telepathygabble/src/tp-channel-iface.c
changeset 10 59927b2d3b75
parent 0 d0f3a028347a
equal deleted inserted replaced
0:d0f3a028347a 10:59927b2d3b75
     1 /*
       
     2  * tp-channel-iface.c - Stubs for Telepathy Channel interface
       
     3  *
       
     4  * Copyright (C) 2006 Collabora Ltd.
       
     5  * 
       
     6  *
       
     7  * This library is free software; you can redistribute it and/or
       
     8  * modify it under the terms of the GNU Lesser General Public
       
     9  * License as published by the Free Software Foundation; either
       
    10  * version 2.1 of the License, or (at your option) any later version.
       
    11  *
       
    12  * This library is distributed in the hope that it will be useful,
       
    13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       
    15  * Lesser General Public License for more details.
       
    16  *
       
    17  * You should have received a copy of the GNU Lesser General Public
       
    18  * License along with this library; if not, write to the Free Software
       
    19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
       
    20  */
       
    21 
       
    22 #include "tp-channel-iface.h"
       
    23 
       
    24 
       
    25 #ifdef EMULATOR
       
    26 #include "libgabble_wsd_solution.h"
       
    27 
       
    28 	GET_STATIC_VAR_FROM_TLS(type,gabble_chnl_iface,GType)
       
    29 	#define type (*GET_WSD_VAR_NAME(type,gabble_chnl_iface, s)())	
       
    30 
       
    31 	GET_STATIC_VAR_FROM_TLS(initialized,gabble_chnl_iface,gboolean)
       
    32 	#define initialized (*GET_WSD_VAR_NAME(initialized,gabble_chnl_iface, s)())	
       
    33 
       
    34 #endif
       
    35 
       
    36 static void
       
    37 tp_channel_iface_base_init (gpointer klass)
       
    38 {
       
    39 #ifndef EMULATOR
       
    40   static gboolean initialized = FALSE;
       
    41 #endif
       
    42 
       
    43   if (!initialized) {
       
    44     GParamSpec *param_spec;
       
    45 
       
    46     initialized = TRUE;
       
    47 
       
    48     param_spec = g_param_spec_string ("object-path", "D-Bus object path",
       
    49                                       "The D-Bus object path used for this "
       
    50                                       "object on the bus.",
       
    51                                       NULL,
       
    52                                       G_PARAM_CONSTRUCT_ONLY |
       
    53                                       G_PARAM_READWRITE |
       
    54                                       G_PARAM_STATIC_NAME |
       
    55                                       G_PARAM_STATIC_BLURB);
       
    56     g_object_interface_install_property (klass, param_spec);
       
    57 
       
    58     param_spec = g_param_spec_string ("channel-type", "Telepathy channel type",
       
    59                                       "The D-Bus interface representing the "
       
    60                                       "type of this channel.",
       
    61                                       NULL,
       
    62                                       G_PARAM_READABLE |
       
    63                                       G_PARAM_STATIC_NAME |
       
    64                                       G_PARAM_STATIC_BLURB);
       
    65     g_object_interface_install_property (klass, param_spec);
       
    66 
       
    67     param_spec = g_param_spec_uint ("handle-type", "Contact handle type",
       
    68                                     "The TpHandleType representing a "
       
    69                                     "contact handle.",
       
    70                                     0, G_MAXUINT32, 0,
       
    71                                     G_PARAM_READABLE |
       
    72                                     G_PARAM_STATIC_NAME |
       
    73                                     G_PARAM_STATIC_BLURB);
       
    74     g_object_interface_install_property (klass, param_spec);
       
    75 
       
    76     param_spec = g_param_spec_uint ("handle", "Contact handle",
       
    77                                     "The GabbleHandle representing the contact "
       
    78                                     "with whom this channel communicates.",
       
    79                                     0, G_MAXUINT32, 0,
       
    80                                     G_PARAM_CONSTRUCT_ONLY |
       
    81                                     G_PARAM_READWRITE |
       
    82                                     G_PARAM_STATIC_NAME |
       
    83                                     G_PARAM_STATIC_BLURB);
       
    84     g_object_interface_install_property (klass, param_spec);
       
    85   }
       
    86 }
       
    87 
       
    88 
       
    89 GType
       
    90 tp_channel_iface_get_type (void)
       
    91 {
       
    92 
       
    93 #ifndef EMULATOR
       
    94   static GType type = 0;
       
    95 #endif
       
    96   
       
    97 
       
    98   if (type == 0) {
       
    99     static const GTypeInfo info = {
       
   100       sizeof (TpChannelIfaceClass),
       
   101       tp_channel_iface_base_init,   /* base_init */
       
   102       NULL,   /* base_finalize */
       
   103       NULL,   /* class_init */
       
   104       NULL,   /* class_finalize */
       
   105       NULL,   /* class_data */
       
   106       0,
       
   107       0,      /* n_preallocs */
       
   108       NULL    /* instance_init */
       
   109     };
       
   110 
       
   111     type = g_type_register_static (G_TYPE_INTERFACE, "TpChannelIface", &info, 0);
       
   112   }
       
   113 
       
   114   return type;
       
   115 }