Cairo-Dock
3.4.0
|
Data Structures | |
struct | _CairoDialogRenderer |
Definition of a Dialog renderer. It draws the inside of the Dialog. More... | |
struct | _CairoDialogDecorator |
Definition of a Dialog/Menu decorator. It draws the frame of the Dialog/Menu. More... | |
struct | _CairoDialog |
Definition of a Dialog. More... | |
Macros | |
#define | CAIRO_DOCK_IS_DIALOG(obj) |
#define | CAIRO_DIALOG(pContainer) |
Functions | |
CairoDialog * | gldi_dialog_new (CairoDialogAttr *pAttribute) |
CairoDialog * | gldi_dialog_show (const gchar *cText, Icon *pIcon, GldiContainer *pContainer, double fTimeLength, const gchar *cIconPath, GtkWidget *pInteractiveWidget, CairoDockActionOnAnswerFunc pActionFunc, gpointer data, GFreeFunc pFreeDataFunc) |
CairoDialog * | gldi_dialog_show_temporary_with_icon_printf (const gchar *cText, Icon *pIcon, GldiContainer *pContainer, double fTimeLength, const gchar *cIconPath,...) G_GNUC_PRINTF(1 |
CairoDialog CairoDialog * | gldi_dialog_show_temporary_with_icon (const gchar *cText, Icon *pIcon, GldiContainer *pContainer, double fTimeLength, const gchar *cIconPath) |
CairoDialog * | gldi_dialog_show_temporary (const gchar *cText, Icon *pIcon, GldiContainer *pContainer, double fTimeLength) |
CairoDialog * | gldi_dialog_show_temporary_with_default_icon (const gchar *cText, Icon *pIcon, GldiContainer *pContainer, double fTimeLength) |
CairoDialog * | gldi_dialog_show_with_question (const gchar *cText, Icon *pIcon, GldiContainer *pContainer, const gchar *cIconPath, CairoDockActionOnAnswerFunc pActionFunc, gpointer data, GFreeFunc pFreeDataFunc) |
CairoDialog * | gldi_dialog_show_with_entry (const gchar *cText, Icon *pIcon, GldiContainer *pContainer, const gchar *cIconPath, const gchar *cTextForEntry, CairoDockActionOnAnswerFunc pActionFunc, gpointer data, GFreeFunc pFreeDataFunc) |
CairoDialog * | gldi_dialog_show_with_value (const gchar *cText, Icon *pIcon, GldiContainer *pContainer, const gchar *cIconPath, double fValue, double fMaxValue, CairoDockActionOnAnswerFunc pActionFunc, gpointer data, GFreeFunc pFreeDataFunc) |
CairoDialog * | gldi_dialog_show_general_message (const gchar *cMessage, double fTimeLength) |
int | gldi_dialog_show_and_wait (const gchar *cText, Icon *pIcon, GldiContainer *pContainer, const gchar *cIconPath, GtkWidget *pInteractiveWidget) |
GtkWidget * | gldi_dialog_steal_interactive_widget (CairoDialog *pDialog) |
This class defines the Dialog container, useful to bring interaction with the user. A Dialog is a container that points to an icon. It contains the following optionnal components :
A Dialog is constructed with a set of attributes grouped inside a _CairoDialogAttribute. It has a Decorator that draws its shape, and a Renderer that draws its content.
To add buttons, you specify a list of images in the attributes. "ok" and "cancel" are key words for the default ok/cancel buttons. You also has to provide a callback function that will be called on click. When the user clicks on a button, the function is called with the number of the clicked button, counted from 0. -1 and -2 are set if the user pushed the Return or Escape keys. The dialog is unreferenced after the user's answer, so you have to reference the dialog in the callback if you want to keep the dialog alive.
This class defines various helper functions to build a Dialog.
Note that Dialogs and Menus share the same rendering.
#define CAIRO_DOCK_IS_DIALOG | ( | obj | ) |
Say if an object is a Dialog.
obj | the object. |
#define CAIRO_DIALOG | ( | pContainer | ) |
Cast a Container into a Dialog.
pContainer | the container. |
CairoDialog* gldi_dialog_new | ( | CairoDialogAttr * | pAttribute | ) |
Create a new dialog.
pAttribute | attributes of the dialog. |
CairoDialog* gldi_dialog_show | ( | const gchar * | cText, |
Icon * | pIcon, | ||
GldiContainer * | pContainer, | ||
double | fTimeLength, | ||
const gchar * | cIconPath, | ||
GtkWidget * | pInteractiveWidget, | ||
CairoDockActionOnAnswerFunc | pActionFunc, | ||
gpointer | data, | ||
GFreeFunc | pFreeDataFunc | ||
) |
Pop up a dialog with a message, a widget, 2 buttons ok/cancel and an icon, all optionnal.
cText | the message to display. |
pIcon | the icon that will hold the dialog. |
pContainer | the container of the icon. |
fTimeLength | the duration of the dialog (in ms), or 0 for an unlimited dialog. |
cIconPath | path to an icon to display in the margin. |
pInteractiveWidget | a GTK widget; It is destroyed with the dialog. Use 'cairo_dock_steal_interactive_widget_from_dialog()' before if you want to keep it alive. |
pActionFunc | the callback called when the user makes its choice. NULL means there will be no buttons. |
data | data passed as a parameter of the callback. |
pFreeDataFunc | function used to free the data when the dialog is destroyed, or NULL if unnecessary. |
CairoDialog* gldi_dialog_show_temporary_with_icon_printf | ( | const gchar * | cText, |
Icon * | pIcon, | ||
GldiContainer * | pContainer, | ||
double | fTimeLength, | ||
const gchar * | cIconPath, | ||
... | |||
) |
Pop up a dialog with a message, and a limited duration, and an icon in the margin.
cText | the message to display. |
pIcon | the icon that will hold the dialog. |
pContainer | the container of the icon. |
fTimeLength | the duration of the dialog (in ms), or 0 for an unlimited dialog. |
cIconPath | path to an icon. |
... | arguments to insert in the message, in a printf way. |
CairoDialog CairoDialog* gldi_dialog_show_temporary_with_icon | ( | const gchar * | cText, |
Icon * | pIcon, | ||
GldiContainer * | pContainer, | ||
double | fTimeLength, | ||
const gchar * | cIconPath | ||
) |
Pop up a dialog with a message, and a limited duration, and an icon in the margin.
cText | the message to display. |
pIcon | the icon that will hold the dialog. |
pContainer | the container of the icon. |
fTimeLength | the duration of the dialog (in ms), or 0 for an unlimited dialog. |
cIconPath | path to an icon. |
CairoDialog* gldi_dialog_show_temporary | ( | const gchar * | cText, |
Icon * | pIcon, | ||
GldiContainer * | pContainer, | ||
double | fTimeLength | ||
) |
Pop up a dialog with a message, and a limited duration, with no icon.
cText | the message to display. |
pIcon | the icon that will hold the dialog. |
pContainer | the container of the icon. |
fTimeLength | the duration of the dialog (in ms), or 0 for an unlimited dialog. |
CairoDialog* gldi_dialog_show_temporary_with_default_icon | ( | const gchar * | cText, |
Icon * | pIcon, | ||
GldiContainer * | pContainer, | ||
double | fTimeLength | ||
) |
Pop up a dialog with a message, and a limited duration, and a default icon.
cText | the format of the message to display. |
pIcon | the icon that will hold the dialog. |
pContainer | the container of the icon. |
fTimeLength | the duration of the dialog (in ms), or 0 for an unlimited dialog. |
CairoDialog* gldi_dialog_show_with_question | ( | const gchar * | cText, |
Icon * | pIcon, | ||
GldiContainer * | pContainer, | ||
const gchar * | cIconPath, | ||
CairoDockActionOnAnswerFunc | pActionFunc, | ||
gpointer | data, | ||
GFreeFunc | pFreeDataFunc | ||
) |
Pop up a dialog with a question and 2 buttons ok/cancel. The dialog is unreferenced after the user has answered, so if you want to keep it alive, you have to reference it in the callback.
cText | the message to display. |
pIcon | the icon that will hold the dialog. |
pContainer | the container of the icon. |
cIconPath | path to an icon to display in the margin. |
pActionFunc | the callback. |
data | data passed as a parameter of the callback. |
pFreeDataFunc | function used to free the data. |
CairoDialog* gldi_dialog_show_with_entry | ( | const gchar * | cText, |
Icon * | pIcon, | ||
GldiContainer * | pContainer, | ||
const gchar * | cIconPath, | ||
const gchar * | cTextForEntry, | ||
CairoDockActionOnAnswerFunc | pActionFunc, | ||
gpointer | data, | ||
GFreeFunc | pFreeDataFunc | ||
) |
Pop up a dialog with a text entry and 2 buttons ok/cancel. The dialog is unreferenced after the user has answered, so if you want to keep it alive, you have to reference it in the callback.
cText | the message to display. |
pIcon | the icon that will hold the dialog. |
pContainer | the container of the icon. |
cIconPath | path to an icon to display in the margin. |
cTextForEntry | text to display initially in the entry. |
pActionFunc | the callback. |
data | data passed as a parameter of the callback. |
pFreeDataFunc | function used to free the data. |
CairoDialog* gldi_dialog_show_with_value | ( | const gchar * | cText, |
Icon * | pIcon, | ||
GldiContainer * | pContainer, | ||
const gchar * | cIconPath, | ||
double | fValue, | ||
double | fMaxValue, | ||
CairoDockActionOnAnswerFunc | pActionFunc, | ||
gpointer | data, | ||
GFreeFunc | pFreeDataFunc | ||
) |
Pop up a dialog with an horizontal scale between 0 and fMaxValue and 2 buttons ok/cancel. The dialog is unreferenced after the user has answered, so if you want to keep it alive, you have to reference it in the callback.
cText | the message to display. |
pIcon | the icon that will hold the dialog. |
pContainer | the container of the icon. |
cIconPath | path to an icon to display in the margin. |
fValue | initial value of the scale. |
fMaxValue | maximum value of the scale. |
pActionFunc | the callback. |
data | data passed as a parameter of the callback. |
pFreeDataFunc | function used to free the data. |
CairoDialog* gldi_dialog_show_general_message | ( | const gchar * | cMessage, |
double | fTimeLength | ||
) |
Pop up a dialog, pointing on "the best icon possible". This allows to display a general message.
cMessage | the message. |
fTimeLength | life time of the dialog, in ms. |
int gldi_dialog_show_and_wait | ( | const gchar * | cText, |
Icon * | pIcon, | ||
GldiContainer * | pContainer, | ||
const gchar * | cIconPath, | ||
GtkWidget * | pInteractiveWidget | ||
) |
Pop up a dialog with GTK widget and 2 buttons ok/cancel, and block until the user makes its choice.
cText | the message to display. |
pIcon | the icon that will hold the dialog. |
pContainer | the container of the icon. |
cIconPath | path to an icon to display in the margin. |
pInteractiveWidget | an interactive widget. |
GtkWidget* gldi_dialog_steal_interactive_widget | ( | CairoDialog * | pDialog | ) |
Detach the interactive widget from a dialog. The widget can then be placed anywhere after that. You have to unref it after you placed it into a container, or to destroy it.
pDialog | the desklet with an interactive widget. |