├── 3rdparty ├── bakefile │ ├── bakefile.txt │ ├── wx.bkl │ ├── wx_unix.bkl │ ├── wx_win32.bkl │ └── wx_xrc.bkl ├── bin2c │ └── bin2c.c ├── bzip2 │ ├── LICENSE │ ├── blocksort.c │ ├── bzlib.c │ ├── bzlib.h │ ├── bzlib_private.h │ ├── compress.c │ ├── crctable.c │ ├── decompress.c │ ├── huffman.c │ └── randtable.c ├── crengine │ ├── AUTHORS │ ├── LICENSE │ ├── README │ ├── crsetup.inc │ ├── css │ │ ├── doc.css │ │ ├── epub.css │ │ ├── fb2.css │ │ ├── htm.css │ │ ├── rtf.css │ │ └── txt.css │ ├── hyph │ │ ├── Bulgarian.pdb │ │ ├── Czech.pdb │ │ ├── Danish.pdb │ │ ├── English_GB.pdb │ │ ├── English_US.pdb │ │ ├── Finnish.pdb │ │ ├── French.pdb │ │ ├── German.pdb │ │ ├── Hungarian.pdb │ │ ├── Icelandic.pdb │ │ ├── Irish.pdb │ │ ├── Italian.pdb │ │ ├── Polish.pdb │ │ ├── Portuguese.pdb │ │ ├── Roman.pdb │ │ ├── Russian.pdb │ │ ├── Russian_EnGB.pdb │ │ ├── Russian_EnUS.pdb │ │ ├── Slovak.pdb │ │ ├── Slovenian.pdb │ │ ├── Spanish.pdb │ │ ├── Swedish.pdb │ │ └── Ukrain.pdb │ ├── include │ │ ├── chmfmt.h │ │ ├── cp_stats.h │ │ ├── cr3version.h │ │ ├── crengine.h │ │ ├── crgui.h │ │ ├── cri18n.h │ │ ├── crsetup.h │ │ ├── crskin.h │ │ ├── crtest.h │ │ ├── crtrace.h │ │ ├── crtxtenc.h │ │ ├── cssdef.h │ │ ├── dtddef.h │ │ ├── encodings │ │ │ ├── big5.h │ │ │ ├── big5_2003.h │ │ │ ├── cp936ext.h │ │ │ ├── gb2312.h │ │ │ ├── gbkext1.h │ │ │ ├── gbkext2.h │ │ │ ├── jisx0213.h │ │ │ └── ksc5601.h │ │ ├── epubfmt.h │ │ ├── fb2def.h │ │ ├── gammatbl.h │ │ ├── hist.h │ │ ├── hyphman.h │ │ ├── lstridmap.h │ │ ├── lvarray.h │ │ ├── lvbmpbuf.h │ │ ├── lvdocview.h │ │ ├── lvdrawbuf.h │ │ ├── lvfnt.h │ │ ├── lvfntman.h │ │ ├── lvhashtable.h │ │ ├── lvimg.h │ │ ├── lvmemman.h │ │ ├── lvpagesplitter.h │ │ ├── lvptrvec.h │ │ ├── lvref.h │ │ ├── lvrefcache.h │ │ ├── lvrend.h │ │ ├── lvstream.h │ │ ├── lvstring.h │ │ ├── lvstsheet.h │ │ ├── lvstyles.h │ │ ├── lvtextfm.h │ │ ├── lvthread.h │ │ ├── lvtinydom.h │ │ ├── lvtypes.h │ │ ├── lvxml.h │ │ ├── pdbfmt.h │ │ ├── props.h │ │ ├── rtfcmd.h │ │ ├── rtfimp.h │ │ ├── s32utils.h │ │ ├── txtselector.h │ │ ├── w32utils.h │ │ ├── wolutil.h │ │ ├── wordfmt.h │ │ └── xutils.h │ └── src │ │ ├── chmfmt.cpp │ │ ├── cp_stats.cpp │ │ ├── crgui.cpp │ │ ├── cri18n.cpp │ │ ├── crskin.cpp │ │ ├── crtest.cpp │ │ ├── crtxtenc.cpp │ │ ├── epubfmt.cpp │ │ ├── hist.cpp │ │ ├── hyphman.cpp │ │ ├── lstridmap.cpp │ │ ├── lvbmpbuf.cpp │ │ ├── lvdocview.cpp │ │ ├── lvdrawbuf.cpp │ │ ├── lvfnt.cpp │ │ ├── lvfntman.cpp │ │ ├── lvimg.cpp │ │ ├── lvmemman.cpp │ │ ├── lvpagesplitter.cpp │ │ ├── lvrend.cpp │ │ ├── lvstream.cpp │ │ ├── lvstring.cpp │ │ ├── lvstsheet.cpp │ │ ├── lvstyles.cpp │ │ ├── lvtextfm.cpp │ │ ├── lvtinydom.cpp │ │ ├── lvxml.cpp │ │ ├── pdbfmt.cpp │ │ ├── props.cpp │ │ ├── rtfimp.cpp │ │ ├── s32utils.cpp │ │ ├── txtselector.cpp │ │ ├── w32utils.cpp │ │ ├── wolutil.cpp │ │ ├── wordfmt.cpp │ │ └── xutils.cpp ├── expat │ ├── amigaconfig.h │ ├── ascii.h │ ├── asciitab.h │ ├── expat.h │ ├── expat_external.h │ ├── iasciitab.h │ ├── internal.h │ ├── latin1tab.h │ ├── macconfig.h │ ├── nametab.h │ ├── utf8tab.h │ ├── winconfig.h │ ├── xmlparse.c │ ├── xmlrole.c │ ├── xmlrole.h │ ├── xmltok.c │ ├── xmltok.h │ ├── xmltok_impl.c │ ├── xmltok_impl.h │ └── xmltok_ns.c ├── faxpp │ ├── ChangeLog │ ├── LICENSE │ ├── Makefile.am │ ├── Makefile.in │ ├── TODO │ ├── aclocal.m4 │ ├── configure │ ├── configure.in │ ├── docs │ │ ├── Doxyfile.api │ │ ├── api │ │ │ ├── annotated.html │ │ │ ├── doxygen.css │ │ │ ├── doxygen.png │ │ │ ├── entity__resolver_8c-example.html │ │ │ ├── error_8h-source.html │ │ │ ├── error_8h.html │ │ │ ├── error_8h__dep__incl.map │ │ │ ├── error_8h__dep__incl.md5 │ │ │ ├── error_8h__dep__incl.png │ │ │ ├── event_8h-source.html │ │ │ ├── event_8h.html │ │ │ ├── event_8h__dep__incl.map │ │ │ ├── event_8h__dep__incl.md5 │ │ │ ├── event_8h__dep__incl.png │ │ │ ├── event_8h__incl.map │ │ │ ├── event_8h__incl.md5 │ │ │ ├── event_8h__incl.png │ │ │ ├── examples.html │ │ │ ├── files.html │ │ │ ├── functions.html │ │ │ ├── functions_func.html │ │ │ ├── functions_vars.html │ │ │ ├── globals.html │ │ │ ├── globals_0x62.html │ │ │ ├── globals_0x63.html │ │ │ ├── globals_0x64.html │ │ │ ├── globals_0x65.html │ │ │ ├── globals_0x66.html │ │ │ ├── globals_0x67.html │ │ │ ├── globals_0x68.html │ │ │ ├── globals_0x69.html │ │ │ ├── globals_0x6c.html │ │ │ ├── globals_0x6e.html │ │ │ ├── globals_0x6f.html │ │ │ ├── globals_0x70.html │ │ │ ├── globals_0x71.html │ │ │ ├── globals_0x72.html │ │ │ ├── globals_0x73.html │ │ │ ├── globals_0x74.html │ │ │ ├── globals_0x75.html │ │ │ ├── globals_0x77.html │ │ │ ├── globals_0x78.html │ │ │ ├── globals_defs.html │ │ │ ├── globals_enum.html │ │ │ ├── globals_eval.html │ │ │ ├── globals_func.html │ │ │ ├── globals_type.html │ │ │ ├── globals_vars.html │ │ │ ├── graph_legend.dot │ │ │ ├── graph_legend.html │ │ │ ├── graph_legend.png │ │ │ ├── index.html │ │ │ ├── output__event_8c-example.html │ │ │ ├── parser_8h-source.html │ │ │ ├── parser_8h.html │ │ │ ├── parser_8h__incl.map │ │ │ ├── parser_8h__incl.md5 │ │ │ ├── parser_8h__incl.png │ │ │ ├── parser__example_8c-example.html │ │ │ ├── structFAXPP__AttrValue__s.html │ │ │ ├── structFAXPP__Attribute.html │ │ │ ├── structFAXPP__Event.html │ │ │ ├── structFAXPP__Parser.html │ │ │ ├── structFAXPP__Text.html │ │ │ ├── structFAXPP__Token.html │ │ │ ├── structFAXPP__Tokenizer.html │ │ │ ├── structFAXPP__Transcoder.html │ │ │ ├── tab_b.gif │ │ │ ├── tab_l.gif │ │ │ ├── tab_r.gif │ │ │ ├── tabs.css │ │ │ ├── text_8h-source.html │ │ │ ├── text_8h.html │ │ │ ├── text_8h__dep__incl.map │ │ │ ├── text_8h__dep__incl.md5 │ │ │ ├── text_8h__dep__incl.png │ │ │ ├── token_8h-source.html │ │ │ ├── token_8h.html │ │ │ ├── token_8h__dep__incl.map │ │ │ ├── token_8h__dep__incl.md5 │ │ │ ├── token_8h__dep__incl.png │ │ │ ├── token_8h__incl.map │ │ │ ├── token_8h__incl.md5 │ │ │ ├── token_8h__incl.png │ │ │ ├── tokenizer_8h-source.html │ │ │ ├── tokenizer_8h.html │ │ │ ├── tokenizer_8h__incl.map │ │ │ ├── tokenizer_8h__incl.md5 │ │ │ ├── tokenizer_8h__incl.png │ │ │ ├── tokenizer__example_8c-example.html │ │ │ ├── transcode_8h-source.html │ │ │ ├── transcode_8h.html │ │ │ ├── transcode_8h__dep__incl.map │ │ │ ├── transcode_8h__dep__incl.md5 │ │ │ ├── transcode_8h__dep__incl.png │ │ │ ├── transcode_8h__incl.map │ │ │ ├── transcode_8h__incl.md5 │ │ │ └── transcode_8h__incl.png │ │ └── header.html │ ├── examples │ │ ├── entity_resolver.c │ │ ├── entity_resolver.h │ │ ├── output_event.c │ │ ├── output_event.h │ │ ├── parser_example.c │ │ └── tokenizer_example.c │ ├── include │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ └── faxpp │ │ │ ├── error.h │ │ │ ├── event.h │ │ │ ├── parser.h │ │ │ ├── text.h │ │ │ ├── token.h │ │ │ ├── tokenizer.h │ │ │ └── transcode.h │ ├── src │ │ ├── attlistdecl.c │ │ ├── attr_states.h │ │ ├── buffer.c │ │ ├── buffer.h │ │ ├── cdata.c │ │ ├── char_classes.c │ │ ├── char_classes.h │ │ ├── comment.c │ │ ├── conditional.c │ │ ├── config.h.in │ │ ├── doctype.c │ │ ├── element.c │ │ ├── element_states.h │ │ ├── elementdecl.c │ │ ├── entitydecl.c │ │ ├── error.c │ │ ├── event.c │ │ ├── notationdecl.c │ │ ├── pi.c │ │ ├── reference.c │ │ ├── system_public_states.h │ │ ├── token.c │ │ ├── tokenizer_states.c │ │ ├── tokenizer_states.h │ │ ├── transcode.c │ │ ├── xml_parser.c │ │ ├── xml_parser.h │ │ ├── xml_tokenizer.c │ │ ├── xml_tokenizer.h │ │ └── xmldecl.c │ └── tests │ │ └── xmlconf_runner.c ├── gnome │ ├── document-new.png │ ├── document-open.png │ ├── document-save.png │ ├── format-justify-left.png │ └── format-justify-right.png ├── sqlite3 │ ├── shell.c │ ├── sqlite3.c │ ├── sqlite3.h │ └── sqlite3ext.h ├── wxbzipstream │ ├── README.txt │ ├── bzipcopy.cpp │ ├── bzipstream.cpp │ └── bzipstream.h └── wxsqlite3 │ ├── LICENCE.txt │ ├── Readme.txt │ ├── include │ └── wx │ │ ├── wxsqlite3.h │ │ ├── wxsqlite3def.h │ │ ├── wxsqlite3dyn.h │ │ └── wxsqlite3opt.h │ └── src │ └── wxsqlite3.cpp ├── AUTHORS ├── ChangeLog ├── INSTALL ├── LICENSE ├── Makefile.in ├── README ├── aclocal.m4 ├── autoconf_inc.m4 ├── config.guess ├── config.sub ├── configure ├── configure.in ├── debian ├── changelog ├── compat ├── copyright ├── dirs ├── docs ├── menu ├── myrulib-cr │ ├── control │ └── rules ├── myrulib │ ├── control │ └── rules └── source │ └── format ├── desktop ├── 016.png ├── 032.png ├── 048.png ├── 064.png ├── 128.png ├── 256.png ├── 512.png ├── info.plist ├── myrulib.icns └── myrulib.ico ├── install-sh ├── myrulib.bkl ├── rpmbuild ├── myrulib-cr.spec └── myrulib.spec ├── scripts ├── Common │ ├── database.php │ ├── datafile.php │ ├── genres.php │ └── strutils.php ├── Flibusta │ ├── conv_book.php │ ├── conv_info.php │ └── download.sh ├── GenLib │ ├── CreateGen.sh │ └── conv-gen.php ├── LibRusEc │ ├── convert.php │ └── download.sh ├── Traum │ ├── cv_traum.php │ └── download.sh └── TraumEpub │ ├── cv_traum.php │ └── download.sh ├── sources ├── MyRuLib │ ├── FbAlphabet.cpp │ ├── FbAlphabet.h │ ├── FbBookEvent.cpp │ ├── FbBookEvent.h │ ├── FbBookMenu.cpp │ ├── FbBookMenu.h │ ├── FbBookPanel.cpp │ ├── FbBookPanel.h │ ├── FbBookTraverser.cpp │ ├── FbBookTraverser.h │ ├── FbBookTypes.h │ ├── FbCacheBook.cpp │ ├── FbCacheBook.h │ ├── FbClientData.h │ ├── FbCollection.cpp │ ├── FbCollection.h │ ├── FbColumns.cpp │ ├── FbColumns.h │ ├── FbConst.cpp │ ├── FbConst.h │ ├── FbDataPath.cpp │ ├── FbDataPath.h │ ├── FbDatabase.cpp │ ├── FbDatabase.h │ ├── FbDateTime.cpp │ ├── FbDateTime.h │ ├── FbDeleteThread.cpp │ ├── FbDeleteThread.h │ ├── FbDownloader.cpp │ ├── FbDownloader.h │ ├── FbEditBook.cpp │ ├── FbEditBook.h │ ├── FbExtractInfo.cpp │ ├── FbExtractInfo.h │ ├── FbFileReader.cpp │ ├── FbFileReader.h │ ├── FbFilterObj.cpp │ ├── FbFilterObj.h │ ├── FbFilterThread.cpp │ ├── FbFilterThread.h │ ├── FbFrameThread.cpp │ ├── FbFrameThread.h │ ├── FbGenreThread.cpp │ ├── FbGenreThread.h │ ├── FbGenres.cpp │ ├── FbGenres.h │ ├── FbImportCtx.cpp │ ├── FbImportCtx.h │ ├── FbImportReader.cpp │ ├── FbImportReader.h │ ├── FbImportThread.cpp │ ├── FbImportThread.h │ ├── FbImportWizard.cpp │ ├── FbImportWizard.h │ ├── FbInternetBook.cpp │ ├── FbInternetBook.h │ ├── FbLocale.cpp │ ├── FbLocale.h │ ├── FbLogStream.cpp │ ├── FbLogStream.h │ ├── FbLogoBitmap.h │ ├── FbMainFrame.cpp │ ├── FbMainFrame.h │ ├── FbMainMenu.cpp │ ├── FbMainMenu.h │ ├── FbMasterInfo.cpp │ ├── FbMasterInfo.h │ ├── FbMasterThread.cpp │ ├── FbMasterThread.h │ ├── FbMasterTypes.cpp │ ├── FbMasterTypes.h │ ├── FbMenu.cpp │ ├── FbMenu.h │ ├── FbParams.cpp │ ├── FbParams.h │ ├── FbParsingCtx.cpp │ ├── FbParsingCtx.h │ ├── FbPreviewReader.cpp │ ├── FbPreviewReader.h │ ├── FbPreviewThread.cpp │ ├── FbPreviewThread.h │ ├── FbPreviewWindow.cpp │ ├── FbPreviewWindow.h │ ├── FbServiceThread.cpp │ ├── FbServiceThread.h │ ├── FbSmartPtr.h │ ├── FbString.h │ ├── FbStringHash.h │ ├── FbThread.cpp │ ├── FbThread.h │ ├── FbUpdateThread.cpp │ ├── FbUpdateThread.h │ ├── FbViewContext.cpp │ ├── FbViewContext.h │ ├── FbViewData.cpp │ ├── FbViewData.h │ ├── FbViewThread.cpp │ ├── FbViewThread.h │ ├── FbWindow.cpp │ ├── FbWindow.h │ ├── MyRuLibApp.cpp │ ├── MyRuLibApp.h │ ├── VacuumThread.cpp │ ├── VacuumThread.h │ ├── controls │ │ ├── FbChoiceCtrl.cpp │ │ ├── FbChoiceCtrl.h │ │ ├── FbComboBox.cpp │ │ ├── FbComboBox.h │ │ ├── FbHtmlWindow.cpp │ │ ├── FbHtmlWindow.h │ │ ├── FbLogModel.cpp │ │ ├── FbLogModel.h │ │ ├── FbNotebook.cpp │ │ ├── FbNotebook.h │ │ ├── FbSearchCombo.cpp │ │ ├── FbSearchCombo.h │ │ ├── FbSearchCtrl.cpp │ │ ├── FbSearchCtrl.h │ │ ├── FbToolBar.cpp │ │ ├── FbToolBar.h │ │ ├── FbTreeModel.cpp │ │ ├── FbTreeModel.h │ │ ├── FbTreeView.cpp │ │ ├── FbTreeView.h │ │ ├── FbURL.cpp │ │ ├── FbURL.h │ │ ├── FbViewItem.cpp │ │ ├── FbViewItem.h │ │ ├── ProgressBar.cpp │ │ └── ProgressBar.h │ ├── desktop │ │ ├── home-128x128.png │ │ ├── home-32x32.png │ │ ├── home-64x64.png │ │ ├── myrulib.desktop │ │ └── myrulib.png │ ├── dialogs │ │ ├── FbAboutDlg.cpp │ │ ├── FbAboutDlg.h │ │ ├── FbAuthorDlg.cpp │ │ ├── FbAuthorDlg.h │ │ ├── FbColumnDlg.cpp │ │ ├── FbColumnDlg.h │ │ ├── FbConfigDlg.cpp │ │ ├── FbConfigDlg.h │ │ ├── FbConvertDlg.cpp │ │ ├── FbConvertDlg.h │ │ ├── FbDataOpenDlg.cpp │ │ ├── FbDataOpenDlg.h │ │ ├── FbDirImportDlg.cpp │ │ ├── FbDirImportDlg.h │ │ ├── FbExportDlg.cpp │ │ ├── FbExportDlg.h │ │ ├── FbFilterDlg.cpp │ │ ├── FbFilterDlg.h │ │ ├── FbParamsDlg.cpp │ │ ├── FbParamsDlg.h │ │ ├── FbProgressDlg.cpp │ │ ├── FbProgressDlg.h │ │ ├── FbReaderDlg.cpp │ │ ├── FbReaderDlg.h │ │ ├── FbSequenDlg.cpp │ │ ├── FbSequenDlg.h │ │ ├── FbServiceDlg.cpp │ │ ├── FbServiceDlg.h │ │ ├── FbTitleDlg.cpp │ │ ├── FbTitleDlg.h │ │ ├── FbViewerDlg.cpp │ │ └── FbViewerDlg.h │ ├── frames │ │ ├── FbCoolReader.cpp │ │ ├── FbCoolReader.h │ │ ├── FbFrameAuth.cpp │ │ ├── FbFrameAuth.h │ │ ├── FbFrameBase.cpp │ │ ├── FbFrameBase.h │ │ ├── FbFrameClss.cpp │ │ ├── FbFrameClss.h │ │ ├── FbFrameDate.cpp │ │ ├── FbFrameDate.h │ │ ├── FbFrameDown.cpp │ │ ├── FbFrameDown.h │ │ ├── FbFrameFind.cpp │ │ ├── FbFrameFind.h │ │ ├── FbFrameFldr.cpp │ │ ├── FbFrameFldr.h │ │ ├── FbFrameGenr.cpp │ │ ├── FbFrameGenr.h │ │ ├── FbFrameHtml.cpp │ │ ├── FbFrameHtml.h │ │ ├── FbFrameInfo.cpp │ │ ├── FbFrameInfo.h │ │ ├── FbFrameSeqn.cpp │ │ └── FbFrameSeqn.h │ ├── locale │ │ ├── be.po │ │ ├── cs.po │ │ ├── myrulib.pot │ │ ├── ru.po │ │ ├── sv.po │ │ └── uk.po │ ├── models │ │ ├── FbAuthList.cpp │ │ ├── FbAuthList.h │ │ ├── FbBookList.cpp │ │ ├── FbBookList.h │ │ ├── FbBookTree.cpp │ │ ├── FbBookTree.h │ │ ├── FbClssTree.cpp │ │ ├── FbClssTree.h │ │ ├── FbDateTree.cpp │ │ ├── FbDateTree.h │ │ ├── FbDownList.cpp │ │ ├── FbDownList.h │ │ ├── FbExportTree.cpp │ │ ├── FbExportTree.h │ │ ├── FbFilterTree.cpp │ │ ├── FbFilterTree.h │ │ ├── FbFldrTree.cpp │ │ ├── FbFldrTree.h │ │ ├── FbGenrTree.cpp │ │ ├── FbGenrTree.h │ │ ├── FbSeqnList.cpp │ │ └── FbSeqnList.h │ ├── polarssl │ │ ├── config.h │ │ ├── md5.c │ │ └── md5.h │ ├── res │ │ ├── add.xpm │ │ ├── checked.xpm │ │ ├── checkout.xpm │ │ ├── del.xpm │ │ ├── delete.xpm │ │ ├── home.ico │ │ ├── home.xpm │ │ ├── ico_djvu.xpm │ │ ├── ico_pdf.xpm │ │ ├── library.ico │ │ ├── mod.xpm │ │ ├── modify.xpm │ │ ├── nocheck.xpm │ │ ├── pause.xpm │ │ ├── resource.rc │ │ └── start.xpm │ └── wx │ │ ├── FbSQLite3.h │ │ ├── base64.cpp │ │ ├── base64.h │ │ └── unictabl.inc ├── ZipScaner │ └── ZipScan.cpp ├── config.h.in ├── myrulib.sln ├── myrulib.workspace ├── testtree │ ├── FbTreeModel.cpp │ ├── FbTreeModel.h │ ├── FbTreeView.cpp │ ├── FbTreeView.h │ ├── FbViewItem.cpp │ ├── FbViewItem.h │ ├── TestApp.cpp │ ├── TestApp.h │ ├── TestMain.cpp │ ├── TestMain.h │ ├── TreeView.cbp │ ├── TreeView.sln │ └── TreeView.vcproj └── workspace │ ├── crengine.cbp │ ├── crengine.vcproj │ ├── expat.cbp │ ├── expat.vcproj │ ├── faxpp.cbp │ ├── myrulib.cbp │ ├── myrulib.vcproj │ ├── sqlite3.cbp │ ├── wxbzipstream.cbp │ ├── wxsqlite3.cbp │ └── zipscan.vcproj ├── tarball.sh ├── ubuntu.sh ├── windows.sh └── xcode.sh /3rdparty/bin2c/bin2c.c: -------------------------------------------------------------------------------- 1 | /* 2 | * bin2c: A Program to convert binary data into C source code 3 | * Copyright 2004 by Adrian Prantl 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | */ 11 | 12 | #include 13 | #include 14 | 15 | char* self = 0; 16 | 17 | void usage() 18 | { 19 | printf("Usage:\n%s input_binary_file output_c_file symbol_name\n\n", self); 20 | } 21 | 22 | void bail_out(const char* s1, const char* s2) 23 | { 24 | fprintf(stderr, "%s: FATAL ERROR:\n%s%s\n", self, s1, s2); 25 | } 26 | 27 | int main(int argc, char** argv) 28 | { 29 | FILE *fi, *fo; 30 | int c, i; 31 | 32 | self = argv[0]; 33 | 34 | if (argc != 4) { 35 | usage(); 36 | return 1; 37 | } 38 | 39 | if ((fi = fopen(argv[1], "rb")) == 0) { 40 | bail_out("Cannot open input file ", argv[1]); 41 | return 1; 42 | } 43 | 44 | if ((fo = fopen(argv[2], "w")) == 0) { 45 | bail_out("Cannot open output file ", argv[2]); 46 | return 1; 47 | } 48 | 49 | fprintf(fo, "const unsigned char locale_binary_%s[] = {\n", argv[3]); 50 | 51 | i = 0; 52 | while ((c = fgetc(fi)) != EOF) { 53 | fprintf(fo, " 0x%02x,", (unsigned char)c); 54 | if (++i == 12) { 55 | fprintf(fo, "\n"); 56 | i = 0; 57 | } 58 | } 59 | fprintf(fo, " };\n"); 60 | 61 | printf("converted %s\n", argv[1]); 62 | 63 | return 0; 64 | } 65 | 66 | -------------------------------------------------------------------------------- /3rdparty/bzip2/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------- 3 | 4 | This program, "bzip2", the associated library "libbzip2", and all 5 | documentation, are copyright (C) 1996-2010 Julian R Seward. All 6 | rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions 10 | are met: 11 | 12 | 1. Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | 15 | 2. The origin of this software must not be misrepresented; you must 16 | not claim that you wrote the original software. If you use this 17 | software in a product, an acknowledgment in the product 18 | documentation would be appreciated but is not required. 19 | 20 | 3. Altered source versions must be plainly marked as such, and must 21 | not be misrepresented as being the original software. 22 | 23 | 4. The name of the author may not be used to endorse or promote 24 | products derived from this software without specific prior written 25 | permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS 28 | OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 30 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 31 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 32 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 33 | GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 34 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 36 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 37 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38 | 39 | Julian Seward, jseward@bzip.org 40 | bzip2/libbzip2 version 1.0.6 of 6 September 2010 41 | 42 | -------------------------------------------------------------------------- 43 | -------------------------------------------------------------------------------- /3rdparty/crengine/AUTHORS: -------------------------------------------------------------------------------- 1 | Vadim Lopatin 2 | 3 | -------------------------------------------------------------------------------- /3rdparty/crengine/README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/crengine/README -------------------------------------------------------------------------------- /3rdparty/crengine/crsetup.inc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define CR_WX_SUPPORT 1 4 | #define CR_EMULATE_GETTEXT 1 5 | #define CHM_SUPPORT_ENABLED 0 6 | #define USE_BITMAP_FONTS 0 7 | 8 | #ifndef _WIN32 9 | #define USE_FREETYPE 1 10 | #endif 11 | 12 | #define ENABLE_ANTIWORD 0 13 | -------------------------------------------------------------------------------- /3rdparty/crengine/hyph/Bulgarian.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/crengine/hyph/Bulgarian.pdb -------------------------------------------------------------------------------- /3rdparty/crengine/hyph/Czech.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/crengine/hyph/Czech.pdb -------------------------------------------------------------------------------- /3rdparty/crengine/hyph/Danish.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/crengine/hyph/Danish.pdb -------------------------------------------------------------------------------- /3rdparty/crengine/hyph/English_GB.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/crengine/hyph/English_GB.pdb -------------------------------------------------------------------------------- /3rdparty/crengine/hyph/English_US.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/crengine/hyph/English_US.pdb -------------------------------------------------------------------------------- /3rdparty/crengine/hyph/Finnish.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/crengine/hyph/Finnish.pdb -------------------------------------------------------------------------------- /3rdparty/crengine/hyph/French.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/crengine/hyph/French.pdb -------------------------------------------------------------------------------- /3rdparty/crengine/hyph/German.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/crengine/hyph/German.pdb -------------------------------------------------------------------------------- /3rdparty/crengine/hyph/Hungarian.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/crengine/hyph/Hungarian.pdb -------------------------------------------------------------------------------- /3rdparty/crengine/hyph/Icelandic.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/crengine/hyph/Icelandic.pdb -------------------------------------------------------------------------------- /3rdparty/crengine/hyph/Irish.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/crengine/hyph/Irish.pdb -------------------------------------------------------------------------------- /3rdparty/crengine/hyph/Italian.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/crengine/hyph/Italian.pdb -------------------------------------------------------------------------------- /3rdparty/crengine/hyph/Polish.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/crengine/hyph/Polish.pdb -------------------------------------------------------------------------------- /3rdparty/crengine/hyph/Portuguese.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/crengine/hyph/Portuguese.pdb -------------------------------------------------------------------------------- /3rdparty/crengine/hyph/Roman.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/crengine/hyph/Roman.pdb -------------------------------------------------------------------------------- /3rdparty/crengine/hyph/Russian.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/crengine/hyph/Russian.pdb -------------------------------------------------------------------------------- /3rdparty/crengine/hyph/Russian_EnGB.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/crengine/hyph/Russian_EnGB.pdb -------------------------------------------------------------------------------- /3rdparty/crengine/hyph/Russian_EnUS.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/crengine/hyph/Russian_EnUS.pdb -------------------------------------------------------------------------------- /3rdparty/crengine/hyph/Slovak.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/crengine/hyph/Slovak.pdb -------------------------------------------------------------------------------- /3rdparty/crengine/hyph/Slovenian.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/crengine/hyph/Slovenian.pdb -------------------------------------------------------------------------------- /3rdparty/crengine/hyph/Spanish.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/crengine/hyph/Spanish.pdb -------------------------------------------------------------------------------- /3rdparty/crengine/hyph/Swedish.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/crengine/hyph/Swedish.pdb -------------------------------------------------------------------------------- /3rdparty/crengine/hyph/Ukrain.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/crengine/hyph/Ukrain.pdb -------------------------------------------------------------------------------- /3rdparty/crengine/include/chmfmt.h: -------------------------------------------------------------------------------- 1 | #ifndef CHMFMT_H 2 | #define CHMFMT_H 3 | 4 | #include "../include/crsetup.h" 5 | #include "../include/lvtinydom.h" 6 | 7 | #if CHM_SUPPORT_ENABLED==1 8 | 9 | bool DetectCHMFormat( LVStreamRef stream ); 10 | bool ImportCHMDocument( LVStreamRef stream, ldomDocument * doc, LVDocViewCallback * progressCallback, CacheLoadingCallback * formatCallback ); 11 | 12 | /// opens CHM container 13 | LVContainerRef LVOpenCHMContainer( LVStreamRef stream ); 14 | 15 | #endif 16 | 17 | #endif // CHMFMT_H 18 | -------------------------------------------------------------------------------- /3rdparty/crengine/include/cp_stats.h: -------------------------------------------------------------------------------- 1 | typedef struct { 2 | unsigned char ch1; 3 | unsigned char ch2; 4 | short count; 5 | } dbl_char_stat_t; 6 | 7 | typedef struct { 8 | unsigned char ch1; 9 | unsigned char ch2; 10 | int count; 11 | } dbl_char_stat_long_t; 12 | -------------------------------------------------------------------------------- /3rdparty/crengine/include/cr3version.h: -------------------------------------------------------------------------------- 1 | #define CR_ENGINE_VERSION "3.0.57-15" 2 | #define CR_ENGINE_BUILD_DATE "2012-05-29" 3 | -------------------------------------------------------------------------------- /3rdparty/crengine/include/cri18n.h: -------------------------------------------------------------------------------- 1 | /** \file cri18n.h 2 | \brief internationalization support, gettext wrapper 3 | 4 | CoolReader Engine 5 | 6 | (c) Vadim Lopatin, 2000-2006 7 | This source code is distributed under the terms of 8 | GNU General Public License. 9 | See LICENSE file for details. 10 | 11 | */ 12 | 13 | #ifndef __CRI18N_H_INCLUDED__ 14 | #define __CRI18N_H_INCLUDED__ 15 | 16 | #if CR_EMULATE_GETTEXT!=1 && !defined(_WIN32) 17 | #include 18 | #endif 19 | 20 | #include "lvstring.h" 21 | #include "lvptrvec.h" 22 | 23 | /// i18n interface 24 | class CRI18NTranslator 25 | { 26 | protected: 27 | static CRI18NTranslator * _translator; 28 | virtual const char * getText( const char * src ) = 0; 29 | public: 30 | virtual ~CRI18NTranslator() { } 31 | static void setTranslator( CRI18NTranslator * translator ); 32 | static const char * translate( const char * src ); 33 | static const lString8 translate8( const char * src ); 34 | static const lString16 translate16( const char * src ); 35 | }; 36 | 37 | class CRMoFileTranslator : public CRI18NTranslator 38 | { 39 | public: 40 | class Item { 41 | public: 42 | lString8 src; 43 | lString8 dst; 44 | Item( lString8 srcText, lString8 dstText ) 45 | : src(srcText), dst(dstText) 46 | { 47 | } 48 | protected: 49 | // no copy 50 | Item( const Item & ) { } 51 | Item & operator = ( const Item & ) { return *this; } 52 | }; 53 | protected: 54 | LVPtrVector _list; 55 | // call in src sort order only! 56 | virtual void add( lString8 src, lString8 dst ); 57 | virtual const char * getText( const char * src ); 58 | virtual void sort(); 59 | public: 60 | CRMoFileTranslator(); 61 | bool openMoFile( lString16 fileName ); 62 | virtual ~CRMoFileTranslator(); 63 | }; 64 | 65 | #ifdef _ 66 | #undef _ 67 | #endif 68 | #ifdef _8 69 | #undef _8 70 | #endif 71 | #ifdef _16 72 | #undef _16 73 | #endif 74 | #define _(String) CRI18NTranslator::translate(String) 75 | #define _8(String) CRI18NTranslator::translate8(String) 76 | #define _16(String) CRI18NTranslator::translate16(String) 77 | 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /3rdparty/crengine/include/crtest.h: -------------------------------------------------------------------------------- 1 | #ifndef CRTEST_H 2 | #define CRTEST_H 3 | 4 | #include "lvtypes.h" 5 | #include "lvstring.h" 6 | #include "lvstream.h" 7 | 8 | #define MYASSERT(x,t) \ 9 | if (!(x)) { \ 10 | CRLog::error("Assertion failed at %s #%d : %s", __FILE__, __LINE__, t); \ 11 | crFatalError(1111, "Exiting: UnitTest assertion failed"); \ 12 | } 13 | 14 | 15 | LVStreamRef LVCreateCompareTestStream( LVStreamRef stream1, LVStreamRef stream2 ); 16 | 17 | void runCRUnitTests(); 18 | 19 | #endif // CRTEST_H 20 | -------------------------------------------------------------------------------- /3rdparty/crengine/include/crtrace.h: -------------------------------------------------------------------------------- 1 | #ifndef __CRTRACE 2 | #define __CRTRACE 1 3 | 4 | #include "lvstring.h" 5 | 6 | struct endtrace { 7 | endtrace() {} 8 | }; 9 | 10 | class crtrace { 11 | lString8 buffer_; 12 | public: 13 | crtrace() : buffer_() {} 14 | crtrace(const char *c) : buffer_(c) {} 15 | virtual ~crtrace() { flush(); } 16 | void flush() { 17 | CRLog::info(buffer_.c_str()); 18 | buffer_.clear(); 19 | } 20 | 21 | crtrace& operator << (const char *s) { 22 | buffer_.append(s); 23 | return *this; 24 | } 25 | 26 | crtrace& operator << (const lString8& ls8) { 27 | buffer_.append(ls8); 28 | return *this; 29 | } 30 | 31 | crtrace& operator << (const lString16& ls16) { 32 | buffer_.append(UnicodeToUtf8(ls16)); 33 | return *this; 34 | } 35 | 36 | crtrace& operator << (int i) { 37 | buffer_.append(lString8::itoa(i)); 38 | return *this; 39 | } 40 | 41 | void operator << (const endtrace&) { 42 | flush(); 43 | } 44 | 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /3rdparty/crengine/include/encodings/cp936ext.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2001 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Library General Public 7 | * License as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, write to the Free Software Foundation, Inc., 51 Franklin Street, 18 | * Fifth Floor, Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | /* 22 | * CP936 extensions 23 | */ 24 | 25 | static const unsigned short cp936ext_2uni_pagea6[181-159] = { 26 | /* 0xa6 */ 27 | 0xfe35, 28 | 0xfe36, 0xfe39, 0xfe3a, 0xfe3f, 0xfe40, 0xfe3d, 0xfe3e, 0xfe41, 29 | 0xfe42, 0xfe43, 0xfe44, 0xfffd, 0xfffd, 0xfe3b, 0xfe3c, 0xfe37, 30 | 0xfe38, 0xfe31, 0xfffd, 0xfe33, 0xfe34, 31 | }; 32 | static const unsigned short cp936ext_2uni_pagea8[128-122] = { 33 | /* 0xa8 */ 34 | 0x0251, 0xfffd, 0x0144, 0x0148, 0xfffd, 0x0261, 35 | }; 36 | 37 | -------------------------------------------------------------------------------- /3rdparty/crengine/include/epubfmt.h: -------------------------------------------------------------------------------- 1 | #ifndef EPUBFMT_H 2 | #define EPUBFMT_H 3 | 4 | #include "../include/crsetup.h" 5 | #include "../include/lvtinydom.h" 6 | 7 | 8 | bool DetectEpubFormat( LVStreamRef stream ); 9 | bool ImportEpubDocument( LVStreamRef stream, ldomDocument * doc, LVDocViewCallback * progressCallback, CacheLoadingCallback * formatCallback ); 10 | lString16 EpubGetRootFilePath( LVContainerRef m_arc ); 11 | LVStreamRef GetEpubCoverpage(LVContainerRef arc); 12 | 13 | 14 | #endif // EPUBFMT_H 15 | -------------------------------------------------------------------------------- /3rdparty/crengine/include/pdbfmt.h: -------------------------------------------------------------------------------- 1 | #ifndef PDBFMT_H 2 | #define PDBFMT_H 3 | 4 | #include "../include/crsetup.h" 5 | #include "../include/lvtinydom.h" 6 | 7 | // creates PDB decoder stream for stream 8 | //LVStreamRef LVOpenPDBStream( LVStreamRef srcstream, int &format ); 9 | 10 | bool DetectPDBFormat( LVStreamRef stream, doc_format_t & contentFormat ); 11 | bool ImportPDBDocument( LVStreamRef & stream, ldomDocument * doc, LVDocViewCallback * progressCallback, CacheLoadingCallback * formatCallback, doc_format_t & contentFormat ); 12 | LVStreamRef GetPDBCoverpage(LVStreamRef stream); 13 | 14 | 15 | #endif // PDBFMT_H 16 | -------------------------------------------------------------------------------- /3rdparty/crengine/include/s32utils.h: -------------------------------------------------------------------------------- 1 | /** \file s32utils.h 2 | \brief misc symbian utility functions 3 | 4 | CoolReader Engine 5 | 6 | 7 | (c) torque, 2006 8 | This source code is distributed under the terms of 9 | GNU General Public License. 10 | 11 | See LICENSE file for details. 12 | 13 | */ 14 | 15 | #ifndef __S32_UTILS_H_INCLUDED__ 16 | #define __S32_UTILS_H_INCLUDED__ 17 | 18 | #ifdef __SYMBIAN32__ 19 | 20 | #include "lvfnt.h" 21 | #include "lvdrawbuf.h" 22 | 23 | #include 24 | #include 25 | 26 | /// draw gray bitmap buffer to Windows device context 27 | void DrawBuf2DC(CWindowGc &dc, int x, int y, LVDrawBuf * buf, unsigned long * palette, int scale=1 ); 28 | 29 | 30 | #endif 31 | 32 | #endif 33 | 34 | -------------------------------------------------------------------------------- /3rdparty/crengine/include/w32utils.h: -------------------------------------------------------------------------------- 1 | /** \file w32utils.h 2 | \brief misc windows utility functions 3 | 4 | CoolReader Engine 5 | 6 | 7 | (c) Vadim Lopatin, 2000-2006 8 | This source code is distributed under the terms of 9 | GNU General Public License. 10 | 11 | See LICENSE file for details. 12 | 13 | */ 14 | 15 | #ifndef __W32_UTILS_H_INCLUDED__ 16 | #define __W32_UTILS_H_INCLUDED__ 17 | 18 | #if !defined(__SYMBIAN32__) && defined(_WIN32) 19 | 20 | #include "lvfnt.h" 21 | #include "lvdrawbuf.h" 22 | 23 | extern "C" { 24 | #include 25 | } 26 | 27 | /// draw gray bitmap buffer to Windows device context 28 | void DrawBuf2DC(HDC dc, int x, int y, LVDrawBuf * buf, COLORREF * palette, int scale=1 ); 29 | /// save gray bitmap to .BMP file 30 | void SaveBitmapToFile( const char * fname, LVGrayDrawBuf * bmp ); 31 | 32 | 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /3rdparty/crengine/include/wordfmt.h: -------------------------------------------------------------------------------- 1 | #ifndef WORDFMT_H 2 | #define WORDFMT_H 3 | #if ENABLE_ANTIWORD==1 4 | 5 | #include "lvtinydom.h" 6 | 7 | // MS WORD format support using AntiWord library 8 | bool DetectWordFormat( LVStreamRef stream ); 9 | 10 | bool ImportWordDocument( LVStreamRef stream, ldomDocument * m_doc, LVDocViewCallback * progressCallback, CacheLoadingCallback * formatCallback ); 11 | 12 | 13 | #endif // ENABLE_ANTIWORD==1 14 | #endif // WORDFMT_H 15 | -------------------------------------------------------------------------------- /3rdparty/crengine/include/xutils.h: -------------------------------------------------------------------------------- 1 | /** \file xutils.h 2 | \brief misc X Window System utility functions 3 | 4 | CoolReader Engine 5 | 6 | 7 | (c) Vadim Lopatin, 2000-2006 8 | This source code is distributed under the terms of 9 | GNU General Public License. 10 | 11 | See LICENSE file for details. 12 | 13 | */ 14 | 15 | #ifndef __X_UTILS_H_INCLUDED__ 16 | #define __X_UTILS_H_INCLUDED__ 17 | 18 | #ifdef LINUX 19 | 20 | #include "lvfnt.h" 21 | #include "lvdrawbuf.h" 22 | 23 | /** 24 | \brief RGB offscreen image for X Window System 25 | */ 26 | class MyXImage 27 | { 28 | private: 29 | XImage * _img; 30 | public: 31 | /// creates image buffer of specified size 32 | MyXImage( int dx, int dy ); 33 | ~MyXImage(); 34 | /// returns scanline pointer (pixel is 32bit unsigned) 35 | unsigned * getScanLine( int y ); 36 | /// fills buffer with specified color 37 | void fill( unsigned pixel ); 38 | /// returns XImage object 39 | XImage * getXImage() 40 | { 41 | return _img; 42 | } 43 | }; 44 | 45 | 46 | 47 | /// draw gray bitmap buffer to X drawable 48 | void DrawBuf2Drawable(Display *display, Drawable d, GC gc, int x, int y, LVDrawBuf * buf, unsigned * palette, int scale=1 ); 49 | 50 | #endif 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /3rdparty/expat/amigaconfig.h: -------------------------------------------------------------------------------- 1 | #ifndef AMIGACONFIG_H 2 | #define AMIGACONFIG_H 3 | 4 | /* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ 5 | #define BYTEORDER 4321 6 | 7 | /* Define to 1 if you have the `bcopy' function. */ 8 | #define HAVE_BCOPY 1 9 | 10 | /* Define to 1 if you have the header file. */ 11 | #undef HAVE_CHECK_H 12 | 13 | /* Define to 1 if you have the `memmove' function. */ 14 | #define HAVE_MEMMOVE 1 15 | 16 | /* Define to 1 if you have the header file. */ 17 | #define HAVE_UNISTD_H 1 18 | 19 | /* whether byteorder is bigendian */ 20 | #define WORDS_BIGENDIAN 21 | 22 | /* Define to specify how much context to retain around the current parse 23 | point. */ 24 | #define XML_CONTEXT_BYTES 1024 25 | 26 | /* Define to make parameter entity parsing functionality available. */ 27 | #define XML_DTD 28 | 29 | /* Define to make XML Namespaces functionality available. */ 30 | #define XML_NS 31 | 32 | #endif /* AMIGACONFIG_H */ 33 | -------------------------------------------------------------------------------- /3rdparty/expat/asciitab.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | /* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 6 | /* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 7 | /* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, 8 | /* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML, 9 | /* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 10 | /* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 11 | /* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 12 | /* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 13 | /* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, 14 | /* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, 15 | /* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, 16 | /* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, 17 | /* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, 18 | /* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, 19 | /* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI, 20 | /* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, 21 | /* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, 22 | /* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, 23 | /* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 24 | /* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 25 | /* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 26 | /* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 27 | /* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, 28 | /* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, 29 | /* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, 30 | /* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, 31 | /* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 32 | /* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 33 | /* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 34 | /* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 35 | /* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, 36 | /* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, 37 | -------------------------------------------------------------------------------- /3rdparty/expat/iasciitab.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | /* Like asciitab.h, except that 0xD has code BT_S rather than BT_CR */ 6 | /* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 7 | /* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 8 | /* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, 9 | /* 0x0C */ BT_NONXML, BT_S, BT_NONXML, BT_NONXML, 10 | /* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 11 | /* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 12 | /* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 13 | /* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 14 | /* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, 15 | /* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, 16 | /* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, 17 | /* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, 18 | /* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, 19 | /* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, 20 | /* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI, 21 | /* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, 22 | /* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, 23 | /* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, 24 | /* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 25 | /* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 26 | /* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 27 | /* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 28 | /* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, 29 | /* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, 30 | /* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, 31 | /* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, 32 | /* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 33 | /* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 34 | /* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 35 | /* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 36 | /* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, 37 | /* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, 38 | -------------------------------------------------------------------------------- /3rdparty/expat/latin1tab.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | /* 0x80 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 6 | /* 0x84 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 7 | /* 0x88 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 8 | /* 0x8C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 9 | /* 0x90 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 10 | /* 0x94 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 11 | /* 0x98 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 12 | /* 0x9C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 13 | /* 0xA0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 14 | /* 0xA4 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 15 | /* 0xA8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, 16 | /* 0xAC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 17 | /* 0xB0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 18 | /* 0xB4 */ BT_OTHER, BT_NMSTRT, BT_OTHER, BT_NAME, 19 | /* 0xB8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, 20 | /* 0xBC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 21 | /* 0xC0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 22 | /* 0xC4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 23 | /* 0xC8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 24 | /* 0xCC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 25 | /* 0xD0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 26 | /* 0xD4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, 27 | /* 0xD8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 28 | /* 0xDC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 29 | /* 0xE0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 30 | /* 0xE4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 31 | /* 0xE8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 32 | /* 0xEC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 33 | /* 0xF0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 34 | /* 0xF4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, 35 | /* 0xF8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 36 | /* 0xFC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 37 | -------------------------------------------------------------------------------- /3rdparty/expat/macconfig.h: -------------------------------------------------------------------------------- 1 | /*================================================================ 2 | ** Copyright 2000, Clark Cooper 3 | ** All rights reserved. 4 | ** 5 | ** This is free software. You are permitted to copy, distribute, or modify 6 | ** it under the terms of the MIT/X license (contained in the COPYING file 7 | ** with this distribution.) 8 | ** 9 | */ 10 | 11 | #ifndef MACCONFIG_H 12 | #define MACCONFIG_H 13 | 14 | 15 | /* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ 16 | #define BYTEORDER 4321 17 | 18 | /* Define to 1 if you have the `bcopy' function. */ 19 | #undef HAVE_BCOPY 20 | 21 | /* Define to 1 if you have the `memmove' function. */ 22 | #define HAVE_MEMMOVE 23 | 24 | /* Define to 1 if you have a working `mmap' system call. */ 25 | #undef HAVE_MMAP 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #undef HAVE_UNISTD_H 29 | 30 | /* whether byteorder is bigendian */ 31 | #define WORDS_BIGENDIAN 32 | 33 | /* Define to specify how much context to retain around the current parse 34 | point. */ 35 | #undef XML_CONTEXT_BYTES 36 | 37 | /* Define to make parameter entity parsing functionality available. */ 38 | #define XML_DTD 39 | 40 | /* Define to make XML Namespaces functionality available. */ 41 | #define XML_NS 42 | 43 | /* Define to empty if `const' does not conform to ANSI C. */ 44 | #undef const 45 | 46 | /* Define to `long' if does not define. */ 47 | #define off_t long 48 | 49 | /* Define to `unsigned' if does not define. */ 50 | #undef size_t 51 | 52 | 53 | #endif /* ifndef MACCONFIG_H */ 54 | -------------------------------------------------------------------------------- /3rdparty/expat/utf8tab.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | 6 | /* 0x80 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 7 | /* 0x84 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 8 | /* 0x88 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 9 | /* 0x8C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 10 | /* 0x90 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 11 | /* 0x94 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 12 | /* 0x98 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 13 | /* 0x9C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 14 | /* 0xA0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 15 | /* 0xA4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 16 | /* 0xA8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 17 | /* 0xAC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 18 | /* 0xB0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 19 | /* 0xB4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 20 | /* 0xB8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 21 | /* 0xBC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 22 | /* 0xC0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 23 | /* 0xC4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 24 | /* 0xC8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 25 | /* 0xCC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 26 | /* 0xD0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 27 | /* 0xD4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 28 | /* 0xD8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 29 | /* 0xDC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 30 | /* 0xE0 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, 31 | /* 0xE4 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, 32 | /* 0xE8 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, 33 | /* 0xEC */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, 34 | /* 0xF0 */ BT_LEAD4, BT_LEAD4, BT_LEAD4, BT_LEAD4, 35 | /* 0xF4 */ BT_LEAD4, BT_NONXML, BT_NONXML, BT_NONXML, 36 | /* 0xF8 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 37 | /* 0xFC */ BT_NONXML, BT_NONXML, BT_MALFORM, BT_MALFORM, 38 | -------------------------------------------------------------------------------- /3rdparty/expat/winconfig.h: -------------------------------------------------------------------------------- 1 | /*================================================================ 2 | ** Copyright 2000, Clark Cooper 3 | ** All rights reserved. 4 | ** 5 | ** This is free software. You are permitted to copy, distribute, or modify 6 | ** it under the terms of the MIT/X license (contained in the COPYING file 7 | ** with this distribution.) 8 | */ 9 | 10 | #ifndef WINCONFIG_H 11 | #define WINCONFIG_H 12 | 13 | #define WIN32_LEAN_AND_MEAN 14 | #include 15 | #undef WIN32_LEAN_AND_MEAN 16 | 17 | #include 18 | #include 19 | 20 | #define XML_NS 1 21 | #define XML_DTD 1 22 | #define XML_CONTEXT_BYTES 1024 23 | 24 | /* we will assume all Windows platforms are little endian */ 25 | #define BYTEORDER 1234 26 | 27 | /* Windows has memmove() available. */ 28 | #define HAVE_MEMMOVE 29 | 30 | #endif /* ndef WINCONFIG_H */ 31 | -------------------------------------------------------------------------------- /3rdparty/expat/xmltok_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 3 | See the file COPYING for copying permission. 4 | */ 5 | 6 | enum { 7 | BT_NONXML, 8 | BT_MALFORM, 9 | BT_LT, 10 | BT_AMP, 11 | BT_RSQB, 12 | BT_LEAD2, 13 | BT_LEAD3, 14 | BT_LEAD4, 15 | BT_TRAIL, 16 | BT_CR, 17 | BT_LF, 18 | BT_GT, 19 | BT_QUOT, 20 | BT_APOS, 21 | BT_EQUALS, 22 | BT_QUEST, 23 | BT_EXCL, 24 | BT_SOL, 25 | BT_SEMI, 26 | BT_NUM, 27 | BT_LSQB, 28 | BT_S, 29 | BT_NMSTRT, 30 | BT_COLON, 31 | BT_HEX, 32 | BT_DIGIT, 33 | BT_NAME, 34 | BT_MINUS, 35 | BT_OTHER, /* known not to be a name or name start character */ 36 | BT_NONASCII, /* might be a name or name start character */ 37 | BT_PERCNT, 38 | BT_LPAR, 39 | BT_RPAR, 40 | BT_AST, 41 | BT_PLUS, 42 | BT_COMMA, 43 | BT_VERBAR 44 | }; 45 | 46 | #include 47 | -------------------------------------------------------------------------------- /3rdparty/faxpp/Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS = foreign dist-zip 2 | SUBDIRS = include 3 | 4 | INCLUDES = -I$(top_srcdir)/include/ 5 | 6 | noinst_PROGRAMS = tokenizer_example parser_example xmlconf_runner 7 | lib_LTLIBRARIES = libfaxpp.la 8 | 9 | # Library version, see http://sourceware.org/autobook/autobook/autobook_91.html 10 | libfaxpp_la_LDFLAGS = -version-info 2:1:0 -no-undefined 11 | 12 | libfaxpp_la_SOURCES = \ 13 | src/attr_states.h \ 14 | src/buffer.c \ 15 | src/buffer.h \ 16 | src/cdata.c \ 17 | src/char_classes.c \ 18 | src/char_classes.h \ 19 | src/comment.c \ 20 | src/element.c \ 21 | src/element_states.h \ 22 | src/error.c \ 23 | src/event.c \ 24 | src/pi.c \ 25 | src/reference.c \ 26 | src/token.c \ 27 | src/tokenizer_states.c \ 28 | src/tokenizer_states.h \ 29 | src/transcode.c \ 30 | src/xmldecl.c \ 31 | src/xml_parser.c \ 32 | src/xml_parser.h \ 33 | src/xml_tokenizer.c \ 34 | src/xml_tokenizer.h \ 35 | src/doctype.c \ 36 | src/elementdecl.c \ 37 | src/attlistdecl.c \ 38 | src/notationdecl.c \ 39 | src/entitydecl.c \ 40 | src/conditional.c \ 41 | src/system_public_states.h 42 | 43 | tokenizer_example_LDADD = libfaxpp.la 44 | tokenizer_example_SOURCES = examples/tokenizer_example.c 45 | 46 | parser_example_LDADD = libfaxpp.la 47 | parser_example_SOURCES = \ 48 | examples/parser_example.c \ 49 | examples/entity_resolver.c \ 50 | examples/entity_resolver.h \ 51 | examples/output_event.c \ 52 | examples/output_event.h 53 | 54 | xmlconf_runner_LDADD = libfaxpp.la 55 | xmlconf_runner_SOURCES = \ 56 | tests/xmlconf_runner.c \ 57 | examples/entity_resolver.c \ 58 | examples/entity_resolver.h \ 59 | examples/output_event.c \ 60 | examples/output_event.h 61 | 62 | EXTRA_DIST = \ 63 | docs/Doxyfile.api \ 64 | docs/header.html \ 65 | docs/api \ 66 | LICENSE \ 67 | TODO \ 68 | ChangeLog 69 | 70 | .PHONY: docs 71 | 72 | docs: 73 | $(MAKE) -C include docs 74 | -------------------------------------------------------------------------------- /3rdparty/faxpp/TODO: -------------------------------------------------------------------------------- 1 | Small tasks 2 | ----------- 3 | 4 | Windows project files 5 | Normalize line endings in element character content / PI values / comment values 6 | Accept XML 1.1 line endings as whitespace 7 | 8 | Large tasks 9 | ----------- 10 | 11 | Attribute default values 12 | DTD validation 13 | -------------------------------------------------------------------------------- /3rdparty/faxpp/configure.in: -------------------------------------------------------------------------------- 1 | # -*- Autoconf -*- 2 | # Process this file with autoconf to produce a configure script. 3 | 4 | AC_PREREQ(2.59) 5 | AC_INIT(faxpp, 0.4, john@snelson.org.uk) 6 | AC_CONFIG_AUX_DIR(autotools) 7 | AM_INIT_AUTOMAKE(faxpp, 0.4, john@snelson.org.uk) 8 | AC_CONFIG_SRCDIR([include/faxpp/parser.h]) 9 | AM_CONFIG_HEADER([src/config.h]) 10 | 11 | # Check debug option 12 | AC_MSG_CHECKING(if --enable-debug option specified) 13 | AC_ARG_ENABLE(debug, 14 | [AS_HELP_STRING(--enable-debug,Build a debugging version.)], 15 | [sp_debug="$enable_debug"], [sp_debug="no"]) 16 | AC_MSG_RESULT($sp_debug) 17 | 18 | # Check profile option 19 | AC_MSG_CHECKING(if --enable-profile option specified) 20 | AC_ARG_ENABLE(profile, 21 | [AS_HELP_STRING(--enable-profile,Build a profiling version.)], 22 | [sp_profile="$enable_profile"], [sp_profile="no"]) 23 | AC_MSG_RESULT($sp_profile) 24 | 25 | if test "$sp_profile" = "yes"; then 26 | CFLAGS="$CFLAGS -g -pg -DDEBUG -Wall" 27 | CXXFLAGS="$CXXFLAGS -g -pg -DDEBUG -Wall" 28 | else 29 | if test "$sp_debug" = "yes"; then 30 | CFLAGS="$CFLAGS -g -DDEBUG -Wall" 31 | CXXFLAGS="$CXXFLAGS -g -DDEBUG -Wall" 32 | else 33 | CFLAGS="$CFLAGS -O2 -Wall" 34 | CXXFLAGS="$CXXFLAGS -O2 -Wall" 35 | fi 36 | fi 37 | 38 | # Checks for programs. 39 | AC_PROG_CXX 40 | AC_PROG_CC 41 | AC_PROG_CPP 42 | AC_PROG_LIBTOOL 43 | AC_PROG_INSTALL 44 | AC_PROG_LN_S 45 | AC_PROG_MAKE_SET 46 | AC_PROG_AWK 47 | AC_PROG_RANLIB 48 | 49 | # Checks for libraries. 50 | 51 | # Checks for header files. 52 | AC_HEADER_STDC 53 | AC_CHECK_HEADERS([stdint.h stdlib.h string.h sys/time.h]) 54 | 55 | # Checks for typedefs, structures, and compiler characteristics. 56 | AC_C_CONST 57 | AC_C_BIGENDIAN 58 | AC_HEADER_TIME 59 | AC_TYPE_UINT16_T 60 | AC_TYPE_UINT32_T 61 | AC_TYPE_UINT8_T 62 | 63 | # Checks for library functions. 64 | AC_FUNC_MALLOC 65 | AC_FUNC_MEMCMP 66 | AC_FUNC_REALLOC 67 | AC_CHECK_FUNCS([gettimeofday memmove memset strerror]) 68 | 69 | AC_CONFIG_FILES([Makefile include/Makefile]) 70 | AC_OUTPUT 71 | -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/faxpp/docs/api/doxygen.png -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/error_8h__dep__incl.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/error_8h__dep__incl.md5: -------------------------------------------------------------------------------- 1 | 1c3c4aef922688963c5d9a9108046b43 -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/error_8h__dep__incl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/faxpp/docs/api/error_8h__dep__incl.png -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/event_8h__dep__incl.map: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/event_8h__dep__incl.md5: -------------------------------------------------------------------------------- 1 | f04b0245abf03b058c4f32ba635e0275 -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/event_8h__dep__incl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/faxpp/docs/api/event_8h__dep__incl.png -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/event_8h__incl.map: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/event_8h__incl.md5: -------------------------------------------------------------------------------- 1 | feee6d48d62fd8804883cf84a08b739b -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/event_8h__incl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/faxpp/docs/api/event_8h__incl.png -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/examples.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Faxpp 0.3 Documentation 4 | 5 | 6 | 7 | SourceForge.net Logo 8 | 9 | 19 |
20 |

