14 #include "../testdialogs/dlg_test.h" 15 #include "../testdialogs/dlg_test2.h" 17 #include <gwenhywfar/gwenhywfar.h> 18 #include <gwenhywfar/gui.h> 19 #include <gwenhywfar/dialog.h> 20 #include <gwenhywfar/debug.h> 28 int test1(
int argc,
char **argv)
43 gtk_init(&argc, &argv);
51 fprintf(stderr,
"Could not create dialog.\n");
56 fprintf(stderr,
"Result: %d\n", rv);
65 int test2(
int argc,
char **argv)
75 gtk_init(&argc, &argv);
85 "<p><b>This</b> is an example <i>text</i>..</p>" 86 "<p>As you can see <font color=red>colors</font> can " 91 for (i1=1; i1<=10; i1++) {
94 snprintf(numbuf,
sizeof(numbuf)-1,
"Step %d\n", (
int)i1);
100 "Starting 2nd progress...",
103 for (i2=1; i2<=10; i2++) {
105 fprintf(stderr,
"Advancing %d/%d\n", (
int)i1, (
int)i2);
108 fprintf(stderr,
"Aborted by user (2)\n");
116 fprintf(stderr,
"Aborted by user (1)\n");
143 gtk_init(&argc, &argv);
151 fprintf(stderr,
"Could not create dialog.\n");
156 fprintf(stderr,
"Result: %d\n", rv);
165 int main(
int argc,
char **argv)
168 if (strcasecmp(argv[1],
"1")==0)
169 return test1(argc, argv);
170 else if (strcasecmp(argv[1],
"2")==0)
171 return test2(argc, argv);
172 else if (strcasecmp(argv[1],
"3")==0)
173 return test3(argc, argv);
175 return test1(argc, argv);
GWENHYWFAR_API int GWEN_Gui_ProgressLog(uint32_t id, GWEN_LOGGER_LEVEL level, const char *text)
int main(int argc, char **argv)
GWENHYWFAR_API int GWEN_Gui_ProgressAdvance(uint32_t id, uint32_t progress)
void GWEN_Logger_SetLevel(const char *logDomain, GWEN_LOGGER_LEVEL l)
GWEN_GUI * Gtk2_Gui_new()
#define GWEN_GUI_PROGRESS_DELAY
int test2(int argc, char **argv)
#define DBG_ERROR_ERR(dbg_logger, dbg_err)
GWENHYWFAR_API int GWEN_Gui_ExecDialog(GWEN_DIALOG *dlg, uint32_t guiid)
struct GWEN_DIALOG GWEN_DIALOG
int test1(int argc, char **argv)
int test3(int argc, char **argv)
GWEN_DIALOG * Dlg_Test2_new()
GWENHYWFAR_API uint32_t GWEN_Gui_ProgressStart(uint32_t progressFlags, const char *title, const char *text, uint64_t total, uint32_t guiid)
GWENHYWFAR_API int GWEN_Gui_ProgressEnd(uint32_t id)
#define GWEN_GUI_PROGRESS_KEEP_OPEN
#define GWEN_GUI_PROGRESS_SHOW_LOG
GWEN_DIALOG * Dlg_Test1_new()
#define GWEN_ERROR_USER_ABORTED
void GWEN_Gui_SetGui(GWEN_GUI *gui)
#define GWEN_GUI_PROGRESS_SHOW_ABORT