/* 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 * This program 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 program 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 program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA struct _PurpleActionMenu { /****************************************************************************** *****************************************************************************/ purple_action_menu_new(const gchar *label, GCallback callback, gpointer data, PurpleActionMenu *act = g_new(PurpleActionMenu, 1); act->label = g_strdup(label); act->callback = callback; act->children = children; purple_action_menu_free(PurpleActionMenu *act) { g_return_if_fail(act != NULL); purple_action_menu_set_children(act, NULL); purple_action_menu_get_label(const PurpleActionMenu *act) { g_return_val_if_fail(act != NULL, NULL); purple_action_menu_get_callback(const PurpleActionMenu *act) { g_return_val_if_fail(act != NULL, NULL); purple_action_menu_get_data(const PurpleActionMenu *act) { g_return_val_if_fail(act != NULL, NULL); purple_action_menu_get_children(const PurpleActionMenu *act) { g_return_val_if_fail(act != NULL, NULL); purple_action_menu_set_label(PurpleActionMenu *act, const gchar *label) { g_return_if_fail(act != NULL); act->label = g_strdup(label); purple_action_menu_set_callback(PurpleActionMenu *act, GCallback callback) { g_return_if_fail(act != NULL); act->callback = callback; purple_action_menu_set_data(PurpleActionMenu *act, gpointer data) { g_return_if_fail(act != NULL); purple_action_menu_set_children(PurpleActionMenu *act, GList *children) { g_return_if_fail(act != NULL); g_list_free_full(act->children, (GDestroyNotify)purple_action_menu_free); act->children = children; /****************************************************************************** *****************************************************************************/ purple_protocol_action_new(const gchar* label, PurpleProtocolActionCallback callback) { PurpleProtocolAction *action; g_return_val_if_fail(label != NULL, NULL); g_return_val_if_fail(callback != NULL, NULL); action = g_new0(PurpleProtocolAction, 1); action->label = g_strdup(label); action->callback = callback; purple_protocol_action_free(PurpleProtocolAction *action) { g_return_if_fail(action != NULL); purple_protocol_action_copy(PurpleProtocolAction *action) { g_return_val_if_fail(action != NULL, NULL); return purple_protocol_action_new(action->label, action->callback); purple_protocol_action_copy, purple_protocol_action_free