void gaim_notify_close(GaimNotifyType type, void *ui_handle) { GList *l; GaimNotifyUiOps *ops; g_return_if_fail(ui_handle != NULL); ops = gaim_notify_get_ui_ops(); for (l = handles; l != NULL; l = l->next) { GaimNotifyInfo *info = l->data; if (info->ui_handle == ui_handle) { handles = g_list_remove(handles, info); 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 gaim_notify_close_with_handle(void *handle) { GList *l, *l_next; GaimNotifyUiOps *ops; g_return_if_fail(handle != NULL); ops = gaim_notify_get_ui_ops(); for (l = handles; l != NULL; l = l_next) { GaimNotifyInfo *info = l->data; l_next = l->next; if (info->handle == handle) { handles = g_list_remove(handles, info); 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); } } }
void * gaim_notify_email(void *handle, const char *subject, const char *from, const char *to, const char *url, GCallback cb, void *user_data) { GaimNotifyUiOps *ops; ops = gaim_get_notify_ui_ops(); if (ops != NULL && ops->notify_email != NULL) { GaimNotifyInfo *info; info = g_new0(GaimNotifyInfo, 1); info->type = GAIM_NOTIFY_EMAIL; info->handle = handle; info->ui_handle = ops->notify_email(subject, from, to, url, cb, user_data); handles = g_list_append(handles, info); return info->ui_handle; } return NULL; }
void * gaim_notify_uri(void *handle, const char *uri) { GaimNotifyUiOps *ops; g_return_val_if_fail(uri != NULL, NULL); ops = gaim_notify_get_ui_ops(); if (ops != NULL && ops->notify_uri != NULL) { GaimNotifyInfo *info; info = g_new0(GaimNotifyInfo, 1); info->type = GAIM_NOTIFY_URI; info->handle = handle; info->ui_handle = ops->notify_uri(uri); if (info->ui_handle != NULL) { handles = g_list_append(handles, info); return info->ui_handle; } else { g_free(info); return NULL; } } return NULL; }
void * gaim_notify_message(void *handle, GaimNotifyMsgType type, const char *title, const char *primary, const char *secondary, GCallback cb, void *user_data) { GaimNotifyUiOps *ops; g_return_val_if_fail(primary != NULL, NULL); ops = gaim_get_notify_ui_ops(); if (ops != NULL && ops->notify_message != NULL) { GaimNotifyInfo *info; info = g_new0(GaimNotifyInfo, 1); info->type = GAIM_NOTIFY_MESSAGE; info->handle = handle; info->ui_handle = ops->notify_message(type, title, primary, secondary, cb, user_data); handles = g_list_append(handles, info); return info->ui_handle; } return NULL; }
void * gaim_notify_formatted(void *handle, const char *title, const char *primary, const char *secondary, const char *text, GCallback cb, void *user_data) { GaimNotifyUiOps *ops; g_return_val_if_fail(primary != NULL, NULL); ops = gaim_get_notify_ui_ops(); if (ops != NULL && ops->notify_formatted != NULL) { GaimNotifyInfo *info; info = g_new0(GaimNotifyInfo, 1); info->type = GAIM_NOTIFY_FORMATTED; info->handle = handle; info->ui_handle = ops->notify_formatted(title, primary, secondary, text, cb, user_data); handles = g_list_append(handles, info); return info->ui_handle; } return NULL; }
void * gaim_notify_emails(void *handle, size_t count, gboolean detailed, const char **subjects, const char **froms, const char **tos, const char **urls, GaimNotifyCloseCallback cb, gpointer user_data) { GaimNotifyUiOps *ops; g_return_val_if_fail(count != 0, NULL); if (count == 1) { return gaim_notify_email(handle, (subjects == NULL ? NULL : *subjects), (froms == NULL ? NULL : *froms), (tos == NULL ? NULL : *tos), (urls == NULL ? NULL : *urls), cb, user_data); } ops = gaim_notify_get_ui_ops(); if (ops != NULL && ops->notify_emails != NULL) { GaimNotifyInfo *info; info = g_new0(GaimNotifyInfo, 1); info->type = GAIM_NOTIFY_EMAILS; info->handle = handle; info->ui_handle = ops->notify_emails(handle, count, detailed, subjects, froms, tos, urls); info->cb = cb; info->cb_user_data = user_data; if (info->ui_handle != NULL) { handles = g_list_append(handles, info); return info->ui_handle; } else { if (info->cb != NULL) info->cb(info->cb_user_data); g_free(info); return NULL; } } else { if (cb != NULL) cb(user_data); } return NULL; }
void gaim_notify_searchresults_new_rows(GaimConnection *gc, GaimNotifySearchResults *results, void *data) { GaimNotifyUiOps *ops; ops = gaim_notify_get_ui_ops(); if (ops != NULL && ops->notify_searchresults != NULL) { ops->notify_searchresults_new_rows(gc, results, data); } }
void * gaim_notify_userinfo(GaimConnection *gc, const char *who, GaimNotifyUserInfo *user_info, GaimNotifyCloseCallback cb, gpointer user_data) { GaimNotifyUiOps *ops; g_return_val_if_fail(who != NULL, NULL); ops = gaim_notify_get_ui_ops(); if (ops != NULL && ops->notify_userinfo != NULL) { GaimNotifyInfo *info; info = g_new0(GaimNotifyInfo, 1); info->type = GAIM_NOTIFY_USERINFO; info->handle = gc; gaim_signal_emit(gaim_notify_get_handle(), "displaying-userinfo", gaim_connection_get_account(gc), who, user_info); info->ui_handle = ops->notify_userinfo(gc, who, user_info); info->cb = cb; info->cb_user_data = user_data; if (info->ui_handle != NULL) { handles = g_list_append(handles, info); return info->ui_handle; } else { if (info->cb != NULL) info->cb(info->cb_user_data); g_free(info); return NULL; } } else { if (cb != NULL) cb(user_data); } return NULL; }
void * gaim_notify_message(void *handle, GaimNotifyMsgType type, const char *title, const char *primary, const char *secondary, GaimNotifyCloseCallback cb, gpointer user_data) { GaimNotifyUiOps *ops; g_return_val_if_fail(primary != NULL, NULL); ops = gaim_notify_get_ui_ops(); if (ops != NULL && ops->notify_message != NULL) { GaimNotifyInfo *info; info = g_new0(GaimNotifyInfo, 1); info->type = GAIM_NOTIFY_MESSAGE; info->handle = handle; info->ui_handle = ops->notify_message(type, title, primary, secondary); info->cb = cb; info->cb_user_data = user_data; if (info->ui_handle != NULL) { handles = g_list_append(handles, info); return info->ui_handle; } else { if (info->cb != NULL) info->cb(info->cb_user_data); g_free(info); return NULL; } } else { if (cb != NULL) cb(user_data); } return NULL; }
void * gaim_notify_searchresults(GaimConnection *gc, const char *title, const char *primary, const char *secondary, GaimNotifySearchResults *results, GaimNotifyCloseCallback cb, gpointer user_data) { GaimNotifyUiOps *ops; ops = gaim_notify_get_ui_ops(); if (ops != NULL && ops->notify_searchresults != NULL) { GaimNotifyInfo *info; info = g_new0(GaimNotifyInfo, 1); info->type = GAIM_NOTIFY_SEARCHRESULTS; info->handle = gc; info->ui_handle = ops->notify_searchresults(gc, title, primary, secondary, results, user_data); info->cb = cb; info->cb_user_data = user_data; if (info->ui_handle != NULL) { handles = g_list_append(handles, info); return info->ui_handle; } else { if (info->cb != NULL) info->cb(info->cb_user_data); g_free(info); return NULL; } } else { if (cb != NULL) cb(user_data); } return NULL; }
void * gaim_notify_email(void *handle, const char *subject, const char *from, const char *to, const char *url, GaimNotifyCloseCallback cb, gpointer user_data) { GaimNotifyUiOps *ops; ops = gaim_notify_get_ui_ops(); if (ops != NULL && ops->notify_email != NULL) { GaimNotifyInfo *info; info = g_new0(GaimNotifyInfo, 1); info->type = GAIM_NOTIFY_EMAIL; info->handle = handle; info->ui_handle = ops->notify_email(handle, subject, from, to, url); info->cb = cb; info->cb_user_data = user_data; if (info->ui_handle != NULL) { handles = g_list_append(handles, info); return info->ui_handle; } else { if (info->cb != NULL) info->cb(info->cb_user_data); g_free(info); return NULL; } } else { if (cb != NULL) cb(user_data); } return NULL; }