Tue, 06 Aug 2024 00:37:03 -0500
Remove the notify API
Testing Done:
Ran the turtles.
Reviewed at https://reviews.imfreedom.org/r/3351/
--- a/libpurple/accounts.c Tue Aug 06 00:14:25 2024 -0500 +++ b/libpurple/accounts.c Tue Aug 06 00:37:03 2024 -0500 @@ -26,7 +26,6 @@ #include "core.h" #include "debug.h" #include "network.h" -#include "notify.h" #include "prefs.h" #include "purpleaccountmanager.h" #include "purpleconversationmanager.h" @@ -487,7 +486,6 @@ */ purple_account_set_enabled(account, FALSE); - purple_notify_close_with_handle(account); purple_request_close_with_handle(account); manager = purple_account_manager_get_default();
--- a/libpurple/connection.c Tue Aug 06 00:14:25 2024 -0500 +++ b/libpurple/connection.c Tue Aug 06 00:37:03 2024 -0500 @@ -24,7 +24,6 @@ #include "connection.h" #include "debug.h" -#include "notify.h" #include "prefs.h" #include "proxy.h" #include "purpleaccount.h" @@ -850,7 +849,6 @@ purple_account_request_close_with_account(priv->account); purple_request_close_with_handle(connection); - purple_notify_close_with_handle(connection); connections_connected = g_list_remove(connections_connected, connection); if(connections_connected == NULL) {
--- a/libpurple/core.c Tue Aug 06 00:14:25 2024 -0500 +++ b/libpurple/core.c Tue Aug 06 00:37:03 2024 -0500 @@ -30,7 +30,6 @@ #include "core.h" #include "debug.h" #include "network.h" -#include "notify.h" #include "plugins.h" #include "prefs.h" #include "proxy.h" @@ -150,7 +149,6 @@ purple_accounts_init(); purple_contact_manager_startup(); purple_presence_manager_startup(); - purple_notify_init(); purple_conversation_manager_startup(); purple_whiteboard_manager_startup(); @@ -219,7 +217,6 @@ purple_idle_manager_shutdown(); purple_whiteboard_manager_shutdown(); purple_conversation_manager_shutdown(); - purple_notify_uninit(); purple_connections_uninit(); purple_presence_manager_shutdown(); purple_accounts_uninit();
--- a/libpurple/meson.build Tue Aug 06 00:14:25 2024 -0500 +++ b/libpurple/meson.build Tue Aug 06 00:37:03 2024 -0500 @@ -6,7 +6,6 @@ 'debug.c', 'image.c', 'network.c', - 'notify.c', 'plugins.c', 'prefs.c', 'proxy.c', @@ -96,7 +95,6 @@ 'debug.h', 'image.h', 'network.h', - 'notify.h', 'plugins.h', 'prefs.h', 'proxy.h', @@ -226,7 +224,6 @@ purple_enumheaders = [ 'connection.h', 'debug.h', - 'notify.h', 'plugins.h', 'purpleaccount.h', 'purpleconnectionerrorinfo.h',
--- a/libpurple/notify.c Tue Aug 06 00:14:25 2024 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,813 +0,0 @@ -/* - * Purple - Internet Messaging Library - * Copyright (C) Pidgin Developers <devel@pidgin.im> - * - * Purple is the legal property of its developers, whose names are too numerous - * to list here. Please refer to the COPYRIGHT file distributed with this - * source distribution. - * - * This library 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. - * - * This library is distributed in the hope that 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 library; if not, see <https://www.gnu.org/licenses/>. - */ - -#include "notify.h" - -static PurpleNotifyUiOps *notify_ui_ops = NULL; -static GList *handles = NULL; - -typedef struct -{ - PurpleNotifyType type; - void *handle; - void *ui_handle; - PurpleNotifyCloseCallback cb; - gpointer cb_user_data; -} PurpleNotifyInfo; - -/* - * Definition of a user info entry - */ -struct _PurpleNotifyUserInfoEntry -{ - char *label; - char *value; - PurpleNotifyUserInfoEntryType type; -}; - -struct _PurpleNotifyUserInfo -{ - GQueue entries; -}; - -/* - * Single column of a search result. - */ -struct _PurpleNotifySearchColumn -{ - char *title; /* Title of the column. */ - gboolean visible; /* Should the column be visible to the user. Defaults to TRUE. */ - -}; - -void * -purple_notify_message(void *handle, PurpleNotifyMessageType type, const char *title, - const char *primary, const char *secondary, - PurpleRequestCommonParameters *cpar, PurpleNotifyCloseCallback cb, - gpointer user_data) -{ - PurpleNotifyUiOps *ops; - - g_return_val_if_fail(primary != NULL, NULL); - - ops = purple_notify_get_ui_ops(); - - if (ops != NULL && ops->notify_message != NULL) { - void *ui_handle = ops->notify_message(type, title, primary, - secondary, cpar); - if (ui_handle != NULL) { - - PurpleNotifyInfo *info = g_new0(PurpleNotifyInfo, 1); - info->type = PURPLE_NOTIFY_MESSAGE; - info->handle = handle; - info->ui_handle = ui_handle; - info->cb = cb; - info->cb_user_data = user_data; - - handles = g_list_append(handles, info); - - return info->ui_handle; - } - - } - - if (cb != NULL) - cb(user_data); - - return NULL; -} - -void * -purple_notify_formatted(void *handle, const char *title, const char *primary, - const char *secondary, const char *text, - PurpleNotifyCloseCallback cb, gpointer user_data) -{ - PurpleNotifyUiOps *ops; - - g_return_val_if_fail(primary != NULL, NULL); - - ops = purple_notify_get_ui_ops(); - - if (ops != NULL && ops->notify_formatted != NULL) { - void *ui_handle = ops->notify_formatted(title, primary, secondary, text); - - if (ui_handle != NULL) { - - PurpleNotifyInfo *info = g_new0(PurpleNotifyInfo, 1); - info->type = PURPLE_NOTIFY_FORMATTED; - info->handle = handle; - info->ui_handle = ui_handle; - info->cb = cb; - info->cb_user_data = user_data; - - handles = g_list_append(handles, info); - - return info->ui_handle; - } - } - - if (cb != NULL) - cb(user_data); - return NULL; -} - -void * -purple_notify_searchresults(PurpleConnection *gc, const char *title, - const char *primary, const char *secondary, - PurpleNotifySearchResults *results, PurpleNotifyCloseCallback cb, - gpointer user_data) -{ - PurpleNotifyUiOps *ops; - - ops = purple_notify_get_ui_ops(); - - if (ops != NULL && ops->notify_searchresults != NULL) { - void *ui_handle = ops->notify_searchresults(gc, title, primary, - secondary, results, user_data); - if (ui_handle != NULL) { - - PurpleNotifyInfo *info = g_new0(PurpleNotifyInfo, 1); - info->type = PURPLE_NOTIFY_SEARCHRESULTS; - info->handle = gc; - info->ui_handle = ui_handle; - info->cb = cb; - info->cb_user_data = user_data; - - handles = g_list_append(handles, info); - - return info->ui_handle; - } - } - - if (cb != NULL) - cb(user_data); - - return NULL; -} - -void -purple_notify_searchresults_free(PurpleNotifySearchResults *results) -{ - GList *l; - - g_return_if_fail(results != NULL); - - for (l = results->buttons; l; l = g_list_delete_link(l, l)) { - PurpleNotifySearchButton *button = l->data; - g_free(button->label); - g_free(button); - } - - for (l = results->rows; l; l = g_list_delete_link(l, l)) { - GList *row = l->data; - g_list_free_full(row, g_free); - } - - for (l = results->columns; l; l = g_list_delete_link(l, l)) { - PurpleNotifySearchColumn *column = l->data; - g_free(column->title); - g_free(column); - } - - g_free(results); -} - -void -purple_notify_searchresults_new_rows(PurpleConnection *gc, - PurpleNotifySearchResults *results, - void *data) -{ - PurpleNotifyUiOps *ops; - - ops = purple_notify_get_ui_ops(); - - if (ops != NULL && ops->notify_searchresults != NULL) { - ops->notify_searchresults_new_rows(gc, results, data); - } -} - -void -purple_notify_searchresults_button_add(PurpleNotifySearchResults *results, - PurpleNotifySearchButtonType type, - PurpleNotifySearchResultsCallback cb) -{ - PurpleNotifySearchButton *button; - - g_return_if_fail(results != NULL); - g_return_if_fail(cb != NULL); - - button = g_new0(PurpleNotifySearchButton, 1); - button->callback = cb; - button->type = type; - - results->buttons = g_list_append(results->buttons, button); -} - - -void -purple_notify_searchresults_button_add_labeled(PurpleNotifySearchResults *results, - const char *label, - PurpleNotifySearchResultsCallback cb) { - PurpleNotifySearchButton *button; - - g_return_if_fail(results != NULL); - g_return_if_fail(cb != NULL); - g_return_if_fail(label != NULL); - g_return_if_fail(*label != '\0'); - - button = g_new0(PurpleNotifySearchButton, 1); - button->callback = cb; - button->type = PURPLE_NOTIFY_BUTTON_LABELED; - button->label = g_strdup(label); - - results->buttons = g_list_append(results->buttons, button); -} - - -PurpleNotifySearchResults * -purple_notify_searchresults_new(void) -{ - PurpleNotifySearchResults *rs = g_new0(PurpleNotifySearchResults, 1); - - return rs; -} - -void -purple_notify_searchresults_column_add(PurpleNotifySearchResults *results, - PurpleNotifySearchColumn *column) -{ - g_return_if_fail(results != NULL); - g_return_if_fail(column != NULL); - - results->columns = g_list_append(results->columns, column); -} - -void purple_notify_searchresults_row_add(PurpleNotifySearchResults *results, - GList *row) -{ - g_return_if_fail(results != NULL); - g_return_if_fail(row != NULL); - - results->rows = g_list_append(results->rows, row); -} - -PurpleNotifySearchColumn * -purple_notify_searchresults_column_new(const char *title) -{ - PurpleNotifySearchColumn *sc; - - g_return_val_if_fail(title != NULL, NULL); - - sc = g_new0(PurpleNotifySearchColumn, 1); - sc->title = g_strdup(title); - sc->visible = TRUE; - - return sc; -} - -const char *purple_notify_searchresult_column_get_title(const PurpleNotifySearchColumn *column) -{ - g_return_val_if_fail(column != NULL, NULL); - - return column->title; -} - -void purple_notify_searchresult_column_set_visible(PurpleNotifySearchColumn *column, gboolean visible) -{ - g_return_if_fail(column != NULL); - - column->visible = visible; -} - -gboolean -purple_notify_searchresult_column_is_visible(const PurpleNotifySearchColumn *column) -{ - g_return_val_if_fail(column != NULL, FALSE); - - return column->visible; -} - -void * -purple_notify_userinfo(PurpleConnection *gc, const char *who, - PurpleNotifyUserInfo *user_info, PurpleNotifyCloseCallback cb, gpointer user_data) -{ - PurpleNotifyUiOps *ops; - - g_return_val_if_fail(who != NULL, NULL); - - ops = purple_notify_get_ui_ops(); - - if (ops != NULL && ops->notify_userinfo != NULL) { - void *ui_handle; - - ui_handle = ops->notify_userinfo(gc, who, user_info); - - if (ui_handle != NULL) { - - PurpleNotifyInfo *info = g_new0(PurpleNotifyInfo, 1); - info->type = PURPLE_NOTIFY_USERINFO; - info->handle = gc; - info->ui_handle = ui_handle; - info->cb = cb; - info->cb_user_data = user_data; - - handles = g_list_append(handles, info); - - return info->ui_handle; - } - } - - if (cb != NULL) - cb(user_data); - - return NULL; -} - -PurpleNotifyUserInfoEntry * -purple_notify_user_info_entry_new(const char *label, const char *value) -{ - PurpleNotifyUserInfoEntry *user_info_entry; - - user_info_entry = g_new0(PurpleNotifyUserInfoEntry, 1); - user_info_entry->label = g_strdup(label); - user_info_entry->value = g_strdup(value); - user_info_entry->type = PURPLE_NOTIFY_USER_INFO_ENTRY_PAIR; - - return user_info_entry; -} - -void -purple_notify_user_info_entry_destroy(PurpleNotifyUserInfoEntry *user_info_entry) -{ - g_return_if_fail(user_info_entry != NULL); - - g_free(user_info_entry->label); - g_free(user_info_entry->value); - g_free(user_info_entry); -} - -PurpleNotifyUserInfo * -purple_notify_user_info_new(void) -{ - PurpleNotifyUserInfo *user_info; - - user_info = g_new0(PurpleNotifyUserInfo, 1); - g_queue_init(&user_info->entries); - - return user_info; -} - -void -purple_notify_user_info_destroy(PurpleNotifyUserInfo *user_info) -{ - GList *l; - - for (l = user_info->entries.head; l != NULL; l = l->next) { - PurpleNotifyUserInfoEntry *user_info_entry = l->data; - - purple_notify_user_info_entry_destroy(user_info_entry); - } - - g_queue_clear(&user_info->entries); - g_free(user_info); -} - -GQueue * -purple_notify_user_info_get_entries(PurpleNotifyUserInfo *user_info) -{ - g_return_val_if_fail(user_info != NULL, NULL); - - return &user_info->entries; -} - -char * -purple_notify_user_info_get_text_with_newline(PurpleNotifyUserInfo *user_info, const char *newline) -{ - GList *l; - GString *text; - - text = g_string_new(""); - - for (l = user_info->entries.head; l != NULL; l = l->next) { - PurpleNotifyUserInfoEntry *user_info_entry = l->data; - /* Add a newline before a section header */ - if (user_info_entry->type == PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_HEADER) - g_string_append(text, newline); - - /* Handle the label/value pair itself */ - /* XXX Todo: Use a larger size for a section header? */ - if (user_info_entry->label) - g_string_append_printf(text, "<b>%s</b>", user_info_entry->label); - if (user_info_entry->label && user_info_entry->value) - g_string_append(text, ": "); - if (user_info_entry->value) - g_string_append(text, user_info_entry->value); - - /* Display a section break as a horizontal line */ - if (user_info_entry->type == PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_BREAK) - g_string_append(text, "<HR>"); - - /* Don't insert a new line before or after a section break; <HR> does that for us */ - if ((user_info_entry->type != PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_BREAK) && - (l->next && ((((PurpleNotifyUserInfoEntry *)(l->next->data))->type != PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_BREAK)))) - g_string_append(text, newline); - - /* Add an extra newline after a section header */ - if (user_info_entry->type == PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_HEADER) - g_string_append(text, newline); - } - - return g_string_free(text, FALSE); -} - - -const gchar * -purple_notify_user_info_entry_get_label(PurpleNotifyUserInfoEntry *user_info_entry) -{ - g_return_val_if_fail(user_info_entry != NULL, NULL); - - return user_info_entry->label; -} - -void -purple_notify_user_info_entry_set_label(PurpleNotifyUserInfoEntry *user_info_entry, const char *label) -{ - g_return_if_fail(user_info_entry != NULL); - - g_free(user_info_entry->label); - user_info_entry->label = g_strdup(label); -} - -const gchar * -purple_notify_user_info_entry_get_value(PurpleNotifyUserInfoEntry *user_info_entry) -{ - g_return_val_if_fail(user_info_entry != NULL, NULL); - - return user_info_entry->value; -} - -void -purple_notify_user_info_entry_set_value(PurpleNotifyUserInfoEntry *user_info_entry, const char *value) -{ - g_return_if_fail(user_info_entry != NULL); - - g_free(user_info_entry->value); - user_info_entry->value = g_strdup(value); -} - -PurpleNotifyUserInfoEntryType -purple_notify_user_info_entry_get_entry_type(PurpleNotifyUserInfoEntry *user_info_entry) -{ - g_return_val_if_fail(user_info_entry != NULL, PURPLE_NOTIFY_USER_INFO_ENTRY_PAIR); - - return user_info_entry->type; -} - -void -purple_notify_user_info_entry_set_entry_type(PurpleNotifyUserInfoEntry *user_info_entry, - PurpleNotifyUserInfoEntryType type) -{ - g_return_if_fail(user_info_entry != NULL); - - user_info_entry->type = type; -} - -void -purple_notify_user_info_add_pair_html(PurpleNotifyUserInfo *user_info, const char *label, const char *value) -{ - PurpleNotifyUserInfoEntry *entry; - - entry = purple_notify_user_info_entry_new(label, value); - g_queue_push_tail(&user_info->entries, entry); -} - -void -purple_notify_user_info_add_pair_plaintext(PurpleNotifyUserInfo *user_info, const char *label, const char *value) -{ - gchar *escaped; - - escaped = g_markup_escape_text(value, -1); - purple_notify_user_info_add_pair_html(user_info, label, escaped); - g_free(escaped); -} - -void -purple_notify_user_info_prepend_pair_html(PurpleNotifyUserInfo *user_info, const char *label, const char *value) -{ - PurpleNotifyUserInfoEntry *entry; - - entry = purple_notify_user_info_entry_new(label, value); - g_queue_push_head(&user_info->entries, entry); -} - -void -purple_notify_user_info_prepend_pair_plaintext(PurpleNotifyUserInfo *user_info, const char *label, const char *value) -{ - gchar *escaped; - - escaped = g_markup_escape_text(value, -1); - purple_notify_user_info_prepend_pair_html(user_info, label, escaped); - g_free(escaped); -} - -void -purple_notify_user_info_remove_entry(PurpleNotifyUserInfo *user_info, PurpleNotifyUserInfoEntry *entry) -{ - g_return_if_fail(user_info != NULL); - g_return_if_fail(entry != NULL); - - g_queue_remove(&user_info->entries, entry); -} - -void -purple_notify_user_info_add_section_header(PurpleNotifyUserInfo *user_info, const char *label) -{ - PurpleNotifyUserInfoEntry *entry; - - entry = purple_notify_user_info_entry_new(label, NULL); - entry->type = PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_HEADER; - - g_queue_push_tail(&user_info->entries, entry); -} - -void -purple_notify_user_info_prepend_section_header(PurpleNotifyUserInfo *user_info, const char *label) -{ - PurpleNotifyUserInfoEntry *entry; - - entry = purple_notify_user_info_entry_new(label, NULL); - entry->type = PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_HEADER; - - g_queue_push_head(&user_info->entries, entry); -} - -void -purple_notify_user_info_add_section_break(PurpleNotifyUserInfo *user_info) -{ - PurpleNotifyUserInfoEntry *entry; - - entry = purple_notify_user_info_entry_new(NULL, NULL); - entry->type = PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_BREAK; - - g_queue_push_tail(&user_info->entries, entry); -} - -void -purple_notify_user_info_prepend_section_break(PurpleNotifyUserInfo *user_info) -{ - PurpleNotifyUserInfoEntry *entry; - - entry = purple_notify_user_info_entry_new(NULL, NULL); - entry->type = PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_BREAK; - - g_queue_push_head(&user_info->entries, entry); -} - -void -purple_notify_user_info_remove_last_item(PurpleNotifyUserInfo *user_info) -{ - PurpleNotifyUserInfoEntry *entry; - - entry = g_queue_pop_tail(&user_info->entries); - if (entry) - purple_notify_user_info_entry_destroy(entry); -} - -static PurpleNotifyUserInfo * -purple_notify_user_info_copy(PurpleNotifyUserInfo *user_info) -{ - PurpleNotifyUserInfo *user_info_copy; - GList *l; - - g_return_val_if_fail(user_info != NULL, NULL); - - user_info_copy = purple_notify_user_info_new(); - - for (l = user_info->entries.head; l != NULL; l = l->next) { - PurpleNotifyUserInfoEntry *new_entry, *user_info_entry = l->data; - - new_entry = purple_notify_user_info_entry_new(user_info_entry->label, - user_info_entry->value); - new_entry->type = user_info_entry->type; - g_queue_push_tail(&user_info_copy->entries, new_entry); - } - - return user_info_copy; -} - -GType -purple_notify_user_info_get_type(void) -{ - static GType type = 0; - - if (type == 0) { - type = g_boxed_type_register_static("PurpleNotifyUserInfo", - (GBoxedCopyFunc)purple_notify_user_info_copy, - (GBoxedFreeFunc)purple_notify_user_info_destroy); - } - - return type; -} - -void * -purple_notify_uri(void *handle, const char *uri) -{ - PurpleNotifyUiOps *ops; - - g_return_val_if_fail(uri != NULL, NULL); - - ops = purple_notify_get_ui_ops(); - - if (ops != NULL && ops->notify_uri != NULL) { - - void *ui_handle = ops->notify_uri(uri); - - if (ui_handle != NULL) { - - PurpleNotifyInfo *info = g_new0(PurpleNotifyInfo, 1); - info->type = PURPLE_NOTIFY_URI; - info->handle = handle; - info->ui_handle = ui_handle; - - handles = g_list_append(handles, info); - - return info->ui_handle; - } - } - - return NULL; -} - -gboolean -purple_notify_is_valid_ui_handle(void *ui_handle, PurpleNotifyType *type) -{ - GList *it; - - if (ui_handle == NULL) - return FALSE; - - for (it = handles; it != NULL; it = g_list_next(it)) { - PurpleNotifyInfo *info = it->data; - - if (info->ui_handle != ui_handle) - continue; - - if (type != NULL) - *type = info->type; - return TRUE; - } - - return FALSE; -} - -void -purple_notify_close(G_GNUC_UNUSED PurpleNotifyType type, void *ui_handle) -{ - GList *l; - PurpleNotifyUiOps *ops; - - g_return_if_fail(ui_handle != NULL); - - ops = purple_notify_get_ui_ops(); - - for (l = handles; l != NULL; l = l->next) { - PurpleNotifyInfo *info = l->data; - - if (info->ui_handle == ui_handle) { - handles = g_list_delete_link(handles, l); - - if (ops != NULL && ops->close_notify != NULL) - ops->close_notify(info->type, ui_handle); - - if (info->cb != NULL) - info->cb(info->cb_user_data); - - g_free(info); - - break; - } - } -} - -void -purple_notify_close_with_handle(void *handle) -{ - GList *l, *prev = NULL; - PurpleNotifyUiOps *ops; - - g_return_if_fail(handle != NULL); - - ops = purple_notify_get_ui_ops(); - - for (l = handles; l != NULL; l = prev ? prev->next : handles) { - PurpleNotifyInfo *info = l->data; - - if (info->handle == handle) { - handles = g_list_delete_link(handles, l); - - if (ops != NULL && ops->close_notify != NULL) - ops->close_notify(info->type, info->ui_handle); - - if (info->cb != NULL) - info->cb(info->cb_user_data); - - g_free(info); - } else - prev = l; - } -} - -static PurpleNotifyUiOps * -purple_notify_ui_ops_copy(PurpleNotifyUiOps *ops) -{ - PurpleNotifyUiOps *ops_new; - - g_return_val_if_fail(ops != NULL, NULL); - - ops_new = g_new(PurpleNotifyUiOps, 1); - *ops_new = *ops; - - return ops_new; -} - -GType -purple_notify_ui_ops_get_type(void) -{ - static GType type = 0; - - if (type == 0) { - type = g_boxed_type_register_static("PurpleNotifyUiOps", - (GBoxedCopyFunc)purple_notify_ui_ops_copy, - (GBoxedFreeFunc)g_free); - } - - return type; -} - -static PurpleNotifySearchButton * -purple_notify_search_button_copy(PurpleNotifySearchButton *button) -{ - PurpleNotifySearchButton *button_new; - - g_return_val_if_fail(button != NULL, NULL); - - button_new = g_new(PurpleNotifySearchButton, 1); - *button_new = *button; - - return button_new; -} - -GType -purple_notify_search_button_get_type(void) -{ - static GType type = 0; - - if (type == 0) { - type = g_boxed_type_register_static("PurpleNotifySearchButton", - (GBoxedCopyFunc)purple_notify_search_button_copy, - (GBoxedFreeFunc)g_free); - } - - return type; -} - -void -purple_notify_set_ui_ops(PurpleNotifyUiOps *ops) -{ - notify_ui_ops = ops; -} - -PurpleNotifyUiOps * -purple_notify_get_ui_ops(void) -{ - return notify_ui_ops; -} - -void -purple_notify_init(void) -{ -} - -void -purple_notify_uninit(void) -{ -}
--- a/libpurple/notify.h Tue Aug 06 00:14:25 2024 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1022 +0,0 @@ -/* - * Purple - Internet Messaging Library - * Copyright (C) Pidgin Developers <devel@pidgin.im> - * - * Purple is the legal property of its developers, whose names are too numerous - * to list here. Please refer to the COPYRIGHT file distributed with this - * source distribution. - * - * This library 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. - * - * This library is distributed in the hope that 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 library; if not, see <https://www.gnu.org/licenses/>. - */ - -#if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION) -# error "only <purple.h> may be included directly" -#endif - -#ifndef PURPLE_NOTIFY_H -#define PURPLE_NOTIFY_H - -#include <stdlib.h> -#include <glib-object.h> -#include <glib.h> - -#include "purpleversion.h" - -/** - * PurpleNotifyUserInfoEntry: - * - * A entry for the user information. - * - * Since: 2.0 - */ -typedef struct _PurpleNotifyUserInfoEntry PurpleNotifyUserInfoEntry; - -/** - * PurpleNotifyUserInfo: - * - * A collection of user information entries. - * - * Since: 2.0 - */ -#define PURPLE_TYPE_NOTIFY_USER_INFO (purple_notify_user_info_get_type()) -typedef struct _PurpleNotifyUserInfo PurpleNotifyUserInfo; - -#define PURPLE_TYPE_NOTIFY_SEARCH_BUTTON (purple_notify_search_button_get_type()) -typedef struct _PurpleNotifySearchButton PurpleNotifySearchButton; - -/** - * PurpleNotifySearchColumn: - * - * Single column of a search result. - */ -typedef struct _PurpleNotifySearchColumn PurpleNotifySearchColumn; - -#include "connection.h" -#include "request.h" - -typedef struct _PurpleNotifySearchResults PurpleNotifySearchResults; - -#define PURPLE_TYPE_NOTIFY_UI_OPS (purple_notify_ui_ops_get_type()) -typedef struct _PurpleNotifyUiOps PurpleNotifyUiOps; - -/** - * PurpleNotifyCloseCallback: - * @user_data: User specified data. - * - * Notification close callbacks. - */ -typedef void (*PurpleNotifyCloseCallback) (gpointer user_data); - - -/** - * PurpleNotifyType: - * @PURPLE_NOTIFY_MESSAGE: Message notification. - * @PURPLE_NOTIFY_FORMATTED: Formatted text. - * @PURPLE_NOTIFY_SEARCHRESULTS: Buddy search results. - * @PURPLE_NOTIFY_USERINFO: Formatted userinfo text. - * @PURPLE_NOTIFY_URI: URI notification or display. - * - * Notification types. - */ -typedef enum -{ - PURPLE_NOTIFY_MESSAGE = 0, - PURPLE_NOTIFY_FORMATTED, - PURPLE_NOTIFY_SEARCHRESULTS, - PURPLE_NOTIFY_USERINFO, - PURPLE_NOTIFY_URI -} PurpleNotifyType; - - -/** - * PurpleNotifyMessageType: - * @PURPLE_NOTIFY_MSG_ERROR: Error notification. - * @PURPLE_NOTIFY_MSG_WARNING: Warning notification. - * @PURPLE_NOTIFY_MSG_INFO: Information notification. - * - * Notification message types. - */ -typedef enum -{ - PURPLE_NOTIFY_MSG_ERROR = 0, - PURPLE_NOTIFY_MSG_WARNING, - PURPLE_NOTIFY_MSG_INFO - -} PurpleNotifyMessageType; - - -/** - * PurpleNotifySearchButtonType: - * @PURPLE_NOTIFY_BUTTON_LABELED: special use, see - * purple_notify_searchresults_button_add_labeled() - * @PURPLE_NOTIFY_BUTTON_CONTINUE: A continue button. - * @PURPLE_NOTIFY_BUTTON_ADD: An add button. - * @PURPLE_NOTIFY_BUTTON_INFO: An info button. - * @PURPLE_NOTIFY_BUTTON_IM: An IM button. - * @PURPLE_NOTIFY_BUTTON_JOIN: A join button. - * @PURPLE_NOTIFY_BUTTON_INVITE: An invite button. - * - * Constant values to define the type of buttons to use in a request dialog. - * These are used by user interfaces to label and possibly add an icon to the - * button. - */ -typedef enum -{ - PURPLE_NOTIFY_BUTTON_LABELED = 0, - PURPLE_NOTIFY_BUTTON_CONTINUE = 1, - PURPLE_NOTIFY_BUTTON_ADD, - PURPLE_NOTIFY_BUTTON_INFO, - PURPLE_NOTIFY_BUTTON_IM, - PURPLE_NOTIFY_BUTTON_JOIN, - PURPLE_NOTIFY_BUTTON_INVITE -} PurpleNotifySearchButtonType; - - -/** - * PurpleNotifySearchResults: - * @columns: List of the search column objects. - * @rows: List of rows in the result. - * @buttons: List of buttons to display. - * - * Search results object. - */ -struct _PurpleNotifySearchResults -{ - GList *columns; - GList *rows; - GList *buttons; - -}; - -/** - * PurpleNotifyUserInfoEntryType: - * @PURPLE_NOTIFY_USER_INFO_ENTRY_PAIR: A label and its value. - * @PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_BREAK: Separates two sections. - * @PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_HEADER: Create a header for the - * current section. - * - * Types of PurpleNotifyUserInfoEntry objects - */ -typedef enum -{ - PURPLE_NOTIFY_USER_INFO_ENTRY_PAIR = 0, - PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_BREAK, - PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_HEADER -} PurpleNotifyUserInfoEntryType; - - - -/** - * PurpleNotifySearchResultsCallback: - * @c: the PurpleConnection passed to purple_notify_searchresults - * @row: the contents of the selected row - * @user_data: User defined data. - * - * Callback for a button in a search result. - */ -typedef void (*PurpleNotifySearchResultsCallback)(PurpleConnection *c, GList *row, - gpointer user_data); - - -/** - * PurpleNotifySearchButton: - * @type: The type of search button that will be used. - * @callback: Function to be called when clicked. - * @label: only for PURPLE_NOTIFY_BUTTON_LABELED - * - * Definition of a button. - */ -struct _PurpleNotifySearchButton -{ - PurpleNotifySearchButtonType type; - PurpleNotifySearchResultsCallback callback; - char *label; -}; - -/** - * PurpleNotifyUiOps: - * @notify_message: UI op for purple_notify_message(). - * @notify_formatted: UI op for purple_notify_formatted(). - * @notify_searchresults: UI op for purple_notify_searchresults(). - * @notify_searchresults_new_rows: UI op for - * purple_notify_searchresults_new_rows(). - * @notify_userinfo: UI op for purple_notify_userinfo(). - * @notify_uri: UI op for purple_notify_uri(). - * @close_notify: UI op for purple_notify_close() and - * purple_notify_close_with_handle(). - * - * Notification UI operations. - */ -struct _PurpleNotifyUiOps -{ - void *(*notify_message)(PurpleNotifyMessageType type, const char *title, - const char *primary, const char *secondary, - PurpleRequestCommonParameters *cpar); - - void *(*notify_formatted)(const char *title, const char *primary, - const char *secondary, const char *text); - - void *(*notify_searchresults)(PurpleConnection *gc, const char *title, - const char *primary, const char *secondary, - PurpleNotifySearchResults *results, gpointer user_data); - - void (*notify_searchresults_new_rows)(PurpleConnection *gc, - PurpleNotifySearchResults *results, - void *data); - - void *(*notify_userinfo)(PurpleConnection *gc, const char *who, - PurpleNotifyUserInfo *user_info); - - void *(*notify_uri)(const char *uri); - - void (*close_notify)(PurpleNotifyType type, void *ui_handle); - - /*< private >*/ - void (*_purple_reserved1)(void); - void (*_purple_reserved2)(void); - void (*_purple_reserved3)(void); - void (*_purple_reserved4)(void); -}; - - -G_BEGIN_DECLS - - -/**************************************************************************/ -/* Search results notification API */ -/**************************************************************************/ - -/** - * purple_notify_searchresults: - * @gc: The PurpleConnection handle associated with the information. - * @title: The title of the message. If this is NULL, the title - * will be "Search Results." - * @primary: The main point of the message. - * @secondary: The secondary information. - * @results: The PurpleNotifySearchResults instance. - * @cb: (scope call): The callback to call when the user closes - * the notification. - * @user_data: The data to pass to the close callback and any other - * callback associated with a button. - * - * Displays results from a buddy search. This can be, for example, - * a window with a list of all found buddies, where you are given the - * option of adding buddies to your buddy list. - * - * Returns: A UI-specific handle. - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -void *purple_notify_searchresults(PurpleConnection *gc, const char *title, const char *primary, const char *secondary, PurpleNotifySearchResults *results, PurpleNotifyCloseCallback cb, gpointer user_data); - -/** - * purple_notify_searchresults_free: - * @results: The PurpleNotifySearchResults to free. - * - * Frees a PurpleNotifySearchResults object. - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -void purple_notify_searchresults_free(PurpleNotifySearchResults *results); - -/** - * purple_notify_searchresults_new_rows: - * @gc: The PurpleConnection structure. - * @results: The PurpleNotifySearchResults structure. - * @data: Data returned by the purple_notify_searchresults(). - * - * Replace old rows with the new. Reuse an existing window. - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -void purple_notify_searchresults_new_rows(PurpleConnection *gc, PurpleNotifySearchResults *results, void *data); - - -/** - * purple_notify_searchresults_button_add: - * @results: The search results object. - * @type: Type of the button. (TODO: Only one button of a given type - * can be displayed.) - * @cb: (scope call): Function that will be called on the click event. - * - * Adds a stock button that will be displayed in the search results dialog. - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -void purple_notify_searchresults_button_add(PurpleNotifySearchResults *results, PurpleNotifySearchButtonType type, PurpleNotifySearchResultsCallback cb); - - -/** - * purple_notify_searchresults_button_add_labeled: - * @results: The search results object - * @label: The label to display - * @cb: (scope call): Function that will be called on the click event - * - * Adds a plain labelled button that will be displayed in the search results - * dialog. - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -void purple_notify_searchresults_button_add_labeled(PurpleNotifySearchResults *results, const char *label, PurpleNotifySearchResultsCallback cb); - - -/** - * purple_notify_searchresults_new: - * - * Returns a newly created search results object. - * - * Returns: (transfer full): The new search results object. - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -PurpleNotifySearchResults *purple_notify_searchresults_new(void); - -/** - * purple_notify_searchresults_column_new: - * @title: Title of the column. NOTE: Title will get g_strdup()ed. - * - * Returns a newly created search result column object. The column defaults - * to being visible. - * - * Returns: (transfer full): The new search column object. - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -PurpleNotifySearchColumn *purple_notify_searchresults_column_new(const char *title); - -/** - * purple_notify_searchresult_column_get_title: - * @column: The search column object. - * - * Returns the title of the column - * - * Returns: The title of the column - * - * Since: 3.0 - */ -PURPLE_AVAILABLE_IN_3_0 -const char *purple_notify_searchresult_column_get_title(const PurpleNotifySearchColumn *column); - -/** - * purple_notify_searchresult_column_set_visible: - * @column: The search column object. - * @visible: TRUE if visible, or FALSE if not. - * - * Sets whether or not a search result column is visible. - * - * Since: 3.0 - */ -PURPLE_AVAILABLE_IN_3_0 -void purple_notify_searchresult_column_set_visible(PurpleNotifySearchColumn *column, gboolean visible); - -/** - * purple_notify_searchresult_column_is_visible: - * @column: The search column object. - * - * Returns whether or not a search result column is visible. - * - * Returns: TRUE if the search result column is visible. FALSE otherwise. - * - * Since: 3.0 - */ -PURPLE_AVAILABLE_IN_3_0 -gboolean purple_notify_searchresult_column_is_visible(const PurpleNotifySearchColumn *column); - -/** - * purple_notify_searchresults_column_add: - * @results: The result object to which the column will be added. - * @column: The column that will be added to the result object. - * - * Adds a new column to the search result object. - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -void purple_notify_searchresults_column_add(PurpleNotifySearchResults *results, PurpleNotifySearchColumn *column); - -/** - * purple_notify_searchresults_row_add: - * @results: The search results object. - * @row: (element-type utf8) (transfer full): The row of the results. - * - * Adds a new row of the results to the search results object. - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -void purple_notify_searchresults_row_add(PurpleNotifySearchResults *results, GList *row); - -/**************************************************************************/ -/* Notification API */ -/**************************************************************************/ - -/** - * purple_notify_message: - * @handle: The plugin or connection handle. - * @type: The notification type. - * @title: The title of the message. - * @primary: The main point of the message. - * @secondary: The secondary information. - * @cpar: The #PurpleRequestCommonParameters associated with this - * request, or %NULL if none is. - * @cb: (scope call): The callback to call when the user closes - * the notification. - * @user_data: The data to pass to the callback. - * - * Displays a notification message to the user. - * - * Returns: A UI-specific handle. - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -void *purple_notify_message(void *handle, PurpleNotifyMessageType type, const char *title, const char *primary, const char *secondary, PurpleRequestCommonParameters *cpar, PurpleNotifyCloseCallback cb, gpointer user_data); - -/** - * purple_notify_formatted: - * @handle: The plugin or connection handle. - * @title: The title of the message. - * @primary: The main point of the message. - * @secondary: The secondary information. - * @text: The formatted text. - * @cb: (scope call): The callback to call when the user closes - * the notification. - * @user_data: The data to pass to the callback. - * - * Displays a notification with formatted text. - * - * The text is essentially a stripped-down format of HTML, the same that - * IMs may send. - * - * Returns: A UI-specific handle. - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -void *purple_notify_formatted(void *handle, const char *title, const char *primary, const char *secondary, const char *text, PurpleNotifyCloseCallback cb, gpointer user_data); - -/** - * purple_notify_userinfo: - * @gc: The PurpleConnection handle associated with the information. - * @who: The username associated with the information. - * @user_info: The PurpleNotifyUserInfo which contains the information - * @cb: (scope call): The callback to call when the user closes the - * notification. - * @user_data: The data to pass to the callback. - * - * Displays user information with formatted text, passing information giving - * the connection and username from which the user information came. - * - * The text is essentially a stripped-down format of HTML, the same that - * IMs may send. - * - * Returns: A UI-specific handle. - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -void *purple_notify_userinfo(PurpleConnection *gc, const char *who, PurpleNotifyUserInfo *user_info, PurpleNotifyCloseCallback cb, gpointer user_data); - -/** - * purple_notify_search_button_get_type: - * - * Returns: The #GType for #PurpleNotifiySearchButton boxed structure. - * - * Since: 3.0 - */ -PURPLE_AVAILABLE_IN_3_0 -GType purple_notify_search_button_get_type(void); - -/** - * purple_notify_user_info_get_type: - * - * Returns: The #GType for the #PurpleNotifyUserInfo boxed structure. - * - * Since: 3.0 - */ -PURPLE_AVAILABLE_IN_3_0 -GType purple_notify_user_info_get_type(void); - -/** - * purple_notify_user_info_new: - * - * Create a new PurpleNotifyUserInfo which is suitable for passing to - * purple_notify_userinfo() - * - * Returns: A new PurpleNotifyUserInfo, which the caller must destroy when done - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -PurpleNotifyUserInfo *purple_notify_user_info_new(void); - -/** - * purple_notify_user_info_destroy: - * @user_info: The PurpleNotifyUserInfo - * - * Destroy a PurpleNotifyUserInfo - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -void purple_notify_user_info_destroy(PurpleNotifyUserInfo *user_info); - -/** - * purple_notify_user_info_get_entries: - * @user_info: The PurpleNotifyUserInfo - * - * Retrieve the array of PurpleNotifyUserInfoEntry objects from a - * PurpleNotifyUserInfo - * - * This GQueue may be manipulated directly with normal GQueue functions such - * as g_queue_push_tail(). Only PurpleNotifyUserInfoEntry are allowed in the - * queue. If a PurpleNotifyUserInfoEntry item is added to the queue, it - * should not be freed by the caller; PurpleNotifyUserInfo will free it when - * destroyed. - * - * To remove a PurpleNotifyUserInfoEntry, use - * purple_notify_user_info_remove_entry(). Do not use the GQueue directly. - * - * Returns: (transfer none): A GQueue of PurpleNotifyUserInfoEntry objects. - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -GQueue *purple_notify_user_info_get_entries(PurpleNotifyUserInfo *user_info); - -/** - * purple_notify_user_info_get_text_with_newline: - * @user_info: The PurpleNotifyUserInfo - * @newline: The separation character - * - * Create a textual representation of a PurpleNotifyUserInfo, separating - * entries with newline - * - * Returns: (transfer full): The text. - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -char *purple_notify_user_info_get_text_with_newline(PurpleNotifyUserInfo *user_info, const char *newline); - -/** - * purple_notify_user_info_add_pair_html: - * @user_info: The PurpleNotifyUserInfo - * @label: A label, which for example might be displayed by a UI with a colon - * after it ("Status:"). Do not include a colon. If %NULL, value will be - * displayed without a label. - * @value: The value, which might be displayed by a UI after the label. This - * should be valid HTML. If you want to insert plaintext then use - * purple_notify_user_info_add_pair_plaintext(), instead. If this is - * %NULL the label will still be displayed; the UI should treat label as - * independent and not include a colon if it would otherwise. - * - * Add a label/value pair to a #PurpleNotifyUserInfo object. - * #PurpleNotifyUserInfo keeps track of the order in which pairs are added. - * - * Since: 3.0 - */ -PURPLE_AVAILABLE_IN_3_0 -void purple_notify_user_info_add_pair_html(PurpleNotifyUserInfo *user_info, const char *label, const char *value); - -/** - * purple_notify_user_info_add_pair_plaintext: - * @user_info: The PurpleNotifyUserInfo - * @label: A label, which for example might be displayed by a UI with a colon - * after it ("Status:"). Do not include a colon. If %NULL, value will be - * displayed without a label. - * @value: The value, which might be displayed by a UI after the label. This - * will be escaped to produce valid HTML. If you want to insert HTML - * then use purple_notify_user_info_add_pair_html(), instead. If this is - * %NULL the label will still be displayed; the UI should treat label as - * independent and not include a colon if it would otherwise. - * - * Add a label/value pair to a #PurpleNotifyUserInfo object. - * #PurpleNotifyUserInfo keeps track of the order in which pairs are added. - * - * Like purple_notify_user_info_add_pair_html(), but value should be plaintext - * and will be escaped using g_markup_escape_text(). - * - * Since: 2.8 - */ -PURPLE_AVAILABLE_IN_2_8 -void purple_notify_user_info_add_pair_plaintext(PurpleNotifyUserInfo *user_info, const char *label, const char *value); - -/** - * purple_notify_user_info_prepend_pair_html: - * @user_info: The PurpleNotifyUserInfo - * @label: A label, which for example might be displayed by a UI with a colon - * after it ("Status:"). Do not include a colon. If %NULL, value will be - * displayed without a label. - * @value: The value, which might be displayed by a UI after the label. This - * should be valid HTML. If you want to insert plaintext then use - * purple_notify_user_info_prepend_pair_plaintext(), instead. If this is - * %NULL the label will still be displayed; the UI should treat label as - * independent and not include a colon if it would otherwise. - * - * Like purple_notify_user_info_add_pair_html(), but the pair is inserted - * at the beginning of the list. - * - * Since: 3.0 - */ -PURPLE_AVAILABLE_IN_3_0 -void purple_notify_user_info_prepend_pair_html(PurpleNotifyUserInfo *user_info, const char *label, const char *value); - -/** - * purple_notify_user_info_prepend_pair_plaintext: - * @user_info: The PurpleNotifyUserInfo - * @label: A label, which for example might be displayed by a UI with a colon - * after it ("Status:"). Do not include a colon. If %NULL, value will be - * displayed without a label. - * @value: The value, which might be displayed by a UI after the label. This - * will be escaped to produce valid HTML. If you want to insert HTML - * then use purple_notify_user_info_prepend_pair_html(), instead. If - * this is %NULL the label will still be displayed; the UI should treat - * label as independent and not include a colon if it would otherwise. - * - * Like purple_notify_user_info_prepend_pair_html(), but value should be - * plaintext and will be escaped using g_markup_escape_text(). - * - * Since: 3.0 - */ -PURPLE_AVAILABLE_IN_3_0 -void purple_notify_user_info_prepend_pair_plaintext(PurpleNotifyUserInfo *user_info, const char *label, const char *value); - -/** - * purple_notify_user_info_remove_entry: - * @user_info: The PurpleNotifyUserInfo - * @user_info_entry: The PurpleNotifyUserInfoEntry - * - * Remove a PurpleNotifyUserInfoEntry from a PurpleNotifyUserInfo object - * without freeing the entry. - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -void purple_notify_user_info_remove_entry(PurpleNotifyUserInfo *user_info, PurpleNotifyUserInfoEntry *user_info_entry); - -/** - * purple_notify_user_info_entry_new: - * @label: A label, which for example might be displayed by a UI - * with a colon after it ("Status:"). Do not include a - * colon. If NULL, value will be displayed without a label. - * @value: The value, which might be displayed by a UI after the - * label. If NULL, label will still be displayed; the UI - * should then treat label as independent and not include a - * colon if it would otherwise. - * - * Create a new PurpleNotifyUserInfoEntry - * - * If added to a PurpleNotifyUserInfo object, this should not be free()'d, - * as PurpleNotifyUserInfo will do so when destroyed. - * purple_notify_user_info_add_pair_html(), - * purple_notify_user_info_add_pair_plaintext(), - * purple_notify_user_info_prepend_pair_html() and - * purple_notify_user_info_prepend_pair_plaintext() are convenience - * methods for creating entries and adding them to a PurpleNotifyUserInfo. - * - * Returns: (transfer full): A new PurpleNotifyUserInfoEntry - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -PurpleNotifyUserInfoEntry *purple_notify_user_info_entry_new(const char *label, const char *value); - -/** - * purple_notify_user_info_entry_destroy: - * @user_info_entry: The PurpleNotifyUserInfoEntry - * - * Destroy a PurpleNotifyUserInfoEntry - * - * Since: 3.0 - */ -PURPLE_AVAILABLE_IN_3_0 -void purple_notify_user_info_entry_destroy(PurpleNotifyUserInfoEntry *user_info_entry); - -/** - * purple_notify_user_info_add_section_break: - * @user_info: The PurpleNotifyUserInfo - * - * Add a section break. A UI might display this as a horizontal line. - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -void purple_notify_user_info_add_section_break(PurpleNotifyUserInfo *user_info); - -/** - * purple_notify_user_info_prepend_section_break: - * @user_info: The PurpleNotifyUserInfo - * - * Prepend a section break. A UI might display this as a horizontal line. - * - * Since: 2.5 - */ -PURPLE_AVAILABLE_IN_2_5 -void purple_notify_user_info_prepend_section_break(PurpleNotifyUserInfo *user_info); - -/** - * purple_notify_user_info_add_section_header: - * @user_info: The PurpleNotifyUserInfo - * @label: The name of the section - * - * Add a section header. A UI might display this in a different font - * from other text. - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -void purple_notify_user_info_add_section_header(PurpleNotifyUserInfo *user_info, const char *label); - -/** - * purple_notify_user_info_prepend_section_header: - * @user_info: The PurpleNotifyUserInfo - * @label: The name of the section - * - * Prepend a section header. A UI might display this in a different font - * from other text. - * - * Since: 2.5 - */ -PURPLE_AVAILABLE_IN_2_5 -void purple_notify_user_info_prepend_section_header(PurpleNotifyUserInfo *user_info, const char *label); - -/** - * purple_notify_user_info_remove_last_item: - * @user_info: The PurpleNotifyUserInfo - * - * Remove the last item which was added to a PurpleNotifyUserInfo. This - * could be used to remove a section header which is not needed. - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -void purple_notify_user_info_remove_last_item(PurpleNotifyUserInfo *user_info); - -/** - * purple_notify_user_info_entry_get_label: - * @user_info_entry: The PurpleNotifyUserInfoEntry - * - * Get the label for a PurpleNotifyUserInfoEntry - * - * Returns: The label - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -const gchar *purple_notify_user_info_entry_get_label(PurpleNotifyUserInfoEntry *user_info_entry); - -/** - * purple_notify_user_info_entry_set_label: - * @user_info_entry: The PurpleNotifyUserInfoEntry - * @label: The label - * - * Set the label for a PurpleNotifyUserInfoEntry - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -void purple_notify_user_info_entry_set_label(PurpleNotifyUserInfoEntry *user_info_entry, const char *label); - -/** - * purple_notify_user_info_entry_get_value: - * @user_info_entry: The PurpleNotifyUserInfoEntry - * - * Get the value for a PurpleNotifyUserInfoEntry - * - * Returns: The value - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -const gchar *purple_notify_user_info_entry_get_value(PurpleNotifyUserInfoEntry *user_info_entry); - -/** - * purple_notify_user_info_entry_set_value: - * @user_info_entry: The PurpleNotifyUserInfoEntry - * @value: The value - * - * Set the value for a PurpleNotifyUserInfoEntry - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -void purple_notify_user_info_entry_set_value(PurpleNotifyUserInfoEntry *user_info_entry, const char *value); - -/** - * purple_notify_user_info_entry_get_entry_type: - * @user_info_entry: The PurpleNotifyUserInfoEntry - * - * Get the type of a PurpleNotifyUserInfoEntry - * - * Returns: The PurpleNotifyUserInfoEntryType - * - * Since: 3.0 - */ -PURPLE_AVAILABLE_IN_3_0 -PurpleNotifyUserInfoEntryType purple_notify_user_info_entry_get_entry_type( - PurpleNotifyUserInfoEntry *user_info_entry); - -/** - * purple_notify_user_info_entry_set_entry_type: - * @user_info_entry: The PurpleNotifyUserInfoEntry - * @type: The PurpleNotifyUserInfoEntryType - * - * Set the type of a PurpleNotifyUserInfoEntry - * - * Since: 3.0 - */ -PURPLE_AVAILABLE_IN_3_0 -void purple_notify_user_info_entry_set_entry_type( - PurpleNotifyUserInfoEntry *user_info_entry, PurpleNotifyUserInfoEntryType type); - -/** - * purple_notify_uri: - * @handle: The plugin or connection handle. - * @uri: The URI to display or go to. - * - * Opens a URI or somehow presents it to the user. - * - * Returns: A UI-specific handle, if any. This may only be presented if - * the UI code displays a dialog instead of a webpage, or something - * similar. - * - * Since: 2.0 - * - * Deprecated: 3.0 - */ -PURPLE_DEPRECATED_FOR(purple_ui_open_uri) -void *purple_notify_uri(void *handle, const char *uri); - -/** - * purple_notify_is_valid_ui_handle: - * @ui_handle: The UI handle. - * @type: The pointer to variable, where request type may be stored - * (may be %NULL). - * - * Checks, if passed UI handle is valid. - * - * Returns: TRUE, if handle is valid, FALSE otherwise. - * - * Since: 3.0 - */ -PURPLE_AVAILABLE_IN_3_0 -gboolean -purple_notify_is_valid_ui_handle(void *ui_handle, PurpleNotifyType *type); - -/** - * purple_notify_close: - * @type: The notification type. - * @ui_handle: The notification UI handle. - * - * Closes a notification. - * - * This should be used only by the UI operation functions and part of the - * core. - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -void purple_notify_close(PurpleNotifyType type, void *ui_handle); - -/** - * purple_notify_close_with_handle: - * @handle: The handle. - * - * Closes all notifications registered with the specified handle. - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -void purple_notify_close_with_handle(void *handle); - -/** - * purple_notify_info: - * @handle: The plugin or connection handle. - * @title: The title of the message. - * @primary: The main point of the message. - * @secondary: The secondary information. - * @cpar: The #PurpleRequestCommonParameters associated with this request, or - * %NULL if none is. - * - * A wrapper for purple_notify_message() that displays an information message. - */ -#define purple_notify_info(handle, title, primary, secondary, cpar) \ - purple_notify_message((handle), PURPLE_NOTIFY_MSG_INFO, (title), \ - (primary), (secondary), (cpar), NULL, NULL) - -/** - * purple_notify_warning: - * @handle: The plugin or connection handle. - * @title: The title of the message. - * @primary: The main point of the message. - * @secondary: The secondary information. - * @cpar: The #PurpleRequestCommonParameters associated with this request, or - * %NULL if none is. - * - * A wrapper for purple_notify_message() that displays a warning message. - */ -#define purple_notify_warning(handle, title, primary, secondary, cpar) \ - purple_notify_message((handle), PURPLE_NOTIFY_MSG_WARNING, (title), \ - (primary), (secondary), (cpar), NULL, NULL) - -/** - * purple_notify_error: - * @handle: The plugin or connection handle. - * @title: The title of the message. - * @primary: The main point of the message. - * @secondary: The secondary information. - * @cpar: The #PurpleRequestCommonParameters associated with this request, or - * %NULL if none is. - * - * A wrapper for purple_notify_message() that displays an error message. - */ -#define purple_notify_error(handle, title, primary, secondary, cpar) \ - purple_notify_message((handle), PURPLE_NOTIFY_MSG_ERROR, (title), \ - (primary), (secondary), (cpar), NULL, NULL) - -/**************************************************************************/ -/* UI Registration Functions */ -/**************************************************************************/ - -/** - * purple_notify_ui_ops_get_type: - * - * Returns: The #GType for the #PurpleNotifyUiOps boxed structure. - * - * Since: 3.0 - */ -PURPLE_AVAILABLE_IN_3_0 -GType purple_notify_ui_ops_get_type(void); - -/** - * purple_notify_set_ui_ops: - * @ops: The UI operations structure. - * - * Sets the UI operations structure to be used when displaying a - * notification. - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -void purple_notify_set_ui_ops(PurpleNotifyUiOps *ops); - -/** - * purple_notify_get_ui_ops: - * - * Returns the UI operations structure to be used when displaying a - * notification. - * - * Returns: The UI operations structure. - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -PurpleNotifyUiOps *purple_notify_get_ui_ops(void); - -/**************************************************************************/ -/* Notify Subsystem */ -/**************************************************************************/ - -/** - * purple_notify_init: - * - * Initializes the notify subsystem. - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -void purple_notify_init(void); - -/** - * purple_notify_uninit: - * - * Uninitializes the notify subsystem. - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -void purple_notify_uninit(void); - - -G_END_DECLS - -#endif /* PURPLE_NOTIFY_H */
--- a/libpurple/plugins.c Tue Aug 06 00:14:25 2024 -0500 +++ b/libpurple/plugins.c Tue Aug 06 00:37:03 2024 -0500 @@ -26,12 +26,12 @@ #include "core.h" #include "debug.h" -#include "notify.h" #include "plugins.h" #include "prefs.h" #include "purpleenums.h" #include "purplenotification.h" #include "purplenotificationmanager.h" +#include "request.h" #include "signals.h" #include "util.h" #ifdef _WIN32 @@ -130,7 +130,6 @@ /* cancel any pending dialogs the plugin has */ purple_request_close_with_handle(plugin); - purple_notify_close_with_handle(plugin); purple_signals_disconnect_by_handle(plugin); purple_signals_unregister_by_instance(plugin);
--- a/libpurple/proxy.c Tue Aug 06 00:14:25 2024 -0500 +++ b/libpurple/proxy.c Tue Aug 06 00:37:03 2024 -0500 @@ -23,7 +23,6 @@ #include <glib/gi18n-lib.h> #include "debug.h" -#include "notify.h" #include "prefs.h" #include "proxy.h" #include "purplegio.h"
--- a/libpurple/purpleaccount.c Tue Aug 06 00:14:25 2024 -0500 +++ b/libpurple/purpleaccount.c Tue Aug 06 00:37:03 2024 -0500 @@ -28,7 +28,6 @@ #include "core.h" #include "debug.h" #include "network.h" -#include "notify.h" #include "prefs.h" #include "purpleaddcontactrequest.h" #include "purpleconversationmanager.h"
--- a/libpurple/purpleconversation.c Tue Aug 06 00:14:25 2024 -0500 +++ b/libpurple/purpleconversation.c Tue Aug 06 00:37:03 2024 -0500 @@ -25,7 +25,6 @@ #include "purpleconversation.h" #include "debug.h" -#include "notify.h" #include "purpleconversationmanager.h" #include "purpleconversationmember.h" #include "purpleenums.h"
--- a/libpurple/purplecredentialmanager.c Tue Aug 06 00:14:25 2024 -0500 +++ b/libpurple/purplecredentialmanager.c Tue Aug 06 00:37:03 2024 -0500 @@ -26,7 +26,6 @@ #include "core.h" #include "debug.h" -#include "notify.h" #include "prefs.h" #include "purplenoopcredentialprovider.h" #include "purplenotification.h"
--- a/libpurple/purpleprotocol.c Tue Aug 06 00:14:25 2024 -0500 +++ b/libpurple/purpleprotocol.c Tue Aug 06 00:37:03 2024 -0500 @@ -22,10 +22,10 @@ #include "purpleprotocol.h" -#include "notify.h" #include "prefs.h" #include "purpleaccountmanager.h" #include "purpleenums.h" +#include "request.h" #include "signals.h" enum { @@ -263,7 +263,6 @@ * clean up? I kind of want to delete them... - gk 2021-03-03 */ purple_request_close_with_handle(protocol); - purple_notify_close_with_handle(protocol); purple_signals_disconnect_by_handle(protocol); purple_signals_unregister_by_instance(protocol);
--- a/libpurple/request.c Tue Aug 06 00:14:25 2024 -0500 +++ b/libpurple/request.c Tue Aug 06 00:37:03 2024 -0500 @@ -23,7 +23,6 @@ #include <glib/gi18n-lib.h> #include "glibcompat.h" -#include "notify.h" #include "purplemarkup.h" #include "request.h" #include "debug.h" @@ -807,7 +806,6 @@ ops = purple_request_get_ui_ops(); - purple_notify_close_with_handle(info->ui_handle); purple_request_close_with_handle(info->ui_handle); if (ops != NULL && ops->close_request != NULL)
--- a/libpurple/util.c Tue Aug 06 00:14:25 2024 -0500 +++ b/libpurple/util.c Tue Aug 06 00:37:03 2024 -0500 @@ -30,7 +30,6 @@ #include "core.h" #include "debug.h" -#include "notify.h" #include "prefs.h" #include "purpleaccountmanager.h" #include "purpleconversation.h"