2 * mcp-account-manager-goa.c
4 * McpAccountManagerGoa - a Mission Control plugin to expose GNOME Online
5 * Accounts with chat capabilities (e.g. Facebook) to Mission Control
7 * Copyright (C) 2010-2014 Collabora Ltd.
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
23 * Danielle Madeley <danielle.madeley@collabora.co.uk>
27 #include "mcp-account-manager-goa.h"
29 #define GOA_API_IS_SUBJECT_TO_CHANGE /* awesome! */
33 #define GET_PRIVATE(self) (((McpAccountManagerGoa *) self)->priv)
34 #define DECLARE_GASYNC_CALLBACK(name) \
35 static void name (GObject *, GAsyncResult *, gpointer);
37 #define PLUGIN_NAME "goa"
38 #define PLUGIN_DESCRIPTION "Provide Telepathy Accounts from GOA"
39 #define PLUGIN_PROVIDER EMPATHY_GOA_PROVIDER
41 #define INITIAL_COMMENT "Parameters of GOA Telepathy accounts"
43 #ifdef MCP_API_VERSION_5_18
45 # define RESTRICTIONS TpStorageRestrictionFlags
46 # define WAS_CONST /* nothing */
47 /* Its historical value was based on the KEYRING priority which no longer
48 * exists. Using a large number is OK, because it uses unusual account names
49 * which are unlikely to collide. */
50 # define PLUGIN_PRIORITY (10010)
51 /* McpAccountStorageSetResult enum is defined by MC */
53 #else /* MC 5.16 or older */
55 # define RESTRICTIONS guint
56 # define WAS_CONST const
57 # define PLUGIN_PRIORITY (MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_KEYRING + 10)
59 /* we use this in helper functions */
61 MCP_ACCOUNT_STORAGE_SET_RESULT_FAILED
,
62 MCP_ACCOUNT_STORAGE_SET_RESULT_UNCHANGED
,
63 MCP_ACCOUNT_STORAGE_SET_RESULT_CHANGED
64 } McpAccountStorageSetResult
;
66 #endif /* MC 5.16 or older */
68 static void account_storage_iface_init (McpAccountStorageIface
*iface
);
70 G_DEFINE_TYPE_WITH_CODE (McpAccountManagerGoa
,
71 mcp_account_manager_goa
,
73 G_IMPLEMENT_INTERFACE (MCP_TYPE_ACCOUNT_STORAGE
,
74 account_storage_iface_init
))
76 struct _McpAccountManagerGoaPrivate
81 GHashTable
*accounts
; /* alloc'ed string -> ref'ed GoaObject */
89 mcp_account_manager_goa_dispose (GObject
*self
)
91 McpAccountManagerGoaPrivate
*priv
= GET_PRIVATE (self
);
93 tp_clear_object (&priv
->client
);
95 G_OBJECT_CLASS (mcp_account_manager_goa_parent_class
)->dispose (self
);
100 mcp_account_manager_goa_finalize (GObject
*self
)
102 McpAccountManagerGoaPrivate
*priv
= GET_PRIVATE (self
);
104 g_hash_table_unref (priv
->accounts
);
105 g_key_file_free (priv
->store
);
106 g_free (priv
->filename
);
108 G_OBJECT_CLASS (mcp_account_manager_goa_parent_class
)->finalize (self
);
113 mcp_account_manager_goa_class_init (McpAccountManagerGoaClass
*klass
)
115 GObjectClass
*gobject_class
= G_OBJECT_CLASS (klass
);
117 gobject_class
->dispose
= mcp_account_manager_goa_dispose
;
118 gobject_class
->finalize
= mcp_account_manager_goa_finalize
;
120 g_type_class_add_private (gobject_class
,
121 sizeof (McpAccountManagerGoaPrivate
));
125 get_tp_parameters (GoaAccount
*account
)
127 GHashTable
*params
= g_hash_table_new_full (g_str_hash
, g_str_equal
,
129 const char *type
= goa_account_get_provider_type (account
);
131 #define PARAM(key, value) g_hash_table_insert (params, key, g_strdup (value));
133 if (!tp_strdiff (type
, "google"))
135 PARAM ("manager", "gabble");
136 PARAM ("protocol", "jabber");
137 PARAM ("Icon", "im-google-talk");
138 PARAM ("Service", "google-talk");
140 PARAM ("param-account", goa_account_get_identity (account
));
141 PARAM ("param-server", "talk.google.com");
142 PARAM ("param-fallback-servers",
143 "talkx.l.google.com;"
144 "talkx.l.google.com:443,oldssl;"
145 "talkx.l.google.com:80");
146 PARAM ("param-extra-certificate-identities", "talk.google.com");
147 PARAM ("param-require-encryption", "true");
151 DEBUG ("Unknown account type %s", type
);
152 g_hash_table_unref (params
);
156 /* generic properties */
157 PARAM ("DisplayName", goa_account_get_presentation_identity (account
));
166 get_tp_account_name (GoaAccount
*account
)
168 GHashTable
*params
= get_tp_parameters (account
);
169 const char *type
= goa_account_get_provider_type (account
);
170 const char *id
= goa_account_get_id (account
);
176 name
= g_strdup_printf ("%s/%s/goa_%s_%s",
177 (char *) g_hash_table_lookup (params
, "manager"),
178 (char *) g_hash_table_lookup (params
, "protocol"),
181 g_hash_table_unref (params
);
187 object_chat_changed_cb (GoaObject
*object
,
189 McpAccountManagerGoa
*self
)
191 GoaAccount
*account
= goa_object_peek_account (object
);
192 char *name
= get_tp_account_name (account
);
198 enabled
= (goa_object_peek_chat (object
) != NULL
);
200 DEBUG ("%s %s", name
, enabled
? "enabled" : "disabled");
202 if (self
->priv
->ready
)
203 mcp_account_storage_emit_toggled (MCP_ACCOUNT_STORAGE (self
),
208 _new_account (McpAccountManagerGoa
*self
,
211 GoaAccount
*account
= goa_object_peek_account (object
);
212 char *account_name
= get_tp_account_name (account
);
214 if (account_name
== NULL
)
217 /* @account_name now is owned by the hash table */
218 g_hash_table_insert (self
->priv
->accounts
, account_name
,
219 g_object_ref (object
));
221 if (self
->priv
->ready
)
222 mcp_account_storage_emit_created (MCP_ACCOUNT_STORAGE (self
),
225 tp_g_signal_connect_object (object
, "notify::chat",
226 G_CALLBACK (object_chat_changed_cb
), self
, 0);
230 DECLARE_GASYNC_CALLBACK (_goa_client_new_cb
);
233 load_store (McpAccountManagerGoa
*self
)
235 GError
*error
= NULL
;
237 if (!g_key_file_load_from_file (self
->priv
->store
, self
->priv
->filename
,
238 G_KEY_FILE_KEEP_COMMENTS
, &error
))
242 DEBUG ("Failed to load keyfile, creating a new one: %s", error
->message
);
244 dir
= g_path_get_dirname (self
->priv
->filename
);
246 g_mkdir_with_parents (dir
, 0700);
249 g_key_file_set_comment (self
->priv
->store
, NULL
, NULL
, INITIAL_COMMENT
,
252 g_error_free (error
);
257 mcp_account_manager_goa_init (McpAccountManagerGoa
*self
)
259 DEBUG ("GOA MC plugin initialised");
261 self
->priv
= G_TYPE_INSTANCE_GET_PRIVATE (self
,
262 MCP_TYPE_ACCOUNT_MANAGER_GOA
, McpAccountManagerGoaPrivate
);
264 #ifdef MCP_API_VERSION_5_18
265 /* the ready callback no longer exists, we may emit signals at any time */
266 self
->priv
->ready
= TRUE
;
269 self
->priv
->accounts
= g_hash_table_new_full (g_str_hash
, g_str_equal
,
270 g_free
, g_object_unref
);
272 goa_client_new (NULL
, _goa_client_new_cb
, self
);
275 self
->priv
->store
= g_key_file_new ();
276 self
->priv
->filename
= g_build_filename (g_get_user_data_dir (), "telepathy",
277 "mission-control", "accounts-goa.cfg", NULL
);
284 _account_added_cb (GoaClient
*client
,
286 McpAccountManagerGoa
*self
)
288 _new_account (self
, object
);
293 _account_removed_cb (GoaClient
*client
,
295 McpAccountManagerGoa
*self
)
297 GoaAccount
*account
= goa_object_peek_account (object
);
298 char *name
= get_tp_account_name (account
);
303 if (self
->priv
->ready
)
304 mcp_account_storage_emit_deleted (MCP_ACCOUNT_STORAGE (self
), name
);
306 g_hash_table_remove (self
->priv
->accounts
, name
);
312 _goa_client_new_cb (GObject
*obj
,
313 GAsyncResult
*result
,
316 McpAccountManagerGoa
*self
= user_data
;
317 GList
*accounts
, *ptr
;
318 GError
*error
= NULL
;
320 self
->priv
->client
= goa_client_new_finish (result
, &error
);
324 DEBUG ("Failed to connect to GOA");
328 accounts
= goa_client_get_accounts (self
->priv
->client
);
330 for (ptr
= accounts
; ptr
!= NULL
; ptr
= ptr
->next
)
332 _new_account (self
, ptr
->data
);
335 g_list_free_full (accounts
, g_object_unref
);
337 g_signal_connect (self
->priv
->client
, "account-added",
338 G_CALLBACK (_account_added_cb
), self
);
339 g_signal_connect (self
->priv
->client
, "account-removed",
340 G_CALLBACK (_account_removed_cb
), self
);
345 mcp_account_manager_goa_list (WAS_CONST McpAccountStorage
*self
,
346 WAS_CONST McpAccountManager
*am
)
348 McpAccountManagerGoaPrivate
*priv
= GET_PRIVATE (self
);
349 GList
*accounts
= NULL
;
355 g_hash_table_iter_init (&iter
, priv
->accounts
);
356 while (g_hash_table_iter_next (&iter
, &key
, NULL
))
357 accounts
= g_list_prepend (accounts
, g_strdup (key
));
363 #ifdef MCP_API_VERSION_5_18
366 get_item (McpAccountManagerGoa
*self
,
367 McpAccountManager
*am
,
370 const GVariantType
*type
)
376 GVariant
*ret
= NULL
;
378 DEBUG ("%s: %s, %s", G_STRFUNC
, acc
, key
);
380 object
= g_hash_table_lookup (self
->priv
->accounts
, acc
);
382 g_return_val_if_fail (object
!= NULL
, NULL
);
384 account
= goa_object_peek_account (object
);
386 g_return_val_if_fail (account
!= NULL
, NULL
);
388 if (!tp_strdiff (key
, "Enabled"))
390 return g_variant_ref_sink (g_variant_new_boolean (
391 !goa_account_get_chat_disabled (account
)));
394 bits
= get_tp_parameters (account
);
396 esc
= g_hash_table_lookup (bits
, key
);
399 esc
= g_key_file_get_value (self
->priv
->store
, acc
, key
, NULL
);
401 esc
= g_strdup (esc
);
405 ret
= mcp_account_manager_unescape_variant_from_keyfile (am
,
411 g_hash_table_unref (bits
);
416 mcp_account_manager_goa_get_attribute (McpAccountStorage
*self
,
417 McpAccountManager
*am
,
419 const gchar
*attribute
,
420 const GVariantType
*type
,
421 McpAttributeFlags
*flags
)
423 return get_item (MCP_ACCOUNT_MANAGER_GOA (self
), am
, acc
, attribute
, type
);
427 mcp_account_manager_goa_get_parameter (McpAccountStorage
*storage
,
428 McpAccountManager
*am
,
430 const gchar
*parameter
,
431 const GVariantType
*type
,
432 McpParameterFlags
*flags
)
437 key
= g_strdup_printf ("param-%s", parameter
);
439 ret
= get_item (MCP_ACCOUNT_MANAGER_GOA (storage
), am
, acc
, key
, type
);
444 #else /* MC 5.16 or older */
447 get_enabled (WAS_CONST McpAccountStorage
*self
,
448 WAS_CONST McpAccountManager
*am
,
452 mcp_account_manager_set_value (am
, acc
, "Enabled",
453 goa_account_get_chat_disabled (account
) == FALSE
? "true" : "false");
457 mcp_account_manager_goa_get (WAS_CONST McpAccountStorage
*self
,
458 WAS_CONST McpAccountManager
*am
,
462 McpAccountManagerGoaPrivate
*priv
= GET_PRIVATE (self
);
466 DEBUG ("%s: %s, %s", G_STRFUNC
, acc
, key
);
468 object
= g_hash_table_lookup (priv
->accounts
, acc
);
473 account
= goa_object_peek_account (object
);
481 GHashTable
*params
= get_tp_parameters (account
);
488 /* Properties from GOA */
489 g_hash_table_iter_init (&iter
, params
);
490 while (g_hash_table_iter_next (&iter
, &k
, &value
))
491 mcp_account_manager_set_value (am
, acc
, k
, value
);
493 g_hash_table_unref (params
);
495 /* Stored properties */
496 keys
= g_key_file_get_keys (priv
->store
, acc
, &nkeys
, NULL
);
498 for (i
= 0; i
< nkeys
; i
++)
500 gchar
*v
= g_key_file_get_value (priv
->store
, acc
, keys
[i
], NULL
);
504 mcp_account_manager_set_value (am
, acc
, keys
[i
], v
);
512 get_enabled (self
, am
, acc
, account
);
514 else if (!tp_strdiff (key
, "Enabled"))
516 get_enabled (self
, am
, acc
, account
);
520 /* get a specific key */
521 GHashTable
*params
= get_tp_parameters (account
);
524 value
= g_hash_table_lookup (params
, key
);
527 value
= g_key_file_get_value (priv
->store
, acc
, key
, NULL
);
529 value
= g_strdup (value
);
531 mcp_account_manager_set_value (am
, acc
, key
, value
);
533 g_hash_table_unref (params
);
540 #endif /* MC 5.16 or older */
544 account_is_in_goa (WAS_CONST McpAccountStorage
*self
,
545 const gchar
*account
)
547 McpAccountManagerGoaPrivate
*priv
= GET_PRIVATE (self
);
549 return (g_hash_table_lookup (priv
->accounts
, account
) != NULL
);
552 static McpAccountStorageSetResult
553 mcp_account_manager_goa_set_enabled (McpAccountStorage
*self
,
554 const gchar
*account
,
557 McpAccountManagerGoaPrivate
*priv
= GET_PRIVATE (self
);
561 object
= g_hash_table_lookup (priv
->accounts
, account
);
564 return MCP_ACCOUNT_STORAGE_SET_RESULT_FAILED
;
566 acc
= goa_object_peek_account (object
);
569 return MCP_ACCOUNT_STORAGE_SET_RESULT_FAILED
;
571 if (goa_account_get_chat_disabled (acc
) == !enabled
)
572 return MCP_ACCOUNT_STORAGE_SET_RESULT_UNCHANGED
;
574 goa_account_set_chat_disabled (acc
, !enabled
);
575 return MCP_ACCOUNT_STORAGE_SET_RESULT_CHANGED
;
578 #ifdef MCP_API_VERSION_5_18
580 static McpAccountStorageSetResult
581 mcp_account_manager_goa_set_attribute (McpAccountStorage
*storage
,
582 McpAccountManager
*am
,
583 const gchar
*account_name
,
584 const gchar
*attribute
,
586 McpAttributeFlags flags
)
588 McpAccountManagerGoaPrivate
*priv
= GET_PRIVATE (storage
);
589 McpAccountStorageSetResult ret
= MCP_ACCOUNT_STORAGE_SET_RESULT_FAILED
;
591 g_return_val_if_fail (account_is_in_goa (storage
, account_name
),
592 MCP_ACCOUNT_STORAGE_SET_RESULT_FAILED
);
594 if (!tp_strdiff (attribute
, "Enabled"))
596 g_return_val_if_fail (
597 g_variant_classify (value
) == G_VARIANT_CLASS_BOOLEAN
,
598 MCP_ACCOUNT_STORAGE_SET_RESULT_FAILED
);
600 return mcp_account_manager_goa_set_enabled (storage
, account_name
,
601 g_variant_get_boolean (value
));
603 /* FIXME: filter out manager, protocol, Icon, Service? */
604 else if (value
!= NULL
)
606 gchar
*esc
= mcp_account_manager_escape_variant_for_keyfile (am
,
611 return MCP_ACCOUNT_STORAGE_SET_RESULT_FAILED
;
613 old
= g_key_file_get_value (priv
->store
, account_name
, attribute
, NULL
);
615 if (tp_strdiff (old
, esc
))
617 g_key_file_set_value (priv
->store
, account_name
, attribute
, esc
);
618 ret
= MCP_ACCOUNT_STORAGE_SET_RESULT_CHANGED
;
622 ret
= MCP_ACCOUNT_STORAGE_SET_RESULT_UNCHANGED
;
630 if (g_key_file_has_key (priv
->store
, account_name
, attribute
, NULL
))
632 g_key_file_remove_key (priv
->store
, account_name
, attribute
, NULL
);
633 ret
= MCP_ACCOUNT_STORAGE_SET_RESULT_CHANGED
;
637 ret
= MCP_ACCOUNT_STORAGE_SET_RESULT_UNCHANGED
;
644 static McpAccountStorageSetResult
645 mcp_account_manager_goa_set_parameter (McpAccountStorage
*storage
,
646 McpAccountManager
*am
,
647 const gchar
*account_name
,
648 const gchar
*parameter
,
650 McpParameterFlags flags
)
652 McpAccountManagerGoaPrivate
*priv
= GET_PRIVATE (storage
);
653 McpAccountStorageSetResult ret
= MCP_ACCOUNT_STORAGE_SET_RESULT_FAILED
;
658 g_return_val_if_fail (account_is_in_goa (storage
, account_name
),
659 MCP_ACCOUNT_STORAGE_SET_RESULT_FAILED
);
661 key
= g_strdup_printf ("param-%s", parameter
);
663 /* FIXME: filter out reserved keys for this account? */
666 esc
= mcp_account_manager_escape_variant_for_keyfile (am
,
672 old
= g_key_file_get_value (priv
->store
, account_name
, key
, NULL
);
674 if (tp_strdiff (esc
, old
))
676 g_key_file_set_value (priv
->store
, account_name
, key
, esc
);
677 ret
= MCP_ACCOUNT_STORAGE_SET_RESULT_CHANGED
;
681 ret
= MCP_ACCOUNT_STORAGE_SET_RESULT_UNCHANGED
;
686 if (g_key_file_has_key (priv
->store
, account_name
, key
, NULL
))
688 g_key_file_remove_key (priv
->store
, account_name
, key
, NULL
);
689 ret
= MCP_ACCOUNT_STORAGE_SET_RESULT_CHANGED
;
693 ret
= MCP_ACCOUNT_STORAGE_SET_RESULT_UNCHANGED
;
705 #else /* MC 5.16 or older */
708 mcp_account_manager_goa_set (const McpAccountStorage
*self
,
709 const McpAccountManager
*am
,
710 const gchar
*account
,
714 McpAccountManagerGoaPrivate
*priv
= GET_PRIVATE (self
);
716 if (!account_is_in_goa (self
, account
))
719 DEBUG ("%s: (%s, %s, %s)", G_STRFUNC
, account
, key
, val
);
721 if (!tp_strdiff (key
, "Enabled"))
723 if (mcp_account_manager_goa_set_enabled ((McpAccountStorage
*) self
,
725 !tp_strdiff (val
, "true")) != MCP_ACCOUNT_STORAGE_SET_RESULT_FAILED
)
732 g_key_file_set_value (priv
->store
, account
, key
, val
);
734 g_key_file_remove_key (priv
->store
, account
, key
, NULL
);
736 /* Pretend we save everything so MC won't save this in accounts.cfg */
740 #endif /* MC 5.16 or older */
744 mcp_account_manager_goa_delete (WAS_CONST McpAccountStorage
*self
,
745 WAS_CONST McpAccountManager
*am
,
746 const gchar
*account
,
749 McpAccountManagerGoaPrivate
*priv
= GET_PRIVATE (self
);
751 if (!account_is_in_goa (self
, account
))
754 DEBUG ("%s: (%s, %s)", G_STRFUNC
, account
, key
);
758 g_key_file_remove_group (priv
->store
, account
, NULL
);
762 g_key_file_remove_key (priv
->store
, account
, key
, NULL
);
765 /* Pretend we deleted everything */
770 #ifdef MCP_API_VERSION_5_18
772 mcp_account_manager_goa_delete_async (McpAccountStorage
*self
,
773 McpAccountManager
*am
,
774 const gchar
*account_name
,
775 GCancellable
*cancellable
,
776 GAsyncReadyCallback callback
,
779 GTask
*task
= g_task_new (self
, cancellable
, callback
, user_data
);
781 if (mcp_account_manager_goa_delete (self
, am
, account_name
, NULL
))
783 g_task_return_boolean (task
, TRUE
);
787 g_task_return_new_error (task
, TP_ERROR
, TP_ERROR_DOES_NOT_EXIST
,
788 "Account does not exist in GOA");
791 g_object_unref (task
);
795 mcp_account_manager_goa_delete_finish (McpAccountStorage
*self
,
799 return g_task_propagate_boolean (G_TASK (res
), error
);
801 #endif /* MC >= 5.18 API */
804 commit (McpAccountManagerGoa
*self
)
806 McpAccountManagerGoaPrivate
*priv
= self
->priv
;
809 GError
*error
= NULL
;
811 DEBUG ("Save config to %s", priv
->filename
);
813 data
= g_key_file_to_data (priv
->store
, &len
, &error
);
816 DEBUG ("Failed to get data from store: %s", error
->message
);
818 g_error_free (error
);
822 if (!g_file_set_contents (priv
->filename
, data
, len
, &error
))
824 DEBUG ("Failed to write file: %s", error
->message
);
827 g_error_free (error
);
836 #ifdef MCP_API_VERSION_5_18
838 mcp_account_manager_goa_commit (McpAccountStorage
*self
,
839 McpAccountManager
*am
,
840 const gchar
*account
)
842 return commit (MCP_ACCOUNT_MANAGER_GOA (self
));
846 mcp_account_manager_goa_commit (const McpAccountStorage
*self
,
847 const McpAccountManager
*am
)
849 return commit (MCP_ACCOUNT_MANAGER_GOA (self
));
854 #ifndef MCP_API_VERSION_5_18
855 /* removed in 5.18, MC should now be ready to receive signals at any time */
857 mcp_account_manager_goa_ready (WAS_CONST McpAccountStorage
*self
,
858 WAS_CONST McpAccountManager
*am
)
860 McpAccountManagerGoaPrivate
*priv
= GET_PRIVATE (self
);
868 mcp_account_manager_goa_get_restrictions (WAS_CONST McpAccountStorage
*self
,
869 const gchar
*account
)
871 return TP_STORAGE_RESTRICTION_FLAG_CANNOT_SET_PARAMETERS
|
872 TP_STORAGE_RESTRICTION_FLAG_CANNOT_SET_SERVICE
;
877 mcp_account_manager_goa_get_identifier (WAS_CONST McpAccountStorage
*self
,
881 McpAccountManagerGoaPrivate
*priv
= GET_PRIVATE (self
);
885 object
= g_hash_table_lookup (priv
->accounts
, acc
);
886 g_return_if_fail (object
!= NULL
);
888 account
= goa_object_peek_account (object
);
889 g_return_if_fail (account
!= NULL
);
891 g_value_init (identifier
, G_TYPE_STRING
);
892 g_value_set_string (identifier
, goa_account_get_id (account
));
897 account_storage_iface_init (McpAccountStorageIface
*iface
)
899 iface
->name
= PLUGIN_NAME
;
900 iface
->desc
= PLUGIN_DESCRIPTION
;
901 iface
->priority
= PLUGIN_PRIORITY
;
902 iface
->provider
= PLUGIN_PROVIDER
;
904 #define IMPLEMENT(x) iface->x = mcp_account_manager_goa_##x
908 IMPLEMENT (get_restrictions
);
909 IMPLEMENT (get_identifier
);
911 #ifdef MCP_API_VERSION_5_18
912 IMPLEMENT (delete_async
);
913 IMPLEMENT (delete_finish
);
914 IMPLEMENT (get_attribute
);
915 IMPLEMENT (get_parameter
);
916 IMPLEMENT (set_attribute
);
917 IMPLEMENT (set_parameter
);