Codebase list gman / 904688e
Import Debian changes 0.9.3-2 gman (0.9.3-2) unstable; urgency=low * Recompiled with new maintainer address, new gcc, new standards version. gman (0.9.3-1) unstable; urgency=low * New upstream version, closes: #156493. * Severe hacking around the CGI crap. Josip Rodin authored 20 years ago Boyuan Yang committed 4 years ago
22 changed file(s) with 990 addition(s) and 128 deletion(s). Raw diff Collapse all Expand all
Binary diff not shown
+0
-6
AUTHEORS less more
0 gman:
1 Xinkai Wang <aakwxk@hotmail.com>
2
3 special thanks to Josip Rodin<jrodin@jagor.srce.hr>,
4 who provide a patch to improve gman from 0.0.7 to 0.0.8
5
00
11 Gman main author:
22 Xinkai Wang <aakwxk@hotmail.com>
3
3
44 Special thanks to Josip Rodin <jrodin@jagor.srce.hr>,
55 who provided a patch to improve gman from 0.0.7 to 0.0.8.
0 GNU GENERAL PUBLIC LICENSE
1 Version 2, June 1991
2
3 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
4 675 Mass Ave, Cambridge, MA 02139, USA
5 Everyone is permitted to copy and distribute verbatim copies
6 of this license document, but changing it is not allowed.
7
8 Preamble
9
10 The licenses for most software are designed to take away your
11 freedom to share and change it. By contrast, the GNU General Public
12 License is intended to guarantee your freedom to share and change free
13 software--to make sure the software is free for all its users. This
14 General Public License applies to most of the Free Software
15 Foundation's software and to any other program whose authors commit to
16 using it. (Some other Free Software Foundation software is covered by
17 the GNU Library General Public License instead.) You can apply it to
18 your programs, too.
19
20 When we speak of free software, we are referring to freedom, not
21 price. Our General Public Licenses are designed to make sure that you
22 have the freedom to distribute copies of free software (and charge for
23 this service if you wish), that you receive source code or can get it
24 if you want it, that you can change the software or use pieces of it
25 in new free programs; and that you know you can do these things.
26
27 To protect your rights, we need to make restrictions that forbid
28 anyone to deny you these rights or to ask you to surrender the rights.
29 These restrictions translate to certain responsibilities for you if you
30 distribute copies of the software, or if you modify it.
31
32 For example, if you distribute copies of such a program, whether
33 gratis or for a fee, you must give the recipients all the rights that
34 you have. You must make sure that they, too, receive or can get the
35 source code. And you must show them these terms so they know their
36 rights.
37
38 We protect your rights with two steps: (1) copyright the software, and
39 (2) offer you this license which gives you legal permission to copy,
40 distribute and/or modify the software.
41
42 Also, for each author's protection and ours, we want to make certain
43 that everyone understands that there is no warranty for this free
44 software. If the software is modified by someone else and passed on, we
45 want its recipients to know that what they have is not the original, so
46 that any problems introduced by others will not reflect on the original
47 authors' reputations.
48
49 Finally, any free program is threatened constantly by software
50 patents. We wish to avoid the danger that redistributors of a free
51 program will individually obtain patent licenses, in effect making the
52 program proprietary. To prevent this, we have made it clear that any
53 patent must be licensed for everyone's free use or not licensed at all.
54
55 The precise terms and conditions for copying, distribution and
56 modification follow.
57
58 GNU GENERAL PUBLIC LICENSE
59 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
60
61 0. This License applies to any program or other work which contains
62 a notice placed by the copyright holder saying it may be distributed
63 under the terms of this General Public License. The "Program", below,
64 refers to any such program or work, and a "work based on the Program"
65 means either the Program or any derivative work under copyright law:
66 that is to say, a work containing the Program or a portion of it,
67 either verbatim or with modifications and/or translated into another
68 language. (Hereinafter, translation is included without limitation in
69 the term "modification".) Each licensee is addressed as "you".
70
71 Activities other than copying, distribution and modification are not
72 covered by this License; they are outside its scope. The act of
73 running the Program is not restricted, and the output from the Program
74 is covered only if its contents constitute a work based on the
75 Program (independent of having been made by running the Program).
76 Whether that is true depends on what the Program does.
77
78 1. You may copy and distribute verbatim copies of the Program's
79 source code as you receive it, in any medium, provided that you
80 conspicuously and appropriately publish on each copy an appropriate
81 copyright notice and disclaimer of warranty; keep intact all the
82 notices that refer to this License and to the absence of any warranty;
83 and give any other recipients of the Program a copy of this License
84 along with the Program.
85
86 You may charge a fee for the physical act of transferring a copy, and
87 you may at your option offer warranty protection in exchange for a fee.
88
89 2. You may modify your copy or copies of the Program or any portion
90 of it, thus forming a work based on the Program, and copy and
91 distribute such modifications or work under the terms of Section 1
92 above, provided that you also meet all of these conditions:
93
94 a) You must cause the modified files to carry prominent notices
95 stating that you changed the files and the date of any change.
96
97 b) You must cause any work that you distribute or publish, that in
98 whole or in part contains or is derived from the Program or any
99 part thereof, to be licensed as a whole at no charge to all third
100 parties under the terms of this License.
101
102 c) If the modified program normally reads commands interactively
103 when run, you must cause it, when started running for such
104 interactive use in the most ordinary way, to print or display an
105 announcement including an appropriate copyright notice and a
106 notice that there is no warranty (or else, saying that you provide
107 a warranty) and that users may redistribute the program under
108 these conditions, and telling the user how to view a copy of this
109 License. (Exception: if the Program itself is interactive but
110 does not normally print such an announcement, your work based on
111 the Program is not required to print an announcement.)
112
113 These requirements apply to the modified work as a whole. If
114 identifiable sections of that work are not derived from the Program,
115 and can be reasonably considered independent and separate works in
116 themselves, then this License, and its terms, do not apply to those
117 sections when you distribute them as separate works. But when you
118 distribute the same sections as part of a whole which is a work based
119 on the Program, the distribution of the whole must be on the terms of
120 this License, whose permissions for other licensees extend to the
121 entire whole, and thus to each and every part regardless of who wrote it.
122
123 Thus, it is not the intent of this section to claim rights or contest
124 your rights to work written entirely by you; rather, the intent is to
125 exercise the right to control the distribution of derivative or
126 collective works based on the Program.
127
128 In addition, mere aggregation of another work not based on the Program
129 with the Program (or with a work based on the Program) on a volume of
130 a storage or distribution medium does not bring the other work under
131 the scope of this License.
132
133 3. You may copy and distribute the Program (or a work based on it,
134 under Section 2) in object code or executable form under the terms of
135 Sections 1 and 2 above provided that you also do one of the following:
136
137 a) Accompany it with the complete corresponding machine-readable
138 source code, which must be distributed under the terms of Sections
139 1 and 2 above on a medium customarily used for software interchange; or,
140
141 b) Accompany it with a written offer, valid for at least three
142 years, to give any third party, for a charge no more than your
143 cost of physically performing source distribution, a complete
144 machine-readable copy of the corresponding source code, to be
145 distributed under the terms of Sections 1 and 2 above on a medium
146 customarily used for software interchange; or,
147
148 c) Accompany it with the information you received as to the offer
149 to distribute corresponding source code. (This alternative is
150 allowed only for noncommercial distribution and only if you
151 received the program in object code or executable form with such
152 an offer, in accord with Subsection b above.)
153
154 The source code for a work means the preferred form of the work for
155 making modifications to it. For an executable work, complete source
156 code means all the source code for all modules it contains, plus any
157 associated interface definition files, plus the scripts used to
158 control compilation and installation of the executable. However, as a
159 special exception, the source code distributed need not include
160 anything that is normally distributed (in either source or binary
161 form) with the major components (compiler, kernel, and so on) of the
162 operating system on which the executable runs, unless that component
163 itself accompanies the executable.
164
165 If distribution of executable or object code is made by offering
166 access to copy from a designated place, then offering equivalent
167 access to copy the source code from the same place counts as
168 distribution of the source code, even though third parties are not
169 compelled to copy the source along with the object code.
170
171 4. You may not copy, modify, sublicense, or distribute the Program
172 except as expressly provided under this License. Any attempt
173 otherwise to copy, modify, sublicense or distribute the Program is
174 void, and will automatically terminate your rights under this License.
175 However, parties who have received copies, or rights, from you under
176 this License will not have their licenses terminated so long as such
177 parties remain in full compliance.
178
179 5. You are not required to accept this License, since you have not
180 signed it. However, nothing else grants you permission to modify or
181 distribute the Program or its derivative works. These actions are
182 prohibited by law if you do not accept this License. Therefore, by
183 modifying or distributing the Program (or any work based on the
184 Program), you indicate your acceptance of this License to do so, and
185 all its terms and conditions for copying, distributing or modifying
186 the Program or works based on it.
187
188 6. Each time you redistribute the Program (or any work based on the
189 Program), the recipient automatically receives a license from the
190 original licensor to copy, distribute or modify the Program subject to
191 these terms and conditions. You may not impose any further
192 restrictions on the recipients' exercise of the rights granted herein.
193 You are not responsible for enforcing compliance by third parties to
194 this License.
195
196 7. If, as a consequence of a court judgment or allegation of patent
197 infringement or for any other reason (not limited to patent issues),
198 conditions are imposed on you (whether by court order, agreement or
199 otherwise) that contradict the conditions of this License, they do not
200 excuse you from the conditions of this License. If you cannot
201 distribute so as to satisfy simultaneously your obligations under this
202 License and any other pertinent obligations, then as a consequence you
203 may not distribute the Program at all. For example, if a patent
204 license would not permit royalty-free redistribution of the Program by
205 all those who receive copies directly or indirectly through you, then
206 the only way you could satisfy both it and this License would be to
207 refrain entirely from distribution of the Program.
208
209 If any portion of this section is held invalid or unenforceable under
210 any particular circumstance, the balance of the section is intended to
211 apply and the section as a whole is intended to apply in other
212 circumstances.
213
214 It is not the purpose of this section to induce you to infringe any
215 patents or other property right claims or to contest validity of any
216 such claims; this section has the sole purpose of protecting the
217 integrity of the free software distribution system, which is
218 implemented by public license practices. Many people have made
219 generous contributions to the wide range of software distributed
220 through that system in reliance on consistent application of that
221 system; it is up to the author/donor to decide if he or she is willing
222 to distribute software through any other system and a licensee cannot
223 impose that choice.
224
225 This section is intended to make thoroughly clear what is believed to
226 be a consequence of the rest of this License.
227
228 8. If the distribution and/or use of the Program is restricted in
229 certain countries either by patents or by copyrighted interfaces, the
230 original copyright holder who places the Program under this License
231 may add an explicit geographical distribution limitation excluding
232 those countries, so that distribution is permitted only in or among
233 countries not thus excluded. In such case, this License incorporates
234 the limitation as if written in the body of this License.
235
236 9. The Free Software Foundation may publish revised and/or new versions
237 of the General Public License from time to time. Such new versions will
238 be similar in spirit to the present version, but may differ in detail to
239 address new problems or concerns.
240
241 Each version is given a distinguishing version number. If the Program
242 specifies a version number of this License which applies to it and "any
243 later version", you have the option of following the terms and conditions
244 either of that version or of any later version published by the Free
245 Software Foundation. If the Program does not specify a version number of
246 this License, you may choose any version ever published by the Free Software
247 Foundation.
248
249 10. If you wish to incorporate parts of the Program into other free
250 programs whose distribution conditions are different, write to the author
251 to ask for permission. For software which is copyrighted by the Free
252 Software Foundation, write to the Free Software Foundation; we sometimes
253 make exceptions for this. Our decision will be guided by the two goals
254 of preserving the free status of all derivatives of our free software and
255 of promoting the sharing and reuse of software generally.
256
257 NO WARRANTY
258
259 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
260 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
261 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
262 PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
263 OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
264 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
265 TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
266 PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
267 REPAIR OR CORRECTION.
268
269 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
270 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
271 REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
272 INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
273 OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
274 TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
275 YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
276 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
277 POSSIBILITY OF SUCH DAMAGES.
278
279 END OF TERMS AND CONDITIONS
280
281 Appendix: How to Apply These Terms to Your New Programs
282
283 If you develop a new program, and you want it to be of the greatest
284 possible use to the public, the best way to achieve this is to make it
285 free software which everyone can redistribute and change under these terms.
286
287 To do so, attach the following notices to the program. It is safest
288 to attach them to the start of each source file to most effectively
289 convey the exclusion of warranty; and each file should have at least
290 the "copyright" line and a pointer to where the full notice is found.
291
292 <one line to give the program's name and a brief idea of what it does.>
293 Copyright (C) 19yy <name of author>
294
295 This program is free software; you can redistribute it and/or modify
296 it under the terms of the GNU General Public License as published by
297 the Free Software Foundation; either version 2 of the License, or
298 (at your option) any later version.
299
300 This program is distributed in the hope that it will be useful,
301 but WITHOUT ANY WARRANTY; without even the implied warranty of
302 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
303 GNU General Public License for more details.
304
305 You should have received a copy of the GNU General Public License
306 along with this program; if not, write to the Free Software
307 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
308
309 Also add information on how to contact you by electronic and paper mail.
310
311 If the program is interactive, make it output a short notice like this
312 when it starts in an interactive mode:
313
314 Gnomovision version 69, Copyright (C) 19yy name of author
315 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
316 This is free software, and you are welcome to redistribute it
317 under certain conditions; type `show c' for details.
318
319 The hypothetical commands `show w' and `show c' should show the appropriate
320 parts of the General Public License. Of course, the commands you use may
321 be called something other than `show w' and `show c'; they could even be
322 mouse-clicks or menu items--whatever suits your program.
323
324 You should also get your employer (if you work as a programmer) or your
325 school, if any, to sign a "copyright disclaimer" for the program, if
326 necessary. Here is a sample; alter the names:
327
328 Yoyodyne, Inc., hereby disclaims all copyright interest in the program
329 `Gnomovision' (which makes passes at compilers) written by James Hacker.
330
331 <signature of Ty Coon>, 1 April 1989
332 Ty Coon, President of Vice
333
334 This General Public License does not permit incorporating your program into
335 proprietary programs. If your program is a subroutine library, you may
336 consider it more useful to permit linking proprietary applications with the
337 library. If this is what you want to do, use the GNU Library General
338 Public License instead of this License.
00 ChangeLog for Gman by Xinkai Wang
1
2 v0.9.2 (31.Mar 2001)
3 - CGI front-end for man2html (gman.pl) added.
4 - Two new "View Mode": LocalBrowse and NetBrowse.
5
6 v0.9.1 (27.Mar 2001)
7 - bug fix in mandata.h:20 and menu.c:592 when compile with GCC 2.95.3,
8 (reported by Petter Sundlöf )
9
10 v0.9.0 (26.Mar 2001)
11 - add show_mode selecting ("View" menu item). GhostView support.
12 (suggested by Michael T. Babcock )
13 - rpm package available.
114
215 v0.0.8 (10/17/99)
316 - pure GTK+ implement, independent from gnome
11 # You can adjust the following variables.
22
33 CXX = g++
4 CXXFLAGS = -DVERSION=\"0.0.8\" `gtk-config --cflags` -O2 -Wall ${DEBUG}
4 CXXFLAGS = -DVERSION=\"0.9.3\" $(shell gtk-config --cflags) -O2 -Wall
55 CC = $(CXX) $(CXXFLAGS)
66
7 gnomelibs = #`gnome-config --libs gnomeui`
8 prefix = /usr/local
7 prefix = /usr
8 cgi_bin_prefix = ${prefix}/lib/cgi-bin
9
10 # There shouldn't be any need to edit anything below this point.
11 all: gman
912
1013 objectfiles = menu.o mandata.o util.o gman.o list.o context.o task.o \
1114 taskfunc.o window2.o
1215
13 # There shouldn't be any need to edit anything below this point.
1416 gman: $(objectfiles)
15 $(CC) -lgtk -lgdk -lpthread $(gnomelibs) $(objectfiles) -o gman
17 $(CC) -lgtk -lgdk -lpthread $(shell gtk-config --libs) $(objectfiles) -o gman
1618
1719 %.o: %.c %.h
1820 gman.o: gman.c gman.h menu.h
2830 install:
2931 test -d $(prefix)/bin || mkdir -p $(prefix)/bin
3032 test -d $(prefix)/share/man/man1 || mkdir -p $(prefix)/share/man/man1
31 install -s -m 755 gman $(prefix)/bin
33 test -d $(cgi_bin_prefix) || mkdir -p $(cgi_bin_prefix)
34 install -s -m 755 gman $(prefix)/bin/
35 install -m 755 gman.pl $(cgi_bin_prefix)/gman.pl
3236 install -m 644 gman.1x $(prefix)/share/man/man1
1010 Unix/Linux. When I was a newbie of Linux, I felt I always could not find
1111 the man pages that I need. I believed the man pages must be somewhere in the
1212 system, but I just could not find the name of it.
13
13
1414 So I thought, maybe we need new graphical man page system. I don't like
1515 xman because it looks ugly and it is difficult to use (I felt). I think
1616 gnome-help-browser is too slow and it eats too much memory (about 12M on my
2121 the help system on windoze). This will help a newbie to find the
2222 information that s/he needs, and sometimes help him/her go around to see
2323 what other man pages are there in the system, in his leisure time.
24
24
2525 Gman is nothing else but a simple front-end for the usual man page system.
2626 The most basic job of gman is to build a database for all the man pages
2727 and display them (or part of them) on the screen. When user decides to read
3333 Installation
3434 ============
3535
36 (possibly editing of Makefile)
36 (possibly editing of Makefile and gman.pl)
3737 $ make
3838 (change to super user if needed)
3939 # make install
40
41 As default, This will put gman binary in /usr/local/bin, and its manual page
42 in /usr/local/man/man1. cgi script in /home/httpd/cgi-bin/gman.
4043
41 This will put gman binary in /usr/local/bin, and its manual page
42 in /usr/local/man/man1.
44 If you don't like the default locations, try to change "prefix" and
45 "cgi_bin_prefix" to other values (in Makefile). And, if your perl
46 is not in /usr/bin/perl, you may need to modify the first line in gman.pl
47 accordingly.
4348
4449 Features of this version
4550 ========================
4752 It's easy to write a simple software that can work, but the problem is
4853 in making it work better. It took me a lot of time to improve it's UI
4954 and some other little things, such as:
50
55
5156 1. Multi-threading.
5257 When you have many manual pages on your system, some of the work (such
5358 as update window) will take a lot of time. So I used multi-thread
5459 programming, which means that the user can input new commands at any
5560 time, without waiting for the previous operation to end.
56
61
5762 2. ~/.gman file.
5863 Every time gman starts up, it will read some configuration information
5964 from $HOME/.gman file. And every time gman exits, it will also write the
6368 To do
6469 =====
6570
71 * autoconf support, especially if GNOME support is included.
6672 * use of gettext for easier translation to other languages.
67 * autoconf support, especially if GNOME support is included.
6873 * improvement for the parser which reads the ~/.gman file (context.c).
6974 * internal method of displaying manual pages, not with xterm.
70
75
7176 Your comments and suggestions will be the most important for gman
7277 development. Patches (bug fixes or code additions) are welcome.
7378
7479 Final note
7580 ==========
7681
77 I wonder if it is worthy for me to spend more time on it. Maybe, if you are
78 already an expert, you will feel I'm wasting my time doing such useless
79 work. I believe a user-friendly graphical interface is extremely important
80 for a software system. Sometimes (often) people find it even more important
82 I wonder if it is worthy for me to spend more time on it. I believe a
83 user-friendly graphical interface is extremely important for a
84 software system. Sometimes (often) people find it even more important
8185 than the contents of the software! (windoze is a good example)
8286
83 I hope you will benefit from my work.
87 I hope more people can benefit because of my work.
8488
8589 /* gman
8690 * Copyright (C) 1999 Xinkai Wang
0
1 General Information
2 ===================
3
4 This is Gman, a GTK+ front end for man.
5
6 Gman's home page will be in http://homex.s-one.net.sg/user/xkwang/gman
7 (still under construction)
8
9 This a little piece of software is mostly developed for the new users of
10 Unix/Linux. When I was a newbie of Linux, I felt I always could not find
11 the man pages that I need. I believed the man pages must be somewhere in the
12 system, but I just could not find the name of it.
13
14 So I thought, maybe we need new graphical man page system. I don't like
15 xman because it looks ugly and it is difficult to use (I felt). I think
16 gnome-help-browser is too slow and it eats too much memory (about 12M on my
17 system). It does not have index search function, and it can not be operated
18 with keyboard shortcuts.
19
20 I think an ideal help system must have the index search function (just like
21 the help system on windoze). This will help a newbie to find the
22 information that s/he needs, and sometimes help him/her go around to see
23 what other man pages are there in the system, in his leisure time.
24
25 Gman is nothing else but a simple front-end for the usual man page system.
26 The most basic job of gman is to build a database for all the man pages
27 and display them (or part of them) on the screen. When user decides to read
28 a man page, gman will launch a xterm window and call the normal man system
29 to display the man page in the window. Gman can launch more than one xterm
30 window at same time. And user can use the index search function to look for
31 the man pages that s/he needs.
32
33 Installation
34 ============
35
36 (possibly editing of Makefile)
37 $ make
38 (change to super user if needed)
39 # make install
40
41 This will put gman binary in /usr/local/bin, and its manual page
42 in /usr/local/man/man1.
43
44 Features of this version
45 ========================
46
47 It's easy to write a simple software that can work, but the problem is
48 in making it work better. It took me a lot of time to improve it's UI
49 and some other little things, such as:
50
51 1. Multi-threading.
52 When you have many manual pages on your system, some of the work (such
53 as update window) will take a lot of time. So I used multi-thread
54 programming, which means that the user can input new commands at any
55 time, without waiting for the previous operation to end.
56
57 2. ~/.gman file.
58 Every time gman starts up, it will read some configuration information
59 from $HOME/.gman file. And every time gman exits, it will also write the
60 current configuration information to that same file. ~/.gman file is a
61 simple text file and can be edited using any text editor.
62
63 To do
64 =====
65
66 * autoconf support, especially if GNOME support is included.
67 * use of gettext for easier translation to other languages.
68 * improvment for the parser when reading the ~/.gman file (context.c).
69 * internal method of displaying manual pages, not with xterm.
70
71 Your comments and suggestions will be the most important for gman
72 development. Patches (bug fixes or code additions) are welcome.
73
74 Final note
75 ==========
76
77 I wonder if it is worthy for me to spend more time on it. Maybe, if you are
78 already an expert, you will feel I'm wasting my time doing such useless
79 work. I believe a user-friendly graphical interface is extremely important
80 for a software system. Sometimes (often) people find it even more important
81 than the contents of the software! (windoze is a good example)
82
83 I hope you will benefit from my work.
84
85 /* gman
86 * Copyright (C) 1999 Xinkai Wang
87 *
88 * This program is free software; you can redistribute it and/or modify
89 * it under the terms of the GNU General Public License as published by
90 * the Free Software Foundation; either version 2 of the License, or
91 * (at your option) any later version.
92 *
93 * This program is distributed in the hope that it will be useful,
94 * but WITHOUT ANY WARRANTY; without even the implied warranty of
95 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
96 * GNU General Public License for more details.
97 *
98 * You should have received a copy of the GNU General Public License
99 * along with this program; if not, write to the Free Software
100 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
101 */
0 ***************
1 *** 11,28 ****
2 Unix/Linux. When I was a newbie of Linux, I felt I always could not find
3 the man pages that I need. I believed the man pages must be somewhere in the
4 system, but I just could not find the name of it.
5 -
6 So I thought, maybe we need new graphical man page system. I don't like
7 xman because it looks ugly and it is difficult to use (I felt). I think
8 gnome-help-browser is too slow and it eats too much memory (about 12M on my
9 system). It does not have index search function, and it can not be operated
10 with keyboard shortcuts.
11 -
12 I think an ideal help system must have the index search function (just like
13 the help system on windoze). This will help a newbie to find the
14 information that s/he needs, and sometimes help him/her go around to see
15 what other man pages are there in the system, in his leisure time.
16 -
17 Gman is nothing else but a simple front-end for the usual man page system.
18 The most basic job of gman is to build a database for all the man pages
19 and display them (or part of them) on the screen. When user decides to read
20 --- 11,28 ----
21 Unix/Linux. When I was a newbie of Linux, I felt I always could not find
22 the man pages that I need. I believed the man pages must be somewhere in the
23 system, but I just could not find the name of it.
24 +
25 So I thought, maybe we need new graphical man page system. I don't like
26 xman because it looks ugly and it is difficult to use (I felt). I think
27 gnome-help-browser is too slow and it eats too much memory (about 12M on my
28 system). It does not have index search function, and it can not be operated
29 with keyboard shortcuts.
30 +
31 I think an ideal help system must have the index search function (just like
32 the help system on windoze). This will help a newbie to find the
33 information that s/he needs, and sometimes help him/her go around to see
34 what other man pages are there in the system, in his leisure time.
35 +
36 Gman is nothing else but a simple front-end for the usual man page system.
37 The most basic job of gman is to build a database for all the man pages
38 and display them (or part of them) on the screen. When user decides to read
39 ***************
40 *** 38,44 ****
41 $ make
42 (change to super user if needed)
43 # make install
44 -
45 This will put gman binary in /usr/local/bin, and its manual page
46 in /usr/local/man/man1.
47
48 --- 38,44 ----
49 $ make
50 (change to super user if needed)
51 # make install
52 +
53 This will put gman binary in /usr/local/bin, and its manual page
54 in /usr/local/man/man1.
55
56 ***************
57 *** 48,60 ****
58 It's easy to write a simple software that can work, but the problem is
59 in making it work better. It took me a lot of time to improve it's UI
60 and some other little things, such as:
61 -
62 1. Multi-threading.
63 When you have many manual pages on your system, some of the work (such
64 as update window) will take a lot of time. So I used multi-thread
65 programming, which means that the user can input new commands at any
66 time, without waiting for the previous operation to end.
67 -
68 2. ~/.gman file.
69 Every time gman starts up, it will read some configuration information
70 from $HOME/.gman file. And every time gman exits, it will also write the
71 --- 48,60 ----
72 It's easy to write a simple software that can work, but the problem is
73 in making it work better. It took me a lot of time to improve it's UI
74 and some other little things, such as:
75 +
76 1. Multi-threading.
77 When you have many manual pages on your system, some of the work (such
78 as update window) will take a lot of time. So I used multi-thread
79 programming, which means that the user can input new commands at any
80 time, without waiting for the previous operation to end.
81 +
82 2. ~/.gman file.
83 Every time gman starts up, it will read some configuration information
84 from $HOME/.gman file. And every time gman exits, it will also write the
85 ***************
86 *** 64,74 ****
87 To do
88 =====
89
90 - * autoconf support, especially if GNOME support is included.
91 * use of gettext for easier translation to other languages.
92 - * improvment for the parser when reading the ~/.gman file (context.c).
93 * internal method of displaying manual pages, not with xterm.
94 -
95 Your comments and suggestions will be the most important for gman
96 development. Patches (bug fixes or code additions) are welcome.
97
98 --- 64,74 ----
99 To do
100 =====
101
102 * use of gettext for easier translation to other languages.
103 + * autoconf support, especially if GNOME support is included.
104 + * improvement for the parser which reads the ~/.gman file (context.c).
105 * internal method of displaying manual pages, not with xterm.
106 +
107 Your comments and suggestions will be the most important for gman
108 development. Patches (bug fixes or code additions) are welcome.
109
0 #!/usr/local/bin/perl
1
2 open (LOG,">>/dat/gman.log");
3
4 while(<>) {
5 print STDERR "$_";
6 }
7
8 print `cat /home/wxk/src/gtk/gman.html`;
9 close(LOG);
0 gman (0.9.3-2) unstable; urgency=low
1
2 * Recompiled with new maintainer address, new gcc, new standards version.
3
4 -- Josip Rodin <joy-packages@debian.org> Thu, 3 Jul 2003 00:56:58 +0200
5
6 gman (0.9.3-1) unstable; urgency=low
7
8 * New upstream version, closes: #156493.
9 * Severe hacking around the CGI crap.
10
11 -- Josip Rodin <jrodin@jagor.srce.hr> Tue, 13 Aug 2002 15:28:34 +0200
12
013 gman (0.0.8-6) unstable; urgency=low
114
215 * Added patches kindly provided by Gergely Nagy to make it compile
5972 * Wrote gman.1x manual page.
6073
6174 -- Josip Rodin <jrodin@jagor.srce.hr> Tue, 12 Oct 1999 14:31:42 +0200
62
63 Local variables:
64 mode: debian-changelog
65 End:
00 Source: gman
11 Section: doc
22 Priority: optional
3 Maintainer: Josip Rodin <jrodin@jagor.srce.hr>
3 Maintainer: Josip Rodin <joy-packages@debian.org>
44 Build-Depends: debhelper (>= 2), xlibs-dev, libglib1.2-dev, libgtk1.2-dev, libjpeg62-dev
5 Standards-Version: 3.5.5
5 Standards-Version: 3.6.0
66
77 Package: gman
88 Architecture: any
99 Depends: ${shlibs:Depends}, man-db, xterm | x-terminal-emulator
10 Suggests: gv, man2html, httpd
1011 Provides: man-browser
11 Description: small X/GTK+ based man(1) front-end
12 Description: small man(1) front-end for X
1213 Gman is nothing else but only a simple front-end for the original man
1314 page system. The most basic job of gman is to build a database for all
1415 the man pages and display them (or part of them) on the screen. When
00 This package was debianized by Josip Rodin <jrodin@jagor.srce.hr> on
11 Tue, 12 Oct 1999 14:31:42 +0200.
22
3 It was downloaded from: http://homex.s-one.net.sg/user/xkwang/gman
3 It was downloaded from: http://homex.coolconnect.com/user/xkwang/gman/
44
55 Upstream author: Xinkai Wang <aakwxk@hotmail.com>.
66
7 /* gman
8 * Copyright (C) 1999 Xinkai Wang
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 */
7 Copyright (C) 1999 Xinkai Wang
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23 The full text of the GNU GPL can be found in /usr/share/common-licenses/GPL.
0 Summary: Gtk+ front-end for man, a good replacment for xman
1 Name: gman
2 Version: 0.9.3
3 Release: 1
4 Copyright: GPL
5 Group: Applications/System
6 Source: http://homex.coolconnect.com/user/xkwang/gman/gman-0.9.3.tar.gz
7 BuildRoot: /var/tmp/%{name}-buildroot
8
9 %description
10
11 Gman is a front-end for the original man page system. The most basic
12 job of gman is to build a database for all the man pages and display
13 them (or part of them) as a list. When user click on a item in the
14 list, gman will launch a new window (xterm, cxterm, gv, netscape
15 browser, etc.) and call the traditional man system to display the man
16 page to the user.
17
18 It is simple but useful, especialy for the Linux newbies who have
19 difficalty in finding information with traditional man system.
20
21 %prep
22 %setup -q
23
24 %build
25 make
26
27 %install
28 rm -rf $RPM_BUILD_ROOT
29 mkdir -p $RPM_BUILD_ROOT/usr/bin
30 mkdir -p $RPM_BUILD_ROOT/usr/man/man1
31 mkdir -p $RPM_BUILD_ROOT/var/www/cgi-bin/gman
32
33 install -s -m 755 gman $RPM_BUILD_ROOT/usr/bin/gman
34 install -m 755 gman.pl $RPM_BUILD_ROOT/usr/bin/gman.cgi
35 install -m 644 gman.1x $RPM_BUILD_ROOT/usr/man/man1/gman.1x
36 install -m 755 gman.pl $RPM_BUILD_ROOT/var/www/cgi-bin/gman/gman.pl
37
38 %clean
39 #rm -rf $RPM_BUILD_ROOT
40
41 %files
42 %defattr(-,root,root)
43 %doc README ChangeLog AUTHORS COPYING
44
45 /usr/bin/gman
46 /usr/man/man1/gman.1x.gz
47 /usr/bin/gman.cgi
48 /var/www/cgi-bin/gman/gman.pl
49
50 %changelog
51 * Sun May 18 2002 Wang Xinkai <aakwxk at hotmail.com>
52 - minor update for RedHat 7.x
53 * Mon Mar 26 2001 Wang Xinkai <aakwxk at hotmail.com>
54 - first build
0 .TH GMAN 1x "October 1999" "Gman"
0 .TH GMAN 1x "May 2002" "Gman"
11 .SH NAME
2 gman \- small X/GTK+ based man front-end
2 gman \- GTK+ based front-end for man, a good replacment for xman.
33 .SH SYNOPSIS
44 .B gman
55 .SH DESCRIPTION
66 .B Gman
7 is nothing else but only a simple front-end for the original
8 .I man
9 page system. The most basic job of gman is to build a database for all
10 the man pages and display them (or part of them) on the screen. When
11 user decides to read a man page,
7 is a front-end for the manual page system. gman builds a database of all the
8 available man pages and displays them in a list. Clicking on an entry in the
9 list makes
1210 .B gman
13 will launch a
14 .I xterm
15 window and call the normal man system to display the man page in the
16 window.
17 .sp
11 launch another window with the manual page displayed in it.
12 .PP
1813 .B Gman
19 can launch more than one xterm window at same time. And user can use
20 the index search function to look for the man pages that he needs.
21 .sp
14 can launch more than one window at same time. The user can use
15 the index/key word search function to look for the man pages that they need.
16 .PP
2217 It is simple, but it is useful.
2318 .SH OPTIONS
2419 There are no command line options for gman, for now.
20
21 .SH DISPLAY OPTIONS
22 Currently gman has 4 different modes to present the man pages, available as
23 the following items in the \fBView\fP menu:
24 .TP
25 .B xTerm
26 This will launch an X terminal emulator with the \fIman\fP output shown
27 inside.
28 .sp
29 You can add the following line to your ~/.gman file in order to select
30 the preferred X terminal emulator:
31 .sp
32 .RS 16
33 xterm_command = rxvt
34 .RE
35 .TP
36 .B GhostView
37 gman will present man pages in a GhostView window for you to view and print
38 the man page.
39 .sp
40 This requires GhostView (command "gv") to be available on your system.
41 .TP
42 .B LocalBrowse
43 gman will launch a Mozilla window to show you the man page.
44 .sp
45 This requires man2html and Mozilla (command "mozilla") to be available on your
46 system.
47 .TP
48 .B NetBrowse
49 In this mode, you can view the pages with Mozilla and navigate from
50 one man page to another by clicking the links in the man pages.
51 .sp
52 This requires man2html, Mozilla (command "mozilla") and a HTTP server
53 running on localhost.
54
2555 .SH FILES
2656 .TP
2757 .I ~/.gman
2858 Contains configuration information for gman, such as window size and
29 paths where the manual pages are contained.
59 paths where the manual pages are contained.
60 For example,
61 .sp
62 v_size = 400
3063 .br
31 It is read by gman on startup, and written on exit.
64 h_size = 300
65 .br
66 xterm_command = rxvt
67 .br
68 show_warning = 0
69 .br
70 man_paths = /usr/man:/usr/local/man:/usr/X11R6/man
71 .sp
72 For more information, see init_context() function in gman.c for all the
73 options avialiable.
74 .sp
75 ~/.gman is read by gman on startup, and written on exit.
3276 .SH SEE ALSO
3377 .BR man (1),
3478 .BR man (7),
3579 .BR xterm (1).
80
3681 .SH AUTHOR
3782 .B Gman
38 was written by Xinkai Wang <aakwxk@hotmail.com>. Home page of gman is at:
83 was written by a smart guy named Xinkai Wang <aakwxk@hotmail.com>.
84 .PP
85 Home page of gman is at:
3986 .br
40 .I http://homex.s-one.net.sg/user/xkwang/gman
87 .UR
88 http://homex.coolconnect.com/user/xkwang/gman/
89 .UE
8181 context = new AppContext();
8282 // context->set_default_value("v_size",(void*)400);
8383 context->set_default_value("debuging","int",(void*)0);
84 context->set_default_value("man_paths","char*",(void*)"/usr/share/man:/usr/man:/usr/X11R6/man:/usr/local/man");
84 context->set_default_value("man_paths","char*",(void*)"/usr/share/man:/usr/X11R6/man:/usr/man:/usr/local/man");
8585 context->set_default_value("display_section_policy","int",(void*)0);
8686 context->set_default_value("display_section","int",(void*)3);
87 context->set_default_value("xterm_command","char*",(void*)"x-terminal-emulator");
8887 context->set_default_value("searching_mode","int",(void*)0);
8988 context->set_default_value("show_status_bar","int",(void*)0);
90 context->set_default_value("show_warning","int",(void*)1);
89 context->set_default_value("show_warning","int",(void*)0);
90 context->set_default_value("show_mode","int",(void*)0); // 0 = xterm, 1 = ghostview
91 context->set_default_value("xterm_command","char*",(void*)"x-terminal-emulator");
92 context->set_default_value("gv_command","char*",(void*)"gv");
93 context->set_default_value("browser_command","char*",(void*)"mozilla"); // kfm also works
94 context->set_default_value("cgi_host","char*",(void*)"localhost");
95 context->set_default_value("cgi_location","char*",(void*)"/cgi-bin/gman.pl");
96 context->set_default_value("print_command","char*",(void*)"lpr"); // not in use
9197
9298 attach(buffer,getenv("HOME"),".gman");
9399 if((fd = fopen(buffer,"r"))) {
0 #!/usr/bin/perl -w
1 use strict;
2
3 if (@ARGV != 2) {
4 print <<_EOF_;
5 Content-type: text/html
6
7 <html><head><title>gman.pl: invalid use</title></head>
8 <body>
9 <h1>gman.pl cannot be used without arguments.</h1>
10 </body></html>
11 _EOF_
12 die;
13 }
14
15 my $section = $ARGV[0]; # should also have some sanity check
16 my $name = $ARGV[1];
17 my $man2html = "/usr/lib/cgi-bin/man2html";
18 my $path = `man -w $section $name`; chomp $path; $path =~ s/\s*$//;
19
20 unless (-s "$path") {
21 warn "not -s $path\n";
22 $name = lc $name;
23 $path = `man -w $section $name`; chomp $path; $path =~ s/\s*$//;
24 }
25 unless (-s "$path") {
26 warn "not -s $path\n";
27 print <<end_of_line;
28 Content-type: text/html
29
30 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
31 <HTML><HEAD>
32 <TITLE>404 Not Found</TITLE>
33 </HEAD><BODY>
34 <H1>Not Found</H1>
35 The requested man page $name($section) was not found on this server.
36 </BODY></HTML>
37 end_of_line
38 die;
39 }
40
41 my $page = `$man2html $path`;
42
43 # $page =~ s/^Content-type: text\/html\n\n// if (not run as cgi...);
44
45 $page =~ s/(This document was created by\n<a HREF=\".*\">man2html<\/a>)(,\nusing the manual pages.<br>)/$1 for <a href=\"\/cgi-bin\/gman.pl?1+gman\">gman<\/a>$2/io;
46
47 print $page;
Binary diff not shown
2525 #include "gman.h"
2626
2727 #include <stdlib.h>
28 #include <glib.h>
2829
2930 void attach (char *dest, const char *dirname, const char *name);
3031 static int section_translate_c_to_n(const char* c);
31 /* static int ManItemComp(ManItem ** a,ManItem ** b); */
3232 static int is_zip_suffix(char* c);
3333
3434 char buffer1[BUFFER_SIZE];
235235 void ManItem::active_man_page(void)
236236 {
237237 int len;
238 char buffer[BUFFER_SIZE];
239 sprintf(buffer,"%s -T '%s manual page' -n GMan -e man ",
240 (char*)context->get_value("xterm_command"),
241 get_display_name(buffer1));
242 len = strlen(buffer);
243 attach(buffer+len,man_path->GetPath(),file_name);
244 //printf(buffer);
238 char buffer[2*BUFFER_SIZE];
239 char loc_name[BUFFER_SIZE];
240 char buffer2[BUFFER_SIZE];
241 switch ((int)context->get_value("show_mode")) {
242 case 0:
243 sprintf(buffer,"%s -T '%s manual page' -n GMan -e man ",
244 (char*)context->get_value("xterm_command"),
245 get_display_name(buffer1));
246 len = strlen(buffer);
247 attach(buffer+len,man_path->GetPath(),file_name);
248 //g_warning(buffer);
249 if(!fork())
250 {
251 //printf(buffer);
252 system(buffer);
253 _exit(0);
254 }
255 break;
256 case 1:
257 sprintf(loc_name," ~/.gman.%s.ps ",get_display_name(buffer1));
258 sprintf(buffer,"man -t ");
259 len = strlen(buffer);
260 attach(buffer+len,man_path->GetPath(),file_name);
261 strcat(buffer," >> ");
262 strcat(buffer,loc_name);
263 strcat(buffer," ; ");
264 strcat(buffer,(char*)context->get_value("gv_command"));
265 strcat(buffer,loc_name);
266 strcat(buffer," ; rm ");
267 strcat(buffer,loc_name);
268 //g_warning(buffer);
269 if(!fork())
270 {
271 //printf(buffer);
272 system(buffer);
273 _exit(0);
274 }
275 break;
276 /*
277 case 2:
278 sprintf(loc_name," ~/.gman.%s.html ",get_display_name(buffer1));
279 if(strstr(file_name,".gz")) sprintf(buffer,"gunzip -c ");
280 else sprintf(buffer,"cat ");
281 len = strlen(buffer);
282 attach(buffer+len,man_path->GetPath(),file_name);
283 strcat(buffer," > ~/.gman.tmp ;");
284 strcat(buffer," man2html ~/.gman.tmp -M ");
285 strcat(buffer,(char*)context->get_value("cgi_location"));
286 strcat(buffer," -H ");
287 strcat(buffer,(char*)context->get_value("cgi_host"));
288 strcat(buffer," >> ");
289 strcat(buffer,loc_name);
290 strcat(buffer," ; ");
291 strcat(buffer,(char*)context->get_value("browser_command"));
292 strcat(buffer,loc_name);
293 strcat(buffer," ; rm ~/.gman.tmp ; sleep 120; rm ");
294 strcat(buffer,loc_name);
295 fprintf(stderr, "running: %s\n", buffer);
296 g_warning(buffer);
297 if(!fork())
298 {
299 //printf(buffer);
300 system(buffer);
301 _exit(0);
302 }
303 break;
304 */
305 case 2:
306 sprintf(loc_name," ~/.gman.%s.html ",get_display_name(buffer1));
307 //g_warning(loc_name);
308 strcpy(buffer,"/usr/lib/cgi-bin/gman.pl ");
309 strcat(buffer," ");
310 strcat(buffer,get_section_name(buffer2));
311 strcat(buffer," ");
312 strcat(buffer,get_display_name(buffer2));
313 strcat(buffer," >> ");
314 strcat(buffer,loc_name);
315 strcat(buffer," ; ");
316 strcat(buffer,(char*)context->get_value("browser_command"));
317 //if (strstr((char*)context->get_value("browser_command"),"mozilla")) strcat(buffer," -chrome ");
318 strcat(buffer,loc_name);
319 strcat(buffer," ; sleep 120; rm ");
320 strcat(buffer,loc_name);
321 fprintf(stderr, "running: %s\n", buffer);
322 //g_warning(buffer);
323 if(!fork())
324 {
325 //printf(buffer);
326 system(buffer);
327 _exit(0);
328 }
329 break;
330 case 3:
331 sprintf(buffer,(char*)context->get_value("browser_command"));
332 len = strlen(buffer);
333 strcat(buffer," \"http://");
334 strcat(buffer,(char*)context->get_value("cgi_host"));
335 strcat(buffer,(char*)context->get_value("cgi_location"));
336 strcat(buffer,"?");
337 strcat(buffer,get_section_name(loc_name));
338 strcat(buffer,"+");
339 strcat(buffer,get_display_name(loc_name));
340 strcat(buffer,"\"");
341 fprintf(stderr, "running: %s\n", buffer);
342 //g_warning(buffer);
343 if(!fork())
344 {
345 //printf(buffer);
346 system(buffer);
347 _exit(0);
348 }
349 break;
350 default:
351 if(context->get_value("show_warning"))
352 g_print("unexpected \'show_mode\' : %d ",(int)context->get_value("show_mode"));
353 return;
354 }
355 //g_warning(buffer);
245356
246 if(!fork())
247 {
248 //printf(buffer);
249 system(buffer);
250 _exit(0);
251 }
252357
253358 return;
254359 }
3232 #include "window2.h"
3333 #include "taskfunc.h"
3434
35 /*
36 static int print_hello(GtkWidget *w, gpointer data);
37 static int test_callback(GtkWidget *w, gpointer data);
38 */
3935 static int window_resize_callback(GtkWidget *w, GtkAllocation *size, gpointer data);
4036 static int section_policy_callback(GtkWidget *w, gpointer data);
4137 static int section_select_callback(GtkWidget *w, gpointer data);
4238 static int status_bar_callback (GtkWidget *widget, gpointer data);
4339 static int search_mode_callback (GtkWidget *widget, gpointer data);
40 static int show_mode_callback(GtkWidget *w, gpointer data);
4441 static void app_quit(GtkWidget *w, gpointer data);
4542 static void select_row_callback(GtkWidget *, gint, gint, GdkEventButton *, gpointer);
4643 static void select_row_callback3(GtkWidget *, gint, gint, GdkEventButton *, gpointer);
7774 {"/Sections/_8: Sys.Administration",NULL, (void (*)())section_select_callback, 1<<7, "<CheckItem>"},
7875 {"/Sections/_l: Local", NULL, (void (*)())section_select_callback, 1<<8, "<CheckItem>"},
7976 {"/Sections/_n: New", NULL, (void (*)())section_select_callback, 1<<9, "<CheckItem>"},
77 {"/_View", NULL, NULL, 0, "<Branch>"},
78 {"/View/x_Term", "<control>T", (void (*)())show_mode_callback, 0, "<RadioItem>"},
79 {"/View/_GhostView", "<control>G", (void (*)())show_mode_callback, 1, "/View/xTerm"},
80 {"/View/_LocalBrowse", "<control>L", (void (*)())show_mode_callback, 2, "/View/xTerm"},
81 {"/View/_NetBrowse", "<control>N", (void (*)())show_mode_callback, 3, "/View/xTerm"},
8082 {"/_Options", NULL, NULL, 0, "<Branch>"},
8183 {"/Options/Status bar", NULL, (void (*)())status_bar_callback, 0, "<CheckItem>"},
8284 {"/Options/sep1", NULL, NULL, 0, "<Separator>"},
83 {"/Options/_Index search", NULL, (void (*)())search_mode_callback, 0, "<RadioItem>"},
84 {"/Options/_Key word search", NULL, (void (*)())search_mode_callback, 1, "/Options/Index search"},
85 {"/Options/_Index search", "<control>I", (void (*)())search_mode_callback, 0, "<RadioItem>"},
86 {"/Options/_Key word search", "<control>K", (void (*)())search_mode_callback, 1, "/Options/Index search"},
8587 {"/Options/sep2", NULL, NULL, 0, "<Separator>"},
86 {"/Options/Man _Paths...", "<control>P", (void (*)())edit_paths_callback, 0, NULL},
87 // {"/Options/Test", NULL, (void (*)(...))test_callback, 0, NULL},
88 {"/Options/Man _Paths...", NULL, (void (*)())edit_paths_callback, 0, NULL},
8889 {"/_Help", NULL, NULL, 0, "<LastBranch>"},
8990 {"/_Help/About", NULL, GTK_SIGNAL_FUNC(window_help_about_callback),0,NULL}
9091 };
100101 GtkWidget * section_buttons[MAX_MAN_SECTION];
101102 GtkWidget * section_select[3];
102103 GtkWidget * searching_mode_buttons[2];
104 GtkWidget * show_mode_buttons[4];
103105 GtkWidget * status_bar_button;
104106
105107 int signal_select_row; //used by select_row_callback() to decide whether to active man pages
158160 section_buttons[9] = gtk_item_factory_get_widget(item_factory, "/Sections/n: New");
159161 searching_mode_buttons[0] = gtk_item_factory_get_widget(item_factory, "/Options/Index search");
160162 searching_mode_buttons[1] = gtk_item_factory_get_widget(item_factory, "/Options/Key word search");
163 show_mode_buttons[0] = gtk_item_factory_get_widget(item_factory, "/View/xTerm");
164 show_mode_buttons[1] = gtk_item_factory_get_widget(item_factory, "/View/GhostView");
165 show_mode_buttons[2] = gtk_item_factory_get_widget(item_factory, "/View/LocalBrowse");
166 show_mode_buttons[3] = gtk_item_factory_get_widget(item_factory, "/View/NetBrowse");
161167 status_bar_button = gtk_item_factory_get_widget(item_factory, "/Options/Status bar");
162168 // gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(section_buttons[4]),1);
163169 updata_menu_buttons(0);
185191 if(!flag) signal_menu_change++;
186192 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(searching_mode_buttons[k]),1);
187193 }
194 k = (int)context->get_value("show_mode");
195 if(k>0 && k<=3)
196 if(!(((GtkCheckMenuItem*)(show_mode_buttons[k]))->active)) {
197 if(!flag) signal_menu_change++;
198 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(show_mode_buttons[k]),1);
199 }
188200 k2 = (int)context->get_value("show_status_bar");
189201 i = k2&(1<<k);
190202 j = (((GtkCheckMenuItem*)(status_bar_button))->active);
427439 GTK_CLIST(clist)->focus_row = i;
428440 gtk_clist_select_row(GTK_CLIST(clist),i,0);
429441 }
430
431 /*
432 static int print_hello(GtkWidget *w, gpointer data) {
433 if(signal_menu_change>0) {signal_menu_change--;return 1;}
434 g_message("Hello, World! %x\n",data);
435 return 0;
436 }
437
438 static int test_callback(GtkWidget *w, gpointer data) {
439 int i,j;
440 if(signal_menu_change>0) {signal_menu_change--;return 1;}
441 j = man_paths->get_size();
442 for(i = 0;i<j;i++)
443 delete ((ManPath*)(man_paths->get_value(i)));
444 delete (man_paths);
445 init_man_data();
446 return 0;
447 }
448 */
449442
450443 static int section_policy_callback(GtkWidget *w, gpointer data) {
451444 // static int signal;
557550
558551 char *tmp = g_strdup_printf("Credits: %s", authors[0]);
559552 gtk_box_pack_start (GTK_BOX (GTK_DIALOG (about_window)->vbox),
560 gtk_label_new (tmp),
553 gtk_label_new (tmp),
554 FALSE, FALSE, 5);
555 g_free(tmp);
556
557 gtk_box_pack_start (GTK_BOX (GTK_DIALOG (about_window)->vbox),
558 gtk_label_new ("Comments and suggestions are extremely welcomed!"),
561559 FALSE, FALSE, 5);
562 g_free(tmp);
563560
564561 gtk_box_pack_start (GTK_BOX (GTK_DIALOG (about_window)->vbox),
565 gtk_label_new ("Comments and suggestions are extremely welcome!"),
566 FALSE, FALSE, 5);
567
568 gtk_box_pack_start (GTK_BOX (GTK_DIALOG (about_window)->vbox),
569 gtk_label_new ("Web: http://homex.s-one.net.sg/user/xkwang/gman"),
562 gtk_label_new ("Web: http://homex.coolconnect.com/user/xkwang/gman/"),
570563 FALSE, FALSE, 5);
571564
572565 if (!GTK_WIDGET_VISIBLE (about_window))
610603 return 0;
611604 }
612605
606 static int show_mode_callback (GtkWidget *widget, gpointer data)
607 {
608 int k,k2;
609 k2 = (int) data;
610 if(!((GtkCheckMenuItem*)(show_mode_buttons[k2]))->active) return 1;
611 if(signal_menu_change>0) {signal_menu_change--;return 1;}
612 //if(!signal) {signal++;return 1;}
613 //signal--;
614 k = (int) context->get_value("show_mode");
615 if(k == k2) return 1;
616 pthread_mutex_lock(&context_lock);
617 context->set_value("show_mode","int",(void*)k2);
618 pthread_mutex_unlock(&context_lock);
619 //updata_widget_show(0);
620 //updata_menu_buttons(0);
621 return 0;
622 }
623
613624 static void entry4_activate_callback(GtkWidget *w,gpointer data)
614625 {
615626 keyword = gtk_entry_get_text(GTK_ENTRY(entry4));
2929
3030 TaskGroup * task_group_new()
3131 {
32 //int retcode;
3233 TaskGroup * task_group = (TaskGroup*)g_malloc(sizeof(TaskGroup));
3334 task_group->tasks = new List;
3435 task_group->state = 0;
4445 {
4546 int i,j;
4647 Task * task;
47 g_return_val_if_fail((priority>0.0 && priority <1.0)&&(task_group != NULL)&&(task_func != NULL),NULL);
48 g_return_val_if_fail((priority>0.0 && priority <1.0)&&(task_group != NULL)&&(task_func != NULL),(Task*)NULL);
4849
4950 task = (Task *)g_malloc(sizeof(Task));
50 pthread_mutex_init(&task->lock,NULL);
51 pthread_mutex_init(&task->lock,(const pthread_mutexattr_t *)NULL);
5152 task->priority = priority;
5253 task->state = 0;
5354 task->task_group = task_group;
109110
110111 do {
111112 have_task = 0;
112 task = NULL;
113 task = (Task *)NULL;
113114 int flag = 0;
114115 pthread_mutex_lock(&task_group->lock);
115116 j = task_group->tasks->get_size();
172172 for (i = 0;i<j;i++) {
173173 p = (ManPath*) man_paths->get_value(i);
174174 if (p) {
175 clist_item[0] = (gchar*)(((gchar *)p->active)?"o":"");
175 if (p->active) clist_item[0] ="o";
176 else clist_item[0] = "";
176177 clist_item[1] = man_paths->get_name(i);
177178 sprintf(buffer,"%d",p->GetSize(-1));
178179 clist_item[2] = buffer;
204205 gtk_widget_show(window2);
205206 focus = (GtkWidget*) gtk_object_get_data(GTK_OBJECT(window2),"button1");
206207 gtk_widget_grab_focus (focus);
207 return 0;
208 return 1;
208209 }
209210
210211 /******************* call backs ***********************/
267268 gtk_widget_set_sensitive(apply_button,1);
268269 break;
269270 default:
270 g_print("gman: sorry, this function is not implemented yet\n");
271 g_print("gman: sorry... this function not implemented yet\n");
271272 };
272273 return 1;
273274 }