/* Confirmation Dialog */ #ifndef CDLG_H #define CDLG_H #include "../include/osw-x.h" #include "../include/widget.h" typedef struct _cdlg_struct cdlg_struct; /* * Options: */ #define CDlgBtnNo (1 << 0) #define CDlgBtnYes (1 << 1) #define CDlgBtnYesToAll (1 << 2) #define CDlgBtnCancel (1 << 3) /* * Response Codes: */ #define CDlgError -1 #define CDlgNo 0 #define CDlgYes 1 #define CDlgYesToAll 2 #define CDlgCancel 3 /* * Confirmation DIalog: */ struct _cdlg_struct { bool_t map_state, has_focus; int x, y; unsigned int width, height; visibility_t visibility_state; font_t *font; unsigned int btn_flags; /* Any of CDlgBtn* */ win_t toplevel; pixmap_t toplevel_buf; int map_rel; /* One of WIDGET_WINDOW_RELATIVE_* */ win_t transient_for_w; image_t *icon; char *msg; unsigned int msg_width, msg_height; /* In pixels */ push_button_struct no_btn, yes_btn, yes_to_all_btn, cancel_btn; /* Main push function */ void (*main_push_func)( void * /* Data */ ); void *main_push_data; /* Main pop function */ void (*main_pop_func)( void * /* Data */ ); void *main_pop_data; int response; /* One of CDlg* */ }; #define CDLG(p) ((cdlg_struct *)(p)) /* cdlg.cpp */ extern int CDlgGetResponse( cdlg_struct *d, const char *title, const char *msg, image_t *icon, unsigned int btn_flags, int map_rel, win_t toplevel, void (*main_push_func)(void *), void *main_push_data, void (*main_pop_func)(void *), void *main_pop_data ); extern int CDlgInit(cdlg_struct *d); extern void CDlgResize(cdlg_struct *d); extern void CDlgQueueResize(cdlg_struct *d); extern void CDlgDraw(cdlg_struct *d); extern void CDlgQueueDraw(cdlg_struct *d); extern int CDlgManage(cdlg_struct *d, event_t *event); extern void CDlgMap(cdlg_struct *d); extern void CDlgUnmap(cdlg_struct *d); extern void CDlgDestroy(cdlg_struct *d); #endif /* CDLG_H */