Examples

Here is a list of all examples: 26 |
27 |
Generated on Thu Dec 4 14:21:52 2008 for Faxpp by  28 | 29 | doxygen 1.5.5
30 | 31 | 32 | -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/graph_legend.dot: -------------------------------------------------------------------------------- 1 | digraph G 2 | { 3 | edge [fontname="FreeSans",fontsize=10,labelfontname="FreeSans",labelfontsize=10]; 4 | node [fontname="FreeSans",fontsize=10,shape=record]; 5 | Node9 [shape="box",label="Inherited",fontsize=10,height=0.2,width=0.4,fontname="FreeSans",fillcolor="grey75",style="filled" fontcolor="black"]; 6 | Node10 -> Node9 [dir=back,color="midnightblue",fontsize=10,style="solid",fontname="FreeSans"]; 7 | Node10 [shape="box",label="PublicBase",fontsize=10,height=0.2,width=0.4,fontname="FreeSans",color="black",URL="$classPublicBase.html"]; 8 | Node11 -> Node10 [dir=back,color="midnightblue",fontsize=10,style="solid",fontname="FreeSans"]; 9 | Node11 [shape="box",label="Truncated",fontsize=10,height=0.2,width=0.4,fontname="FreeSans",color="red",URL="$classTruncated.html"]; 10 | Node13 -> Node9 [dir=back,color="darkgreen",fontsize=10,style="solid",fontname="FreeSans"]; 11 | Node13 [shape="box",label="ProtectedBase",fontsize=10,height=0.2,width=0.4,fontname="FreeSans",color="black",URL="$classProtectedBase.html"]; 12 | Node14 -> Node9 [dir=back,color="firebrick4",fontsize=10,style="solid",fontname="FreeSans"]; 13 | Node14 [shape="box",label="PrivateBase",fontsize=10,height=0.2,width=0.4,fontname="FreeSans",color="black",URL="$classPrivateBase.html"]; 14 | Node15 -> Node9 [dir=back,color="midnightblue",fontsize=10,style="solid",fontname="FreeSans"]; 15 | Node15 [shape="box",label="Undocumented",fontsize=10,height=0.2,width=0.4,fontname="FreeSans",color="grey75"]; 16 | Node16 -> Node9 [dir=back,color="midnightblue",fontsize=10,style="solid",fontname="FreeSans"]; 17 | Node16 [shape="box",label="Templ< int >",fontsize=10,height=0.2,width=0.4,fontname="FreeSans",color="black",URL="$classTempl.html"]; 18 | Node17 -> Node16 [dir=back,color="orange",fontsize=10,style="dashed",label="< int >",fontname="FreeSans"]; 19 | Node17 [shape="box",label="Templ< T >",fontsize=10,height=0.2,width=0.4,fontname="FreeSans",color="black",URL="$classTempl.html"]; 20 | Node18 -> Node9 [dir=back,color="darkorchid3",fontsize=10,style="dashed",label="m_usedClass",fontname="FreeSans"]; 21 | Node18 [shape="box",label="Used",fontsize=10,height=0.2,width=0.4,fontname="FreeSans",color="black",URL="$classUsed.html"]; 22 | } 23 | -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/graph_legend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/faxpp/docs/api/graph_legend.png -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/parser_8h__incl.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/parser_8h__incl.md5: -------------------------------------------------------------------------------- 1 | f129c4742f42d1a037bbfab06188403d -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/parser_8h__incl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/faxpp/docs/api/parser_8h__incl.png -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/tab_b.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/faxpp/docs/api/tab_b.gif -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/tab_l.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/faxpp/docs/api/tab_l.gif -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/tab_r.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/faxpp/docs/api/tab_r.gif -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/text_8h__dep__incl.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/text_8h__dep__incl.md5: -------------------------------------------------------------------------------- 1 | aa71413e208c057e690febb7c7bd71f3 -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/text_8h__dep__incl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/faxpp/docs/api/text_8h__dep__incl.png -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/token_8h__dep__incl.map: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/token_8h__dep__incl.md5: -------------------------------------------------------------------------------- 1 | bc660c3d5046df51c66a3415355f52ee -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/token_8h__dep__incl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/faxpp/docs/api/token_8h__dep__incl.png -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/token_8h__incl.map: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/token_8h__incl.md5: -------------------------------------------------------------------------------- 1 | a8173743338cdc78f75d73a19784b9c0 -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/token_8h__incl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/faxpp/docs/api/token_8h__incl.png -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/tokenizer_8h__incl.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/tokenizer_8h__incl.md5: -------------------------------------------------------------------------------- 1 | 1e2f07b9066b3cc2ba01afa18192298d -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/tokenizer_8h__incl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/faxpp/docs/api/tokenizer_8h__incl.png -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/transcode_8h__dep__incl.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/transcode_8h__dep__incl.md5: -------------------------------------------------------------------------------- 1 | 4bcbe38b89a0ecdbed1cb4c9e89c1383 -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/transcode_8h__dep__incl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/faxpp/docs/api/transcode_8h__dep__incl.png -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/transcode_8h__incl.map: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/faxpp/docs/api/transcode_8h__incl.map -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/transcode_8h__incl.md5: -------------------------------------------------------------------------------- 1 | 40d1a929942b3a952f83129d0a192d95 -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/api/transcode_8h__incl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/faxpp/docs/api/transcode_8h__incl.png -------------------------------------------------------------------------------- /3rdparty/faxpp/docs/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Faxpp 0.3 Documentation 4 | 5 | 6 | 7 | SourceForge.net Logo 8 | -------------------------------------------------------------------------------- /3rdparty/faxpp/examples/entity_resolver.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Doxological Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ENTITY_RESOLVER_H 18 | #define ENTITY_RESOLVER_H 19 | 20 | #include 21 | 22 | char *resolve_paths(const char *base, unsigned int base_len, const char *path, unsigned int path_len); 23 | unsigned int file_read_callback(void *userData, void *buffer, unsigned int length); 24 | FAXPP_Error entity_callback(void *userData, FAXPP_Parser *parser, FAXPP_EntityType type, 25 | const FAXPP_Text *base_uri, const FAXPP_Text *system, const FAXPP_Text *public); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /3rdparty/faxpp/examples/output_event.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Doxological Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef OUTPUT_EVENT_H 18 | #define OUTPUT_EVENT_H 19 | 20 | #include 21 | 22 | #include 23 | 24 | void output_event(const FAXPP_Event *event, FILE *stream); 25 | void output_attr_value(const FAXPP_AttrValue *atval, FILE *stream); 26 | void output_text(const FAXPP_Text *text, FILE *stream); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /3rdparty/faxpp/include/Makefile.am: -------------------------------------------------------------------------------- 1 | nobase_include_HEADERS = \ 2 | faxpp/error.h \ 3 | faxpp/event.h \ 4 | faxpp/parser.h \ 5 | faxpp/text.h \ 6 | faxpp/token.h \ 7 | faxpp/tokenizer.h \ 8 | faxpp/transcode.h 9 | 10 | docs: $(top_srcdir)/docs/.api-timestamp 11 | 12 | $(top_srcdir)/docs/.api-timestamp: $(nobase_include_HEADERS) $(top_srcdir)/docs/Doxyfile.api $(top_srcdir)/docs/header.html 13 | cd $(top_srcdir)/docs && \ 14 | doxygen Doxyfile.api && \ 15 | touch .api-timestamp 16 | -------------------------------------------------------------------------------- /3rdparty/faxpp/include/faxpp/text.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Doxological Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __FAXPP__TEXT_H 18 | #define __FAXPP__TEXT_H 19 | 20 | /// The basic string type in faxpp 21 | typedef struct { 22 | void *ptr; ///< A pointer to the memory for the string 23 | unsigned int len; ///< The length of the string in bytes 24 | } FAXPP_Text; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /3rdparty/faxpp/src/buffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Doxological Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __FAXPP__BUFFER_H 18 | #define __FAXPP__BUFFER_H 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | typedef struct FAXPP_Buffer_s FAXPP_Buffer; 25 | typedef void (*FAXPP_BufferResizeCallback)(void *userData, FAXPP_Buffer *buffer, void *newFAXPP_Buffer); 26 | 27 | /// Implementation of a resizing buffer 28 | struct FAXPP_Buffer_s { 29 | void *buffer; 30 | unsigned int length; 31 | void *cursor; 32 | 33 | FAXPP_BufferResizeCallback callback; 34 | void *userData; 35 | }; 36 | 37 | FAXPP_Error FAXPP_init_buffer(FAXPP_Buffer *buffer, unsigned int initialSize, 38 | FAXPP_BufferResizeCallback callback, void *userData); 39 | void FAXPP_free_buffer(FAXPP_Buffer *buffer); 40 | void FAXPP_swap_buffer(FAXPP_Buffer *a, FAXPP_Buffer *b); 41 | 42 | #define FAXPP_reset_buffer(buf) (buf)->cursor = (buf)->buffer 43 | 44 | FAXPP_Error FAXPP_resize_buffer(FAXPP_Buffer *buffer, unsigned int minSize); 45 | FAXPP_Error FAXPP_buffer_append(FAXPP_Buffer *buffer, void *ptr, unsigned int len); 46 | FAXPP_Error FAXPP_buffer_append_text(FAXPP_Buffer *buffer, const FAXPP_Text *text); 47 | FAXPP_Error FAXPP_buffer_append_ch(FAXPP_Buffer *buffer, FAXPP_EncodeFunction encode, Char32 ch); 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /3rdparty/faxpp/src/char_classes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Doxological Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __FAXPP__CHAR_CLASSES_H 18 | #define __FAXPP__CHAR_CLASSES_H 19 | 20 | #include 21 | 22 | #define NCNAME_START_CHAR10 0x01 23 | #define NCNAME_CHAR10 0x02 24 | #define NCNAME_START_CHAR11 0x04 25 | #define NCNAME_CHAR11 0x08 26 | #define NON_RESTRICTED_CHAR10 0x10 27 | #define NON_RESTRICTED_CHAR11 0x20 28 | #define WHITESPACE_CHAR 0x40 29 | #define CHAR10 0x10 30 | #define CHAR11 0x80 31 | 32 | const char *FAXPP_char_flags_to_string(unsigned int flags); 33 | 34 | #define FAXPP_char_flags(ch) (((ch) < 256) ? FAXPP_char_flags_256[(ch)] : FAXPP_char_flags_impl((ch))) 35 | 36 | uint8_t FAXPP_char_flags_impl(Char32 c); 37 | extern const uint8_t FAXPP_char_flags_256[256]; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /3rdparty/faxpp/src/element.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Doxological Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "tokenizer_states.h" 18 | #include "char_classes.h" 19 | 20 | FAXPP_Error 21 | start_element_end_state(FAXPP_TokenizerEnv *env) 22 | { 23 | env->state = (env)->element_content_state; 24 | env->nesting_level += 1; 25 | report_empty_token(START_ELEMENT_END_TOKEN, env); 26 | // no next_char 27 | return 0; 28 | } 29 | 30 | FAXPP_Error 31 | self_closing_element_state(FAXPP_TokenizerEnv *env) 32 | { 33 | read_char(env); 34 | 35 | switch(env->current_char) { 36 | case '>': 37 | base_state(env); 38 | token_end_position(env); 39 | report_empty_token(SELF_CLOSING_ELEMENT_TOKEN, env); 40 | next_char(env); 41 | token_start_position(env); 42 | break; 43 | LINE_ENDINGS 44 | default: 45 | next_char(env); 46 | return INVALID_CHAR_IN_START_ELEMENT; 47 | } 48 | return NO_ERROR; 49 | } 50 | 51 | FAXPP_Error 52 | end_element_ws_state(FAXPP_TokenizerEnv *env) 53 | { 54 | read_char(env); 55 | 56 | switch(env->current_char) { 57 | WHITESPACE: 58 | next_char(env); 59 | break; 60 | case '>': 61 | env->nesting_level -= 1; 62 | base_state(env); 63 | next_char(env); 64 | token_start_position(env); 65 | break; 66 | default: 67 | next_char(env); 68 | return INVALID_CHAR_IN_END_ELEMENT; 69 | } 70 | return NO_ERROR; 71 | } 72 | 73 | -------------------------------------------------------------------------------- /3rdparty/faxpp/src/event.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Doxological Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | 19 | #ifdef DEBUG 20 | const char * 21 | event_to_string(FAXPP_EventType type) 22 | { 23 | switch(type) { 24 | case START_DOCUMENT_EVENT: 25 | return "START_DOCUMENT_EVENT"; 26 | case END_DOCUMENT_EVENT: 27 | return "END_DOCUMENT_EVENT"; 28 | case DOCTYPE_EVENT: 29 | return "DOCTYPE_EVENT"; 30 | case START_ELEMENT_EVENT: 31 | return "START_ELEMENT_EVENT"; 32 | case SELF_CLOSING_ELEMENT_EVENT: 33 | return "SELF_CLOSING_ELEMENT_EVENT"; 34 | case END_ELEMENT_EVENT: 35 | return "END_ELEMENT_EVENT"; 36 | case CHARACTERS_EVENT: 37 | return "CHARACTERS_EVENT"; 38 | case CDATA_EVENT: 39 | return "CDATA_EVENT"; 40 | case IGNORABLE_WHITESPACE_EVENT: 41 | return "IGNORABLE_WHITESPACE_EVENT"; 42 | case COMMENT_EVENT: 43 | return "COMMENT_EVENT"; 44 | case PI_EVENT: 45 | return "PI_EVENT"; 46 | case ENTITY_REFERENCE_EVENT: 47 | return "ENTITY_REFERENCE_EVENT"; 48 | case DEC_CHAR_REFERENCE_EVENT: 49 | return "DEC_CHAR_REFERENCE_EVENT"; 50 | case HEX_CHAR_REFERENCE_EVENT: 51 | return "HEX_CHAR_REFERENCE_EVENT"; 52 | case ENTITY_REFERENCE_START_EVENT: 53 | return "ENTITY_REFERENCE_START_EVENT"; 54 | case ENTITY_REFERENCE_END_EVENT: 55 | return "ENTITY_REFERENCE_END_EVENT"; 56 | case START_EXTERNAL_ENTITY_EVENT: 57 | return "START_EXTERNAL_ENTITY_EVENT"; 58 | case END_EXTERNAL_ENTITY_EVENT: 59 | return "END_EXTERNAL_ENTITY_EVENT"; 60 | case NO_EVENT: break; 61 | } 62 | 63 | return "NO_EVENT"; 64 | } 65 | #endif 66 | -------------------------------------------------------------------------------- /3rdparty/gnome/document-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/gnome/document-new.png -------------------------------------------------------------------------------- /3rdparty/gnome/document-open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/gnome/document-open.png -------------------------------------------------------------------------------- /3rdparty/gnome/document-save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/gnome/document-save.png -------------------------------------------------------------------------------- /3rdparty/gnome/format-justify-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/gnome/format-justify-left.png -------------------------------------------------------------------------------- /3rdparty/gnome/format-justify-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/3rdparty/gnome/format-justify-right.png -------------------------------------------------------------------------------- /3rdparty/wxbzipstream/README.txt: -------------------------------------------------------------------------------- 1 | 1. Introduction 2 | 2. Build Instructions 3 | 3. Credits/License 4 | 4. Versions 5 | 6 | //////////////////////////////////////////////////////////////// 7 | 1. Introduction 8 | //////////////////////////////////////////////////////////////// 9 | wxBZipInputStream & wxBZipOutputStream function just 10 | like normal wx streams, only they work on BZip compressed 11 | data. 12 | 13 | //////////////////////////////////////////////////////////////// 14 | 2. Build Instructions 15 | //////////////////////////////////////////////////////////////// 16 | Build all files in the bzip folder, along 17 | with bzipstream.cpp and bzip.h. 18 | 19 | //////////////////////////////////////////////////////////////// 20 | 3. Credits/License 21 | //////////////////////////////////////////////////////////////// 22 | Author: Ryan Norton (wxprojects@comcast.net) 23 | License: wxWindows (wxwindows.org for more info) 24 | [this is a requirement of wxCode] 25 | 26 | //////////////////////////////////////////////////////////////// 27 | 4. Versions 28 | //////////////////////////////////////////////////////////////// 29 | 1.2 30 | - Patch from David Hart for version fix and GCC compilation fix 31 | - Unicode fixes 32 | - Some cleanup with nCompressionFactor documented 33 | 34 | 1.1 35 | - Patch from David Hart with fixes for large archives 36 | - wxArchive integration 37 | 38 | 1.0 39 | Initial Release -------------------------------------------------------------------------------- /3rdparty/wxsqlite3/include/wx/wxsqlite3opt.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // Name: wxsqlite3opt.h 3 | // Purpose: wxSQLite3 optional feature selection 4 | // Author: Ulrich Telle 5 | // Modified by: 6 | // Created: 2007-02-01 7 | // 8 | // Copyright: (c) Ulrich Telle 9 | // Licence: wxWindows licence 10 | /////////////////////////////////////////////////////////////////////////////// 11 | 12 | /// \file wxsqlite3opt.h Compile time switches for the wxSQLite3 class 13 | 14 | #ifndef _WX_SQLITE3_OPT_H_ 15 | #define _WX_SQLITE3_OPT_H_ 16 | 17 | // Conditional compilation 18 | // ----------------------- 19 | 20 | //! If this define is set to 1, then the SQLite library will be loaded dynamically 21 | //! otherwise a link library is required to build wxSQLite3. 22 | #ifndef wxUSE_DYNAMIC_SQLITE3_LOAD 23 | #define wxUSE_DYNAMIC_SQLITE3_LOAD 0 24 | #endif 25 | 26 | //! To enable SQLite's meta data methods define WXSQLITE3_HAVE_METADATA as 1 here. 27 | //! Attention: SQLite needs to be compiled with SQLITE_ENABLE_COLUMN_METADATA for this to work 28 | #ifndef WXSQLITE3_HAVE_METADATA 29 | #define WXSQLITE3_HAVE_METADATA 0 30 | #endif 31 | 32 | //! To enable SQLite's database encryption support define WXSQLITE3_HAVE_CODEC as 1 here. 33 | //! Attention: SQLite needs to be compiled with SQLITE_HAS_CODEC for this to work 34 | #ifndef WXSQLITE3_HAVE_CODEC 35 | #define WXSQLITE3_HAVE_CODEC 0 36 | #endif 37 | 38 | //! To enable SQLite's loadable extension feature define WXSQLITE3_HAVE_LOAD_EXTENSION as 1 here. 39 | //! Attention: SQLite needs to be compiled without SQLITE_OMIT_LOAD_EXTENSION for this to work 40 | #ifndef WXSQLITE3_HAVE_LOAD_EXTENSION 41 | #define WXSQLITE3_HAVE_LOAD_EXTENSION 0 42 | #endif 43 | 44 | //! To disable support for named collections define WXSQLITE3_USE_NAMED_COLLECTIONS as 0 here. 45 | //! Attention: if WXSQLITE3_USE_NAMED_COLLECTIONS is defined as 1 (default) SQLite needs to be 46 | //! compiled without SQLITE_OMIT_VIRTUALTABLE for this to work 47 | #ifndef WXSQLITE3_USE_NAMED_COLLECTIONS 48 | #define WXSQLITE3_USE_NAMED_COLLECTIONS 1 49 | #endif 50 | 51 | #endif // _WX_SQLITE3_OPT_H_ 52 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Denis Kandrashin 2 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | MyRuLib 0.29 (c) Denis Kandrashin, 2009-2012 2 | 3 | Distribution: source codes are distributed under the terms 4 | of GNU General Public License (GPL). 5 | See LICENSE file for details. 6 | 7 | Project homepage: http://myrulib.lintest.ru 8 | 9 | You can contact author by email: mail@lintest.ru 10 | 11 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | This package was debianized by Kandrashin Denis on 2 | Wed, 07 Oct 2009 13:33:05 +0400. 3 | 4 | It was downloaded from: http://myrulib.lintest.ru 5 | 6 | Upstream Author: 7 | 8 | Kandrashin Denis 9 | 10 | Copyright: 11 | 12 | The Debian packaging is copyright (c) 2009 13 | by Kandrashin Denis, Moscow, Russia 14 | 15 | License: 16 | 17 | GPLv3 18 | 19 | You are free to distribute this software under the terms of 20 | the GNU General Public License. 21 | 22 | On Debian systems, the complete text of the GNU General Public 23 | License can be found in /usr/share/common-licenses/GPL file. 24 | -------------------------------------------------------------------------------- /debian/dirs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/debian/dirs -------------------------------------------------------------------------------- /debian/docs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/debian/docs -------------------------------------------------------------------------------- /debian/menu: -------------------------------------------------------------------------------- 1 | ?package(myrulib):needs="x11" section="Applications/Viewers" \ 2 | title="MyRuLib e-book library" command="myrulib" 3 | -------------------------------------------------------------------------------- /debian/myrulib-cr/control: -------------------------------------------------------------------------------- 1 | Source: myrulib-cr 2 | Section: x11 3 | Priority: optional 4 | Maintainer: Kandrashin Denis 5 | Build-Depends: debhelper (>= 7), libwxgtk2.8-dev (>=2.8.10), libxml2-dev, libsqlite3-dev, libwxsqlite3-2.8-dev, libicu-dev, libbz2-dev, libjpeg-dev, libpng-dev, libfreetype6-dev 6 | Standards-Version: 3.8.0 7 | Homepage: http://myrulib.lintest.ru 8 | 9 | Package: myrulib-cr 10 | Architecture: any 11 | Depends: ${shlibs:Depends}, ${misc:Depends} 12 | Replaces: myrulib 13 | Conflicts: myrulib 14 | Description: Create your own collection of e-books (builtin CoolReader3) 15 | MyRuLib-CR — свободная (бесплатная и открытая) программа 16 | для организации домашней библиотеки (коллекции) 17 | электронных книг формата fb2. Позволяет также читать 18 | электронные книги, используя встроенный CoolReader3. 19 | . 20 | http://myrulib.lintest.ru 21 | -------------------------------------------------------------------------------- /debian/myrulib/control: -------------------------------------------------------------------------------- 1 | Source: myrulib 2 | Section: x11 3 | Priority: optional 4 | Maintainer: Kandrashin Denis 5 | Build-Depends: debhelper (>= 7), libwxgtk2.8-dev (>=2.8.10), libxml2-dev, libsqlite3-dev, libwxsqlite3-2.8-dev, libicu-dev, libbz2-dev 6 | Standards-Version: 3.8.0 7 | Homepage: http://myrulib.lintest.ru 8 | 9 | Package: myrulib 10 | Architecture: any 11 | Depends: ${shlibs:Depends}, ${misc:Depends} 12 | Replaces: myrulib-cr 13 | Conflicts: myrulib-cr 14 | Description: Create your own collection of e-books (without reader) 15 | MyRuLib — свободная (бесплатная и открытая) программа 16 | для организации домашней библиотеки (коллекции) 17 | электронных книг формата fb2. Для чтения книг 18 | используются внешние программы. 19 | . 20 | http://myrulib.lintest.ru 21 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /desktop/016.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/desktop/016.png -------------------------------------------------------------------------------- /desktop/032.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/desktop/032.png -------------------------------------------------------------------------------- /desktop/048.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/desktop/048.png -------------------------------------------------------------------------------- /desktop/064.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/desktop/064.png -------------------------------------------------------------------------------- /desktop/128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/desktop/128.png -------------------------------------------------------------------------------- /desktop/256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/desktop/256.png -------------------------------------------------------------------------------- /desktop/512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/desktop/512.png -------------------------------------------------------------------------------- /desktop/info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleExecutable 6 | myrulib 7 | CFBundleIdentifier 8 | ru.lintest.MyRuLib 9 | CFBundleName 10 | MyRuLib 11 | CFBundleIconFile 12 | myrulib 13 | CFBundleDevelopmentRegion 14 | ru 15 | NSPrincipalClass 16 | NSApplication 17 | NSHighResolutionCapable 18 | 19 | NSPrincipalClass 20 | NSApplication 21 | 22 | -------------------------------------------------------------------------------- /desktop/myrulib.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/desktop/myrulib.icns -------------------------------------------------------------------------------- /desktop/myrulib.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/desktop/myrulib.ico -------------------------------------------------------------------------------- /scripts/Common/database.php: -------------------------------------------------------------------------------- 1 | query("begin transaction"); 6 | 7 | $sqlite_db->query(" 8 | CREATE TABLE a( 9 | Aid integer primary key, 10 | First text, 11 | Middle text, 12 | Last text, 13 | Full varchar(255), 14 | Find varchar(255), 15 | Letter char(1), 16 | Numb integer, 17 | Dscr text); 18 | "); 19 | 20 | $sqlite_db->query(" 21 | CREATE TABLE b( 22 | Bid integer primary key, 23 | Zid integer, 24 | Aid integer, 25 | Title varchar(255) not null, 26 | File text, 27 | Path text, 28 | Size integer, 29 | Type text, 30 | Md5s text, 31 | Genr text, 32 | Lang text, 33 | Date integer, 34 | Year integer, 35 | Dscr text); 36 | "); 37 | 38 | $sqlite_db->query(" 39 | CREATE TABLE s( 40 | Sid integer primary key, 41 | Seqn text, 42 | Numb integer); 43 | "); 44 | 45 | $sqlite_db->query(" 46 | CREATE TABLE ba( 47 | Bid integer not null, 48 | Aid integer); 49 | "); 50 | 51 | $sqlite_db->query(" 52 | CREATE TABLE bg( 53 | Bid integer not null, 54 | Gid text); 55 | "); 56 | 57 | $sqlite_db->query(" 58 | CREATE TABLE bs( 59 | Bid integer not null, 60 | Sid integer, 61 | Num integer); 62 | "); 63 | 64 | $sqlite_db->query("CREATE TABLE params(id integer primary key, value text)"); 65 | 66 | $sqlite_db->query("commit"); 67 | } 68 | 69 | ?> 70 | -------------------------------------------------------------------------------- /scripts/Common/strutils.php: -------------------------------------------------------------------------------- 1 | $cto ? $cto : $cfrom; 14 | for($i = 0; $i < $count; $i++){$strtolowerEx_pairs[$from[$i]] = $to[$i];} 15 | } 16 | $result = strtr($str, $strtolowerEx_pairs); 17 | return $result; 18 | } 19 | 20 | function utf8_strlen($s) 21 | { 22 | return preg_match_all('/./u', $s, $tmp); 23 | } 24 | 25 | function strtoupperEx($str){ 26 | $result = $str; 27 | global $strtoupperEx_pairs; 28 | if(!isset($strtoupperEx_pairs)){ 29 | $from = 'а б в г д е ё ж з и й к л м н о п р с т у ф х ц ч ш щ ъ ы ь э ю я a b c d e f g h i j k l m n o p q r s t u v w x y z Ё'; 30 | $to = 'А Б В Г Д Е Е Ж З И Й К Л М Н О П Р С Т У Ф Х Ц Ч Ш Щ Ъ Ы Ь Э Ю Я A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Е'; 31 | $from = explode(' ', trim($from)); 32 | $to = explode(' ', trim($to)); 33 | $cfrom = count($from); 34 | $cto = count($to); 35 | $count = $cfrom > $cto ? $cto : $cfrom; 36 | for($i = 0; $i < $count; $i++){$strtoupperEx_pairs[$from[$i]] = $to[$i];} 37 | } 38 | $result = strtr($str, $strtoupperEx_pairs); 39 | return $result; 40 | } 41 | 42 | function utf8_substr($s, $offset, $len = 'all') 43 | { 44 | if ($offset<0) $offset = utf8_strlen($s) + $offset; 45 | if ($len!='all') 46 | { 47 | if ($len<0) $len = utf8_strlen($s) - $offset + $len; 48 | $xlen = utf8_strlen($s) - $offset; 49 | $len = ($len>$xlen) ? $xlen : $len; 50 | preg_match('/^.{' . $offset . '}(.{0,'.$len.'})/us', $s, $tmp); 51 | } 52 | else 53 | { 54 | preg_match('/^.{' . $offset . '}(.*)/us', $s, $tmp); 55 | } 56 | return (isset($tmp[1])) ? $tmp[1] : false; 57 | } 58 | 59 | ?> 60 | -------------------------------------------------------------------------------- /scripts/Flibusta/conv_info.php: -------------------------------------------------------------------------------- 1 | query("begin transaction;"); 8 | 9 | $bb = new bbcode; 10 | $bb->autolinks = false; 11 | $sqltest = "SELECT AvtorId FROM libaannotations WHERE AvtorId>$min"; 12 | $query = $mysql_db->query($sqltest); 13 | while ($row = $query->fetch_array()) { 14 | echo "Auth: ".$row['AvtorId']."\n"; 15 | 16 | $sqltest1 = "SELECT Body FROM libaannotations WHERE AvtorId=".$row['AvtorId']; 17 | $query1 = $mysql_db->query($sqltest1); 18 | $row1 = $query1->fetch_array(); 19 | 20 | $sql = "UPDATE authors SET description=? where id=?"; 21 | $insert = $sqlite_db->prepare($sql); 22 | $bb -> parse($row1['Body']); 23 | $body = $bb->get_html(); 24 | $body = str_replace("<", "<", $body); 25 | $body = str_replace(">", ">", $body); 26 | $insert->execute(array($body, $row['AvtorId'])); 27 | $insert->closeCursor(); 28 | } 29 | 30 | $sqlite_db->query("commit;"); 31 | } 32 | 33 | function book_info($mysql_db, $sqlite_db, $min) 34 | { 35 | $sqlite_db->query("begin transaction;"); 36 | 37 | $bb = new bbcode; 38 | $bb->autolinks = false; 39 | $sqltest = "SELECT BookId FROM libbannotations WHERE BookId>$min"; 40 | $query = $mysql_db->query($sqltest); 41 | while ($row = $query->fetch_array()) { 42 | echo "Book: ".$row['BookId']."\n"; 43 | 44 | $sqltest1 = "SELECT Body FROM libbannotations WHERE BookId=".$row['BookId']; 45 | $query1 = $mysql_db->query($sqltest1); 46 | $row1 = $query1->fetch_array(); 47 | 48 | $sql = "UPDATE books SET description=? where id=?"; 49 | $insert = $sqlite_db->prepare($sql); 50 | $bb -> parse($row1['Body']); 51 | $body = $bb->get_html(); 52 | $body = str_replace("<", "<", $body); 53 | $body = str_replace(">", ">", $body); 54 | $insert->execute(array($body, $row['BookId'])); 55 | $insert->closeCursor(); 56 | } 57 | 58 | $sqlite_db->query("commit;"); 59 | } 60 | 61 | ?> 62 | -------------------------------------------------------------------------------- /scripts/Flibusta/download.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Script to download and restore original lib.rus.ec MySQL database files 4 | # 5 | #for t in libactions libavtoraliase libavtorname libavtor libblocked libbook.old libbook libdonations libfilename libgenrelist libgenre libjoinedbooks libpolka libseqname libseq libsrclang libtranslator; 6 | # 7 | 8 | rm *.sql.gz 9 | for t in libavtor libtranslator libavtoraliase libavtorname libbook libfilename libgenre libgenrelist libjoinedbooks librate libseqname libseq libsrclang reviews b.annotations b.annotations_pics a.annotations a.annotations_pics; 10 | 11 | do 12 | n=1000; while ! wget -t0 -c http://flibusta.net/sql/lib.$t.sql.gz; do if (let "$n<0") then break; fi; sleep 10s; n=$((n-1)); done; 13 | zcat lib.$t.sql.gz | sed -e 's/USING BTREE//g' | mysql flibusta -u root 14 | done 15 | 16 | rm myrulib.db 17 | php conv_book.php 18 | 19 | rm flibusta.db.zip 20 | zip flibusta.db.zip myrulib.db 21 | 22 | php conv_info.php 23 | 24 | rm flibusta.db.full.zip 25 | zip flibusta.db.full.zip myrulib.db 26 | -------------------------------------------------------------------------------- /scripts/GenLib/CreateGen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Script to download and restore original lib.rus.ec MySQL database files 4 | # 5 | #for t in libactions libavtoraliase libavtorname libavtor libblocked libbook.old libbook libdonations libfilename libgenrelist libgenre libjoinedbooks libpolka libseqname libseq libsrclang libtranslator; 6 | # 7 | 8 | #cd /home/lintest/librusec/ 9 | #rm *.sql.gz 10 | #rm *.sql.gz.* 11 | #for t in libavtoraliase libavtorname libavtor libbook libfilename libgenrelist libgenre libjoinedbooks libseqname libseq libsrclang libtranslator; 12 | #do 13 | # wget -c http://lib.rus.ec/sql/lib.$t.sql.gz; 14 | # zcat lib.$t.sql.gz | sed -e 's/USING BTREE//g' | mysql $DBNAME -h 127.0.0.1 -u root -D lintest_genlib -p11111111; 15 | #done 16 | 17 | 18 | 19 | #rm backup-last.rar 20 | #wget -c http://free-books.dontexist.com/dailyupdated/My%20Dropbox/Public/backup-last.rar 21 | 22 | unrar p -inul backup-last.rar | sed -e 's/USING BTREE//g' | mysql $DBNAME -h 127.0.0.1 -D lintest_genlib -u root -p11111111; 23 | 24 | #rm myrulib.db 25 | #php -c /home/lintest/etc/ convert.php 26 | 27 | #rm myrulib.db.zip 28 | #zip myrulib.db.zip myrulib.db 29 | 30 | #cp myrulib.db.zip /home/lintest/lintest.ru/docs/myrulib/current/ -------------------------------------------------------------------------------- /scripts/LibRusEc/download.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Script to download and restore original lib.rus.ec MySQL database files 4 | # 5 | 6 | rm *.sql.gz 7 | rm *.sql.gz.* 8 | for t in libavtor libavtors libbook libgenre libgenremeta libgenres libjoinedbooks libmag libmags libquality librate libseq libseqs libsrclang ; 9 | do 10 | n=1000; while ! wget -t0 -c http://lib.rus.ec/sql/$t.sql.gz; do if (let "$n<0") then break; fi; sleep 10s; n=$((n-1)); done; 11 | zcat $t.sql.gz | sed -e 's/USING BTREE//g' | mysql librusec -u root; 12 | done 13 | 14 | rm myrulib.db 15 | php convert.php 16 | 17 | rm myrulib.db.zip 18 | zip myrulib.db.zip myrulib.db 19 | -------------------------------------------------------------------------------- /scripts/Traum/download.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | rm db.rar 4 | 5 | wget -c http://traumlibrary.net/file/db.rar 6 | 7 | rm db/* 8 | unrar x db.rar 9 | 10 | php cv_traum.php 11 | 12 | rm traum.db.zip 13 | zip traum.db.zip myrulib.db 14 | -------------------------------------------------------------------------------- /scripts/TraumEpub/download.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | rm db.rar 4 | 5 | wget -c http://traumlibrary.net/file/db.rar 6 | 7 | rm db/* 8 | unrar x db.rar 9 | 10 | php cv_traum.php 11 | 12 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbAlphabet.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBALPHABET_H__ 2 | #define __FBALPHABET_H__ 3 | 4 | #include "controls/FbComboBox.h" 5 | #include "controls/FbTreeModel.h" 6 | #include "FbBookEvent.h" 7 | #include "FbThread.h" 8 | 9 | class FbAlphabetData: public FbModelData 10 | { 11 | public: 12 | FbAlphabetData(const wxString & letter, int count = 0) 13 | : m_letter(letter), m_count(Format(count)) {} 14 | FbAlphabetData(const wxString & letter, const wxString & count) 15 | : m_letter(letter), m_count(count) {} 16 | virtual FbModelData * Clone() const 17 | { return new FbAlphabetData(m_letter, m_count); } 18 | virtual wxString GetValue(FbModel & model, size_t col = 0) const; 19 | private: 20 | wxString m_letter; 21 | wxString m_count; 22 | DECLARE_CLASS(FbAlphabetData); 23 | }; 24 | 25 | class FbAlphabetThread: public FbThread 26 | { 27 | public: 28 | FbAlphabetThread(wxEvtHandler * owner) 29 | : FbThread(wxTHREAD_JOINABLE), m_owner(owner) {} 30 | 31 | protected: 32 | virtual void * Entry(); 33 | 34 | private: 35 | wxEvtHandler * m_owner; 36 | }; 37 | 38 | class FbAlphabetCombo : public FbComboBox 39 | { 40 | public: 41 | FbAlphabetCombo(); 42 | 43 | virtual ~FbAlphabetCombo(); 44 | 45 | void UpdateModel(); 46 | 47 | virtual void OnDrawItem( wxDC& dc, const wxRect& rect, int index, FbModelItem item, int flags ) const; 48 | 49 | virtual wxCoord OnMeasureItem( size_t item ) const; 50 | 51 | virtual wxCoord OnMeasureItemWidth( size_t WXUNUSED(item) ) const { return -1; } 52 | 53 | virtual bool SetFont(const wxFont& font); 54 | 55 | void SetText(const wxString &text = wxEmptyString); 56 | 57 | private: 58 | int m_rowHeight; 59 | FbAlphabetThread * m_thread; 60 | wxString m_text; 61 | int m_divider; 62 | 63 | private: 64 | void OnModel( FbModelEvent& event ); 65 | DECLARE_EVENT_TABLE() 66 | }; 67 | 68 | #endif // __FBALPHABET_H__ 69 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbBookEvent.cpp: -------------------------------------------------------------------------------- 1 | #include "FbBookEvent.h" 2 | #include "MyRuLibApp.h" 3 | 4 | DEFINE_LOCAL_EVENT_TYPE( fbEVT_BOOK_ACTION ) 5 | 6 | DEFINE_LOCAL_EVENT_TYPE( fbEVT_MODEL_ACTION ) 7 | 8 | DEFINE_LOCAL_EVENT_TYPE( fbEVT_OPEN_ACTION ) 9 | 10 | DEFINE_LOCAL_EVENT_TYPE( fbEVT_FOLDER_ACTION ) 11 | 12 | DEFINE_LOCAL_EVENT_TYPE( fbEVT_PROGRESS_ACTION ) 13 | 14 | DEFINE_LOCAL_EVENT_TYPE( fbEVT_MASTER_ACTION ) 15 | 16 | DEFINE_LOCAL_EVENT_TYPE( fbEVT_EXPORT_ACTION ) 17 | 18 | DEFINE_LOCAL_EVENT_TYPE( fbEVT_ARRAY_ACTION ) 19 | 20 | DEFINE_LOCAL_EVENT_TYPE( fbEVT_COUNT_ACTION ) 21 | 22 | DEFINE_LOCAL_EVENT_TYPE( fbEVT_IMAGE_ACTION ) 23 | 24 | DEFINE_LOCAL_EVENT_TYPE( fbEVT_LETTERS_ACTION ) 25 | 26 | DEFINE_LOCAL_EVENT_TYPE( fbEVT_INIT_FRAMES ) 27 | 28 | void FbCommandEvent::Post(wxEvtHandler *dest) 29 | { 30 | wxPostEvent(dest, *this); 31 | } 32 | 33 | void FbCommandEvent::Post() 34 | { 35 | wxPostEvent(wxGetApp().GetTopWindow(), *this); 36 | } 37 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbBookMenu.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBBOOKMENU_H__ 2 | #define __FBBOOKMENU_H__ 3 | 4 | #include 5 | #include "FbMenu.h" 6 | #include "controls/FbTreeModel.h" 7 | 8 | class FbMasterInfo; 9 | 10 | class FbBookMenu: public FbMenu 11 | { 12 | public: 13 | FbBookMenu(FbModelItem item, int book); 14 | void Init(const FbMasterInfo &master, bool bShowOrder); 15 | private: 16 | void AppendAuth(); 17 | void AppendSeqn(); 18 | void AppendFldr(int folder); 19 | private: 20 | int m_auth; 21 | int m_seqn; 22 | int m_book; 23 | }; 24 | 25 | class FbMenuAuthors: public wxMenu 26 | { 27 | public: 28 | FbMenuAuthors(int book, wxWindow * frame, wxObjectEventFunction func); 29 | }; 30 | 31 | class FbMenuSeries: public wxMenu 32 | { 33 | public: 34 | FbMenuSeries(int book, wxWindow * frame, wxObjectEventFunction func); 35 | }; 36 | 37 | class FbMenuFolders: public wxMenu 38 | { 39 | public: 40 | FbMenuFolders(int folder, wxWindow * frame, wxObjectEventFunction func); 41 | }; 42 | 43 | #endif // __FBBOOKMENU_H__ 44 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbBookTraverser.cpp: -------------------------------------------------------------------------------- 1 | #include "FbBookTraverser.h" 2 | 3 | IMPLEMENT_CLASS(FbBookTraverser, wxObject) 4 | 5 | //----------------------------------------------------------------------------- 6 | // FbBookArrayTraverser 7 | //----------------------------------------------------------------------------- 8 | 9 | void FbBookArrayTraverser::DoBook(FbModelItem & item, int level, size_t row) 10 | { 11 | int book = item.GetBook(); 12 | if (book) m_items.Add(book); 13 | } 14 | 15 | 16 | //----------------------------------------------------------------------------- 17 | // FbBookTextTraverser 18 | //----------------------------------------------------------------------------- 19 | 20 | void FbBookTextTraverser::DoBook(FbModelItem & item, int level, size_t row) 21 | { 22 | wxString str; 23 | 24 | for (int i = 0; i < level; i++) { 25 | str << wxT("\t"); 26 | } 27 | 28 | if (item.FullRow()) { 29 | size_t count = m_columns.Count(); 30 | if (count) str << item[m_columns[0]]; 31 | } else { 32 | size_t count = m_columns.Count(); 33 | for (size_t i = 0; i < count; i++) { 34 | if (i) str << wxT("\t"); 35 | str << item[m_columns[i]];; 36 | } 37 | } 38 | 39 | #ifdef __WXMSW__ 40 | str << wxT("\r"); 41 | #endif 42 | str << wxT("\n"); 43 | 44 | m_text.Prepend(str); 45 | } 46 | 47 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbBookTraverser.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBBOOKTRAVERSER_H__ 2 | #define __FBBOOKTRAVERSER_H__ 3 | 4 | #include 5 | #include "controls/FbTreeModel.h" 6 | #include "controls/FbTreeView.h" 7 | 8 | class FbBookTraverser : 9 | public wxObject 10 | { 11 | public: 12 | FbBookTraverser() {} 13 | 14 | virtual ~FbBookTraverser() {} 15 | 16 | void OnBook(FbModelItem item, int level, size_t row) 17 | { DoBook(item, level, row); } 18 | 19 | protected: 20 | virtual void DoBook(FbModelItem & item, int level, size_t row) = 0; 21 | 22 | protected: 23 | DECLARE_DYNAMIC_CLASS(FbBookTraverser) 24 | }; 25 | 26 | class FbBookArrayTraverser : 27 | public FbBookTraverser 28 | { 29 | public: 30 | FbBookArrayTraverser(wxArrayInt &items) 31 | : m_items(items) {} 32 | protected: 33 | virtual void DoBook(FbModelItem & item, int level, size_t row); 34 | 35 | private: 36 | wxArrayInt & m_items; 37 | }; 38 | 39 | class FbBookTextTraverser : 40 | public FbBookTraverser 41 | { 42 | public: 43 | FbBookTextTraverser(wxArrayInt &columns) 44 | : m_columns(columns) {} 45 | 46 | wxString GetText() 47 | { return m_text; } 48 | 49 | protected: 50 | virtual void DoBook(FbModelItem & item, int level, size_t row); 51 | 52 | private: 53 | wxArrayInt m_columns; 54 | wxString m_text; 55 | }; 56 | 57 | #endif // __FBBOOKTRAVERSER_H__ 58 | 59 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbBookTypes.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBBOOKTYPES_H__ 2 | #define __FBBOOKTYPES_H__ 3 | 4 | enum FbFolderType { 5 | FT_FOLDER = 1, 6 | FT_RATING, 7 | FT_COMMENT, 8 | FT_DOWNLOAD, 9 | FT_AUTHOR, 10 | FT_GENRE, 11 | FT_SEQNAME, 12 | FT_DATE, 13 | FT_NOTHING, 14 | }; 15 | 16 | enum FbListMode { 17 | FB2_MODE_LIST = 0, 18 | FB2_MODE_TREE = 1, 19 | }; 20 | 21 | enum FbViewMode { 22 | FB2_VIEW_HORISONTAL = 0, 23 | FB2_VIEW_VERTICAL = 1, 24 | FB2_VIEW_NOTHING = 2, 25 | }; 26 | 27 | enum FbMasterTypes { 28 | fbMT_NULL = 0, 29 | fbMT_BOOK, 30 | fbMT_AUTH, 31 | fbMT_SEQN, 32 | fbMT_GENR, 33 | fbMT_FLDR, 34 | fbMT_DOWN, 35 | fbMT_COMM, 36 | fbMT_RATE, 37 | fbMT_FIND, 38 | fbMT_DATE, 39 | fbMT_ARCH, 40 | fbMT_FILE, 41 | fbMT_LAST, 42 | }; 43 | 44 | #include 45 | WX_DEFINE_SORTED_ARRAY_INT(int, FbSortedArrayInt); 46 | 47 | #endif // __FBBOOKTYPE_H__ 48 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbCacheBook.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBCACHEBOOK_H__ 2 | #define __FBCACHEBOOK_H__ 3 | 4 | #include 5 | #include "wx/FbSQLite3.h" 6 | 7 | class FbCacheBook: public wxObject 8 | { 9 | public: 10 | static FbCacheBook Get(int code, FbSQLite3Database & database); 11 | FbCacheBook(int code = 0); 12 | FbCacheBook(int code, FbSQLite3ResultSet &result); 13 | FbCacheBook(const FbCacheBook &book); 14 | FbCacheBook & operator =(const FbCacheBook &book); 15 | operator bool() const { return m_code; } 16 | int GetCode() const { return m_code; } 17 | wxString GetValue(size_t field) const; 18 | bool IsDeleted() const; 19 | bool IsGray() const; 20 | private: 21 | static wxString GetSQL(); 22 | int m_code; 23 | wxString m_name; 24 | wxString m_auth; 25 | wxString m_genr; 26 | wxString m_lang; 27 | wxString m_type; 28 | wxString m_md5s; 29 | int m_rate; 30 | int m_date; 31 | int m_size; 32 | int m_down; 33 | bool m_gray; 34 | bool m_dltd; 35 | DECLARE_CLASS(FbCacheBook) 36 | }; 37 | 38 | #include 39 | WX_DECLARE_OBJARRAY(FbCacheBook, FbCasheBookArray); 40 | 41 | #endif // __FBCACHEBOOK_H__ 42 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbClientData.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBCLIENTDATA_H__ 2 | #define __FBCLIENTDATA_H__ 3 | 4 | #include 5 | 6 | class FbClientData : public wxClientData 7 | { 8 | public: 9 | FbClientData(const int id) : m_ID(id) {} 10 | const int GetID() {return m_ID;} 11 | private: 12 | int m_ID; 13 | }; 14 | 15 | #endif // __FBCLIENTDATA_H__ 16 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbColumns.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBCOLUMNS_H__ 2 | #define __FBCOLUMNS_H__ 3 | 4 | #include 5 | #include "FbBookTypes.h" 6 | 7 | enum FbBookFields { 8 | BF_NAME = 0, 9 | BF_AUTH, 10 | BF_NUMB, 11 | BF_GENR, 12 | BF_LANG, 13 | BF_TYPE, 14 | BF_SIZE, 15 | BF_DOWN, 16 | BF_RATE, 17 | BF_CODE, 18 | BF_DATE, 19 | BF_BITE, 20 | BF_SEQN, 21 | BF_MD5S, 22 | BF_LAST, 23 | }; 24 | 25 | class FbTreeViewCtrl; 26 | 27 | class FbColumns 28 | { 29 | public: 30 | static wxString GetName(int field); 31 | static int GetSize(int field); 32 | static wxAlignment GetAlign(int field); 33 | static wxString Get(const wxArrayInt & columns); 34 | static void Set(const wxString &text, wxArrayInt & columns); 35 | static void Create(const wxArrayInt & columns, FbListMode mode, FbTreeViewCtrl & ctrl); 36 | private: 37 | static wxChar GetChar(int field); 38 | static size_t GetCode(wxChar letter); 39 | }; 40 | 41 | #endif // __FBCOLUMNS_H__ 42 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbDataPath.cpp: -------------------------------------------------------------------------------- 1 | #include "FbDataPath.h" 2 | #include "MyRuLibApp.h" 3 | #include "FbParams.h" 4 | 5 | wxString FbStandardPaths::GetDefaultName() const 6 | { 7 | wxString result = wxStandardPaths::GetDocumentsDir(); 8 | 9 | #if wxCHECK_VERSION(2, 9, 0) 10 | result = AppendPathComponent(result, wxTheApp->GetAppName()); 11 | #else 12 | result = AppendAppName(result); 13 | #endif 14 | 15 | return result << wxT(".db"); 16 | } 17 | 18 | wxString FbStandardPaths::GetUserConfigDir() const 19 | { 20 | #ifdef __WXMSW__ 21 | wxString result = wxStandardPaths::GetUserConfigDir(); 22 | #else // __WXMSW__ 23 | wxString result = wxStandardPaths::GetUserConfigDir() + wxT("/.config/"); 24 | #endif // __WXMSW__ 25 | 26 | if (!wxFileName::DirExists(result)) wxFileName::Mkdir(result); 27 | 28 | #if wxCHECK_VERSION(2, 9, 0) 29 | result = AppendPathComponent(result, wxTheApp->GetAppName()); 30 | #else 31 | result = AppendAppName(result); 32 | #endif 33 | 34 | if (!wxFileName::DirExists(result)) wxFileName::Mkdir(result); 35 | 36 | return result; 37 | } 38 | 39 | wxString FbStandardPaths::GetConfigFile() const 40 | { 41 | wxFileName filename = GetExecutablePath(); 42 | filename.SetExt(wxT("cfg")); 43 | if ( !filename.FileExists() ) filename.SetPath(GetUserConfigDir()); 44 | filename.Normalize(); 45 | return filename.GetFullPath(); 46 | } 47 | 48 | wxString FbStandardPaths::MakeRelative(const wxString &fullpath, const wxString &basefile) 49 | { 50 | wxString basepath = wxFileName(basefile).GetPath(); 51 | wxFileName filename = fullpath; 52 | filename.MakeRelativeTo(basepath); 53 | wxString relative = filename.GetFullPath(); 54 | filename.MakeAbsolute(basepath); 55 | return filename.GetFullPath() == fullpath ? relative : fullpath; 56 | } 57 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbDataPath.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBDATAPATH_H__ 2 | #define __FBDATAPATH_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class FbStandardPaths: public wxStandardPaths 9 | { 10 | public: 11 | wxString GetDefaultName() const; 12 | virtual wxString GetConfigFile() const; 13 | virtual wxString GetUserConfigDir() const; 14 | static wxString MakeRelative(const wxString &fullname, const wxString &basefile); 15 | }; 16 | 17 | #endif // __FBDATAPATH_H__ 18 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbDateTime.cpp: -------------------------------------------------------------------------------- 1 | #include "FbDateTime.h" 2 | 3 | FbDateTime::FbDateTime(int year, int month = 1, int day = 1) 4 | : wxDateTime(day, GetMonth(month), year) 5 | { 6 | } 7 | 8 | FbDateTime::FbDateTime(int code) 9 | : wxDateTime(code % 100, GetMonth(code / 100 % 100), code / 10000 + 2000) 10 | { 11 | } 12 | 13 | wxDateTime::Month FbDateTime::GetMonth(int month) 14 | { 15 | return wxDateTime::Month((month - 1) % 12 + wxDateTime::Jan); 16 | } 17 | 18 | FbDateTime FbDateTime::Today() 19 | { 20 | return wxDateTime::Today(); 21 | } 22 | 23 | int FbDateTime::Code() const 24 | { 25 | long code; 26 | Format(wxT("%y%m%d")).ToLong(&code); 27 | return code; 28 | } 29 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbDateTime.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class FbDateTime: public wxDateTime 4 | { 5 | public: 6 | static FbDateTime Today(); 7 | FbDateTime(const wxDateTime &date): wxDateTime(date) {} 8 | FbDateTime(int year, int month, int day); 9 | FbDateTime(int code); 10 | int Code() const; 11 | private: 12 | static wxDateTime::Month GetMonth(int month); 13 | }; 14 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbDeleteThread.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBDELETETHREAD_H__ 2 | #define __FBDELETETHREAD_H__ 3 | 4 | #include 5 | #include "FbThread.h" 6 | #include "FbDatabase.h" 7 | 8 | class FbDeleteThread: public FbThread 9 | { 10 | public: 11 | FbDeleteThread(const wxString &sel): m_sel(sel) {} 12 | protected: 13 | virtual void * Entry(); 14 | private: 15 | void DoDelete(FbDatabase &database); 16 | const wxString m_sel; 17 | }; 18 | 19 | #endif // __FBDELETETHREAD_H__ 20 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbDownloader.cpp: -------------------------------------------------------------------------------- 1 | #include "FbDownloader.h" 2 | #include "FbInternetBook.h" 3 | #include "FbDatabase.h" 4 | #include "FbDataPath.h" 5 | #include "FbParams.h" 6 | #include "FbConst.h" 7 | 8 | FbDownloader::FbDownloader(): m_condition(m_mutex), m_closed(false) 9 | { 10 | wxURL(MyRuLib::HomePage()).GetProtocol().SetTimeout(FbParams(FB_WEB_TIMEOUT)); 11 | } 12 | 13 | void FbDownloader::Signal() 14 | { 15 | wxCriticalSectionLocker locker(m_section); 16 | m_condition.Broadcast(); 17 | } 18 | 19 | void FbDownloader::Close() 20 | { 21 | wxCriticalSectionLocker locker(m_section); 22 | m_closed = true; 23 | m_condition.Broadcast(); 24 | } 25 | 26 | void FbDownloader::Execute() 27 | { 28 | if ( Create() == wxTHREAD_NO_ERROR ) Run(); 29 | } 30 | 31 | bool FbDownloader::IsClosed() 32 | { 33 | return m_closed; 34 | } 35 | 36 | void * FbDownloader::Entry() 37 | { 38 | while (true) { 39 | while (true) { 40 | wxString md5sum = GetBook(); 41 | if (md5sum.IsEmpty()) break; 42 | if (m_closed) return NULL; 43 | try { FbInternetBook(this, md5sum).Execute(); } catch (...) {} 44 | wxSleep(3); 45 | } 46 | { 47 | wxMutexLocker locker(m_mutex); 48 | m_condition.Wait(); 49 | if (m_closed) return NULL; 50 | } 51 | } 52 | return NULL; 53 | } 54 | 55 | wxString FbDownloader::GetBook() 56 | { 57 | wxString sql = wxT("SELECT md5sum FROM states WHERE download<0 ORDER BY download DESC"); 58 | FbLocalDatabase database; 59 | FbSQLite3ResultSet result = database.ExecuteQuery(sql); 60 | if (result.NextRow()) return result.GetString(0); 61 | return wxEmptyString; 62 | } 63 | 64 | wxString FbDownloader::GetFilename(const wxString &md5sum, bool bCreateFolder) 65 | { 66 | wxString path = FbParamItem::GetPath(FB_DOWNLOAD_DIR); 67 | 68 | wxString name = md5sum; 69 | for (int i=1; i<=3; i++) { 70 | path += wxFileName::GetPathSeparator(); 71 | path += name.Left(2); 72 | name = name.Mid(2); 73 | } 74 | 75 | if ( bCreateFolder && !wxFileName::DirExists(path)) 76 | wxFileName::Mkdir(path, 0777, wxPATH_MKDIR_FULL); 77 | 78 | path += wxFileName::GetPathSeparator(); 79 | path += name; 80 | 81 | return path; 82 | } 83 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbDownloader.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBDOWNLOADER_H__ 2 | #define __FBDOWNLOADER_H__ 3 | 4 | #include "FbThread.h" 5 | 6 | class FbDownloader: public wxThread 7 | { 8 | public: 9 | FbDownloader(); 10 | static wxString GetFilename(const wxString &md5sum, bool bCreateFolder = false); 11 | void Signal(); 12 | void Close(); 13 | bool IsClosed(); 14 | void Execute(); 15 | protected: 16 | virtual void *Entry(); 17 | wxString GetBook(); 18 | private: 19 | wxMutex m_mutex; 20 | wxCondition m_condition; 21 | wxCriticalSection m_section; 22 | bool m_closed; 23 | }; 24 | 25 | #endif // __FBDOWNLOADER_H__ 26 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbEditBook.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBEDITBOOK_H__ 2 | #define __FBEDITBOOK_H__ 3 | 4 | #include "FbWindow.h" 5 | #include 6 | 7 | class FbEditBookDlg : public FbDialog 8 | { 9 | public: 10 | FbEditBookDlg( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); 11 | ~FbEditBookDlg(); 12 | static bool Execute(); 13 | protected: 14 | enum 15 | { 16 | ID_TITLE_CHECK = 1000, 17 | ID_TITLE_EDIT, 18 | ID_AUTHOR_CHECK, 19 | ID_AUTHOR_TEXT, 20 | ID_AUTHOR_BTN, 21 | ID_SEQUENCE_CHECK, 22 | ID_SEQUENCE_TEXT, 23 | ID_SEQUENCE_BTN, 24 | ID_GENRE_CHECK, 25 | ID_GENRE_TEXT, 26 | ID_GENRE_BTN, 27 | }; 28 | private: 29 | void AppenTitle(wxFlexGridSizer * sizer); 30 | void AppenItem(wxFlexGridSizer * sizer, wxWindowID id, const wxString &caption); 31 | }; 32 | 33 | #endif //__FBEDITBOOK_H__ 34 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbExtractInfo.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBEXTRACTINFO_H__ 2 | #define __FBEXTRACTINFO_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include "wx/FbSQLite3.h" 8 | 9 | class FbExtractItem 10 | { 11 | public: 12 | FbExtractItem(FbSQLite3ResultSet & result, int id, const wxString & ext, const wxString & md5); 13 | FbExtractItem(const FbExtractItem & item); 14 | public: 15 | wxString FileName(bool bInfoOnly) const; 16 | wxString ErrorName() const; 17 | void DeleteFile(const wxString &basepath) const; 18 | bool FindZip(const wxString &basepath, wxFileName &filename) const; 19 | bool FindBook(const wxString &basepath, wxFileName &filename) const; 20 | wxString GetURL() const; 21 | public: 22 | int id_book; 23 | int id_archive; 24 | wxString book_name; 25 | wxString book_path; 26 | wxString file_type; 27 | wxString zip_name; 28 | wxString zip_path; 29 | bool librusec; 30 | private: 31 | wxFileName GetBook(const wxString &path = wxEmptyString) const; 32 | wxFileName GetZip(const wxString &path = wxEmptyString) const; 33 | wxString InfoName() const; 34 | bool NotFb2() const; 35 | }; 36 | 37 | WX_DECLARE_OBJARRAY(FbExtractItem, FbExtractArrayBase); 38 | 39 | class FbExtractArray 40 | : public FbExtractArrayBase 41 | { 42 | public: 43 | FbExtractArray(FbSQLite3Database & database, const int id); 44 | int GetId() const {return m_id; }; 45 | void DeleteFiles(const wxString &basepath) const; 46 | private: 47 | int m_id; 48 | }; 49 | 50 | #endif // __FBEXTRACTINFO_H__ 51 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbFilterObj.cpp: -------------------------------------------------------------------------------- 1 | #include "FbFilterObj.h" 2 | #include "FbParams.h" 3 | 4 | IMPLEMENT_CLASS(FbFilterObj, wxObject) 5 | 6 | FbFilterObj::FbFilterObj() 7 | : m_enabled(false), m_lib(false), m_usr(false), m_del(false) 8 | { 9 | } 10 | 11 | FbFilterObj::FbFilterObj(const FbFilterObj & object) : 12 | m_enabled(object.m_enabled), 13 | m_lib(object.m_lib), 14 | m_usr(object.m_usr), 15 | m_del(object.m_del), 16 | m_lang(object.m_lang), 17 | m_type(object.m_type) 18 | { 19 | } 20 | 21 | FbFilterObj & FbFilterObj::operator=(const FbFilterObj & object) 22 | { 23 | m_enabled = object.m_enabled; 24 | m_lib = object.m_lib; 25 | m_usr = object.m_usr; 26 | m_del = object.m_del; 27 | m_lang = object.m_lang; 28 | m_type = object.m_type; 29 | return *this; 30 | } 31 | 32 | void FbFilterObj::Load() 33 | { 34 | m_enabled = FbParams(FB_USE_FILTER); 35 | m_lib = FbParams(FB_FILTER_LIB); 36 | m_usr = FbParams(FB_FILTER_USR); 37 | m_del = FbParams(FB_FILTER_DEL); 38 | m_lang = FbParams(FB_FILTER_LANG).Str(); 39 | m_type = FbParams(FB_FILTER_TYPE).Str(); 40 | } 41 | 42 | void FbFilterObj::Save() const 43 | { 44 | FbParams(FB_USE_FILTER) = m_enabled; 45 | FbParams(FB_FILTER_LIB) = m_lib; 46 | FbParams(FB_FILTER_USR) = m_usr; 47 | FbParams(FB_FILTER_DEL) = m_del; 48 | FbParams(FB_FILTER_LANG) = m_lang; 49 | FbParams(FB_FILTER_TYPE) = m_type; 50 | } 51 | 52 | wxString FbFilterObj::GetFilterSQL() const 53 | { 54 | wxString sql; 55 | if (!m_del) sql << wxT(" AND((books.deleted IS NULL)OR(books.deleted<>1))"); 56 | if (!m_enabled) return sql; 57 | 58 | const wxString addin = wxT(" AND books."); 59 | if (m_lib && !m_usr) sql << addin << wxT("id>0"); 60 | if (!m_lib && m_usr) sql << addin << wxT("id<0"); 61 | if (!m_lang.IsEmpty()) sql << addin << wxT("lang in (") << m_lang << wxT(')'); 62 | if (!m_type.IsEmpty()) sql << addin << wxT("file_type in (") << m_type << wxT(')'); 63 | 64 | return sql; 65 | } 66 | 67 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbFilterObj.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBFILTEROBJ_H__ 2 | #define __FBFILTEROBJ_H__ 3 | 4 | #include 5 | 6 | class FbFilterObj: public wxObject 7 | { 8 | public: 9 | friend class FbFilterDlg; 10 | public: 11 | FbFilterObj(); 12 | FbFilterObj(const FbFilterObj & object); 13 | FbFilterObj & operator=(const FbFilterObj & object); 14 | wxString GetFilterSQL() const; 15 | bool IsEnabled() const { return m_enabled; }; 16 | void Enable(bool value) { m_enabled = value; }; 17 | bool GetDeleted() const { return m_del; }; 18 | void SetDeleted(bool value) { m_del = value; }; 19 | void Load(); 20 | void Save() const; 21 | private: 22 | bool m_enabled; 23 | bool m_lib; 24 | bool m_usr; 25 | bool m_del; 26 | wxString m_lang; 27 | wxString m_type; 28 | DECLARE_CLASS(FbFilterTreeModel) 29 | }; 30 | 31 | #endif // __FBFILTEROBJ_H__ 32 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbFilterThread.cpp: -------------------------------------------------------------------------------- 1 | #include "FbFilterThread.h" 2 | #include "FbDatabase.h" 3 | #include "FbConst.h" 4 | #include "FbBookEvent.h" 5 | #include 6 | 7 | void * FbFilterThread::Entry() 8 | { 9 | int result = Execute() ? wxID_OK : wxID_CANCEL; 10 | FbCommandEvent(wxEVT_COMMAND_BUTTON_CLICKED, result, m_tempfile).Post(m_owner); 11 | return NULL; 12 | } 13 | 14 | bool FbFilterThread::Execute() 15 | { 16 | m_tempfile = wxFileName::CreateTempFileName(wxT("fb")); 17 | wxRemoveFile(m_tempfile); 18 | FbCommonDatabase database; 19 | 20 | FbProgressEvent(ID_PROGRESS_PULSE, _("Create filter")).Post(m_owner); 21 | 22 | FbSQLite3Statement stmt = database.PrepareStatement(wxT("ATTACH ? AS f")); 23 | stmt.Bind(1, m_tempfile); 24 | stmt.ExecuteUpdate(); 25 | 26 | FbSQLite3Transaction trans(&database); 27 | database.JoinThread(this); 28 | 29 | wxArrayString sql; 30 | 31 | sql.Add(wxT("CREATE TEMP TABLE tb(b INTEGER NOT NULL, a INTEGER, d INTEGER, PRIMARY KEY(b, a))")); 32 | sql.Add(wxT("CREATE TABLE f.fa(a INTEGER PRIMARY KEY, n INTEGER)")); 33 | sql.Add(wxT("CREATE TABLE f.fd(d INTEGER PRIMARY KEY, n INTEGER)")); 34 | sql.Add(wxT("CREATE TABLE f.fs(s INTEGER PRIMARY KEY, n INTEGER)")); 35 | sql.Add(wxT("CREATE TABLE f.fg(g CHAR(2), n INTEGER)")); 36 | 37 | sql.Add(wxT("INSERT INTO tb(b, a, d) SELECT DISTINCT id, id_author, created FROM books WHERE 1") + m_filter.GetFilterSQL()); 38 | sql.Add(wxT("INSERT INTO f.fa(a, n) SELECT a, COUNT(b) FROM tb GROUP BY a")); 39 | sql.Add(wxT("INSERT INTO f.fd(d, n) SELECT d, COUNT(b) FROM tb GROUP BY d")); 40 | sql.Add(wxT("INSERT INTO f.fs(s, n) SELECT id_seq, COUNT(DISTINCT b) FROM tb INNER JOIN bookseq ON b=id_book GROUP BY id_seq")); 41 | sql.Add(wxT("INSERT INTO f.fg(g, n) SELECT id_genre, COUNT(DISTINCT b) FROM tb INNER JOIN genres ON b=id_book GROUP BY id_genre")); 42 | 43 | size_t count = sql.Count(); 44 | for (size_t i = 0; i < count; i++) { 45 | database.ExecuteUpdate(sql[i]); 46 | if (IsClosed()) return false; 47 | } 48 | 49 | trans.Commit(); 50 | 51 | return true; 52 | } 53 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbFilterThread.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBFILTERTHREAD_H__ 2 | #define __FBFILTERTHREAD_H__ 3 | 4 | #include "FbThread.h" 5 | #include "FbFilterObj.h" 6 | 7 | class FbFilterThread : public FbThread 8 | { 9 | public: 10 | FbFilterThread(wxEvtHandler * owner, const FbFilterObj & filter) 11 | : FbThread(wxTHREAD_JOINABLE), m_owner(owner), m_filter(filter) {} 12 | 13 | protected: 14 | virtual void * Entry(); 15 | 16 | private: 17 | bool Execute(); 18 | 19 | private: 20 | wxEvtHandler * m_owner; 21 | FbFilterObj m_filter; 22 | wxString m_tempfile; 23 | }; 24 | 25 | #endif // __FBFILTERTHREAD_H__ 26 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbFrameThread.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBFRAMETHREAD_H__ 2 | #define __FBFRAMETHREAD_H__ 3 | 4 | #include 5 | #include "wx/FbSQLite3.h" 6 | #include "FbThread.h" 7 | #include "FbDatabase.h" 8 | #include "FbFilterObj.h" 9 | 10 | class FbFrameDatabase : public FbDatabase 11 | { 12 | public: 13 | FbFrameDatabase(FbThread * thread, wxString &filename); 14 | }; 15 | 16 | class FbFrameThread : public FbThread 17 | { 18 | public: 19 | static int GetCount(FbSQLite3Database &database, int code); 20 | 21 | FbFrameThread(wxEvtHandler * frame, const wxString &counter) 22 | : FbThread(wxTHREAD_JOINABLE), m_frame(frame), m_counter(counter) {} 23 | 24 | virtual ~FbFrameThread(void) 25 | {} 26 | 27 | void SetCountSQL(const wxString &sql, const FbFilterObj &filter); 28 | 29 | protected: 30 | static wxString GetOrder(int order, const wxString &standart); 31 | void CreateCounter(FbSQLite3Database &database, const wxString &sql); 32 | virtual void MakeModel(FbSQLite3ResultSet &result) {} 33 | 34 | protected: 35 | wxEvtHandler * m_frame; 36 | wxString m_counter; 37 | wxString m_sql; 38 | }; 39 | 40 | class FbCountThread : public FbFrameThread 41 | { 42 | public: 43 | FbCountThread(wxEvtHandler * frame) : FbFrameThread(frame, wxEmptyString) {} 44 | protected: 45 | virtual void * Entry(); 46 | }; 47 | 48 | #endif // __FBFRAMETHREAD_H__ 49 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbGenreThread.cpp: -------------------------------------------------------------------------------- 1 | #include "FbGenreThread.h" 2 | #include "FbDatabase.h" 3 | #include "FbBookEvent.h" 4 | #include "FbConst.h" 5 | 6 | void * FbGenreThread::Entry() 7 | { 8 | FbCommonDatabase database; 9 | database.JoinThread(this); 10 | FbSQLite3Transaction trans(&database, WXSQLITE_TRANSACTION_EXCLUSIVE); 11 | 12 | wxString msg = _("Rebuild the list of genres"); 13 | 14 | database.ExecuteUpdate(wxT("DROP TABLE genres")); 15 | database.ExecuteUpdate(wxT("CREATE TABLE genres(id_book integer, id_genre CHAR(2));")); 16 | database.ExecuteUpdate(wxT("CREATE INDEX genres_book ON genres(id_book);")); 17 | database.ExecuteUpdate(wxT("CREATE INDEX genres_genre ON genres(id_genre);")); 18 | 19 | int count = database.ExecuteScalar(wxT("SELECT count(DISTINCT id) FROM books")); 20 | if (count == 0) return NULL; 21 | 22 | int pos = 0; 23 | wxString sql = wxT("SELECT id, genres FROM books"); 24 | FbSQLite3ResultSet res = database.ExecuteQuery(sql); 25 | while (res.NextRow()) { 26 | int id = res.GetInt(0); 27 | wxString genres = res.GetString(1); 28 | int len = genres.Len(); 29 | for (int i = 0; i < len; i+=2) { 30 | wxString sql = wxT("INSERT INTO genres(id_book, id_genre) VALUES(?,?)"); 31 | FbSQLite3Statement stmt = database.PrepareStatement(sql); 32 | stmt.Bind(1, id); 33 | stmt.Bind(2, genres.Mid(i, 2)); 34 | FbSQLite3ResultSet result = stmt.ExecuteQuery(); 35 | } 36 | FbProgressEvent(ID_PROGRESS_UPDATE, msg, ++pos * 1000 / count).Post(); 37 | } 38 | 39 | trans.Commit(); 40 | FbProgressEvent(ID_PROGRESS_UPDATE).Post(); 41 | 42 | return NULL; 43 | } 44 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbGenreThread.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBGENRETHREAD_H__ 2 | #define __FBGENRETHREAD_H__ 3 | 4 | #include "FbThread.h" 5 | 6 | class FbGenreThread: public FbThread 7 | { 8 | public: 9 | FbGenreThread() {} 10 | protected: 11 | virtual void * Entry(); 12 | }; 13 | 14 | #endif // __FBGENRETHREAD_H__ -------------------------------------------------------------------------------- /sources/MyRuLib/FbGenres.h: -------------------------------------------------------------------------------- 1 | #ifndef FBGENRES_H 2 | #define FBGENRES_H 3 | 4 | #include 5 | #include "wx/FbSQLite3.h" 6 | #include "controls/FbTreeModel.h" 7 | #include "FbStringHash.h" 8 | 9 | class FbGenreGroup: public wxObject 10 | { 11 | public: 12 | FbGenreGroup(const wxString &code, const wxString &name) 13 | : m_code(code), m_name(name) {} 14 | void Add(const wxString &code) 15 | { m_items.Add(code); } 16 | private: 17 | wxString m_code; 18 | wxString m_name; 19 | wxArrayString m_items; 20 | friend class FbGenres; 21 | DECLARE_CLASS(FbGenreGroup); 22 | }; 23 | 24 | #include 25 | WX_DECLARE_OBJARRAY( FbGenreGroup, FbGenreArray ); 26 | 27 | class FbGenres: public wxObject 28 | { 29 | public: 30 | static void Init(); 31 | static wxString Char(const wxString &code); 32 | static wxString Name(const wxString &letter); 33 | static wxString DecodeList(const wxString &genres); 34 | static void GetNames(FbStringHash & names); 35 | static FbModel * CreateModel(const wxString &code = wxEmptyString); 36 | private: 37 | static wxCriticalSection sm_section; 38 | static FbGenreArray sm_groups; 39 | static FbStringHash sm_chars; 40 | static FbStringHash sm_names; 41 | DECLARE_CLASS(FbGenres); 42 | }; 43 | 44 | class FbGenreFunction : public wxSQLite3ScalarFunction 45 | { 46 | public: 47 | FbGenreFunction() { FbGenres::GetNames(m_names); } 48 | protected: 49 | virtual void Execute(wxSQLite3FunctionContext& ctx); 50 | private: 51 | wxString DecodeList(const wxString &genres); 52 | FbStringHash m_names; 53 | }; 54 | 55 | #endif //FBGENRES_H 56 | 57 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbImportCtx.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBIMPORTCTX_H__ 2 | #define __FBIMPORTCTX_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include "FbDatabase.h" 8 | #include "FbStringHash.h" 9 | 10 | class AuthorItem 11 | { 12 | public: 13 | AuthorItem(int id = 0): m_id(id) {}; 14 | wxString GetFullName(); 15 | void Convert(FbDatabase & database); 16 | int GetId() { return m_id; } 17 | int Find(FbDatabase & database); 18 | int Load(FbDatabase & database); 19 | int Save(FbDatabase & database); 20 | wxString first; 21 | wxString middle; 22 | wxString last; 23 | private: 24 | void SetNames(); 25 | void Bind(FbSQLite3Statement &stmt, int param, const wxString &value); 26 | private: 27 | int m_id; 28 | }; 29 | 30 | WX_DECLARE_OBJARRAY(AuthorItem, AuthorArray); 31 | 32 | class SequenceItem 33 | { 34 | public: 35 | SequenceItem(): m_id(0), m_number(0) {}; 36 | SequenceItem(const FbStringHash &atts); 37 | public: 38 | int Convert(FbDatabase & database); 39 | int GetId() const { return m_id; } 40 | int GetNumber() const { return m_number; } 41 | private: 42 | int FindSequence(FbDatabase & database); 43 | int m_id; 44 | wxString m_name; 45 | long m_number; 46 | }; 47 | 48 | WX_DECLARE_OBJARRAY(SequenceItem, SequenceArray); 49 | 50 | #endif // FBIMPORTCTX_H__ 51 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbImportWizard.cpp: -------------------------------------------------------------------------------- 1 | #include "FbImportWizard.h" 2 | 3 | FbImportWizard::~FbImportWizard(void) 4 | { 5 | } 6 | 7 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbImportWizard.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBIMPORTWIZARD_H__ 2 | #define __FBIMPORTWIZARD_H__ 3 | 4 | #include 5 | 6 | class FbImportWizard : 7 | public wxWizard 8 | { 9 | public: 10 | FbImportWizard() { Init(); } 11 | 12 | FbImportWizard(wxWindow *parent, 13 | int id = wxID_ANY, 14 | const wxString& title = wxEmptyString, 15 | const wxBitmap& bitmap = wxNullBitmap, 16 | const wxPoint& pos = wxDefaultPosition, 17 | long style = wxDEFAULT_DIALOG_STYLE) 18 | { 19 | Init(); 20 | Create(parent, id, title, bitmap, pos, style); 21 | } 22 | 23 | bool Create(wxWindow *parent, 24 | int id = wxID_ANY, 25 | const wxString& title = wxEmptyString, 26 | const wxBitmap& bitmap = wxNullBitmap, 27 | const wxPoint& pos = wxDefaultPosition, 28 | long style = wxDEFAULT_DIALOG_STYLE); 29 | 30 | void Init(); 31 | 32 | virtual ~FbImportWizard(void); 33 | 34 | private: 35 | 36 | }; 37 | 38 | #endif // __FBIMPORTWIZARD_H__ 39 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbInternetBook.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBINTERNETBOOK_H__ 2 | #define __FBINTERNETBOOK_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include "FbDownloader.h" 8 | 9 | class FbInternetBook 10 | { 11 | public: 12 | static wxString GetURL(const int id, const wxString& md5sum = wxEmptyString); 13 | static bool Download(wxEvtHandler * owner, const wxString & address, const wxString & filename, const wxString &cookie = wxEmptyString); 14 | static bool Download(const wxString & address, wxString & filename, const wxString &cookie = wxEmptyString); 15 | FbInternetBook(FbDownloader * owner, const wxString& md5sum); 16 | bool Execute(); 17 | private: 18 | bool DoDownload(); 19 | bool DownloadUrl(const wxString &cookie = wxEmptyString); 20 | bool CheckFile(); 21 | bool CheckZip(); 22 | void SaveFile(const bool success); 23 | private: 24 | int m_id; 25 | FbDownloader * m_owner; 26 | wxString m_url; 27 | wxString m_md5sum; 28 | wxString m_filetype; 29 | wxString m_filename; 30 | bool m_zipped; 31 | }; 32 | 33 | #endif // __FBINTERNETBOOK_H__ 34 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbLocale.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBLOCALE_H__ 2 | #define __FBLOCALE_H__ 3 | 4 | #include 5 | #include 6 | 7 | class FbChoiceInt; 8 | 9 | class FbLocale: public wxLocale 10 | { 11 | public: 12 | virtual bool Init(int language = wxLANGUAGE_DEFAULT, int flags = wxLOCALE_LOAD_DEFAULT); 13 | static void Fill(FbChoiceInt * choise, int value); 14 | private: 15 | bool LoadResource(const wxLanguageInfo * info, const wxString & filename); 16 | bool Save(const wxFileName &filename, const void *data, size_t size); 17 | wxFileName GetLocaleFilename(); 18 | int m_language; 19 | }; 20 | 21 | #endif // __FBLOCALE_H__ 22 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbLogStream.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBLOGSTREAM_H__ 2 | #define __FBLOGSTREAM_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | class FbLog: public wxLog 11 | { 12 | public: 13 | static bool Update(wxArrayString &lines); 14 | protected: 15 | void PostMsg(wxLogLevel level, const wxChar *szString, time_t t); 16 | protected: 17 | static wxCriticalSection sm_queue; 18 | static wxArrayString sm_lines; 19 | }; 20 | 21 | #ifdef FB_SYSLOG_LOGGING 22 | 23 | class FbLogSyslog: public FbLog 24 | { 25 | public: 26 | FbLogSyslog(); 27 | virtual ~FbLogSyslog(); 28 | protected: 29 | virtual void DoLog(wxLogLevel level, const wxChar *szString, time_t t); 30 | }; 31 | 32 | #else // FB_SYSLOG_LOGGING 33 | 34 | class FbLogStream: public FbLog 35 | { 36 | public: 37 | FbLogStream(); 38 | protected: 39 | virtual void DoLog(wxLogLevel level, const wxChar *szString, time_t t); 40 | virtual void DoLogString(const wxChar *szString, time_t t); 41 | private: 42 | wxFileOutputStream m_stream; 43 | wxTextOutputStream m_text; 44 | }; 45 | 46 | #endif // FB_SYSLOG_LOGGING 47 | 48 | #endif // __FBLOGSTREAM_H__ 49 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbLogoBitmap.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBLOGOBITMAP_H__ 2 | #define __FBLOGOBITMAP_H__ 3 | 4 | #include "res/nocheck.xpm" 5 | #include "res/checked.xpm" 6 | #include "res/checkout.xpm" 7 | #include "res/add.xpm" 8 | #include "res/mod.xpm" 9 | #include "res/del.xpm" 10 | 11 | #ifndef __WIN32__ 12 | #include "res/home.xpm" 13 | #endif 14 | 15 | #include 16 | 17 | #define FB_CHECKBOX_HEIGHT 14 18 | #define FB_CHECKBOX_WIDTH 14 19 | 20 | class FbLogoBitmap: public wxBitmap 21 | { 22 | public: 23 | FbLogoBitmap() 24 | #ifndef __WIN32__ 25 | :wxBitmap(home_xpm) 26 | #endif 27 | { 28 | #ifdef __WIN32__ 29 | wxIcon icon(wxT("aaaa")); 30 | CopyFromIcon(icon); 31 | #endif 32 | }; 33 | 34 | private: 35 | void Unused() 36 | { 37 | wxUnusedVar(nocheck_xpm); 38 | wxUnusedVar(checked_xpm); 39 | wxUnusedVar(checkout_xpm); 40 | wxUnusedVar(add_xpm); 41 | wxUnusedVar(mod_xpm); 42 | wxUnusedVar(del_xpm); 43 | }; 44 | }; 45 | 46 | #endif // __FBLOGOBITMAP_H__ 47 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbMainMenu.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBMAINMENU_H__ 2 | #define __FBMAINMENU_H__ 3 | 4 | #include 5 | #include "FbMenu.h" 6 | 7 | #define fbFIND_MENU_POSITION 3 8 | #define fbBOOK_MENU_POSITION 4 9 | 10 | class FbMenuBar: public wxMenuBar 11 | { 12 | public: 13 | FbMenuBar(); 14 | class MenuFile : public FbMenu { public: MenuFile ();}; 15 | class MenuEdit : public FbMenu { public: MenuEdit ();}; 16 | class MenuFrame : public FbMenu { public: MenuFrame ();}; 17 | class MenuLib : public FbMenu { public: MenuLib ();}; 18 | class MenuTree : public FbMenu { public: MenuTree ();}; 19 | class MenuHelp : public FbMenu { public: MenuHelp ();}; 20 | class MenuRecent : public FbMenu { public: MenuRecent ();}; 21 | class MenuWindow : public FbMenu { public: MenuWindow ();}; 22 | class MenuListMode : public FbMenu { public: MenuListMode ();}; 23 | class MenuTabArt : public FbMenu { public: MenuTabArt ();}; 24 | class MenuPreview : public FbMenu { public: MenuPreview ();}; 25 | 26 | #ifdef FB_INCLUDE_READER 27 | class MenuRead : public FbMenu { public: MenuRead ();}; 28 | #endif // FB_INCLUDE_READER 29 | }; 30 | 31 | #endif // __FBMAINMENU_H__ 32 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbMasterThread.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBMASTERTHREAD_H__ 2 | #define __FBMASTERTHREAD_H__ 3 | 4 | #include 5 | #include 6 | #include "FbThread.h" 7 | #include "FbMasterInfo.h" 8 | #include "FbFilterObj.h" 9 | 10 | class FbMasterThread : public FbThread 11 | { 12 | public: 13 | FbMasterThread(wxEvtHandler * owner); 14 | virtual ~FbMasterThread(); 15 | void Reset(const FbMasterInfo &info, const FbFilterObj &filter); 16 | virtual void Close(); 17 | protected: 18 | virtual void * Entry(); 19 | private: 20 | wxMutex m_mutex; 21 | wxCondition m_condition; 22 | wxCriticalSection m_section; 23 | wxEvtHandler * m_owner; 24 | FbMasterInfo m_info; 25 | FbFilterObj m_filter; 26 | FbThread * m_thread; 27 | bool m_closed; 28 | }; 29 | 30 | #endif // __FBMASTERTHREAD_H__ 31 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbMenu.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBMENU_H__ 2 | #define __FBMENU_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class FbMenu: public wxMenu 9 | { 10 | public: 11 | enum Type { 12 | AUTH, 13 | SEQN, 14 | FLDR, 15 | CLSS, 16 | }; 17 | 18 | wxMenuItem * AppendImg(int itemid, const wxString& text, const wxArtID& art, const wxString& help = wxEmptyString, wxItemKind kind = wxITEM_NORMAL) 19 | { 20 | wxMenuItem * item = new wxMenuItem(this, itemid, text, help, kind); 21 | #ifndef __WXMAC__ 22 | item->SetBitmap( wxArtProvider::GetBitmap(art) ); 23 | #endif 24 | return Append(item); 25 | } 26 | 27 | wxMenuItem * AppendSub(Type type, int code, const wxString& name, const wxString& help = wxEmptyString, wxItemKind kind = wxITEM_NORMAL); 28 | }; 29 | 30 | class FbMenuSort: public FbMenu 31 | { 32 | public: 33 | FbMenuSort(); 34 | }; 35 | 36 | class FbMenuRating: public FbMenu 37 | { 38 | public: 39 | FbMenuRating(); 40 | }; 41 | 42 | class FbMenuRefs: public FbMenu 43 | { 44 | public: 45 | static wxMenuItem * Create(wxMenu * menu); 46 | FbMenuRefs() {} 47 | }; 48 | 49 | class FbMenuData { 50 | public: 51 | FbMenu::Type type; 52 | int code; 53 | }; 54 | 55 | WX_DECLARE_HASH_MAP(int, FbMenuData, wxIntegerHash, wxIntegerEqual, FbMenuHash); 56 | 57 | class FbMenuItem: public wxMenuItem 58 | { 59 | public: 60 | static bool Get(wxWindowID id, FbMenu::Type & type, int & code); 61 | 62 | FbMenuItem(wxMenu * menu, FbMenu::Type type, int code, 63 | const wxString& name = wxEmptyString, 64 | const wxString& help = wxEmptyString, 65 | wxItemKind kind = wxITEM_NORMAL, 66 | wxMenu * submenu = NULL 67 | ); 68 | 69 | virtual ~FbMenuItem(); 70 | 71 | private: 72 | static wxWindowID NewId(FbMenu::Type type, int code); 73 | static FbMenuHash m_hash; 74 | }; 75 | 76 | #endif // __FBMENU_H__ 77 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbPreviewThread.cpp: -------------------------------------------------------------------------------- 1 | #include "FbPreviewThread.h" 2 | #include "FbViewThread.h" 3 | 4 | //----------------------------------------------------------------------------- 5 | // FbPreviewThread 6 | //----------------------------------------------------------------------------- 7 | 8 | FbPreviewThread::FbPreviewThread(wxEvtHandler * owner) 9 | : FbThread(wxTHREAD_JOINABLE), m_condition(m_mutex), m_owner(owner), m_thread(NULL), m_closed(false) 10 | { 11 | } 12 | 13 | FbPreviewThread::~FbPreviewThread() 14 | { 15 | if (m_thread) { 16 | m_thread->Close(); 17 | m_thread->Wait(); 18 | wxDELETE(m_thread); 19 | } 20 | } 21 | 22 | void FbPreviewThread::Close() 23 | { 24 | wxCriticalSectionLocker locker(m_section); 25 | m_closed = true; 26 | m_condition.Broadcast(); 27 | } 28 | 29 | void FbPreviewThread::Reset(const FbViewContext &ctx, const FbViewItem &view) 30 | { 31 | wxCriticalSectionLocker locker(m_section); 32 | m_view = view; 33 | m_ctx = ctx; 34 | m_condition.Broadcast(); 35 | } 36 | 37 | void * FbPreviewThread::Entry() 38 | { 39 | while (true) { 40 | { 41 | wxMutexLocker locker(m_mutex); 42 | m_condition.Wait(); 43 | } 44 | 45 | FbViewContext ctx; 46 | FbViewItem view; 47 | { 48 | wxCriticalSectionLocker lock(m_section); 49 | if (m_closed) return NULL; 50 | if (!m_view) continue; 51 | view = m_view; 52 | ctx = m_ctx; 53 | m_view = FbViewItem::None; 54 | } 55 | 56 | 57 | if (m_thread) { 58 | m_thread->Close(); 59 | m_thread->Wait(); 60 | wxDELETE(m_thread); 61 | } 62 | 63 | m_thread = new FbViewThread(m_owner, ctx, view); 64 | if (m_thread) m_thread->Execute(); 65 | } 66 | return NULL; 67 | } 68 | 69 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbPreviewThread.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBPREVIEWTHREAD_H__ 2 | #define __FBPREVIEWTHREAD_H__ 3 | 4 | #include 5 | #include "FbThread.h" 6 | #include "controls/FbViewItem.h" 7 | #include "FbViewContext.h" 8 | 9 | class FbPreviewThread : public FbThread 10 | { 11 | public: 12 | FbPreviewThread(wxEvtHandler * owner); 13 | virtual ~FbPreviewThread(); 14 | void Reset(const FbViewContext &ctx, const FbViewItem &view); 15 | virtual void Close(); 16 | protected: 17 | virtual void * Entry(); 18 | private: 19 | wxMutex m_mutex; 20 | wxCondition m_condition; 21 | wxCriticalSection m_section; 22 | wxEvtHandler * m_owner; 23 | FbThread * m_thread; 24 | FbViewItem m_view; 25 | FbViewContext m_ctx; 26 | bool m_closed; 27 | }; 28 | 29 | #endif // __FBPREVIEWTHREAD_H__ 30 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbPreviewWindow.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBPREVIEWWINDOW_H__ 2 | #define __FBPREVIEWWINDOW_H__ 3 | 4 | #include 5 | #include "controls/FbHtmlWindow.h" 6 | #include "controls/FbTreeModel.h" 7 | #include "FbViewContext.h" 8 | #include "FbPreviewThread.h" 9 | #include "FbThread.h" 10 | #include "FbMenu.h" 11 | 12 | class FbPreviewWindow: public FbHtmlWindow 13 | { 14 | public: 15 | FbPreviewWindow(); 16 | FbPreviewWindow( 17 | wxWindow *parent, 18 | wxWindowID id = wxID_ANY, 19 | const wxPoint& pos = wxDefaultPosition, 20 | const wxSize& size = wxDefaultSize, 21 | long style = wxSUNKEN_BORDER 22 | ); 23 | bool Create( 24 | wxWindow *parent, 25 | wxWindowID id = wxID_ANY, 26 | const wxPoint& pos = wxDefaultPosition, 27 | const wxSize& size = wxDefaultSize, 28 | long style = wxSUNKEN_BORDER 29 | ); 30 | ~FbPreviewWindow(); 31 | void Reset(const FbViewContext &ctx, const FbViewItem &item); 32 | void Empty(); 33 | protected: 34 | void OnLinkClicked(const wxHtmlLinkInfo &link); 35 | private: 36 | class ContextMenu: public FbMenu { 37 | public: ContextMenu(int book, wxHtmlLinkInfo * link); 38 | }; 39 | void SaveFile(wxInputStream &stream, const wxString &filename); 40 | FbPreviewThread * m_thread; 41 | FbViewItem m_view; 42 | int m_book; 43 | wxHtmlLinkInfo m_link; 44 | private: 45 | void OnCellHover(wxHtmlCellEvent& event); 46 | void OnRightUp(wxMouseEvent& event); 47 | void OnInfoUpdate(wxCommandEvent& event); 48 | void OnCopy(wxCommandEvent& event); 49 | void OnSelectAll(wxCommandEvent& event); 50 | void OnUnselectAll(wxCommandEvent& event); 51 | void OnSaveFile(wxCommandEvent& event); 52 | void OnShowFile(wxCommandEvent& event); 53 | void OnCopyUrl(wxCommandEvent& event); 54 | DECLARE_CLASS(FbPreviewWindow) 55 | DECLARE_EVENT_TABLE(); 56 | }; 57 | 58 | #endif // __FBPREVIEWWINDOW_H__ 59 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbServiceThread.cpp: -------------------------------------------------------------------------------- 1 | #include "FbServiceThread.h" 2 | 3 | FbServiceThread::FbServiceThread() 4 | { 5 | //ctor 6 | } 7 | 8 | FbServiceThread::~FbServiceThread() 9 | { 10 | //dtor 11 | } 12 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbServiceThread.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBSERVICETHREAD_H__ 2 | #define __FBSERVICETHREAD_H__ 3 | 4 | #include "FbThread.h" 5 | 6 | enum FbServiceEnum { 7 | fbSV_EMPTY_NULL, 8 | fbSV_FULL_TEXT, 9 | fbSV_LAST, 10 | }; 11 | 12 | class FbServiceThread : public FbThread 13 | { 14 | public: 15 | FbServiceThread(); 16 | virtual ~FbServiceThread(); 17 | protected: 18 | private: 19 | }; 20 | 21 | #endif // __FBSERVICETHREAD_H__ 22 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbSmartPtr.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBSMARTPTR_H__ 2 | #define __FBSMARTPTR_H__ 3 | 4 | template 5 | class FbSmartPtr 6 | { 7 | public: 8 | FbSmartPtr(wxtype * object = NULL): m_object(object) {} 9 | 10 | ~FbSmartPtr() { wxDELETE(m_object); } 11 | 12 | wxtype * operator->() { return m_object; } 13 | 14 | wxtype & operator*() { return * m_object; } 15 | 16 | wxtype * operator&() { return m_object; } 17 | 18 | operator bool() { return m_object; } 19 | 20 | bool operator !() { return !m_object; } 21 | 22 | wxtype * Reset() 23 | { 24 | wxtype * result = m_object; 25 | m_object = NULL; 26 | return result; 27 | } 28 | 29 | wxtype * operator=(wxtype * object) 30 | { 31 | if (m_object == object) return object; 32 | wxDELETE(m_object); 33 | return m_object = object; 34 | } 35 | 36 | private: 37 | wxtype * m_object; 38 | }; 39 | 40 | #endif // __FBSMARTPTR_H__ 41 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbString.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBSTRING_H__ 2 | #define __FBSTRING_H__ 3 | 4 | #include 5 | 6 | class FbString : public wxString 7 | { 8 | public: 9 | FbString(const wxChar * psz) : wxString(psz) {} 10 | 11 | FbString(const wxString & str) : wxString(str) {} 12 | 13 | FbString(const char * psz) : wxString(psz, wxConvUTF8) {} 14 | 15 | FbString Translate() const { return wxGetTranslation(*this); } 16 | 17 | wxString & Shorten(int length = 0x20) { 18 | if (Len() <= (size_t)length) return *this; 19 | Truncate(length); 20 | int pos = Find(wxT(' '), true); 21 | if (pos >= length / 2) Truncate(pos); 22 | *this += wxChar(0x2026); 23 | return *this; 24 | } 25 | }; 26 | 27 | #define fbT(str) (FbString(str)) 28 | 29 | #endif // __FBSTRING_H__ 30 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbStringHash.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBSTRINGGASH_H__ 2 | #define __FBSTRINGGASH_H__ 3 | 4 | #include 5 | WX_DECLARE_STRING_HASH_MAP( wxString, FbStringHash ); 6 | 7 | #endif // __FBSTRINGGASH_H__ 8 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbThread.cpp: -------------------------------------------------------------------------------- 1 | #include "FbThread.h" 2 | #include "FbBookEvent.h" 3 | #include "FbConst.h" 4 | 5 | //----------------------------------------------------------------------------- 6 | // FbThread 7 | //----------------------------------------------------------------------------- 8 | 9 | wxCriticalSection FbThread::sm_section; 10 | 11 | void FbThread::DeleteRef(PFbThread & thread) 12 | { 13 | if (thread) { 14 | thread->Close(); 15 | thread->Wait(); 16 | delete thread; 17 | thread = NULL; 18 | } 19 | } 20 | 21 | bool FbThread::IsClosed() 22 | { 23 | wxCriticalSectionLocker locker(sm_section); 24 | return m_closed; 25 | } 26 | 27 | void FbThread::Close() 28 | { 29 | wxCriticalSectionLocker locker(sm_section); 30 | m_closed = true; 31 | } 32 | 33 | 34 | //----------------------------------------------------------------------------- 35 | // FbProgressThread 36 | //----------------------------------------------------------------------------- 37 | 38 | void FbProgressThread::DoPulse(const wxString & msg) 39 | { 40 | FbProgressEvent(ID_PROGRESS_PULSE, msg).Post(m_owner); 41 | } 42 | 43 | void FbProgressThread::DoStart(const wxString & msg, int max) 44 | { 45 | wxString text = msg; 46 | if (!m_info.IsEmpty()) { 47 | text.Prepend(m_info + wxT(' ')); 48 | } 49 | m_max = max; 50 | m_pos = 0; 51 | 52 | FbProgressEvent(ID_PROGRESS_START, text, 1000).Post(m_owner); 53 | } 54 | 55 | void FbProgressThread::DoStep(const wxString & msg) 56 | { 57 | int pos = m_max ? (++m_pos * 1000 / m_max) : 0; 58 | FbProgressEvent(ID_PROGRESS_UPDATE, msg, pos).Post(m_owner); 59 | } 60 | 61 | void FbProgressThread::DoFinish() 62 | { 63 | FbProgressEvent(ID_PROGRESS_UPDATE).Post(m_owner); 64 | } 65 | 66 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbThread.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBTHREAD_H__ 2 | #define __FBTHREAD_H__ 3 | 4 | #include 5 | 6 | class FbCondition 7 | : public wxCondition 8 | { 9 | public: 10 | FbCondition(): wxCondition(m_mutex) {} 11 | private: 12 | wxMutex m_mutex; 13 | }; 14 | 15 | class FbThread 16 | : public wxThread 17 | { 18 | public: 19 | typedef FbThread * PFbThread; 20 | 21 | static void DeleteRef(PFbThread & thread); 22 | 23 | FbThread(wxThreadKind kind = wxTHREAD_DETACHED) 24 | : wxThread(kind), m_closed(false) {} 25 | 26 | void Execute() 27 | { if ( Create() == wxTHREAD_NO_ERROR ) Run(); } 28 | 29 | bool IsClosed(); 30 | 31 | virtual void Close(); 32 | 33 | private: 34 | static wxCriticalSection sm_section; 35 | bool m_closed; 36 | }; 37 | 38 | class FbProgressThread 39 | : public FbThread 40 | { 41 | public: 42 | FbProgressThread(wxEvtHandler * owner, wxThreadKind kind = wxTHREAD_DETACHED) 43 | : FbThread(kind), m_owner(owner) {} 44 | wxEvtHandler * GetOwner() { return m_owner; } 45 | public: 46 | void SetInfo(const wxString & info) { m_info = info; } 47 | void DoStart(const wxString & msg, int max = 0); 48 | void DoPulse(const wxString & msg); 49 | void DoStep(const wxString & msg); 50 | void DoFinish(); 51 | private: 52 | wxEvtHandler * m_owner; 53 | wxString m_info; 54 | int m_pos; 55 | int m_max; 56 | }; 57 | 58 | #endif // __FBTHREAD_H__ 59 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbUpdateThread.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBUPDATETHREAD_H__ 2 | #define __FBUPDATETHREAD_H__ 3 | 4 | #include 5 | #include "FbThread.h" 6 | #include "FbDatabase.h" 7 | #include "controls/FbURL.h" 8 | 9 | class FbUpdateThread: public FbThread 10 | { 11 | public: 12 | FbUpdateThread(); 13 | protected: 14 | virtual void * Entry(); 15 | }; 16 | 17 | class FbUpdateItem: public wxObject 18 | { 19 | public: 20 | static wxString GetAddr(int date, const wxString &type); 21 | FbUpdateItem(FbDatabase & database, int code, const wxString &type); 22 | virtual ~FbUpdateItem(); 23 | int Execute(); 24 | private: 25 | bool ReadURL(); 26 | bool OpenZip(); 27 | int DoUpdate(); 28 | void ExecInsert(); 29 | void ExecDelete(); 30 | void CalcCount(); 31 | private: 32 | FbDatabase & m_database; 33 | int m_code; 34 | wxString m_type; 35 | wxString m_url; 36 | wxString m_filename; 37 | wxString m_dataname; 38 | DECLARE_CLASS(FbUpdateItem); 39 | }; 40 | 41 | class FbFulltextThread: public FbProgressThread 42 | { 43 | public: 44 | FbFulltextThread(wxEvtHandler * owner) 45 | : FbProgressThread(owner, wxTHREAD_JOINABLE) {} 46 | protected: 47 | virtual void * Entry(); 48 | }; 49 | 50 | #endif // __FBUPDATETHREAD_H__ 51 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbViewContext.cpp: -------------------------------------------------------------------------------- 1 | #include "FbViewContext.h" 2 | 3 | IMPLEMENT_CLASS(FbViewContext, wxObject) 4 | 5 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbViewContext.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBVIEWCONTEXT_H__ 2 | #define __FBVIEWCONTEXT_H__ 3 | 4 | #include 5 | 6 | class FbViewContext: public wxObject 7 | { 8 | public: 9 | FbViewContext() 10 | : vertical(false), editable(false) {} 11 | FbViewContext(const FbViewContext &ctx) 12 | : vertical(ctx.vertical), editable(ctx.editable) {} 13 | FbViewContext & operator =(const FbViewContext &ctx) 14 | { vertical = ctx.vertical; editable = ctx.editable; return *this; } 15 | public: 16 | bool vertical; 17 | bool editable; 18 | private: 19 | DECLARE_CLASS(FbViewContext) 20 | }; 21 | 22 | #endif // __FBVIEWCONTEXT_H__ 23 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbViewData.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBVIEWDATA_H__ 2 | #define __FBVIEWDATA_H__ 3 | 4 | #include 5 | #include "FbViewContext.h" 6 | #include "FbCacheBook.h" 7 | 8 | class FbViewThread; 9 | 10 | class FbViewData: public wxObject 11 | { 12 | public: 13 | enum Fields { 14 | ANNT = 0, 15 | DSCR, 16 | ISBN, 17 | ICON, 18 | FILE, 19 | SEQN, 20 | LAST_FIELD, 21 | }; 22 | public: 23 | static void Push(const wxString &filename, const wxImage &image); 24 | FbViewData(int id): m_id(id) {} 25 | virtual ~FbViewData(); 26 | int GetCode() const { return m_id; } 27 | void SetText(size_t index, const wxString &text); 28 | wxString GetHTML(const FbViewContext &ctx, const FbCacheBook &book) const; 29 | void AddImage(FbViewThread &thread, const wxString &filename, const wxString &imagedata); 30 | void AddImage(FbViewThread &thread, const wxString &filename, wxInputStream &stream); 31 | void Reset(); 32 | private: 33 | wxString GetTitle(const FbCacheBook &book) const; 34 | wxString GetImage(const wxString &filename) const; 35 | wxString GetText(size_t index) const; 36 | wxString GetComments(const FbViewContext &ctx, const FbCacheBook &book) const; 37 | static wxString HTML(const wxString &value, const bool bSingleQuotes = false, const bool bDoubleQuotes = true); 38 | public: 39 | const int m_id; 40 | wxString m_text[LAST_FIELD]; 41 | wxArrayString m_images; 42 | }; 43 | 44 | #include 45 | WX_DECLARE_OBJARRAY(FbViewData, FbViewDataArray); 46 | 47 | #endif // __FBVIEWDATA_H__ 48 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbViewThread.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBVIEWTHREAD_H__ 2 | #define __FBVIEWTHREAD_H__ 3 | 4 | #include 5 | #include 6 | #include "FbCacheBook.h" 7 | #include "FbDatabase.h" 8 | #include "controls/FbViewItem.h" 9 | #include "FbThread.h" 10 | #include "FbViewContext.h" 11 | 12 | class FbViewData; 13 | 14 | class FbViewThread: public FbThread 15 | { 16 | public: 17 | FbViewThread(wxEvtHandler * frame, class FbViewContext &ctx, const FbViewItem &view) 18 | : FbThread(wxTHREAD_JOINABLE), m_frame(frame), m_ctx(ctx), m_view(view) {} 19 | void SendHTML(const FbViewData &data); 20 | protected: 21 | virtual void * Entry(); 22 | private: 23 | void OpenAuth(); 24 | void OpenBook(); 25 | void OpenNone(); 26 | void SendHTML(wxWindowID winid, const wxString &html); 27 | wxString GetDescr(FbDatabase & database); 28 | wxString GetFiles(FbDatabase & database); 29 | wxString GetSeqns(FbDatabase & database); 30 | private: 31 | wxEvtHandler * m_frame; 32 | FbViewContext m_ctx; 33 | FbViewItem m_view; 34 | FbCacheBook m_book; 35 | }; 36 | 37 | #endif // __FBVIEWTHREAD_H__ 38 | -------------------------------------------------------------------------------- /sources/MyRuLib/FbWindow.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBWINDOW_H__ 2 | #define __FBWINDOW_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | class FbDialog : public wxDialog 11 | { 12 | public: 13 | FbDialog() {} 14 | 15 | FbDialog( 16 | wxWindow* parent, 17 | wxWindowID id = wxID_ANY, 18 | const wxString& title = wxEmptyString, 19 | const wxPoint& pos = wxDefaultPosition, 20 | const wxSize& size = wxDefaultSize, 21 | long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER, 22 | const wxString& name = wxFrameNameStr 23 | ); 24 | 25 | bool Create( 26 | wxWindow* parent, 27 | wxWindowID id = wxID_ANY, 28 | const wxString& title = wxEmptyString, 29 | const wxPoint& pos = wxDefaultPosition, 30 | const wxSize& size = wxDefaultSize, 31 | long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER, 32 | const wxString& name = wxFrameNameStr 33 | ); 34 | 35 | protected: 36 | static wxString GetCommandSQL(const wxString &table); 37 | void Assign(long winid, int param, bool write); 38 | }; 39 | 40 | class FbToolBar : public wxToolBar 41 | { 42 | public: 43 | wxToolBarToolBase * AddTool(int itemid, const wxString& text, const wxArtID& art, const wxString& help = wxEmptyString, wxItemKind kind = wxITEM_NORMAL) { 44 | return wxToolBar::AddTool(itemid, text, wxArtProvider::GetBitmap(art, wxART_TOOLBAR), help); 45 | } 46 | 47 | wxToolBarToolBase * AddTool(int itemid, const wxString& text, const wxBitmap& bitmap, const wxString& help = wxEmptyString, wxItemKind kind = wxITEM_NORMAL) { 48 | return wxToolBar::AddTool(itemid, text, bitmap, help); 49 | } 50 | 51 | private: 52 | void OnSubmenu(wxCommandEvent & event) { } 53 | DECLARE_CLASS(FbToolBar) 54 | DECLARE_EVENT_TABLE() 55 | }; 56 | 57 | #endif // __FBWINDOW_H__ 58 | -------------------------------------------------------------------------------- /sources/MyRuLib/MyRuLibApp.h: -------------------------------------------------------------------------------- 1 | #ifndef __MYRULIBAPP_H__ 2 | #define __MYRULIBAPP_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include "FbDatabase.h" 8 | #include "FbDownloader.h" 9 | #include "FbBookEvent.h" 10 | 11 | class FbLocale; 12 | 13 | class FbCollection; 14 | 15 | class MyRuLibApp : public wxApp 16 | { 17 | public: 18 | MyRuLibApp(); 19 | virtual bool OnInit(); 20 | virtual int OnExit(); 21 | bool OpenDatabase(const wxString &filename); 22 | const wxString GetLibFile() const; 23 | const wxString GetLibPath() const; 24 | const wxString GetAppFile() const; 25 | const wxString GetAppPath() const; 26 | void Localize(); 27 | void StartDownload(); 28 | void StopDownload(); 29 | void UpdateLibPath(); 30 | FbCollection * GetCollection(); 31 | protected: 32 | #ifdef __WXMSW__ 33 | virtual int FilterEvent(wxEvent & event); 34 | #endif // __WXMSW__ 35 | virtual void OnUnhandledException() {} 36 | virtual bool OnExceptionInMainLoop() { return true; } 37 | private: 38 | void SetLibFile(const wxString & filename); 39 | wxFileName GetDatabaseFile(); 40 | void SetAppData(const wxString &filename); 41 | void LoadBlankImage(); 42 | private: 43 | static wxCriticalSection sm_section; 44 | wxString m_LibFile; 45 | wxString m_LibPath; 46 | FbLocale * m_locale; 47 | FbCollection * m_collection; 48 | FbDownloader * m_downloader; 49 | private: 50 | void OnImageEvent(FbImageEvent & event); 51 | DECLARE_EVENT_TABLE() 52 | }; 53 | 54 | DECLARE_APP(MyRuLibApp) 55 | 56 | #endif // __MYRULIBAPP_H__ 57 | -------------------------------------------------------------------------------- /sources/MyRuLib/VacuumThread.cpp: -------------------------------------------------------------------------------- 1 | #include "VacuumThread.h" 2 | #include "FbDatabase.h" 3 | 4 | void VacuumThread::Execute() 5 | { 6 | if ( Create() != wxTHREAD_NO_ERROR ) Run(); 7 | } 8 | 9 | void * VacuumThread::Entry() 10 | { 11 | wxLogMessage(_("Start SQLite VACUUM")); 12 | FbCommonDatabase().ExecuteUpdate(wxT("VACUUM")); 13 | FbConfigDatabase().ExecuteUpdate(wxT("VACUUM")); 14 | wxLogMessage(wxT("Finish SQLite VACUUM")); 15 | return NULL; 16 | } 17 | -------------------------------------------------------------------------------- /sources/MyRuLib/VacuumThread.h: -------------------------------------------------------------------------------- 1 | #ifndef __VACUUMTHREAD_H__ 2 | #define __VACUUMTHREAD_H__ 3 | 4 | #include 5 | #include 6 | 7 | class VacuumThread : public wxThread 8 | { 9 | public: 10 | void Execute(); 11 | VacuumThread (): wxThread() {}; 12 | protected: 13 | virtual void *Entry(); 14 | }; 15 | 16 | #endif // __VACUUMTHREAD_H__ 17 | -------------------------------------------------------------------------------- /sources/MyRuLib/controls/FbChoiceCtrl.cpp: -------------------------------------------------------------------------------- 1 | #include "FbChoiceCtrl.h" 2 | 3 | IMPLEMENT_CLASS(FbChoiceInt, wxChoice) 4 | 5 | IMPLEMENT_CLASS(FbChoiceStr, wxChoice) 6 | -------------------------------------------------------------------------------- /sources/MyRuLib/controls/FbHtmlWindow.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBHTMLWINDOW_H__ 2 | #define __FBHTMLWINDOW_H__ 3 | 4 | #include 5 | 6 | class FbHtmlWindow: public wxHtmlWindow 7 | { 8 | public: 9 | FbHtmlWindow() {} 10 | 11 | FbHtmlWindow( 12 | wxWindow *parent, 13 | wxWindowID id = wxID_ANY, 14 | const wxPoint& pos = wxDefaultPosition, 15 | const wxSize& size = wxDefaultSize, 16 | long style = wxSUNKEN_BORDER 17 | ); 18 | 19 | bool Create( 20 | wxWindow *parent, 21 | wxWindowID id = wxID_ANY, 22 | const wxPoint& pos = wxDefaultPosition, 23 | const wxSize& size = wxDefaultSize, 24 | long style = wxSUNKEN_BORDER 25 | ); 26 | 27 | virtual bool SetPage(const wxString& source); 28 | 29 | void UpdateFont(bool refresh); 30 | 31 | void UnselectALL() { 32 | wxDELETE(m_selection); 33 | Refresh(); 34 | } 35 | 36 | protected: 37 | virtual wxHtmlOpeningStatus OnOpeningURL(wxHtmlURLType type, const wxString& url, wxString * redirect) const; 38 | 39 | private: 40 | void OnCopy(wxCommandEvent& event); 41 | void OnSelect(wxCommandEvent& event); 42 | void OnUnselect(wxCommandEvent& event); 43 | void OnEnableUI(wxUpdateUIEvent & event); 44 | void OnDisableUI(wxUpdateUIEvent & event); 45 | DECLARE_CLASS(FbHtmlWindow) 46 | DECLARE_EVENT_TABLE() 47 | }; 48 | 49 | #endif // __FBHTMLWINDOW_H__ 50 | -------------------------------------------------------------------------------- /sources/MyRuLib/controls/FbLogModel.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBLOGMODEL_H__ 2 | #define __FBLOGMODEL_H__ 3 | 4 | #include "FbTreeModel.h" 5 | #include "FbTreeView.h" 6 | #include "FbMenu.h" 7 | 8 | class FbLogViewCtrl 9 | : public FbTreeViewCtrl 10 | { 11 | private: 12 | void Init() {} 13 | 14 | private: 15 | class ContextMenu: public FbMenu { 16 | public: ContextMenu(); 17 | }; 18 | 19 | void OnContextMenu(wxTreeEvent& event); 20 | 21 | void OnCopy(wxCommandEvent & event); 22 | 23 | void OnSelect(wxCommandEvent & event) { 24 | SelectAll(true); 25 | } 26 | void OnUnselect(wxCommandEvent & event) { 27 | SelectAll(false); 28 | } 29 | 30 | void OnEnableUI(wxUpdateUIEvent & event) { 31 | event.Enable(GetModel() && GetModel()->GetRowCount()); 32 | } 33 | 34 | void OnDisableUI(wxUpdateUIEvent & event) { 35 | event.Enable(false); 36 | } 37 | 38 | DECLARE_CLASS(FbLogViewCtrl) 39 | DECLARE_EVENT_TABLE() 40 | }; 41 | 42 | class FbLogData: public FbModelData 43 | { 44 | public: 45 | FbLogData(const wxString & text) 46 | : m_text(text) {} 47 | virtual wxString GetValue(FbModel & model, size_t col = 0) const 48 | { return m_text; } 49 | virtual FbModelData * Clone() const 50 | { return new FbLogData(m_text); } 51 | private: 52 | wxString m_text; 53 | DECLARE_CLASS(FbLogData); 54 | }; 55 | 56 | class FbLogModel : public FbListModel 57 | { 58 | public: 59 | wxString GetSelectedText(); 60 | virtual void SelectAll(bool value); 61 | virtual void Append(FbModelData * data) {} 62 | virtual void Replace(FbModelData * data) {} 63 | virtual void Delete() {} 64 | bool Update(); 65 | public: 66 | virtual size_t GetRowCount() const 67 | { return m_lines.Count(); } 68 | virtual FbModelItem GetCurrent() 69 | { return GetData(m_position); }; 70 | protected: 71 | virtual FbModelItem DoGetData(size_t row, int &level); 72 | void Append(wxString & result, size_t row); 73 | private: 74 | wxArrayString m_lines; 75 | DECLARE_CLASS(FbLogData); 76 | }; 77 | 78 | #endif // __FBLOGMODEL_H__ 79 | -------------------------------------------------------------------------------- /sources/MyRuLib/controls/FbSearchCombo.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBSEARCHCOMBO_H__ 2 | #define __FBSEARCHCOMBO_H__ 3 | 4 | #include 5 | #include 6 | 7 | class FbSearchCombo: public wxComboCtrl 8 | { 9 | public: 10 | FbSearchCombo() : wxComboCtrl() { Init(); } 11 | 12 | FbSearchCombo(wxWindow *parent, 13 | wxWindowID id = wxID_ANY, 14 | const wxString& value = wxEmptyString, 15 | const wxPoint& pos = wxDefaultPosition, 16 | const wxSize& size = wxDefaultSize, 17 | long style = 0, 18 | const wxValidator& validator = wxDefaultValidator, 19 | const wxString& name = wxComboBoxNameStr) 20 | : wxComboCtrl() 21 | { 22 | Init(); 23 | Create(parent,id,value, 24 | pos,size, 25 | // Style flag wxCC_STD_BUTTON makes the button 26 | // behave more like a standard push button. 27 | style | wxCC_STD_BUTTON, 28 | validator,name); 29 | 30 | SetButtonBitmaps(RenderButtonBitmap(), true); 31 | } 32 | 33 | virtual void DoSetPopupControl(wxComboPopup* WXUNUSED(popup)) {} 34 | 35 | private: 36 | virtual void OnButtonClick() 37 | { 38 | wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, GetId()); 39 | wxPostEvent(this, event); 40 | } 41 | 42 | void OnSelectAll(wxCommandEvent& event) 43 | { 44 | GetTextCtrl()->SelectAll(); 45 | } 46 | 47 | private: 48 | // Initialize member variables here 49 | void Init() {} 50 | private: 51 | wxBitmap RenderButtonBitmap(); 52 | DECLARE_CLASS(FbSearchCombo) 53 | DECLARE_EVENT_TABLE() 54 | }; 55 | 56 | #endif // __FBSEARCHCOMBO_H__ 57 | -------------------------------------------------------------------------------- /sources/MyRuLib/controls/FbToolBar.cpp: -------------------------------------------------------------------------------- 1 | #include "FbToolBar.h" 2 | #include "FbParams.h" 3 | 4 | FbToolBarImages::FbToolBarImages(wxToolBar & toolbar, const wxString &sample) 5 | : m_toolbar(toolbar) 6 | { 7 | m_font_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT); 8 | m_tool_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW); 9 | m_brush = wxBrush(m_tool_colour, wxSOLID); 10 | m_font = FbParams(FB_FONT_TOOL); 11 | 12 | wxBitmap bitmap(10, 10); 13 | wxMemoryDC dc; 14 | dc.SelectObject(bitmap); 15 | dc.SetFont(m_font); 16 | m_size = dc.GetTextExtent(sample); 17 | m_size.IncBy(2, 0); 18 | m_toolbar.SetToolBitmapSize(m_size); 19 | 20 | m_rect = m_size; 21 | } 22 | 23 | wxBitmap FbToolBarImages::operator[](const wxString &text) 24 | { 25 | wxBitmap bitmap(m_size.GetX(), m_size.GetY()); 26 | wxMemoryDC dc; 27 | dc.SelectObject(bitmap); 28 | dc.SetBackground(m_brush); 29 | dc.Clear(); 30 | dc.SetFont(m_font); 31 | dc.SetTextForeground(m_font_colour); 32 | dc.DrawLabel(text, wxNullBitmap, m_rect, wxALIGN_CENTER); 33 | dc.SelectObject(wxNullBitmap); 34 | bitmap.SetMask(new wxMask(bitmap, m_tool_colour)); 35 | 36 | return bitmap; 37 | } 38 | -------------------------------------------------------------------------------- /sources/MyRuLib/controls/FbToolBar.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBTOOLBAR_H__ 2 | #define __FBTOOLBAR_H__ 3 | 4 | #include 5 | 6 | class FbToolBarImages 7 | { 8 | public: 9 | FbToolBarImages(wxToolBar & toolbar, const wxString &sample); 10 | wxBitmap operator[](const wxString &text); 11 | private: 12 | wxToolBar & m_toolbar; 13 | private: 14 | wxColour m_font_colour; 15 | wxColour m_tool_colour; 16 | wxBrush m_brush; 17 | wxFont m_font; 18 | wxSize m_size; 19 | wxRect m_rect; 20 | 21 | }; 22 | 23 | #endif // __FBTOOLBAR_H__ 24 | -------------------------------------------------------------------------------- /sources/MyRuLib/controls/FbURL.cpp: -------------------------------------------------------------------------------- 1 | #include "FbURL.h" 2 | #include "FbConst.h" 3 | #include "FbParams.h" 4 | #include "wx/base64.h" 5 | 6 | FbURL::FbURL(const wxString& sUrl): wxURL(sUrl) 7 | { 8 | bool use_proxy = FbParams(FB_USE_PROXY); 9 | if (use_proxy) SetProxy(FbParams(FB_PROXY_ADDR)); 10 | 11 | wxHTTP & http = (wxHTTP&)GetProtocol(); 12 | http.SetFlags(wxSOCKET_WAITALL); 13 | int timeout = FbParams(FB_WEB_TIMEOUT); 14 | if (timeout > 0) http.SetTimeout(timeout); 15 | http.SetHeader(wxT("User-Agent"), MyRuLib::UserAgent()); 16 | 17 | if (use_proxy) { 18 | wxString auth = FbParams(FB_PROXY_USER); 19 | if (!auth.IsEmpty()) { 20 | auth << wxT(':') << FbParams(FB_PROXY_PASS).Str(); 21 | wxCharBuffer buff = auth.mb_str(wxConvUTF8); 22 | wxString text = wxT("Basic"); 23 | text << wxT(' ') << wxBase64Encode(buff, strlen(buff)); 24 | http.SetHeader(wxT("Proxy-Authorization"), text); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /sources/MyRuLib/controls/FbURL.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBURL_H__ 2 | #define __FBURL_H__ 3 | 4 | #include 5 | 6 | class FbURL: public wxURL 7 | { 8 | public: 9 | FbURL(const wxString& sUrl = wxEmptyString); 10 | private: 11 | static wxString GetUserAgent(); 12 | }; 13 | 14 | #endif // __FBURL_H__ -------------------------------------------------------------------------------- /sources/MyRuLib/controls/FbViewItem.cpp: -------------------------------------------------------------------------------- 1 | #include "FbViewItem.h" 2 | 3 | //----------------------------------------------------------------------------- 4 | // FbViewItem 5 | //----------------------------------------------------------------------------- 6 | 7 | IMPLEMENT_CLASS(FbViewItem, wxObject) 8 | 9 | -------------------------------------------------------------------------------- /sources/MyRuLib/controls/FbViewItem.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBVIEWITEM_H__ 2 | #define __FBVIEWITEM_H__ 3 | 4 | #include 5 | 6 | class FbViewItem: public wxObject 7 | { 8 | public: 9 | enum Types { 10 | None, 11 | Auth, 12 | Book, 13 | }; 14 | FbViewItem(Types type = None, int code = 0) 15 | : m_type(type), m_code(code) {} 16 | FbViewItem(const FbViewItem & item) 17 | : m_type(item.m_type), m_code(item.m_code) {} 18 | FbViewItem & operator=(const FbViewItem & item) 19 | { m_type = item.m_type; m_code = item.m_code; return *this; } 20 | operator bool() const 21 | { return m_type != None && m_code; } 22 | Types GetType() const 23 | { return m_type; } 24 | int GetCode() const 25 | { return m_code; } 26 | private: 27 | Types m_type; 28 | int m_code; 29 | DECLARE_CLASS(FbViewItem); 30 | }; 31 | 32 | #endif // __FBVIEWITEM_H__ 33 | -------------------------------------------------------------------------------- /sources/MyRuLib/controls/ProgressBar.cpp: -------------------------------------------------------------------------------- 1 | #include "ProgressBar.h" 2 | 3 | // Event table 4 | BEGIN_EVENT_TABLE(ProgressBar, wxStatusBar) 5 | EVT_SIZE(ProgressBar::OnSize) 6 | END_EVENT_TABLE() 7 | 8 | ProgressBar::ProgressBar(wxWindow *parent, wxWindowID id, long style, const wxString &name) 9 | { 10 | Create(parent, id, style, name); 11 | } 12 | 13 | bool ProgressBar::Create(wxWindow* parent, wxWindowID id, long style, const wxString& name) 14 | { 15 | bool res = wxStatusBar::Create(parent, id, style, name); 16 | if (res) { 17 | m_progress.Create(this, wxID_ANY, 1000, wxPoint(0, 0), wxDefaultSize, wxGA_HORIZONTAL | wxGA_SMOOTH); 18 | SetProgress(0); 19 | Resize(); 20 | } 21 | return res; 22 | } 23 | 24 | void ProgressBar::Resize() 25 | { 26 | if (GetFieldsCount()<=1) return ; 27 | 28 | wxRect r; 29 | GetFieldRect(1, r); 30 | m_progress.SetSize(r); 31 | } 32 | 33 | void ProgressBar::SetProgress(int progress) 34 | { 35 | m_progress.Show(progress > 0); 36 | m_progress.SetValue(progress); 37 | Resize(); 38 | } 39 | -------------------------------------------------------------------------------- /sources/MyRuLib/controls/ProgressBar.h: -------------------------------------------------------------------------------- 1 | #ifndef PROGRESSBAR_H 2 | #define PROGRESSBAR_H 3 | 4 | #include 5 | #include 6 | 7 | class ProgressBar : public wxStatusBar 8 | { 9 | private: 10 | wxGauge m_progress; 11 | void Resize(); 12 | public: 13 | ProgressBar() {} 14 | ProgressBar(wxWindow *parent, wxWindowID id, long style = wxST_SIZEGRIP, const wxString &name = wxT("ProgressBar")); 15 | bool Create(wxWindow *parent, wxWindowID id = wxID_ANY, long style = wxST_SIZEGRIP, const wxString& name = wxT("ProgressBar")); 16 | void OnSize(wxSizeEvent &event) { Resize(); }; 17 | void SetProgress(int progress); 18 | DECLARE_EVENT_TABLE(); 19 | }; 20 | 21 | #endif // PROGRESSBAR_H 22 | -------------------------------------------------------------------------------- /sources/MyRuLib/desktop/home-128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/sources/MyRuLib/desktop/home-128x128.png -------------------------------------------------------------------------------- /sources/MyRuLib/desktop/home-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/sources/MyRuLib/desktop/home-32x32.png -------------------------------------------------------------------------------- /sources/MyRuLib/desktop/home-64x64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/sources/MyRuLib/desktop/home-64x64.png -------------------------------------------------------------------------------- /sources/MyRuLib/desktop/myrulib.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=MyRuLib 3 | GenericName=E-Book Library Manager 4 | GenericName[ru]=Каталогизатор электронных книг 5 | Comment=Organizer of your collection of e-books 6 | Comment[ru]=Организатор домашней библиотеки электронных книг 7 | Type=Application 8 | Categories=Office;Database; 9 | Exec=myrulib 10 | Icon=myrulib 11 | StartupNotify=true 12 | Terminal=false 13 | -------------------------------------------------------------------------------- /sources/MyRuLib/desktop/myrulib.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/sources/MyRuLib/desktop/myrulib.png -------------------------------------------------------------------------------- /sources/MyRuLib/dialogs/FbAboutDlg.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBABOUTDLG_H__ 2 | #define __FBABOUTDLG_H__ 3 | 4 | #include 5 | #include "FbWindow.h" 6 | 7 | class FbAboutDlg : public FbDialog 8 | { 9 | public: 10 | FbAboutDlg( wxWindow* parent); 11 | }; 12 | 13 | #endif // __FBABOUTDLG_H__ 14 | -------------------------------------------------------------------------------- /sources/MyRuLib/dialogs/FbColumnDlg.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBCOLUMNDLG_H__ 2 | #define __FBCOLUMNDLG_H__ 3 | 4 | #include 5 | #include "FbWindow.h" 6 | #include "controls/FbTreeView.h" 7 | 8 | class FbColumnModel: public FbListStore 9 | { 10 | public: 11 | void MoveUp(); 12 | void MoveDown(); 13 | }; 14 | 15 | class FbColumnDlg : public FbDialog 16 | { 17 | public: 18 | static bool Execute(wxWindow * parent, wxArrayInt & columns); 19 | FbColumnDlg(wxWindow * parent, const wxArrayInt & columns); 20 | private: 21 | FbModel * CreateModel(const wxArrayInt & columns); 22 | void GetColumns(wxArrayInt & columns); 23 | void DoSelected(); 24 | private: 25 | FbTreeViewCtrl m_fields; 26 | FbToolBar m_toolbar; 27 | FbColumnModel * m_model; 28 | private: 29 | void OnItemSelected(wxTreeEvent & event); 30 | void OnMoveUp(wxCommandEvent& event); 31 | void OnMoveDown(wxCommandEvent& event); 32 | DECLARE_EVENT_TABLE() 33 | }; 34 | 35 | #endif // __FBCOLUMNDLG_H__ 36 | -------------------------------------------------------------------------------- /sources/MyRuLib/dialogs/FbDataOpenDlg.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBDATAOPENDLG_H__ 2 | #define __FBDATAOPENDLG_H__ 3 | 4 | #include 5 | #include "FbWindow.h" 6 | #include "controls/FbChoiceCtrl.h" 7 | 8 | class FbThread; 9 | 10 | class FbDataOpenDlg : public FbDialog 11 | { 12 | public: 13 | static wxString Execute(wxWindow * parent); 14 | FbDataOpenDlg( wxWindow * parent); 15 | FbThread * CreateThread(wxEvtHandler * owner); 16 | private: 17 | enum 18 | { 19 | ID_ACTION = 1000, 20 | ID_FILE_TXT, 21 | ID_FILE_BTN, 22 | ID_FOLDER_TXT, 23 | ID_FOLDER_BTN, 24 | ID_DOWNLOAD, 25 | }; 26 | wxString GetTitle() const; 27 | void UpdateFolder(); 28 | wxString CheckExt(const wxString &filename); 29 | void SetDefaultNames(); 30 | private: 31 | wxString GetFilename(); 32 | wxString GetDirname(); 33 | private: 34 | FbChoiceStr m_action; 35 | wxComboBox m_file; 36 | wxTextCtrl m_folder; 37 | wxCheckBox m_scaner; 38 | wxCheckBox m_import; 39 | wxCheckBox m_only_new; 40 | wxCheckBox m_only_md5; 41 | private: 42 | void OnActionChoise( wxCommandEvent& event ); 43 | void OnSelectFileClick( wxCommandEvent& event ); 44 | void OnSelectFolderClick( wxCommandEvent& event ); 45 | void OnFileCombo( wxCommandEvent& event ); 46 | DECLARE_EVENT_TABLE() 47 | }; 48 | 49 | 50 | #endif // __FBDATAOPENDLG_H__ 51 | -------------------------------------------------------------------------------- /sources/MyRuLib/dialogs/FbDirImportDlg.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBDIRIMPORTDLG_H__ 2 | #define __FBDIRIMPORTDLG_H__ 3 | 4 | #include 5 | #include "FbWindow.h" 6 | #include "controls/FbComboBox.h" 7 | 8 | class FbThread; 9 | 10 | class FbDirImportDlg : public FbDialog 11 | { 12 | public: 13 | static bool Execute(wxWindow * parent); 14 | FbDirImportDlg( wxWindow * parent, const wxString &title); 15 | FbThread * CreateThread(wxEvtHandler * owner); 16 | private: 17 | enum 18 | { 19 | ID_FOLDER = 1000, 20 | ID_ONLY_NEW, 21 | ID_ONLY_MD5, 22 | }; 23 | wxString GetDirname(); 24 | private: 25 | FbCustomCombo m_folder; 26 | wxCheckBox m_only_new; 27 | wxCheckBox m_only_md5; 28 | private: 29 | void OnSelectFolderClick( wxCommandEvent& event ); 30 | DECLARE_EVENT_TABLE() 31 | }; 32 | 33 | 34 | #endif // __FBDIRIMPORTDLG_H__ 35 | -------------------------------------------------------------------------------- /sources/MyRuLib/dialogs/FbFilterDlg.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBFILTERDLG_H__ 2 | #define __FBFILTERDLG_H__ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | #include "FbWindow.h" 9 | #include "controls/FbTreeView.h" 10 | #include "FbFilterObj.h" 11 | #include "FbDatabase.h" 12 | #include "FbThread.h" 13 | #include "FbParams.h" 14 | #include "FbBookEvent.h" 15 | 16 | class FbFilterDlg : public FbDialog 17 | { 18 | public: 19 | enum { 20 | ID_CHECK_LIB = 1000, 21 | ID_CHECK_USR, 22 | ID_TREE_LANG, 23 | ID_TREE_TYPE, 24 | }; 25 | static bool Execute(FbFilterObj & filter); 26 | FbFilterDlg(FbFilterObj & filter); 27 | virtual ~FbFilterDlg(); 28 | 29 | private: 30 | wxCheckBox* m_checkLib; 31 | wxCheckBox* m_checkUsr; 32 | FbTreeViewCtrl * m_treeLang; 33 | FbTreeViewCtrl * m_treeType; 34 | 35 | private: 36 | void Assign(FbFilterObj & filter); 37 | 38 | private: 39 | FbFilterObj m_filter; 40 | FbThread * m_thread; 41 | 42 | private: 43 | void OnNoButton( wxCommandEvent& event ); 44 | void OnTreeModel( FbModelEvent& event ); 45 | DECLARE_EVENT_TABLE() 46 | }; 47 | 48 | #endif //__FBFILTERDLG_H__ 49 | -------------------------------------------------------------------------------- /sources/MyRuLib/dialogs/FbProgressDlg.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBSCANERDLG_H__ 2 | #define __FBSCANERDLG_H__ 3 | 4 | #include 5 | #include "FbWindow.h" 6 | #include "FbThread.h" 7 | #include "FbBookEvent.h" 8 | 9 | class FbProgressDlg: public FbDialog 10 | { 11 | public: 12 | FbProgressDlg(wxWindow* parent, const wxString &title); 13 | virtual ~FbProgressDlg(void); 14 | void RunThread(FbThread * thread); 15 | private: 16 | FbThread * m_thread; 17 | wxStaticText m_info; 18 | wxStaticText m_text; 19 | wxGauge m_gauge; 20 | wxTimer m_timer; 21 | private: 22 | void OnTimer(wxTimerEvent& event); 23 | void OnGaugeStart(FbProgressEvent & event); 24 | void OnGaugeUpdate(FbProgressEvent & event); 25 | void OnGaugePulse(FbProgressEvent & event); 26 | DECLARE_EVENT_TABLE() 27 | }; 28 | 29 | #endif // __FBSCANERDLG_H__ 30 | -------------------------------------------------------------------------------- /sources/MyRuLib/dialogs/FbReaderDlg.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBREADERDLG_H__ 2 | #define __FBREADERDLG_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "FbWindow.h" 10 | #include "FbDatabase.h" 11 | 12 | #ifdef FB_INCLUDE_READER 13 | 14 | class FbReaderDlg : private FbDialog 15 | { 16 | public: 17 | FbReaderDlg( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER); 18 | virtual ~FbReaderDlg(); 19 | static bool Execute(wxWindow* parent); 20 | private: 21 | enum ID { 22 | ID_READER_FONT_NAME = 1000, 23 | ID_READER_FONT_SIZE, 24 | ID_READER_FONT_COLOUR, 25 | ID_READER_BACK_COLOUR, 26 | ID_HEADER_FONT_NAME, 27 | ID_HEADER_FONT_SIZE, 28 | ID_HEADER_FONT_COLOUR, 29 | ID_HEADER_SHOW_HEADER, 30 | ID_READER_INTERLINE, 31 | ID_READER_HYPHENATION, 32 | ID_READER_PAGE_COUNT, 33 | }; 34 | class PanelMain: public wxPanel 35 | { 36 | public: 37 | PanelMain(wxWindow *parent, wxArrayString & fonts); 38 | }; 39 | class PanelPage: public wxPanel 40 | { 41 | public: 42 | PanelPage(wxWindow *parent, wxArrayString & fonts); 43 | }; 44 | private: 45 | void Assign(bool write); 46 | DECLARE_EVENT_TABLE() 47 | }; 48 | 49 | #endif // FB_INCLUDE_READER 50 | 51 | #endif // __FBREADERDLG_H__ 52 | -------------------------------------------------------------------------------- /sources/MyRuLib/dialogs/FbSequenDlg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "FbWindow.h" 4 | #include "FbDatabase.h" 5 | 6 | class FbSequenDlg: public FbDialog 7 | { 8 | public: 9 | FbSequenDlg( const wxString& title = wxEmptyString, int id = 0 ); 10 | static int Append(wxString &newname); 11 | static int Modify(int id, wxString &newname); 12 | protected: 13 | virtual void EndModal(int retCode); 14 | private: 15 | bool Load(int id); 16 | int Find(); 17 | int DoAppend(); 18 | int DoUpdate(); 19 | int DoModify(); 20 | int DoReplace(); 21 | wxString GetValue() { return m_edit.GetValue().Trim(false).Trim(true); }; 22 | private: 23 | wxTextCtrl m_edit; 24 | wxStaticText m_text; 25 | FbCommonDatabase m_database; 26 | int m_id; 27 | int m_exists; 28 | }; 29 | -------------------------------------------------------------------------------- /sources/MyRuLib/dialogs/FbServiceDlg.cpp: -------------------------------------------------------------------------------- 1 | #include "FbServiceDlg.h" 2 | 3 | FbServiceDlg::FbServiceDlg() 4 | { 5 | //ctor 6 | } 7 | 8 | FbServiceDlg::~FbServiceDlg() 9 | { 10 | //dtor 11 | } 12 | -------------------------------------------------------------------------------- /sources/MyRuLib/dialogs/FbServiceDlg.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBSERVICEDLG_H__ 2 | #define __FBSERVICEDLG_H__ 3 | 4 | #include "FbWindow.h" 5 | 6 | class FbServiceDlg : public FbDialog 7 | { 8 | public: 9 | FbServiceDlg(); 10 | virtual ~FbServiceDlg(); 11 | protected: 12 | private: 13 | }; 14 | 15 | #endif // __FBSERVICEDLG_H__ 16 | -------------------------------------------------------------------------------- /sources/MyRuLib/dialogs/FbViewerDlg.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBVIEWERDLG_H__ 2 | #define __FBVIEWERDLG_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | #include "FbWindow.h" 24 | 25 | /////////////////////////////////////////////////////////////////////////// 26 | 27 | /////////////////////////////////////////////////////////////////////////////// 28 | /// Class FbViewerDlg 29 | /////////////////////////////////////////////////////////////////////////////// 30 | class FbViewerDlg : public FbDialog 31 | { 32 | public: 33 | static bool Execute( wxWindow* parent, const wxString& type, wxString &value, bool relative = false); 34 | FbViewerDlg( wxWindow* parent, const wxString& type, const wxString& value, bool relative = false); 35 | wxString GetValue(); 36 | protected: 37 | enum 38 | { 39 | ID_FILENAME = 1000, 40 | ID_COOLREADER, 41 | }; 42 | wxComboCtrl * m_filename; 43 | wxCheckBox * m_coolreader; 44 | bool m_relative; 45 | private: 46 | void OnTextEnter( wxCommandEvent& event ); 47 | void OnBtnClick( wxCommandEvent& event ); 48 | DECLARE_EVENT_TABLE() 49 | }; 50 | 51 | #endif //__FBVIEWERDLG_H__ 52 | -------------------------------------------------------------------------------- /sources/MyRuLib/frames/FbFrameAuth.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBFRAMEAUTH_H__ 2 | #define __FBFRAMEAUTH_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "FbFrameBase.h" 10 | #include "models/FbAuthList.h" 11 | #include "FbAlphabet.h" 12 | 13 | class FbAuthViewCtrl 14 | : public FbMasterViewCtrl 15 | { 16 | private: 17 | void OnMasterReplace(wxCommandEvent& event); 18 | void OnMasterAppend(wxCommandEvent& event); 19 | void OnMasterModify(wxCommandEvent& event); 20 | void OnMasterDelete(wxCommandEvent& event); 21 | void OnMasterPage(wxCommandEvent& event); 22 | void OnMasterPageUpdateUI(wxUpdateUIEvent & event); 23 | DECLARE_EVENT_TABLE() 24 | }; 25 | 26 | class FbFrameAuth : public FbFrameBase 27 | { 28 | public: 29 | FbFrameAuth(wxAuiNotebook * parent, bool select = false); 30 | void FindAuthor(const wxString &text); 31 | void ActivateAuthors(); 32 | virtual void UpdateFonts(bool refresh); 33 | virtual void UpdateMaster(); 34 | protected: 35 | virtual wxString GetCountSQL(); 36 | private: 37 | void ShowContextMenu(const wxPoint& pos, wxTreeItemId item); 38 | void CreateMasterThread(); 39 | void CreateColumns(); 40 | private: 41 | FbAlphabetCombo * m_LetterList; 42 | FbAuthListInfo m_info; 43 | private: 44 | void OnBooksCount(FbCountEvent& event); 45 | void OnColClick(wxListEvent& event); 46 | void OnAllClicked(wxCommandEvent& event); 47 | void OnLetterClicked(wxCommandEvent& event); 48 | void OnChoiceLetter(wxCommandEvent& event); 49 | void OnViewAlphavet(wxCommandEvent& event); 50 | void OnViewAlphavetUpdateUI(wxUpdateUIEvent & event); 51 | void OnContextMenu(wxTreeEvent& event); 52 | void OnNumber(wxCommandEvent& event); 53 | void OnModel( FbArrayEvent& event ); 54 | void OnArray( FbArrayEvent& event ); 55 | DECLARE_EVENT_TABLE() 56 | DECLARE_CLASS(FbFrameAuth) 57 | protected: 58 | class MasterMenu: public wxMenu 59 | { 60 | public: 61 | MasterMenu(int id); 62 | }; 63 | }; 64 | 65 | #endif // __FBFRAMEAUTH_H__ 66 | -------------------------------------------------------------------------------- /sources/MyRuLib/frames/FbFrameClss.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBFRAMECLSS_H__ 2 | #define __FBFRAMECLSS_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include "FbFrameBase.h" 11 | 12 | class FbFrameClss : public FbFrameBase 13 | { 14 | public: 15 | static FbFrameClss * Create(wxAuiNotebook * parent, int code, bool select = false); 16 | FbFrameClss(wxAuiNotebook * parent, FbSQLite3ResultSet & result, bool select = false); 17 | int GetCode() const { return m_code; } ; 18 | protected: 19 | class MasterMenu: public wxMenu { 20 | public: MasterMenu(const wxString & code); 21 | }; 22 | void CreateColumns(); 23 | private: 24 | void CreateModel(FbSQLite3ResultSet & result); 25 | void ReplaceData(int old_id, int new_id, wxTreeItemId selected, const wxString &newname); 26 | void ShowContextMenu(const wxPoint& pos, wxTreeItemId item); 27 | void SelectFirstAuthor(const int book = 0); 28 | void AppendAttay(FbTreeModel &model, const wxArrayInt &items); 29 | private: 30 | const int m_code; 31 | wxSplitterWindow * m_BooksSplitter; 32 | private: 33 | void OnContextMenu(wxTreeEvent& event); 34 | void OnItemActivated(wxTreeEvent & event); 35 | void OnBooksCount(FbCountEvent & event); 36 | DECLARE_CLASS(FbFrameClss) 37 | DECLARE_EVENT_TABLE() 38 | }; 39 | 40 | #endif // __FBFRAMECLSS_H__ 41 | -------------------------------------------------------------------------------- /sources/MyRuLib/frames/FbFrameDate.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBFRAMEDATE_H__ 2 | #define __FBFRAMEDATE_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include "FbFrameBase.h" 11 | 12 | class FbFrameDate : public FbFrameBase 13 | { 14 | public: 15 | FbFrameDate(wxAuiNotebook * parent, bool select = false); 16 | protected: 17 | void CreateColumns(); 18 | virtual wxString GetCountSQL(); 19 | private: 20 | void ReplaceData(int old_id, int new_id, wxTreeItemId selected, const wxString &newname); 21 | void ShowContextMenu(const wxPoint& pos, wxTreeItemId item); 22 | void SelectFirstAuthor(const int book = 0); 23 | void AppendAttay(FbTreeModel &model, const wxArrayInt &items); 24 | private: 25 | wxSplitterWindow * m_BooksSplitter; 26 | private: 27 | void OnBooksCount(FbCountEvent & event); 28 | void OnModel(FbModelEvent & event); 29 | void OnNumber(wxCommandEvent& event); 30 | DECLARE_CLASS(FbFrameDate) 31 | DECLARE_EVENT_TABLE() 32 | }; 33 | 34 | #endif // __FBFRAMEDATE_H__ 35 | -------------------------------------------------------------------------------- /sources/MyRuLib/frames/FbFrameDown.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBFRAMEDOWN_H__ 2 | #define __FBFRAMEDOWN_H__ 3 | 4 | #include "FbFrameBase.h" 5 | 6 | class FbFrameDown : public FbFrameBase 7 | { 8 | public: 9 | FbFrameDown(wxAuiNotebook * parent, bool select = false); 10 | void UpdateFolder(const int iFolder, const FbFolderType type); 11 | protected: 12 | virtual void UpdateBooklist(); 13 | private: 14 | void CreateColumns(); 15 | void CreateBookInfo(); 16 | void FillFolders(const int iCurrent = 0); 17 | void DeleteItems(const wxTreeItemId &root, wxArrayInt &items); 18 | FbToolBar m_ToolBar; 19 | private: 20 | void OnFavoritesDel(wxCommandEvent & event); 21 | void OnFolderAppend(wxCommandEvent & event); 22 | void OnFolderModify(wxCommandEvent & event); 23 | void OnFolderDelete(wxCommandEvent & event); 24 | void OnStart(wxCommandEvent & event); 25 | void OnPause(wxCommandEvent & event); 26 | void OnFolderSelected(wxTreeEvent & event); 27 | void OnMoveUp(wxCommandEvent& event); 28 | void OnMoveDown(wxCommandEvent& event); 29 | DECLARE_CLASS(FbFrameDown) 30 | DECLARE_EVENT_TABLE() 31 | }; 32 | 33 | #endif // __FBFRAMEDOWN_H__ 34 | -------------------------------------------------------------------------------- /sources/MyRuLib/frames/FbFrameFind.cpp: -------------------------------------------------------------------------------- 1 | #include "FbFrameFind.h" 2 | #include 3 | #include 4 | #include "FbConst.h" 5 | #include "FbBookPanel.h" 6 | #include "FbMainMenu.h" 7 | #include "FbDatabase.h" 8 | #include "FbMasterTypes.h" 9 | 10 | //----------------------------------------------------------------------------- 11 | // FbFrameFind 12 | //----------------------------------------------------------------------------- 13 | 14 | IMPLEMENT_CLASS(FbFrameFind, FbFrameBase) 15 | 16 | BEGIN_EVENT_TABLE(FbFrameFind, FbFrameBase) 17 | EVT_COMMAND(ID_INIT_SEARCH, fbEVT_BOOK_ACTION, FbFrameFind::OnInitSearch) 18 | END_EVENT_TABLE() 19 | 20 | FbFrameFind::FbFrameFind(wxAuiNotebook * parent, wxWindowID winid, const FbMasterInfo &info, const wxString &title) 21 | : FbFrameBase(parent, winid, title, true) 22 | , m_info(info) 23 | , m_title(title) 24 | { 25 | CreateBooksPanel(this); 26 | Initialize(m_BooksPanel); 27 | CreateControls(true); 28 | 29 | Update(); 30 | 31 | FbCommandEvent(fbEVT_BOOK_ACTION, ID_INIT_SEARCH).Post(this); 32 | } 33 | 34 | void FbFrameFind::OnInitSearch(wxCommandEvent& event) 35 | { 36 | UpdateBooklist(); 37 | } 38 | 39 | -------------------------------------------------------------------------------- /sources/MyRuLib/frames/FbFrameFind.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBFRAMEFIND_H__ 2 | #define __FBFRAMEFIND_H__ 3 | 4 | #include "FbFrameBase.h" 5 | 6 | class FbFrameFind : public FbFrameBase 7 | { 8 | public: 9 | FbFrameFind(wxAuiNotebook * parent, wxWindowID winid, const FbMasterInfo &info, const wxString &title); 10 | virtual FbMasterInfo GetInfo() { return m_info; } 11 | virtual void CreateColumns() {} 12 | private: 13 | void CreateBookInfo(); 14 | void FillBooks(FbSQLite3ResultSet & result, const wxString &caption); 15 | private: 16 | FbMasterInfo m_info; 17 | wxString m_title; 18 | private: 19 | void OnFoundNothing(wxCommandEvent& event); 20 | void OnInitSearch(wxCommandEvent& event); 21 | DECLARE_CLASS(FbFrameFind) 22 | DECLARE_EVENT_TABLE() 23 | }; 24 | 25 | #endif // __FBFRAMEFIND_H__ 26 | -------------------------------------------------------------------------------- /sources/MyRuLib/frames/FbFrameFldr.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBFRAMEFLDR_H__ 2 | #define __FBFRAMEFLDR_H__ 3 | 4 | #include "FbFrameBase.h" 5 | 6 | class FbFrameFldr : public FbFrameBase 7 | { 8 | public: 9 | FbFrameFldr(wxAuiNotebook * parent, bool select = false); 10 | void UpdateFolder(const int iFolder, const FbFolderType type); 11 | private: 12 | void CreateColumns(); 13 | void CreateBookInfo(); 14 | void FillFolders(const int iCurrent = 0); 15 | void DeleteItems(const wxTreeItemId &root, wxArrayInt &items); 16 | FbParentData * m_folders; 17 | FbToolBar m_ToolBar; 18 | private: 19 | void OnFavoritesDel(wxCommandEvent & event); 20 | void OnFolderAppend(wxCommandEvent & event); 21 | void OnFolderModify(wxCommandEvent & event); 22 | void OnFolderDelete(wxCommandEvent & event); 23 | void OnFolderSelected(wxTreeEvent & event); 24 | DECLARE_CLASS(FbFrameFldr) 25 | DECLARE_EVENT_TABLE() 26 | }; 27 | 28 | #endif // __FBFRAMEFLDR_H__ 29 | -------------------------------------------------------------------------------- /sources/MyRuLib/frames/FbFrameGenr.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBFRAMEGENR_H__ 2 | #define __FBFRAMEGENR_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include "wx/FbSQLite3.h" 12 | #include "FbFrameBase.h" 13 | #include "FbBookEvent.h" 14 | #include "FbSmartPtr.h" 15 | 16 | class FbFrameGenr : public FbFrameBase 17 | { 18 | public: 19 | FbFrameGenr(wxAuiNotebook * parent, bool select = false); 20 | protected: 21 | virtual FbFrameThread * CreateCounter(); 22 | virtual wxString GetCountSQL(); 23 | private: 24 | void CreateBookInfo(); 25 | void CreateColumns(); 26 | private: 27 | void OnBooksCount(FbCountEvent& event); 28 | void OnModel( FbModelEvent & event ); 29 | DECLARE_CLASS(FbFrameGenr) 30 | DECLARE_EVENT_TABLE() 31 | }; 32 | 33 | #endif // __FBFRAMEGENR_H__ 34 | -------------------------------------------------------------------------------- /sources/MyRuLib/frames/FbFrameHtml.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBFRAMEHTML_H__ 2 | #define __FBFRAMEHTML_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "FbThread.h" 10 | #include "FbWindow.h" 11 | #include "controls/FbHtmlWindow.h" 12 | 13 | class FbFrameHtml : 14 | public wxSplitterWindow 15 | { 16 | public: 17 | FbFrameHtml(wxAuiNotebook * parent, int id); 18 | virtual ~FbFrameHtml(); 19 | void Load(const wxString & html); 20 | static void Execute(); 21 | virtual void UpdateFonts(bool refresh = true); 22 | virtual void Localize(bool bUpdateMenu); 23 | public: 24 | void DoEvent(wxEvent& event) { 25 | GetEventHashTable().HandleEvent(event, this); 26 | } 27 | private: 28 | void CreateControls(); 29 | static wxString GetMd5sum(const int id); 30 | void DoModify(); 31 | void DoSubmit(); 32 | void DoUpdate(); 33 | void ModifyLink(const wxString &key); 34 | void DeleteLink(const wxString &key); 35 | void Reset(); 36 | private: 37 | FbHtmlWindow m_info; 38 | wxTextCtrl m_Caption; 39 | wxTextCtrl m_Comment; 40 | wxToolBar m_ToolBar; 41 | int m_id; 42 | wxString m_key; 43 | wxString m_md5sum; 44 | FbThread * m_thread; 45 | private: 46 | void OnEnter(wxCommandEvent& event); 47 | void OnSubmit(wxCommandEvent& event); 48 | void OnModify(wxCommandEvent& event); 49 | void OnInfoUpdate(wxCommandEvent& event); 50 | void OnSave(wxCommandEvent& event); 51 | void OnLinkClicked(wxHtmlLinkEvent& event); 52 | DECLARE_CLASS(FbFrameHtml) 53 | DECLARE_EVENT_TABLE() 54 | }; 55 | 56 | #endif // __FBFRAMEHTML_H__ 57 | -------------------------------------------------------------------------------- /sources/MyRuLib/frames/FbFrameInfo.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBFRAMEINFO_H__ 2 | #define __FBFRAMEINFO_H__ 3 | 4 | #include 5 | #include 6 | #include "FbMainMenu.h" 7 | #include "FbThread.h" 8 | #include "controls/FbHtmlWindow.h" 9 | 10 | class FbFrameInfo 11 | : public FbHtmlWindow 12 | { 13 | public: 14 | static void Execute(wxEvtHandler * owner); 15 | FbFrameInfo(wxAuiNotebook * parent, bool select); 16 | void Load(const wxString & html); 17 | virtual void UpdateFonts(bool refresh = true); 18 | public: 19 | void DoEvent(wxEvent& event) { 20 | GetEventHashTable().HandleEvent(event, this); 21 | } 22 | private: 23 | void OnSave(wxCommandEvent& event); 24 | DECLARE_CLASS(FbFrameInfo) 25 | DECLARE_EVENT_TABLE() 26 | }; 27 | 28 | #endif // __FBFRAMEINFO_H__ 29 | -------------------------------------------------------------------------------- /sources/MyRuLib/models/FbClssTree.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBCLSSLIST_H__ 2 | #define __FBCLSSLIST_H__ 3 | 4 | #include "controls/FbTreeModel.h" 5 | #include "FbMasterTypes.h" 6 | 7 | class FbClssTreeModel: public FbTreeModel 8 | { 9 | public: 10 | FbClssTreeModel(FbSQLite3ResultSet & result); 11 | wxString GetItemSQL() const { return m_ItemSQL; } 12 | wxString GetBookSQL() const { return m_BookSQL; } 13 | private: 14 | wxString m_ItemSQL; 15 | wxString m_BookSQL; 16 | private: 17 | DECLARE_CLASS(FbClssTreeModel); 18 | }; 19 | 20 | class FbClssModelData: public FbParentData 21 | { 22 | public: 23 | FbClssModelData(FbModel & model, const wxString & name = wxEmptyString); 24 | FbClssModelData(FbModel & model, FbParentData * parent, FbSQLite3ResultSet & result); 25 | void SetCount(int count) { m_count = count; } 26 | const wxString & GetCode() const { return m_code; } 27 | public: 28 | virtual wxString GetValue(FbModel & model, size_t col) const; 29 | virtual bool IsExpanded(FbModel & model) const { return m_expanded; } 30 | virtual bool HasChildren(FbModel & model) const { return m_children || Count(model); } 31 | virtual bool HiddenRoot() const { return false; } 32 | virtual bool IsBold(FbModel & model) const { return false; } 33 | virtual bool Expand(FbModel & model, bool expand); 34 | virtual FbMasterInfo GetInfo(FbModel & model) const; 35 | bool operator==(const FbMasterInfo & info) const; 36 | protected: 37 | const wxString m_code; 38 | wxString m_name; 39 | bool m_children; 40 | bool m_expanded; 41 | int m_count; 42 | private: 43 | DECLARE_CLASS(FbClssModelData); 44 | }; 45 | 46 | #endif // __FBCLSSLIST_H__ 47 | -------------------------------------------------------------------------------- /sources/MyRuLib/models/FbDateTree.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBDATETREE_H__ 2 | #define __FBDATETREE_H__ 3 | 4 | #include "wx/FbSQLite3.h" 5 | #include "controls/FbTreeModel.h" 6 | #include "FbDatabase.h" 7 | #include "FbCollection.h" 8 | #include "FbFrameThread.h" 9 | 10 | class FbDateTreeThread : public FbFrameThread 11 | { 12 | public: 13 | FbDateTreeThread(wxEvtHandler * frame, const wxString &counter) 14 | : FbFrameThread(frame, counter) {} 15 | protected: 16 | virtual void * Entry(); 17 | void MakeModel(FbSQLite3ResultSet &result); 18 | }; 19 | 20 | class FbDateYearData: public FbParentData 21 | { 22 | public: 23 | FbDateYearData(FbModel & model, FbParentData * parent, int code) 24 | : FbParentData(model, parent), m_code(code) {} 25 | virtual wxString GetValue(FbModel & model, size_t col = 0) const; 26 | int GetCode() const { return m_code; } 27 | private: 28 | int m_code; 29 | DECLARE_CLASS(FbDateMonthData); 30 | }; 31 | 32 | class FbDateMonthData: public FbParentData 33 | { 34 | public: 35 | FbDateMonthData(FbModel & model, FbParentData * parent, int code) 36 | : FbParentData(model, parent), m_code(code) {} 37 | virtual wxString GetValue(FbModel & model, size_t col = 0) const; 38 | int GetCode() const { return m_code; } 39 | private: 40 | int m_code; 41 | DECLARE_CLASS(FbDateMonthData); 42 | }; 43 | 44 | class FbDateDayData: public FbChildData 45 | { 46 | public: 47 | FbDateDayData(FbModel & model, FbParentData * parent, int code); 48 | virtual wxString GetValue(FbModel & model, size_t col = 0) const; 49 | int GetCode() const { return m_code; } 50 | FbMasterInfo GetInfo(FbModel & model) const; 51 | bool operator==(const FbMasterInfo & info) const; 52 | void SetCount(int count) { m_count = count; } 53 | private: 54 | int m_code; 55 | int m_count; 56 | DECLARE_CLASS(FbDateDayData); 57 | }; 58 | 59 | class FbDateTreeModel: public FbTreeModel 60 | { 61 | public: 62 | void SetCounter(const wxString & filename); 63 | int GetCount(int code); 64 | private: 65 | FbIntegerHash m_counter; 66 | FbSQLite3Database m_database; 67 | DECLARE_CLASS(FbDateTreeModel); 68 | }; 69 | 70 | #endif // __FBDATETREE_H__ 71 | -------------------------------------------------------------------------------- /sources/MyRuLib/models/FbDownList.cpp: -------------------------------------------------------------------------------- 1 | #include "FbDownList.h" 2 | #include "FbBookList.h" 3 | #include "FbCollection.h" 4 | 5 | IMPLEMENT_CLASS(FbDownListData, FbModelData) 6 | 7 | IMPLEMENT_CLASS(FbDownList, FbListModel) 8 | 9 | FbModelItem FbDownList::DoGetData(size_t row, int &level) 10 | { 11 | level = 0; 12 | FbBookListData data = FbCollection::GetDown(row); 13 | return FbModelItem(*this, &data); 14 | } 15 | -------------------------------------------------------------------------------- /sources/MyRuLib/models/FbDownList.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBDOWNLIST_H__ 2 | #define __FBDOWNLIST_H__ 3 | 4 | #include "controls/FbTreeModel.h" 5 | #include "FbMasterTypes.h" 6 | 7 | class FbDownListData: public FbModelData 8 | { 9 | public: 10 | FbDownListData(FbMasterDownInfo::DownType code, const wxString &name) 11 | : m_code(code), m_name(name) {} 12 | virtual wxString GetValue(FbModel & model, size_t col = 0) const 13 | { return col == 0 ? m_name : (wxString)wxEmptyString; } 14 | FbMasterDownInfo::DownType GetCode() const 15 | { return m_code; } 16 | FbMasterInfo GetInfo(FbModel & model) const; 17 | private: 18 | FbMasterDownInfo::DownType m_code; 19 | wxString m_name; 20 | DECLARE_CLASS(FbDownListData); 21 | }; 22 | 23 | class FbDownList: public FbListModel 24 | { 25 | public: 26 | virtual void Delete(); 27 | virtual size_t GetRowCount() const; 28 | protected: 29 | virtual FbModelItem DoGetData(size_t row, int &level); 30 | protected: 31 | DECLARE_CLASS(FbDownList); 32 | }; 33 | 34 | #endif // __FBDOWNLIST_H__ 35 | -------------------------------------------------------------------------------- /sources/MyRuLib/models/FbFldrTree.cpp: -------------------------------------------------------------------------------- 1 | #include "FbFldrTree.h" 2 | #include "FbConst.h" 3 | 4 | //----------------------------------------------------------------------------- 5 | // FbFolderParentData 6 | //----------------------------------------------------------------------------- 7 | 8 | IMPLEMENT_CLASS(FbFolderParentData, FbParentData) 9 | 10 | //----------------------------------------------------------------------------- 11 | // FbFolderChildData 12 | //----------------------------------------------------------------------------- 13 | 14 | IMPLEMENT_CLASS(FbFolderChildData, FbChildData) 15 | 16 | //----------------------------------------------------------------------------- 17 | // FbCommChildData 18 | //----------------------------------------------------------------------------- 19 | 20 | IMPLEMENT_CLASS(FbCommChildData, FbChildData) 21 | 22 | FbCommChildData::FbCommChildData(FbModel & model, FbParentData * parent) 23 | : FbChildData(model, parent), m_name(_("Comments")) {} 24 | 25 | //----------------------------------------------------------------------------- 26 | // FbRateChildData 27 | //----------------------------------------------------------------------------- 28 | 29 | IMPLEMENT_CLASS(FbRateChildData, FbChildData) 30 | 31 | FbRateChildData::FbRateChildData(FbModel & model, FbParentData * parent, int code) 32 | : FbChildData(model, parent), m_code(code), m_name(GetRatingText(code)) {} 33 | -------------------------------------------------------------------------------- /sources/MyRuLib/models/FbFldrTree.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBFLDRTREE_H__ 2 | #define __FBFLDRTREE_H__ 3 | 4 | #include "controls/FbTreeModel.h" 5 | 6 | class FbFolderParentData: public FbParentData 7 | { 8 | public: 9 | FbFolderParentData(FbModel & model, FbParentData * parent, const wxString &name) 10 | : FbParentData(model, parent), m_name(name) {} 11 | virtual wxString GetValue(FbModel & model, size_t col) const 12 | { return col ? (wxString)wxEmptyString : m_name; } 13 | virtual bool IsBold(FbModel & model) const 14 | { return true; } 15 | private: 16 | wxString m_name; 17 | DECLARE_CLASS(FbFolderParentData); 18 | }; 19 | 20 | class FbFolderChildData: public FbChildData 21 | { 22 | public: 23 | FbFolderChildData(FbModel & model, FbParentData * parent, int code, const wxString &name) 24 | : FbChildData(model, parent), m_code(code), m_name(name) {} 25 | virtual wxString GetValue(FbModel & model, size_t col = 0) const 26 | { return col == 0 ? m_name : (wxString)wxEmptyString; } 27 | int GetCode() const 28 | { return m_code; } 29 | void SetName(const wxString &name) 30 | { m_name = name; } 31 | FbMasterInfo GetInfo(FbModel & model) const; 32 | private: 33 | int m_code; 34 | wxString m_name; 35 | DECLARE_CLASS(FbFolderChildData); 36 | }; 37 | 38 | class FbCommChildData: public FbChildData 39 | { 40 | public: 41 | FbCommChildData(FbModel & model, FbParentData * parent); 42 | virtual wxString GetValue(FbModel & model, size_t col = 0) const 43 | { return col == 0 ? m_name : wxString(); } 44 | FbMasterInfo GetInfo(FbModel & model) const; 45 | private: 46 | wxString m_name; 47 | DECLARE_CLASS(FbCommChildData); 48 | }; 49 | 50 | class FbRateChildData: public FbChildData 51 | { 52 | public: 53 | FbRateChildData(FbModel & model, FbParentData * parent, int code); 54 | int GetCode() const 55 | { return m_code; } 56 | virtual wxString GetValue(FbModel & model, size_t col = 0) const 57 | { return col == 0 ? m_name : wxString(); } 58 | FbMasterInfo GetInfo(FbModel & model) const; 59 | private: 60 | int m_code; 61 | wxString m_name; 62 | DECLARE_CLASS(FbCommChildData); 63 | }; 64 | 65 | #endif // __FBFLDRTREE_H__ 66 | -------------------------------------------------------------------------------- /sources/MyRuLib/polarssl/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file config.h 3 | * 4 | * Copyright (C) 2006-2009, Paul Bakker 5 | * All rights reserved. 6 | * 7 | * Joined copyright on original XySSL code with: Christophe Devine 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License along 20 | * with this program; if not, write to the Free Software Foundation, Inc., 21 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 22 | * 23 | * This set of compile-time options may be used to enable 24 | * or disable features selectively, and reduce the global 25 | * memory footprint. 26 | */ 27 | #ifndef POLARSSL_CONFIG_H 28 | #define POLARSSL_CONFIG_H 29 | 30 | #define POLARSSL_MD5_C 31 | 32 | #endif /* config.h */ 33 | -------------------------------------------------------------------------------- /sources/MyRuLib/res/add.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * add_xpm[] = { 3 | "15 15 3 1", 4 | "X c Black", 5 | "# c Red", 6 | " c None", 7 | " ", 8 | " XXXXX ", 9 | " X X ", 10 | " X X ", 11 | " X X ", 12 | " XXXXX XXXXX ", 13 | " X X ", 14 | " X X ", 15 | " X X ", 16 | " XXXXX XXXXX ", 17 | " X X ", 18 | " X X ", 19 | " X X ", 20 | " XXXXX ", 21 | " "}; 22 | -------------------------------------------------------------------------------- /sources/MyRuLib/res/checked.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * checked_xpm[] = { 3 | /* columns rows colors chars-per-pixel */ 4 | "13 12 4 1", 5 | "* c #AA0000", 6 | "X c Black", 7 | " c White", 8 | "- c None", 9 | /* pixels */ 10 | "XXXXXXXXXXXX-", 11 | "X X-", 12 | "X * X-", 13 | "X ** X-", 14 | "X *** X-", 15 | "X * *** X-", 16 | "X ** *** X-", 17 | "X ***** X-", 18 | "X *** X-", 19 | "X * X-", 20 | "X X-", 21 | "XXXXXXXXXXXX-" 22 | }; 23 | -------------------------------------------------------------------------------- /sources/MyRuLib/res/checkout.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * checkout_xpm[] = { 3 | /* columns rows colors chars-per-pixel */ 4 | "13 12 4 1", 5 | "* c #AA0000", 6 | "X c Black", 7 | " c White", 8 | "- c None", 9 | /* pixels */ 10 | "XXXXXXXXXXXX-", 11 | "X X-", 12 | "X X-", 13 | "X ****** X-", 14 | "X ****** X-", 15 | "X ****** X-", 16 | "X ****** X-", 17 | "X ****** X-", 18 | "X ****** X-", 19 | "X X-", 20 | "X X-", 21 | "XXXXXXXXXXXX-" 22 | }; 23 | -------------------------------------------------------------------------------- /sources/MyRuLib/res/del.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * del_xpm[] = { 3 | "15 15 3 1", 4 | "X c Black", 5 | "# c Red", 6 | " c None", 7 | " ", 8 | " ", 9 | " ", 10 | " ", 11 | " ", 12 | " XXXXXXXXXXXXX ", 13 | " X X ", 14 | " X X ", 15 | " X X ", 16 | " XXXXXXXXXXXXX ", 17 | " ", 18 | " ", 19 | " ", 20 | " ", 21 | " "}; 22 | -------------------------------------------------------------------------------- /sources/MyRuLib/res/delete.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * delete_xpm[] = { 3 | "16 15 40 1", 4 | " c None", 5 | ". c #D64F49", 6 | "+ c #949494", 7 | "@ c #939393", 8 | "# c #929292", 9 | "$ c #C14741", 10 | "% c #D8D8D8", 11 | "& c #FFFFFF", 12 | "* c #FEFEFE", 13 | "= c #FBFBFB", 14 | "- c #F6F6F6", 15 | "; c #919191", 16 | "> c #FDFDFD", 17 | ", c #F2F2F2", 18 | "' c #F5F5F5", 19 | ") c #EDEDED", 20 | "! c #F3F3F3", 21 | "~ c #ECECEC", 22 | "{ c #E8E8E8", 23 | "] c #E7E7E7", 24 | "^ c #E2E2E2", 25 | "/ c #DEDEDE", 26 | "( c #DBDBDB", 27 | "_ c #E3E3E3", 28 | ": c #F7F7F7", 29 | "< c #F1F1F1", 30 | "[ c #E9E9E9", 31 | "} c #E0E0E0", 32 | "| c #DCDCDC", 33 | "1 c #DADADA", 34 | "2 c #D6D6D6", 35 | "3 c #E5E5E5", 36 | "4 c #CFCFCF", 37 | "5 c #8D8D8D", 38 | "6 c #8A8A8A", 39 | "7 c #888888", 40 | "8 c #878787", 41 | "9 c #868686", 42 | "0 c #8C8C8C", 43 | "a c #8B8B8B", 44 | " . . ", 45 | " ++@##...# .$$", 46 | " +%&&&&&...#.$$ ", 47 | "+%&&&&&&&...$$ ", 48 | "@&&&&&&&&&...# ", 49 | "#&&&&&&&&.$...# ", 50 | "#&&&&*==.$$-.$$ ", 51 | ";&&&>-,.$$')&$$$", 52 | ";&&=!~{]$^/(_=$ ", 53 | "+%:<[}|(1%23,%+ ", 54 | " +%&&&&4&&&&%+ ", 55 | " +555&&6789+ ", 56 | " 0&6 ", 57 | " a6 ", 58 | " 6 "}; 59 | -------------------------------------------------------------------------------- /sources/MyRuLib/res/home.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/sources/MyRuLib/res/home.ico -------------------------------------------------------------------------------- /sources/MyRuLib/res/library.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/sources/MyRuLib/res/library.ico -------------------------------------------------------------------------------- /sources/MyRuLib/res/mod.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * mod_xpm[] = { 3 | "15 15 3 1", 4 | "X c Black", 5 | "# c Red", 6 | " c None", 7 | " ", 8 | " ", 9 | " ", 10 | " XXXXXXXXX ", 11 | " X X ", 12 | " X X ", 13 | " X X ", 14 | " X X ", 15 | " X X ", 16 | " X X ", 17 | " X X ", 18 | " XXXXXXXXX ", 19 | " ", 20 | " ", 21 | " "}; 22 | -------------------------------------------------------------------------------- /sources/MyRuLib/res/modify.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * modify_xpm[] = { 3 | "16 15 39 1", 4 | " c None", 5 | ". c #FFFFFF", 6 | "+ c #655B4D", 7 | "@ c #949494", 8 | "# c #939393", 9 | "$ c #929292", 10 | "% c #919191", 11 | "& c #9A9A9A", 12 | "* c #BBBBBB", 13 | "= c #C7C7C7", 14 | "- c #F2AC47", 15 | "; c #D8D8D8", 16 | "> c #C79449", 17 | ", c #9D7B4B", 18 | "' c #C4C4C4", 19 | ") c #E6E598", 20 | "! c #B6B6B6", 21 | "~ c #FDFDFD", 22 | "{ c #FBFBFB", 23 | "] c #BFBB81", 24 | "^ c #EFEFEF", 25 | "/ c #F3F3F3", 26 | "( c #F4F4F4", 27 | "_ c #99926B", 28 | ": c #EDEDED", 29 | "< c #EEEEEE", 30 | "[ c #868686", 31 | "} c #F7F7F7", 32 | "| c #F1F1F1", 33 | "1 c #E9E9E9", 34 | "2 c #E3E3E3", 35 | "3 c #EBEBEB", 36 | "4 c #E1E1E1", 37 | "5 c #8D8D8D", 38 | "6 c #8A8A8A", 39 | "7 c #888888", 40 | "8 c #878787", 41 | "9 c #8C8C8C", 42 | "0 c #8B8B8B", 43 | " .++. ", 44 | " @@#$$%&*=+--+.", 45 | " @;.......+-->,+", 46 | "@;.......+-->>,+", 47 | "#.......+-->>,+.", 48 | "$......+-->>,+' ", 49 | "$.....+))>>,+.! ", 50 | "%...~{+)]],+^.% ", 51 | "%..{/(++]_+:<{[ ", 52 | "@;}|12++++3^/;@ ", 53 | " @;....4....;@ ", 54 | " @555..678[@ ", 55 | " 9.6 ", 56 | " 06 ", 57 | " 6 "}; 58 | -------------------------------------------------------------------------------- /sources/MyRuLib/res/nocheck.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * nocheck_xpm[] = { 3 | /* columns rows colors chars-per-pixel */ 4 | "13 12 4 1", 5 | "* c #AA0000", 6 | "X c Black", 7 | " c White", 8 | "- c None", 9 | /* pixels */ 10 | "XXXXXXXXXXXX-", 11 | "X X-", 12 | "X X-", 13 | "X X-", 14 | "X X-", 15 | "X X-", 16 | "X X-", 17 | "X X-", 18 | "X X-", 19 | "X X-", 20 | "X X-", 21 | "XXXXXXXXXXXX-" 22 | }; 23 | -------------------------------------------------------------------------------- /sources/MyRuLib/res/pause.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * pause_xpm[] = { 3 | "16 16 75 1", 4 | " c None", 5 | ". c #254BA3", 6 | "+ c #254CA4", 7 | "@ c #284EA6", 8 | "# c #6793DF", 9 | "$ c #6895E3", 10 | "% c #5F8DDF", 11 | "& c #274FA8", 12 | "* c #274EA5", 13 | "= c #618EDE", 14 | "- c #6290E2", 15 | "; c #5A89DE", 16 | "> c #2951AA", 17 | ", c #4B7FDC", 18 | "' c #5B8BE1", 19 | ") c #2852AD", 20 | "! c #2851A9", 21 | "~ c #618FE1", 22 | "{ c #4379DA", 23 | "] c #5687E0", 24 | "^ c #2853AD", 25 | "/ c #6290E3", 26 | "( c #4077D9", 27 | "_ c #5284E1", 28 | ": c #2956B1", 29 | "< c #5B8AE1", 30 | "[ c #3870D7", 31 | "} c #4C7FE0", 32 | "| c #3E75D9", 33 | "1 c #497DE0", 34 | "2 c #2A59B5", 35 | "3 c #4F82DF", 36 | "4 c #306AD5", 37 | "5 c #3E74DD", 38 | "6 c #3D74D8", 39 | "7 c #457ADF", 40 | "8 c #2C5DBA", 41 | "9 c #3C72DC", 42 | "0 c #2561D2", 43 | "a c #336BDB", 44 | "b c #2B5CB9", 45 | "c c #487CE0", 46 | "d c #2E68D4", 47 | "e c #3971DB", 48 | "f c #2D60BE", 49 | "g c #2C5FBC", 50 | "h c #346CDB", 51 | "i c #3F76DC", 52 | "j c #2E64C3", 53 | "k c #2D61C0", 54 | "l c #457ADC", 55 | "m c #2F67C7", 56 | "n c #2663D3", 57 | "o c #4B81DE", 58 | "p c #316ACB", 59 | "q c #2F66C5", 60 | "r c #477DDE", 61 | "s c #2E6ED8", 62 | "t c #578FE4", 63 | "u c #326ECF", 64 | "v c #3068C8", 65 | "w c #5087E1", 66 | "x c #397DE0", 67 | "y c #65A1EC", 68 | "z c #3371D4", 69 | "A c #3069C9", 70 | "B c #568EE3", 71 | "C c #66A2ED", 72 | "D c #6FAFF3", 73 | "E c #3474D8", 74 | "F c #306ACB", 75 | "G c #326DCF", 76 | "H c #3370D3", 77 | "I c #3474D7", 78 | "J c #3576DA", 79 | " ", 80 | " ...++ ...++ ", 81 | " @#$%& *=-;& ", 82 | " >$,') !~{]) ", 83 | " ^/(_: ^<[}: ", 84 | " :'|12 :3452 ", 85 | " 2_678 290a8 ", 86 | " bcdef ba0ef ", 87 | " gh0ij ga0ij ", 88 | " ke0lm ke0lm ", 89 | " jinop jinop ", 90 | " qrstu qrstu ", 91 | " vwxyz vwxyz ", 92 | " ABCDE ABCDE ", 93 | " FGHIJ FGHIJ ", 94 | " "}; 95 | -------------------------------------------------------------------------------- /sources/MyRuLib/res/resource.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/sources/MyRuLib/res/resource.rc -------------------------------------------------------------------------------- /sources/myrulib.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual C++ Express 2008 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "myrulib", "workspace\myrulib.vcproj", "{F088C1BE-436A-42D4-96F0-18EDC62DB8B3}" 5 | ProjectSection(ProjectDependencies) = postProject 6 | {31C68256-9ADF-4B7A-BDC9-34A4C55ACB1D} = {31C68256-9ADF-4B7A-BDC9-34A4C55ACB1D} 7 | {230674E1-3392-4A62-B749-5D73D586F12F} = {230674E1-3392-4A62-B749-5D73D586F12F} 8 | EndProjectSection 9 | EndProject 10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "expat", "workspace\expat.vcproj", "{31C68256-9ADF-4B7A-BDC9-34A4C55ACB1D}" 11 | EndProject 12 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "crengine", "workspace\crengine.vcproj", "{230674E1-3392-4A62-B749-5D73D586F12F}" 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug28|Win32 = Debug28|Win32 17 | Debug29|Win32 = Debug29|Win32 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {F088C1BE-436A-42D4-96F0-18EDC62DB8B3}.Debug28|Win32.ActiveCfg = Debug28|Win32 21 | {F088C1BE-436A-42D4-96F0-18EDC62DB8B3}.Debug28|Win32.Build.0 = Debug28|Win32 22 | {F088C1BE-436A-42D4-96F0-18EDC62DB8B3}.Debug29|Win32.ActiveCfg = Debug29|Win32 23 | {F088C1BE-436A-42D4-96F0-18EDC62DB8B3}.Debug29|Win32.Build.0 = Debug29|Win32 24 | {31C68256-9ADF-4B7A-BDC9-34A4C55ACB1D}.Debug28|Win32.ActiveCfg = Debug28|Win32 25 | {31C68256-9ADF-4B7A-BDC9-34A4C55ACB1D}.Debug28|Win32.Build.0 = Debug28|Win32 26 | {31C68256-9ADF-4B7A-BDC9-34A4C55ACB1D}.Debug29|Win32.ActiveCfg = Debug29|Win32 27 | {31C68256-9ADF-4B7A-BDC9-34A4C55ACB1D}.Debug29|Win32.Build.0 = Debug29|Win32 28 | {230674E1-3392-4A62-B749-5D73D586F12F}.Debug28|Win32.ActiveCfg = Debug28|Win32 29 | {230674E1-3392-4A62-B749-5D73D586F12F}.Debug28|Win32.Build.0 = Debug28|Win32 30 | {230674E1-3392-4A62-B749-5D73D586F12F}.Debug29|Win32.ActiveCfg = Debug29|Win32 31 | {230674E1-3392-4A62-B749-5D73D586F12F}.Debug29|Win32.Build.0 = Debug29|Win32 32 | EndGlobalSection 33 | GlobalSection(SolutionProperties) = preSolution 34 | HideSolutionNode = FALSE 35 | EndGlobalSection 36 | EndGlobal 37 | -------------------------------------------------------------------------------- /sources/myrulib.workspace: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /sources/testtree/FbViewItem.cpp: -------------------------------------------------------------------------------- 1 | #include "FbViewItem.h" 2 | 3 | //----------------------------------------------------------------------------- 4 | // FbViewItem 5 | //----------------------------------------------------------------------------- 6 | 7 | IMPLEMENT_CLASS(FbViewItem, wxObject) 8 | 9 | -------------------------------------------------------------------------------- /sources/testtree/FbViewItem.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBVIEWITEM_H__ 2 | #define __FBVIEWITEM_H__ 3 | 4 | #include 5 | 6 | class FbViewItem: public wxObject 7 | { 8 | public: 9 | enum Types { 10 | None, 11 | Auth, 12 | Book, 13 | }; 14 | FbViewItem(Types type = None, int code = 0) 15 | : m_type(type), m_code(code) {} 16 | FbViewItem(const FbViewItem & item) 17 | : m_type(item.m_type), m_code(item.m_code) {} 18 | FbViewItem & operator=(const FbViewItem & item) 19 | { m_type = item.m_type; m_code = item.m_code; return *this; } 20 | operator bool() const 21 | { return m_type != None && m_code; } 22 | Types GetType() const 23 | { return m_type; } 24 | int GetCode() const 25 | { return m_code; } 26 | private: 27 | Types m_type; 28 | int m_code; 29 | DECLARE_CLASS(FbViewItem); 30 | }; 31 | 32 | #endif // __FBVIEWITEM_H__ 33 | -------------------------------------------------------------------------------- /sources/testtree/TestApp.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Name: DataViewApp.cpp 3 | * Purpose: Code for Application Class 4 | * Author: () 5 | * Created: 2010-03-05 6 | * Copyright: () 7 | * License: 8 | **************************************************************/ 9 | 10 | #include "TestApp.h" 11 | #include "TestMain.h" 12 | 13 | IMPLEMENT_APP(DataViewApp); 14 | 15 | bool DataViewApp::OnInit() 16 | { 17 | wxLog::SetVerbose(true); 18 | DataViewFrame* frame = new DataViewFrame(0L); 19 | frame->Show(); 20 | 21 | return true; 22 | } 23 | 24 | -------------------------------------------------------------------------------- /sources/testtree/TestApp.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Name: DataViewApp.h 3 | * Purpose: Defines Application Class 4 | * Author: () 5 | * Created: 2010-03-05 6 | * Copyright: () 7 | * License: 8 | **************************************************************/ 9 | 10 | #ifndef DATAVIEWAPP_H 11 | #define DATAVIEWAPP_H 12 | 13 | #include 14 | #include 15 | 16 | class FbCollection; 17 | 18 | class DataViewApp : public wxApp 19 | { 20 | public: 21 | DataViewApp(): m_collection(NULL) {} 22 | virtual bool OnInit(); 23 | private: 24 | FbCollection * m_collection; 25 | }; 26 | 27 | DECLARE_APP(DataViewApp) 28 | 29 | #endif // DATAVIEWAPP_H 30 | -------------------------------------------------------------------------------- /sources/testtree/TestMain.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Name: DataViewMain.h 3 | * Purpose: Defines Application Frame 4 | * Author: () 5 | * Created: 2010-03-05 6 | * Copyright: () 7 | * License: 8 | **************************************************************/ 9 | 10 | #ifndef DATAVIEWMAIN_H 11 | #define DATAVIEWMAIN_H 12 | 13 | #include 14 | #include 15 | 16 | class wxTreeEvent; 17 | 18 | class FbAuthListInfo; 19 | 20 | class FbTreeViewCtrl; 21 | 22 | class DataViewFrame: public wxFrame 23 | { 24 | public: 25 | DataViewFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("wxWidgets Application Template"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 481,466 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL ); 26 | ~DataViewFrame(); 27 | static wxString sm_filename; 28 | protected: 29 | void CreateTreeModel(); 30 | void CreateListModel(); 31 | 32 | protected: 33 | enum 34 | { 35 | idMenuQuit = 1000, 36 | idOpenList, 37 | idOpenBook, 38 | idOpenTree, 39 | idMenuAbout, 40 | idSearchBtn, 41 | idCreateTree, 42 | idCreateList, 43 | ID_TYPE_LIST, 44 | ID_APPEND_TYPE, 45 | ID_MODIFY_TYPE, 46 | ID_DELETE_TYPE, 47 | }; 48 | 49 | wxStatusBar * m_statusbar; 50 | FbTreeViewCtrl * m_dataview; 51 | 52 | private: 53 | void OnClose(wxCloseEvent& event); 54 | void OnQuit(wxCommandEvent& event); 55 | void OnAbout(wxCommandEvent& event); 56 | void OnOpenBook(wxCommandEvent& event); 57 | void OnOpenList(wxCommandEvent& event); 58 | void OnOpenTree(wxCommandEvent& event); 59 | void OnSearchBtn(wxCommandEvent& event); 60 | 61 | void OnCreateList(wxCommandEvent& event); 62 | void OnCreateTree(wxCommandEvent& event); 63 | 64 | void OnAppendType(wxCommandEvent& event); 65 | void OnModifyType(wxCommandEvent& event); 66 | void OnDeleteType(wxCommandEvent& event); 67 | void OnTypeActivated(wxTreeEvent& event); 68 | void OnColumnClick(wxListEvent& event); 69 | 70 | DECLARE_EVENT_TABLE() 71 | }; 72 | 73 | #endif // DATAVIEWMAIN_H 74 | -------------------------------------------------------------------------------- /sources/testtree/TreeView.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual C++ Express 2008 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestTree", "TreeView.vcproj", "{F088C1BE-436A-42D4-96F0-18EDC62DB8B3}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | DebugTv|Win32 = DebugTv|Win32 9 | EndGlobalSection 10 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 11 | {F088C1BE-436A-42D4-96F0-18EDC62DB8B3}.DebugTv|Win32.ActiveCfg = DebugTv|Win32 12 | {F088C1BE-436A-42D4-96F0-18EDC62DB8B3}.DebugTv|Win32.Build.0 = DebugTv|Win32 13 | EndGlobalSection 14 | GlobalSection(SolutionProperties) = preSolution 15 | HideSolutionNode = FALSE 16 | EndGlobalSection 17 | EndGlobal 18 | -------------------------------------------------------------------------------- /sources/testtree/TreeView.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lintest/myrulib/8800f9abd7dbc64b56ddfee3ae03e1bdea303679/sources/testtree/TreeView.vcproj -------------------------------------------------------------------------------- /tarball.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | VERSION=`cat configure | grep PACKAGE_VERSION= | sed "s/.*=//" | sed "s/'//g"` 4 | echo Version: $VERSION; 5 | 6 | rm -rf tarball 7 | mkdir tarball 8 | cd tarball 9 | 10 | mkdir myrulib-$VERSION 11 | cd myrulib-$VERSION 12 | 13 | cp -f ../../AUTHORS . 14 | cp -f ../../INSTALL . 15 | cp -f ../../LICENSE . 16 | cp -f ../../README . 17 | cp -f ../../ChangeLog . 18 | cp -f ../../aclocal.m4 . 19 | cp -f ../../autoconf_inc.m4 . 20 | cp -f ../../config.guess . 21 | cp -f ../../config.sub . 22 | cp -f ../../configure . 23 | cp -f ../../configure.in . 24 | cp -f ../../install-sh . 25 | cp -f ../../Makefile.in . 26 | cp -f ../../myrulib.bkl . 27 | cp -f ../../windows.sh . 28 | cp -rf ../../3rdparty . 29 | 30 | mkdir sources 31 | 32 | cp -rf ../../sources/MyRuLib sources 33 | cp -rf ../../sources/WxSQLite3 sources 34 | cp -rf ../../sources/ZipScaner sources 35 | cp -f ../../sources/config.h.in sources 36 | 37 | cd .. 38 | 39 | tar -cvjf myrulib-$VERSION.tar.bz2 myrulib-$VERSION 40 | cp myrulib-$VERSION.tar.bz2 myrulib_$VERSION.orig.tar.bz2 41 | 42 | cp -rf myrulib-$VERSION myrulib-cr-$VERSION 43 | tar -cvjf myrulib-cr_$VERSION.orig.tar.bz2 myrulib-cr-$VERSION 44 | --------------------------------------------------------------------------------