Google

NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+ ">

nd_dialog

Name

nd_dialog -- 

Synopsis



enum        ND_DialogType;
enum        ND_Base;
void        (*ND_NumberCallback)            (ND_Packet *packet,
                                             void *user_data,
                                             guint value);
void        (*ND_AddressCallback)           (guchar *address,
                                             int address_len,
                                             ND_Packet *packet,
                                             void *user_data);
void        (*ND_FilenameCallback)          (const char *filename,
                                             void *user_data);
void        (*ND_DialogCallback)            (void *user_data);
void        nd_dialog_ync                   (const char *title,
                                             const char *message,
                                             ND_DialogCallback yes_cb,
                                             ND_DialogCallback no_cb,
                                             ND_DialogCallback cancel_cb,
                                             void *user_data);
void        nd_dialog_message               (const char *title,
                                             const char *message,
                                             gboolean modal);
void        nd_dialog_number                (const char *message,
                                             ND_Base base,
                                             guint value,
                                             guint max,
                                             ND_NumberCallback callback_okay,
                                             ND_DialogCallback callback_cancel,
                                             ND_Packet *packet,
                                             void *user_data);
void        nd_dialog_hardware_address      (const char *message,
                                             guchar *address,
                                             int address_len,
                                             ND_AddressCallback callback_ok,
                                             ND_DialogCallback callback_cancel,
                                             ND_Packet *packet,
                                             void *user_data);
void        nd_dialog_ip                    (const char *message,
                                             guchar *ip_address,
                                             ND_AddressCallback callback_ok,
                                             ND_DialogCallback callback_cancel,
                                             ND_Packet *packet,
                                             void *user_data);
void        nd_dialog_filesel               (const char *title,
                                             const char *file_name,
                                             ND_FilenameCallback callback_fname,
                                             void *user_data);
void        nd_dialog_exit                  (void);
void        nd_dialog_generic               (ND_DialogType type,
                                             const char *title,
                                             const char *message,
                                             gboolean modal,
                                             GtkWidget *extra_area,
                                             void *user_data,
                                             int num_buttons,
                                             ...);
void        nd_dialog_about                 (void);
void        (*ND_FontselCallback)           (const char *fontname,
                                             void *user_data);
void        nd_dialog_fontsel               (const char *title,
                                             const char *font_name,
                                             ND_FontselCallback callback_ok,
                                             void *user_data);

Description

Details

enum ND_DialogType

typedef enum {
  ND_DIALOG_QUESTION,
  ND_DIALOG_WARNING
} ND_DialogType;


enum ND_Base

typedef enum {
  ND_BASE_DEC,
  ND_BASE_HEX
} ND_Base;


ND_NumberCallback ()

void        (*ND_NumberCallback)            (ND_Packet *packet,
                                             void *user_data,
                                             guint value);

This is the signature of callbacks that can be passed to nd_dialog_number() and that gets called when the user clicks "OK".


ND_AddressCallback ()

void        (*ND_AddressCallback)           (guchar *address,
                                             int address_len,
                                             ND_Packet *packet,
                                             void *user_data);

This is the signature of callbacks that can be passed to nd_dialog_hardware_address() and that gets called when the user clicks "OK".


ND_FilenameCallback ()

void        (*ND_FilenameCallback)          (const char *filename,
                                             void *user_data);

This is the signature of callbacks that can be passed to nd_dialog_filesel() and that gets called when the user clicks "OK".


ND_DialogCallback ()

void        (*ND_DialogCallback)            (void *user_data);

This is the signature of the generic callbacks used in the dialogs. Also used in the generic number and address dialogs for the "Cancel" callbacks, where the user can clean up any user_data if necessary.


nd_dialog_ync ()

void        nd_dialog_ync                   (const char *title,
                                             const char *message,
                                             ND_DialogCallback yes_cb,
                                             ND_DialogCallback no_cb,
                                             ND_DialogCallback cancel_cb,
                                             void *user_data);

Shows a yes-no-cancel dialog and calls the appriopriate callback when a button is clicked. The dialog is displayed and hidden automatically. You can pass NULL for callbacks you don't need.


nd_dialog_message ()

void        nd_dialog_message               (const char *title,
                                             const char *message,
                                             gboolean modal);

The function shows a simple message dialog with an okay button. No callbacks. If modal is TRUE, no other windows will be active while the dialog is shown.


nd_dialog_number ()

void        nd_dialog_number                (const char *message,
                                             ND_Base base,
                                             guint value,
                                             guint max,
                                             ND_NumberCallback callback_okay,
                                             ND_DialogCallback callback_cancel,
                                             ND_Packet *packet,
                                             void *user_data);

The function shows a number-editing dialog with the given label and initial value. The largest possible value is given through max. You can pass NULL for callback_cancel if you don't need it. The dialog also handles 32-bit values nicely, in contrast to GTK's entry widget.


nd_dialog_hardware_address ()

void        nd_dialog_hardware_address      (const char *message,
                                             guchar *address,
                                             int address_len,
                                             ND_AddressCallback callback_ok,
                                             ND_DialogCallback callback_cancel,
                                             ND_Packet *packet,
                                             void *user_data);

The function shows a generic hardware address entry dialog that allows you to edit an address with the given address_len (in bytes, e.g. 6 for Ethernet). When the "okay"-button is clicked, callback_ok is called with the new value. You can pass NULL for callback_cancel if you don't need it.


nd_dialog_ip ()

void        nd_dialog_ip                    (const char *message,
                                             guchar *ip_address,
                                             ND_AddressCallback callback_ok,
                                             ND_DialogCallback callback_cancel,
                                             ND_Packet *packet,
                                             void *user_data);

The function shows a dialog to edit an IPv4 address. This is needed sufficiently often that it is provided withing Netdude itself, not by a plugin. The ip_address memory is not used internally. You can pass NULL for callback_cancel if you don't need it.


nd_dialog_filesel ()

void        nd_dialog_filesel               (const char *title,
                                             const char *file_name,
                                             ND_FilenameCallback callback_fname,
                                             void *user_data);

The function shows a file selection dialog, initialized to file_name, if provided. You can also pass NULL for file_name. callback_fname if called when the user clicks the "okay"-button.


nd_dialog_exit ()

void        nd_dialog_exit                  (void);

This function opens the exit dialog, which shows a list of unsaved files, which the user can save directly from the dialog before Netdude exits.


nd_dialog_generic ()

void        nd_dialog_generic               (ND_DialogType type,
                                             const char *title,
                                             const char *message,
                                             gboolean modal,
                                             GtkWidget *extra_area,
                                             void *user_data,
                                             int num_buttons,
                                             ...);

This function is the most generic way to generate a dialog, allowing you to basically specify all parts of it. The varargs specify the buttons and must be a sequence of char*s for buttons labels and ND_DialogCallbacks for the button callbacks.


nd_dialog_about ()

void        nd_dialog_about                 (void);

The function displays Netdude's About-dialog, containing version and author info etc.


ND_FontselCallback ()

void        (*ND_FontselCallback)           (const char *fontname,
                                             void *user_data);

This is the signature of the callbacks that get called when the user clicks "OK" in a dialog opened by nd_dialog_fontsel().


nd_dialog_fontsel ()

void        nd_dialog_fontsel               (const char *title,
                                             const char *font_name,
                                             ND_FontselCallback callback_ok,
                                             void *user_data);

The function shows a font selection dialog, initialized to font_name, if provided. callback_ok is called when the user clicks the "okay"-button.