pidgin  2.13.0
About: Pidgin is a chat program (multi-protocol instant messaging client) which lets you log in to accounts on multiple chat networks simultaneously (old name "gaim").
  Fossies Dox: pidgin-2.13.0.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

gntrequest.c File Reference
#include <internal.h>
#include <gnt.h>
#include <gntbox.h>
#include <gntbutton.h>
#include <gntcheckbox.h>
#include <gntcombobox.h>
#include <gntentry.h>
#include <gntfilesel.h>
#include <gntlabel.h>
#include <gntline.h>
#include <gnttree.h>
#include "finch.h"
#include "gntrequest.h"
#include "debug.h"
#include "util.h"
Include dependency graph for gntrequest.c:

Go to the source code of this file.

Data Structures

struct  FinchFileRequest
 

Macros

#define FINCH_GET_DATA(obj)   purple_request_field_get_ui_data(obj)
 
#define FINCH_SET_DATA(obj, data)   purple_request_field_set_ui_data(obj, data)
 

Functions

static GntWidgetsetup_request_window (const char *title, const char *primary, const char *secondary, PurpleRequestType type)
 
static void setup_default_callback (GntWidget *window, gpointer default_cb, gpointer data)
 
static void action_performed (GntWidget *button, gpointer data)
 
static GntWidgetsetup_button_box (GntWidget *win, gpointer userdata, gpointer cb, gpointer data,...)
 
static void notify_input_cb (GntWidget *button, GntWidget *entry)
 
static void * finch_request_input (const char *title, const char *primary, const char *secondary, const char *default_value, gboolean multiline, gboolean masked, gchar *hint, const char *ok_text, GCallback ok_cb, const char *cancel_text, GCallback cancel_cb, PurpleAccount *account, const char *who, PurpleConversation *conv, void *user_data)
 
static void finch_close_request (PurpleRequestType type, gpointer ui_handle)
 
static void request_choice_cb (GntWidget *button, GntComboBox *combo)
 
static void * finch_request_choice (const char *title, const char *primary, const char *secondary, int default_value, const char *ok_text, GCallback ok_cb, const char *cancel_text, GCallback cancel_cb, PurpleAccount *account, const char *who, PurpleConversation *conv, void *user_data, va_list choices)
 
static void request_action_cb (GntWidget *button, GntWidget *window)
 
static void * finch_request_action (const char *title, const char *primary, const char *secondary, int default_value, PurpleAccount *account, const char *who, PurpleConversation *conv, void *user_data, size_t actioncount, va_list actions)
 
static void request_fields_cb (GntWidget *button, PurpleRequestFields *fields)
 
static void update_selected_account (GntEntry *username, const char *start, const char *end, GntComboBox *accountlist)
 
static GntWidgetcreate_boolean_field (PurpleRequestField *field)
 
static GntWidgetcreate_string_field (PurpleRequestField *field, GntWidget **username)
 
static GntWidgetcreate_integer_field (PurpleRequestField *field)
 
static GntWidgetcreate_choice_field (PurpleRequestField *field)
 
static GntWidgetcreate_list_field (PurpleRequestField *field)
 
static GntWidgetcreate_account_field (PurpleRequestField *field)
 
static void * finch_request_fields (const char *title, const char *primary, const char *secondary, PurpleRequestFields *allfields, const char *ok, GCallback ok_cb, const char *cancel, GCallback cancel_cb, PurpleAccount *account, const char *who, PurpleConversation *conv, void *userdata)
 
static void file_cancel_cb (gpointer fq, GntWidget *wid)
 
static void file_ok_cb (gpointer fq, GntWidget *widget)
 
static void file_request_destroy (FinchFileRequest *data)
 
static FinchFileRequestfinch_file_request_window (const char *title, const char *path, GCallback ok_cb, GCallback cancel_cb, void *user_data)
 
static void * finch_request_file (const char *title, const char *filename, gboolean savedialog, GCallback ok_cb, GCallback cancel_cb, PurpleAccount *account, const char *who, PurpleConversation *conv, void *user_data)
 
static void * finch_request_folder (const char *title, const char *dirname, GCallback ok_cb, GCallback cancel_cb, PurpleAccount *account, const char *who, PurpleConversation *conv, void *user_data)
 
PurpleRequestUiOpsfinch_request_get_ui_ops ()
 
