Exemplo n.º 1
0
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));
}
Exemplo n.º 2
0
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);
}
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_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);
}