pidgin: f2ad927f: Add PurpleCertificate request field API.
qulogic at pidgin.im
qulogic at pidgin.im
Mon Feb 27 18:12:27 EST 2012
----------------------------------------------------------------------
Revision: f2ad927fa98dba64f5c3e6c533fd57c8ca8da334
Parent: a20675477f20a92c7670991cd6273519c8f700e6
Author: qulogic at pidgin.im
Date: 02/25/12 22:38:28
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/f2ad927fa98dba64f5c3e6c533fd57c8ca8da334
Changelog:
Add PurpleCertificate request field API.
Changes against parent a20675477f20a92c7670991cd6273519c8f700e6
patched ChangeLog.API
patched libpurple/request.c
patched libpurple/request.h
-------------- next part --------------
============================================================
--- libpurple/request.c da818cd177aa782fd8c9c9bc5f7bcf92cee13b6e
+++ libpurple/request.c 551f66771a9a00291a9822347095b9c490d73cc4
@@ -119,6 +119,11 @@ struct _PurpleRequestField
gsize size;
} image;
+ struct
+ {
+ PurpleCertificate *cert;
+ } certificate;
+
} u;
void *ui_data;
@@ -1329,6 +1334,31 @@ purple_request_field_account_get_filter(
return field->u.account.filter_func;
}
+PurpleRequestField *
+purple_request_field_certificate_new(const char *id, const char *text, PurpleCertificate *cert)
+{
+ PurpleRequestField *field;
+
+ g_return_val_if_fail(id != NULL, NULL);
+ g_return_val_if_fail(text != NULL, NULL);
+ g_return_val_if_fail(cert != NULL, NULL);
+
+ field = purple_request_field_new(id, text, PURPLE_REQUEST_FIELD_CERTIFICATE);
+
+ field->u.certificate.cert = cert;
+
+ return field;
+}
+
+PurpleCertificate *
+purple_request_field_certificate_get_value(const PurpleRequestField *field)
+{
+ g_return_val_if_fail(field != NULL, NULL);
+ g_return_val_if_fail(field->type == PURPLE_REQUEST_FIELD_CERTIFICATE, NULL);
+
+ return field->u.certificate.cert;
+}
+
/* -- */
void *
============================================================
--- libpurple/request.h dd4070ebb0dbe574885c0425c7bca2d7d7cb623a
+++ libpurple/request.h 1c782c4b021cb66bd16561508bbc45fa25c16de8
@@ -76,7 +76,8 @@ typedef enum
PURPLE_REQUEST_FIELD_LIST,
PURPLE_REQUEST_FIELD_LABEL,
PURPLE_REQUEST_FIELD_IMAGE,
- PURPLE_REQUEST_FIELD_ACCOUNT
+ PURPLE_REQUEST_FIELD_ACCOUNT,
+ PURPLE_REQUEST_FIELD_CERTIFICATE
} PurpleRequestFieldType;
@@ -1170,6 +1171,36 @@ PurpleFilterAccountFunc purple_request_f
/*@}*/
/**************************************************************************/
+/** @name Certificate Field API */
+/**************************************************************************/
+/*@{*/
+
+/**
+ * Creates a certificate field.
+ *
+ * @param id The field ID.
+ * @param text The label of the field.
+ * @param cert The certificate of the field.
+ *
+ * @return The new field.
+ */
+PurpleRequestField *purple_request_field_certificate_new(const char *id,
+ const char *text,
+ PurpleCertificate *cert);
+
+/**
+ * Returns the certificate in a certificate field.
+ *
+ * @param field The field.
+ *
+ * @return The certificate.
+ */
+PurpleCertificate *purple_request_field_certificate_get_value(
+ const PurpleRequestField *field);
+
+/*@}*/
+
+/**************************************************************************/
/** @name Request API */
/**************************************************************************/
/*@{*/
============================================================
--- ChangeLog.API a6c0ef933e0535d55645fad5b4ee96b3899f12d9
+++ ChangeLog.API a6c8b3380e958b5b0ffc3b5d4e57655fcc88157d
@@ -34,6 +34,8 @@ version 3.0.0 (??/??/????):
* purple_menu_action_set_data
* purple_menu_action_set_callback
* purple_menu_action_set_children
+ * purple_request_field_certificate_new
+ * purple_request_field_certificate_get_value
* purple_request_field_get_tooltip
* purple_request_field_group_get_fields_list
* purple_request_field_set_tooltip
More information about the Commits
mailing list