GWEN_XML_CONTEXT *AIO_OfxXmlCtx_new(uint32_t flags, AB_IMEXPORTER_CONTEXT *ioContext) { GWEN_XML_CONTEXT *ctx; AIO_OFX_XMLCTX *xctx; AIO_OFX_GROUP *g; /* create base object */ ctx=GWEN_XmlCtx_new(flags); assert(ctx); /* create and assign extension */ GWEN_NEW_OBJECT(AIO_OFX_XMLCTX, xctx); assert(xctx); GWEN_INHERIT_SETDATA(GWEN_XML_CONTEXT, AIO_OFX_XMLCTX, ctx, xctx, AIO_OfxXmlCtx_FreeData); xctx->ioContext=ioContext; /* set virtual functions */ GWEN_XmlCtx_SetStartTagFn(ctx, AIO_OfxXmlCtx_StartTag); GWEN_XmlCtx_SetEndTagFn(ctx, AIO_OfxXmlCtx_EndTag); GWEN_XmlCtx_SetAddDataFn(ctx, AIO_OfxXmlCtx_AddData); GWEN_XmlCtx_SetAddCommentFn(ctx, AIO_OfxXmlCtx_AddComment); GWEN_XmlCtx_SetAddAttrFn(ctx, AIO_OfxXmlCtx_AddAttr); /* create initial group */ g=AIO_OfxGroup_Document_new("OFX_FILE", NULL, ctx); assert(g); AIO_OfxXmlCtx_SetCurrentGroup(ctx, g); /* return base object */ return ctx; }
AB_PROVIDER *APY_Provider_new(AB_BANKING *ab) { AB_PROVIDER *pro; APY_PROVIDER *xp; pro=AB_Provider_new(ab, APY_PROVIDER_NAME); GWEN_NEW_OBJECT(APY_PROVIDER, xp); GWEN_INHERIT_SETDATA(AB_PROVIDER, APY_PROVIDER, pro, xp, APY_Provider_FreeData); AB_Provider_SetInitFn(pro, APY_Provider_Init); AB_Provider_SetFiniFn(pro, APY_Provider_Fini); AB_Provider_SetCreateAccountObjectsFn(pro, APY_Provider_CreateAccountObject); AB_Provider_SetCreateUserObjectsFn(pro, APY_Provider_CreateUserObject); AB_Provider_SetControlFn(pro, APY_Control); AB_Provider_SetGetNewUserDialogFn(pro, APY_Provider_GetNewUserDialog); AB_Provider_SetGetEditUserDialogFn(pro, APY_Provider_GetEditUserDialog); AB_Provider_AddFlags(pro, AB_PROVIDER_FLAGS_HAS_EDITUSER_DIALOG | AB_PROVIDER_FLAGS_HAS_NEWUSER_DIALOG); return pro; }
AIO_OFX_GROUP *AIO_OfxGroup_STATUS_new(const char *groupName, AIO_OFX_GROUP *parent, GWEN_XML_CONTEXT *ctx, const char *description) { AIO_OFX_GROUP *g; AIO_OFX_GROUP_STATUS *xg; /* create base group */ g=AIO_OfxGroup_Generic_new(groupName, parent, ctx); assert(g); GWEN_NEW_OBJECT(AIO_OFX_GROUP_STATUS, xg); assert(xg); GWEN_INHERIT_SETDATA(AIO_OFX_GROUP, AIO_OFX_GROUP_STATUS, g, xg, AIO_OfxGroup_STATUS_FreeData); if (description) xg->description=strdup(description); /* set virtual functions */ AIO_OfxGroup_SetStartTagFn(g, AIO_OfxGroup_STATUS_StartTag); xg->oldEndTagFn=AIO_OfxGroup_SetEndTagFn(g, AIO_OfxGroup_STATUS_EndTag); AIO_OfxGroup_SetAddDataFn(g, AIO_OfxGroup_STATUS_AddData); return g; }
AB_PROVIDER *EBC_Provider_new(AB_BANKING *ab){ AB_PROVIDER *pro; EBC_PROVIDER *dp; pro=AB_Provider_new(ab, "aqebics"); GWEN_NEW_OBJECT(EBC_PROVIDER, dp); GWEN_INHERIT_SETDATA(AB_PROVIDER, EBC_PROVIDER, pro, dp, EBC_Provider_FreeData); dp->bankingJobs=AB_Job_List2_new(); dp->queue=EBC_Queue_new(); AB_Provider_SetInitFn(pro, EBC_Provider_Init); AB_Provider_SetFiniFn(pro, EBC_Provider_Fini); AB_Provider_SetUpdateJobFn(pro, EBC_Provider_UpdateJob); AB_Provider_SetAddJobFn(pro, EBC_Provider_AddJob); AB_Provider_SetExecuteFn(pro, EBC_Provider_Execute); AB_Provider_SetResetQueueFn(pro, EBC_Provider_ResetQueue); AB_Provider_SetExtendUserFn(pro, EBC_Provider_ExtendUser); AB_Provider_SetExtendAccountFn(pro, EBC_Provider_ExtendAccount); AB_Provider_SetGetEditUserDialogFn(pro, EBC_Provider_GetEditUserDialog); AB_Provider_AddFlags(pro, AB_PROVIDER_FLAGS_HAS_EDITUSER_DIALOG); AB_Provider_SetGetNewUserDialogFn(pro, EBC_Provider_GetNewUserDialog); AB_Provider_AddFlags(pro, AB_PROVIDER_FLAGS_HAS_NEWUSER_DIALOG); return pro; }
FOX16_HtmlCtx::FOX16_HtmlCtx(uint32_t flags) :_context(NULL) ,_font(NULL) ,_fgColor(0) ,_bgColor(0) ,m_iconSource(NULL) { HTML_PROPS *pr; HTML_FONT *fnt; _context=HtmlCtx_new(flags); GWEN_INHERIT_SETDATA(GWEN_XML_CONTEXT, FOX16_HtmlCtx, _context, this, FOX16_HtmlCtxLinker::freeData); _font=FXApp::instance()->getNormalFont(); HtmlCtx_SetGetTextWidthFn(_context, FOX16_HtmlCtxLinker::GetTextWidth); HtmlCtx_SetGetTextHeightFn(_context, FOX16_HtmlCtxLinker::GetTextHeight); HtmlCtx_SetGetColorFromNameFn(_context, FOX16_HtmlCtxLinker::GetColorFromName); HtmlCtx_SetGetFontFn(_context, FOX16_HtmlCtxLinker::GetFont); HtmlCtx_SetGetImageFn(_context, FOX16_HtmlCtxLinker::GetImage); pr=HtmlProps_new(); fnt=HtmlCtx_GetFont(_context, _font->getName().text(), _font->getSize()/10, 0); HtmlProps_SetFont(pr, fnt); HtmlCtx_SetStandardProps(_context, pr); HtmlProps_free(pr); }
AIO_OFX_GROUP *AIO_OfxGroup_INVACC_new(const char *groupName, AIO_OFX_GROUP *parent, GWEN_XML_CONTEXT *ctx) { AIO_OFX_GROUP *g; AIO_OFX_GROUP_INVACC *xg; /* create base group */ g=AIO_OfxGroup_Generic_new(groupName, parent, ctx); assert(g); GWEN_NEW_OBJECT(AIO_OFX_GROUP_INVACC, xg); assert(xg); GWEN_INHERIT_SETDATA(AIO_OFX_GROUP, AIO_OFX_GROUP_INVACC, g, xg, AIO_OfxGroup_INVACC_FreeData); /* set virtual functions */ AIO_OfxGroup_SetStartTagFn(g, AIO_OfxGroup_INVACC_StartTag); AIO_OfxGroup_SetAddDataFn(g, AIO_OfxGroup_INVACC_AddData); if (strcasecmp(groupName, "INVACCTFROM")==0 || strcasecmp(groupName, "INVACCTTO")==0) xg->accType=strdup("INVESTMENT"); return g; }
/* --------------------------------------------------------------- FUNCTION */ AH_JOB *AH_Job_GetTransactions_new(AB_PROVIDER *pro, AB_USER *u, AB_ACCOUNT *account) { AH_JOB *j; AH_JOB_GETTRANSACTIONS *aj; GWEN_DB_NODE *dbArgs; GWEN_DB_NODE *updgroup; int useCreditCardJob = 0; //Check if we should use DKKKU updgroup=AH_User_GetUpdForAccount(u, account); if (updgroup) { GWEN_DB_NODE *n; n=GWEN_DB_GetFirstGroup(updgroup); while (n) { if (strcasecmp(GWEN_DB_GetCharValue(n, "job", 0, ""), "DKKKU")==0) { useCreditCardJob = 1; break; } n=GWEN_DB_GetNextGroup(n); } /* while */ } /* if updgroup for the given account found */ if (useCreditCardJob) j=AH_AccountJob_new("JobGetTransactionsCreditCard", pro, u, account); else j=AH_AccountJob_new("JobGetTransactions", pro, u, account); if (!j) return 0; GWEN_NEW_OBJECT(AH_JOB_GETTRANSACTIONS, aj); GWEN_INHERIT_SETDATA(AH_JOB, AH_JOB_GETTRANSACTIONS, j, aj, AH_Job_GetTransactions_FreeData); AH_Job_SetSupportedCommand(j, AB_Transaction_CommandGetTransactions); /* overwrite some virtual functions */ if (useCreditCardJob) AH_Job_SetProcessFn(j, AH_Job_GetTransactionsCreditCard_Process); else AH_Job_SetProcessFn(j, AH_Job_GetTransactions_Process); AH_Job_SetGetLimitsFn(j, AH_Job_GetTransactions_GetLimits); AH_Job_SetHandleCommandFn(j, AH_Job_GetTransactions_HandleCommand); AH_Job_SetHandleResultsFn(j, AH_Job_HandleResults_Empty); /* set some known arguments */ dbArgs=AH_Job_GetArguments(j); assert(dbArgs); if (useCreditCardJob) GWEN_DB_SetCharValue(dbArgs, GWEN_DB_FLAGS_DEFAULT, "accountNumber", AB_Account_GetAccountNumber(account)); else GWEN_DB_SetCharValue(dbArgs, GWEN_DB_FLAGS_DEFAULT, "allAccounts", "N"); return j; }
HTML_OBJECT *HtmlObject_Image_new(GWEN_XML_CONTEXT *ctx) { HTML_OBJECT *o; OBJECT_IMAGE *xo; o=HtmlObject_new(ctx, HtmlObjectType_Image); GWEN_NEW_OBJECT(OBJECT_IMAGE, xo); GWEN_INHERIT_SETDATA(HTML_OBJECT, OBJECT_IMAGE, o, xo, HtmlObject_Image_FreeData); HtmlObject_SetLayoutFn(o, HtmlObject_Image_Layout); return o; }
GWEN_DIALOG *AB_CSV_EditProfileDialog_new(AB_IMEXPORTER *ie, GWEN_DB_NODE *dbProfile, const char *testFileName) { AB_BANKING *ab; GWEN_DIALOG *dlg; AB_CSV_EDIT_PROFILE_DIALOG *xdlg; GWEN_BUFFER *fbuf; int rv; assert(ie); assert(dbProfile); ab=AB_ImExporter_GetBanking(ie); dlg=GWEN_Dialog_new("ab_csv_edit_profile"); GWEN_NEW_OBJECT(AB_CSV_EDIT_PROFILE_DIALOG, xdlg); GWEN_INHERIT_SETDATA(GWEN_DIALOG, AB_CSV_EDIT_PROFILE_DIALOG, dlg, xdlg, AB_CSV_EditProfileDialog_FreeData); GWEN_Dialog_SetSignalHandler(dlg, AB_CSV_EditProfileDialog_SignalHandler); /* get path of dialog description file */ fbuf=GWEN_Buffer_new(0, 256, 0, 1); rv=GWEN_PathManager_FindFile(AB_PM_LIBNAME, AB_PM_DATADIR, "aqbanking/imexporters/csv/dialogs/csv_editprofile.dlg", fbuf); if (rv<0) { DBG_INFO(AQBANKING_LOGDOMAIN, "Dialog description file not found (%d).", rv); GWEN_Buffer_free(fbuf); GWEN_Dialog_free(dlg); return NULL; } /* read dialog from dialog description file */ rv=GWEN_Dialog_ReadXmlFile(dlg, GWEN_Buffer_GetStart(fbuf)); if (rv<0) { DBG_INFO(AQBANKING_LOGDOMAIN, "here (%d).", rv); GWEN_Buffer_free(fbuf); GWEN_Dialog_free(dlg); return NULL; } GWEN_Buffer_free(fbuf); xdlg->banking=ab; xdlg->imExporter=ie; xdlg->testFileName=testFileName; xdlg->dbProfile=dbProfile; xdlg->columns=GWEN_StringList_new(); /* done */ return dlg; }
GWEN_DIALOG *AB_SelectBankInfoDialog_new(AB_BANKING *ab, const char *country, const char *bankCode) { GWEN_DIALOG *dlg; AB_SELECTBANKINFO_DIALOG *xdlg; GWEN_BUFFER *fbuf; int rv; dlg=GWEN_Dialog_new("ab_selectbankinfo"); GWEN_NEW_OBJECT(AB_SELECTBANKINFO_DIALOG, xdlg); GWEN_INHERIT_SETDATA(GWEN_DIALOG, AB_SELECTBANKINFO_DIALOG, dlg, xdlg, AB_SelectBankInfoDialog_FreeData); GWEN_Dialog_SetSignalHandler(dlg, AB_SelectBankInfoDialog_SignalHandler); /* get path of dialog description file */ fbuf=GWEN_Buffer_new(0, 256, 0, 1); rv=GWEN_PathManager_FindFile(AB_PM_LIBNAME, AB_PM_DATADIR, "aqbanking/dialogs/dlg_selectbankinfo.dlg", fbuf); if (rv<0) { DBG_INFO(AQBANKING_LOGDOMAIN, "Dialog description file not found (%d).", rv); GWEN_Buffer_free(fbuf); GWEN_Dialog_free(dlg); return NULL; } /* read dialog from dialog description file */ rv=GWEN_Dialog_ReadXmlFile(dlg, GWEN_Buffer_GetStart(fbuf)); if (rv<0) { DBG_INFO(AQBANKING_LOGDOMAIN, "here (%d).", rv); GWEN_Buffer_free(fbuf); GWEN_Dialog_free(dlg); return NULL; } GWEN_Buffer_free(fbuf); xdlg->banking=ab; if (country) xdlg->country=strdup(country); else xdlg->country=strdup("de"); if (bankCode) xdlg->bankCode=strdup(bankCode); else xdlg->bankCode=NULL; /* done */ return dlg; }
CppDialog::CppDialog(GWEN_DIALOG *dlg) :_dialog(NULL) { _dialog=dlg; GWEN_INHERIT_SETDATA(GWEN_DIALOG, CppDialog, _dialog, this, CppDialogLinker::freeData); _setIntPropertyFn=GWEN_Dialog_SetSetIntPropertyFn(_dialog, CppDialogLinker::SetIntProperty); _getIntPropertyFn=GWEN_Dialog_SetGetIntPropertyFn(_dialog, CppDialogLinker::GetIntProperty); _setCharPropertyFn=GWEN_Dialog_SetSetCharPropertyFn(_dialog, CppDialogLinker::SetCharProperty); _getCharPropertyFn=GWEN_Dialog_SetGetCharPropertyFn(_dialog, CppDialogLinker::GetCharProperty); }
void Gtk2Gui_Dialog_Extend(GWEN_DIALOG *dlg) { GTK2_GUI_DIALOG *xdlg; GWEN_NEW_OBJECT(GTK2_GUI_DIALOG, xdlg); GWEN_INHERIT_SETDATA(GWEN_DIALOG, GTK2_GUI_DIALOG, dlg, xdlg, Gtk2Gui_Dialog_FreeData); /* set virtual functions */ xdlg->setIntPropertyFn=GWEN_Dialog_SetSetIntPropertyFn(dlg, Gtk2Gui_Dialog_SetIntProperty); xdlg->getIntPropertyFn=GWEN_Dialog_SetGetIntPropertyFn(dlg, Gtk2Gui_Dialog_GetIntProperty); xdlg->setCharPropertyFn=GWEN_Dialog_SetSetCharPropertyFn(dlg, Gtk2Gui_Dialog_SetCharProperty); xdlg->getCharPropertyFn=GWEN_Dialog_SetGetCharPropertyFn(dlg, Gtk2Gui_Dialog_GetCharProperty); }
AB_IMEXPORTER *AB_ImExporterYellowNet_new(AB_BANKING *ab) { AB_IMEXPORTER *ie; AB_IMEXPORTER_YELLOWNET *ieh; ie=AB_ImExporter_new(ab, "yellownet"); GWEN_NEW_OBJECT(AB_IMEXPORTER_YELLOWNET, ieh); GWEN_INHERIT_SETDATA(AB_IMEXPORTER, AB_IMEXPORTER_YELLOWNET, ie, ieh, AB_ImExporterYN_FreeData); AB_ImExporter_SetImportFn(ie, AB_ImExporterYN_Import); AB_ImExporter_SetCheckFileFn(ie, AB_ImExporterYN_CheckFile); return ie; }
GWEN_DIALOG *AB_NewUserDialog_new(AB_BANKING *ab, AB_PROVIDER *pro, const char *dname) { GWEN_DIALOG *dlg; AB_NEWUSER_DIALOG *xdlg; dlg=GWEN_Dialog_new(dname); GWEN_NEW_OBJECT(AB_NEWUSER_DIALOG, xdlg); GWEN_INHERIT_SETDATA(GWEN_DIALOG, AB_NEWUSER_DIALOG, dlg, xdlg, AB_NewUserDialog_FreeData); xdlg->banking=ab; xdlg->provider=pro; return dlg; }
GWEN_PLUGIN *AB_Plugin_Provider_new(GWEN_PLUGIN_MANAGER *pm, const char *name, const char *fileName) { GWEN_PLUGIN *pl; AB_PLUGIN_PROVIDER *xpl; pl=GWEN_Plugin_new(pm, name, fileName); GWEN_NEW_OBJECT(AB_PLUGIN_PROVIDER, xpl); GWEN_INHERIT_SETDATA(GWEN_PLUGIN, AB_PLUGIN_PROVIDER, pl, xpl, AB_Plugin_Provider_FreeData); return pl; }
AB_IMEXPORTER *AB_Plugin_ImExporterCtxFile_Factory(GWEN_PLUGIN *pl, AB_BANKING *ab){ AB_IMEXPORTER *ie; AH_IMEXPORTER_CTXFILE *ieh; ie=AB_ImExporter_new(ab, "ctxfile"); GWEN_NEW_OBJECT(AH_IMEXPORTER_CTXFILE, ieh); GWEN_INHERIT_SETDATA(AB_IMEXPORTER, AH_IMEXPORTER_CTXFILE, ie, ieh, AH_ImExporterCtxFile_FreeData); AB_ImExporter_SetImportFn(ie, AH_ImExporterCtxFile_Import); AB_ImExporter_SetExportFn(ie, AH_ImExporterCtxFile_Export); AB_ImExporter_SetCheckFileFn(ie, AH_ImExporterCtxFile_CheckFile); return ie; }
HTML_OBJECT *HtmlObject_GridEntry_new(GWEN_XML_CONTEXT *ctx) { HTML_OBJECT *o; OBJECT_GRIDENTRY *xo; /* derived from box object */ o=HtmlObject_Box_new(ctx); /* extend box as grid entry */ HtmlObject_SetObjectType(o, HtmlObjectType_GridEntry); GWEN_NEW_OBJECT(OBJECT_GRIDENTRY, xo); GWEN_INHERIT_SETDATA(HTML_OBJECT, OBJECT_GRIDENTRY, o, xo, HtmlObject_GridEntry_FreeData); return o; }
AB_IMEXPORTER *ofx_factory(AB_BANKING *ab, GWEN_DB_NODE *db) { AB_IMEXPORTER *ie; AH_IMEXPORTER_OFX *ieh; ie=AB_ImExporter_new(ab, "ofx"); GWEN_NEW_OBJECT(AH_IMEXPORTER_OFX, ieh); GWEN_INHERIT_SETDATA(AB_IMEXPORTER, AH_IMEXPORTER_OFX, ie, ieh, AH_ImExporterOFX_FreeData); ieh->dbData=db; AB_ImExporter_SetImportFn(ie, AH_ImExporterOFX_Import); AB_ImExporter_SetCheckFileFn(ie, AH_ImExporterOFX_CheckFile); return ie; }
GWEN_PLUGIN *GWEN_Crypt_Token_Plugin_new(GWEN_PLUGIN_MANAGER *mgr, GWEN_CRYPT_TOKEN_DEVICE devType, const char *typeName, const char *fileName) { GWEN_PLUGIN *pl; GWEN_CRYPT_TOKEN_PLUGIN *xpl; pl=GWEN_Plugin_new(mgr, typeName, fileName); GWEN_NEW_OBJECT(GWEN_CRYPT_TOKEN_PLUGIN, xpl); GWEN_INHERIT_SETDATA(GWEN_PLUGIN, GWEN_CRYPT_TOKEN_PLUGIN, pl, xpl, GWEN_Crypt_Token_Plugin_FreeData); xpl->devType=devType; return pl; }
GWEN_MDIGEST *GWEN_MDigest_Gc_new(GWEN_CRYPT_HASHALGOID a) { GWEN_MDIGEST *md; GWEN_MDIGEST_GC *xmd; GWEN_NEW_OBJECT(GWEN_MDIGEST_GC, xmd) md=GWEN_MDigest_new(a); assert(md); GWEN_INHERIT_SETDATA(GWEN_MDIGEST, GWEN_MDIGEST_GC, md, xmd, GWEN_Digest_Gc_freeData) GWEN_MDigest_SetBeginFn(md, GWEN_MDigest_Gc_Begin); GWEN_MDigest_SetEndFn(md, GWEN_MDigest_Gc_End); GWEN_MDigest_SetUpdateFn(md, GWEN_MDigest_Gc_Update); return md; }
/* --------------------------------------------------------------- FUNCTION */ AH_JOB *AH_Job_GetBalance_new(AB_USER *u, AB_ACCOUNT *account) { AH_JOB *j; AH_JOB_GETBALANCE *aj; GWEN_DB_NODE *dbArgs; int useCreditCardJob=0; GWEN_DB_NODE *updgroup; //Check if we should use DKKKS updgroup=AH_User_GetUpdForAccount(u, account); if (updgroup) { GWEN_DB_NODE *n; n=GWEN_DB_GetFirstGroup(updgroup); while(n) { if (strcasecmp(GWEN_DB_GetCharValue(n, "job", 0, ""), "DKKKS")==0) { useCreditCardJob = 1; break; } n=GWEN_DB_GetNextGroup(n); } /* while */ } /* if updgroup for the given account found */ if(useCreditCardJob) j=AH_AccountJob_new("JobGetBalanceCreditCard", u, account); else j=AH_AccountJob_new("JobGetBalance", u, account); if (!j) return 0; GWEN_NEW_OBJECT(AH_JOB_GETBALANCE, aj); GWEN_INHERIT_SETDATA(AH_JOB, AH_JOB_GETBALANCE, j, aj, AH_Job_GetBalance_FreeData); /* overwrite some virtual functions */ AH_Job_SetProcessFn(j, AH_Job_GetBalance_Process); AH_Job_SetExchangeFn(j, AH_Job_GetBalance_Exchange); /* set some known arguments */ dbArgs=AH_Job_GetArguments(j); assert(dbArgs); if(useCreditCardJob) GWEN_DB_SetCharValue(dbArgs, GWEN_DB_FLAGS_DEFAULT, "accountNumber", AB_Account_GetAccountNumber(account)); else GWEN_DB_SetCharValue(dbArgs, GWEN_DB_FLAGS_DEFAULT, "allAccounts", "N"); return j; }
GWEN_DIALOG *GWEN_DlgShowBox_new(uint32_t flags, const char *title, const char *text) { GWEN_DIALOG *dlg; GWEN_DLGSHOWBOX *xdlg; GWEN_BUFFER *fbuf; int rv; dlg=GWEN_Dialog_new("dlg_gwen_showbox"); GWEN_NEW_OBJECT(GWEN_DLGSHOWBOX, xdlg); GWEN_INHERIT_SETDATA(GWEN_DIALOG, GWEN_DLGSHOWBOX, dlg, xdlg, GWEN_DlgShowBox_FreeData); GWEN_Dialog_SetSignalHandler(dlg, GWEN_DlgShowBox_SignalHandler); /* get path of dialog description file */ fbuf=GWEN_Buffer_new(0, 256, 0, 1); rv=GWEN_PathManager_FindFile(GWEN_PM_LIBNAME, GWEN_PM_SYSDATADIR, "gwenhywfar/dialogs/dlg_showbox.dlg", fbuf); if (rv<0) { DBG_INFO(GWEN_LOGDOMAIN, "Dialog description file not found (%d).", rv); GWEN_Buffer_free(fbuf); GWEN_Dialog_free(dlg); return NULL; } /* read dialog from dialog description file */ rv=GWEN_Dialog_ReadXmlFile(dlg, GWEN_Buffer_GetStart(fbuf)); if (rv<0) { DBG_INFO(GWEN_LOGDOMAIN, "here (%d).", rv); GWEN_Buffer_free(fbuf); GWEN_Dialog_free(dlg); return NULL; } GWEN_Buffer_free(fbuf); xdlg->flags=flags; if (title) xdlg->title=strdup(title); if (text) xdlg->text=strdup(text); return dlg; }
FXFont *FOX16_HtmlCtx::_getFoxFont(HTML_FONT *fnt) { FXFont *xfnt; if (GWEN_INHERIT_ISOFTYPE(HTML_FONT, FXFont, fnt)) { xfnt=GWEN_INHERIT_GETDATA(HTML_FONT, FXFont, fnt); return xfnt; } else { FXuint size; FXuint weight; FXuint slant; FXuint encoding; FXString face; uint32_t flags; if (HtmlFont_GetFontName(fnt)) face=HtmlFont_GetFontName(fnt); else face=_font->getName(); size=HtmlFont_GetFontSize(fnt); weight=FXFont::Normal; slant=_font->getSlant(); encoding=_font->getEncoding(); flags=HtmlFont_GetFontFlags(fnt); if (flags & HTML_FONT_FLAGS_STRONG) weight=FXFont::Bold; if (flags & HTML_FONT_FLAGS_ITALIC) slant=FXFont::Italic; DBG_DEBUG(GWEN_LOGDOMAIN, "Creating font [%s], size=%d, weight=%d, slant=%d, encoding=%d", face.text(), size, weight, slant, encoding); xfnt=new FXFont(FXApp::instance(), face, size, weight, slant, encoding); if (xfnt==NULL) { DBG_ERROR(GWEN_LOGDOMAIN, "Could not create font [%s], size=%d, weight=%d, slant=%d, encoding=%d", face.text(), size, weight, slant, encoding); return NULL; } xfnt->create(); GWEN_INHERIT_SETDATA(HTML_FONT, FXFont, fnt, xfnt, FOX16_HtmlCtxLinker::freeFontData); return xfnt; } }
GWEN_DIALOG *AH_NewKeyFileDialog_new(AB_BANKING *ab) { GWEN_DIALOG *dlg; AH_NEWKEYFILE_DIALOG *xdlg; GWEN_BUFFER *fbuf; int rv; dlg=GWEN_Dialog_new("ah_setup_newkeyfile"); GWEN_NEW_OBJECT(AH_NEWKEYFILE_DIALOG, xdlg); GWEN_INHERIT_SETDATA(GWEN_DIALOG, AH_NEWKEYFILE_DIALOG, dlg, xdlg, AH_NewKeyFileDialog_FreeData); GWEN_Dialog_SetSignalHandler(dlg, AH_NewKeyFileDialog_SignalHandler); /* get path of dialog description file */ fbuf=GWEN_Buffer_new(0, 256, 0, 1); rv=GWEN_PathManager_FindFile(AB_PM_LIBNAME, AB_PM_DATADIR, "aqbanking/backends/aqhbci/dialogs/dlg_newkeyfile.dlg", fbuf); if (rv<0) { DBG_INFO(AQHBCI_LOGDOMAIN, "Dialog description file not found (%d).", rv); GWEN_Buffer_free(fbuf); GWEN_Dialog_free(dlg); return NULL; } /* read dialog from dialog description file */ rv=GWEN_Dialog_ReadXmlFile(dlg, GWEN_Buffer_GetStart(fbuf)); if (rv<0) { DBG_INFO(AQHBCI_LOGDOMAIN, "here (%d).", rv); GWEN_Gui_ShowError(I18N("Error"), I18N("Could not read dialog description file [%s], maybe an installation error (%d)?"), GWEN_Buffer_GetStart(fbuf), rv); GWEN_Buffer_free(fbuf); GWEN_Dialog_free(dlg); return NULL; } GWEN_Buffer_free(fbuf); xdlg->banking=ab; /* preset */ xdlg->hbciVersion=210; xdlg->rdhVersion=0; /* done */ return dlg; }
GWEN_DIALOG *APY_NewUserDialog_new(AB_BANKING *ab) { GWEN_DIALOG *dlg; APY_NEWUSER_DIALOG *xdlg; GWEN_BUFFER *fbuf; int rv; dlg=GWEN_Dialog_new("apy_newuser"); GWEN_NEW_OBJECT(APY_NEWUSER_DIALOG, xdlg); GWEN_INHERIT_SETDATA(GWEN_DIALOG, APY_NEWUSER_DIALOG, dlg, xdlg, APY_NewUserDialog_FreeData); GWEN_Dialog_SetSignalHandler(dlg, APY_NewUserDialog_SignalHandler); /* get path of dialog description file */ fbuf=GWEN_Buffer_new(0, 256, 0, 1); rv=GWEN_PathManager_FindFile(AB_PM_LIBNAME, AB_PM_DATADIR, "aqbanking/backends/aqpaypal/dialogs/dlg_newuser.dlg", fbuf); if (rv<0) { DBG_INFO(AQPAYPAL_LOGDOMAIN, "Dialog description file not found (%d).", rv); GWEN_Buffer_free(fbuf); GWEN_Dialog_free(dlg); return NULL; } /* read dialog from dialog description file */ rv=GWEN_Dialog_ReadXmlFile(dlg, GWEN_Buffer_GetStart(fbuf)); if (rv<0) { DBG_INFO(AQPAYPAL_LOGDOMAIN, "here (%d).", rv); GWEN_Buffer_free(fbuf); GWEN_Dialog_free(dlg); return NULL; } GWEN_Buffer_free(fbuf); xdlg->banking=ab; /* preset */ xdlg->httpVMajor=1; xdlg->httpVMinor=1; xdlg->url=strdup("https://api-3t.paypal.com/nvp"); /* done */ return dlg; }
GWEN_DIALOG *AO_NewUserDialog_new(AB_PROVIDER *pro) { GWEN_DIALOG *dlg; AO_NEWUSER_DIALOG *xdlg; GWEN_BUFFER *fbuf; int rv; dlg=GWEN_Dialog_new("ao_newuser"); GWEN_NEW_OBJECT(AO_NEWUSER_DIALOG, xdlg); GWEN_INHERIT_SETDATA(GWEN_DIALOG, AO_NEWUSER_DIALOG, dlg, xdlg, AO_NewUserDialog_FreeData); GWEN_Dialog_SetSignalHandler(dlg, AO_NewUserDialog_SignalHandler); /* get path of dialog description file */ fbuf=GWEN_Buffer_new(0, 256, 0, 1); rv=GWEN_PathManager_FindFile(AB_PM_LIBNAME, AB_PM_DATADIR, "aqbanking/backends/aqofxconnect/dialogs/dlg_newuser.dlg", fbuf); if (rv<0) { DBG_INFO(AQOFXCONNECT_LOGDOMAIN, "Dialog description file not found (%d).", rv); GWEN_Buffer_free(fbuf); GWEN_Dialog_free(dlg); return NULL; } /* read dialog from dialog description file */ rv=GWEN_Dialog_ReadXmlFile(dlg, GWEN_Buffer_GetStart(fbuf)); if (rv<0) { DBG_INFO(AQOFXCONNECT_LOGDOMAIN, "here (%d)", rv); GWEN_Buffer_free(fbuf); GWEN_Dialog_free(dlg); return NULL; } GWEN_Buffer_free(fbuf); xdlg->provider=pro; xdlg->banking=AB_Provider_GetBanking(pro); /* preset */ xdlg->httpVMajor=1; xdlg->httpVMinor=1; /* done */ return dlg; }
GWEN_CRYPTMGR *GWEN_CryptMgrKeys_new(const char *localName, GWEN_CRYPT_KEY *localKey, const char *peerName, GWEN_CRYPT_KEY *peerKey, int ownKeys) { GWEN_CRYPTMGR *cm; GWEN_CRYPTMGR_KEYS *xcm; cm=GWEN_CryptMgr_new(); GWEN_NEW_OBJECT(GWEN_CRYPTMGR_KEYS, xcm); GWEN_INHERIT_SETDATA(GWEN_CRYPTMGR, GWEN_CRYPTMGR_KEYS, cm, xcm, GWEN_CryptMgrKeys_FreeData); if (localKey) { xcm->localKey=localKey; GWEN_CryptMgr_SetLocalKeyNumber(cm, GWEN_Crypt_Key_GetKeyNumber(localKey)); GWEN_CryptMgr_SetLocalKeyVersion(cm, GWEN_Crypt_Key_GetKeyVersion(localKey)); xcm->ownLocalKey=ownKeys; } else xcm->ownLocalKey=0; if (peerKey) { xcm->peerKey=peerKey; GWEN_CryptMgr_SetPeerKeyNumber(cm, GWEN_Crypt_Key_GetKeyNumber(peerKey)); GWEN_CryptMgr_SetPeerKeyVersion(cm, GWEN_Crypt_Key_GetKeyVersion(peerKey)); xcm->ownPeerKey=ownKeys; } else xcm->ownPeerKey=0; if (localName) GWEN_CryptMgr_SetLocalKeyName(cm, localName); if (peerName) GWEN_CryptMgr_SetPeerKeyName(cm, peerName); GWEN_CryptMgr_SetSignDataFn(cm, GWEN_CryptMgrKeys_SignData); GWEN_CryptMgr_SetVerifyDataFn(cm, GWEN_CryptMgrKeys_VerifyData); GWEN_CryptMgr_SetEncryptKeyFn(cm, GWEN_CryptMgrKeys_EncryptKey); GWEN_CryptMgr_SetDecryptKeyFn(cm, GWEN_CryptMgrKeys_DecryptKey); return cm; }
GWEN_DIALOG *OH_GetInstituteDialog_new(const char *dataFolder, const char *name) { GWEN_DIALOG *dlg; OH_GETINST_DIALOG *xdlg; GWEN_BUFFER *fbuf; int rv; dlg=GWEN_Dialog_new("oh_getinst"); GWEN_NEW_OBJECT(OH_GETINST_DIALOG, xdlg); GWEN_INHERIT_SETDATA(GWEN_DIALOG, OH_GETINST_DIALOG, dlg, xdlg, OH_GetInstituteDialog_FreeData); GWEN_Dialog_SetSignalHandler(dlg, OH_GetInstituteDialog_SignalHandler); /* get path of dialog description file */ fbuf=GWEN_Buffer_new(0, 256, 0, 1); rv=GWEN_PathManager_FindFile(AB_PM_LIBNAME, AB_PM_DATADIR, "aqbanking/backends/aqofxconnect/dialogs/dlg_getinst.dlg", fbuf); if (rv<0) { DBG_INFO(AQOFXCONNECT_LOGDOMAIN, "Dialog description file not found (%d).", rv); GWEN_Buffer_free(fbuf); GWEN_Dialog_free(dlg); return NULL; } /* read dialog from dialog description file */ rv=GWEN_Dialog_ReadXmlFile(dlg, GWEN_Buffer_GetStart(fbuf)); if (rv<0) { DBG_INFO(AQOFXCONNECT_LOGDOMAIN, "here (%d).", rv); GWEN_Buffer_free(fbuf); GWEN_Dialog_free(dlg); return NULL; } GWEN_Buffer_free(fbuf); xdlg->ofxHome=OfxHome_new(dataFolder); xdlg->matchingSpecList=OH_InstituteSpec_List_new(); if (name) xdlg->name=strdup(name); /* done */ return dlg; }
HTML_IMAGE *FOX16_HtmlCtx::getImage(const char *fileName) { GWEN_STRINGLIST *sl; sl=HtmlCtx_GetMediaPaths(_context); if (sl) { GWEN_BUFFER *tbuf; int rv; FXImage *ximg; HTML_IMAGE *img; tbuf=GWEN_Buffer_new(0, 256, 0, 1); rv=GWEN_Directory_FindFileInPaths(sl, fileName, tbuf); if (rv<0) { DBG_ERROR(GWEN_LOGDOMAIN, "here (%d)", rv); GWEN_Buffer_free(tbuf); return NULL; } if (m_iconSource==NULL) m_iconSource=new FXIconSource(FXApp::instance()); ximg=m_iconSource->loadIconFile(GWEN_Buffer_GetStart(tbuf)); if (ximg==NULL) { DBG_ERROR(GWEN_LOGDOMAIN, "Could not load icon [%s]", GWEN_Buffer_GetStart(tbuf)); GWEN_Buffer_free(tbuf); return NULL; } ximg->create(); img=HtmlImage_new(); HtmlImage_SetImageName(img, GWEN_Buffer_GetStart(tbuf)); HtmlImage_SetWidth(img, ximg->getWidth()); HtmlImage_SetHeight(img, ximg->getHeight()); GWEN_INHERIT_SETDATA(HTML_IMAGE, FXImage, img, ximg, FOX16_HtmlCtxLinker::freeImageData); GWEN_Buffer_free(tbuf); return img; } else { DBG_ERROR(GWEN_LOGDOMAIN, "No media paths in dialog"); return NULL; } }
static int Gtk3Gui_WGridLayout_Setup(GWEN_WIDGET *w) { GtkWidget *g; GWEN_WIDGET *wParent; GTK3_GRIDLAYOUT_WIDGET *xw; int rows; int cols; GWEN_NEW_OBJECT(GTK3_GRIDLAYOUT_WIDGET, xw); GWEN_INHERIT_SETDATA(GWEN_WIDGET, GTK3_GRIDLAYOUT_WIDGET, w, xw, Gtk3Gui_WGridLayout_FreeData); wParent=GWEN_Widget_Tree_GetParent(w); cols=GWEN_Widget_GetColumns(w); rows=GWEN_Widget_GetRows(w); if (rows>0) { xw->sortByRow=1; xw->allocatedRows=rows; xw->allocatedColumns=1; } else { xw->sortByRow=0; xw->allocatedColumns=cols; xw->allocatedRows=1; } g=gtk_grid_new(); GWEN_Widget_SetImplData(w, GTK3_DIALOG_WIDGET_REAL, (void*) g); GWEN_Widget_SetImplData(w, GTK3_DIALOG_WIDGET_CONTENT, (void*) g); GWEN_Widget_SetSetIntPropertyFn(w, Gtk3Gui_WGridLayout_SetIntProperty); GWEN_Widget_SetGetIntPropertyFn(w, Gtk3Gui_WGridLayout_GetIntProperty); GWEN_Widget_SetSetCharPropertyFn(w, Gtk3Gui_WGridLayout_SetCharProperty); GWEN_Widget_SetGetCharPropertyFn(w, Gtk3Gui_WGridLayout_GetCharProperty); GWEN_Widget_SetAddChildGuiWidgetFn(w, Gtk3Gui_WGridLayout_AddChildGuiWidget); if (wParent) GWEN_Widget_AddChildGuiWidget(wParent, w); return 0; }