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>
29 int test1(
int argc,
char **argv) {
42 setlocale (LC_ALL,
"");
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) {
73 setlocale(LC_ALL,
"");
74 gtk_init (&argc, &argv);
84 "<p><b>This</b> is an example <i>text</i>..</p>"
85 "<p>As you can see <font color=red>colors</font> can "
90 for (i1=1; i1<=10; i1++) {
93 snprintf(numbuf,
sizeof(numbuf)-1,
"Step %d\n", (
int)i1);
99 "Starting 2nd progress...",
102 for (i2=1; i2<=10; i2++) {
104 fprintf(stderr,
"Advancing %d/%d\n", (
int)i1, (
int)i2);
107 fprintf(stderr,
"Aborted by user (2)\n");
115 fprintf(stderr,
"Aborted by user (1)\n");
140 setlocale(LC_ALL,
"");
141 gtk_init (&argc, &argv);
149 fprintf(stderr,
"Could not create dialog.\n");
154 fprintf(stderr,
"Result: %d\n", rv);
163 int main(
int argc,
char **argv) {
165 if (strcasecmp(argv[1],
"1")==0)
166 return test1(argc, argv);
167 else if (strcasecmp(argv[1],
"2")==0)
168 return test2(argc, argv);
169 else if (strcasecmp(argv[1],
"3")==0)
170 return test3(argc, argv);
172 return test1(argc, argv);
int GWEN_Gui_ProgressLog(uint32_t id, GWEN_LOGGER_LEVEL level, const char *text)
int GWEN_Gui_ProgressAdvance(uint32_t id, uint32_t progress)
void GWEN_Logger_SetLevel(const char *logDomain, GWEN_LOGGER_LEVEL l)
int test3(int argc, char **argv)
#define GWEN_GUI_PROGRESS_DELAY
#define DBG_ERROR_ERR(dbg_logger, dbg_err)
int GWEN_Gui_ExecDialog(GWEN_DIALOG *dlg, uint32_t guiid)
int test1(int argc, char **argv)
struct GWEN_DIALOG GWEN_DIALOG
int test2(int argc, char **argv)
GWEN_DIALOG * Dlg_Test2_new()
uint32_t GWEN_Gui_ProgressStart(uint32_t progressFlags, const char *title, const char *text, uint64_t total, uint32_t guiid)
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
int main(int argc, char **argv)
void GWEN_Gui_SetGui(GWEN_GUI *gui)
GWEN_GUI * Gtk3_Gui_new()
#define GWEN_GUI_PROGRESS_SHOW_ABORT