void finch_request_init ()
 
void finch_request_uninit ()
 
void finch_request_save_in_prefs (gpointer null, PurpleRequestFields *allfields)
 
GntWidgetfinch_request_field_get_widget (PurpleRequestField *field)
 

Variables

static PurpleRequestUiOps uiops
 

Detailed Description

GNT Request API

Definition in file gntrequest.c.

Macro Definition Documentation

◆ FINCH_GET_DATA

#define FINCH_GET_DATA (   obj)    purple_request_field_get_ui_data(obj)

Definition at line 47 of file gntrequest.c.

◆ FINCH_SET_DATA

#define FINCH_SET_DATA (   obj,
  data 
)    purple_request_field_set_ui_data(obj, data)

Definition at line 48 of file gntrequest.c.

Function Documentation

◆ action_performed()

static void action_performed ( GntWidget button,
gpointer  data 
)
static

Definition at line 95 of file gntrequest.c.

References data, and NULL.

Referenced by finch_file_request_window(), and setup_button_box().

◆ create_account_field()

◆ create_boolean_field()

◆ create_choice_field()

◆ create_integer_field()

◆ create_list_field()

◆ create_string_field()

◆ file_cancel_cb()

static void file_cancel_cb ( gpointer  fq,
GntWidget wid 
)
static

Definition at line 689 of file gntrequest.c.

References data, NULL, purple_request_close(), and PURPLE_REQUEST_FILE.

Referenced by finch_file_request_window().

◆ file_ok_cb()

static void file_ok_cb ( gpointer  fq,
GntWidget widget 
)
static

◆ file_request_destroy()

static void file_request_destroy ( FinchFileRequest data)
static

Definition at line 715 of file gntrequest.c.

References data.

Referenced by finch_file_request_window().

◆ finch_close_request()

static void finch_close_request ( PurpleRequestType  type,
gpointer  ui_handle 
)
static

◆ finch_file_request_window()

static FinchFileRequest* finch_file_request_window ( const char *  title,
const char *  path,
GCallback  ok_cb,
GCallback  cancel_cb,
void *  user_data 
)
static

◆ finch_request_action()

static void* finch_request_action ( const char *  title,
const char *  primary,
const char *  secondary,
int  default_value,
PurpleAccount account,
const char *  who,
PurpleConversation conv,
void *  user_data,
size_t  actioncount,
va_list  actions 
)
static

◆ finch_request_choice()

static void* finch_request_choice ( const char *  title,
const char *  primary,
const char *  secondary,
int  default_value,
const char *  ok_text,
GCallback  ok_cb,
const char *  cancel_text,
GCallback  cancel_cb,
PurpleAccount account,
const char *  who,
PurpleConversation conv,
void *  user_data,
va_list  choices 
)
static

◆ finch_request_field_get_widget()

◆ finch_request_fields()

static void* finch_request_fields ( const char *  title,
const char *  primary,
const char *  secondary,
PurpleRequestFields allfields,
const char *  ok,
GCallback  ok_cb,
const char *  cancel,
GCallback  cancel_cb,
PurpleAccount account,
const char *  who,
PurpleConversation conv,
void *  userdata 
)
static

◆ finch_request_file()

static void* finch_request_file ( const char *  title,
const char *  filename,
gboolean  savedialog,
GCallback  ok_cb,
GCallback  cancel_cb,
PurpleAccount account,
const char *  who,
PurpleConversation conv,
void *  user_data 
)
static

◆ finch_request_folder()

static void* finch_request_folder ( const char *  title,
const char *  dirname,
GCallback  ok_cb,
GCallback  cancel_cb,
PurpleAccount account,
const char *  who,
PurpleConversation conv,
void *  user_data 
)
static

◆ finch_request_get_ui_ops()

PurpleRequestUiOps* finch_request_get_ui_ops ( void  )

Get the ui-functions.

Returns
The PurpleRequestUiOps structure populated with the appropriate functions.

Definition at line 807 of file gntrequest.c.

References uiops.

Referenced by gnt_ui_init().

◆ finch_request_init()

void finch_request_init ( void  )

Perform necessary initializations.

Definition at line 812 of file gntrequest.c.

Referenced by gnt_ui_init().

◆ finch_request_input()

