├── .travis.yml ├── AUTHORS ├── COPYING ├── ChangeLog ├── Doxyfile ├── INSTALL ├── Makefile.am ├── NEWS ├── README ├── README.md ├── README.xmlrpc ├── art ├── 128x128 │ └── apps │ │ ├── xchm.png │ │ └── xchmdoc.png ├── 16x16 │ └── apps │ │ ├── xchm.png │ │ └── xchmdoc.png ├── 32x32 │ └── apps │ │ ├── xchm.png │ │ └── xchmdoc.png ├── 48x48 │ └── apps │ │ ├── xchm.png │ │ └── xchmdoc.png ├── Makefile.am ├── fullscreen.xpm ├── hbook_closed.xpm ├── hbook_open.xpm ├── htmoptns.xpm ├── htmsidep.xpm ├── logo.xpm ├── screenshot.png └── xchm.xpm ├── bootstrap ├── build.bat ├── configure.ac ├── data ├── Makefile.am ├── xchm.appdata.xml └── xchm.desktop ├── m4 ├── Makefile.am └── wxwin.m4 ├── mac ├── Info.plist ├── Makefile.am └── xCHM.icns ├── make.bkl ├── man ├── Makefile.am └── xchm.1 ├── po ├── LINGUAS ├── Makevars ├── POTFILES.in ├── be.po ├── bg.po ├── cs.po ├── de.po ├── el.po ├── es.po ├── fr.po ├── hu.po ├── it.po ├── lv.po ├── pl.po ├── pt_BR.po ├── pt_PT.po ├── ro.po ├── ru.po ├── sk.po ├── sv.po ├── uk.po ├── zh_CN.po └── zh_TW.po ├── rc ├── xchm.ico └── xchm.rc └── src ├── .clang-format ├── Makefile.am ├── chm_lib.c ├── chmapp.cpp ├── chmapp.h ├── chmfile.cpp ├── chmfile.h ├── chmfinddialog.cpp ├── chmfinddialog.h ├── chmfontdialog.cpp ├── chmfontdialog.h ├── chmframe.cpp ├── chmframe.h ├── chmfshandler.cpp ├── chmfshandler.h ├── chmhtmlnotebook.cpp ├── chmhtmlnotebook.h ├── chmhtmlwindow.cpp ├── chmhtmlwindow.h ├── chmindexpanel.cpp ├── chmindexpanel.h ├── chminputstream.cpp ├── chminputstream.h ├── chmlistctrl.cpp ├── chmlistctrl.h ├── chmsearchpanel.cpp ├── chmsearchpanel.h ├── hhcparser.cpp ├── hhcparser.h ├── lzx.c ├── lzx.h ├── wxstringutils.h └── xchm_chm_lib.h /.travis.yml: -------------------------------------------------------------------------------- 1 | matrix: 2 | include: 3 | # works on Precise and Trusty 4 | - os: linux 5 | addons: 6 | apt: 7 | sources: 8 | - ubuntu-toolchain-r-test 9 | packages: 10 | - g++-7 autopoint libwxgtk3.0-dev libchm-dev 11 | compiler: gcc 12 | env: 13 | - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" 14 | 15 | - os: linux 16 | dist: xenial 17 | addons: 18 | apt: 19 | sources: 20 | - ubuntu-toolchain-r-test 21 | packages: 22 | - autopoint libwxgtk3.0-dev libchm-dev 23 | compiler: clang 24 | 25 | - os: osx 26 | osx_image: xcode10.2 27 | addons: 28 | homebrew: 29 | packages: 30 | - chmlib 31 | - wxmac 32 | update: true 33 | 34 | language: c++ 35 | 36 | before_install: 37 | - eval "PATH=${PATH}:/usr/local/opt/gettext/bin" 38 | - eval "${MATRIX_EVAL}" 39 | 40 | script: 41 | ./bootstrap && ./configure && make 42 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Razvan Cojocaru 2 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | SUBDIRS = m4 po src art mac data man 3 | EXTRA_DIST = config.rpath Doxyfile README.xmlrpc rc/xchm.rc rc/xchm.ico 4 | 5 | ACLOCAL_AMFLAGS = -I m4 6 | #-I /usr/local/share/aclocal 7 | 8 | macbundle: all 9 | mkdir -p $(top_srcdir)/xCHM.app/Contents/MacOS 10 | mkdir -p $(top_srcdir)/xCHM.app/Contents/Resources 11 | cp -f $(top_srcdir)/mac/Info.plist $(top_srcdir)/xCHM.app/Contents/ 12 | cp -f $(top_srcdir)/mac/xCHM.icns $(top_srcdir)/xCHM.app/Contents/Resources 13 | 14 | clean-local: 15 | -rm -rf $(top_srcdir)/xCHM.app 16 | 17 | .PHONY: bundle 18 | 19 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzvncj/xCHM/0f81da0f34b600cbc4282df093b2d132133ef6e2/NEWS -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | 2 | xCHM - the CHM viewer for UNIX 3 | (c) 2003 - 2024 Razvan Cojocaru 4 | 5 | * Prerequisites 6 | 7 | In order to be able to compile the code you need to have wxWidgets and 8 | CHMLIB installed. You can get wxWidgets from: 9 | 10 | http://www.wxwidgets.org 11 | 12 | Get the GTK+ version (also known as wxGTK). xCHM currently compiles 13 | with all flavours of wxWidgets, but only works well and looks truly 14 | appealing with wxGTK, so I recommend against bothering to use it with 15 | anything else. 16 | 17 | You can get CHMLIB from: 18 | 19 | http://www.jedrea.com/chmlib/ 20 | 21 | After you've installed the above you're ready for the next phase. 22 | 23 | * Installing 24 | 25 | Type ./configure --help if you're interested in parameters you can pass 26 | to configure for compile switches. Most people will be perfectly happy 27 | doing a: 28 | 29 | ./configure && make 30 | 31 | Once everything is built, type 32 | 33 | make install 34 | 35 | and the executable should be somewhere in your $PATH (hopefully :)). 36 | Now you can just type 37 | 38 | xchm 39 | 40 | and start your session. 41 | 42 | * Generating documentation 43 | 44 | If you'd like to generate developer documentation go to the root 45 | of the distribution and type 46 | 47 | doxygen 48 | 49 | This of course implies that you have doxygen installed. The documentation 50 | will be generated in the doc directory in HTML and LaTex format. The doc 51 | directory will be created in the process of creating the documentation so 52 | it's ok that it's not present by default in the tarball. 53 | 54 | * Happy reading! 55 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # xCHM 2 | 3 | UNIX CHM viewer. 4 | 5 | ## Screenshots 6 | 7 | ![Python documentation](./art/screenshot.png) 8 | 9 | ## Prerequisites 10 | 11 | In order to be able to compile the code you need to have wxWidgets and 12 | CHMLIB installed. 13 | 14 | Get the GTK+ version (also known as wxGTK). xCHM currently compiles 15 | with all flavours of wxWidgets, but only works well and looks truly 16 | appealing with wxGTK, so I recommend against bothering to use it with 17 | anything else. 18 | 19 | ## Installing 20 | 21 | (If you've just cloned the code - as opposed to using a release tarball - 22 | you need to run `./bootstrap` first.) 23 | 24 | Type `./configure --help` if you're interested in parameters you can 25 | pass to configure for compile switches. Most people will be perfectly 26 | happy doing a: 27 | 28 | ``` 29 | ./configure && make 30 | ``` 31 | 32 | Once everything is built, type: 33 | 34 | ``` 35 | make install 36 | ``` 37 | 38 | and the executable should be somewhere in your `$PATH` (hopefully :)). 39 | Now you can just type 40 | 41 | ``` 42 | xchm 43 | ``` 44 | 45 | and start your session. 46 | 47 | ## Built with 48 | 49 | * [wxWidgets](http://www.wxwidgets.org) - GUI 50 | * [CHMLIB](http://www.jedrea.com/chmlib/) - CHM access logic 51 | 52 | ## Generating documentation 53 | 54 | If you'd like to generate developer documentation go to the root 55 | of the distribution and type: 56 | 57 | ``` 58 | doxygen 59 | ``` 60 | 61 | This of course implies that you have doxygen installed. The documentation 62 | will be generated in the doc directory in HTML and LaTex format. 63 | 64 | ## Binaries 65 | 66 | I am no longer providing Mac and Windows binaries, just the source code. 67 | Some Linux distributions already provide binaries ([Debian](https://packages.debian.org/search?searchon=names&keywords=xchm), 68 | [Arch](https://archlinux.org/packages/extra/x86_64/xchm/), 69 | [Gentoo](https://packages.gentoo.org/packages/app-text/xchm), 70 | [Ubuntu](https://packages.ubuntu.com/search?keywords=xchm), etc.) 71 | For Mac, please see [MacPorts](https://www.macports.org/ports.php?by=name&substr=xchm). 72 | Windows users can (and should) just use the standard viewer (hh.exe). 73 | 74 | ## Authors 75 | 76 | * **Răzvan Cojocaru** [rzvncj](https://github.com/rzvncj) 77 | 78 | ## Happy reading! 79 | -------------------------------------------------------------------------------- /README.xmlrpc: -------------------------------------------------------------------------------- 1 | XmlRpc interface documentation 2 | 3 | XmlRpc support enables 3rd party applications to issue load, change page, and 4 | close instructions to xCHM. 5 | 6 | In order to make use of the XmlRpc support in xCHM you must configure with the 7 | --enable-xmlrpc flag. You must also have the XmlRpc++ (0.7 or higher) library 8 | installed on your system. You can aquire this library at: 9 | http://xmlrpcpp.sourceforge.net/ 10 | 11 | 12 | Calls 13 | param 1 14 | 0 - Shuts down xCHM 15 | 16 | 1 - Loads a chmfile specified by param 2, and an optional contextID as param 3 17 | 18 | 2 - Loads a specified contextID within the file as param 2 19 | 20 | Results 21 | 0 - The request was not completed, this indicates a failure in the command. For 22 | example if the call (1,file,id) is made with a valid file, but invalid id 23 | the correct file will be loaded but the id will not be. Thus it will report 24 | that the request was not completed. 25 | 26 | 1 - The request was completed successfully. 27 | 28 | 29 | Notes: 30 | 31 | File paths are relative to the xCHM executable, thus full path names are the 32 | recommended method for opening files via XmlRpc. 33 | 34 | Example using Python: 35 | 36 | Launch xCHM with the XmlRpc server activated 37 | xchm --with-xmlrpc=port 38 | 39 | Launch python 40 | >>> import xmlrpclib 41 | 42 | # establish connection to xCHM XmlRpc server 43 | >>> s = xmlrpclib.Server('http://localhost:port') 44 | 45 | # tell xCHM to open /path/to/sch/file.chm 46 | >>> s.xCHM(1,'/path/to/chm/file.chm') 47 | 1 # success 48 | #tell xCHM to load the contextID from the current file. 49 | >>> s.xCHM(2,1234) 50 | 0 # failure 51 | >>> s.xCHM(2,1235) 52 | 1 # success 53 | # close xCHM 54 | >>> s.xCHM(0) 55 | 1 56 | -------------------------------------------------------------------------------- /art/128x128/apps/xchm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzvncj/xCHM/0f81da0f34b600cbc4282df093b2d132133ef6e2/art/128x128/apps/xchm.png -------------------------------------------------------------------------------- /art/128x128/apps/xchmdoc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzvncj/xCHM/0f81da0f34b600cbc4282df093b2d132133ef6e2/art/128x128/apps/xchmdoc.png -------------------------------------------------------------------------------- /art/16x16/apps/xchm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzvncj/xCHM/0f81da0f34b600cbc4282df093b2d132133ef6e2/art/16x16/apps/xchm.png -------------------------------------------------------------------------------- /art/16x16/apps/xchmdoc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzvncj/xCHM/0f81da0f34b600cbc4282df093b2d132133ef6e2/art/16x16/apps/xchmdoc.png -------------------------------------------------------------------------------- /art/32x32/apps/xchm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzvncj/xCHM/0f81da0f34b600cbc4282df093b2d132133ef6e2/art/32x32/apps/xchm.png -------------------------------------------------------------------------------- /art/32x32/apps/xchmdoc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzvncj/xCHM/0f81da0f34b600cbc4282df093b2d132133ef6e2/art/32x32/apps/xchmdoc.png -------------------------------------------------------------------------------- /art/48x48/apps/xchm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzvncj/xCHM/0f81da0f34b600cbc4282df093b2d132133ef6e2/art/48x48/apps/xchm.png -------------------------------------------------------------------------------- /art/48x48/apps/xchmdoc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzvncj/xCHM/0f81da0f34b600cbc4282df093b2d132133ef6e2/art/48x48/apps/xchmdoc.png -------------------------------------------------------------------------------- /art/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = *.xpm *.png 2 | 3 | iconsdir = $(datadir)/icons/hicolor 4 | nobase_dist_icons_DATA = \ 5 | 16x16/apps/* 32x32/apps/* 48x48/apps/* 128x128/apps/* 6 | -------------------------------------------------------------------------------- /art/fullscreen.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char *fullscreen_xpm[] = { 3 | /* columns rows colors chars-per-pixel */ 4 | "16 16 256 2 ", 5 | " c None", 6 | ". c #A8AAA5", 7 | "X c #B8B9B3", 8 | "o c #B9BAB4", 9 | "O c #B9BAB4", 10 | "+ c #B8B9B3", 11 | "@ c #B2B3B0", 12 | "# c #B0B2AF", 13 | "$ c #B0B2AF", 14 | "% c #B1B2AF", 15 | "& c #B6B7B2", 16 | "* c #B9BAB4", 17 | "= c #B9BAB4", 18 | "- c #B9BAB4", 19 | "; c #AFB0AC", 20 | ": c #969893", 21 | "> c #95968F", 22 | ", c #C3C8CA", 23 | "< c #A3B3C6", 24 | "1 c #98AAC0", 25 | "2 c #98AAC0", 26 | "3 c #9FB1C4", 27 | "4 c #D2DBDE", 28 | "5 c #E0E6E5", 29 | "6 c #DFE6E5", 30 | "7 c #DCE3E4", 31 | "8 c #AEBDCC", 32 | "9 c #97AABF", 33 | "0 c #98ABC0", 34 | "q c #9AACC1", 35 | "w c #BEC7CE", 36 | "e c #AFB0AC", 37 | "r c #A0A097", 38 | "t c #BAC3CB", 39 | "y c #3D6397", 40 | "u c #204B88", 41 | "i c #254E8A", 42 | "p c #819BBA", 43 | "a c #DEE9EB", 44 | "s c #E4EEEE", 45 | "d c #E4EEEE", 46 | "f c #E4EEEE", 47 | "g c #ACBFD1", 48 | "h c #355C92", 49 | "j c #214B88", 50 | "k c #254E8A", 51 | "l c #9AACC1", 52 | "z c #B9BAB4", 53 | "x c #A1A097", 54 | "c c #B9C2CA", 55 | "v c #3B6096", 56 | "b c #1D4785", 57 | "n c #2F578F", 58 | "m c #99AFC6", 59 | "M c #E2ECEC", 60 | "N c #E4EDED", 61 | "B c #E4EDED", 62 | "V c #E5EEEE", 63 | "C c #BFCEDA", 64 | "Z c #486B9C", 65 | "A c #1F4987", 66 | "S c #214B88", 67 | "D c #99ABC0", 68 | "F c #B9BAB4", 69 | "G c #A1A097", 70 | "H c #B9C1C9", 71 | "J c #43679A", 72 | "K c #466A9B", 73 | "L c #5677A3", 74 | "P c #89A1BE", 75 | "I c #CEDAE2", 76 | "U c #E6EEEE", 77 | "Y c #E6EFEE", 78 | "T c #DDE7E9", 79 | "R c #A0B4CA", 80 | "E c #6482AA", 81 | "W c #4A6D9D", 82 | "Q c #365D93", 83 | "! c #98AABF", 84 | "~ c #BABAB4", 85 | "^ c #9E9D95", 86 | "/ c #BFC7CD", 87 | "( c #9FB2C9", 88 | ") c #CED9E1", 89 | "_ c #A6B8CC", 90 | "` c #B9C8D7", 91 | "' c #DEE7EA", 92 | "] c #E8EFEF", 93 | "[ c #E8EFEF", 94 | "{ c #E4EBED", 95 | "} c #C7D4DE", 96 | "| c #A4B7CB", 97 | " . c #C4D1DC", 98 | ".. c #B0C1D2", 99 | "X. c #B0BECC", 100 | "o. c #B6B7B2", 101 | "O. c #959691", 102 | "+. c #D6D9D8", 103 | "@. c #E9F0F0", 104 | "#. c #EBF1F0", 105 | "$. c #E4EBED", 106 | "%. c #E3EAEC", 107 | "&. c #E9F0F0", 108 | "*. c #E9F0F0", 109 | "=. c #E9EFEF", 110 | "-. c #E9F0F0", 111 | ";. c #E6EDEE", 112 | ":. c #E1E9EB", 113 | ">. c #EAF0F0", 114 | ",. c #EAF0F0", 115 | "<. c #E0E5E5", 116 | "1. c #B1B2AF", 117 | "2. c #949590", 118 | "3. c #D8DBDA", 119 | "4. c #ECF2F2", 120 | "5. c #EBF0F0", 121 | "6. c #EBF1F0", 122 | "7. c #EBF1F0", 123 | "8. c #EBF0F0", 124 | "9. c #EBF0F0", 125 | "0. c #EBF0F0", 126 | "q. c #EBF0F0", 127 | "w. c #EBF0F0", 128 | "e. c #EBF1F1", 129 | "r. c #EBF0F0", 130 | "t. c #ECF1F1", 131 | "y. c #E4E8E7", 132 | "u. c #B1B2AF", 133 | "i. c #939590", 134 | "p. c #D9DCDA", 135 | "a. c #EFF3F3", 136 | "s. c #EDF1F1", 137 | "d. c #EDF2F1", 138 | "f. c #EDF1F1", 139 | "g. c #EDF1F1", 140 | "h. c #EDF1F1", 141 | "j. c #EDF1F1", 142 | "k. c #EDF1F1", 143 | "l. c #EDF1F1", 144 | "z. c #EDF1F1", 145 | "x. c #EDF1F1", 146 | "c. c #EEF2F2", 147 | "v. c #E6E9E8", 148 | "b. c #B1B2AF", 149 | "n. c #969791", 150 | "m. c #D2D6D6", 151 | "M. c #E3E9EC", 152 | "N. c #F0F3F3", 153 | "B. c #DDE4E9", 154 | "V. c #DEE4E9", 155 | "C. c #EDF1F1", 156 | "Z. c #EEF2F2", 157 | "A. c #EEF2F2", 158 | "S. c #EEF2F2", 159 | "D. c #E5EAED", 160 | "F. c #D8E0E6", 161 | "G. c #EDF0F1", 162 | "H. c #E9EEF0", 163 | "J. c #D9DEE1", 164 | "K. c #B2B3B0", 165 | "L. c #A09F96", 166 | "P. c #BDC4CB", 167 | "I. c #7B94B7", 168 | "U. c #ADBCD0", 169 | "Y. c #8DA2BF", 170 | "T. c #AEBDD0", 171 | "R. c #DEE4E9", 172 | "E. c #F0F3F3", 173 | "W. c #F0F3F3", 174 | "Q. c #E8ECEE", 175 | "!. c #BFCBD9", 176 | "~. c #91A5C1", 177 | "^. c #A4B5CB", 178 | "/. c #89A0BE", 179 | "(. c #A4B3C6", 180 | "). c #B9B9B3", 181 | "_. c #A09F97", 182 | "`. c #BDC4CB", 183 | "'. c #3D6297", 184 | "]. c #2B538D", 185 | "[. c #476A9B", 186 | "{. c #8A9FBE", 187 | "}. c #DEE3E9", 188 | "|. c #F2F4F3", 189 | " X c #F2F3F3", 190 | ".X c #EBEEF0", 191 | "XX c #A9B9CE", 192 | "oX c #5878A4", 193 | "OX c #325990", 194 | "+X c #264F8B", 195 | "@X c #9CACC1", 196 | "#X c #BBBAB4", 197 | "$X c #A0A097", 198 | "%X c #BDC4CC", 199 | "&X c #3B6096", 200 | "*X c #1B4685", 201 | "=X c #2A528C", 202 | "-X c #ABBACF", 203 | ";X c #F5F5F5", 204 | ":X c #F3F4F4", 205 | ">X c #F3F4F4", 206 | ",X c #F5F5F5", 207 | " , < 1 2 3 4 5 6 7 8 9 0 q w e ", 264 | "r t y u i p a s d f g h j k l z ", 265 | "x c v b n m M N B V C Z A S D F ", 266 | "G H J K L P I U Y T R E W Q ! ~ ", 267 | "^ / ( ) _ ` ' ] [ { } | ...X.o.", 268 | "O.+.@.#.$.%.&.*.=.-.;.:.>.,.<.1.", 269 | "2.3.4.5.6.7.8.9.0.q.w.e.r.t.y.u.", 270 | "i.p.a.s.d.f.g.h.j.k.l.z.x.c.v.b.", 271 | "n.m.M.N.B.V.C.Z.A.S.D.F.G.H.J.K.", 272 | "L.P.I.U.Y.T.R.E.W.Q.!.~.^./.(.).", 273 | "_.`.'.].[.{.}.|. X.XXXoXOX+X@X#X", 274 | "$X%X&X*X=X-X;X:X>X,X c #FFFF00", 17 | ", c #0000FF", 18 | "' c #FF00FF", 19 | ") c #00FFFF", 20 | "! c #FFFFFF", 21 | "****************", 22 | "*..............*", 23 | "*.************.*", 24 | "*..............*", 25 | "*.****.!!!!!!!.*", 26 | "*.****.!====*!.*", 27 | "*.****.!!!!!!!.*", 28 | "*.****.!===*!!.*", 29 | "*.****.!!!!!!!.*", 30 | "*.****.!====*!.*", 31 | "*.****.!!!!!!!.*", 32 | "*.****.!===*!!.*", 33 | "*.****.!!!!!!!.*", 34 | "*..............*", 35 | "****************"}; 36 | -------------------------------------------------------------------------------- /art/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzvncj/xCHM/0f81da0f34b600cbc4282df093b2d132133ef6e2/art/screenshot.png -------------------------------------------------------------------------------- /bootstrap: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #aclocal \ 4 | #&& automake --gnu --add-missing \ 5 | #&& autoconf 6 | 7 | autoreconf --install 8 | -------------------------------------------------------------------------------- /build.bat: -------------------------------------------------------------------------------- 1 | nmake -f makefile.vc WX_DEBUG=0 WX_SHARED=0 WX_UNICODE=1 WXWIN="g:\tmp\xchm\wxMSW-2.8.11" 2 | 3 | 4 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | AC_INIT([xchm],[1.38]) 2 | AC_CONFIG_SRCDIR(src/chmfile.cpp) 3 | AC_CONFIG_HEADERS(config.h) 4 | 5 | AM_GNU_GETTEXT([external]) 6 | AM_GNU_GETTEXT_VERSION([0.19]) 7 | 8 | AM_OPTIONS_WXCONFIG 9 | 10 | AM_PATH_WXCONFIG(3.0.0, wxWin=1, wxWin=0, [std,aui]) 11 | if test "$wxWin" != 1; then 12 | AC_MSG_ERROR([ 13 | wxWidgets must be installed on your system 14 | but the wx-config script couldn't be found. 15 | 16 | Please check that wx-config is in path, the directory 17 | where wxWidgets libraries are installed (returned by 18 | 'wx-config --libs' command) is in LD_LIBRARY_PATH or 19 | equivalent variable and wxWidgets version is 2.3.4 or above. 20 | ]) 21 | fi 22 | 23 | #REZ_FLAGS="`$WX_CONFIG_PATH --rezflags`" 24 | #if test "x$REZ_FLAGS" = "x" -o "x$REZ_FLAGS" = "x#"; then 25 | # REZ_COMMAND="" 26 | #else 27 | # REZ_COMMAND="$REZ_FLAGS xchm" 28 | #fi 29 | #AC_SUBST(REZ_COMMAND) 30 | 31 | wx_config_major_version=`echo $WX_VERSION | \ 32 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` 33 | wx_config_minor_version=`echo $WX_VERSION | \ 34 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` 35 | 36 | CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS" 37 | CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY -std=c++14 -W -Wall -Wno-ignored-qualifiers -Wno-cast-function-type" 38 | CFLAGS="$CFLAGS $WX_CFLAGS_ONLY" 39 | XMLRPCDIR="" 40 | 41 | AC_ARG_ENABLE(static, 42 | [ --enable-static link statically to wxWidgets.], 43 | LINKOPT="$WX_LIBS_STATIC", 44 | LINKOPT="$WX_LIBS") 45 | AC_SUBST(LINKOPT) 46 | 47 | AC_ARG_ENABLE(builtin-chmlib, 48 | [ --enable-builtin-chmlib compile with included chmlib source.], 49 | [case "${enableval}" in 50 | yes) builtin_chmlib=true ;; 51 | no) builtin_chmlib=false ;; 52 | *) AC_MSG_ERROR([bad value ${enableval} for --enable-builtin-chmlib]) ;; 53 | esac],[builtin_chmlib=false]) 54 | AM_CONDITIONAL([ENABLE_BUILTIN_CHMLIB], [test x$builtin_chmlib = xtrue]) 55 | 56 | AC_ARG_ENABLE(debug, 57 | [ --enable-debug compile with gdb debug information.], 58 | CXXFLAGS="$CXXFLAGS -g") 59 | 60 | AC_ARG_ENABLE(optimize, 61 | [ --enable-optimize optimize compiled code (-O2).], 62 | CXXFLAGS="$CXXFLAGS -O2") 63 | 64 | AC_ARG_ENABLE(xmlrpc, 65 | [ --enable-xmlrpc enable XmlRpc functionality in xchm.], 66 | [ enable_xmlrpc=yes ]) 67 | 68 | AC_ARG_WITH(xmlrpc-dir, 69 | [ --with-xmlrpc-dir specify XMLRPC++ includes and libraries parent directory], 70 | XMLRPCDIR="$withval") 71 | 72 | if test -n "$XMLRPCDIR" ; then 73 | CFLAGS="-I$XMLRPCDIR/include -I$XMLRPCDIR/include/xmlrpcpp $CFLAGS" 74 | CXXFLAGS="-I$XMLRPCDIR/include -I$XMLRPCDIR/include/xmlrpcpp $CXXFLAGS" 75 | CPPFLAGS="-I$XMLRPCDIR/include -I$XMLRPCDIR/include/xmlrpcpp $CPPFLAGS" 76 | LDFLAGS="-L$XMLRPCDIR/lib -Wl,-rpath,$XMLRPCDIR/lib $LDFLAGS" 77 | fi 78 | 79 | AM_INIT_AUTOMAKE 80 | AC_PROG_CXX 81 | AC_PROG_INSTALL 82 | 83 | AC_CHECK_TYPE(int32_t, int) 84 | AC_CHECK_TYPE(int16_t, short) 85 | AC_CHECK_TYPE(uint16_t, unsigned short) 86 | AC_CHECK_TYPE(uint32_t, unsigned int) 87 | AC_CHECK_TYPE(uint64_t, unsigned long long) 88 | 89 | if test x$builtin_chmlib = xtrue ; then 90 | AC_DEFINE(ENABLE_BUILTIN_CHMLIB, 1, [Compile with included chmlib source.]) 91 | 92 | else 93 | AC_CHECK_HEADER(chm_lib.h,,AC_MSG_ERROR([Can't find the CHMLIB header.])) 94 | AC_CHECK_LIB( 95 | chm, chm_open,, 96 | AC_MSG_ERROR([Can't find/use -lchm. Please install CHMLIB first.]) 97 | ) 98 | fi 99 | 100 | if test "x$enable_xmlrpc" = "xyes" ; then 101 | AC_LANG_PUSH([C++]) 102 | 103 | AC_CHECK_HEADER(XmlRpc.h,,AC_MSG_ERROR([Can't find the XmlRpc++ header.])) 104 | 105 | LIBS="$LIBS -lxmlrpcpp -lssl" 106 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[XmlRpc::XmlRpcServer svr;]])],[AC_DEFINE(WITH_LIBXMLRPC, 1, [Compile with XmlRpc functionality.])],[AC_MSG_ERROR(Can't find/use -lXmlRpc. Please install XmlRpc++ first.) 107 | ]) 108 | AC_LANG_POP([C++]) 109 | fi 110 | 111 | case "$host" in 112 | *-*-mingw*) 113 | LINKOPT="$LINKOPT -lwxjpeg-2.6 -lwxpng-2.6 -lwxtiff-2.6 -lwxzlib-2.6" 114 | WINDRES="windres.exe $(top_srcdir)/" 115 | ;; 116 | esac 117 | 118 | AC_CONFIG_FILES([Makefile src/Makefile art/Makefile po/Makefile.in m4/Makefile 119 | mac/Makefile data/Makefile man/Makefile]) 120 | AC_OUTPUT 121 | 122 | -------------------------------------------------------------------------------- /data/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = xchm.appdata.xml xchm.desktop 2 | 3 | applicationsdir = $(datadir)/applications 4 | applications_DATA = xchm.desktop 5 | 6 | metainfodir = $(datadir)/metainfo 7 | metainfo_DATA = xchm.appdata.xml 8 | -------------------------------------------------------------------------------- /data/xchm.appdata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.github.xchm 4 | xchm.desktop 5 | xCHM 6 | View CHM files 7 | CC0-1.0 8 | GPL-2.0 9 | 10 |

xCHM is a viewer for Compiled HTML Help (CHM) files. It can show the contents tree if one is available, print the current page and do the usual history stunts. It allows one to change fonts and search for text in all the pages of the file, or in the page's titles.

