1 2 3 4 #ifndef GWENHYWFAR_GUI_CPROGRESS_H 5 #define GWENHYWFAR_GUI_CPROGRESS_H 6 7 #include <gwenhywfar/list.h> 8 #include <gwenhywfar/gui.h> 9 #include <gwenhywfar/buffer.h> 10 #include <gwenhywfar/logger.h> 11 12 13 14 typedef struct GWEN_GUI_CPROGRESS GWEN_GUI_CPROGRESS; 15 GWEN_LIST_FUNCTION_DEFS(GWEN_GUI_CPROGRESS, GWEN_Gui_CProgress) 16 17 18 GWEN_GUI_CPROGRESS *GWEN_Gui_CProgress_new(GWEN_GUI *gui, 19 uint32_t id, 20 uint32_t progressFlags, 21 const char *title, 22 const char *text, 23 uint64_t total); 24 void GWEN_Gui_CProgress_free(GWEN_GUI_CPROGRESS *cp); 25 26 27 GWEN_GUI *GWEN_Gui_CProgress_GetGui(const GWEN_GUI_CPROGRESS *cp); 28 uint32_t GWEN_Gui_CProgress_GetId(const GWEN_GUI_CPROGRESS *cp); 29 const char *GWEN_Gui_CProgress_GetTitle(const GWEN_GUI_CPROGRESS *cp); 30 const char *GWEN_Gui_CProgress_GetText(const GWEN_GUI_CPROGRESS *cp); 31 uint64_t GWEN_Gui_CProgress_GetTotal(const GWEN_GUI_CPROGRESS *cp); 32 void GWEN_Gui_CProgress_SetTotal(GWEN_GUI_CPROGRESS *cp, uint64_t i); 33 34 uint64_t GWEN_Gui_CProgress_GetCurrent(const GWEN_GUI_CPROGRESS *cp); 35 const char *GWEN_Gui_CProgress_GetLogBuf(const GWEN_GUI_CPROGRESS *cp); 36 int GWEN_Gui_CProgress_GetAborted(const GWEN_GUI_CPROGRESS *cp); 37 38 39 int GWEN_Gui_CProgress_Advance(GWEN_GUI_CPROGRESS *cp, uint64_t progress); 40 41 int GWEN_Gui_CProgress_Log(GWEN_GUI_CPROGRESS *cp, 42 GWEN_LOGGER_LEVEL level, 43 const char *text); 44 45 int GWEN_Gui_CProgress_End(GWEN_GUI_CPROGRESS *cp); 46 47 48 49 #endif 50 51