static void* finch_request_input ( const char *  title,
const char *  primary,
const char *  secondary,
const char *  default_value,
gboolean  multiline,
gboolean  masked,
gchar *  hint,
const char *  ok_text,
GCallback  ok_cb,
const char *  cancel_text,
GCallback  cancel_cb,
PurpleAccount account,
const char *  who,
PurpleConversation conv,
void *  user_data 
)
static

◆ finch_request_save_in_prefs()

◆ finch_request_uninit()

void finch_request_uninit ( void  )

Perform necessary uninitializations.

Definition at line 816 of file gntrequest.c.

◆ notify_input_cb()

static void notify_input_cb ( GntWidget button,
GntWidget entry 
)
static

◆ request_action_cb()

static void request_action_cb ( GntWidget button,
GntWidget window 
)
static

Definition at line 251 of file gntrequest.c.

References data, PURPLE_REQUEST_ACTION, purple_request_close(), and window.

Referenced by finch_request_action().

◆ request_choice_cb()

static void request_choice_cb ( GntWidget button,
GntComboBox combo 
)
static

◆ request_fields_cb()

◆ setup_button_box()

static GntWidget* setup_button_box ( GntWidget win,
gpointer  userdata,
gpointer  cb,
gpointer  data,
  ... 
)
static

window: this is the window userdata: the userdata to pass to the primary callbacks cb: the callback data: data for the callback (text, primary-callback) pairs, ended by a NULL

The cancellation callback should be the last callback sent.

Definition at line 113 of file gntrequest.c.

References action_performed(), data, FALSE, GNT_BOX, gnt_box_add_widget(), gnt_button_new(), gnt_hbox_new, NULL, text, and TRUE.

Referenced by finch_request_choice(), finch_request_fields(), and finch_request_input().

◆ setup_default_callback()

static void setup_default_callback ( GntWidget window,
gpointer  default_cb,
gpointer  data 
)
static

If the window is closed by the wm (ie, without triggering any of the buttons, then do some default callback.

Definition at line 86 of file gntrequest.c.

References data, NULL, and window.

Referenced by finch_file_request_window(), finch_request_choice(), finch_request_fields(), and finch_request_input().

◆ setup_request_window()

◆ update_selected_account()

static void update_selected_account ( GntEntry username,
const char *  start,
const char *  end,
GntComboBox accountlist 
)
static

Variable Documentation

◆ uiops

finch_close_request
static void finch_close_request(PurpleRequestType type, gpointer ui_handle)
Definition: gntrequest.c:188
finch_request_action
static void * finch_request_action(const char *title, const char *primary, const char *secondary, int default_value, PurpleAccount *account, const char *who, PurpleConversation *conv, void *user_data, size_t actioncount, va_list actions)
Definition: gntrequest.c:264
finch_request_choice
static void * finch_request_choice(const char *title, const char *primary, const char *secondary, int default_value, const char *ok_text, GCallback ok_cb, const char *cancel_text, GCallback cancel_cb, PurpleAccount *account, const char *who, PurpleConversation *conv, void *user_data, va_list choices)
Definition: gntrequest.c:218
NULL
#define NULL
Definition: getopt1.c:52
finch_request_folder
static void * finch_request_folder(const char *title, const char *dirname, GCallback ok_cb, GCallback cancel_cb, PurpleAccount *account, const char *who, PurpleConversation *conv, void *user_data)
Definition: gntrequest.c:777
finch_request_input
static void * finch_request_input(const char *title, const char *primary, const char *secondary, const char *default_value, gboolean multiline, gboolean masked, gchar *hint, const char *ok_text, GCallback ok_cb, const char *cancel_text, GCallback cancel_cb, PurpleAccount *account, const char *who, PurpleConversation *conv, void *user_data)
Definition: gntrequest.c:160
finch_request_file
static void * finch_request_file(const char *title, const char *filename, gboolean savedialog, GCallback ok_cb, GCallback cancel_cb, PurpleAccount *account, const char *who, PurpleConversation *conv, void *user_data)
Definition: gntrequest.c:756
finch_request_fields
static void * finch_request_fields(const char *title, const char *primary, const char *secondary, PurpleRequestFields *allfields, const char *ok, GCallback ok_cb, const char *cancel, GCallback cancel_cb, PurpleAccount *account, const char *who, PurpleConversation *conv, void *userdata)
Definition: gntrequest.c:581