/******************************************************************************
 *
 *    Name: UIDialogLibGTK.h
 *
 *    $Id$
 *
 *    Purpose: A GTK+ header for the UI Dialog Library.
 *
 *    Copyright 2014 Citrix Systems, Inc. All rights reserved.
 *
 *****************************************************************************/

enum dialogState
{
    DIALOG_DOWN = 0,
    DIALOG_GOING_DOWN,
    DIALOG_UP
};


/* UIDialogLibGTK implementation of the opaque UIDIALOG. */
struct UIDialog
{
    enum dialogState going_up_or_down;  /* Is the dialog set to open or close.
                                           Required to resolve the race from an asynchronous close
                                           from another thread and the coming up of the dialog. */
    GtkWidget *window;
    GtkWidget *win_contents;
    GtkWidget *spinner;                 /* A reference to the spinner widget if present. */
    const char *response;
    guint close_signal;                 /* A reference to the registered callback on the close signal. */
    const char *timeout_response;       /* The response to return if the timeout fires. */
    guint timeout_src;                  /* A reference to the timer counting down to close the dialog. */
    unsigned int timeout;               /* The amount of time until the dialog is closed. */
    const char *idle_timeout_response;  /* The response to return if the idle timeout fires. */
    guint idle_timeout_src;             /* A reference to the idle timer counting down to close the dialog. */
    GList *idle_timeout_change_srcs;    /* A reference to all the idle timer sources which monitor for changes. */
    unsigned int idle_timeout_base;     /* The amount of time in total the dialog needs to be idle before it will close. */
    unsigned int idle_timeout;          /* The amount of time the dialog has been idle so far. */
    guint key_press_src;                /* A reference to the registered callback on key press. */
    struct formsElement **form;         /* Access to the form data passed in to UIDialogDisplay(). */
    struct element *element_widgets;    /* List of all the widgets corresponding to the elements in the form structures. */
    GtkWidget *timeout_label;           /* The label used to render the timeout information. */
    int num_elements;                   /* Total number of elements in the form structures. */
    GList *brespList;                   /* List of button response structures. */
    GList *elementList;                 /* List of all the elements in the order they were created recursively as expanders were created.
                                         *   1
                                         *   2
                                         *   3 
                                         *   expander    4
                                         *               5
                                         *               expander    6
                                         *                           7
                                         *   8
                                         *   expander   9
                                         *   10
                                         */
    GList *selectionTablesList;         /* List of selection tables. */

};