11 |
12 | 13 | 14 | https://raw.githubusercontent.com/rzvncj/xCHM/master/art/screenshot.png 15 | 16 | 17 | https://github.com/rzvncj/xCHM 18 |
19 | -------------------------------------------------------------------------------- /data/xchm.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=xCHM 3 | Comment=View CHM files 4 | Exec=xchm %f 5 | Terminal=false 6 | Type=Application 7 | Icon=xchm 8 | Categories=Viewer;Utility; 9 | MimeType=application/x-chm;application/vnd.ms-htmlhelp; 10 | StartupNotify=true 11 | Keywords=chm;view;document; 12 | -------------------------------------------------------------------------------- /m4/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = glibc21.m4 codeset.m4 gettext.m4 glibc21.m4 iconv.m4 intdiv0.m4 inttypes_h.m4 inttypes-pri.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 progtest.m4 stdint_h.m4 uintmax_t.m4 wxwin.m4 2 | -------------------------------------------------------------------------------- /mac/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDocumentTypes 8 | 9 | 10 | CFBundleTypeExtensions 11 | 12 | chm 13 | 14 | CFBundleTypeIconFile 15 | docicon-xchm.icns 16 | CFBundleTypeMIMETypes 17 | 18 | application/mshelp 19 | 20 | CFBundleTypeName 21 | Compiled HTML Help 22 | CFBundleTypeOSTypes 23 | 24 | XCHM 25 | 26 | CFBundleTypeRole 27 | Viewer 28 | 29 | 30 | CFBundleExecutable 31 | xCHM 32 | CFBundleIconFile 33 | xCHM.icns 34 | CFBundleGetInfoString 35 | xchm version 1.38, (c) 2003-2024 Razvan Cojocaru 36 | CFBundleIdentifier 37 | net.sourceforge.xchm 38 | CFBundleInfoDictionaryVersion 39 | 6.0 40 | CFBundleName 41 | xCHM 42 | CFBundlePackageType 43 | APPL 44 | CFBundleShortVersionString 45 | 1.38 46 | CFBundleLongVersionString 47 | 1.38 (c) 2003-2024 Razvan Cojocaru 48 | CFBundleSignature 49 | xCHM 50 | CFBundleVersion 51 | 1.38 52 | CSResourcesFileMapped 53 | 54 | NSHumanReadableCopyright 55 | Copyright 2003-2024 Razvan Cojocaru 56 | NSHighResolutionCapable 57 | 58 | NSPrincipalClass 59 | NSApplication 60 | 61 | 62 | -------------------------------------------------------------------------------- /mac/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = Info.plist xCHM.icns 2 | 3 | -------------------------------------------------------------------------------- /mac/xCHM.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzvncj/xCHM/0f81da0f34b600cbc4282df093b2d132133ef6e2/mac/xCHM.icns -------------------------------------------------------------------------------- /make.bkl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | ../wxWidgets-3.0.0 11 | ../chmlib-0.40 12 | 13 | 14 | 15 | 16 | gui 17 | off 18 | static 19 | multi 20 | 21 | ./art 22 | ./src 23 | $(CHMLIB)/src 24 | 25 | 26 | $(CHMLIB)/src/chm_lib.c $(CHMLIB)/src/lzx.c 27 | src/chmapp.cpp src/chmfile.cpp src/chmfinddialog.cpp 28 | src/chmfontdialog.cpp src/chmframe.cpp src/chmfshandler.cpp 29 | src/chmhtmlnotebook.cpp src/chmhtmlwindow.cpp 30 | src/chmindexpanel.cpp src/chminputstream.cpp 31 | src/chmlistctrl.cpp src/chmsearchpanel.cpp src/hhcparser.cpp 32 | 33 | adv 34 | net 35 | html 36 | aui 37 | core 38 | base 39 | rc/xchm.rc 40 | 41 | 42 | -------------------------------------------------------------------------------- /man/Makefile.am: -------------------------------------------------------------------------------- 1 | dist_man_MANS = xchm.1 2 | -------------------------------------------------------------------------------- /man/xchm.1: -------------------------------------------------------------------------------- 1 | .\" Author: Julien Lemoine 2 | .\" 3 | .\" This is free software; you may redistribute it and/or modify it under the 4 | .\" terms of the GNU General Public License as published by the Free Software 5 | .\" Foundation; either version 2 or (at your option) any later version. 6 | .\" 7 | .\" This is distributed in the hope that it will be useful, but WITHOUT ANY 8 | .\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 9 | .\" FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 10 | .\" details. 11 | .\" 12 | .\" You should have received a copy of the GNU General Public License along with 13 | .\" the Debian GNU/Linux system; if not, write to the Free Software Foundation, 14 | .\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | .TH "XCHM" 1 "August 2006" "" "" 17 | 18 | .SH NAME 19 | xchm \- Compiled HTML Help (CHM) file viewer for X. 20 | 21 | .SH SYNOPSIS 22 | .B xchm 23 | .RI [\| OPTIONS \|] 24 | .RI [\| FILE \|] 25 | 26 | .SH DESCRIPTION 27 | .B xchm 28 | is a viewer for Compiled HTML Help (CHM) files. It, can show the contents tree 29 | if one is available, print the current page and do the usual history stunts. It 30 | allows you to change fonts and search for text in all the pages of the file, or 31 | in the pages' titles. 32 | 33 | xchm does not handle Javascript in the book. 34 | 35 | .SH OPTIONS 36 | .TP 37 | .B -c, --contextid= 38 | context-Id to open in file, requires that a file be specified. 39 | .TP 40 | .B -h, --help 41 | displays help message and exit. 42 | 43 | .SH SEE ALSO 44 | .BR Homepage: 45 | 46 | 47 | .SH AUTHOR 48 | Razvan Cojocaru 49 | .PP 50 | This manual page was written by Julien Lemoine and 51 | reformatted by Kartik Mistry for the \fBDebian\fP 52 | system (but may be used by others). 53 | -------------------------------------------------------------------------------- /po/LINGUAS: -------------------------------------------------------------------------------- 1 | ro fr it de be ru pt_BR pt_PT es pl bg hu lv zh_TW zh_CN cs sk uk sv el 2 | -------------------------------------------------------------------------------- /po/Makevars: -------------------------------------------------------------------------------- 1 | # Makefile variables for PO directory in any package using GNU gettext. 2 | 3 | # Usually the message domain is the same as the package name. 4 | DOMAIN = $(PACKAGE) 5 | 6 | # These two variables depend on the location of this directory. 7 | subdir = po 8 | top_builddir = .. 9 | 10 | # These options get passed to xgettext. 11 | XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ 12 | 13 | # This is the copyright holder that gets inserted into the header of the 14 | # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding 15 | # package. (Note that the msgstr strings, extracted from the package's 16 | # sources, belong to the copyright holder of the package.) Translators are 17 | # expected to transfer the copyright for their translations to this person 18 | # or entity, or to disclaim their copyright. The empty string stands for 19 | # the public domain; in this case the translators are expected to disclaim 20 | # their copyright. 21 | COPYRIGHT_HOLDER = Razvan Cojocaru 22 | 23 | # This is the list of locale categories, beyond LC_MESSAGES, for which the 24 | # message catalogs shall be used. It is usually empty. 25 | EXTRA_LOCALE_CATEGORIES = 26 | -------------------------------------------------------------------------------- /po/POTFILES.in: -------------------------------------------------------------------------------- 1 | src/chmfile.cpp 2 | src/chmfinddialog.cpp 3 | src/chmfontdialog.cpp 4 | src/chmframe.cpp 5 | src/chmhtmlwindow.cpp 6 | src/chmsearchpanel.cpp 7 | src/hhcparser.cpp -------------------------------------------------------------------------------- /po/de.po: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzvncj/xCHM/0f81da0f34b600cbc4282df093b2d132133ef6e2/po/de.po -------------------------------------------------------------------------------- /po/es.po: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzvncj/xCHM/0f81da0f34b600cbc4282df093b2d132133ef6e2/po/es.po -------------------------------------------------------------------------------- /po/hu.po: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzvncj/xCHM/0f81da0f34b600cbc4282df093b2d132133ef6e2/po/hu.po -------------------------------------------------------------------------------- /po/it.po: -------------------------------------------------------------------------------- 1 | # xCHM .pot file. 2 | # Copyright (C) 2004 Razvan Cojocaru 3 | # This file is distributed under the same license as the xCHM package. 4 | # Fabio Vescarelli , 2004. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: xCHM\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2024-10-22 14:11+0300\n" 11 | "PO-Revision-Date: 2004-02-25 00:33+0100\n" 12 | "Last-Translator: Fabio Vescarelli \n" 13 | "Language-Team: Italian \n" 14 | "Language: it\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=iso-8859-15\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | 19 | #: src/chmfile.cpp:262 20 | msgid "Retrieving table of contents.." 21 | msgstr "" 22 | 23 | #: src/chmfile.cpp:263 24 | #, fuzzy 25 | msgid "Retrieving index.." 26 | msgstr "Indice senza Titolo" 27 | 28 | #: src/chmfile.cpp:264 29 | msgid "Untitled in index" 30 | msgstr "Indice senza Titolo" 31 | 32 | #: src/chmfinddialog.cpp:29 33 | msgid "Find in page.." 34 | msgstr "Trova nella pagina..." 35 | 36 | #: src/chmfinddialog.cpp:32 37 | msgid "Whole words only" 38 | msgstr "Solo parole intere" 39 | 40 | #: src/chmfinddialog.cpp:33 41 | msgid "Case sensitive" 42 | msgstr "Maiuscole / Minuscole" 43 | 44 | #: src/chmfinddialog.cpp:42 45 | msgid "Find next" 46 | msgstr "Trova successivo" 47 | 48 | #: src/chmfinddialog.cpp:45 src/chmfontdialog.cpp:89 49 | msgid "Cancel" 50 | msgstr "Annulla" 51 | 52 | #: src/chmfontdialog.cpp:64 53 | msgid "Change fonts.." 54 | msgstr "Cambia tipo di Carattere" 55 | 56 | #: src/chmfontdialog.cpp:71 57 | msgid "Normal font:" 58 | msgstr "Carattere normale:" 59 | 60 | #: src/chmfontdialog.cpp:72 61 | msgid "Fixed font:" 62 | msgstr "Carattere a largezza fissa:" 63 | 64 | #: src/chmfontdialog.cpp:78 65 | msgid "Preview:" 66 | msgstr "Anteprima" 67 | 68 | #: src/chmfontdialog.cpp:84 69 | msgid "OK" 70 | msgstr "Ok" 71 | 72 | #: src/chmframe.cpp:52 73 | msgid "Open a CHM book." 74 | msgstr "Apri un file CHM" 75 | 76 | #: src/chmframe.cpp:53 77 | msgid "Change fonts." 78 | msgstr "Modifica i tipi di carattere" 79 | 80 | #: src/chmframe.cpp:54 81 | msgid "Print the page currently displayed." 82 | msgstr "Stampa la pagina attualmente visualizzata" 83 | 84 | #: src/chmframe.cpp:55 85 | msgid "Toggle table of contents." 86 | msgstr "" 87 | 88 | #: src/chmframe.cpp:56 89 | msgid "Go to the book's start page." 90 | msgstr "Vai alla pagina iniziale" 91 | 92 | #: src/chmframe.cpp:57 93 | msgid "Go forward in history. Per book." 94 | msgstr "Vai alla pagina successiva" 95 | 96 | #: src/chmframe.cpp:58 97 | msgid "Back to the last visited page. Per book." 98 | msgstr "Vai alla pagina precedente" 99 | 100 | #: src/chmframe.cpp:59 101 | msgid "About the program." 102 | msgstr "Informazioni sul programma" 103 | 104 | #: src/chmframe.cpp:60 105 | #, fuzzy 106 | msgid "Copy selection." 107 | msgstr "&Copia selezione" 108 | 109 | #: src/chmframe.cpp:61 110 | #, fuzzy 111 | msgid "Find word in page." 112 | msgstr "Trova nella pagina..." 113 | 114 | #: src/chmframe.cpp:62 115 | msgid "Toggle fullscreen mode." 116 | msgstr "" 117 | 118 | #: src/chmframe.cpp:63 119 | msgid "Toggle toolbar." 120 | msgstr "" 121 | 122 | #: src/chmframe.cpp:64 123 | msgid "Close the current tab" 124 | msgstr "" 125 | 126 | #: src/chmframe.cpp:65 127 | #, fuzzy 128 | msgid "Open a new tab" 129 | msgstr "Apri un file CHM" 130 | 131 | #: src/chmframe.cpp:66 132 | msgid "Associate the .chm file extension with xCHM." 133 | msgstr "" 134 | 135 | #: src/chmframe.cpp:141 136 | msgid "Ready." 137 | msgstr "Pronto" 138 | 139 | #: src/chmframe.cpp:165 src/chmframe.cpp:849 src/chmframe.cpp:853 140 | msgid "Contents" 141 | msgstr "Sommario" 142 | 143 | #: src/chmframe.cpp:166 144 | msgid "Index" 145 | msgstr "Indice" 146 | 147 | #: src/chmframe.cpp:167 src/chmsearchpanel.cpp:45 148 | msgid "Search" 149 | msgstr "Cerca" 150 | 151 | #: src/chmframe.cpp:186 152 | msgid "About xCHM" 153 | msgstr "Informazioni su xCHM" 154 | 155 | #: src/chmframe.cpp:191 156 | msgid "Choose a file.." 157 | msgstr "Seleziona un file..." 158 | 159 | #: src/chmframe.cpp:201 src/chmframe.cpp:310 160 | msgid "Could not open file" 161 | msgstr "" 162 | 163 | #: src/chmframe.cpp:201 src/chmframe.cpp:310 src/chmhtmlwindow.cpp:268 164 | #: src/chmhtmlwindow.cpp:286 165 | msgid "Error" 166 | msgstr "" 167 | 168 | #: src/chmframe.cpp:270 169 | msgid "Confirm" 170 | msgstr "" 171 | 172 | #: src/chmframe.cpp:288 173 | msgid "Registration successful!" 174 | msgstr "" 175 | 176 | #: src/chmframe.cpp:288 177 | msgid "Done" 178 | msgstr "" 179 | 180 | #: src/chmframe.cpp:522 181 | msgid "Loading, please wait.." 182 | msgstr "" 183 | 184 | #: src/chmframe.cpp:625 185 | msgid "&Open..\tCtrl-O" 186 | msgstr "&Apri...\tCtrl-O" 187 | 188 | #: src/chmframe.cpp:626 189 | msgid "&Print page..\tCtrl-P" 190 | msgstr "S&tampa pagina...\tCtrl-P" 191 | 192 | #: src/chmframe.cpp:627 193 | #, fuzzy 194 | msgid "Fon&ts.." 195 | msgstr "Caratteri" 196 | 197 | #: src/chmframe.cpp:629 198 | msgid "&Show contents tree\tCtrl-S" 199 | msgstr "Mo&stra l'albero dei contenuti\tCtrl-S" 200 | 201 | #: src/chmframe.cpp:633 202 | msgid "&Make xCHM the default CHM viewer" 203 | msgstr "" 204 | 205 | #: src/chmframe.cpp:638 206 | msgid "&Recent files" 207 | msgstr "File &recenti" 208 | 209 | #: src/chmframe.cpp:650 210 | msgid "E&xit\tCtrl-X" 211 | msgstr "Es&ci\tCtrl-X" 212 | 213 | #: src/chmframe.cpp:650 214 | msgid "Quit the application." 215 | msgstr "Chiude il programma" 216 | 217 | #: src/chmframe.cpp:654 218 | msgid "&Home\tCtrl-H" 219 | msgstr "P&agina iniziale\tCtrl-H" 220 | 221 | #: src/chmframe.cpp:655 222 | #, fuzzy 223 | msgid "For&ward\tAlt-RIGHT" 224 | msgstr "A&vanti\tCtrl-W" 225 | 226 | #: src/chmframe.cpp:656 227 | #, fuzzy 228 | msgid "&Back\tAlt-LEFT" 229 | msgstr "In&dietro\tCtrl-B" 230 | 231 | #: src/chmframe.cpp:659 232 | msgid "&About..\tF1" 233 | msgstr "In&fo..\tF1" 234 | 235 | #: src/chmframe.cpp:662 236 | #, fuzzy 237 | msgid "&Copy\tCtrl-C" 238 | msgstr "P&agina iniziale\tCtrl-H" 239 | 240 | #: src/chmframe.cpp:663 241 | #, fuzzy 242 | msgid "&Find..\tCtrl-F" 243 | msgstr "&Apri...\tCtrl-O" 244 | 245 | #: src/chmframe.cpp:665 246 | #, fuzzy 247 | msgid "&Close tab\tCtrl-W" 248 | msgstr "P&agina iniziale\tCtrl-H" 249 | 250 | #: src/chmframe.cpp:666 251 | #, fuzzy 252 | msgid "&New tab\tCtrl-T" 253 | msgstr "Cara&tteri...\tCtrl-T" 254 | 255 | #: src/chmframe.cpp:669 256 | msgid "Toggle &fullscreen\tF11" 257 | msgstr "" 258 | 259 | #: src/chmframe.cpp:670 260 | msgid "Toggle &toolbar\tAlt-T" 261 | msgstr "" 262 | 263 | #: src/chmframe.cpp:673 264 | msgid "&File" 265 | msgstr "&File" 266 | 267 | #: src/chmframe.cpp:674 268 | msgid "&View" 269 | msgstr "" 270 | 271 | #: src/chmframe.cpp:675 272 | msgid "&Edit" 273 | msgstr "" 274 | 275 | #: src/chmframe.cpp:676 276 | msgid "Hi&story" 277 | msgstr "C&ronologia" 278 | 279 | #: src/chmframe.cpp:677 280 | msgid "&Help" 281 | msgstr "&Aiuto" 282 | 283 | #: src/chmframe.cpp:693 284 | msgid "Bookmarks" 285 | msgstr "Segnalibri" 286 | 287 | #: src/chmframe.cpp:708 288 | msgid "Topics" 289 | msgstr "Argomenti" 290 | 291 | #: src/chmframe.cpp:718 292 | msgid "Add" 293 | msgstr "Aggiungi" 294 | 295 | #: src/chmframe.cpp:719 296 | msgid "Remove" 297 | msgstr "Rimuovi" 298 | 299 | #: src/chmframe.cpp:722 300 | msgid "Add displayed page to bookmarks." 301 | msgstr "Aggiungi la pagina selezionata ai segnalibri" 302 | 303 | #: src/chmframe.cpp:723 304 | msgid "Remove selected bookmark." 305 | msgstr "Rimuovi il segnalibro selezionato" 306 | 307 | #: src/chmframe.cpp:844 308 | msgid "Open .." 309 | msgstr "Apri" 310 | 311 | #: src/chmframe.cpp:845 312 | msgid "Print .." 313 | msgstr "Stampa" 314 | 315 | #: src/chmframe.cpp:848 src/chmframe.cpp:852 316 | msgid "Fonts .." 317 | msgstr "Caratteri" 318 | 319 | #: src/chmframe.cpp:857 320 | msgid "Copy" 321 | msgstr "" 322 | 323 | #: src/chmframe.cpp:858 324 | #, fuzzy 325 | msgid "Find" 326 | msgstr "Trova successivo" 327 | 328 | #: src/chmframe.cpp:863 src/chmframe.cpp:866 329 | msgid "Fullscreen" 330 | msgstr "" 331 | 332 | #: src/chmframe.cpp:871 333 | msgid "Back" 334 | msgstr "Indietro" 335 | 336 | #: src/chmframe.cpp:872 337 | msgid "Forward" 338 | msgstr "Avanti" 339 | 340 | #: src/chmframe.cpp:873 341 | msgid "Home" 342 | msgstr "Pagina iniziale" 343 | 344 | #: src/chmframe.cpp:877 src/chmframe.cpp:879 345 | msgid "About" 346 | msgstr "Info" 347 | 348 | #: src/chmhtmlwindow.cpp:41 349 | msgid "For&ward" 350 | msgstr "A&vanti" 351 | 352 | #: src/chmhtmlwindow.cpp:42 353 | msgid "&Back" 354 | msgstr "In&dietro" 355 | 356 | #: src/chmhtmlwindow.cpp:43 357 | #, fuzzy 358 | msgid "Copy &link location" 359 | msgstr "&Copia selezione" 360 | 361 | #: src/chmhtmlwindow.cpp:44 362 | msgid "&Save link as.." 363 | msgstr "" 364 | 365 | #: src/chmhtmlwindow.cpp:45 366 | msgid "&Open in a new tab" 367 | msgstr "" 368 | 369 | #: src/chmhtmlwindow.cpp:48 370 | msgid "&Copy selection" 371 | msgstr "&Copia selezione" 372 | 373 | #: src/chmhtmlwindow.cpp:50 374 | msgid "&Find in page.." 375 | msgstr "T&rova nella pagina..." 376 | 377 | #: src/chmhtmlwindow.cpp:52 378 | msgid "&Toggle fullscreen mode" 379 | msgstr "" 380 | 381 | #: src/chmhtmlwindow.cpp:268 382 | msgid "OpenFile(" 383 | msgstr "" 384 | 385 | #: src/chmhtmlwindow.cpp:268 386 | msgid ") failed" 387 | msgstr "" 388 | 389 | #: src/chmhtmlwindow.cpp:278 390 | msgid "Save as" 391 | msgstr "" 392 | 393 | #: src/chmhtmlwindow.cpp:286 394 | msgid "Error creating file " 395 | msgstr "" 396 | 397 | #: src/chmhtmlwindow.cpp:296 398 | msgid "Saved file " 399 | msgstr "" 400 | 401 | #: src/chmhtmlwindow.cpp:296 402 | msgid "Success" 403 | msgstr "" 404 | 405 | #: src/chmsearchpanel.cpp:43 406 | msgid "Get partial matches" 407 | msgstr "Trova risultati parziali" 408 | 409 | #: src/chmsearchpanel.cpp:44 410 | msgid "Search titles only" 411 | msgstr "Cerca solo nei titoli" 412 | 413 | #: src/chmsearchpanel.cpp:48 414 | msgid "Allow partial matches." 415 | msgstr "Permetti risultati parziali" 416 | 417 | #: src/chmsearchpanel.cpp:49 418 | msgid "Only search in the contents' titles." 419 | msgstr "Cerca solamente nei titoli dei contenuti" 420 | 421 | #: src/chmsearchpanel.cpp:50 422 | msgid "Search contents for occurrences of the specified text." 423 | msgstr "Cerca nei contenuti le occorrenze del testo specificato" 424 | 425 | #, fuzzy 426 | #~ msgid "Open all" 427 | #~ msgstr "Apri" 428 | 429 | #~ msgid "Font size:" 430 | #~ msgstr "Dimensione" 431 | 432 | #~ msgid "On or off?" 433 | #~ msgstr "Visualizza il sommario" 434 | 435 | #~ msgid "Couldn't extract the book contents tree." 436 | #~ msgstr "Impossibile estrarre l'albero del contenuto del file" 437 | 438 | #~ msgid "No contents.." 439 | #~ msgstr "Nessun contenuto..." 440 | -------------------------------------------------------------------------------- /po/lv.po: -------------------------------------------------------------------------------- 1 | # XChm LatvianGatis Kalnins , 2004. 2 | # 3 | # 4 | msgid "" 5 | msgstr "" 6 | "Project-Id-Version: XChm Latvian\n" 7 | "Report-Msgid-Bugs-To: \n" 8 | "POT-Creation-Date: 2024-10-22 14:11+0300\n" 9 | "PO-Revision-Date: 2004-10-13 13:32+0300\n" 10 | "Last-Translator: <>\n" 11 | "Language-Team: \n" 12 | "Language: lv\n" 13 | "MIME-Version: 1.0\n" 14 | "Content-Type: text/plain; charset=UTF-8\n" 15 | "Content-Transfer-Encoding: 8bit\n" 16 | 17 | #: src/chmfile.cpp:262 18 | msgid "Retrieving table of contents.." 19 | msgstr "" 20 | 21 | #: src/chmfile.cpp:263 22 | #, fuzzy 23 | msgid "Retrieving index.." 24 | msgstr "Bez virsraksta" 25 | 26 | #: src/chmfile.cpp:264 27 | msgid "Untitled in index" 28 | msgstr "Bez virsraksta" 29 | 30 | #: src/chmfinddialog.cpp:29 31 | msgid "Find in page.." 32 | msgstr "Meklēt šajā lappusē..." 33 | 34 | #: src/chmfinddialog.cpp:32 35 | msgid "Whole words only" 36 | msgstr "Tikai pilnus vārdus" 37 | 38 | #: src/chmfinddialog.cpp:33 39 | msgid "Case sensitive" 40 | msgstr "Reģistrjūtīgs" 41 | 42 | #: src/chmfinddialog.cpp:42 43 | msgid "Find next" 44 | msgstr "Meklēt tālāk" 45 | 46 | #: src/chmfinddialog.cpp:45 src/chmfontdialog.cpp:89 47 | msgid "Cancel" 48 | msgstr "Atcelt" 49 | 50 | #: src/chmfontdialog.cpp:64 51 | msgid "Change fonts.." 52 | msgstr "Mainīt šriftu.." 53 | 54 | #: src/chmfontdialog.cpp:71 55 | msgid "Normal font:" 56 | msgstr "Normālais šrifts:" 57 | 58 | #: src/chmfontdialog.cpp:72 59 | msgid "Fixed font:" 60 | msgstr "Fiksētais šrifts:" 61 | 62 | #: src/chmfontdialog.cpp:78 63 | msgid "Preview:" 64 | msgstr "Caurskate:" 65 | 66 | #: src/chmfontdialog.cpp:84 67 | msgid "OK" 68 | msgstr "Ok" 69 | 70 | #: src/chmframe.cpp:52 71 | msgid "Open a CHM book." 72 | msgstr "Atvērt CHM grāmatu." 73 | 74 | #: src/chmframe.cpp:53 75 | msgid "Change fonts." 76 | msgstr "Burtu šrifti." 77 | 78 | #: src/chmframe.cpp:54 79 | msgid "Print the page currently displayed." 80 | msgstr "Drukāt šo lappusi." 81 | 82 | #: src/chmframe.cpp:55 83 | msgid "Toggle table of contents." 84 | msgstr "" 85 | 86 | #: src/chmframe.cpp:56 87 | msgid "Go to the book's start page." 88 | msgstr "Iet uz sākuma lappusi." 89 | 90 | #: src/chmframe.cpp:57 91 | msgid "Go forward in history. Per book." 92 | msgstr "Uz priekšu pa vēsturi." 93 | 94 | #: src/chmframe.cpp:58 95 | msgid "Back to the last visited page. Per book." 96 | msgstr "Atpakaļ uz pēdējo apmeklēto lapu." 97 | 98 | #: src/chmframe.cpp:59 99 | msgid "About the program." 100 | msgstr "Par programmu." 101 | 102 | #: src/chmframe.cpp:60 103 | #, fuzzy 104 | msgid "Copy selection." 105 | msgstr "&Kopēt iezīmēto" 106 | 107 | #: src/chmframe.cpp:61 108 | #, fuzzy 109 | msgid "Find word in page." 110 | msgstr "Meklēt šajā lappusē..." 111 | 112 | #: src/chmframe.cpp:62 113 | msgid "Toggle fullscreen mode." 114 | msgstr "" 115 | 116 | #: src/chmframe.cpp:63 117 | msgid "Toggle toolbar." 118 | msgstr "" 119 | 120 | #: src/chmframe.cpp:64 121 | msgid "Close the current tab" 122 | msgstr "" 123 | 124 | #: src/chmframe.cpp:65 125 | #, fuzzy 126 | msgid "Open a new tab" 127 | msgstr "Atvērt CHM grāmatu." 128 | 129 | #: src/chmframe.cpp:66 130 | msgid "Associate the .chm file extension with xCHM." 131 | msgstr "" 132 | 133 | #: src/chmframe.cpp:141 134 | msgid "Ready." 135 | msgstr "Gatavs." 136 | 137 | #: src/chmframe.cpp:165 src/chmframe.cpp:849 src/chmframe.cpp:853 138 | msgid "Contents" 139 | msgstr "Saturs" 140 | 141 | #: src/chmframe.cpp:166 142 | msgid "Index" 143 | msgstr "Indekss" 144 | 145 | #: src/chmframe.cpp:167 src/chmsearchpanel.cpp:45 146 | msgid "Search" 147 | msgstr "Meklēt" 148 | 149 | #: src/chmframe.cpp:186 150 | msgid "About xCHM" 151 | msgstr "Par xCHM" 152 | 153 | #: src/chmframe.cpp:191 154 | msgid "Choose a file.." 155 | msgstr "Atvērt failu.." 156 | 157 | #: src/chmframe.cpp:201 src/chmframe.cpp:310 158 | msgid "Could not open file" 159 | msgstr "" 160 | 161 | #: src/chmframe.cpp:201 src/chmframe.cpp:310 src/chmhtmlwindow.cpp:268 162 | #: src/chmhtmlwindow.cpp:286 163 | msgid "Error" 164 | msgstr "" 165 | 166 | #: src/chmframe.cpp:270 167 | msgid "Confirm" 168 | msgstr "" 169 | 170 | #: src/chmframe.cpp:288 171 | msgid "Registration successful!" 172 | msgstr "" 173 | 174 | #: src/chmframe.cpp:288 175 | msgid "Done" 176 | msgstr "" 177 | 178 | #: src/chmframe.cpp:522 179 | msgid "Loading, please wait.." 180 | msgstr "" 181 | 182 | #: src/chmframe.cpp:625 183 | msgid "&Open..\tCtrl-O" 184 | msgstr "&Atvērt..\tCtrl-O" 185 | 186 | #: src/chmframe.cpp:626 187 | msgid "&Print page..\tCtrl-P" 188 | msgstr "&Druka..\tCtrl-P" 189 | 190 | #: src/chmframe.cpp:627 191 | #, fuzzy 192 | msgid "Fon&ts.." 193 | msgstr "Šrifti .." 194 | 195 | #: src/chmframe.cpp:629 196 | msgid "&Show contents tree\tCtrl-S" 197 | msgstr "A&ttēlot saturu\tCtrl-S" 198 | 199 | #: src/chmframe.cpp:633 200 | msgid "&Make xCHM the default CHM viewer" 201 | msgstr "" 202 | 203 | #: src/chmframe.cpp:638 204 | msgid "&Recent files" 205 | msgstr "Atvērt &skatītos" 206 | 207 | #: src/chmframe.cpp:650 208 | msgid "E&xit\tCtrl-X" 209 | msgstr "I&zeja\tCtrl-X" 210 | 211 | #: src/chmframe.cpp:650 212 | msgid "Quit the application." 213 | msgstr "Izeja no programmas." 214 | 215 | #: src/chmframe.cpp:654 216 | msgid "&Home\tCtrl-H" 217 | msgstr "&Starts\tCtrl-H" 218 | 219 | #: src/chmframe.cpp:655 220 | #, fuzzy 221 | msgid "For&ward\tAlt-RIGHT" 222 | msgstr "&Uz priekšu\tCtrl-W" 223 | 224 | #: src/chmframe.cpp:656 225 | #, fuzzy 226 | msgid "&Back\tAlt-LEFT" 227 | msgstr "&Atpakaļ\tCtrl-B" 228 | 229 | #: src/chmframe.cpp:659 230 | msgid "&About..\tF1" 231 | msgstr "&Par programmu..\tF1" 232 | 233 | #: src/chmframe.cpp:662 234 | #, fuzzy 235 | msgid "&Copy\tCtrl-C" 236 | msgstr "&Starts\tCtrl-H" 237 | 238 | #: src/chmframe.cpp:663 239 | #, fuzzy 240 | msgid "&Find..\tCtrl-F" 241 | msgstr "&Atvērt..\tCtrl-O" 242 | 243 | #: src/chmframe.cpp:665 244 | #, fuzzy 245 | msgid "&Close tab\tCtrl-W" 246 | msgstr "&Starts\tCtrl-H" 247 | 248 | #: src/chmframe.cpp:666 249 | #, fuzzy 250 | msgid "&New tab\tCtrl-T" 251 | msgstr "&Šrifti..\tCtrl-T" 252 | 253 | #: src/chmframe.cpp:669 254 | msgid "Toggle &fullscreen\tF11" 255 | msgstr "" 256 | 257 | #: src/chmframe.cpp:670 258 | msgid "Toggle &toolbar\tAlt-T" 259 | msgstr "" 260 | 261 | #: src/chmframe.cpp:673 262 | msgid "&File" 263 | msgstr "&Fails" 264 | 265 | #: src/chmframe.cpp:674 266 | msgid "&View" 267 | msgstr "" 268 | 269 | #: src/chmframe.cpp:675 270 | msgid "&Edit" 271 | msgstr "" 272 | 273 | #: src/chmframe.cpp:676 274 | msgid "Hi&story" 275 | msgstr "&Vēsture" 276 | 277 | #: src/chmframe.cpp:677 278 | msgid "&Help" 279 | msgstr "Palī&gs" 280 | 281 | #: src/chmframe.cpp:693 282 | msgid "Bookmarks" 283 | msgstr "Grāmatzīmes" 284 | 285 | #: src/chmframe.cpp:708 286 | msgid "Topics" 287 | msgstr "Tēmas" 288 | 289 | #: src/chmframe.cpp:718 290 | msgid "Add" 291 | msgstr "Pievienot" 292 | 293 | #: src/chmframe.cpp:719 294 | msgid "Remove" 295 | msgstr "Dzēst" 296 | 297 | #: src/chmframe.cpp:722 298 | msgid "Add displayed page to bookmarks." 299 | msgstr "Pievienot lappusi grāmatzīmēm." 300 | 301 | #: src/chmframe.cpp:723 302 | msgid "Remove selected bookmark." 303 | msgstr "Dzēst izvēlēto grāmatzīmi." 304 | 305 | #: src/chmframe.cpp:844 306 | msgid "Open .." 307 | msgstr "Atvērt .." 308 | 309 | #: src/chmframe.cpp:845 310 | msgid "Print .." 311 | msgstr "Druka .." 312 | 313 | #: src/chmframe.cpp:848 src/chmframe.cpp:852 314 | msgid "Fonts .." 315 | msgstr "Šrifti .." 316 | 317 | #: src/chmframe.cpp:857 318 | msgid "Copy" 319 | msgstr "" 320 | 321 | #: src/chmframe.cpp:858 322 | #, fuzzy 323 | msgid "Find" 324 | msgstr "Meklēt tālāk" 325 | 326 | #: src/chmframe.cpp:863 src/chmframe.cpp:866 327 | msgid "Fullscreen" 328 | msgstr "" 329 | 330 | #: src/chmframe.cpp:871 331 | msgid "Back" 332 | msgstr "Atpakaļ" 333 | 334 | #: src/chmframe.cpp:872 335 | msgid "Forward" 336 | msgstr "Uz priekšu" 337 | 338 | #: src/chmframe.cpp:873 339 | msgid "Home" 340 | msgstr "Starts" 341 | 342 | #: src/chmframe.cpp:877 src/chmframe.cpp:879 343 | msgid "About" 344 | msgstr "Par..." 345 | 346 | #: src/chmhtmlwindow.cpp:41 347 | msgid "For&ward" 348 | msgstr "&Uz priekšu" 349 | 350 | #: src/chmhtmlwindow.cpp:42 351 | msgid "&Back" 352 | msgstr "&Atpakaļ" 353 | 354 | #: src/chmhtmlwindow.cpp:43 355 | #, fuzzy 356 | msgid "Copy &link location" 357 | msgstr "&Kopēt iezīmēto" 358 | 359 | #: src/chmhtmlwindow.cpp:44 360 | msgid "&Save link as.." 361 | msgstr "" 362 | 363 | #: src/chmhtmlwindow.cpp:45 364 | msgid "&Open in a new tab" 365 | msgstr "" 366 | 367 | #: src/chmhtmlwindow.cpp:48 368 | msgid "&Copy selection" 369 | msgstr "&Kopēt iezīmēto" 370 | 371 | #: src/chmhtmlwindow.cpp:50 372 | msgid "&Find in page.." 373 | msgstr "&Meklēt lappusē" 374 | 375 | #: src/chmhtmlwindow.cpp:52 376 | msgid "&Toggle fullscreen mode" 377 | msgstr "" 378 | 379 | #: src/chmhtmlwindow.cpp:268 380 | msgid "OpenFile(" 381 | msgstr "" 382 | 383 | #: src/chmhtmlwindow.cpp:268 384 | msgid ") failed" 385 | msgstr "" 386 | 387 | #: src/chmhtmlwindow.cpp:278 388 | msgid "Save as" 389 | msgstr "" 390 | 391 | #: src/chmhtmlwindow.cpp:286 392 | msgid "Error creating file " 393 | msgstr "" 394 | 395 | #: src/chmhtmlwindow.cpp:296 396 | msgid "Saved file " 397 | msgstr "" 398 | 399 | #: src/chmhtmlwindow.cpp:296 400 | msgid "Success" 401 | msgstr "" 402 | 403 | #: src/chmsearchpanel.cpp:43 404 | msgid "Get partial matches" 405 | msgstr "Attēlot daļēji līdzīgos" 406 | 407 | #: src/chmsearchpanel.cpp:44 408 | msgid "Search titles only" 409 | msgstr "Meklēt tikai virsrakstos" 410 | 411 | #: src/chmsearchpanel.cpp:48 412 | msgid "Allow partial matches." 413 | msgstr "Atļaut daļēju sakritību." 414 | 415 | #: src/chmsearchpanel.cpp:49 416 | msgid "Only search in the contents' titles." 417 | msgstr "Meklēt tikai virsrakstos." 418 | 419 | #: src/chmsearchpanel.cpp:50 420 | msgid "Search contents for occurrences of the specified text." 421 | msgstr "Meklēt frāzes, kas satur tekstu." 422 | 423 | #, fuzzy 424 | #~ msgid "Open all" 425 | #~ msgstr "Atvērt .." 426 | 427 | #~ msgid "Font size:" 428 | #~ msgstr "Izmērs:" 429 | 430 | #~ msgid "On or off?" 431 | #~ msgstr "Ieslēgt vai izslēgt?" 432 | 433 | #~ msgid "Couldn't extract the book contents tree." 434 | #~ msgstr "Nav iespējams attēlot dokumenta saturu." 435 | 436 | #~ msgid "No contents.." 437 | #~ msgstr "Satura nav.." 438 | -------------------------------------------------------------------------------- /po/pt_BR.po: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzvncj/xCHM/0f81da0f34b600cbc4282df093b2d132133ef6e2/po/pt_BR.po -------------------------------------------------------------------------------- /po/pt_PT.po: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzvncj/xCHM/0f81da0f34b600cbc4282df093b2d132133ef6e2/po/pt_PT.po -------------------------------------------------------------------------------- /po/ro.po: -------------------------------------------------------------------------------- 1 | # xCHM .pot file. 2 | # Copyright (C) 2004 Razvan Cojocaru 3 | # This file is distributed under the same license as the xCHM package. 4 | # FIRST AUTHOR , 2004. 5 | # Igor Stirbu , 2007. 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: xCHM\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2024-10-22 14:11+0300\n" 11 | "PO-Revision-Date: 2024-09-01 10:45+0300\n" 12 | "Last-Translator: Răzvan Cojocaru \n" 13 | "Language-Team: Romanian \n" 14 | "Language: ro\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | 19 | #: src/chmfile.cpp:262 20 | msgid "Retrieving table of contents.." 21 | msgstr "Se descarcă cuprinsul..." 22 | 23 | #: src/chmfile.cpp:263 24 | msgid "Retrieving index.." 25 | msgstr "Se descarcă indexul..." 26 | 27 | #: src/chmfile.cpp:264 28 | msgid "Untitled in index" 29 | msgstr "Fără titlu în index" 30 | 31 | #: src/chmfinddialog.cpp:29 32 | msgid "Find in page.." 33 | msgstr "Căută în pagină..." 34 | 35 | #: src/chmfinddialog.cpp:32 36 | msgid "Whole words only" 37 | msgstr "Numai cuvinte întregi" 38 | 39 | #: src/chmfinddialog.cpp:33 40 | msgid "Case sensitive" 41 | msgstr "Majuscule nesemnificative" 42 | 43 | #: src/chmfinddialog.cpp:42 44 | msgid "Find next" 45 | msgstr "Următoarea potrivire" 46 | 47 | #: src/chmfinddialog.cpp:45 src/chmfontdialog.cpp:89 48 | msgid "Cancel" 49 | msgstr "Renunță" 50 | 51 | #: src/chmfontdialog.cpp:64 52 | msgid "Change fonts.." 53 | msgstr "Schimbă fonturile..." 54 | 55 | #: src/chmfontdialog.cpp:71 56 | msgid "Normal font:" 57 | msgstr "Font normal:" 58 | 59 | #: src/chmfontdialog.cpp:72 60 | msgid "Fixed font:" 61 | msgstr "Font cu dimensiune fixă:" 62 | 63 | #: src/chmfontdialog.cpp:78 64 | msgid "Preview:" 65 | msgstr "Vizualizare:" 66 | 67 | #: src/chmfontdialog.cpp:84 68 | msgid "OK" 69 | msgstr "OK" 70 | 71 | #: src/chmframe.cpp:52 72 | msgid "Open a CHM book." 73 | msgstr "Deschide un document CHM." 74 | 75 | #: src/chmframe.cpp:53 76 | msgid "Change fonts." 77 | msgstr "Schimbă fonturile." 78 | 79 | #: src/chmframe.cpp:54 80 | msgid "Print the page currently displayed." 81 | msgstr "Tipărește pagina afișată." 82 | 83 | #: src/chmframe.cpp:55 84 | msgid "Toggle table of contents." 85 | msgstr "Se descarcă cuprinsul..." 86 | 87 | #: src/chmframe.cpp:56 88 | msgid "Go to the book's start page." 89 | msgstr "Mergi la pagina de start a carții." 90 | 91 | #: src/chmframe.cpp:57 92 | msgid "Go forward in history. Per book." 93 | msgstr "Mergi înainte în paginile vizitate. Per carte." 94 | 95 | #: src/chmframe.cpp:58 96 | msgid "Back to the last visited page. Per book." 97 | msgstr "Înapoi la ultima pagina vizitată. Per carte." 98 | 99 | # Despre aplicație? 100 | #: src/chmframe.cpp:59 101 | msgid "About the program." 102 | msgstr "Despre program." 103 | 104 | #: src/chmframe.cpp:60 105 | msgid "Copy selection." 106 | msgstr "Copiază selecția." 107 | 108 | #: src/chmframe.cpp:61 109 | msgid "Find word in page." 110 | msgstr "Caută cuvântul în pagină." 111 | 112 | #: src/chmframe.cpp:62 113 | msgid "Toggle fullscreen mode." 114 | msgstr "Comutați modul fullscreen" 115 | 116 | #: src/chmframe.cpp:63 117 | msgid "Toggle toolbar." 118 | msgstr "Comutați bara de unelte" 119 | 120 | #: src/chmframe.cpp:64 121 | msgid "Close the current tab" 122 | msgstr "Închideți tabul curent" 123 | 124 | #: src/chmframe.cpp:65 125 | msgid "Open a new tab" 126 | msgstr "Deschide un document CHM." 127 | 128 | #: src/chmframe.cpp:66 129 | msgid "Associate the .chm file extension with xCHM." 130 | msgstr "Asociază extensia .chm cu xCHM." 131 | 132 | #: src/chmframe.cpp:141 133 | msgid "Ready." 134 | msgstr "Gata." 135 | 136 | #: src/chmframe.cpp:165 src/chmframe.cpp:849 src/chmframe.cpp:853 137 | msgid "Contents" 138 | msgstr "Cuprins" 139 | 140 | #: src/chmframe.cpp:166 141 | msgid "Index" 142 | msgstr "Index" 143 | 144 | #: src/chmframe.cpp:167 src/chmsearchpanel.cpp:45 145 | msgid "Search" 146 | msgstr "Caută" 147 | 148 | #: src/chmframe.cpp:186 149 | msgid "About xCHM" 150 | msgstr "Despre xCHM" 151 | 152 | #: src/chmframe.cpp:191 153 | msgid "Choose a file.." 154 | msgstr "Alege un fișier..." 155 | 156 | #: src/chmframe.cpp:201 src/chmframe.cpp:310 157 | msgid "Could not open file" 158 | msgstr "Nu pot deschide fișierul" 159 | 160 | #: src/chmframe.cpp:201 src/chmframe.cpp:310 src/chmhtmlwindow.cpp:268 161 | #: src/chmhtmlwindow.cpp:286 162 | msgid "Error" 163 | msgstr "Eroare" 164 | 165 | #: src/chmframe.cpp:270 166 | msgid "Confirm" 167 | msgstr "Confirmă" 168 | 169 | #: src/chmframe.cpp:288 170 | msgid "Registration successful!" 171 | msgstr "Înregistrare reușită!" 172 | 173 | #: src/chmframe.cpp:288 174 | msgid "Done" 175 | msgstr "Gata" 176 | 177 | #: src/chmframe.cpp:522 178 | msgid "Loading, please wait.." 179 | msgstr "Așteptați, documentul se încarcă..." 180 | 181 | #: src/chmframe.cpp:625 182 | msgid "&Open..\tCtrl-O" 183 | msgstr "&Deschide...\tCtrl-O" 184 | 185 | #: src/chmframe.cpp:626 186 | msgid "&Print page..\tCtrl-P" 187 | msgstr "&Tipărește pagina...\tCtrl-P" 188 | 189 | #: src/chmframe.cpp:627 190 | msgid "Fon&ts.." 191 | msgstr "Fonturi..." 192 | 193 | #: src/chmframe.cpp:629 194 | msgid "&Show contents tree\tCtrl-S" 195 | msgstr "&Arată arborescent cuprinsul\tCtrl-S" 196 | 197 | #: src/chmframe.cpp:633 198 | msgid "&Make xCHM the default CHM viewer" 199 | msgstr "Fă xCH&M vizualizator implicit de CHM" 200 | 201 | #: src/chmframe.cpp:638 202 | msgid "&Recent files" 203 | msgstr "F&ișiere recente" 204 | 205 | #: src/chmframe.cpp:650 206 | msgid "E&xit\tCtrl-X" 207 | msgstr "Ieșire\tCtrl-X" 208 | 209 | #: src/chmframe.cpp:650 210 | msgid "Quit the application." 211 | msgstr "Închide aplicația." 212 | 213 | #: src/chmframe.cpp:654 214 | msgid "&Home\tCtrl-H" 215 | msgstr "&Start\tCtrl-H" 216 | 217 | #: src/chmframe.cpp:655 218 | msgid "For&ward\tAlt-RIGHT" 219 | msgstr "Îna&inte\tCtrl-W" 220 | 221 | #: src/chmframe.cpp:656 222 | msgid "&Back\tAlt-LEFT" 223 | msgstr "Î&napoi\tCtrl-B" 224 | 225 | #: src/chmframe.cpp:659 226 | msgid "&About..\tF1" 227 | msgstr "&Despre...\tF1" 228 | 229 | #: src/chmframe.cpp:662 230 | msgid "&Copy\tCtrl-C" 231 | msgstr "&Copiază\tCtrl-C" 232 | 233 | #: src/chmframe.cpp:663 234 | msgid "&Find..\tCtrl-F" 235 | msgstr "Caută...\tCtrl-F" 236 | 237 | #: src/chmframe.cpp:665 238 | msgid "&Close tab\tCtrl-W" 239 | msgstr "Închide &tabul\tCtrl-H" 240 | 241 | #: src/chmframe.cpp:666 242 | msgid "&New tab\tCtrl-T" 243 | msgstr "Tab &nou...\tCtrl-T" 244 | 245 | #: src/chmframe.cpp:669 246 | msgid "Toggle &fullscreen\tF11" 247 | msgstr "Comută &fullscreen\tF11" 248 | 249 | #: src/chmframe.cpp:670 250 | msgid "Toggle &toolbar\tAlt-T" 251 | msgstr "Comută &toolbar\tAlt-T" 252 | 253 | #: src/chmframe.cpp:673 254 | msgid "&File" 255 | msgstr "&Fișier" 256 | 257 | #: src/chmframe.cpp:674 258 | msgid "&View" 259 | msgstr "Afișa&re" 260 | 261 | #: src/chmframe.cpp:675 262 | msgid "&Edit" 263 | msgstr "&Editare" 264 | 265 | #: src/chmframe.cpp:676 266 | msgid "Hi&story" 267 | msgstr "&Istoric" 268 | 269 | #: src/chmframe.cpp:677 270 | msgid "&Help" 271 | msgstr "&Ajutor" 272 | 273 | #: src/chmframe.cpp:693 274 | msgid "Bookmarks" 275 | msgstr "Semne de carte" 276 | 277 | #: src/chmframe.cpp:708 278 | msgid "Topics" 279 | msgstr "Cuprins" 280 | 281 | #: src/chmframe.cpp:718 282 | msgid "Add" 283 | msgstr "Adaugă" 284 | 285 | #: src/chmframe.cpp:719 286 | msgid "Remove" 287 | msgstr "Șterge" 288 | 289 | #: src/chmframe.cpp:722 290 | msgid "Add displayed page to bookmarks." 291 | msgstr "Adaugă pagina afișată la semnele de carte." 292 | 293 | #: src/chmframe.cpp:723 294 | msgid "Remove selected bookmark." 295 | msgstr "Șterge semnul de carte selectat." 296 | 297 | #: src/chmframe.cpp:844 298 | msgid "Open .." 299 | msgstr "Deschide..." 300 | 301 | #: src/chmframe.cpp:845 302 | msgid "Print .." 303 | msgstr "Tipărește..." 304 | 305 | #: src/chmframe.cpp:848 src/chmframe.cpp:852 306 | msgid "Fonts .." 307 | msgstr "Fonturi..." 308 | 309 | #: src/chmframe.cpp:857 310 | msgid "Copy" 311 | msgstr "Copiază" 312 | 313 | #: src/chmframe.cpp:858 314 | msgid "Find" 315 | msgstr "Caută" 316 | 317 | #: src/chmframe.cpp:863 src/chmframe.cpp:866 318 | msgid "Fullscreen" 319 | msgstr "Fullscreen" 320 | 321 | #: src/chmframe.cpp:871 322 | msgid "Back" 323 | msgstr "Înapoi" 324 | 325 | #: src/chmframe.cpp:872 326 | msgid "Forward" 327 | msgstr "Înainte" 328 | 329 | #: src/chmframe.cpp:873 330 | msgid "Home" 331 | msgstr "Start" 332 | 333 | #: src/chmframe.cpp:877 src/chmframe.cpp:879 334 | msgid "About" 335 | msgstr "Despre" 336 | 337 | #: src/chmhtmlwindow.cpp:41 338 | msgid "For&ward" 339 | msgstr "Înai&nte" 340 | 341 | #: src/chmhtmlwindow.cpp:42 342 | msgid "&Back" 343 | msgstr "Îna&poi" 344 | 345 | #: src/chmhtmlwindow.cpp:43 346 | msgid "Copy &link location" 347 | msgstr "&Copiază adresa" 348 | 349 | #: src/chmhtmlwindow.cpp:44 350 | msgid "&Save link as.." 351 | msgstr "&Salvează adresa ca..." 352 | 353 | #: src/chmhtmlwindow.cpp:45 354 | msgid "&Open in a new tab" 355 | msgstr "Deschide într-un tab n&ou" 356 | 357 | #: src/chmhtmlwindow.cpp:48 358 | msgid "&Copy selection" 359 | msgstr "&Copiază selecția" 360 | 361 | #: src/chmhtmlwindow.cpp:50 362 | msgid "&Find in page.." 363 | msgstr "&Caută în pagină..." 364 | 365 | #: src/chmhtmlwindow.cpp:52 366 | msgid "&Toggle fullscreen mode" 367 | msgstr "Comu&tă în modul fullscreen" 368 | 369 | #: src/chmhtmlwindow.cpp:268 370 | msgid "OpenFile(" 371 | msgstr "OpenFile(" 372 | 373 | #: src/chmhtmlwindow.cpp:268 374 | msgid ") failed" 375 | msgstr ") a eșuat" 376 | 377 | #: src/chmhtmlwindow.cpp:278 378 | msgid "Save as" 379 | msgstr "Salvează ca" 380 | 381 | #: src/chmhtmlwindow.cpp:286 382 | msgid "Error creating file " 383 | msgstr "Eroare la crearea fișierului " 384 | 385 | #: src/chmhtmlwindow.cpp:296 386 | msgid "Saved file " 387 | msgstr "Fișierul salvat este " 388 | 389 | #: src/chmhtmlwindow.cpp:296 390 | msgid "Success" 391 | msgstr "Succes" 392 | 393 | #: src/chmsearchpanel.cpp:43 394 | msgid "Get partial matches" 395 | msgstr "Rezultate parțiale" 396 | 397 | #: src/chmsearchpanel.cpp:44 398 | msgid "Search titles only" 399 | msgstr "Caută doar în titluri" 400 | 401 | #: src/chmsearchpanel.cpp:48 402 | msgid "Allow partial matches." 403 | msgstr "Permite rezultate parțiale." 404 | 405 | #: src/chmsearchpanel.cpp:49 406 | msgid "Only search in the contents' titles." 407 | msgstr "Caută doar în titlurile din cuprins." 408 | 409 | #: src/chmsearchpanel.cpp:50 410 | msgid "Search contents for occurrences of the specified text." 411 | msgstr "Caută în carte pagini care conțin apariții ale textului precizat." 412 | -------------------------------------------------------------------------------- /po/sk.po: -------------------------------------------------------------------------------- 1 | # Slovak translation for xchm. 2 | # This file is distributed under the same license as the xchm package. 3 | # Vladimir Vasil , 2005. 4 | # 5 | # vi:encoding=utf-8 6 | # 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: xchm 0.9\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2024-10-22 14:11+0300\n" 12 | "PO-Revision-Date: 2004-03-01 22:50+0100\n" 13 | "Last-Translator: Vladimir Vasil \n" 14 | "Language-Team: Slovak \n" 15 | "Language: sk\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | 20 | #: src/chmfile.cpp:262 21 | msgid "Retrieving table of contents.." 22 | msgstr "" 23 | 24 | #: src/chmfile.cpp:263 25 | #, fuzzy 26 | msgid "Retrieving index.." 27 | msgstr "Bez tytulku v indexe" 28 | 29 | #: src/chmfile.cpp:264 30 | msgid "Untitled in index" 31 | msgstr "Bez tytulku v indexe" 32 | 33 | #: src/chmfinddialog.cpp:29 34 | msgid "Find in page.." 35 | msgstr "Nájdi na strane..." 36 | 37 | #: src/chmfinddialog.cpp:32 38 | msgid "Whole words only" 39 | msgstr "Iba celé slová" 40 | 41 | #: src/chmfinddialog.cpp:33 42 | msgid "Case sensitive" 43 | msgstr "Rozlišuj veľké a malé písmená" 44 | 45 | #: src/chmfinddialog.cpp:42 46 | msgid "Find next" 47 | msgstr "Nájdi nasledujúci" 48 | 49 | #: src/chmfinddialog.cpp:45 src/chmfontdialog.cpp:89 50 | msgid "Cancel" 51 | msgstr "Zruš" 52 | 53 | #: src/chmfontdialog.cpp:64 54 | msgid "Change fonts.." 55 | msgstr "Zmeň fonty.." 56 | 57 | #: src/chmfontdialog.cpp:71 58 | msgid "Normal font:" 59 | msgstr "Normálny font:" 60 | 61 | #: src/chmfontdialog.cpp:72 62 | msgid "Fixed font:" 63 | msgstr "Font s rovnakou veľkosťou:" 64 | 65 | #: src/chmfontdialog.cpp:78 66 | msgid "Preview:" 67 | msgstr "Náhľad:" 68 | 69 | #: src/chmfontdialog.cpp:84 70 | msgid "OK" 71 | msgstr "OK" 72 | 73 | #: src/chmframe.cpp:52 74 | msgid "Open a CHM book." 75 | msgstr "Otvor knihu CHM." 76 | 77 | #: src/chmframe.cpp:53 78 | msgid "Change fonts." 79 | msgstr "Zmena písma." 80 | 81 | #: src/chmframe.cpp:54 82 | msgid "Print the page currently displayed." 83 | msgstr "Vytlač aktuálne zobrazené strany." 84 | 85 | #: src/chmframe.cpp:55 86 | msgid "Toggle table of contents." 87 | msgstr "" 88 | 89 | #: src/chmframe.cpp:56 90 | msgid "Go to the book's start page." 91 | msgstr "Skok na prvú stranu knihy." 92 | 93 | #: src/chmframe.cpp:57 94 | msgid "Go forward in history. Per book." 95 | msgstr "Vpred v histórií. Podľa knihy." 96 | 97 | #: src/chmframe.cpp:58 98 | msgid "Back to the last visited page. Per book." 99 | msgstr "Späť na poslednú navštívenú stranu. Podľa knihy." 100 | 101 | #: src/chmframe.cpp:59 102 | msgid "About the program." 103 | msgstr "O programe." 104 | 105 | #: src/chmframe.cpp:60 106 | #, fuzzy 107 | msgid "Copy selection." 108 | msgstr "&Kopíruj označené" 109 | 110 | #: src/chmframe.cpp:61 111 | #, fuzzy 112 | msgid "Find word in page." 113 | msgstr "Nájdi na strane..." 114 | 115 | #: src/chmframe.cpp:62 116 | msgid "Toggle fullscreen mode." 117 | msgstr "" 118 | 119 | #: src/chmframe.cpp:63 120 | msgid "Toggle toolbar." 121 | msgstr "" 122 | 123 | #: src/chmframe.cpp:64 124 | msgid "Close the current tab" 125 | msgstr "" 126 | 127 | #: src/chmframe.cpp:65 128 | #, fuzzy 129 | msgid "Open a new tab" 130 | msgstr "Otvor knihu CHM." 131 | 132 | #: src/chmframe.cpp:66 133 | msgid "Associate the .chm file extension with xCHM." 134 | msgstr "" 135 | 136 | #: src/chmframe.cpp:141 137 | msgid "Ready." 138 | msgstr "Pripravený." 139 | 140 | #: src/chmframe.cpp:165 src/chmframe.cpp:849 src/chmframe.cpp:853 141 | msgid "Contents" 142 | msgstr "Obsah" 143 | 144 | #: src/chmframe.cpp:166 145 | msgid "Index" 146 | msgstr "Kľúč" 147 | 148 | #: src/chmframe.cpp:167 src/chmsearchpanel.cpp:45 149 | msgid "Search" 150 | msgstr "Hľadaj" 151 | 152 | #: src/chmframe.cpp:186 153 | msgid "About xCHM" 154 | msgstr "O xCHM" 155 | 156 | #: src/chmframe.cpp:191 157 | msgid "Choose a file.." 158 | msgstr "Zvoľ súbor.." 159 | 160 | #: src/chmframe.cpp:201 src/chmframe.cpp:310 161 | msgid "Could not open file" 162 | msgstr "" 163 | 164 | #: src/chmframe.cpp:201 src/chmframe.cpp:310 src/chmhtmlwindow.cpp:268 165 | #: src/chmhtmlwindow.cpp:286 166 | msgid "Error" 167 | msgstr "" 168 | 169 | #: src/chmframe.cpp:270 170 | msgid "Confirm" 171 | msgstr "" 172 | 173 | #: src/chmframe.cpp:288 174 | msgid "Registration successful!" 175 | msgstr "" 176 | 177 | #: src/chmframe.cpp:288 178 | msgid "Done" 179 | msgstr "" 180 | 181 | #: src/chmframe.cpp:522 182 | msgid "Loading, please wait.." 183 | msgstr "" 184 | 185 | #: src/chmframe.cpp:625 186 | msgid "&Open..\tCtrl-O" 187 | msgstr "&Otvor..\tCtrl-O" 188 | 189 | #: src/chmframe.cpp:626 190 | msgid "&Print page..\tCtrl-P" 191 | msgstr "T&lač stranu..\tCtrl-P" 192 | 193 | #: src/chmframe.cpp:627 194 | #, fuzzy 195 | msgid "Fon&ts.." 196 | msgstr "Fonty .." 197 | 198 | #: src/chmframe.cpp:629 199 | msgid "&Show contents tree\tCtrl-S" 200 | msgstr "Z&obraz obsah stromu\tCtrl-S" 201 | 202 | #: src/chmframe.cpp:633 203 | msgid "&Make xCHM the default CHM viewer" 204 | msgstr "" 205 | 206 | #: src/chmframe.cpp:638 207 | msgid "&Recent files" 208 | msgstr "&Nedávno otvorené súbory" 209 | 210 | #: src/chmframe.cpp:650 211 | msgid "E&xit\tCtrl-X" 212 | msgstr "&Koniec\tCtrl-X" 213 | 214 | #: src/chmframe.cpp:650 215 | msgid "Quit the application." 216 | msgstr "Ukončenie programu." 217 | 218 | #: src/chmframe.cpp:654 219 | msgid "&Home\tCtrl-H" 220 | msgstr "&Začiatok\tCtrl-H" 221 | 222 | #: src/chmframe.cpp:655 223 | #, fuzzy 224 | msgid "For&ward\tAlt-RIGHT" 225 | msgstr "&Vpred\tCtrl-W" 226 | 227 | #: src/chmframe.cpp:656 228 | #, fuzzy 229 | msgid "&Back\tAlt-LEFT" 230 | msgstr "&Späť\tCtrl-B" 231 | 232 | #: src/chmframe.cpp:659 233 | msgid "&About..\tF1" 234 | msgstr "&O programe..\tF1" 235 | 236 | #: src/chmframe.cpp:662 237 | #, fuzzy 238 | msgid "&Copy\tCtrl-C" 239 | msgstr "&Začiatok\tCtrl-H" 240 | 241 | #: src/chmframe.cpp:663 242 | #, fuzzy 243 | msgid "&Find..\tCtrl-F" 244 | msgstr "&Otvor..\tCtrl-O" 245 | 246 | #: src/chmframe.cpp:665 247 | #, fuzzy 248 | msgid "&Close tab\tCtrl-W" 249 | msgstr "&Začiatok\tCtrl-H" 250 | 251 | #: src/chmframe.cpp:666 252 | #, fuzzy 253 | msgid "&New tab\tCtrl-T" 254 | msgstr "&Písma..\tCtrl-T" 255 | 256 | #: src/chmframe.cpp:669 257 | msgid "Toggle &fullscreen\tF11" 258 | msgstr "" 259 | 260 | #: src/chmframe.cpp:670 261 | msgid "Toggle &toolbar\tAlt-T" 262 | msgstr "" 263 | 264 | #: src/chmframe.cpp:673 265 | msgid "&File" 266 | msgstr "&Súbor" 267 | 268 | #: src/chmframe.cpp:674 269 | msgid "&View" 270 | msgstr "" 271 | 272 | #: src/chmframe.cpp:675 273 | msgid "&Edit" 274 | msgstr "" 275 | 276 | #: src/chmframe.cpp:676 277 | msgid "Hi&story" 278 | msgstr "Hi&stória" 279 | 280 | #: src/chmframe.cpp:677 281 | msgid "&Help" 282 | msgstr "&Pomoc" 283 | 284 | #: src/chmframe.cpp:693 285 | msgid "Bookmarks" 286 | msgstr "Zakladač" 287 | 288 | #: src/chmframe.cpp:708 289 | msgid "Topics" 290 | msgstr "Témy" 291 | 292 | #: src/chmframe.cpp:718 293 | msgid "Add" 294 | msgstr "Pridaj" 295 | 296 | #: src/chmframe.cpp:719 297 | msgid "Remove" 298 | msgstr "Odstráň" 299 | 300 | #: src/chmframe.cpp:722 301 | msgid "Add displayed page to bookmarks." 302 | msgstr "Vlož zobrazovanú stranu do zakladača." 303 | 304 | #: src/chmframe.cpp:723 305 | msgid "Remove selected bookmark." 306 | msgstr "Odstráň označený zakladač." 307 | 308 | #: src/chmframe.cpp:844 309 | msgid "Open .." 310 | msgstr "Otvor .." 311 | 312 | #: src/chmframe.cpp:845 313 | msgid "Print .." 314 | msgstr "Vytlač .." 315 | 316 | #: src/chmframe.cpp:848 src/chmframe.cpp:852 317 | msgid "Fonts .." 318 | msgstr "Fonty .." 319 | 320 | #: src/chmframe.cpp:857 321 | msgid "Copy" 322 | msgstr "" 323 | 324 | #: src/chmframe.cpp:858 325 | #, fuzzy 326 | msgid "Find" 327 | msgstr "Nájdi nasledujúci" 328 | 329 | #: src/chmframe.cpp:863 src/chmframe.cpp:866 330 | msgid "Fullscreen" 331 | msgstr "" 332 | 333 | #: src/chmframe.cpp:871 334 | msgid "Back" 335 | msgstr "Späť" 336 | 337 | #: src/chmframe.cpp:872 338 | msgid "Forward" 339 | msgstr "Vpred" 340 | 341 | #: src/chmframe.cpp:873 342 | msgid "Home" 343 | msgstr "Domov" 344 | 345 | #: src/chmframe.cpp:877 src/chmframe.cpp:879 346 | msgid "About" 347 | msgstr "O programe" 348 | 349 | #: src/chmhtmlwindow.cpp:41 350 | msgid "For&ward" 351 | msgstr "&Vpred" 352 | 353 | #: src/chmhtmlwindow.cpp:42 354 | msgid "&Back" 355 | msgstr "&Späť" 356 | 357 | #: src/chmhtmlwindow.cpp:43 358 | #, fuzzy 359 | msgid "Copy &link location" 360 | msgstr "&Kopiuj zaznaczenie" 361 | 362 | #: src/chmhtmlwindow.cpp:44 363 | msgid "&Save link as.." 364 | msgstr "" 365 | 366 | #: src/chmhtmlwindow.cpp:45 367 | msgid "&Open in a new tab" 368 | msgstr "" 369 | 370 | #: src/chmhtmlwindow.cpp:48 371 | msgid "&Copy selection" 372 | msgstr "&Kopíruj označené" 373 | 374 | #: src/chmhtmlwindow.cpp:50 375 | msgid "&Find in page.." 376 | msgstr "&Nájdi na strane.." 377 | 378 | #: src/chmhtmlwindow.cpp:52 379 | msgid "&Toggle fullscreen mode" 380 | msgstr "" 381 | 382 | #: src/chmhtmlwindow.cpp:268 383 | msgid "OpenFile(" 384 | msgstr "" 385 | 386 | #: src/chmhtmlwindow.cpp:268 387 | msgid ") failed" 388 | msgstr "" 389 | 390 | #: src/chmhtmlwindow.cpp:278 391 | msgid "Save as" 392 | msgstr "" 393 | 394 | #: src/chmhtmlwindow.cpp:286 395 | msgid "Error creating file " 396 | msgstr "" 397 | 398 | #: src/chmhtmlwindow.cpp:296 399 | msgid "Saved file " 400 | msgstr "" 401 | 402 | #: src/chmhtmlwindow.cpp:296 403 | msgid "Success" 404 | msgstr "" 405 | 406 | #: src/chmsearchpanel.cpp:43 407 | msgid "Get partial matches" 408 | msgstr "Vziať čiastočné rovnaké" 409 | 410 | #: src/chmsearchpanel.cpp:44 411 | msgid "Search titles only" 412 | msgstr "Hľadaj len v názvoch" 413 | 414 | #: src/chmsearchpanel.cpp:48 415 | msgid "Allow partial matches." 416 | msgstr "Dovoliť čiastočne rovnaké." 417 | 418 | #: src/chmsearchpanel.cpp:49 419 | msgid "Only search in the contents' titles." 420 | msgstr "Hľadaj iba v obsahu." 421 | 422 | #: src/chmsearchpanel.cpp:50 423 | msgid "Search contents for occurrences of the specified text." 424 | msgstr "Nájdi obsah pre náhodný výskit zvoleného textu." 425 | 426 | #, fuzzy 427 | #~ msgid "Open all" 428 | #~ msgstr "Otvor .." 429 | 430 | #~ msgid "Font size:" 431 | #~ msgstr "Veľkosť písma:" 432 | 433 | #~ msgid "On or off?" 434 | #~ msgstr "Zapnuť alebo vypnuť?" 435 | 436 | #~ msgid "Couldn't extract the book contents tree." 437 | #~ msgstr "Nemôžem rozbaliť obsah stromu knihy." 438 | 439 | #~ msgid "No contents.." 440 | #~ msgstr "Bez obsahu.." 441 | -------------------------------------------------------------------------------- /po/uk.po: -------------------------------------------------------------------------------- 1 | # Ukrainian translation of xchm. 2 | # Copyright (C) 2001 Free Software Foundation, Inc. 3 | # Maxim Dziumanenko , 2006 4 | # 5 | msgid "" 6 | msgstr "" 7 | "Project-Id-Version: xchm 1.5\n" 8 | "Report-Msgid-Bugs-To: \n" 9 | "POT-Creation-Date: 2024-10-22 14:11+0300\n" 10 | "PO-Revision-Date: 2006-04-01 18:30+0300\n" 11 | "Last-Translator: Maxim V. Dziumanenko \n" 12 | "Language-Team: Ukrainian \n" 13 | "Language: uk\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | 18 | #: src/chmfile.cpp:262 19 | msgid "Retrieving table of contents.." 20 | msgstr "" 21 | 22 | #: src/chmfile.cpp:263 23 | #, fuzzy 24 | msgid "Retrieving index.." 25 | msgstr "Без заголовку" 26 | 27 | #: src/chmfile.cpp:264 28 | msgid "Untitled in index" 29 | msgstr "Без заголовку" 30 | 31 | #: src/chmfinddialog.cpp:29 32 | msgid "Find in page.." 33 | msgstr "Знайти на цій сторінці..." 34 | 35 | #: src/chmfinddialog.cpp:32 36 | msgid "Whole words only" 37 | msgstr "Тільки повні слова" 38 | 39 | #: src/chmfinddialog.cpp:33 40 | msgid "Case sensitive" 41 | msgstr "Збігається регістр" 42 | 43 | #: src/chmfinddialog.cpp:42 44 | msgid "Find next" 45 | msgstr "Знайти наступне" 46 | 47 | #: src/chmfinddialog.cpp:45 src/chmfontdialog.cpp:89 48 | msgid "Cancel" 49 | msgstr "Скасувати" 50 | 51 | #: src/chmfontdialog.cpp:64 52 | msgid "Change fonts.." 53 | msgstr "Шрифти..." 54 | 55 | #: src/chmfontdialog.cpp:71 56 | msgid "Normal font:" 57 | msgstr "Звичайний шрифт:" 58 | 59 | #: src/chmfontdialog.cpp:72 60 | msgid "Fixed font:" 61 | msgstr "Моноширинний шрифт:" 62 | 63 | #: src/chmfontdialog.cpp:78 64 | msgid "Preview:" 65 | msgstr "Перегляд:" 66 | 67 | #: src/chmfontdialog.cpp:84 68 | msgid "OK" 69 | msgstr "Гаразд" 70 | 71 | #: src/chmframe.cpp:52 72 | msgid "Open a CHM book." 73 | msgstr "Відкрити книгу CHM." 74 | 75 | #: src/chmframe.cpp:53 76 | msgid "Change fonts." 77 | msgstr "Параметри шрифтів." 78 | 79 | #: src/chmframe.cpp:54 80 | msgid "Print the page currently displayed." 81 | msgstr "Друкувати поточну сторінку." 82 | 83 | #: src/chmframe.cpp:55 84 | msgid "Toggle table of contents." 85 | msgstr "" 86 | 87 | #: src/chmframe.cpp:56 88 | msgid "Go to the book's start page." 89 | msgstr "Перейти на початкову сторінку." 90 | 91 | #: src/chmframe.cpp:57 92 | msgid "Go forward in history. Per book." 93 | msgstr "Вперед по історії." 94 | 95 | #: src/chmframe.cpp:58 96 | msgid "Back to the last visited page. Per book." 97 | msgstr "Назад до останньої відвіданої сторінки." 98 | 99 | #: src/chmframe.cpp:59 100 | msgid "About the program." 101 | msgstr "Про програму." 102 | 103 | #: src/chmframe.cpp:60 104 | msgid "Copy selection." 105 | msgstr "Копіювати виділене." 106 | 107 | #: src/chmframe.cpp:61 108 | msgid "Find word in page." 109 | msgstr "Знайти на сторінці слово." 110 | 111 | #: src/chmframe.cpp:62 112 | msgid "Toggle fullscreen mode." 113 | msgstr "" 114 | 115 | #: src/chmframe.cpp:63 116 | msgid "Toggle toolbar." 117 | msgstr "" 118 | 119 | #: src/chmframe.cpp:64 120 | msgid "Close the current tab" 121 | msgstr "" 122 | 123 | #: src/chmframe.cpp:65 124 | #, fuzzy 125 | msgid "Open a new tab" 126 | msgstr "Відкрити книгу CHM." 127 | 128 | #: src/chmframe.cpp:66 129 | msgid "Associate the .chm file extension with xCHM." 130 | msgstr "" 131 | 132 | #: src/chmframe.cpp:141 133 | msgid "Ready." 134 | msgstr "Завершено." 135 | 136 | #: src/chmframe.cpp:165 src/chmframe.cpp:849 src/chmframe.cpp:853 137 | msgid "Contents" 138 | msgstr "Зміст" 139 | 140 | #: src/chmframe.cpp:166 141 | msgid "Index" 142 | msgstr "Індекс" 143 | 144 | #: src/chmframe.cpp:167 src/chmsearchpanel.cpp:45 145 | msgid "Search" 146 | msgstr "Пошук" 147 | 148 | #: src/chmframe.cpp:186 149 | msgid "About xCHM" 150 | msgstr "Про програму xCHM" 151 | 152 | #: src/chmframe.cpp:191 153 | msgid "Choose a file.." 154 | msgstr "Відкрити файл.." 155 | 156 | #: src/chmframe.cpp:201 src/chmframe.cpp:310 157 | msgid "Could not open file" 158 | msgstr "" 159 | 160 | #: src/chmframe.cpp:201 src/chmframe.cpp:310 src/chmhtmlwindow.cpp:268 161 | #: src/chmhtmlwindow.cpp:286 162 | msgid "Error" 163 | msgstr "" 164 | 165 | #: src/chmframe.cpp:270 166 | msgid "Confirm" 167 | msgstr "" 168 | 169 | #: src/chmframe.cpp:288 170 | msgid "Registration successful!" 171 | msgstr "" 172 | 173 | #: src/chmframe.cpp:288 174 | msgid "Done" 175 | msgstr "" 176 | 177 | #: src/chmframe.cpp:522 178 | msgid "Loading, please wait.." 179 | msgstr "" 180 | 181 | #: src/chmframe.cpp:625 182 | msgid "&Open..\tCtrl-O" 183 | msgstr "&Відкрити...\tCtrl+O" 184 | 185 | #: src/chmframe.cpp:626 186 | msgid "&Print page..\tCtrl-P" 187 | msgstr "Д&рук..\tCtrl-P" 188 | 189 | #: src/chmframe.cpp:627 190 | #, fuzzy 191 | msgid "Fon&ts.." 192 | msgstr "Шрифти..." 193 | 194 | #: src/chmframe.cpp:629 195 | msgid "&Show contents tree\tCtrl-S" 196 | msgstr "Показати зміст\tCtrl-S" 197 | 198 | #: src/chmframe.cpp:633 199 | msgid "&Make xCHM the default CHM viewer" 200 | msgstr "" 201 | 202 | #: src/chmframe.cpp:638 203 | msgid "&Recent files" 204 | msgstr "Не&давні файли..." 205 | 206 | #: src/chmframe.cpp:650 207 | msgid "E&xit\tCtrl-X" 208 | msgstr "Ви&йти\tCtrl-X" 209 | 210 | #: src/chmframe.cpp:650 211 | msgid "Quit the application." 212 | msgstr "Вийти з програми." 213 | 214 | #: src/chmframe.cpp:654 215 | msgid "&Home\tCtrl-H" 216 | msgstr "&Додому\tCtrl-H" 217 | 218 | #: src/chmframe.cpp:655 219 | #, fuzzy 220 | msgid "For&ward\tAlt-RIGHT" 221 | msgstr "&Вперед\tCtrl-W" 222 | 223 | #: src/chmframe.cpp:656 224 | #, fuzzy 225 | msgid "&Back\tAlt-LEFT" 226 | msgstr "&Назад\tCtrl-B" 227 | 228 | #: src/chmframe.cpp:659 229 | msgid "&About..\tF1" 230 | msgstr "&Про програму..\tF1" 231 | 232 | #: src/chmframe.cpp:662 233 | msgid "&Copy\tCtrl-C" 234 | msgstr "&Копіювати\tCtrl-C" 235 | 236 | #: src/chmframe.cpp:663 237 | msgid "&Find..\tCtrl-F" 238 | msgstr "З&найти..\tCtrl-F" 239 | 240 | #: src/chmframe.cpp:665 241 | #, fuzzy 242 | msgid "&Close tab\tCtrl-W" 243 | msgstr "&Додому\tCtrl-H" 244 | 245 | #: src/chmframe.cpp:666 246 | #, fuzzy 247 | msgid "&New tab\tCtrl-T" 248 | msgstr "&Шрифти..\tCtrl-T" 249 | 250 | #: src/chmframe.cpp:669 251 | msgid "Toggle &fullscreen\tF11" 252 | msgstr "" 253 | 254 | #: src/chmframe.cpp:670 255 | msgid "Toggle &toolbar\tAlt-T" 256 | msgstr "" 257 | 258 | #: src/chmframe.cpp:673 259 | msgid "&File" 260 | msgstr "&Файл" 261 | 262 | #: src/chmframe.cpp:674 263 | msgid "&View" 264 | msgstr "" 265 | 266 | #: src/chmframe.cpp:675 267 | msgid "&Edit" 268 | msgstr "&Правка" 269 | 270 | #: src/chmframe.cpp:676 271 | msgid "Hi&story" 272 | msgstr "&Історія" 273 | 274 | #: src/chmframe.cpp:677 275 | msgid "&Help" 276 | msgstr "&Довідка" 277 | 278 | #: src/chmframe.cpp:693 279 | msgid "Bookmarks" 280 | msgstr "Закладки" 281 | 282 | #: src/chmframe.cpp:708 283 | msgid "Topics" 284 | msgstr "Теми" 285 | 286 | #: src/chmframe.cpp:718 287 | msgid "Add" 288 | msgstr "Додати" 289 | 290 | #: src/chmframe.cpp:719 291 | msgid "Remove" 292 | msgstr "Видалити" 293 | 294 | #: src/chmframe.cpp:722 295 | msgid "Add displayed page to bookmarks." 296 | msgstr "Додати цю сторінку до закладок." 297 | 298 | #: src/chmframe.cpp:723 299 | msgid "Remove selected bookmark." 300 | msgstr "Видалити виділену закладку." 301 | 302 | #: src/chmframe.cpp:844 303 | msgid "Open .." 304 | msgstr "Відкрити..." 305 | 306 | #: src/chmframe.cpp:845 307 | msgid "Print .." 308 | msgstr "Друк..." 309 | 310 | #: src/chmframe.cpp:848 src/chmframe.cpp:852 311 | msgid "Fonts .." 312 | msgstr "Шрифти..." 313 | 314 | #: src/chmframe.cpp:857 315 | msgid "Copy" 316 | msgstr "Копіювати" 317 | 318 | #: src/chmframe.cpp:858 319 | msgid "Find" 320 | msgstr "Знайти" 321 | 322 | #: src/chmframe.cpp:863 src/chmframe.cpp:866 323 | msgid "Fullscreen" 324 | msgstr "" 325 | 326 | #: src/chmframe.cpp:871 327 | msgid "Back" 328 | msgstr "Назад" 329 | 330 | #: src/chmframe.cpp:872 331 | msgid "Forward" 332 | msgstr "Вперед" 333 | 334 | #: src/chmframe.cpp:873 335 | msgid "Home" 336 | msgstr "Додому" 337 | 338 | #: src/chmframe.cpp:877 src/chmframe.cpp:879 339 | msgid "About" 340 | msgstr "Про програму" 341 | 342 | #: src/chmhtmlwindow.cpp:41 343 | msgid "For&ward" 344 | msgstr "&Вперед" 345 | 346 | #: src/chmhtmlwindow.cpp:42 347 | msgid "&Back" 348 | msgstr "&Назад" 349 | 350 | #: src/chmhtmlwindow.cpp:43 351 | msgid "Copy &link location" 352 | msgstr "Копіювати &посилання" 353 | 354 | #: src/chmhtmlwindow.cpp:44 355 | msgid "&Save link as.." 356 | msgstr "" 357 | 358 | #: src/chmhtmlwindow.cpp:45 359 | msgid "&Open in a new tab" 360 | msgstr "" 361 | 362 | #: src/chmhtmlwindow.cpp:48 363 | msgid "&Copy selection" 364 | msgstr "&Копіювати виділене" 365 | 366 | #: src/chmhtmlwindow.cpp:50 367 | msgid "&Find in page.." 368 | msgstr "З&найти на цій сторінці.." 369 | 370 | #: src/chmhtmlwindow.cpp:52 371 | msgid "&Toggle fullscreen mode" 372 | msgstr "" 373 | 374 | #: src/chmhtmlwindow.cpp:268 375 | msgid "OpenFile(" 376 | msgstr "" 377 | 378 | #: src/chmhtmlwindow.cpp:268 379 | msgid ") failed" 380 | msgstr "" 381 | 382 | #: src/chmhtmlwindow.cpp:278 383 | msgid "Save as" 384 | msgstr "" 385 | 386 | #: src/chmhtmlwindow.cpp:286 387 | msgid "Error creating file " 388 | msgstr "" 389 | 390 | #: src/chmhtmlwindow.cpp:296 391 | msgid "Saved file " 392 | msgstr "" 393 | 394 | #: src/chmhtmlwindow.cpp:296 395 | msgid "Success" 396 | msgstr "" 397 | 398 | #: src/chmsearchpanel.cpp:43 399 | msgid "Get partial matches" 400 | msgstr "Отримувати часткові відповідності" 401 | 402 | #: src/chmsearchpanel.cpp:44 403 | msgid "Search titles only" 404 | msgstr "Шукати лише у заголовках" 405 | 406 | #: src/chmsearchpanel.cpp:48 407 | msgid "Allow partial matches." 408 | msgstr "Дозволити часткові відповідностей." 409 | 410 | #: src/chmsearchpanel.cpp:49 411 | msgid "Only search in the contents' titles." 412 | msgstr "Шукати лише у заголовках змісту." 413 | 414 | #: src/chmsearchpanel.cpp:50 415 | msgid "Search contents for occurrences of the specified text." 416 | msgstr "Шукати фрази, де зустрічається виділений текст." 417 | 418 | #, fuzzy 419 | #~ msgid "Open all" 420 | #~ msgstr "Відкрити..." 421 | 422 | #~ msgid "Font size:" 423 | #~ msgstr "Розмір:" 424 | 425 | #~ msgid "On or off?" 426 | #~ msgstr "Увімкнути чи вимкнути?" 427 | 428 | #~ msgid "Couldn't extract the book contents tree." 429 | #~ msgstr "Не вдається відкрити зміст." 430 | 431 | #~ msgid "No contents.." 432 | #~ msgstr "Без змісту.." 433 | -------------------------------------------------------------------------------- /po/zh_CN.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Razvan Cojocaru 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: xCHM 1.1\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2024-10-22 14:11+0300\n" 11 | "PO-Revision-Date: 2005-08-27 14:37+0800\n" 12 | "Last-Translator: sejishikong \n" 13 | "Language-Team: zh_CN \n" 14 | "Language: zh_CN\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | 19 | #: src/chmfile.cpp:262 20 | msgid "Retrieving table of contents.." 21 | msgstr "" 22 | 23 | #: src/chmfile.cpp:263 24 | #, fuzzy 25 | msgid "Retrieving index.." 26 | msgstr "在索引中无标题" 27 | 28 | #: src/chmfile.cpp:264 29 | msgid "Untitled in index" 30 | msgstr "在索引中无标题" 31 | 32 | #: src/chmfinddialog.cpp:29 33 | msgid "Find in page.." 34 | msgstr "在页面中查找.." 35 | 36 | #: src/chmfinddialog.cpp:32 37 | msgid "Whole words only" 38 | msgstr "仅整个单词" 39 | 40 | #: src/chmfinddialog.cpp:33 41 | msgid "Case sensitive" 42 | msgstr "区分大小写" 43 | 44 | #: src/chmfinddialog.cpp:42 45 | msgid "Find next" 46 | msgstr "查找下一个" 47 | 48 | #: src/chmfinddialog.cpp:45 src/chmfontdialog.cpp:89 49 | msgid "Cancel" 50 | msgstr "取消" 51 | 52 | #: src/chmfontdialog.cpp:64 53 | msgid "Change fonts.." 54 | msgstr "更改字体.." 55 | 56 | #: src/chmfontdialog.cpp:71 57 | msgid "Normal font:" 58 | msgstr "普通字体:" 59 | 60 | #: src/chmfontdialog.cpp:72 61 | msgid "Fixed font:" 62 | msgstr "固定字体:" 63 | 64 | #: src/chmfontdialog.cpp:78 65 | msgid "Preview:" 66 | msgstr "预览" 67 | 68 | #: src/chmfontdialog.cpp:84 69 | msgid "OK" 70 | msgstr "好" 71 | 72 | #: src/chmframe.cpp:52 73 | msgid "Open a CHM book." 74 | msgstr "打开CHM书籍" 75 | 76 | #: src/chmframe.cpp:53 77 | msgid "Change fonts." 78 | msgstr "更改字体。" 79 | 80 | #: src/chmframe.cpp:54 81 | msgid "Print the page currently displayed." 82 | msgstr "打印当前显示的页面" 83 | 84 | #: src/chmframe.cpp:55 85 | msgid "Toggle table of contents." 86 | msgstr "" 87 | 88 | #: src/chmframe.cpp:56 89 | msgid "Go to the book's start page." 90 | msgstr "到书籍的起始页。" 91 | 92 | #: src/chmframe.cpp:57 93 | msgid "Go forward in history. Per book." 94 | msgstr "在历史中向前,每一书籍。" 95 | 96 | #: src/chmframe.cpp:58 97 | msgid "Back to the last visited page. Per book." 98 | msgstr "回到最近访问的页面,每一书籍。" 99 | 100 | #: src/chmframe.cpp:59 101 | msgid "About the program." 102 | msgstr "关于此程序。" 103 | 104 | #: src/chmframe.cpp:60 105 | #, fuzzy 106 | msgid "Copy selection." 107 | msgstr "复制选定(&C)" 108 | 109 | #: src/chmframe.cpp:61 110 | #, fuzzy 111 | msgid "Find word in page." 112 | msgstr "在页面中查找.." 113 | 114 | #: src/chmframe.cpp:62 115 | msgid "Toggle fullscreen mode." 116 | msgstr "" 117 | 118 | #: src/chmframe.cpp:63 119 | msgid "Toggle toolbar." 120 | msgstr "" 121 | 122 | #: src/chmframe.cpp:64 123 | msgid "Close the current tab" 124 | msgstr "" 125 | 126 | #: src/chmframe.cpp:65 127 | #, fuzzy 128 | msgid "Open a new tab" 129 | msgstr "打开CHM书籍" 130 | 131 | #: src/chmframe.cpp:66 132 | msgid "Associate the .chm file extension with xCHM." 133 | msgstr "" 134 | 135 | #: src/chmframe.cpp:141 136 | msgid "Ready." 137 | msgstr "准备。" 138 | 139 | #: src/chmframe.cpp:165 src/chmframe.cpp:849 src/chmframe.cpp:853 140 | msgid "Contents" 141 | msgstr "目录" 142 | 143 | #: src/chmframe.cpp:166 144 | msgid "Index" 145 | msgstr "索引" 146 | 147 | #: src/chmframe.cpp:167 src/chmsearchpanel.cpp:45 148 | msgid "Search" 149 | msgstr "查找" 150 | 151 | #: src/chmframe.cpp:186 152 | msgid "About xCHM" 153 | msgstr "关于xCHM" 154 | 155 | #: src/chmframe.cpp:191 156 | msgid "Choose a file.." 157 | msgstr "选择一个文件.." 158 | 159 | #: src/chmframe.cpp:201 src/chmframe.cpp:310 160 | msgid "Could not open file" 161 | msgstr "" 162 | 163 | #: src/chmframe.cpp:201 src/chmframe.cpp:310 src/chmhtmlwindow.cpp:268 164 | #: src/chmhtmlwindow.cpp:286 165 | msgid "Error" 166 | msgstr "" 167 | 168 | #: src/chmframe.cpp:270 169 | msgid "Confirm" 170 | msgstr "" 171 | 172 | #: src/chmframe.cpp:288 173 | msgid "Registration successful!" 174 | msgstr "" 175 | 176 | #: src/chmframe.cpp:288 177 | msgid "Done" 178 | msgstr "" 179 | 180 | #: src/chmframe.cpp:522 181 | msgid "Loading, please wait.." 182 | msgstr "" 183 | 184 | #: src/chmframe.cpp:625 185 | msgid "&Open..\tCtrl-O" 186 | msgstr "打开(&O)..\tCtrl-O" 187 | 188 | #: src/chmframe.cpp:626 189 | msgid "&Print page..\tCtrl-P" 190 | msgstr "打印页面(&P)..\tCtrl-P" 191 | 192 | #: src/chmframe.cpp:627 193 | #, fuzzy 194 | msgid "Fon&ts.." 195 | msgstr "字体 .." 196 | 197 | #: src/chmframe.cpp:629 198 | msgid "&Show contents tree\tCtrl-S" 199 | msgstr "显示目录树(&S)\tCtrl-S" 200 | 201 | #: src/chmframe.cpp:633 202 | msgid "&Make xCHM the default CHM viewer" 203 | msgstr "" 204 | 205 | #: src/chmframe.cpp:638 206 | msgid "&Recent files" 207 | msgstr "最近的文件(&R)" 208 | 209 | #: src/chmframe.cpp:650 210 | msgid "E&xit\tCtrl-X" 211 | msgstr "退出(&X)\tCtrl-X" 212 | 213 | #: src/chmframe.cpp:650 214 | msgid "Quit the application." 215 | msgstr "退出应用程序" 216 | 217 | #: src/chmframe.cpp:654 218 | msgid "&Home\tCtrl-H" 219 | msgstr "主页(&H)\tCtrl-H" 220 | 221 | #: src/chmframe.cpp:655 222 | #, fuzzy 223 | msgid "For&ward\tAlt-RIGHT" 224 | msgstr "向前(&W)\tCtrl-W" 225 | 226 | #: src/chmframe.cpp:656 227 | #, fuzzy 228 | msgid "&Back\tAlt-LEFT" 229 | msgstr "向后(&B)\tCtrl-B" 230 | 231 | #: src/chmframe.cpp:659 232 | msgid "&About..\tF1" 233 | msgstr "关于(&A)..\tF1" 234 | 235 | #: src/chmframe.cpp:662 236 | #, fuzzy 237 | msgid "&Copy\tCtrl-C" 238 | msgstr "主页(&H)\tCtrl-H" 239 | 240 | #: src/chmframe.cpp:663 241 | #, fuzzy 242 | msgid "&Find..\tCtrl-F" 243 | msgstr "打开(&O)..\tCtrl-O" 244 | 245 | #: src/chmframe.cpp:665 246 | #, fuzzy 247 | msgid "&Close tab\tCtrl-W" 248 | msgstr "主页(&H)\tCtrl-H" 249 | 250 | #: src/chmframe.cpp:666 251 | #, fuzzy 252 | msgid "&New tab\tCtrl-T" 253 | msgstr "字体(&T)..\tCtrl-T" 254 | 255 | #: src/chmframe.cpp:669 256 | msgid "Toggle &fullscreen\tF11" 257 | msgstr "" 258 | 259 | #: src/chmframe.cpp:670 260 | msgid "Toggle &toolbar\tAlt-T" 261 | msgstr "" 262 | 263 | #: src/chmframe.cpp:673 264 | msgid "&File" 265 | msgstr "文件(&F)" 266 | 267 | #: src/chmframe.cpp:674 268 | msgid "&View" 269 | msgstr "" 270 | 271 | #: src/chmframe.cpp:675 272 | msgid "&Edit" 273 | msgstr "" 274 | 275 | #: src/chmframe.cpp:676 276 | msgid "Hi&story" 277 | msgstr "历史(&S)" 278 | 279 | #: src/chmframe.cpp:677 280 | msgid "&Help" 281 | msgstr "帮助(&H)" 282 | 283 | #: src/chmframe.cpp:693 284 | msgid "Bookmarks" 285 | msgstr "书签" 286 | 287 | #: src/chmframe.cpp:708 288 | msgid "Topics" 289 | msgstr "主题" 290 | 291 | #: src/chmframe.cpp:718 292 | msgid "Add" 293 | msgstr "添加" 294 | 295 | #: src/chmframe.cpp:719 296 | msgid "Remove" 297 | msgstr "移除" 298 | 299 | #: src/chmframe.cpp:722 300 | msgid "Add displayed page to bookmarks." 301 | msgstr "添加显示的页面到书签。" 302 | 303 | #: src/chmframe.cpp:723 304 | msgid "Remove selected bookmark." 305 | msgstr "移除选定的书签。" 306 | 307 | #: src/chmframe.cpp:844 308 | msgid "Open .." 309 | msgstr "打开 .." 310 | 311 | #: src/chmframe.cpp:845 312 | msgid "Print .." 313 | msgstr "打印 .." 314 | 315 | #: src/chmframe.cpp:848 src/chmframe.cpp:852 316 | msgid "Fonts .." 317 | msgstr "字体 .." 318 | 319 | #: src/chmframe.cpp:857 320 | msgid "Copy" 321 | msgstr "" 322 | 323 | #: src/chmframe.cpp:858 324 | #, fuzzy 325 | msgid "Find" 326 | msgstr "查找下一个" 327 | 328 | #: src/chmframe.cpp:863 src/chmframe.cpp:866 329 | msgid "Fullscreen" 330 | msgstr "" 331 | 332 | #: src/chmframe.cpp:871 333 | msgid "Back" 334 | msgstr "后退" 335 | 336 | #: src/chmframe.cpp:872 337 | msgid "Forward" 338 | msgstr "前进" 339 | 340 | #: src/chmframe.cpp:873 341 | msgid "Home" 342 | msgstr "主页" 343 | 344 | #: src/chmframe.cpp:877 src/chmframe.cpp:879 345 | msgid "About" 346 | msgstr "关于" 347 | 348 | #: src/chmhtmlwindow.cpp:41 349 | msgid "For&ward" 350 | msgstr "向前(&W)" 351 | 352 | #: src/chmhtmlwindow.cpp:42 353 | msgid "&Back" 354 | msgstr "向后(&B)" 355 | 356 | #: src/chmhtmlwindow.cpp:43 357 | msgid "Copy &link location" 358 | msgstr "复制链接地址(&L)" 359 | 360 | #: src/chmhtmlwindow.cpp:44 361 | msgid "&Save link as.." 362 | msgstr "" 363 | 364 | #: src/chmhtmlwindow.cpp:45 365 | msgid "&Open in a new tab" 366 | msgstr "" 367 | 368 | #: src/chmhtmlwindow.cpp:48 369 | msgid "&Copy selection" 370 | msgstr "复制选定(&C)" 371 | 372 | #: src/chmhtmlwindow.cpp:50 373 | msgid "&Find in page.." 374 | msgstr "在页面中查找(F).." 375 | 376 | #: src/chmhtmlwindow.cpp:52 377 | msgid "&Toggle fullscreen mode" 378 | msgstr "" 379 | 380 | #: src/chmhtmlwindow.cpp:268 381 | msgid "OpenFile(" 382 | msgstr "" 383 | 384 | #: src/chmhtmlwindow.cpp:268 385 | msgid ") failed" 386 | msgstr "" 387 | 388 | #: src/chmhtmlwindow.cpp:278 389 | msgid "Save as" 390 | msgstr "" 391 | 392 | #: src/chmhtmlwindow.cpp:286 393 | msgid "Error creating file " 394 | msgstr "" 395 | 396 | #: src/chmhtmlwindow.cpp:296 397 | msgid "Saved file " 398 | msgstr "" 399 | 400 | #: src/chmhtmlwindow.cpp:296 401 | msgid "Success" 402 | msgstr "" 403 | 404 | #: src/chmsearchpanel.cpp:43 405 | msgid "Get partial matches" 406 | msgstr "获取部分匹配" 407 | 408 | #: src/chmsearchpanel.cpp:44 409 | msgid "Search titles only" 410 | msgstr "只查找标题" 411 | 412 | #: src/chmsearchpanel.cpp:48 413 | msgid "Allow partial matches." 414 | msgstr "允许部分匹配" 415 | 416 | #: src/chmsearchpanel.cpp:49 417 | msgid "Only search in the contents' titles." 418 | msgstr "只在目录标题中查找" 419 | 420 | #: src/chmsearchpanel.cpp:50 421 | msgid "Search contents for occurrences of the specified text." 422 | msgstr "在目录中查找指定的文本" 423 | 424 | #, fuzzy 425 | #~ msgid "Open all" 426 | #~ msgstr "打开 .." 427 | 428 | #~ msgid "Font size:" 429 | #~ msgstr "字体大小:" 430 | 431 | #~ msgid "On or off?" 432 | #~ msgstr "打开还是关闭?" 433 | 434 | #~ msgid "Couldn't extract the book contents tree." 435 | #~ msgstr "不能展开此书的目录树。" 436 | 437 | #~ msgid "No contents.." 438 | #~ msgstr "没有目录.." 439 | -------------------------------------------------------------------------------- /po/zh_TW.po: -------------------------------------------------------------------------------- 1 | # Traditional Chinese Messages for xchm 2 | # Copyright (C) 2005 Free Software Foundation, Inc. 3 | # Wei-Lun Chao , 2005 4 | # 5 | msgid "" 6 | msgstr "" 7 | "Project-Id-Version: xchm 1.0\n" 8 | "Report-Msgid-Bugs-To: \n" 9 | "POT-Creation-Date: 2024-10-22 14:11+0300\n" 10 | "PO-Revision-Date: 2005-08-10 14:31+0800\n" 11 | "Last-Translator: Wei-Lun Chao \n" 12 | "Language-Team: Chinese (traditional) \n" 13 | "Language: zh_TW\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Plural-Forms: nplurals=1; plural=0;\n" 18 | 19 | #: src/chmfile.cpp:262 20 | msgid "Retrieving table of contents.." 21 | msgstr "" 22 | 23 | #: src/chmfile.cpp:263 24 | #, fuzzy 25 | msgid "Retrieving index.." 26 | msgstr "索引中不具標題" 27 | 28 | #: src/chmfile.cpp:264 29 | msgid "Untitled in index" 30 | msgstr "索引中不具標題" 31 | 32 | #: src/chmfinddialog.cpp:29 33 | msgid "Find in page.." 34 | msgstr "在頁面中尋找.." 35 | 36 | #: src/chmfinddialog.cpp:32 37 | msgid "Whole words only" 38 | msgstr "全字拼寫須相符" 39 | 40 | #: src/chmfinddialog.cpp:33 41 | msgid "Case sensitive" 42 | msgstr "區分大小寫" 43 | 44 | #: src/chmfinddialog.cpp:42 45 | msgid "Find next" 46 | msgstr "找下一個" 47 | 48 | #: src/chmfinddialog.cpp:45 src/chmfontdialog.cpp:89 49 | msgid "Cancel" 50 | msgstr "取消" 51 | 52 | #: src/chmfontdialog.cpp:64 53 | msgid "Change fonts.." 54 | msgstr "變更字型.." 55 | 56 | #: src/chmfontdialog.cpp:71 57 | msgid "Normal font:" 58 | msgstr "正常字型:" 59 | 60 | #: src/chmfontdialog.cpp:72 61 | msgid "Fixed font:" 62 | msgstr "定寬字型:" 63 | 64 | #: src/chmfontdialog.cpp:78 65 | msgid "Preview:" 66 | msgstr "預覽:" 67 | 68 | #: src/chmfontdialog.cpp:84 69 | msgid "OK" 70 | msgstr "確定" 71 | 72 | #: src/chmframe.cpp:52 73 | msgid "Open a CHM book." 74 | msgstr "開啟 CHM 書冊。" 75 | 76 | #: src/chmframe.cpp:53 77 | msgid "Change fonts." 78 | msgstr "變更字型。" 79 | 80 | #: src/chmframe.cpp:54 81 | msgid "Print the page currently displayed." 82 | msgstr "列印目前顯示頁面。" 83 | 84 | #: src/chmframe.cpp:55 85 | msgid "Toggle table of contents." 86 | msgstr "" 87 | 88 | #: src/chmframe.cpp:56 89 | msgid "Go to the book's start page." 90 | msgstr "前往書冊首頁。" 91 | 92 | #: src/chmframe.cpp:57 93 | msgid "Go forward in history. Per book." 94 | msgstr "前往該書冊前方的瀏覽紀錄。" 95 | 96 | #: src/chmframe.cpp:58 97 | msgid "Back to the last visited page. Per book." 98 | msgstr "後退至該書冊之前的瀏覽頁面。" 99 | 100 | #: src/chmframe.cpp:59 101 | msgid "About the program." 102 | msgstr "關於此程式。" 103 | 104 | #: src/chmframe.cpp:60 105 | #, fuzzy 106 | msgid "Copy selection." 107 | msgstr "複製選擇範圍(&C)" 108 | 109 | #: src/chmframe.cpp:61 110 | #, fuzzy 111 | msgid "Find word in page." 112 | msgstr "在頁面中尋找.." 113 | 114 | #: src/chmframe.cpp:62 115 | msgid "Toggle fullscreen mode." 116 | msgstr "" 117 | 118 | #: src/chmframe.cpp:63 119 | msgid "Toggle toolbar." 120 | msgstr "" 121 | 122 | #: src/chmframe.cpp:64 123 | msgid "Close the current tab" 124 | msgstr "" 125 | 126 | #: src/chmframe.cpp:65 127 | #, fuzzy 128 | msgid "Open a new tab" 129 | msgstr "開啟 CHM 書冊。" 130 | 131 | #: src/chmframe.cpp:66 132 | msgid "Associate the .chm file extension with xCHM." 133 | msgstr "" 134 | 135 | #: src/chmframe.cpp:141 136 | msgid "Ready." 137 | msgstr "預備。" 138 | 139 | #: src/chmframe.cpp:165 src/chmframe.cpp:849 src/chmframe.cpp:853 140 | msgid "Contents" 141 | msgstr "內容" 142 | 143 | #: src/chmframe.cpp:166 144 | msgid "Index" 145 | msgstr "索引" 146 | 147 | #: src/chmframe.cpp:167 src/chmsearchpanel.cpp:45 148 | msgid "Search" 149 | msgstr "搜尋" 150 | 151 | #: src/chmframe.cpp:186 152 | msgid "About xCHM" 153 | msgstr "關於 xCHM" 154 | 155 | #: src/chmframe.cpp:191 156 | msgid "Choose a file.." 157 | msgstr "選擇一個檔案.." 158 | 159 | #: src/chmframe.cpp:201 src/chmframe.cpp:310 160 | msgid "Could not open file" 161 | msgstr "" 162 | 163 | #: src/chmframe.cpp:201 src/chmframe.cpp:310 src/chmhtmlwindow.cpp:268 164 | #: src/chmhtmlwindow.cpp:286 165 | msgid "Error" 166 | msgstr "" 167 | 168 | #: src/chmframe.cpp:270 169 | msgid "Confirm" 170 | msgstr "" 171 | 172 | #: src/chmframe.cpp:288 173 | msgid "Registration successful!" 174 | msgstr "" 175 | 176 | #: src/chmframe.cpp:288 177 | msgid "Done" 178 | msgstr "" 179 | 180 | #: src/chmframe.cpp:522 181 | msgid "Loading, please wait.." 182 | msgstr "" 183 | 184 | #: src/chmframe.cpp:625 185 | msgid "&Open..\tCtrl-O" 186 | msgstr "開啟(&O)..\tCtrl-O" 187 | 188 | #: src/chmframe.cpp:626 189 | msgid "&Print page..\tCtrl-P" 190 | msgstr "列印頁面(&P)..\tCtrl-P" 191 | 192 | #: src/chmframe.cpp:627 193 | #, fuzzy 194 | msgid "Fon&ts.." 195 | msgstr "字型 .." 196 | 197 | #: src/chmframe.cpp:629 198 | msgid "&Show contents tree\tCtrl-S" 199 | msgstr "顯示樹狀內容(&S)\tCtrl-S" 200 | 201 | #: src/chmframe.cpp:633 202 | msgid "&Make xCHM the default CHM viewer" 203 | msgstr "" 204 | 205 | #: src/chmframe.cpp:638 206 | msgid "&Recent files" 207 | msgstr "最近開檔紀錄(&R)" 208 | 209 | #: src/chmframe.cpp:650 210 | msgid "E&xit\tCtrl-X" 211 | msgstr "離開(&X)\tCtrl-X" 212 | 213 | #: src/chmframe.cpp:650 214 | msgid "Quit the application." 215 | msgstr "離開程式。" 216 | 217 | #: src/chmframe.cpp:654 218 | msgid "&Home\tCtrl-H" 219 | msgstr "首頁(&H)\tCtrl-H" 220 | 221 | #: src/chmframe.cpp:655 222 | #, fuzzy 223 | msgid "For&ward\tAlt-RIGHT" 224 | msgstr "前進(&W)\tCtrl-W" 225 | 226 | #: src/chmframe.cpp:656 227 | #, fuzzy 228 | msgid "&Back\tAlt-LEFT" 229 | msgstr "後退(&B)\tCtrl-B" 230 | 231 | #: src/chmframe.cpp:659 232 | msgid "&About..\tF1" 233 | msgstr "關於(&A)..\tF1" 234 | 235 | #: src/chmframe.cpp:662 236 | #, fuzzy 237 | msgid "&Copy\tCtrl-C" 238 | msgstr "首頁(&H)\tCtrl-H" 239 | 240 | #: src/chmframe.cpp:663 241 | #, fuzzy 242 | msgid "&Find..\tCtrl-F" 243 | msgstr "開啟(&O)..\tCtrl-O" 244 | 245 | #: src/chmframe.cpp:665 246 | #, fuzzy 247 | msgid "&Close tab\tCtrl-W" 248 | msgstr "首頁(&H)\tCtrl-H" 249 | 250 | #: src/chmframe.cpp:666 251 | #, fuzzy 252 | msgid "&New tab\tCtrl-T" 253 | msgstr "字型(&T)..\tCtrl-T" 254 | 255 | #: src/chmframe.cpp:669 256 | msgid "Toggle &fullscreen\tF11" 257 | msgstr "" 258 | 259 | #: src/chmframe.cpp:670 260 | msgid "Toggle &toolbar\tAlt-T" 261 | msgstr "" 262 | 263 | #: src/chmframe.cpp:673 264 | msgid "&File" 265 | msgstr "檔案(&F)" 266 | 267 | #: src/chmframe.cpp:674 268 | msgid "&View" 269 | msgstr "" 270 | 271 | #: src/chmframe.cpp:675 272 | msgid "&Edit" 273 | msgstr "" 274 | 275 | #: src/chmframe.cpp:676 276 | msgid "Hi&story" 277 | msgstr "歷史紀錄(&S)" 278 | 279 | #: src/chmframe.cpp:677 280 | msgid "&Help" 281 | msgstr "求助(&H)" 282 | 283 | #: src/chmframe.cpp:693 284 | msgid "Bookmarks" 285 | msgstr "書籤" 286 | 287 | #: src/chmframe.cpp:708 288 | msgid "Topics" 289 | msgstr "主題" 290 | 291 | #: src/chmframe.cpp:718 292 | msgid "Add" 293 | msgstr "加入" 294 | 295 | #: src/chmframe.cpp:719 296 | msgid "Remove" 297 | msgstr "移除" 298 | 299 | #: src/chmframe.cpp:722 300 | msgid "Add displayed page to bookmarks." 301 | msgstr "將所顯示的頁面加入至書籤。" 302 | 303 | #: src/chmframe.cpp:723 304 | msgid "Remove selected bookmark." 305 | msgstr "移除所選的書籤。" 306 | 307 | #: src/chmframe.cpp:844 308 | msgid "Open .." 309 | msgstr "開啟 .." 310 | 311 | #: src/chmframe.cpp:845 312 | msgid "Print .." 313 | msgstr "列印 .." 314 | 315 | #: src/chmframe.cpp:848 src/chmframe.cpp:852 316 | msgid "Fonts .." 317 | msgstr "字型 .." 318 | 319 | #: src/chmframe.cpp:857 320 | msgid "Copy" 321 | msgstr "" 322 | 323 | #: src/chmframe.cpp:858 324 | #, fuzzy 325 | msgid "Find" 326 | msgstr "找下一個" 327 | 328 | #: src/chmframe.cpp:863 src/chmframe.cpp:866 329 | msgid "Fullscreen" 330 | msgstr "" 331 | 332 | #: src/chmframe.cpp:871 333 | msgid "Back" 334 | msgstr "上一步" 335 | 336 | #: src/chmframe.cpp:872 337 | msgid "Forward" 338 | msgstr "下一步" 339 | 340 | #: src/chmframe.cpp:873 341 | msgid "Home" 342 | msgstr "首頁" 343 | 344 | #: src/chmframe.cpp:877 src/chmframe.cpp:879 345 | msgid "About" 346 | msgstr "關於" 347 | 348 | #: src/chmhtmlwindow.cpp:41 349 | msgid "For&ward" 350 | msgstr "前進(&W)" 351 | 352 | #: src/chmhtmlwindow.cpp:42 353 | msgid "&Back" 354 | msgstr "後退(&B)" 355 | 356 | #: src/chmhtmlwindow.cpp:43 357 | msgid "Copy &link location" 358 | msgstr "複製連結位置(_L)" 359 | 360 | #: src/chmhtmlwindow.cpp:44 361 | msgid "&Save link as.." 362 | msgstr "" 363 | 364 | #: src/chmhtmlwindow.cpp:45 365 | msgid "&Open in a new tab" 366 | msgstr "" 367 | 368 | #: src/chmhtmlwindow.cpp:48 369 | msgid "&Copy selection" 370 | msgstr "複製選擇範圍(&C)" 371 | 372 | #: src/chmhtmlwindow.cpp:50 373 | msgid "&Find in page.." 374 | msgstr "在頁面中尋找(&F).." 375 | 376 | #: src/chmhtmlwindow.cpp:52 377 | msgid "&Toggle fullscreen mode" 378 | msgstr "" 379 | 380 | #: src/chmhtmlwindow.cpp:268 381 | msgid "OpenFile(" 382 | msgstr "" 383 | 384 | #: src/chmhtmlwindow.cpp:268 385 | msgid ") failed" 386 | msgstr "" 387 | 388 | #: src/chmhtmlwindow.cpp:278 389 | msgid "Save as" 390 | msgstr "" 391 | 392 | #: src/chmhtmlwindow.cpp:286 393 | msgid "Error creating file " 394 | msgstr "" 395 | 396 | #: src/chmhtmlwindow.cpp:296 397 | msgid "Saved file " 398 | msgstr "" 399 | 400 | #: src/chmhtmlwindow.cpp:296 401 | msgid "Success" 402 | msgstr "" 403 | 404 | #: src/chmsearchpanel.cpp:43 405 | msgid "Get partial matches" 406 | msgstr "獲得部份相符" 407 | 408 | #: src/chmsearchpanel.cpp:44 409 | msgid "Search titles only" 410 | msgstr "只搜尋標題" 411 | 412 | #: src/chmsearchpanel.cpp:48 413 | msgid "Allow partial matches." 414 | msgstr "允許部份相符。" 415 | 416 | #: src/chmsearchpanel.cpp:49 417 | msgid "Only search in the contents' titles." 418 | msgstr "只在內容的標題中搜尋。" 419 | 420 | #: src/chmsearchpanel.cpp:50 421 | msgid "Search contents for occurrences of the specified text." 422 | msgstr "在內容中搜尋特定文字的出現。" 423 | 424 | #, fuzzy 425 | #~ msgid "Open all" 426 | #~ msgstr "開啟 .." 427 | 428 | #~ msgid "Font size:" 429 | #~ msgstr "字型大小:" 430 | 431 | #~ msgid "On or off?" 432 | #~ msgstr "開或關?" 433 | 434 | #~ msgid "Couldn't extract the book contents tree." 435 | #~ msgstr "無法解開書冊的樹狀內容。" 436 | 437 | #~ msgid "No contents.." 438 | #~ msgstr "無內容" 439 | -------------------------------------------------------------------------------- /rc/xchm.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzvncj/xCHM/0f81da0f34b600cbc4282df093b2d132133ef6e2/rc/xchm.ico -------------------------------------------------------------------------------- /rc/xchm.rc: -------------------------------------------------------------------------------- 1 | aaaa ICON DISCARDABLE "xchm.ico" 2 | #include 3 | 4 | -------------------------------------------------------------------------------- /src/.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: WebKit 2 | IndentWidth: 4 3 | AlignAfterOpenBracket: true 4 | AlignConsecutiveAssignments: true 5 | AlignConsecutiveDeclarations: true 6 | AlignEscapedNewlines: Left 7 | AlignTrailingComments: true 8 | AllowShortFunctionsOnASingleLine: InlineOnly 9 | ReflowComments: true 10 | IndentCaseLabels: false 11 | ColumnLimit: 120 12 | BreakConstructorInitializers: BeforeColon 13 | Cpp11BracedListStyle: true 14 | Language: Cpp 15 | NamespaceIndentation: None 16 | Standard: Cpp11 17 | SpacesInParentheses: false 18 | SpaceInEmptyParentheses: false 19 | SpaceInEmptyBlock: false 20 | IndentWrappedFunctionNames: false 21 | SortIncludes: true 22 | SpaceBeforeAssignmentOperators: true 23 | AlwaysBreakBeforeMultilineStrings: true 24 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = -I$(top_srcdir)/art 2 | 3 | bin_PROGRAMS = xchm 4 | 5 | xchm_SOURCES = chmapp.cpp chmfile.cpp chmframe.cpp chmfshandler.cpp \ 6 | chminputstream.cpp chmfontdialog.cpp chmhtmlnotebook.cpp \ 7 | chmsearchpanel.cpp chmhtmlwindow.cpp chmfinddialog.cpp \ 8 | chmindexpanel.cpp chmlistctrl.cpp hhcparser.cpp 9 | 10 | noinst_HEADERS = chmapp.h chmfile.h chmframe.h chmfshandler.h \ 11 | chminputstream.h chmfontdialog.h chmhtmlnotebook.h \ 12 | chmsearchpanel.h chmhtmlwindow.h wxstringutils.h \ 13 | chmfinddialog.h chmindexpanel.h chmlistctrl.h hhcparser.h \ 14 | xchm_chm_lib.h lzx.h 15 | 16 | if ENABLE_BUILTIN_CHMLIB 17 | xchm_SOURCES += chm_lib.c lzx.c 18 | endif 19 | 20 | xchm_LDADD = @LINKOPT@ 21 | #xchm_LDFLAGS=-pg 22 | 23 | #all-local: 24 | # @REZ_COMMAND@ 25 | 26 | -------------------------------------------------------------------------------- /src/chmapp.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2003 - 2024 Razvan Cojocaru 3 | XML-RPC/Context ID code contributed by Eamon Millman / PCI Geomatics 4 | 5 | Mac OS patches contributed by Mojca Miklavec 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 20 | MA 02110-1301, USA. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | #ifdef __WXMAC__ 36 | #include 37 | #endif 38 | 39 | #ifdef WITH_LIBXMLRPC 40 | 41 | constexpr int TIMER_ID {wxID_HIGHEST + 1}; 42 | 43 | XmlRpc::XmlRpcServer& getXmlRpcServer() 44 | { 45 | static XmlRpc::XmlRpcServer s; 46 | return s; 47 | } 48 | 49 | CHMApp::CHMApp() : XmlRpc::XmlRpcServerMethod("xCHM", &getXmlRpcServer()) 50 | { 51 | } 52 | 53 | void CHMApp::execute(XmlRpc::XmlRpcValue& params, XmlRpc::XmlRpcValue& result) 54 | { 55 | using namespace XmlRpc; 56 | 57 | result = false; 58 | 59 | if (params.size() > 0 && params[0].getType() == XmlRpcValue::TypeInt) 60 | switch (int(params[0])) { 61 | 62 | case 0: // we want to shut everything down! 63 | ExitMainLoop(); 64 | result = true; 65 | break; 66 | 67 | case 1: 68 | if (params.size() == 2 && params[1].getType() == XmlRpcValue::TypeString) 69 | result = _frame->LoadCHM(CURRENT_CHAR_STRING(std::string(params[1]).c_str())); 70 | 71 | if (params.size() == 3 && params[1].getType() == XmlRpcValue::TypeString 72 | && params[2].getType() == XmlRpcValue::TypeInt) 73 | result = _frame->LoadCHM(CURRENT_CHAR_STRING(std::string(params[1]).c_str())) 74 | && _frame->LoadContextID(int(params[2])); 75 | break; 76 | 77 | case 2: 78 | if (params.size() == 2 && params[1].getType() == XmlRpcValue::TypeInt) 79 | result = _frame->LoadContextID(int(params[1])); 80 | break; 81 | } 82 | } 83 | #endif 84 | 85 | bool CHMApp::OnInit() 86 | { 87 | auto id = -1L; 88 | wxString file; 89 | 90 | #if wxCHECK_VERSION(3, 1, 1) 91 | wxStandardPaths::Get().SetFileLayout(wxStandardPaths::FileLayout_XDG); 92 | #endif 93 | 94 | _cmdLP.SetCmdLine(argc, argv); 95 | 96 | _cmdLP.AddParam(wxT("file"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL); 97 | _cmdLP.AddOption(wxT("c"), wxT("contextid"), wxT("context-Id to open in file, requires that a file be specified"), 98 | wxCMD_LINE_VAL_NUMBER); 99 | #ifdef WITH_LIBXMLRPC 100 | _cmdLP.AddOption(wxT("x"), wxT("xmlrpc"), wxT("starts xCHM in XML-RPC server mode listening on port "), 101 | wxCMD_LINE_VAL_NUMBER); 102 | #endif 103 | 104 | _cmdLP.AddSwitch(wxT("t"), wxT("notopics"), wxT("don't load the topics tree")); 105 | _cmdLP.AddSwitch(wxT("i"), wxT("noindex"), wxT("don't load the index")); 106 | _cmdLP.AddSwitch(wxT("h"), wxT("help"), wxT("displays this message."), wxCMD_LINE_OPTION_HELP); 107 | 108 | if (_cmdLP.Parse() != 0) // 0 means everything is ok 109 | return false; 110 | 111 | auto loadTopics = !_cmdLP.Found(wxT("notopics")); 112 | auto loadIndex = !_cmdLP.Found(wxT("noindex")); 113 | 114 | #ifdef WITH_LIBXMLRPC 115 | auto port = -1L; 116 | 117 | // catch the xmlrpc setup if desired 118 | _cmdLP.Found(wxT("xmlrpc"), &port); 119 | #endif 120 | 121 | if (_cmdLP.GetParamCount() == 1) { 122 | file = _cmdLP.GetParam(0); 123 | _cmdLP.Found(wxT("contextid"), &id); 124 | 125 | } else if (_cmdLP.Found(wxT("contextid"))) { 126 | // can't use a context-ID without a file! 127 | _cmdLP.Usage(); 128 | return false; 129 | } 130 | 131 | auto xorig = 50L, yorig = 50L, width = 600L, height = 450L; 132 | long sashPos {CONTENTS_MARGIN}, fontSize {CHM_DEFAULT_FONT_SIZE}; 133 | wxString lastOpenedDir, normalFont, fixedFont; 134 | 135 | #if !defined(__WXMAC__) && !defined(__WXMSW__) 136 | _loc.Init(); 137 | _loc.AddCatalog(wxT("xchm")); 138 | #endif 139 | 140 | wxInitAllImageHandlers(); 141 | wxFileSystem::AddHandler(new CHMFSHandler); 142 | wxFileSystem::AddHandler(new wxInternetFSHandler); 143 | wxFileSystem::AddHandler(new wxMemoryFSHandler); 144 | 145 | wxConfig config(wxT("xchm")); 146 | if (config.Read(wxT("/Position/xOrig"), &xorig)) { 147 | config.Read(wxT("/Position/yOrig"), &yorig); 148 | config.Read(wxT("/Position/width"), &width); 149 | config.Read(wxT("/Position/height"), &height); 150 | config.Read(wxT("/Paths/lastOpenedDir"), &lastOpenedDir); 151 | config.Read(wxT("/Fonts/normalFontFace"), &normalFont); 152 | config.Read(wxT("/Fonts/fixedFontFace"), &fixedFont); 153 | config.Read(wxT("/Fonts/size"), &fontSize); 154 | config.Read(wxT("/Sash/leftMargin"), &sashPos); 155 | } 156 | 157 | wxString fullAppPath; 158 | 159 | if (argc > 0) 160 | fullAppPath = getAppPath(argv[0], wxGetCwd()); 161 | 162 | _frame = new CHMFrame(wxT("xCHM v. ") wxT(VERSION), lastOpenedDir, wxPoint(xorig, yorig), wxSize(width, height), 163 | normalFont, fixedFont, fontSize, sashPos, fullAppPath, loadTopics, loadIndex); 164 | 165 | _frame->SetSizeHints(200, 200); 166 | _frame->Show(true); 167 | SetTopWindow(_frame); 168 | 169 | #ifdef WITH_LIBXMLRPC 170 | if (port != -1L) { 171 | _timer.SetOwner(this, TIMER_ID); 172 | _timer.Start(100); 173 | getXmlRpcServer().bindAndListen(port); 174 | } 175 | #endif 176 | 177 | if (_cmdLP.GetParamCount() == 1) { 178 | if (!_frame->LoadCHM(file)) { 179 | wxMessageBox(_("Could not open file") + " " + file, _("Error"), wxOK | wxCENTRE | wxICON_ERROR, _frame); 180 | return true; 181 | } 182 | 183 | if (id != -1L) 184 | _frame->LoadContextID(id); 185 | } 186 | 187 | return true; 188 | } 189 | 190 | wxString CHMApp::getAppPath(const wxString& argv0, const wxString& cwd) 191 | { 192 | if (wxIsAbsolutePath(argv0)) 193 | return argv0; 194 | 195 | auto cwdtmp = cwd; 196 | 197 | if (cwdtmp.Last() != wxFILE_SEP_PATH) 198 | cwdtmp += wxFILE_SEP_PATH; 199 | 200 | auto apppath = cwdtmp + argv0; 201 | 202 | if (wxFileExists(apppath)) 203 | return apppath; 204 | 205 | wxPathList pathList; 206 | pathList.AddEnvList(wxT("PATH")); 207 | apppath = pathList.FindAbsoluteValidPath(argv0); 208 | 209 | if (!apppath.IsEmpty()) 210 | return wxPathOnly(apppath); 211 | 212 | return wxEmptyString; 213 | } 214 | 215 | #ifdef __WXMAC__ 216 | void CHMApp::MacOpenFile(const wxString& filename) 217 | { 218 | _frame->LoadCHM(filename); 219 | } 220 | #endif 221 | 222 | #ifdef WITH_LIBXMLRPC 223 | void CHMApp::WatchForXMLRPC(wxTimerEvent&) 224 | { 225 | getXmlRpcServer().work(0.0); // check for a XMLRPC message 226 | } 227 | #endif 228 | 229 | #ifdef WITH_LIBXMLRPC 230 | BEGIN_EVENT_TABLE(CHMApp, wxApp) 231 | EVT_TIMER(TIMER_ID, CHMApp::WatchForXMLRPC) 232 | END_EVENT_TABLE() 233 | #endif 234 | 235 | // Apparently this macro gets main() pumping. 236 | IMPLEMENT_APP(CHMApp) 237 | -------------------------------------------------------------------------------- /src/chmapp.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2003 - 2024 Razvan Cojocaru 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef __CHMAPP_H_ 21 | #define __CHMAPP_H_ 22 | 23 | #ifdef HAVE_CONFIG_H 24 | #include 25 | #endif 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | #ifdef WITH_LIBXMLRPC 32 | #include 33 | #endif 34 | 35 | // Forward declaration. 36 | class CHMFrame; 37 | 38 | /*! 39 | \class wxApp 40 | \brief wxWidgets application class. 41 | */ 42 | 43 | //! This is the application class. 44 | #ifdef WITH_LIBXMLRPC 45 | class CHMApp : public wxApp, public XmlRpc::XmlRpcServerMethod { 46 | #else 47 | class CHMApp : public wxApp { 48 | #endif 49 | 50 | #ifdef WITH_LIBXMLRPC 51 | public: 52 | //! Default constructor, also links the XMLRPC method 53 | CHMApp(); 54 | #endif 55 | 56 | private: 57 | //! Our entry point into the application. 58 | bool OnInit() override; 59 | 60 | #ifdef __WXMAC__ 61 | //! Respond to Apple Event for opening a document 62 | void MacOpenFile(const wxString& filename) override; 63 | #endif 64 | 65 | #ifdef WITH_LIBXMLRPC 66 | //! Handles actual XMLRPC requests and parameter parsing. 67 | void execute(XmlRpc::XmlRpcValue& params, XmlRpc::XmlRpcValue& result); 68 | 69 | //! Watches for XMLRPC requests 70 | void WatchForXMLRPC(wxTimerEvent& event); 71 | #endif 72 | 73 | // Try to figure out the absolute file path of the executable. 74 | wxString getAppPath(const wxString& argv0, const wxString& cwd); 75 | 76 | private: 77 | CHMFrame* _frame {nullptr}; 78 | wxLocale _loc; 79 | #ifdef WITH_LIBXMLRPC 80 | wxTimer _timer; 81 | #endif 82 | wxCmdLineParser _cmdLP; 83 | #ifdef WITH_LIBXMLRPC 84 | DECLARE_EVENT_TABLE() 85 | #endif 86 | }; 87 | 88 | #endif // __CHMAPP_H_ 89 | -------------------------------------------------------------------------------- /src/chmfile.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2003 - 2024 Razvan Cojocaru 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef __CHMFILE_H_ 21 | #define __CHMFILE_H_ 22 | 23 | #ifdef HAVE_CONFIG_H 24 | #include 25 | #endif 26 | 27 | #include 28 | #ifdef ENABLE_BUILTIN_CHMLIB 29 | #include "xchm_chm_lib.h" 30 | #else 31 | #include 32 | #endif 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | // Forward declarations. 41 | class wxTreeCtrl; 42 | class CHMListCtrl; 43 | class wxCSConv; 44 | 45 | using UCharVector = std::vector; 46 | 47 | //! Declares a class called CHMSearchResults - hashmap. 48 | WX_DECLARE_STRING_HASH_MAP(wxString, CHMSearchResults); 49 | //! Declares a class called CHMIDMap - hashmap. 50 | WX_DECLARE_HASH_MAP(int, wxString, wxIntegerHash, wxIntegerEqual, CHMIDMap); 51 | 52 | //! C++ wrapper around CHMLIB. Concrete class. 53 | class CHMFile { 54 | public: 55 | //! Default constructor. 56 | CHMFile() = default; 57 | 58 | /*! 59 | \brief This constructor attempts to open the .chm file passed as it's argument. If it fails, IsOk() will 60 | return false. 61 | \param archiveName The .chm filename on disk. 62 | */ 63 | explicit CHMFile(const wxString& archiveName); 64 | 65 | //! Destructor. If a file has been succesfully opened, it closes it. 66 | ~CHMFile(); 67 | 68 | /*! 69 | \brief Gets the name of the default page in the archive. 70 | \return The home page name, with a '/' added in front and relative to the root of the archive filesystem. If 71 | no .chm has been opened, the returned value is "/". 72 | */ 73 | wxString HomePage() const { return _home; } 74 | 75 | /*! 76 | \brief Gets the filename of the currently opened .chm file. 77 | \return The filename of the currently opened archive, relative to the root of the filesystem, or the empty string 78 | if no archive has been opened. 79 | */ 80 | wxString ArchiveName() const { return _filename; } 81 | 82 | /*! 83 | \brief Gets the name of the opened .chm. 84 | \return The name of the opened document, or an empty string if no .chm has been loaded. 85 | */ 86 | wxString Title() const { return _title; } 87 | 88 | /*! 89 | \brief Checks if the last attempt to load a .chm file was succesful. 90 | \return true, if the last attempt to load a .chm file was succesful, false otherwise. 91 | */ 92 | bool IsOk() const { return _chmFile; } 93 | 94 | //! Checks if a 'ms-its' link has been clicked and the chm changed. 95 | bool HasChanged(); 96 | 97 | /*! 98 | \brief Determines the encoding that the CHM creator would like me to use. To be used in combination with 99 | DefaultFont(). 100 | \return Desired encoding. 101 | */ 102 | wxFontEncoding DesiredEncoding() const { return _enc; } 103 | 104 | /*! 105 | \brief Determines the font to use for special charsets. 106 | \return Detected font recommendation. 107 | */ 108 | wxString DefaultFont() const { return _font; } 109 | 110 | /*! 111 | \brief Attempts to load a .chm file from disk. 112 | \param archiveName The .chm filename on disk. 113 | \return true on success, false on failure. 114 | */ 115 | bool LoadCHM(const wxString& archiveName); 116 | 117 | //! Closes the currently opened .chm, or does nothing if none opened. 118 | void CloseCHM(); 119 | 120 | /*! 121 | \brief Attempts to fill a wxTreeCtrl by parsing the topics file. 122 | \param toBuild Pointer to the tree to be filled. If the topics file is not available, the tree is unmodified. 123 | The tree must be empty before passing it to this function. 124 | \return true if it's possible to build the tree, false otherwise. 125 | */ 126 | bool GetTopicsTree(wxTreeCtrl& toBuild); 127 | 128 | /*! 129 | \brief Attempts to fill a CHMListCtrl by parsing the index file. 130 | \param toBuild Pointer to the list control to be filled. If the index file is not available, the list control 131 | is unmodified. The list must be empty before passing it to this function. 132 | \return true if it's possible to build the tree, false otherwise. 133 | */ 134 | bool GetIndex(CHMListCtrl& toBuild); 135 | 136 | /*! 137 | \brief Attempts to build an index of context-ID/page pairs from the file. 138 | \return true if it's possible to buld the tree, false otherwise. 139 | */ 140 | bool LoadContextIDs(); 141 | 142 | /*! 143 | \brief Checks whether or not the context ID is valid for the loaded file. 144 | \param contextID The context-ID to check. 145 | \return true if the context ID is valid. false otherwise. 146 | */ 147 | bool IsValidCID(int contextID); 148 | 149 | /*! 150 | \brief Looks up the page referred to by the context-ID 151 | \param contextID The context-ID to look up 152 | \return the page referred to by the context-ID, or file root"/" if ID is invalid. 153 | */ 154 | wxString GetPageByCID(int contextID); 155 | 156 | /*! 157 | \brief Fast search using the $FIftiMain file in the .chm. 158 | \param text The text we're looking for. 159 | \param wholeWords Are we looking for whole words only? 160 | \param titlesOnly Are we looking for titles only? 161 | \param results A string-string hashmap that will hold the results in case of successful search. The keys are 162 | the URLs and the values are the page titles. 163 | \return true if the search succeeded, false otherwise. 164 | */ 165 | bool IndexSearch(const wxString& text, bool wholeWords, bool titlesOnly, CHMSearchResults& results); 166 | 167 | /*! 168 | \brief Looks up fileName in the archive. 169 | \param fileName The file name to look up in the archive, qualified with '/' standing for the root of the archive 170 | filesystem. 171 | \param ui A pointer to CHMLIB specific data about the file. The parameter gets filled with useful data if the 172 | lookup was succesful. 173 | \return true if the file exists in the archive, false otherwise. 174 | */ 175 | bool ResolveObject(const wxString& fileName, chmUnitInfo* ui); 176 | 177 | /*! 178 | \brief Retrieves an uncompressed chunk of a file in the .chm. 179 | \param ui Pointer to a CHMLIB specific data structure obtained from a succesful call to ResolveObject(). 180 | \param buffer The buffer to place the chunk into. 181 | \param fileOffset Where does the chunk we want begin in the file? 182 | \param bufferSize The size of the buffer. 183 | \return 0 on error, length of chunk retrieved otherwise. 184 | */ 185 | size_t RetrieveObject(chmUnitInfo* ui, unsigned char* buffer, off_t fileOffset, size_t bufferSize); 186 | 187 | public: 188 | //! No copy construction allowed. 189 | CHMFile(const CHMFile&) = delete; 190 | 191 | //! No assignments. 192 | CHMFile& operator=(const CHMFile&) = delete; 193 | 194 | private: 195 | //! Helper. Translates from Win32 encodings to generic wxWidgets ones. 196 | wxFontEncoding GetFontEncFromCharSet(int cs); 197 | 198 | //! Helper. Translates from MS-specific LCID. 199 | wxFontEncoding GetFontEncFromLCID(uint32_t lcid); 200 | 201 | //! Helper. Initializes most of the private data members. 202 | bool GetArchiveInfo(); 203 | 204 | //! Helper. Returns the $FIftiMain offset of leaf node or 0. 205 | uint32_t GetLeafNodeOffset(const wxString& text, uint32_t initalOffset, uint32_t buffSize, uint16_t treeDepth, 206 | chmUnitInfo* ui); 207 | 208 | //! Helper. Processes the word location code entries while searching. 209 | bool ProcessWLC(uint64_t wlc_count, uint64_t wlc_size, uint32_t wlc_offset, unsigned char ds, unsigned char dr, 210 | unsigned char cs, unsigned char cr, unsigned char ls, unsigned char lr, chmUnitInfo* uifmain, 211 | chmUnitInfo* uitbl, chmUnitInfo* uistrings, chmUnitInfo* topics, chmUnitInfo* urlstr, 212 | CHMSearchResults& results); 213 | 214 | //! Looks up as much information as possible from #WINDOWS/#STRINGS. 215 | bool InfoFromWindows(); 216 | 217 | //! Looks up as much information as possible from #SYSTEM. 218 | bool InfoFromSystem(); 219 | 220 | //! Load binary TOC (if available) 221 | bool BinaryTOC(wxTreeCtrl& toBuild); 222 | 223 | //! Try to recursively load the binary topics tree 224 | void RecurseLoadBTOC(UCharVector& topidx, UCharVector& topics, UCharVector& strings, UCharVector& urltbl, 225 | UCharVector& urlstr, uint32_t offset, wxTreeCtrl& toBuild, int level); 226 | 227 | //! Retrieve the data (name/URL) for a single entry (TOC or index) 228 | bool GetItem(UCharVector& topics, UCharVector& strings, UCharVector& urltbl, UCharVector& urlstr, uint32_t index, 229 | wxTreeCtrl* tree, CHMListCtrl* list, const wxString& idxName, int level, bool local); 230 | 231 | //! Get the binary index (if available) 232 | bool BinaryIndex(CHMListCtrl& toBuild, const wxCSConv& cv); 233 | 234 | private: 235 | chmFile* _chmFile {nullptr}; 236 | wxString _filename; 237 | wxString _home {wxT("/")}; 238 | wxString _topicsFile; 239 | wxString _indexFile; 240 | wxString _title; 241 | wxString _font; 242 | wxFontEncoding _enc; 243 | CHMIDMap _cidMap; 244 | }; 245 | 246 | #endif // __CHMFILE_H_ 247 | -------------------------------------------------------------------------------- /src/chmfinddialog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2003 - 2024 Razvan Cojocaru 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | MA 02110-1301, USA. 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | CHMFindDialog::CHMFindDialog(wxWindow* parent, CHMHtmlWindow* toSearch) 29 | : wxDialog(parent, wxID_ANY, _("Find in page..")), _html(toSearch) 30 | { 31 | _text = new wxTextCtrl(this, ID_TextFind, wxEmptyString, wxDefaultPosition, wxSize(200, -1), wxTE_PROCESS_ENTER); 32 | _whole = new wxCheckBox(this, wxID_ANY, _("Whole words only")); 33 | _case = new wxCheckBox(this, wxID_ANY, _("Case sensitive")); 34 | 35 | auto sizer = new wxBoxSizer(wxVERTICAL); 36 | 37 | sizer->Add(_text, 0, wxLEFT | wxTOP | wxBOTTOM, 5); 38 | sizer->Add(_whole, 0, wxLEFT, 5); 39 | sizer->Add(_case, 0, wxLEFT | wxBOTTOM, 5); 40 | 41 | auto szButtons = new wxBoxSizer(wxVERTICAL); 42 | auto find = new wxButton(this, ID_FindNext, _("Find next")); 43 | 44 | szButtons->Add(find, 1, wxLEFT | wxRIGHT | wxTOP | wxEXPAND, 5); 45 | szButtons->Add(new wxButton(this, wxID_CANCEL, _("Cancel")), 1, wxLEFT | wxRIGHT | wxTOP | wxEXPAND, 5); 46 | 47 | auto topsizer = new wxBoxSizer(wxHORIZONTAL); 48 | 49 | topsizer->Add(sizer); 50 | topsizer->Add(szButtons); 51 | 52 | SetAutoLayout(true); 53 | SetSizer(topsizer); 54 | topsizer->Fit(this); 55 | Centre(wxBOTH); 56 | SetFocusToTextBox(); 57 | } 58 | 59 | void CHMFindDialog::OnFind(wxCommandEvent&) 60 | { 61 | _html->ClearSelection(); 62 | 63 | auto sr = _text->GetLineText(0); 64 | 65 | if (sr.IsEmpty()) 66 | return; 67 | 68 | wxStringTokenizer tkz(sr, wxT(" \t\r\n")); 69 | wxString word; 70 | 71 | while (word.IsEmpty()) 72 | if (tkz.HasMoreTokens()) 73 | word = tkz.GetNextToken(); 74 | 75 | if (!_case->IsChecked()) 76 | word.MakeLower(); 77 | 78 | if (!_cell || word.Cmp(_currWord.c_str())) { 79 | _cell = _html->FindFirst(_html->GetInternalRepresentation(), word, _whole->IsChecked(), _case->IsChecked()); 80 | _currWord = word; 81 | 82 | } else { 83 | if (_cell && _cell->GetNext()) 84 | _cell = _cell->GetNext(); 85 | else { 86 | while (_cell && !_cell->GetNext()) 87 | _cell = _cell->GetParent(); 88 | 89 | if (_cell) 90 | _cell = _cell->GetNext(); 91 | } 92 | 93 | if (!_cell) 94 | return; 95 | 96 | _cell = _html->FindNext(_cell, word, _whole->IsChecked(), _case->IsChecked()); 97 | 98 | // Wrap around. 99 | if (!_cell) 100 | _cell = _html->FindFirst(_html->GetInternalRepresentation(), word, _whole->IsChecked(), _case->IsChecked()); 101 | } 102 | } 103 | 104 | BEGIN_EVENT_TABLE(CHMFindDialog, wxDialog) 105 | EVT_TEXT_ENTER(ID_TextFind, CHMFindDialog::OnFind) 106 | EVT_BUTTON(ID_FindNext, CHMFindDialog::OnFind) 107 | END_EVENT_TABLE() 108 | -------------------------------------------------------------------------------- /src/chmfinddialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2003 - 2024 Razvan Cojocaru 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef __CHMFINDDIALOG_H 21 | #define __CHMFINDDIALOG_H 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | // Forward declarations. 28 | class wxCheckBox; 29 | class CHMHtmlWindow; 30 | 31 | //! Event IDs. 32 | enum { 33 | ID_TextFind = 1408, 34 | ID_FindNext, 35 | }; 36 | 37 | //! Dialog for finding a word in the currently displayed page. 38 | class CHMFindDialog : public wxDialog { 39 | public: 40 | //! Initializes the dialog. 41 | CHMFindDialog(wxWindow* parent, CHMHtmlWindow* toSearch); 42 | 43 | //! Sets the focus to the textbox. 44 | void SetFocusToTextBox() { _text->SetFocusFromKbd(); } 45 | 46 | //! Resets the word to be found, so 'Find next' will start over. 47 | void Reset() { _cell = nullptr; } 48 | 49 | protected: 50 | //! Called when the user clicks the 'Find next' button. 51 | void OnFind(wxCommandEvent& event); 52 | 53 | private: 54 | CHMHtmlWindow* _html; 55 | wxTextCtrl* _text; 56 | wxCheckBox* _whole; 57 | wxCheckBox* _case; 58 | wxString _currWord; 59 | wxHtmlCell* _cell {nullptr}; 60 | 61 | private: 62 | DECLARE_EVENT_TABLE(); 63 | }; 64 | 65 | #endif // __CHMFINDDIALOG_H 66 | -------------------------------------------------------------------------------- /src/chmfontdialog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2003 - 2024 Razvan Cojocaru 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | MA 02110-1301, USA. 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | namespace { 28 | 29 | const wxChar* test_page = wxT(R"( 30 | 31 | 32 | 33 | 34 | 35 | 45 | 55 | 56 |
Normal face
(and underlined. Italic face. Bold face. Bold 36 | italic face.
37 | font size -2
38 | font size -1
39 | font size +0
40 | font size +1
41 | font size +2
42 | font size +3
43 | font size +4 44 |
Fixed size face.
bold italic bold italic 46 | underlined
47 | font size -2
48 | font size -1
49 | font size +0
50 | font size +1
51 | font size +2
52 | font size +3
53 | font size +4 54 |
57 | 58 | 59 | )"); 60 | 61 | } 62 | 63 | CHMFontDialog::CHMFontDialog(wxWindow* parent, const wxString& normalFont, const wxString& fixedFont, int fontSize) 64 | : wxDialog(parent, wxID_ANY, _("Change fonts..")), 65 | _normalFont(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, normalFont), 66 | _fixedFont(fontSize, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, fixedFont) 67 | { 68 | auto topsizer = new wxBoxSizer(wxVERTICAL); 69 | auto sizer = new wxFlexGridSizer(2, 2, 2, 5); 70 | 71 | sizer->Add(new wxStaticText(this, wxID_ANY, _("Normal font:"))); 72 | sizer->Add(new wxStaticText(this, wxID_ANY, _("Fixed font:"))); 73 | 74 | sizer->Add(_normalFControl = new wxFontPickerCtrl(this, wxID_ANY, _normalFont, wxDefaultPosition, wxSize(200, -1))); 75 | sizer->Add(_fixedFControl = new wxFontPickerCtrl(this, wxID_ANY, _fixedFont, wxDefaultPosition, wxSize(200, -1))); 76 | 77 | topsizer->Add(sizer, 0, wxLEFT | wxRIGHT | wxTOP, 10); 78 | topsizer->Add(new wxStaticText(this, wxID_ANY, _("Preview:")), 0, wxLEFT | wxTOP, 10); 79 | topsizer->Add(_test = new wxHtmlWindow(this, wxID_ANY, wxDefaultPosition, wxSize(20, 150), 80 | wxHW_SCROLLBAR_AUTO | wxSUNKEN_BORDER), 81 | 1, wxEXPAND | wxLEFT | wxTOP | wxRIGHT, 10); 82 | 83 | auto sizer2 = new wxBoxSizer(wxHORIZONTAL); 84 | auto ok = new wxButton(this, wxID_OK, _("OK")); 85 | 86 | sizer2->Add(ok, 0, wxALL, 10); 87 | ok->SetDefault(); 88 | 89 | sizer2->Add(new wxButton(this, wxID_CANCEL, _("Cancel")), 0, wxALL, 10); 90 | topsizer->Add(sizer2, 0, wxALIGN_RIGHT); 91 | 92 | SetAutoLayout(true); 93 | SetSizer(topsizer); 94 | topsizer->Fit(this); 95 | Centre(wxBOTH); 96 | 97 | UpdatePreview(); 98 | } 99 | 100 | void CHMFontDialog::UpdatePreview() 101 | { 102 | if (!_test) // this can happen with wxMSW 103 | return; 104 | 105 | wxBusyCursor bc; 106 | 107 | auto parent = dynamic_cast(GetParent()); 108 | auto sizes = parent->ComputeFontSizes(_normalFont.GetPointSize()); 109 | 110 | _test->SetFonts(_normalFont.GetFaceName(), _fixedFont.GetFaceName(), sizes.data()); 111 | _test->SetPage(test_page); 112 | } 113 | 114 | void CHMFontDialog::OnUpdate(wxFontPickerEvent& event) 115 | { 116 | _normalFont = _normalFControl->GetSelectedFont(); 117 | _fixedFont = _fixedFControl->GetSelectedFont(); 118 | 119 | _normalFont.SetPointSize(event.GetFont().GetPointSize()); 120 | _fixedFont.SetPointSize(event.GetFont().GetPointSize()); 121 | 122 | UpdatePreview(); 123 | } 124 | 125 | BEGIN_EVENT_TABLE(CHMFontDialog, wxDialog) 126 | EVT_FONTPICKER_CHANGED(wxID_ANY, CHMFontDialog::OnUpdate) 127 | END_EVENT_TABLE() 128 | -------------------------------------------------------------------------------- /src/chmfontdialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2003 - 2024 Razvan Cojocaru 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef __CHMFONTDIALOG_H 21 | #define __CHMFONTDIALOG_H 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | /*! 28 | \class wxDialog 29 | \brief wxWidgets generic dialog class. 30 | */ 31 | 32 | //! Custom font chooser dialog class. 33 | class CHMFontDialog : public wxDialog { 34 | public: 35 | /*! 36 | \brief Constructs a CHMFontDialog. 37 | \param parent The parent window. 38 | \param normalFont The normal font currently in use by the caller. 39 | \param fixedFont The fixed font currently in use by the caller. 40 | \param fontSize The size of the font currently selected. 41 | */ 42 | CHMFontDialog(wxWindow* parent, const wxString& normalFont, const wxString& fixedFont, int fontSize); 43 | 44 | //! Returns the fixed font face name. 45 | wxString FixedFont() const { return _fixedFont.GetFaceName(); } 46 | 47 | //! Return the selected font size. 48 | int FontSize() const { return _normalFont.GetPointSize(); } 49 | //! Returns the normal font face name. 50 | wxString NormalFont() const { return _normalFont.GetFaceName(); } 51 | 52 | protected: 53 | //! This is called when a font is selected from the combo box. 54 | void OnUpdate(wxFontPickerEvent& event); 55 | 56 | private: 57 | //! Helper. Updates the font preview window. 58 | void UpdatePreview(); 59 | 60 | private: 61 | wxHtmlWindow* _test {nullptr}; 62 | wxFontPickerCtrl* _normalFControl {nullptr}; 63 | wxFontPickerCtrl* _fixedFControl {nullptr}; 64 | 65 | wxFont _normalFont; 66 | wxFont _fixedFont; 67 | 68 | private: 69 | DECLARE_EVENT_TABLE(); 70 | }; 71 | 72 | #endif // __CHMFONTDIALOG_H 73 | -------------------------------------------------------------------------------- /src/chmframe.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2003 - 2024 Razvan Cojocaru 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef __CHMFRAME_H_ 21 | #define __CHMFRAME_H_ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | // Forward declarations. 37 | class CHMHtmlWindow; 38 | class CHMSearchPanel; 39 | class CHMIndexPanel; 40 | class wxFileType; 41 | class CHMHtmlNotebook; 42 | 43 | #ifdef HAVE_CONFIG_H 44 | #include 45 | #else 46 | // this should never happen 47 | #define VERSION "unknown" 48 | #endif 49 | 50 | //! Default font size for the wxHtmlWindow. 51 | constexpr int CHM_DEFAULT_FONT_SIZE {12}; 52 | 53 | //! Default sash position. 54 | constexpr int CONTENTS_MARGIN {170}; 55 | 56 | //! IDs for various widget events. 57 | enum { 58 | ID_Quit = 1, 59 | ID_About, 60 | ID_Open, 61 | ID_Fonts, 62 | ID_Print, 63 | ID_Home, 64 | ID_Forward, 65 | ID_Back, 66 | ID_Contents, 67 | ID_Bookmarks, 68 | ID_Add, 69 | ID_Remove, 70 | ID_FindInPage, 71 | ID_CopySelection, 72 | ID_Recent, 73 | ID_Notebook, 74 | ID_RegisterExtension, 75 | ID_CloseTab, 76 | ID_NewTab, 77 | ID_FullScreen, 78 | ID_ToggleToolbar, 79 | ID_TreeCtrl = 1000, 80 | }; 81 | 82 | /*! 83 | \class wxFrame 84 | \brief wxWidgets frame widget class. 85 | */ 86 | 87 | using FontSizesArray = std::array; 88 | 89 | //! The frame, owner of the wxHtmlWindow, contents tree control and all the other nifty stuff. 90 | class CHMFrame : public wxFrame { 91 | 92 | public: 93 | /*! 94 | \brief Brings the frame into existence. 95 | \param title The text that shows up on the titlebar. 96 | \param booksDir Where to go when you click Open.. on the toolbar. This is used to remember the last directory 97 | where a book was sucessfully opened. For the current working directory just pass the empty string. 98 | \param pos The upper left corner of the frame. 99 | \param size The size of the frame. 100 | \param normalFont Name of the font face to use for normal text. 101 | \param fixedFont Name of the font face to use for fixed text. 102 | \param fontSize The font size. 103 | \param sashPosition Distance from the left of the frame to 104 | \param fullAppPath The absolute path to the executable of the process the end of the contents / search panel. 105 | \param loadTopics If set to false, don't try to load the topics tree. 106 | \param loadIndex If set to false, don't try to load the index list. 107 | */ 108 | CHMFrame(const wxString& title, const wxString& booksDir, const wxPoint& pos, const wxSize& size, 109 | const wxString& normalFont = wxEmptyString, const wxString& fixedFont = wxEmptyString, 110 | int fontSize = CHM_DEFAULT_FONT_SIZE, int sashPosition = CONTENTS_MARGIN, 111 | const wxString& fullAppPath = wxEmptyString, bool loadTopics = true, bool loadIndex = true); 112 | 113 | //! Cleans up. 114 | ~CHMFrame(); 115 | 116 | /*! 117 | \brief Attempts to load a .chm file and display it's home page. 118 | \param archive The .chm file name on disk. 119 | \return true if the operation was successful. 120 | */ 121 | bool LoadCHM(const wxString& archive); 122 | 123 | /*! 124 | \brief Attempts to load a context-ID from within the current chm file 125 | \param contextID the context-ID to load. 126 | \return true if the operation was successful. 127 | */ 128 | bool LoadContextID(int contextID); 129 | 130 | //! Fills the index and the contents tree. 131 | void UpdateCHMInfo(); 132 | 133 | //! Add html view 134 | void AddHtmlView(const wxString& path, const wxString& link); 135 | 136 | //! Toggles fullscreen mode 137 | void ToggleFullScreen(bool onlyIfFullScreenOn = false); 138 | 139 | FontSizesArray ComputeFontSizes(int size) const; 140 | 141 | protected: 142 | //! Called when the user closes the window. 143 | void OnQuit(wxCommandEvent& event); 144 | 145 | //! Called when the user clicks on About. 146 | void OnAbout(wxCommandEvent& event); 147 | 148 | //! Called when the user wants to open a file. 149 | void OnOpen(wxCommandEvent& event); 150 | 151 | //! Called when the user wants to change the fonts. 152 | void OnChangeFonts(wxCommandEvent& event); 153 | 154 | //! Called when the user wants to see the default page. 155 | void OnHome(wxCommandEvent& event); 156 | 157 | //! Called when the user wants to go forward in the history. 158 | void OnHistoryForward(wxCommandEvent& event); 159 | 160 | //! Called when the user wants to go back in the history. 161 | void OnHistoryBack(wxCommandEvent& event); 162 | 163 | //! Called when the user wants to either disable or enable the contents tree panel on the left. 164 | void OnShowContents(wxCommandEvent& event); 165 | 166 | //! Called when the user wants to print the displayed page. 167 | void OnPrint(wxCommandEvent& event); 168 | 169 | //! Called when the user selects a file from the file history. 170 | void OnHistFile(wxCommandEvent& event); 171 | 172 | //! Called when the user types Ctrl-F. 173 | void OnFind(wxCommandEvent& event); 174 | 175 | //! Called when the user types Ctrl-F. 176 | void OnCopySelection(wxCommandEvent& event); 177 | 178 | //! Called when fullscreen mode is being toggled 179 | void OnToggleFullScreen(wxCommandEvent& event); 180 | 181 | //! Called when the toolbar is being toggled 182 | void OnToggleToolbar(wxCommandEvent& event); 183 | 184 | //! Called when the user clicks on the Add button. 185 | void OnAddBookmark(wxCommandEvent& event); 186 | 187 | #if defined(__WXMSW__) || defined(__WXMAC__) 188 | //! Called when the user selects Register extension 189 | void OnRegisterExtension(wxCommandEvent& event); 190 | #endif // __WXMSW__ 191 | 192 | //! Called when the user clicks on the Remove button. 193 | void OnRemoveBookmark(wxCommandEvent& event); 194 | 195 | //! Called when the user chooses a bookmark from the wxChoice control. 196 | void OnBookmarkSel(wxCommandEvent& event); 197 | 198 | //! Called when an item in the contents tree is clicked. 199 | void OnSelectionChanged(wxTreeEvent& event); 200 | 201 | //! Cleanup code. This saves the window position and last open dir. 202 | void OnCloseWindow(wxCloseEvent& event); 203 | 204 | //! Called when the user presses a key 205 | void OnChar(wxKeyEvent& event); 206 | 207 | //! Called when the user types Ctrl-F4. 208 | void OnCloseTab(wxCommandEvent& event); 209 | 210 | //! Called when the user types Ctrl-N. 211 | void OnNewTab(wxCommandEvent& event); 212 | 213 | private: 214 | //! Helper. Creates the menu. 215 | wxMenuBar* CreateMenu(); 216 | 217 | //! Helper. Initializes the frame toolbar. 218 | bool InitToolBar(wxToolBar* toolbar); 219 | 220 | //! Helper. Creates the contents panel. 221 | wxPanel* CreateContentsPanel(); 222 | 223 | //! Helper. Loads the bookmarks for the currently opened CHM file. 224 | void LoadBookmarks(); 225 | 226 | //! Helper. Saves the bookmarks for the currently opened CHM file. 227 | void SaveBookmarks(); 228 | 229 | //! Helper. Saves exit information (size, history, etc.) 230 | void SaveExitInfo(); 231 | 232 | private: 233 | CHMHtmlNotebook* _nbhtml; 234 | wxTreeCtrl* _tcl {nullptr}; 235 | wxSplitterWindow* _sw {nullptr}; 236 | wxMenu* _menuFile {nullptr}; 237 | wxToolBar* _tb {nullptr}; 238 | std::unique_ptr _ep; 239 | wxNotebook* _nb {nullptr}; 240 | wxComboBox* _cb {nullptr}; 241 | CHMSearchPanel* _csp {nullptr}; 242 | CHMIndexPanel* _cip {nullptr}; 243 | 244 | wxString _openPath; 245 | wxString _normalFont; 246 | wxString _fixedFont; 247 | bool _bookmarkSel {true}; 248 | bool _bookmarksDeleted {false}; 249 | int _sashPos; 250 | wxFont _font; 251 | wxFileHistory _fh; 252 | wxString _fullAppPath; 253 | bool _loadTopics; 254 | bool _loadIndex; 255 | bool _fullScreen {false}; 256 | 257 | private: 258 | DECLARE_EVENT_TABLE() 259 | }; 260 | 261 | #endif // __CHMFRAME_H_ 262 | -------------------------------------------------------------------------------- /src/chmfshandler.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2003 - 2024 Razvan Cojocaru 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | MA 02110-1301, USA. 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | CHMFSHandler::~CHMFSHandler() 24 | { 25 | CHMInputStream::Cleanup(); 26 | } 27 | 28 | bool CHMFSHandler::CanOpen(const wxString& location) 29 | { 30 | auto p = GetProtocol(location); 31 | return (p == wxT("xchm") && GetProtocol(GetLeftLocation(location)) == wxT("file")) 32 | || !location.Left(6).CmpNoCase(wxT("MS-ITS")); 33 | } 34 | 35 | wxFSFile* CHMFSHandler::OpenFile(wxFileSystem& fs, const wxString& location) 36 | { 37 | auto right = GetRightLocation(location); 38 | auto left = GetLeftLocation(location); 39 | auto cwd = GetRightLocation(fs.GetPath()); 40 | 41 | if (!location.Left(6).CmpNoCase(wxT("MS-ITS"))) { 42 | right = wxT("/") + location; 43 | left = wxEmptyString; 44 | 45 | } else if (GetProtocol(left) != wxT("file")) 46 | return nullptr; 47 | 48 | // HTML code for space is %20 49 | right.Replace(wxT("%20"), wxT(" "), true); 50 | right.Replace(wxT("%5F"), wxT("_"), true); 51 | right.Replace(wxT("%2E"), wxT("."), true); 52 | right.Replace(wxT("%2D"), wxT("-"), true); 53 | right.Replace(wxT("%26"), wxT("&"), true); 54 | 55 | auto filename = wxFileSystem::URLToFileName(left); 56 | filename.Normalize(wxPATH_NORM_ENV_VARS | wxPATH_NORM_DOTS | wxPATH_NORM_TILDE | wxPATH_NORM_ABSOLUTE 57 | | wxPATH_NORM_LONG | wxPATH_NORM_SHORTCUT); 58 | 59 | auto len = cwd.Length(); 60 | if (right.Length() > len && right.StartsWith(cwd) && right[len] == wxT('/')) 61 | right = right.Mid(len); 62 | 63 | wxFileName fwfn(right, wxPATH_UNIX); 64 | fwfn.Normalize(wxPATH_NORM_DOTS | wxPATH_NORM_ABSOLUTE, cwd, wxPATH_UNIX); 65 | right = fwfn.GetFullPath(wxPATH_UNIX); 66 | 67 | auto s = std::make_unique(left.IsEmpty() ? left : filename.GetFullPath(), right); 68 | 69 | if (s && s->IsOk()) { 70 | auto cache = s->GetCache(); 71 | 72 | if (right.IsSameAs(wxT("/"))) 73 | right = cache->HomePage(); 74 | 75 | // Links to files in other archives. 76 | if (!right.Left(8).CmpNoCase(wxT("/MS-ITS:"))) 77 | right = right.AfterLast(wxT(':')); 78 | 79 | auto newLocation = wxT("file:") + cache->ArchiveName() + wxT("#xchm:") + right; 80 | 81 | return new wxFSFile(s.release(), newLocation, GetMimeTypeFromExt(right.Lower()), GetAnchor(location), {}); 82 | } 83 | 84 | return nullptr; 85 | } 86 | -------------------------------------------------------------------------------- /src/chmfshandler.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2003 - 2024 Razvan Cojocaru 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef __CHMFSHANDLER_H_ 21 | #define __CHMFSHANDLER_H_ 22 | 23 | #include 24 | 25 | /*! 26 | \class wxFileSystemHandler 27 | \brief wxWidgets virtual filesystem handler class. 28 | */ 29 | 30 | //! CHM filesystem handler class. 31 | class CHMFSHandler : public wxFileSystemHandler { 32 | public: 33 | /*! 34 | \brief Doesn't do anything but needs to be here because of 35 | the private copy constructor. 36 | */ 37 | CHMFSHandler() = default; 38 | 39 | //! Cleanup code. This calls CHMInputStream's Cleanup(). 40 | ~CHMFSHandler(); 41 | 42 | /*! 43 | \brief Checks if it can open the file passed in location. 44 | \param location File to open. 45 | \returns true if location is in the form 46 | "file:filename.chm#xchm:/file_inside_archive.extension", false 47 | otherwise. Does not attempt to actually open the file. 48 | */ 49 | bool CanOpen(const wxString& location) override; 50 | 51 | /*! 52 | \brief Tries to open the file specified. 53 | \param fs Currently ignored. 54 | \param location filename. 55 | \return A valid pointer to a wxFSFile or nullptr on failure. 56 | */ 57 | wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location) override; 58 | 59 | public: 60 | //! No copy construction. 61 | CHMFSHandler(const CHMFSHandler&) = delete; 62 | 63 | //! No assignment. 64 | CHMFSHandler& operator=(const CHMFSHandler&) = delete; 65 | }; 66 | 67 | #endif // __CHMFSHANDLER_H_ 68 | -------------------------------------------------------------------------------- /src/chmhtmlnotebook.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2003 - 2024 Razvan Cojocaru 3 | Tabbed browsing support developed by Cedric Boudinet 4 | (this file originally written by Cedric Boudinet) 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 | MA 02110-1301, USA. 20 | */ 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | CHMHtmlNotebook::CHMHtmlNotebook(wxWindow* parent, wxTreeCtrl* tc, const wxString& normalFont, 27 | const wxString& fixedFont, int fontSize, CHMFrame* frame) 28 | : wxAuiNotebook(parent), _tcl(tc), _frame(frame), _fontsNormalFace(normalFont), _fontsFixedFace(fixedFont), 29 | _fontSize(fontSize) 30 | { 31 | wxAcceleratorEntry entries[] = {{wxACCEL_CTRL, WXK_PAGEUP, ID_PriorPage}, 32 | {wxACCEL_CTRL, WXK_PAGEDOWN, ID_NextPage}, 33 | {wxACCEL_CTRL, '=', ID_ZoomIn}, 34 | {wxACCEL_CTRL, '-', ID_ZoomOut}}; 35 | 36 | wxAcceleratorTable accel(sizeof(entries) / sizeof(wxAcceleratorEntry), entries); 37 | SetAcceleratorTable(accel); 38 | 39 | AddHtmlView(wxEmptyString, wxT("memory:about.html")); 40 | } 41 | 42 | CHMHtmlWindow* CHMHtmlNotebook::CreateView() 43 | { 44 | auto htmlWin = new CHMHtmlWindow(this, _tcl, _frame); 45 | auto sizes = _frame->ComputeFontSizes(_fontSize); 46 | 47 | htmlWin->SetRelatedStatusBar(_frame->GetStatusBar()); 48 | htmlWin->SetFonts(_fontsNormalFace, _fontsFixedFace, sizes.data()); 49 | 50 | AddTab(htmlWin, _("(Empty page)")); 51 | SetSelection(GetPageCount() - 1); 52 | 53 | return htmlWin; 54 | } 55 | 56 | void CHMHtmlNotebook::AddHtmlView(const wxString& path, const wxString& link) 57 | { 58 | auto htmlWin = CreateView(); 59 | 60 | if (htmlWin && !link.IsEmpty()) { 61 | htmlWin->GetParser()->GetFS()->ChangePathTo(path); 62 | htmlWin->LoadPage(link); 63 | } 64 | } 65 | 66 | bool CHMHtmlNotebook::LoadPageInCurrentView(const wxString& location) 67 | { 68 | return GetCurrentPage()->LoadPage(location); 69 | } 70 | 71 | CHMHtmlWindow* CHMHtmlNotebook::GetCurrentPage() 72 | { 73 | auto selection = GetSelection(); 74 | 75 | if (selection == wxNOT_FOUND) 76 | return CreateView(); 77 | 78 | return dynamic_cast(wxAuiNotebook::GetPage(selection)); 79 | } 80 | 81 | void CHMHtmlNotebook::OnGoToNextPage(wxCommandEvent&) 82 | { 83 | auto selection = GetSelection(); 84 | 85 | if (selection >= static_cast(GetPageCount() - 1)) 86 | return; 87 | 88 | SetSelection(selection + 1); 89 | } 90 | 91 | void CHMHtmlNotebook::OnGoToPriorPage(wxCommandEvent&) 92 | { 93 | auto selection = GetSelection(); 94 | 95 | if (selection <= 0) 96 | return; 97 | 98 | SetSelection(selection - 1); 99 | } 100 | 101 | void CHMHtmlNotebook::OnCloseTab(wxAuiNotebookEvent&) 102 | { 103 | if (!GetPageCount()) 104 | _frame->Close(true); 105 | } 106 | 107 | void CHMHtmlNotebook::OnNewTab(wxCommandEvent&) 108 | { 109 | AddHtmlView(wxEmptyString, wxEmptyString); 110 | } 111 | 112 | void CHMHtmlNotebook::OnZoomIn(wxCommandEvent&) 113 | { 114 | SetChildrenFonts(_fontsNormalFace, _fontsFixedFace, _fontSize + 1); 115 | } 116 | 117 | void CHMHtmlNotebook::OnZoomOut(wxCommandEvent&) 118 | { 119 | SetChildrenFonts(_fontsNormalFace, _fontsFixedFace, _fontSize - 1); 120 | } 121 | 122 | void CHMHtmlNotebook::CloseAllPagesExceptFirst() 123 | { 124 | SetSelection(0); 125 | 126 | while (GetPageCount() > 1) 127 | DeletePage(1); 128 | } 129 | 130 | void CHMHtmlNotebook::SetChildrenFonts(const wxString& normalFace, const wxString& fixedFace, int fontSize) 131 | { 132 | _fontsNormalFace = normalFace; 133 | _fontsFixedFace = fixedFace; 134 | _fontSize = fontSize; 135 | 136 | auto nPageCount = GetPageCount(); 137 | auto sizes = _frame->ComputeFontSizes(_fontSize); 138 | 139 | for (decltype(nPageCount) nPage = 0; nPage < nPageCount; ++nPage) { 140 | auto chw = dynamic_cast(GetPage(nPage)); 141 | 142 | if (chw) 143 | chw->SetFonts(_fontsNormalFace, _fontsFixedFace, sizes.data()); 144 | } 145 | } 146 | 147 | bool CHMHtmlNotebook::AddTab(wxWindow* page, const wxString& title) 148 | { 149 | if (!page) 150 | return false; 151 | 152 | return AddPage(page, title); 153 | } 154 | 155 | BEGIN_EVENT_TABLE(CHMHtmlNotebook, wxAuiNotebook) 156 | EVT_MENU(ID_PriorPage, CHMHtmlNotebook::OnGoToPriorPage) 157 | EVT_MENU(ID_NextPage, CHMHtmlNotebook::OnGoToNextPage) 158 | EVT_MENU(ID_ZoomIn, CHMHtmlNotebook::OnZoomIn) 159 | EVT_MENU(ID_ZoomOut, CHMHtmlNotebook::OnZoomOut) 160 | EVT_AUINOTEBOOK_PAGE_CLOSED(wxID_ANY, CHMHtmlNotebook::OnCloseTab) 161 | END_EVENT_TABLE() 162 | -------------------------------------------------------------------------------- /src/chmhtmlnotebook.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2003 - 2024 Razvan Cojocaru 3 | Tabbed browsing support developed by Cedric Boudinet 4 | (this file originally written by Cedric Boudinet) 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 | MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef __CHMHTMLNOTEBOOK_H_ 23 | #define __CHMHTMLNOTEBOOK_H_ 24 | 25 | #include 26 | #include 27 | 28 | enum { 29 | ID_NextPage, 30 | ID_PriorPage, 31 | ID_ZoomIn, 32 | ID_ZoomOut, 33 | }; 34 | 35 | // Forward declarations 36 | class CHMFrame; 37 | class CHMHtmlWindow; 38 | 39 | /*! 40 | \class wxNotebook 41 | \brief wxWidgets application class. 42 | */ 43 | 44 | /*! 45 | \brief Custom HTML notebook widget class. For tabbed viewing of a CHM file. 46 | */ 47 | class CHMHtmlNotebook : public wxAuiNotebook { 48 | 49 | public: 50 | //! Constructor 51 | CHMHtmlNotebook(wxWindow* parent, wxTreeCtrl* tc, const wxString& normalFont, const wxString& fixedFont, 52 | int fontSize, CHMFrame* frame); 53 | 54 | //! Add a notebook tab and display the specified URL 55 | void AddHtmlView(const wxString& path, const wxString& link); 56 | 57 | //! Displays the URL in the current tab 58 | bool LoadPageInCurrentView(const wxString& location); 59 | 60 | //! Returns the current page as a CHMHtmlWindow 61 | CHMHtmlWindow* GetCurrentPage(); 62 | 63 | //! Close all pages except the first one 64 | void CloseAllPagesExceptFirst(); 65 | 66 | //! Propagate font settings to the children 67 | void SetChildrenFonts(const wxString& normalFace, const wxString& fixedFace, int sizes); 68 | 69 | //! Called when user asks for a tab to close 70 | void OnCloseTab(wxAuiNotebookEvent&); 71 | 72 | //! Called when user ask for a new tab 73 | void OnNewTab(wxCommandEvent& event); 74 | 75 | void OnZoomIn(wxCommandEvent& event); 76 | 77 | void OnZoomOut(wxCommandEvent& event); 78 | 79 | //! Creates a new tab view 80 | CHMHtmlWindow* CreateView(); 81 | 82 | //! Add page and check tab height control 83 | bool AddTab(wxWindow* page, const wxString& title); 84 | 85 | int FontSize() const { return _fontSize; } 86 | 87 | protected: 88 | //! Called when user asks for next notebook page 89 | void OnGoToNextPage(wxCommandEvent&); 90 | 91 | //! Called when user asks for prior notebook page 92 | void OnGoToPriorPage(wxCommandEvent&); 93 | 94 | private: 95 | wxTreeCtrl* _tcl; 96 | CHMFrame* _frame; 97 | wxString _fontsNormalFace; 98 | wxString _fontsFixedFace; 99 | int _fontSize; 100 | DECLARE_EVENT_TABLE() 101 | }; 102 | 103 | #endif // __CHMHTMLNOTEBOOK_H_ 104 | -------------------------------------------------------------------------------- /src/chmhtmlwindow.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2003 - 2024 Razvan Cojocaru 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef __CHMHTMLWINDOW_H_ 21 | #define __CHMHTMLWINDOW_H_ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | //! Event IDs. 31 | enum { 32 | ID_CopySel = 1216, 33 | ID_CopyLink, 34 | ID_SaveLinkAs, 35 | ID_PopupForward, 36 | ID_PopupBack, 37 | ID_PopupFind, 38 | ID_PopupFullScreen, 39 | ID_OpenInNewTab, 40 | }; 41 | 42 | //! Minimize dependencies. Forward declaration. 43 | class CHMFrame; 44 | 45 | /*! 46 | \class wxHtmlWindow 47 | \brief wxWidgets HTML widget class. 48 | */ 49 | 50 | /*! 51 | \brief Custom HTML widget class. Needed for sychnronization between the topics tree control and the currently 52 | displayed page. 53 | */ 54 | class CHMHtmlWindow : public wxHtmlWindow { 55 | 56 | public: 57 | /*! 58 | \brief Initializes the widget. 59 | \param parent The parent widget. 60 | \param tc Pointer to the tree control we want to synchronize with. 61 | \param frame Outer frame. 62 | */ 63 | CHMHtmlWindow(wxWindow* parent, wxTreeCtrl* tc, CHMFrame* frame); 64 | 65 | void OnSetTitle(const wxString& title) override; 66 | 67 | //! Override. Looks up the wanted page in the tree and selects it. 68 | bool LoadPage(const wxString& location) override; 69 | 70 | /*! 71 | \brief Dictates the behaviour of LoadPage(). If SetSync() has been called with a true parameter, 72 | the tree control will be updated by LoadPage(). Otherwise, it will not be updated. 73 | \param value Synchronize the tree widget on load? 74 | */ 75 | void SetSync(bool value) { _syncTree = value; } 76 | 77 | /*! 78 | Returns true if the tree control's EVT_TREE_SEL_CHANGED event happened as a result of the CHMHtmlWindow 79 | calling SelectItem() on it. 80 | */ 81 | bool IsCaller() const { return _found; } 82 | 83 | public: 84 | /*! 85 | \brief Finds the first occurence of word in the displayed page. 86 | \param parent Root of the wxHtmlCell tree where the search should begin. 87 | \param word The word we're looking for. If more words separated by spaces are typed in, only the first 88 | one is taken into account. 89 | \param wholeWords If true, will search for words that match word exactly. 90 | \param caseSensitive If true, the search will be performed case sensitive. 91 | \return A valid cell if the result was found, nullptr otherwise. 92 | */ 93 | wxHtmlCell* FindFirst(wxHtmlCell* parent, const wxString& word, bool wholeWords, bool caseSensitive); 94 | 95 | /*! 96 | \brief Same as FindFirst(), but continues the search from start (start is considered in the search process). 97 | */ 98 | wxHtmlCell* FindNext(wxHtmlCell* start, const wxString& word, bool wholeWords, bool caseSensitive); 99 | 100 | //! Clears the current selection. 101 | void ClearSelection(); 102 | 103 | // Needs to be public, cause I call it from CHMHtmlFrame. 104 | //! Called when the user selects 'Find' from the popup menu. 105 | void OnFind(wxCommandEvent& event); 106 | 107 | //! Called when the user selects 'Copy' from the popup menu. 108 | void OnCopy(wxCommandEvent& event); 109 | 110 | protected: 111 | //! Called when the user selects 'Forward' from the popup menu. 112 | void OnForward(wxCommandEvent& event); 113 | 114 | //! Called when the user selects 'Back' from the popup menu. 115 | void OnBack(wxCommandEvent& event); 116 | 117 | //! Called when the user selects 'Copy link' from the popup menu. 118 | void OnCopyLink(wxCommandEvent& event); 119 | 120 | //! Called when the user selects 'Save link as' from the popup menu. 121 | void OnSaveLinkAs(wxCommandEvent& event); 122 | 123 | //! Called when the user presses a key 124 | void OnChar(wxKeyEvent& event); 125 | 126 | //! Called on widget resize. 127 | void OnSize(wxSizeEvent& event); 128 | 129 | //! Called when the user selects 'Save link as' from the popup menu. 130 | void OnOpenInNewTab(wxCommandEvent& event); 131 | 132 | //! Called when the 'Toggle fullscreen' is selected from the popup menu. 133 | void OnToggleFullScreen(wxCommandEvent& event); 134 | 135 | protected: 136 | //! Called when the user right clicks the HTML window. 137 | void OnRightClick(wxMouseEvent& event); 138 | 139 | //! Overridden. Called when the user clicks on a link. 140 | void OnLinkClicked(const wxHtmlLinkInfo& link) override; 141 | 142 | private: 143 | //! Helper. Recursively looks for the opened page in the tree. 144 | void Sync(wxTreeItemId root, const wxString& page); 145 | 146 | //! Helper. Returns the prefix of the currently loaded page. 147 | wxString GetPrefix(const wxString& location) const; 148 | 149 | private: 150 | wxTreeCtrl* _tcl; 151 | bool _syncTree {true}; 152 | bool _found {false}; 153 | std::unique_ptr _menu; 154 | CHMFrame* _frame; 155 | wxString _link; 156 | std::unique_ptr _fdlg; 157 | 158 | private: 159 | DECLARE_EVENT_TABLE() 160 | }; 161 | 162 | #endif // __CHMHTMLWINDOW_H_ 163 | -------------------------------------------------------------------------------- /src/chmindexpanel.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2003 - 2024 Razvan Cojocaru 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | MA 02110-1301, USA. 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | CHMIndexPanel::CHMIndexPanel(wxWindow* parent, CHMHtmlNotebook* nbhtml) : wxPanel(parent) 26 | { 27 | auto sizer = new wxBoxSizer(wxVERTICAL); 28 | 29 | SetAutoLayout(true); 30 | SetSizer(sizer); 31 | 32 | _text = new wxTextCtrl(this, ID_SearchIndex, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER); 33 | _lc = new CHMListCtrl(this, nbhtml, ID_IndexClicked); 34 | 35 | sizer->Add(_text, 0, wxEXPAND | wxALL, 2); 36 | sizer->Add(_lc, 1, wxALL | wxEXPAND, 2); 37 | } 38 | 39 | void CHMIndexPanel::Reset() 40 | { 41 | _text->Clear(); 42 | _lc->Reset(); 43 | } 44 | 45 | void CHMIndexPanel::SetNewFont(const wxFont& font) 46 | { 47 | _lc->SetFont(font); 48 | } 49 | 50 | void CHMIndexPanel::OnIndexSelRet(wxCommandEvent&) 51 | { 52 | if (_navigate) 53 | _lc->LoadSelected(); 54 | } 55 | 56 | void CHMIndexPanel::OnIndexSel(wxListEvent&) 57 | { 58 | if (_navigate) 59 | _lc->LoadSelected(); 60 | } 61 | 62 | void CHMIndexPanel::OnText(wxCommandEvent&) 63 | { 64 | _navigate = false; 65 | _lc->FindBestMatch(_text->GetLineText(0)); 66 | _navigate = true; 67 | } 68 | 69 | BEGIN_EVENT_TABLE(CHMIndexPanel, wxPanel) 70 | EVT_TEXT(ID_SearchIndex, CHMIndexPanel::OnText) 71 | EVT_TEXT_ENTER(ID_SearchIndex, CHMIndexPanel::OnIndexSelRet) 72 | EVT_LIST_ITEM_SELECTED(ID_IndexClicked, CHMIndexPanel::OnIndexSel) 73 | END_EVENT_TABLE() 74 | -------------------------------------------------------------------------------- /src/chmindexpanel.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2003 - 2024 Razvan Cojocaru 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef __CHMINDEXPANEL_H_ 21 | #define __CHMINDEXPANEL_H_ 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | class CHMHtmlNotebook; 28 | class CHMListCtrl; 29 | 30 | /*! 31 | \class wxPanel 32 | \brief generic wxWidgets panel widget class. 33 | */ 34 | 35 | //! IDs for various widget events. 36 | enum { 37 | ID_SearchIndex = 1500, 38 | ID_IndexClicked, 39 | }; 40 | 41 | //! Custom panel for displaying the .chm index (if available). 42 | class CHMIndexPanel : public wxPanel { 43 | 44 | public: 45 | /*! 46 | \brief Initializes the panel. 47 | \param parent Parent widget. 48 | \param nbhtml HTML-capable widget used for displaying pages 49 | from the index. 50 | */ 51 | CHMIndexPanel(wxWindow* parent, CHMHtmlNotebook* nbhtml); 52 | 53 | public: 54 | //! Accesor for the CHMListCtrl used by this panel. 55 | CHMListCtrl* GetResultsList() { return _lc; } 56 | 57 | //! Clears the textbox and removes all items from the list control. 58 | void Reset(); 59 | 60 | //! Sets the font. 61 | void SetNewFont(const wxFont& font); 62 | 63 | protected: 64 | //! This gets called when the user clicks on a list item. 65 | void OnIndexSel(wxListEvent& event); 66 | 67 | //! This gets called when the user presses enter on a list item. 68 | void OnIndexSelRet(wxCommandEvent& event); 69 | 70 | //! Called whenever the user types a letter in the textbox. 71 | void OnText(wxCommandEvent& event); 72 | 73 | private: 74 | wxTextCtrl* _text; 75 | CHMListCtrl* _lc {nullptr}; 76 | bool _navigate {true}; 77 | 78 | private: 79 | DECLARE_EVENT_TABLE() 80 | }; 81 | 82 | #endif // __CHMINDEXPANEL_H_ 83 | -------------------------------------------------------------------------------- /src/chminputstream.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2003 - 2024 Razvan Cojocaru 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | MA 02110-1301, USA. 18 | */ 19 | 20 | #include 21 | 22 | /*---------------------------------------------------------------------- 23 | * class CHMInputStream static members 24 | */ 25 | 26 | std::unique_ptr CHMInputStream::_archiveCache; 27 | wxString CHMInputStream::_path; 28 | 29 | void CHMInputStream::Cleanup() 30 | { 31 | _archiveCache.reset(); 32 | } 33 | 34 | CHMFile* CHMInputStream::GetCache() 35 | { 36 | return _archiveCache.get(); 37 | } 38 | 39 | /*---------------------------------------------------------------------- 40 | * rest of class CHMInputStream implementation 41 | */ 42 | 43 | CHMInputStream::CHMInputStream(const wxString& archive, const wxString& file) 44 | { 45 | auto filename = file; 46 | 47 | if (!archive.IsEmpty()) 48 | _path = archive.BeforeLast(wxT('/')) + wxT("/"); 49 | 50 | // Maybe the cached chmFile* isn't valid anymore, or maybe there is no chached chmFile* yet. 51 | if (!archive.IsEmpty() && !Init(archive)) { 52 | m_lasterror = wxSTREAM_READ_ERROR; 53 | return; 54 | } 55 | 56 | assert(_archiveCache); 57 | 58 | // Somebody's looking for the homepage. 59 | if (file.IsSameAs(wxT("/"))) 60 | filename = _archiveCache->HomePage(); 61 | 62 | if (!filename.Left(8).CmpNoCase(wxT("/MS-ITS:"))) { 63 | // If this ever happens chances are Microsoft decided that even if we went through the 64 | // trouble to open this archive and check out the index file, the index file is just a 65 | // link to a file in another archive. 66 | 67 | auto arch_link = filename.AfterFirst(wxT(':')).BeforeFirst(wxT(':')); 68 | 69 | filename = filename.AfterLast(wxT(':')); 70 | 71 | // Reset the cached chmFile* and all. 72 | if (!Init(arch_link)) 73 | if (!Init(_path + arch_link)) { 74 | m_lasterror = wxSTREAM_READ_ERROR; 75 | return; 76 | } 77 | } 78 | 79 | // See if the file really is in the archive. 80 | if (!_archiveCache->ResolveObject(filename, &_ui)) { 81 | m_lasterror = wxSTREAM_READ_ERROR; 82 | return; 83 | } 84 | } 85 | 86 | size_t CHMInputStream::GetSize() const 87 | { 88 | return _ui.length; 89 | } 90 | 91 | bool CHMInputStream::Eof() const 92 | { 93 | return static_cast(_currPos) >= _ui.length; 94 | } 95 | 96 | size_t CHMInputStream::OnSysRead(void* buffer, size_t bufsize) 97 | { 98 | if (static_cast(_currPos) >= _ui.length) { 99 | m_lasterror = wxSTREAM_EOF; 100 | return 0; 101 | } 102 | 103 | if (!_archiveCache) 104 | return 0; 105 | 106 | if (static_cast(_currPos + bufsize) > _ui.length) 107 | bufsize = _ui.length - _currPos; 108 | 109 | bufsize = _archiveCache->RetrieveObject(&_ui, static_cast(buffer), _currPos, bufsize); 110 | _currPos += bufsize; 111 | 112 | return bufsize; 113 | } 114 | 115 | wxFileOffset CHMInputStream::OnSysSeek(wxFileOffset seek, wxSeekMode mode) 116 | { 117 | switch (mode) { 118 | case wxFromCurrent: 119 | _currPos += seek; 120 | break; 121 | case wxFromStart: 122 | _currPos = seek; 123 | break; 124 | case wxFromEnd: 125 | _currPos = _ui.length - 1 + seek; 126 | break; 127 | default: 128 | _currPos = seek; 129 | } 130 | 131 | return _currPos; 132 | } 133 | 134 | bool CHMInputStream::Init(const wxString& archive) 135 | { 136 | if (!_archiveCache || !_archiveCache->ArchiveName().IsSameAs(archive)) { 137 | _archiveCache = std::make_unique(archive); 138 | 139 | if (!_archiveCache->IsOk()) { 140 | Cleanup(); 141 | return false; 142 | } 143 | } 144 | 145 | return true; 146 | } 147 | -------------------------------------------------------------------------------- /src/chminputstream.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2003 - 2024 Razvan Cojocaru 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef __CHMINPUTSTREAM_H_ 21 | #define __CHMINPUTSTREAM_H_ 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | /*! 28 | \class wxInputStream 29 | \brief wxWidgets input stream class. 30 | */ 31 | 32 | //! Input stream from a .chm archive. 33 | class CHMInputStream : public wxInputStream { 34 | public: 35 | /*! 36 | \brief Creates a stream. 37 | \param archive The .chm file name on disk. It makes sense to 38 | pass the empty string if you're sure file is a link to a 39 | page, in the form of "/MS-ITS:archive.chm::/filename.html". 40 | \param file The file requested from the archive. 41 | */ 42 | CHMInputStream(const wxString& archive, const wxString& file); 43 | 44 | //! Returns the size of the file. 45 | size_t GetSize() const override; 46 | 47 | //! True if EOF has been found. 48 | bool Eof() const override; 49 | 50 | /*! 51 | \brief Returns the static CHMFile pointer associated with 52 | this stream. Archives are being cached until it is 53 | explicitly requested to open a different one. 54 | \return A valid pointer to a CHMFile object or nullptr if no 55 | .chm file has been opened yet. 56 | */ 57 | static CHMFile* GetCache(); 58 | 59 | /*! 60 | \brief Cleans up the cache. Has to be public and static 61 | since the stream doesn't know how many other streams using 62 | the same cache will be created after it. Somebody else has 63 | to turn off the lights, and in this case it's CHMFSHandler. 64 | */ 65 | static void Cleanup(); 66 | 67 | protected: 68 | /*! 69 | \brief Attempts to read a chunk from the stream. 70 | \param buffer The read data is being placed here. 71 | \param bufsize Number of bytes requested. 72 | \return Number of bytes actually read. 73 | */ 74 | size_t OnSysRead(void* buffer, size_t bufsize) override; 75 | 76 | /*! 77 | \brief Seeks to the requested position in the file. 78 | \param seek Where to seek. 79 | \param mode Seek from the beginning, current position, etc. 80 | \return Position in the file. 81 | */ 82 | wxFileOffset OnSysSeek(wxFileOffset seek, wxSeekMode mode) override; 83 | 84 | /*! 85 | \brief Asks what is the current position in the file. 86 | \return Current position. 87 | */ 88 | wxFileOffset OnSysTell() const override { return _currPos; } 89 | 90 | private: 91 | //! Helper. Inits the cache. 92 | bool Init(const wxString& archive); 93 | 94 | private: 95 | static std::unique_ptr _archiveCache; 96 | off_t _currPos {0}; 97 | chmUnitInfo _ui {}; 98 | static wxString _path; 99 | }; 100 | 101 | #endif // __CHMINPUTSTREAM_H_ 102 | -------------------------------------------------------------------------------- /src/chmlistctrl.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2003 - 2024 Razvan Cojocaru 3 | ListDirty() patch contributed by Iulian Dragos 4 | 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 | MA 02110-1301, USA. 20 | */ 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | // Helper 28 | 29 | int CompareItemPairs(CHMListPairItem* item1, CHMListPairItem* item2) 30 | { 31 | return (item1->_title).CmpNoCase(item2->_title); 32 | } 33 | 34 | // CHMListCtrl implementation 35 | 36 | CHMListCtrl::CHMListCtrl(wxWindow* parent, CHMHtmlNotebook* nbhtml, wxWindowID id) 37 | : wxListCtrl(parent, id, wxDefaultPosition, wxDefaultSize, 38 | wxLC_VIRTUAL | wxLC_REPORT | wxLC_NO_HEADER | wxLC_SINGLE_SEL | wxLC_SORT_ASCENDING | wxSUNKEN_BORDER), 39 | _items(CompareItemPairs), _nbhtml(nbhtml) 40 | { 41 | constexpr size_t INDEX_HINT_SIZE {2048}; 42 | 43 | InsertColumn(0, wxEmptyString); 44 | SetItemCount(0); 45 | 46 | _items.Alloc(INDEX_HINT_SIZE); 47 | } 48 | 49 | CHMListCtrl::~CHMListCtrl() 50 | { 51 | // Clean the items up. 52 | ResetItems(); 53 | } 54 | 55 | void CHMListCtrl::Reset() 56 | { 57 | ResetItems(); 58 | DeleteAllItems(); 59 | UpdateUI(); 60 | } 61 | 62 | void CHMListCtrl::UpdateItemCount() 63 | { 64 | SetItemCount(_items.GetCount()); 65 | } 66 | 67 | void CHMListCtrl::AddPairItem(const wxString& title, const wxString& url) 68 | { 69 | _items.Add(new CHMListPairItem(title, url)); 70 | } 71 | 72 | void CHMListCtrl::LoadSelected() 73 | { 74 | auto item = -1L; 75 | item = GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); 76 | 77 | if (item == -1L || item > static_cast(_items.GetCount()) - 1) 78 | return; 79 | 80 | auto chmf = CHMInputStream::GetCache(); 81 | 82 | if (chmf) { 83 | auto fname = _items[item]->_url; 84 | 85 | if (!fname.StartsWith(wxT("file:"))) 86 | fname = wxT("file:") + chmf->ArchiveName() + wxT("#xchm:/") + _items[item]->_url; 87 | 88 | _nbhtml->LoadPageInCurrentView(fname); 89 | } 90 | } 91 | 92 | void CHMListCtrl::UpdateUI() 93 | { 94 | SetColumnWidth(0, GetClientSize().GetWidth()); 95 | } 96 | 97 | void CHMListCtrl::FindBestMatch(const wxString& title) 98 | { 99 | for (size_t i = 0; i < _items.size(); ++i) { 100 | if (!_items[i]->_title.Left(title.length()).CmpNoCase(title)) { 101 | EnsureVisible(i); 102 | SetItemState(i, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); 103 | break; 104 | } 105 | } 106 | 107 | Refresh(); 108 | wxWindow::Update(); 109 | } 110 | 111 | void CHMListCtrl::ResetItems() 112 | { 113 | for (auto i = 0UL; i < _items.GetCount(); ++i) 114 | delete _items[i]; 115 | 116 | _items.Empty(); 117 | } 118 | 119 | void CHMListCtrl::OnSize(wxSizeEvent& event) 120 | { 121 | UpdateUI(); 122 | event.Skip(); 123 | } 124 | 125 | wxString CHMListCtrl::OnGetItemText(long item, long column) const 126 | { 127 | // Is this even possible? item == -1 or item > size - 1? 128 | if (column != 0 || item == -1L || item > static_cast(_items.GetCount()) - 1) 129 | return wxT(""); 130 | 131 | return _items[item]->_title; 132 | } 133 | 134 | BEGIN_EVENT_TABLE(CHMListCtrl, wxListCtrl) 135 | EVT_SIZE(CHMListCtrl::OnSize) 136 | END_EVENT_TABLE() 137 | -------------------------------------------------------------------------------- /src/chmlistctrl.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2003 - 2024 Razvan Cojocaru 3 | ListDirty() patch contributed by Iulian Dragos 4 | 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 | MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef __CHMLISTCTRL_H_ 23 | #define __CHMLISTCTRL_H_ 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | // Forward declarations. 31 | class CHMHtmlNotebook; 32 | 33 | //! Item to store in the virtual list control 34 | struct CHMListPairItem { 35 | //! Trivial constructor 36 | CHMListPairItem(const wxString& title, const wxString& url) : _title(title), _url(url) {} 37 | 38 | //! This will show up in the list. 39 | wxString _title; 40 | //! This is what the title points to. 41 | wxString _url; 42 | }; 43 | 44 | //! Declare a wxWidgets sorted array 45 | WX_DEFINE_SORTED_ARRAY(CHMListPairItem*, ItemPairArray); 46 | 47 | //! Comparison function to use with the sorted array above. 48 | int CompareItemPairs(CHMListPairItem* item1, CHMListPairItem* item2); 49 | 50 | /*! 51 | \class wxListCtrl 52 | \brief wxWidgets list control class. 53 | */ 54 | 55 | //! List control class meant to emulate the look and feel of a wxListBox. 56 | class CHMListCtrl : public wxListCtrl { 57 | 58 | public: 59 | /*! 60 | \brief Initializes the custom list control. 61 | \param parent The parent widget. 62 | \param nbhtml Pointer to a CHMHtmlWindow that I'll associate with 63 | this object so that selecting an item from the list will display 64 | the corresponding page in the HTML window. 65 | \param id Widget id. 66 | */ 67 | CHMListCtrl(wxWindow* parent, CHMHtmlNotebook* nbhtml, wxWindowID id = wxID_ANY); 68 | 69 | //! Cleanup. 70 | ~CHMListCtrl(); 71 | 72 | public: 73 | //! Cleans up and removes all the list items. 74 | void Reset(); 75 | 76 | void UpdateItemCount(); 77 | 78 | /*! 79 | \brief Adds a title:url pair to the list. The title is the part 80 | that gets displayed, the url is tha page where the HTML window 81 | should go when the item is being clicked. 82 | \param title The title to add. 83 | \param url The title's associated url. 84 | */ 85 | void AddPairItem(const wxString& title, const wxString& url); 86 | 87 | //! Loads the page that corresponds to the item currently selected. 88 | void LoadSelected(); 89 | 90 | //! Should be called each time the list control's state changes. 91 | void UpdateUI(); 92 | 93 | /*! 94 | \brief Finds the list item that is the best match. 95 | \param title The string to match against. 96 | */ 97 | void FindBestMatch(const wxString& title); 98 | 99 | protected: 100 | //! Gets called when the widget is being resized. 101 | void OnSize(wxSizeEvent& event); 102 | 103 | //! Gets called when an item needs to be displayed. 104 | wxString OnGetItemText(long item, long column) const; 105 | 106 | private: 107 | //! Delete/empty the items in the item array. 108 | void ResetItems(); 109 | 110 | private: 111 | ItemPairArray _items; 112 | CHMHtmlNotebook* _nbhtml; 113 | 114 | private: 115 | DECLARE_EVENT_TABLE() 116 | }; 117 | 118 | #endif // __CHMLISTCTRL_H_ 119 | -------------------------------------------------------------------------------- /src/chmsearchpanel.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2003 - 2024 Razvan Cojocaru 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | MA 02110-1301, USA. 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | CHMSearchPanel::CHMSearchPanel(wxWindow* parent, wxTreeCtrl* topics, CHMHtmlNotebook* nbhtml) 34 | : wxPanel(parent), _tcl(topics) 35 | { 36 | auto sizer = new wxBoxSizer(wxVERTICAL); 37 | 38 | SetAutoLayout(true); 39 | SetSizer(sizer); 40 | 41 | _text = new wxTextCtrl(this, ID_SearchText, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER); 42 | 43 | _partial = new wxCheckBox(this, wxID_ANY, _("Get partial matches")); 44 | _titles = new wxCheckBox(this, wxID_ANY, _("Search titles only")); 45 | _search = new wxButton(this, ID_SearchButton, _("Search")); 46 | 47 | #if wxUSE_TOOLTIPS 48 | _partial->SetToolTip(_("Allow partial matches.")); 49 | _titles->SetToolTip(_("Only search in the contents' titles.")); 50 | _search->SetToolTip(_("Search contents for occurrences of the specified text.")); 51 | #endif 52 | _results = new CHMListCtrl(this, nbhtml, ID_Results); 53 | 54 | sizer->Add(_text, 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, 2); 55 | sizer->Add(_partial, 0, wxLEFT | wxRIGHT | wxTOP, 10); 56 | sizer->Add(_titles, 0, wxLEFT | wxRIGHT, 10); 57 | sizer->Add(_search, 0, wxALL, 10); 58 | sizer->Add(_results, 1, wxALL | wxEXPAND, 2); 59 | 60 | GetConfig(); 61 | } 62 | 63 | CHMSearchPanel::~CHMSearchPanel() 64 | { 65 | SetConfig(); 66 | } 67 | 68 | void CHMSearchPanel::OnSearch(wxCommandEvent&) 69 | { 70 | wxBusyCursor bcr; 71 | 72 | _results->Reset(); 73 | 74 | auto sr = _text->GetLineText(0); 75 | wxString word; 76 | 77 | if (sr.IsEmpty()) 78 | return; 79 | 80 | auto chmf = CHMInputStream::GetCache(); 81 | 82 | if (!chmf) 83 | return; 84 | 85 | sr.MakeLower(); 86 | 87 | auto srLen = sr.length(); 88 | 89 | for (size_t i = 0; i < srLen; ++i) 90 | switch (wxChar(sr[i])) { 91 | case wxT('+'): 92 | case wxT('-'): 93 | case wxT('#'): 94 | case wxT('@'): 95 | case wxT('^'): 96 | case wxT('&'): 97 | case wxT('%'): 98 | sr[i] = wxT(' '); 99 | break; 100 | default: 101 | break; 102 | } 103 | 104 | wxStringTokenizer tkz(sr, wxT(" \t\r\n")); 105 | 106 | while (word.IsEmpty()) 107 | if (tkz.HasMoreTokens()) 108 | word = tkz.GetNextToken(); 109 | 110 | CHMSearchResults h1; 111 | chmf->IndexSearch(word, !_partial->IsChecked(), _titles->IsChecked(), h1); 112 | 113 | while (tkz.HasMoreTokens()) { 114 | auto token = tkz.GetNextToken(); 115 | if (token.IsEmpty()) 116 | continue; 117 | 118 | CHMSearchResults h2, tmp; 119 | chmf->IndexSearch(token, !_partial->IsChecked(), _titles->IsChecked(), h2); 120 | 121 | if (!h2.empty()) { 122 | for (auto&& item : h2) 123 | if (h1.find(item.first) != h1.end()) 124 | tmp[item.first] = item.second; 125 | h1 = tmp; 126 | } else { 127 | h1.clear(); 128 | break; 129 | } 130 | } 131 | 132 | if (_titles->IsChecked() && h1.empty()) { 133 | PopulateList(_tcl->GetRootItem(), sr, !_partial->IsChecked()); 134 | _results->UpdateItemCount(); 135 | _results->UpdateUI(); 136 | return; 137 | } 138 | 139 | for (auto&& item : h1) { 140 | auto url = item.first.StartsWith(wxT("/")) ? item.first : (wxT("/") + item.first); 141 | _results->AddPairItem(item.second, url); 142 | } 143 | 144 | _results->UpdateItemCount(); 145 | _results->UpdateUI(); 146 | } 147 | 148 | void CHMSearchPanel::PopulateList(wxTreeItemId root, const wxString& text, bool wholeWords) 149 | { 150 | static auto chmf = CHMInputStream::GetCache(); 151 | 152 | if (!chmf) 153 | return; 154 | 155 | auto data = dynamic_cast(_tcl->GetItemData(root)); 156 | 157 | if (data && (!data->_url.IsEmpty())) { 158 | auto title = _tcl->GetItemText(root); 159 | if (TitleSearch(title, text, wholeWords)) 160 | _results->AddPairItem(title, data->_url); 161 | } 162 | 163 | wxTreeItemIdValue cookie; 164 | 165 | for (auto child = _tcl->GetFirstChild(root, cookie); child; child = _tcl->GetNextChild(root, cookie)) { 166 | PopulateList(child, text, wholeWords); 167 | } 168 | } 169 | 170 | bool CHMSearchPanel::TitleSearch(const wxString& title, const wxString& text, bool wholeWords) 171 | { 172 | auto ncTitle = title; 173 | auto ncText = text; 174 | 175 | ncTitle.MakeLower(); 176 | ncText.MakeLower(); 177 | 178 | wxStringTokenizer textTokenizer(ncText), titleTokenizer(ncTitle); 179 | std::vector titleTokens; 180 | 181 | if (wholeWords) 182 | while (titleTokenizer.HasMoreTokens()) 183 | titleTokens.push_back(titleTokenizer.GetNextToken()); 184 | 185 | auto processedTokens = false; 186 | 187 | while (textTokenizer.HasMoreTokens()) { 188 | auto textToken = textTokenizer.GetNextToken(); 189 | 190 | if (textToken.IsEmpty()) 191 | continue; 192 | 193 | processedTokens = true; 194 | 195 | if (!wholeWords) { 196 | if (ncTitle.find(textToken) == wxString::npos) 197 | return false; 198 | 199 | } else if (std::find(titleTokens.begin(), titleTokens.end(), textToken) == titleTokens.end()) 200 | return false; 201 | } 202 | 203 | return processedTokens; 204 | } 205 | 206 | void CHMSearchPanel::OnSearchSel(wxListEvent&) 207 | { 208 | _results->LoadSelected(); 209 | } 210 | 211 | void CHMSearchPanel::Reset() 212 | { 213 | _text->Clear(); 214 | _results->Reset(); 215 | } 216 | 217 | void CHMSearchPanel::SetNewFont(const wxFont& font) 218 | { 219 | _results->SetFont(font); 220 | } 221 | 222 | void CHMSearchPanel::SetConfig() 223 | { 224 | wxConfig config(wxT("xchm")); 225 | 226 | config.Write(wxT("/Search/partialWords"), static_cast(_partial->GetValue())); 227 | config.Write(wxT("/Search/titlesOnly"), static_cast(_titles->GetValue())); 228 | } 229 | 230 | void CHMSearchPanel::GetConfig() 231 | { 232 | long partial, titles; 233 | wxConfig config(wxT("xchm")); 234 | 235 | if (config.Read(wxT("/Search/partialWords"), &partial)) { 236 | config.Read(wxT("/Search/titlesOnly"), &titles); 237 | _partial->SetValue(partial); 238 | _titles->SetValue(titles); 239 | } 240 | } 241 | 242 | BEGIN_EVENT_TABLE(CHMSearchPanel, wxPanel) 243 | EVT_LIST_ITEM_SELECTED(ID_Results, CHMSearchPanel::OnSearchSel) 244 | EVT_BUTTON(ID_SearchButton, CHMSearchPanel::OnSearch) 245 | EVT_TEXT_ENTER(ID_SearchText, CHMSearchPanel::OnSearch) 246 | END_EVENT_TABLE() 247 | -------------------------------------------------------------------------------- /src/chmsearchpanel.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2003 - 2024 Razvan Cojocaru 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef __CHMSEARCHPANEL_HPP_ 21 | #define __CHMSEARCHPANEL_HPP_ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | // Forward declaration. 35 | class CHMListCtrl; 36 | class CHMHtmlNotebook; 37 | 38 | /*! 39 | \class wxPanel 40 | \brief generic wxWidgets panel widget class. 41 | */ 42 | 43 | //! IDs for various widget events. 44 | enum { 45 | ID_SearchText = 1024, 46 | ID_SearchButton, 47 | ID_Results, 48 | }; 49 | 50 | //! Custom built search panel. 51 | class CHMSearchPanel : public wxPanel { 52 | 53 | public: 54 | /*! 55 | \brief Initialized the search panel. 56 | \param parent Parent widget. 57 | \param topics A wxTreeCtrl* that will be iterated over 58 | recursively in order to figure out which files from the 59 | archive to be searched. 60 | \param nbhtml The widget that can load a html page found as a 61 | result of searching. 62 | */ 63 | CHMSearchPanel(wxWindow* parent, wxTreeCtrl* topics, CHMHtmlNotebook* nbhtml); 64 | 65 | //! Calls SetConfig(). 66 | ~CHMSearchPanel(); 67 | 68 | //! Resets the panel (clears the result list and the textbox.) 69 | void Reset(); 70 | 71 | //! Sets the font. 72 | void SetNewFont(const wxFont& font); 73 | 74 | protected: 75 | /*! 76 | This gets called when the user clicks the Search button or 77 | presses Enter in the textbox. 78 | */ 79 | void OnSearch(wxCommandEvent& event); 80 | 81 | //! This gets called when the user clicks on a result. 82 | void OnSearchSel(wxListEvent& event); 83 | 84 | private: 85 | //! Helper. Searches through the tree recursively. 86 | void PopulateList(wxTreeItemId root, const wxString& text, bool wholeWords); 87 | 88 | //! Helper. Grep searches page titles for the given text. 89 | bool TitleSearch(const wxString& title, const wxString& text, bool wholeWords); 90 | 91 | //! Reads the search configuration from .xchm (case sensitive, etc.). 92 | void GetConfig(); 93 | 94 | //! Writes the search configuration to .xchm. 95 | void SetConfig(); 96 | 97 | private: 98 | wxTreeCtrl* _tcl; 99 | wxTextCtrl* _text; 100 | wxCheckBox* _partial; 101 | wxCheckBox* _titles; 102 | wxButton* _search; 103 | CHMListCtrl* _results; 104 | 105 | private: 106 | DECLARE_EVENT_TABLE() 107 | }; 108 | 109 | #endif // __CHMSEARCHPANEL_HPP_ 110 | -------------------------------------------------------------------------------- /src/hhcparser.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2003 - 2024 Razvan Cojocaru 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef __HHCPARSER_H_ 21 | #define __HHCPARSER_H_ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | // Forward declarations. 29 | class CHMListCtrl; 30 | 31 | //! Maximum number of tree levels. 32 | constexpr size_t TREE_BUF_SIZE {128}; 33 | 34 | /*! 35 | \brief Objects of this class will be used as opaque data to be used with a tree item, so that when the user selects 36 | a tree item it will be easy to retrieve the filename associated with the item. 37 | */ 38 | struct URLTreeItem : public wxTreeItemData { 39 | 40 | //! Sets the data to str. 41 | explicit URLTreeItem(const wxString& str) : _url(str) {} 42 | 43 | //! Useful data. 44 | wxString _url; 45 | }; 46 | 47 | //! Fast index/contents file parser 48 | class HHCParser { 49 | 50 | public: 51 | //! Constructor 52 | HHCParser(wxFontEncoding enc, wxTreeCtrl* tree, CHMListCtrl* list); 53 | 54 | public: 55 | //! Parse a chunk of data. 56 | void parse(const char* chunk); 57 | 58 | private: 59 | //! Handle a retrieved tag. I'm only interested in very few tags. 60 | void handleTag(const std::string& tag); 61 | 62 | //! Retrieve a parameter name. 63 | bool getParameters(const char* input, std::string& name, std::string& value); 64 | 65 | //! Add the information to the contents tree 66 | void addToTree(const wxString& name, const wxString& value); 67 | 68 | //! Add the information to the index list. 69 | void addToList(const wxString& name, const wxString& value); 70 | 71 | //! Replace special HTML strings with correct code. 72 | wxString replaceHTMLChars(const wxString& input); 73 | 74 | //! HTML code for given name (if available) 75 | unsigned getHTMLCode(const wxString& name); 76 | 77 | public: 78 | //! Prevent copying, we have an unique_ptr<> member 79 | HHCParser(const HHCParser&) = delete; 80 | 81 | //! Prevent copying, we have an unique_ptr<> member 82 | HHCParser& operator=(const HHCParser&) = delete; 83 | 84 | private: 85 | int _level {0}; 86 | bool _inquote {false}; 87 | bool _intag {false}; 88 | bool _inobject {false}; 89 | std::string _tag; 90 | std::string _name; 91 | std::string _value; 92 | wxTreeCtrl* _tree; 93 | CHMListCtrl* _list; 94 | wxTreeItemId _parents[TREE_BUF_SIZE] {}; 95 | wxFontEncoding _enc; 96 | int _counter {0}; 97 | std::unique_ptr _cvPtr; 98 | bool _htmlChars {false}; 99 | }; 100 | 101 | #endif // __HHCPARSER_H_ 102 | -------------------------------------------------------------------------------- /src/lzx.h: -------------------------------------------------------------------------------- 1 | /* $Id: lzx.h,v 1.5 2002/10/08 03:43:33 jedwin Exp $ */ 2 | /*************************************************************************** 3 | * lzx.h - LZX decompression routines * 4 | * ------------------- * 5 | * * 6 | * maintainer: Jed Wing * 7 | * source: modified lzx.c from cabextract v0.5 * 8 | * notes: This file was taken from cabextract v0.5, which was, * 9 | * itself, a modified version of the lzx decompression code * 10 | * from unlzx. * 11 | ***************************************************************************/ 12 | 13 | /*************************************************************************** 14 | * * 15 | * This program is free software; you can redistribute it and/or modify * 16 | * it under the terms of the GNU General Public License as published by * 17 | * the Free Software Foundation; either version 2 of the License, or * 18 | * (at your option) any later version. Note that an exemption to this * 19 | * license has been granted by Stuart Caie for the purposes of * 20 | * distribution with chmlib. This does not, to the best of my * 21 | * knowledge, constitute a change in the license of this (the LZX) code * 22 | * in general. * 23 | * * 24 | ***************************************************************************/ 25 | 26 | #ifndef INCLUDED_LZX_H 27 | #define INCLUDED_LZX_H 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | /* return codes */ 34 | #define DECR_OK (0) 35 | #define DECR_DATAFORMAT (1) 36 | #define DECR_ILLEGALDATA (2) 37 | #define DECR_NOMEMORY (3) 38 | 39 | /* opaque state structure */ 40 | struct LZXstate; 41 | 42 | /* create an lzx state object */ 43 | struct LZXstate *LZXinit(int window); 44 | 45 | /* destroy an lzx state object */ 46 | void LZXteardown(struct LZXstate *pState); 47 | 48 | /* reset an lzx stream */ 49 | int LZXreset(struct LZXstate *pState); 50 | 51 | /* decompress an LZX compressed block */ 52 | int LZXdecompress(struct LZXstate *pState, 53 | unsigned char *inpos, 54 | unsigned char *outpos, 55 | int inlen, 56 | int outlen); 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | #endif /* INCLUDED_LZX_H */ 63 | -------------------------------------------------------------------------------- /src/wxstringutils.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2003 - 2024 Razvan Cojocaru 3 | Most of the code in this file is a modified version of code from 4 | Pabs' GPL chmdeco project, credits and thanks go to him. 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 | MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef __WXSTRING_UTILS_H_ 23 | #define __WXSTRING_UTILS_H_ 24 | 25 | #include 26 | #include 27 | 28 | #if wxUSE_UNICODE 29 | #define CURRENT_CHAR_STRING(x) wxString(reinterpret_cast(x), wxConvISO8859_1) 30 | #define CURRENT_CHAR_STRING_CV(x, cv) wxString(reinterpret_cast(x), cv) 31 | #else 32 | #define CURRENT_CHAR_STRING(x) wxString(reinterpret_cast(x)) 33 | #define CURRENT_CHAR_STRING_CV(x, cv) wxString(reinterpret_cast(x)) 34 | #endif 35 | 36 | inline std::unique_ptr createCSConvPtr(wxFontEncoding enc) 37 | { 38 | #ifdef __WXMSW__ 39 | return std::make_unique(enc); 40 | #else 41 | switch (enc) { 42 | case wxFONTENCODING_CP950: 43 | return std::make_unique(wxT("BIG5")); 44 | case wxFONTENCODING_CP932: 45 | return std::make_unique(wxT("SJIS")); 46 | default: 47 | return std::make_unique(enc); 48 | } 49 | #endif 50 | } 51 | 52 | #if wxUSE_UNICODE 53 | inline wxString translateEncoding(const wxString& input, wxFontEncoding enc) 54 | { 55 | if (!input.IsEmpty() && enc != wxFONTENCODING_SYSTEM) { 56 | wxCSConv convFrom(wxFONTENCODING_ISO8859_1); 57 | auto convToPtr = createCSConvPtr(enc); 58 | 59 | return wxString(input.mb_str(convFrom), *convToPtr); 60 | } 61 | 62 | return input; 63 | } 64 | #else 65 | #define translateEncoding(x, y) x 66 | #endif 67 | 68 | inline wxChar charForCode(unsigned code, const wxCSConv& WXUNUSED_IN_UNICODE(cv), bool WXUNUSED_IN_UNICODE(conv)) 69 | { 70 | #if !wxUSE_UNICODE 71 | #if wxUSE_WCHAR_T 72 | if (code < 256) 73 | return static_cast(code); 74 | 75 | if (conv) { 76 | char buf[2]; 77 | wchar_t wbuf[2] {}; 78 | 79 | wbuf[0] = static_cast(code); 80 | 81 | cv.WC2MB(buf, wbuf, 2); 82 | 83 | if (cv.WC2MB(buf, wbuf, 2) == static_cast(-1)) 84 | return '?'; 85 | 86 | return buf[0]; 87 | } else 88 | return static_cast(code); 89 | #else 90 | return (code < 256) ? static_cast(code) : '?'; 91 | #endif 92 | #else 93 | return static_cast(code); 94 | #endif 95 | } 96 | 97 | #endif // __WXSTRING_UTILS_H_ 98 | -------------------------------------------------------------------------------- /src/xchm_chm_lib.h: -------------------------------------------------------------------------------- 1 | /* $Id: chm_lib.h,v 1.10 2002/10/09 01:16:33 jedwin Exp $ */ 2 | /*************************************************************************** 3 | * chm_lib.h - CHM archive manipulation routines * 4 | * ------------------- * 5 | * * 6 | * author: Jed Wing * 7 | * version: 0.3 * 8 | * notes: These routines are meant for the manipulation of microsoft * 9 | * .chm (compiled html help) files, but may likely be used * 10 | * for the manipulation of any ITSS archive, if ever ITSS * 11 | * archives are used for any other purpose. * 12 | * * 13 | * Note also that the section names are statically handled. * 14 | * To be entirely correct, the section names should be read * 15 | * from the section names meta-file, and then the various * 16 | * content sections and the "transforms" to apply to the data * 17 | * they contain should be inferred from the section name and * 18 | * the meta-files referenced using that name; however, all of * 19 | * the files I've been able to get my hands on appear to have * 20 | * only two sections: Uncompressed and MSCompressed. * 21 | * Additionally, the ITSS.DLL file included with Windows does * 22 | * not appear to handle any different transforms than the * 23 | * simple LZX-transform. Furthermore, the list of transforms * 24 | * to apply is broken, in that only half the required space * 25 | * is allocated for the list. (It appears as though the * 26 | * space is allocated for ASCII strings, but the strings are * 27 | * written as unicode. As a result, only the first half of * 28 | * the string appears.) So this is probably not too big of * 29 | * a deal, at least until CHM v4 (MS .lit files), which also * 30 | * incorporate encryption, of some description. * 31 | ***************************************************************************/ 32 | 33 | /*************************************************************************** 34 | * * 35 | * This program is free software; you can redistribute it and/or modify * 36 | * it under the terms of the GNU Lesser General Public License as * 37 | * published by the Free Software Foundation; either version 2.1 of the * 38 | * License, or (at your option) any later version. * 39 | * * 40 | ***************************************************************************/ 41 | 42 | #ifndef INCLUDED_CHMLIB_H 43 | #define INCLUDED_CHMLIB_H 44 | 45 | #ifdef __cplusplus 46 | extern "C" { 47 | #endif 48 | 49 | /* RWE 6/12/1002 */ 50 | #ifdef PPC_BSTR 51 | #include 52 | #endif 53 | 54 | #ifdef WIN32 55 | #ifdef __MINGW32__ 56 | #define __int64 long long 57 | #endif 58 | typedef unsigned __int64 LONGUINT64; 59 | typedef __int64 LONGINT64; 60 | #else 61 | typedef unsigned long long LONGUINT64; 62 | typedef long long LONGINT64; 63 | #endif 64 | 65 | /* the two available spaces in a CHM file */ 66 | /* N.B.: The format supports arbitrarily many spaces, but only */ 67 | /* two appear to be used at present. */ 68 | #define CHM_UNCOMPRESSED (0) 69 | #define CHM_COMPRESSED (1) 70 | 71 | /* structure representing an ITS (CHM) file stream */ 72 | struct chmFile; 73 | 74 | /* structure representing an element from an ITS file stream */ 75 | #define CHM_MAX_PATHLEN (512) 76 | struct chmUnitInfo 77 | { 78 | LONGUINT64 start; 79 | LONGUINT64 length; 80 | int space; 81 | int flags; 82 | char path[CHM_MAX_PATHLEN+1]; 83 | }; 84 | 85 | /* open an ITS archive */ 86 | #ifdef PPC_BSTR 87 | /* RWE 6/12/2003 */ 88 | struct chmFile* chm_open(BSTR filename); 89 | #else 90 | struct chmFile* chm_open(const char *filename); 91 | #endif 92 | 93 | /* close an ITS archive */ 94 | void chm_close(struct chmFile *h); 95 | 96 | /* methods for ssetting tuning parameters for particular file */ 97 | #define CHM_PARAM_MAX_BLOCKS_CACHED 0 98 | void chm_set_param(struct chmFile *h, 99 | int paramType, 100 | int paramVal); 101 | 102 | /* resolve a particular object from the archive */ 103 | #define CHM_RESOLVE_SUCCESS (0) 104 | #define CHM_RESOLVE_FAILURE (1) 105 | int chm_resolve_object(struct chmFile *h, 106 | const char *objPath, 107 | struct chmUnitInfo *ui); 108 | 109 | /* retrieve part of an object from the archive */ 110 | LONGINT64 chm_retrieve_object(struct chmFile *h, 111 | struct chmUnitInfo *ui, 112 | unsigned char *buf, 113 | LONGUINT64 addr, 114 | LONGINT64 len); 115 | 116 | /* enumerate the objects in the .chm archive */ 117 | typedef int (*CHM_ENUMERATOR)(struct chmFile *h, 118 | struct chmUnitInfo *ui, 119 | void *context); 120 | #define CHM_ENUMERATE_NORMAL (1) 121 | #define CHM_ENUMERATE_META (2) 122 | #define CHM_ENUMERATE_SPECIAL (4) 123 | #define CHM_ENUMERATE_FILES (8) 124 | #define CHM_ENUMERATE_DIRS (16) 125 | #define CHM_ENUMERATE_ALL (31) 126 | #define CHM_ENUMERATOR_FAILURE (0) 127 | #define CHM_ENUMERATOR_CONTINUE (1) 128 | #define CHM_ENUMERATOR_SUCCESS (2) 129 | int chm_enumerate(struct chmFile *h, 130 | int what, 131 | CHM_ENUMERATOR e, 132 | void *context); 133 | 134 | int chm_enumerate_dir(struct chmFile *h, 135 | const char *prefix, 136 | int what, 137 | CHM_ENUMERATOR e, 138 | void *context); 139 | 140 | #ifdef __cplusplus 141 | } 142 | #endif 143 | 144 | #endif /* INCLUDED_CHMLIB_H */ 145 | --------------------------------------------------------------------------------