Initial revision
authorinsilmaril
Sun Jan 30 12:59:10 2005 +0000 (2005-01-30)
changeset 82920e6ed5889b
child 83 e90f5bef70c8
Initial revision
LICENSE
Makefile
branchobj.cpp
branchobj.h
demos/liveform.vym
demos/math.vym
demos/time-management.vym
demos/todo.vym
doc/vym.pdf
exporthtmldialog.ui
exporthtmldialog.ui.h
exports.cpp
exports.h
exportxhtmldialog.ui
exportxhtmldialog.ui.h
extrainfodialog.ui
extrainfodialog.ui.h
findwindow.cpp
findwindow.h
flagobj.cpp
flagobj.h
flagrowobj.cpp
flagrowobj.h
floatimageobj.cpp
floatimageobj.h
floatobj.cpp
floatobj.h
frameobj.cpp
frameobj.h
headingobj.cpp
headingobj.h
icons/cursorcolorpicker.xpm
icons/cursorcolorpicker16.xpm
icons/cursorhandopen.xpm
icons/cursorhandopen16.xpm
icons/editcopy.xpm
icons/editcut.xpm
icons/editmovedown.xpm
icons/editmoveup.xpm
icons/editpaste.xpm
icons/editredo.xpm
icons/edittrash.xpm
icons/editundo.xpm
icons/filenew.xpm
icons/fileopen.xpm
icons/fileprint.xpm
icons/filesave.xpm
icons/flag-arrow-down.xpm
icons/flag-arrow-up.xpm
icons/flag-clock.xpm
icons/flag-cross-red.xpm
icons/flag-exclamationmark.xpm
icons/flag-flash.xpm
icons/flag-heart.xpm
icons/flag-hook-green.xpm
icons/flag-lamp.xpm
icons/flag-lifebelt.xpm
icons/flag-note.xpm
icons/flag-questionmark.xpm
icons/flag-scrolled-right.xpm
icons/flag-smiley-good.xpm
icons/flag-smiley-sad.xpm
icons/flag-stopsign.xpm
icons/flag-thumb-down.xpm
icons/flag-thumb-up.xpm
icons/flag-tmpUnscrolled-right.xpm
icons/flag-url.xpm
icons/flag-vymlink.xpm
icons/flags.xcf
icons/formatcolorbranch.xpm
icons/formatcoloritem.xpm
icons/formatcolorpicker.xpm
icons/formatfixedfont.xpm
icons/formattextbold.xpm
icons/formattextcenter.xpm
icons/formattextitalic.xpm
icons/formattextjustify.xpm
icons/formattextleft.xpm
icons/formattextright.xpm
icons/formattextunder.xpm
icons/formatvarfont.xpm
icons/icons.xcf
icons/mouse.xcf
icons/mouse16.xcf
icons/viewzoomin.xpm
icons/viewzoomout.xpm
icons/viewzoomreset.xpm
icons/vym-16x16.png
icons/vym-16x16.xpm
icons/vym-32x32.png
icons/vym-32x32.xpm
icons/vym-48x48.png
icons/vym-48x48.xpm
icons/vym-editor.xpm
icons/vym.png
icons/vym.xcf
icons/wiki.xcf
imageobj.cpp
imageobj.h
linkablemapobj.cpp
linkablemapobj.h
main.cpp
mainwindow.cpp
mainwindow.h
mapcenterobj.cpp
mapcenterobj.h
mapeditor.cpp
mapeditor.h
mapobj.cpp
mapobj.h
misc.cpp
misc.h
noteobj.cpp
noteobj.h
options.cpp
options.h
ornamentedobj.cpp
ornamentedobj.h
process.cpp
process.h
scripts/exportvym
scripts/vym2html.sh
scripts/vym2txt.sh
selection.cpp
selection.h
settings.cpp
settings.h
showtextdialog.ui
showtextdialog.ui.h
styles/cm.xsl
styles/tm.xsl
styles/vym.css
styles/vym2html.xsl
styles/vym2txt.xsl
styles/vym2xhtml.xsl
styles/wiki/answer.gif
styles/wiki/point.gif
styles/wiki/question.gif
tex/branches-flags.png
tex/branches.png
tex/color-buttons.png
tex/default-flags.png
tex/example1.png
tex/find-window.png
tex/flag-url.png
tex/flag-vymlink.png
tex/formatfixedfont.png
tex/move-buttons.png
tex/vym.tex
tex/windows.png
tex/zoom-buttons.png
texteditor.cpp
texteditor.h
version.h
vym.pro
vym_de.ts
xml.cpp
xml.h
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/LICENSE	Sun Jan 30 12:59:10 2005 +0000
     1.3 @@ -0,0 +1,308 @@
     1.4 +    VYM - View Your Mind
     1.5 +    Copyright (C) 2004  Uwe Drechsel  
     1.6 +
     1.7 +    This program is free software; you can redistribute it and/or modify
     1.8 +    it under the terms of the GNU General Public License as published by
     1.9 +    the Free Software Foundation; either version 2 of the License, or
    1.10 +    (at your option) any later version.
    1.11 +
    1.12 +    This program is distributed in the hope that it will be useful,
    1.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.15 +    GNU General Public License below for more details.
    1.16 +
    1.17 +	In addition, as a special exception, Uwe Drechsel
    1.18 +	gives permission to link the code of this program with the QT 
    1.19 +	libraries from trolltech.com (or with modified versions of QT that
    1.20 +	use the same license as QT), and distribute linked combinations
    1.21 +	including the two. You must obey the GNU General Public License in
    1.22 +	all respects for all of the code used other than QT. If you modify
    1.23 +	this file, you may extend this exception to your version of the
    1.24 +	file, but you are not obligated to do so. If you do not wish to do
    1.25 +	so, delete this exception statement from your version.
    1.26 +
    1.27 +
    1.28 +	Uwe Drechsel can be contacted at <vym@insilmaril.de>
    1.29 +
    1.30 +-----------------------------------------------------------------------------
    1.31 +
    1.32 +            GNU GENERAL PUBLIC LICENSE
    1.33 +		       Version 2, June 1991
    1.34 +
    1.35 + Copyright (C) 1989, 1991 Free Software Foundation, Inc.
    1.36 +     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    1.37 + Everyone is permitted to copy and distribute verbatim copies
    1.38 + of this license document, but changing it is not allowed.
    1.39 +
    1.40 +			    Preamble
    1.41 +
    1.42 +  The licenses for most software are designed to take away your
    1.43 +freedom to share and change it.  By contrast, the GNU General Public
    1.44 +License is intended to guarantee your freedom to share and change free
    1.45 +software--to make sure the software is free for all its users.  This
    1.46 +General Public License applies to most of the Free Software
    1.47 +Foundation's software and to any other program whose authors commit to
    1.48 +using it.  (Some other Free Software Foundation software is covered by
    1.49 +the GNU Library General Public License instead.)  You can apply it to
    1.50 +your programs, too.
    1.51 +
    1.52 +  When we speak of free software, we are referring to freedom, not
    1.53 +price.  Our General Public Licenses are designed to make sure that you
    1.54 +have the freedom to distribute copies of free software (and charge for
    1.55 +this service if you wish), that you receive source code or can get it
    1.56 +if you want it, that you can change the software or use pieces of it
    1.57 +in new free programs; and that you know you can do these things.
    1.58 +
    1.59 +  To protect your rights, we need to make restrictions that forbid
    1.60 +anyone to deny you these rights or to ask you to surrender the rights.
    1.61 +These restrictions translate to certain responsibilities for you if you
    1.62 +distribute copies of the software, or if you modify it.
    1.63 +
    1.64 +  For example, if you distribute copies of such a program, whether
    1.65 +gratis or for a fee, you must give the recipients all the rights that
    1.66 +you have.  You must make sure that they, too, receive or can get the
    1.67 +source code.  And you must show them these terms so they know their
    1.68 +rights.
    1.69 +
    1.70 +  We protect your rights with two steps: (1) copyright the software, and
    1.71 +(2) offer you this license which gives you legal permission to copy,
    1.72 +distribute and/or modify the software.
    1.73 +
    1.74 +  Also, for each author's protection and ours, we want to make certain
    1.75 +that everyone understands that there is no warranty for this free
    1.76 +software.  If the software is modified by someone else and passed on, we
    1.77 +want its recipients to know that what they have is not the original, so
    1.78 +that any problems introduced by others will not reflect on the original
    1.79 +authors' reputations.
    1.80 +
    1.81 +  Finally, any free program is threatened constantly by software
    1.82 +patents.  We wish to avoid the danger that redistributors of a free
    1.83 +program will individually obtain patent licenses, in effect making the
    1.84 +program proprietary.  To prevent this, we have made it clear that any
    1.85 +patent must be licensed for everyone's free use or not licensed at all.
    1.86 +
    1.87 +  The precise terms and conditions for copying, distribution and
    1.88 +modification follow.
    1.89 +
    1.90 +		    GNU GENERAL PUBLIC LICENSE
    1.91 +   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
    1.92 +
    1.93 +  0. This License applies to any program or other work which contains
    1.94 +a notice placed by the copyright holder saying it may be distributed
    1.95 +under the terms of this General Public License.  The "Program", below,
    1.96 +refers to any such program or work, and a "work based on the Program"
    1.97 +means either the Program or any derivative work under copyright law:
    1.98 +that is to say, a work containing the Program or a portion of it,
    1.99 +either verbatim or with modifications and/or translated into another
   1.100 +language.  (Hereinafter, translation is included without limitation in
   1.101 +the term "modification".)  Each licensee is addressed as "you".
   1.102 +
   1.103 +Activities other than copying, distribution and modification are not
   1.104 +covered by this License; they are outside its scope.  The act of
   1.105 +running the Program is not restricted, and the output from the Program
   1.106 +is covered only if its contents constitute a work based on the
   1.107 +Program (independent of having been made by running the Program).
   1.108 +Whether that is true depends on what the Program does.
   1.109 +
   1.110 +  1. You may copy and distribute verbatim copies of the Program's
   1.111 +source code as you receive it, in any medium, provided that you
   1.112 +conspicuously and appropriately publish on each copy an appropriate
   1.113 +copyright notice and disclaimer of warranty; keep intact all the
   1.114 +notices that refer to this License and to the absence of any warranty;
   1.115 +and give any other recipients of the Program a copy of this License
   1.116 +along with the Program.
   1.117 +
   1.118 +You may charge a fee for the physical act of transferring a copy, and
   1.119 +you may at your option offer warranty protection in exchange for a fee.
   1.120 +
   1.121 +  2. You may modify your copy or copies of the Program or any portion
   1.122 +of it, thus forming a work based on the Program, and copy and
   1.123 +distribute such modifications or work under the terms of Section 1
   1.124 +above, provided that you also meet all of these conditions:
   1.125 +
   1.126 +    a) You must cause the modified files to carry prominent notices
   1.127 +    stating that you changed the files and the date of any change.
   1.128 +
   1.129 +    b) You must cause any work that you distribute or publish, that in
   1.130 +    whole or in part contains or is derived from the Program or any
   1.131 +    part thereof, to be licensed as a whole at no charge to all third
   1.132 +    parties under the terms of this License.
   1.133 +
   1.134 +    c) If the modified program normally reads commands interactively
   1.135 +    when run, you must cause it, when started running for such
   1.136 +    interactive use in the most ordinary way, to print or display an
   1.137 +    announcement including an appropriate copyright notice and a
   1.138 +    notice that there is no warranty (or else, saying that you provide
   1.139 +    a warranty) and that users may redistribute the program under
   1.140 +    these conditions, and telling the user how to view a copy of this
   1.141 +    License.  (Exception: if the Program itself is interactive but
   1.142 +    does not normally print such an announcement, your work based on
   1.143 +    the Program is not required to print an announcement.)
   1.144 +
   1.145 +These requirements apply to the modified work as a whole.  If
   1.146 +identifiable sections of that work are not derived from the Program,
   1.147 +and can be reasonably considered independent and separate works in
   1.148 +themselves, then this License, and its terms, do not apply to those
   1.149 +sections when you distribute them as separate works.  But when you
   1.150 +distribute the same sections as part of a whole which is a work based
   1.151 +on the Program, the distribution of the whole must be on the terms of
   1.152 +this License, whose permissions for other licensees extend to the
   1.153 +entire whole, and thus to each and every part regardless of who wrote it.
   1.154 +
   1.155 +Thus, it is not the intent of this section to claim rights or contest
   1.156 +your rights to work written entirely by you; rather, the intent is to
   1.157 +exercise the right to control the distribution of derivative or
   1.158 +collective works based on the Program.
   1.159 +
   1.160 +In addition, mere aggregation of another work not based on the Program
   1.161 +with the Program (or with a work based on the Program) on a volume of
   1.162 +a storage or distribution medium does not bring the other work under
   1.163 +the scope of this License.
   1.164 +
   1.165 +  3. You may copy and distribute the Program (or a work based on it,
   1.166 +under Section 2) in object code or executable form under the terms of
   1.167 +Sections 1 and 2 above provided that you also do one of the following:
   1.168 +
   1.169 +    a) Accompany it with the complete corresponding machine-readable
   1.170 +    source code, which must be distributed under the terms of Sections
   1.171 +    1 and 2 above on a medium customarily used for software interchange; or,
   1.172 +
   1.173 +    b) Accompany it with a written offer, valid for at least three
   1.174 +    years, to give any third party, for a charge no more than your
   1.175 +    cost of physically performing source distribution, a complete
   1.176 +    machine-readable copy of the corresponding source code, to be
   1.177 +    distributed under the terms of Sections 1 and 2 above on a medium
   1.178 +    customarily used for software interchange; or,
   1.179 +
   1.180 +    c) Accompany it with the information you received as to the offer
   1.181 +    to distribute corresponding source code.  (This alternative is
   1.182 +    allowed only for noncommercial distribution and only if you
   1.183 +    received the program in object code or executable form with such
   1.184 +    an offer, in accord with Subsection b above.)
   1.185 +
   1.186 +The source code for a work means the preferred form of the work for
   1.187 +making modifications to it.  For an executable work, complete source
   1.188 +code means all the source code for all modules it contains, plus any
   1.189 +associated interface definition files, plus the scripts used to
   1.190 +control compilation and installation of the executable.  However, as a
   1.191 +special exception, the source code distributed need not include
   1.192 +anything that is normally distributed (in either source or binary
   1.193 +form) with the major components (compiler, kernel, and so on) of the
   1.194 +operating system on which the executable runs, unless that component
   1.195 +itself accompanies the executable.
   1.196 +
   1.197 +If distribution of executable or object code is made by offering
   1.198 +access to copy from a designated place, then offering equivalent
   1.199 +access to copy the source code from the same place counts as
   1.200 +distribution of the source code, even though third parties are not
   1.201 +compelled to copy the source along with the object code.
   1.202 +
   1.203 +  4. You may not copy, modify, sublicense, or distribute the Program
   1.204 +except as expressly provided under this License.  Any attempt
   1.205 +otherwise to copy, modify, sublicense or distribute the Program is
   1.206 +void, and will automatically terminate your rights under this License.
   1.207 +However, parties who have received copies, or rights, from you under
   1.208 +this License will not have their licenses terminated so long as such
   1.209 +parties remain in full compliance.
   1.210 +
   1.211 +  5. You are not required to accept this License, since you have not
   1.212 +signed it.  However, nothing else grants you permission to modify or
   1.213 +distribute the Program or its derivative works.  These actions are
   1.214 +prohibited by law if you do not accept this License.  Therefore, by
   1.215 +modifying or distributing the Program (or any work based on the
   1.216 +Program), you indicate your acceptance of this License to do so, and
   1.217 +all its terms and conditions for copying, distributing or modifying
   1.218 +the Program or works based on it.
   1.219 +
   1.220 +  6. Each time you redistribute the Program (or any work based on the
   1.221 +Program), the recipient automatically receives a license from the
   1.222 +original licensor to copy, distribute or modify the Program subject to
   1.223 +these terms and conditions.  You may not impose any further
   1.224 +restrictions on the recipients' exercise of the rights granted herein.
   1.225 +You are not responsible for enforcing compliance by third parties to
   1.226 +this License.
   1.227 +
   1.228 +  7. If, as a consequence of a court judgment or allegation of patent
   1.229 +infringement or for any other reason (not limited to patent issues),
   1.230 +conditions are imposed on you (whether by court order, agreement or
   1.231 +otherwise) that contradict the conditions of this License, they do not
   1.232 +excuse you from the conditions of this License.  If you cannot
   1.233 +distribute so as to satisfy simultaneously your obligations under this
   1.234 +License and any other pertinent obligations, then as a consequence you
   1.235 +may not distribute the Program at all.  For example, if a patent
   1.236 +license would not permit royalty-free redistribution of the Program by
   1.237 +all those who receive copies directly or indirectly through you, then
   1.238 +the only way you could satisfy both it and this License would be to
   1.239 +refrain entirely from distribution of the Program.
   1.240 +
   1.241 +If any portion of this section is held invalid or unenforceable under
   1.242 +any particular circumstance, the balance of the section is intended to
   1.243 +apply and the section as a whole is intended to apply in other
   1.244 +circumstances.
   1.245 +
   1.246 +It is not the purpose of this section to induce you to infringe any
   1.247 +patents or other property right claims or to contest validity of any
   1.248 +such claims; this section has the sole purpose of protecting the
   1.249 +integrity of the free software distribution system, which is
   1.250 +implemented by public license practices.  Many people have made
   1.251 +generous contributions to the wide range of software distributed
   1.252 +through that system in reliance on consistent application of that
   1.253 +system; it is up to the author/donor to decide if he or she is willing
   1.254 +to distribute software through any other system and a licensee cannot
   1.255 +impose that choice.
   1.256 +
   1.257 +This section is intended to make thoroughly clear what is believed to
   1.258 +be a consequence of the rest of this License.
   1.259 +
   1.260 +  8. If the distribution and/or use of the Program is restricted in
   1.261 +certain countries either by patents or by copyrighted interfaces, the
   1.262 +original copyright holder who places the Program under this License
   1.263 +may add an explicit geographical distribution limitation excluding
   1.264 +those countries, so that distribution is permitted only in or among
   1.265 +countries not thus excluded.  In such case, this License incorporates
   1.266 +the limitation as if written in the body of this License.
   1.267 +
   1.268 +  9. The Free Software Foundation may publish revised and/or new versions
   1.269 +of the General Public License from time to time.  Such new versions will
   1.270 +be similar in spirit to the present version, but may differ in detail to
   1.271 +address new problems or concerns.
   1.272 +
   1.273 +Each version is given a distinguishing version number.  If the Program
   1.274 +specifies a version number of this License which applies to it and "any
   1.275 +later version", you have the option of following the terms and conditions
   1.276 +either of that version or of any later version published by the Free
   1.277 +Software Foundation.  If the Program does not specify a version number of
   1.278 +this License, you may choose any version ever published by the Free Software
   1.279 +Foundation.
   1.280 +
   1.281 +  10. If you wish to incorporate parts of the Program into other free
   1.282 +programs whose distribution conditions are different, write to the author
   1.283 +to ask for permission.  For software which is copyrighted by the Free
   1.284 +Software Foundation, write to the Free Software Foundation; we sometimes
   1.285 +make exceptions for this.  Our decision will be guided by the two goals
   1.286 +of preserving the free status of all derivatives of our free software and
   1.287 +of promoting the sharing and reuse of software generally.
   1.288 +
   1.289 +			    NO WARRANTY
   1.290 +
   1.291 +  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
   1.292 +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
   1.293 +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
   1.294 +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
   1.295 +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
   1.296 +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
   1.297 +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
   1.298 +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
   1.299 +REPAIR OR CORRECTION.
   1.300 +
   1.301 +  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
   1.302 +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
   1.303 +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
   1.304 +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
   1.305 +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
   1.306 +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
   1.307 +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
   1.308 +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
   1.309 +POSSIBILITY OF SUCH DAMAGES.
   1.310 +
   1.311 +		     END OF TERMS AND CONDITIONS
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/Makefile	Sun Jan 30 12:59:10 2005 +0000
     2.3 @@ -0,0 +1,737 @@
     2.4 +#############################################################################
     2.5 +# Makefile for building: vym
     2.6 +# Generated by qmake (1.07a) (Qt 3.3.1) on: Tue Jan  4 10:40:21 2005
     2.7 +# Project:  vym.pro
     2.8 +# Template: app
     2.9 +# Command: $(QMAKE) -o Makefile vym.pro
    2.10 +#############################################################################
    2.11 +
    2.12 +####### Compiler, tools and options
    2.13 +
    2.14 +CC       = gcc
    2.15 +CXX      = g++
    2.16 +LEX      = flex
    2.17 +YACC     = yacc
    2.18 +CFLAGS   = -pipe -O2 -fmessage-length=0 -Wall -fPIC -Wall -W -O2 -fmessage-length=0 -Wall -fPIC  -DQT_NO_DEBUG -DQT_SHARED -DQT_TABLET_SUPPORT -DQT_THREAD_SUPPORT
    2.19 +CXXFLAGS = -pipe -O2 -fmessage-length=0 -Wall -fPIC -Wall -W -O2 -fmessage-length=0 -Wall -fPIC  -DQT_NO_DEBUG -DQT_SHARED -DQT_TABLET_SUPPORT -DQT_THREAD_SUPPORT
    2.20 +LEXFLAGS = 
    2.21 +YACCFLAGS= -d
    2.22 +INCPATH  = -I/usr/lib/qt3/mkspecs/linux-g++ -I. -I/usr/include -I$(QTDIR)/include
    2.23 +LINK     = g++
    2.24 +LFLAGS   = 
    2.25 +LIBS     = $(SUBLIBS) -L/usr/lib64/ -L$(QTDIR)/lib64/ -L/usr/X11R6/lib64/ -lqt-mt -lXext -lX11 -lm
    2.26 +AR       = ar cqs
    2.27 +RANLIB   = 
    2.28 +MOC      = $(QTDIR)/bin/moc
    2.29 +UIC      = $(QTDIR)/bin/uic
    2.30 +QMAKE    = qmake
    2.31 +TAR      = tar -cf
    2.32 +GZIP     = gzip -9f
    2.33 +COPY     = cp -f
    2.34 +COPY_FILE= $(COPY)
    2.35 +COPY_DIR = $(COPY) -r
    2.36 +INSTALL_FILE= $(COPY_FILE)
    2.37 +INSTALL_DIR = $(COPY_DIR)
    2.38 +DEL_FILE = rm -f
    2.39 +SYMLINK  = ln -sf
    2.40 +DEL_DIR  = rmdir
    2.41 +MOVE     = mv -f
    2.42 +CHK_DIR_EXISTS= test -d
    2.43 +MKDIR    = mkdir -p
    2.44 +
    2.45 +####### Output directory
    2.46 +
    2.47 +OBJECTS_DIR = ./
    2.48 +
    2.49 +####### Files
    2.50 +
    2.51 +HEADERS = branchobj.h \
    2.52 +		exports.h \
    2.53 +		findwindow.h \
    2.54 +		flagobj.h \
    2.55 +		flagrowobj.h \
    2.56 +		floatimageobj.h \
    2.57 +		floatobj.h \
    2.58 +		frameobj.h \
    2.59 +		headingobj.h \
    2.60 +		imageobj.h \
    2.61 +		linkablemapobj.h \
    2.62 +		mainwindow.h \
    2.63 +		mapcenterobj.h \
    2.64 +		mapeditor.h \
    2.65 +		mapobj.h \
    2.66 +		misc.h \
    2.67 +		noteobj.h \
    2.68 +		ornamentedobj.h \
    2.69 +		process.h \
    2.70 +		selection.h \
    2.71 +		texteditor.h \
    2.72 +		version.h \
    2.73 +		xml.h \
    2.74 +		settings.h \
    2.75 +		options.h
    2.76 +SOURCES = branchobj.cpp \
    2.77 +		exports.cpp \
    2.78 +		findwindow.cpp \
    2.79 +		flagobj.cpp \
    2.80 +		flagrowobj.cpp \
    2.81 +		floatimageobj.cpp \
    2.82 +		floatobj.cpp \
    2.83 +		frameobj.cpp \
    2.84 +		headingobj.cpp \
    2.85 +		imageobj.cpp \
    2.86 +		linkablemapobj.cpp \
    2.87 +		main.cpp \
    2.88 +		mainwindow.cpp \
    2.89 +		mapcenterobj.cpp \
    2.90 +		mapeditor.cpp \
    2.91 +		mapobj.cpp \
    2.92 +		misc.cpp \
    2.93 +		noteobj.cpp \
    2.94 +		ornamentedobj.cpp \
    2.95 +		process.cpp \
    2.96 +		selection.cpp \
    2.97 +		texteditor.cpp \
    2.98 +		xml.cpp \
    2.99 +		settings.cpp \
   2.100 +		options.cpp
   2.101 +OBJECTS = branchobj.o \
   2.102 +		exports.o \
   2.103 +		findwindow.o \
   2.104 +		flagobj.o \
   2.105 +		flagrowobj.o \
   2.106 +		floatimageobj.o \
   2.107 +		floatobj.o \
   2.108 +		frameobj.o \
   2.109 +		headingobj.o \
   2.110 +		imageobj.o \
   2.111 +		linkablemapobj.o \
   2.112 +		main.o \
   2.113 +		mainwindow.o \
   2.114 +		mapcenterobj.o \
   2.115 +		mapeditor.o \
   2.116 +		mapobj.o \
   2.117 +		misc.o \
   2.118 +		noteobj.o \
   2.119 +		ornamentedobj.o \
   2.120 +		process.o \
   2.121 +		selection.o \
   2.122 +		texteditor.o \
   2.123 +		xml.o \
   2.124 +		settings.o \
   2.125 +		options.o \
   2.126 +		exporthtmldialog.o \
   2.127 +		exportxhtmldialog.o \
   2.128 +		showtextdialog.o \
   2.129 +		extrainfodialog.o
   2.130 +FORMS = exporthtmldialog.ui \
   2.131 +		exportxhtmldialog.ui \
   2.132 +		showtextdialog.ui \
   2.133 +		extrainfodialog.ui
   2.134 +UICDECLS = exporthtmldialog.h \
   2.135 +		exportxhtmldialog.h \
   2.136 +		showtextdialog.h \
   2.137 +		extrainfodialog.h
   2.138 +UICIMPLS = exporthtmldialog.cpp \
   2.139 +		exportxhtmldialog.cpp \
   2.140 +		showtextdialog.cpp \
   2.141 +		extrainfodialog.cpp
   2.142 +SRCMOC   = moc_findwindow.cpp \
   2.143 +		moc_linkablemapobj.cpp \
   2.144 +		moc_mainwindow.cpp \
   2.145 +		moc_mapeditor.cpp \
   2.146 +		moc_ornamentedobj.cpp \
   2.147 +		moc_process.cpp \
   2.148 +		moc_texteditor.cpp \
   2.149 +		moc_exporthtmldialog.cpp \
   2.150 +		moc_exportxhtmldialog.cpp \
   2.151 +		moc_showtextdialog.cpp \
   2.152 +		moc_extrainfodialog.cpp
   2.153 +OBJMOC = moc_findwindow.o \
   2.154 +		moc_linkablemapobj.o \
   2.155 +		moc_mainwindow.o \
   2.156 +		moc_mapeditor.o \
   2.157 +		moc_ornamentedobj.o \
   2.158 +		moc_process.o \
   2.159 +		moc_texteditor.o \
   2.160 +		moc_exporthtmldialog.o \
   2.161 +		moc_exportxhtmldialog.o \
   2.162 +		moc_showtextdialog.o \
   2.163 +		moc_extrainfodialog.o
   2.164 +DIST	   = vym.pro
   2.165 +QMAKE_TARGET = vym
   2.166 +DESTDIR  = 
   2.167 +TARGET   = vym
   2.168 +
   2.169 +first: all
   2.170 +####### Implicit rules
   2.171 +
   2.172 +.SUFFIXES: .c .o .cpp .cc .cxx .C
   2.173 +
   2.174 +.cpp.o:
   2.175 +	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
   2.176 +
   2.177 +.cc.o:
   2.178 +	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
   2.179 +
   2.180 +.cxx.o:
   2.181 +	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
   2.182 +
   2.183 +.C.o:
   2.184 +	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
   2.185 +
   2.186 +.c.o:
   2.187 +	$(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
   2.188 +
   2.189 +####### Build rules
   2.190 +
   2.191 +all: Makefile $(TARGET)
   2.192 +
   2.193 +$(TARGET):  $(UICDECLS) $(OBJECTS) $(OBJMOC)  
   2.194 +	$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(OBJCOMP) $(LIBS)
   2.195 +
   2.196 +mocables: $(SRCMOC)
   2.197 +uicables: $(UICDECLS) $(UICIMPLS)
   2.198 +
   2.199 +$(MOC): 
   2.200 +	( cd $(QTDIR)/src/moc && $(MAKE) )
   2.201 +
   2.202 +Makefile: vym.pro  /usr/lib/qt3/mkspecs/linux-g++/qmake.conf /usr/lib/qt3/lib64/libqt-mt.prl
   2.203 +	$(QMAKE) -o Makefile vym.pro
   2.204 +qmake: 
   2.205 +	@$(QMAKE) -o Makefile vym.pro
   2.206 +
   2.207 +dist: 
   2.208 +	@mkdir -p .tmp/vym && $(COPY_FILE) --parents $(SOURCES) $(HEADERS) $(FORMS) $(DIST) .tmp/vym/ && $(COPY_FILE) --parents vym_de.ts .tmp/vym/ && $(COPY_FILE) --parents exporthtmldialog.ui.h exportxhtmldialog.ui.h showtextdialog.ui.h extrainfodialog.ui.h .tmp/vym/ && ( cd `dirname .tmp/vym` && $(TAR) vym.tar vym && $(GZIP) vym.tar ) && $(MOVE) `dirname .tmp/vym`/vym.tar.gz . && $(DEL_FILE) -r .tmp/vym
   2.209 +
   2.210 +mocclean:
   2.211 +	-$(DEL_FILE) $(OBJMOC)
   2.212 +	-$(DEL_FILE) $(SRCMOC)
   2.213 +
   2.214 +uiclean:
   2.215 +	-$(DEL_FILE) $(UICIMPLS) $(UICDECLS)
   2.216 +
   2.217 +yaccclean:
   2.218 +lexclean:
   2.219 +clean: mocclean uiclean
   2.220 +	-$(DEL_FILE) $(OBJECTS)
   2.221 +	-$(DEL_FILE) *~ core *.core
   2.222 +
   2.223 +
   2.224 +####### Sub-libraries
   2.225 +
   2.226 +distclean: clean
   2.227 +	-$(DEL_FILE) $(TARGET) $(TARGET)
   2.228 +
   2.229 +
   2.230 +FORCE:
   2.231 +
   2.232 +####### Compile
   2.233 +
   2.234 +branchobj.o: branchobj.cpp branchobj.h \
   2.235 +		texteditor.h \
   2.236 +		mapeditor.h \
   2.237 +		mainwindow.h \
   2.238 +		floatimageobj.h \
   2.239 +		linkablemapobj.h \
   2.240 +		ornamentedobj.h \
   2.241 +		floatobj.h \
   2.242 +		frameobj.h \
   2.243 +		noteobj.h \
   2.244 +		headingobj.h \
   2.245 +		flagrowobj.h \
   2.246 +		mapobj.h \
   2.247 +		misc.h \
   2.248 +		flagobj.h \
   2.249 +		imageobj.h \
   2.250 +		mapcenterobj.h \
   2.251 +		version.h \
   2.252 +		xml.h \
   2.253 +		findwindow.h
   2.254 +
   2.255 +exports.o: exports.cpp exports.h \
   2.256 +		linkablemapobj.h \
   2.257 +		mapcenterobj.h \
   2.258 +		branchobj.h \
   2.259 +		version.h \
   2.260 +		floatimageobj.h \
   2.261 +		ornamentedobj.h \
   2.262 +		floatobj.h \
   2.263 +		frameobj.h \
   2.264 +		noteobj.h \
   2.265 +		headingobj.h \
   2.266 +		flagrowobj.h \
   2.267 +		mapobj.h \
   2.268 +		misc.h \
   2.269 +		flagobj.h \
   2.270 +		imageobj.h
   2.271 +
   2.272 +findwindow.o: findwindow.cpp findwindow.h
   2.273 +
   2.274 +flagobj.o: flagobj.cpp flagobj.h \
   2.275 +		mapobj.h \
   2.276 +		imageobj.h \
   2.277 +		misc.h
   2.278 +
   2.279 +flagrowobj.o: flagrowobj.cpp flagrowobj.h \
   2.280 +		mapobj.h \
   2.281 +		flagobj.h \
   2.282 +		misc.h \
   2.283 +		imageobj.h
   2.284 +
   2.285 +floatimageobj.o: floatimageobj.cpp floatimageobj.h \
   2.286 +		branchobj.h \
   2.287 +		floatobj.h \
   2.288 +		linkablemapobj.h \
   2.289 +		frameobj.h \
   2.290 +		noteobj.h \
   2.291 +		headingobj.h \
   2.292 +		flagrowobj.h \
   2.293 +		mapobj.h \
   2.294 +		misc.h \
   2.295 +		flagobj.h \
   2.296 +		imageobj.h \
   2.297 +		ornamentedobj.h
   2.298 +
   2.299 +floatobj.o: floatobj.cpp floatobj.h \
   2.300 +		linkablemapobj.h \
   2.301 +		frameobj.h \
   2.302 +		noteobj.h \
   2.303 +		headingobj.h \
   2.304 +		flagrowobj.h \
   2.305 +		mapobj.h \
   2.306 +		misc.h \
   2.307 +		flagobj.h \
   2.308 +		imageobj.h
   2.309 +
   2.310 +frameobj.o: frameobj.cpp frameobj.h \
   2.311 +		mapobj.h \
   2.312 +		misc.h
   2.313 +
   2.314 +headingobj.o: headingobj.cpp headingobj.h \
   2.315 +		mapobj.h \
   2.316 +		misc.h
   2.317 +
   2.318 +imageobj.o: imageobj.cpp imageobj.h \
   2.319 +		mapobj.h \
   2.320 +		misc.h
   2.321 +
   2.322 +linkablemapobj.o: linkablemapobj.cpp linkablemapobj.h \
   2.323 +		branchobj.h \
   2.324 +		mapeditor.h \
   2.325 +		version.h \
   2.326 +		frameobj.h \
   2.327 +		noteobj.h \
   2.328 +		headingobj.h \
   2.329 +		flagrowobj.h \
   2.330 +		mapobj.h \
   2.331 +		misc.h \
   2.332 +		flagobj.h \
   2.333 +		imageobj.h \
   2.334 +		floatimageobj.h \
   2.335 +		ornamentedobj.h \
   2.336 +		floatobj.h \
   2.337 +		mapcenterobj.h
   2.338 +
   2.339 +main.o: main.cpp settings.h \
   2.340 +		options.h \
   2.341 +		mainwindow.h \
   2.342 +		icons/vym-48x48.xpm \
   2.343 +		icons/vym-editor.xpm \
   2.344 +		flagrowobj.h \
   2.345 +		misc.h \
   2.346 +		xml.h \
   2.347 +		texteditor.h \
   2.348 +		mapeditor.h \
   2.349 +		findwindow.h \
   2.350 +		mapcenterobj.h \
   2.351 +		branchobj.h \
   2.352 +		version.h \
   2.353 +		floatimageobj.h \
   2.354 +		linkablemapobj.h \
   2.355 +		ornamentedobj.h \
   2.356 +		floatobj.h \
   2.357 +		frameobj.h \
   2.358 +		noteobj.h \
   2.359 +		headingobj.h \
   2.360 +		mapobj.h \
   2.361 +		flagobj.h \
   2.362 +		imageobj.h
   2.363 +
   2.364 +mainwindow.o: mainwindow.cpp mainwindow.h \
   2.365 +		version.h \
   2.366 +		icons/filenew.xpm \
   2.367 +		icons/fileopen.xpm \
   2.368 +		icons/filesave.xpm \
   2.369 +		icons/fileprint.xpm \
   2.370 +		icons/editundo.xpm \
   2.371 +		icons/editcopy.xpm \
   2.372 +		icons/editcut.xpm \
   2.373 +		icons/editpaste.xpm \
   2.374 +		icons/editmoveup.xpm \
   2.375 +		icons/editmovedown.xpm \
   2.376 +		icons/formatcoloritem.xpm \
   2.377 +		icons/formatcolorbranch.xpm \
   2.378 +		icons/formatcolorpicker.xpm \
   2.379 +		icons/viewzoomreset.xpm \
   2.380 +		icons/viewzoomin.xpm \
   2.381 +		icons/viewzoomout.xpm \
   2.382 +		icons/vym-48x48.xpm \
   2.383 +		icons/flag-note.xpm \
   2.384 +		icons/flag-url.xpm \
   2.385 +		icons/flag-vymlink.xpm \
   2.386 +		icons/flag-scrolled-right.xpm \
   2.387 +		flagrowobj.h \
   2.388 +		texteditor.h \
   2.389 +		mapeditor.h \
   2.390 +		exporthtmldialog.h \
   2.391 +		exportxhtmldialog.h \
   2.392 +		showtextdialog.h \
   2.393 +		process.h \
   2.394 +		settings.h \
   2.395 +		options.h \
   2.396 +		xml.h \
   2.397 +		findwindow.h \
   2.398 +		mapcenterobj.h \
   2.399 +		branchobj.h \
   2.400 +		floatimageobj.h \
   2.401 +		linkablemapobj.h \
   2.402 +		ornamentedobj.h \
   2.403 +		floatobj.h \
   2.404 +		frameobj.h \
   2.405 +		noteobj.h \
   2.406 +		headingobj.h \
   2.407 +		mapobj.h \
   2.408 +		misc.h \
   2.409 +		flagobj.h \
   2.410 +		imageobj.h
   2.411 +
   2.412 +mapcenterobj.o: mapcenterobj.cpp mapcenterobj.h \
   2.413 +		floatimageobj.h \
   2.414 +		mapeditor.h \
   2.415 +		branchobj.h \
   2.416 +		version.h \
   2.417 +		linkablemapobj.h \
   2.418 +		ornamentedobj.h \
   2.419 +		floatobj.h \
   2.420 +		frameobj.h \
   2.421 +		noteobj.h \
   2.422 +		headingobj.h \
   2.423 +		flagrowobj.h \
   2.424 +		mapobj.h \
   2.425 +		misc.h \
   2.426 +		flagobj.h \
   2.427 +		imageobj.h
   2.428 +
   2.429 +mapeditor.o: mapeditor.cpp mapeditor.h \
   2.430 +		version.h \
   2.431 +		xml.h \
   2.432 +		texteditor.h \
   2.433 +		linkablemapobj.h \
   2.434 +		exports.h \
   2.435 +		misc.h \
   2.436 +		mainwindow.h \
   2.437 +		extrainfodialog.h \
   2.438 +		settings.h \
   2.439 +		icons/flag-note.xpm \
   2.440 +		icons/flag-url.xpm \
   2.441 +		icons/flag-vymlink.xpm \
   2.442 +		icons/flag-scrolled-right.xpm \
   2.443 +		icons/flag-tmpUnscrolled-right.xpm \
   2.444 +		icons/flag-questionmark.xpm \
   2.445 +		icons/flag-exclamationmark.xpm \
   2.446 +		icons/flag-hook-green.xpm \
   2.447 +		icons/flag-cross-red.xpm \
   2.448 +		icons/flag-stopsign.xpm \
   2.449 +		icons/flag-smiley-good.xpm \
   2.450 +		icons/flag-smiley-sad.xpm \
   2.451 +		icons/flag-clock.xpm \
   2.452 +		icons/flag-lamp.xpm \
   2.453 +		icons/flag-arrow-up.xpm \
   2.454 +		icons/flag-arrow-down.xpm \
   2.455 +		icons/flag-thumb-up.xpm \
   2.456 +		icons/flag-thumb-down.xpm \
   2.457 +		icons/flag-heart.xpm \
   2.458 +		icons/flag-flash.xpm \
   2.459 +		icons/flag-lifebelt.xpm \
   2.460 +		mapcenterobj.h \
   2.461 +		branchobj.h \
   2.462 +		floatimageobj.h \
   2.463 +		ornamentedobj.h \
   2.464 +		floatobj.h \
   2.465 +		frameobj.h \
   2.466 +		noteobj.h \
   2.467 +		headingobj.h \
   2.468 +		flagrowobj.h \
   2.469 +		mapobj.h \
   2.470 +		flagobj.h \
   2.471 +		imageobj.h \
   2.472 +		findwindow.h
   2.473 +
   2.474 +mapobj.o: mapobj.cpp mapobj.h \
   2.475 +		misc.h
   2.476 +
   2.477 +misc.o: misc.cpp misc.h
   2.478 +
   2.479 +noteobj.o: noteobj.cpp noteobj.h \
   2.480 +		misc.h
   2.481 +
   2.482 +ornamentedobj.o: ornamentedobj.cpp ornamentedobj.h \
   2.483 +		texteditor.h \
   2.484 +		mapeditor.h \
   2.485 +		linkablemapobj.h \
   2.486 +		frameobj.h \
   2.487 +		noteobj.h \
   2.488 +		headingobj.h \
   2.489 +		flagrowobj.h \
   2.490 +		mapobj.h \
   2.491 +		misc.h \
   2.492 +		flagobj.h \
   2.493 +		imageobj.h \
   2.494 +		mapcenterobj.h \
   2.495 +		branchobj.h \
   2.496 +		version.h \
   2.497 +		floatimageobj.h \
   2.498 +		floatobj.h
   2.499 +
   2.500 +process.o: process.cpp process.h
   2.501 +
   2.502 +selection.o: selection.cpp selection.h \
   2.503 +		linkablemapobj.h \
   2.504 +		frameobj.h \
   2.505 +		noteobj.h \
   2.506 +		headingobj.h \
   2.507 +		flagrowobj.h \
   2.508 +		mapobj.h \
   2.509 +		misc.h \
   2.510 +		flagobj.h \
   2.511 +		imageobj.h
   2.512 +
   2.513 +texteditor.o: texteditor.cpp texteditor.h \
   2.514 +		icons/fileopen.xpm \
   2.515 +		icons/filesave.xpm \
   2.516 +		icons/fileprint.xpm \
   2.517 +		icons/editundo.xpm \
   2.518 +		icons/editredo.xpm \
   2.519 +		icons/editcopy.xpm \
   2.520 +		icons/editcut.xpm \
   2.521 +		icons/editpaste.xpm \
   2.522 +		icons/edittrash.xpm \
   2.523 +		icons/formatfixedfont.xpm \
   2.524 +		icons/formattextbold.xpm \
   2.525 +		icons/formattextitalic.xpm \
   2.526 +		icons/formattextunder.xpm \
   2.527 +		icons/formattextleft.xpm \
   2.528 +		icons/formattextcenter.xpm \
   2.529 +		icons/formattextright.xpm \
   2.530 +		icons/formattextjustify.xpm
   2.531 +
   2.532 +xml.o: xml.cpp xml.h \
   2.533 +		misc.h \
   2.534 +		settings.h \
   2.535 +		version.h \
   2.536 +		mapcenterobj.h \
   2.537 +		mapeditor.h \
   2.538 +		branchobj.h \
   2.539 +		floatimageobj.h \
   2.540 +		linkablemapobj.h \
   2.541 +		ornamentedobj.h \
   2.542 +		floatobj.h \
   2.543 +		frameobj.h \
   2.544 +		noteobj.h \
   2.545 +		headingobj.h \
   2.546 +		flagrowobj.h \
   2.547 +		mapobj.h \
   2.548 +		flagobj.h \
   2.549 +		imageobj.h
   2.550 +
   2.551 +settings.o: settings.cpp settings.h \
   2.552 +		misc.h
   2.553 +
   2.554 +options.o: options.cpp options.h
   2.555 +
   2.556 +exporthtmldialog.h: exporthtmldialog.ui showtextdialog.h
   2.557 +	$(UIC) exporthtmldialog.ui -o exporthtmldialog.h
   2.558 +
   2.559 +exporthtmldialog.cpp: exporthtmldialog.h exporthtmldialog.ui showtextdialog.h
   2.560 +	$(UIC) exporthtmldialog.ui -i exporthtmldialog.h -o exporthtmldialog.cpp
   2.561 +
   2.562 +exportxhtmldialog.h: exportxhtmldialog.ui process.h \
   2.563 +		showtextdialog.h
   2.564 +	$(UIC) exportxhtmldialog.ui -o exportxhtmldialog.h
   2.565 +
   2.566 +exportxhtmldialog.cpp: exportxhtmldialog.h exportxhtmldialog.ui process.h \
   2.567 +		showtextdialog.h
   2.568 +	$(UIC) exportxhtmldialog.ui -i exportxhtmldialog.h -o exportxhtmldialog.cpp
   2.569 +
   2.570 +showtextdialog.h: showtextdialog.ui 
   2.571 +	$(UIC) showtextdialog.ui -o showtextdialog.h
   2.572 +
   2.573 +showtextdialog.cpp: showtextdialog.h showtextdialog.ui 
   2.574 +	$(UIC) showtextdialog.ui -i showtextdialog.h -o showtextdialog.cpp
   2.575 +
   2.576 +extrainfodialog.h: extrainfodialog.ui 
   2.577 +	$(UIC) extrainfodialog.ui -o extrainfodialog.h
   2.578 +
   2.579 +extrainfodialog.cpp: extrainfodialog.h extrainfodialog.ui 
   2.580 +	$(UIC) extrainfodialog.ui -i extrainfodialog.h -o extrainfodialog.cpp
   2.581 +
   2.582 +exporthtmldialog.o: exporthtmldialog.cpp settings.h \
   2.583 +		misc.h \
   2.584 +		icons/flag-url.xpm \
   2.585 +		exporthtmldialog.ui.h \
   2.586 +		exporthtmldialog.h
   2.587 +
   2.588 +exportxhtmldialog.o: exportxhtmldialog.cpp settings.h \
   2.589 +		icons/flag-url.xpm \
   2.590 +		exportxhtmldialog.ui.h \
   2.591 +		exportxhtmldialog.h
   2.592 +
   2.593 +showtextdialog.o: showtextdialog.cpp showtextdialog.ui.h \
   2.594 +		showtextdialog.h
   2.595 +
   2.596 +extrainfodialog.o: extrainfodialog.cpp extrainfodialog.ui.h \
   2.597 +		extrainfodialog.h
   2.598 +
   2.599 +moc_findwindow.o: moc_findwindow.cpp  findwindow.h 
   2.600 +
   2.601 +moc_linkablemapobj.o: moc_linkablemapobj.cpp  linkablemapobj.h frameobj.h \
   2.602 +		noteobj.h \
   2.603 +		headingobj.h \
   2.604 +		flagrowobj.h \
   2.605 +		mapobj.h \
   2.606 +		misc.h \
   2.607 +		flagobj.h \
   2.608 +		imageobj.h
   2.609 +
   2.610 +moc_mainwindow.o: moc_mainwindow.cpp  mainwindow.h xml.h \
   2.611 +		texteditor.h \
   2.612 +		mapeditor.h \
   2.613 +		findwindow.h \
   2.614 +		mapcenterobj.h \
   2.615 +		branchobj.h \
   2.616 +		version.h \
   2.617 +		floatimageobj.h \
   2.618 +		linkablemapobj.h \
   2.619 +		ornamentedobj.h \
   2.620 +		floatobj.h \
   2.621 +		frameobj.h \
   2.622 +		noteobj.h \
   2.623 +		headingobj.h \
   2.624 +		flagrowobj.h \
   2.625 +		mapobj.h \
   2.626 +		misc.h \
   2.627 +		flagobj.h \
   2.628 +		imageobj.h
   2.629 +
   2.630 +moc_mapeditor.o: moc_mapeditor.cpp  mapeditor.h mapcenterobj.h \
   2.631 +		misc.h \
   2.632 +		branchobj.h \
   2.633 +		version.h \
   2.634 +		floatimageobj.h \
   2.635 +		linkablemapobj.h \
   2.636 +		ornamentedobj.h \
   2.637 +		floatobj.h \
   2.638 +		frameobj.h \
   2.639 +		noteobj.h \
   2.640 +		headingobj.h \
   2.641 +		flagrowobj.h \
   2.642 +		mapobj.h \
   2.643 +		flagobj.h \
   2.644 +		imageobj.h
   2.645 +
   2.646 +moc_ornamentedobj.o: moc_ornamentedobj.cpp  ornamentedobj.h linkablemapobj.h \
   2.647 +		frameobj.h \
   2.648 +		noteobj.h \
   2.649 +		headingobj.h \
   2.650 +		flagrowobj.h \
   2.651 +		mapobj.h \
   2.652 +		misc.h \
   2.653 +		flagobj.h \
   2.654 +		imageobj.h
   2.655 +
   2.656 +moc_process.o: moc_process.cpp  process.h 
   2.657 +
   2.658 +moc_texteditor.o: moc_texteditor.cpp  texteditor.h 
   2.659 +
   2.660 +moc_exporthtmldialog.o: moc_exporthtmldialog.cpp  exporthtmldialog.h showtextdialog.h
   2.661 +
   2.662 +moc_exportxhtmldialog.o: moc_exportxhtmldialog.cpp  exportxhtmldialog.h process.h \
   2.663 +		showtextdialog.h
   2.664 +
   2.665 +moc_showtextdialog.o: moc_showtextdialog.cpp  showtextdialog.h 
   2.666 +
   2.667 +moc_extrainfodialog.o: moc_extrainfodialog.cpp  extrainfodialog.h 
   2.668 +
   2.669 +moc_findwindow.cpp: $(MOC) findwindow.h
   2.670 +	$(MOC) findwindow.h -o moc_findwindow.cpp
   2.671 +
   2.672 +moc_linkablemapobj.cpp: $(MOC) linkablemapobj.h
   2.673 +	$(MOC) linkablemapobj.h -o moc_linkablemapobj.cpp
   2.674 +
   2.675 +moc_mainwindow.cpp: $(MOC) mainwindow.h
   2.676 +	$(MOC) mainwindow.h -o moc_mainwindow.cpp
   2.677 +
   2.678 +moc_mapeditor.cpp: $(MOC) mapeditor.h
   2.679 +	$(MOC) mapeditor.h -o moc_mapeditor.cpp
   2.680 +
   2.681 +moc_ornamentedobj.cpp: $(MOC) ornamentedobj.h
   2.682 +	$(MOC) ornamentedobj.h -o moc_ornamentedobj.cpp
   2.683 +
   2.684 +moc_process.cpp: $(MOC) process.h
   2.685 +	$(MOC) process.h -o moc_process.cpp
   2.686 +
   2.687 +moc_texteditor.cpp: $(MOC) texteditor.h
   2.688 +	$(MOC) texteditor.h -o moc_texteditor.cpp
   2.689 +
   2.690 +moc_exporthtmldialog.cpp: $(MOC) exporthtmldialog.h
   2.691 +	$(MOC) exporthtmldialog.h -o moc_exporthtmldialog.cpp
   2.692 +
   2.693 +moc_exportxhtmldialog.cpp: $(MOC) exportxhtmldialog.h
   2.694 +	$(MOC) exportxhtmldialog.h -o moc_exportxhtmldialog.cpp
   2.695 +
   2.696 +moc_showtextdialog.cpp: $(MOC) showtextdialog.h
   2.697 +	$(MOC) showtextdialog.h -o moc_showtextdialog.cpp
   2.698 +
   2.699 +moc_extrainfodialog.cpp: $(MOC) extrainfodialog.h
   2.700 +	$(MOC) extrainfodialog.h -o moc_extrainfodialog.cpp
   2.701 +
   2.702 +####### Install
   2.703 +
   2.704 +install_target: all 
   2.705 +	@$(CHK_DIR_EXISTS) "$(INSTALL_ROOT)/usr/bin/" || $(MKDIR) "$(INSTALL_ROOT)/usr/bin/"
   2.706 +	-$(INSTALL_FILE) "$(QMAKE_TARGET)" "$(INSTALL_ROOT)/usr/bin/$(QMAKE_TARGET)"
   2.707 +
   2.708 +uninstall_target: 
   2.709 +	-$(DEL_FILE) "$(INSTALL_ROOT)/usr/bin/$(QMAKE_TARGET)"
   2.710 +	-$(DEL_DIR) "$(INSTALL_ROOT)/usr/bin/"
   2.711 +
   2.712 +
   2.713 +install_support: all 
   2.714 +	@$(CHK_DIR_EXISTS) "$(INSTALL_ROOT)/usr/share/vym/" || $(MKDIR) "$(INSTALL_ROOT)/usr/share/vym/"
   2.715 +	-$(INSTALL_DIR) "styles" "$(INSTALL_ROOT)/usr/share/vym/"
   2.716 +	-$(INSTALL_DIR) "scripts" "$(INSTALL_ROOT)/usr/share/vym/"
   2.717 +	-$(INSTALL_DIR) "icons" "$(INSTALL_ROOT)/usr/share/vym/"
   2.718 +
   2.719 +
   2.720 +uninstall_support: 
   2.721 +	-$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/share/vym/styles"
   2.722 +	-$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/share/vym/scripts"
   2.723 +	-$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/share/vym/icons"
   2.724 +	-$(DEL_DIR) "$(INSTALL_ROOT)/usr/share/vym/"
   2.725 +
   2.726 +
   2.727 +install_demo: all 
   2.728 +	@$(CHK_DIR_EXISTS) "$(INSTALL_ROOT)/usr/share/vym/" || $(MKDIR) "$(INSTALL_ROOT)/usr/share/vym/"
   2.729 +	-$(INSTALL_DIR) "demos" "$(INSTALL_ROOT)/usr/share/vym/"
   2.730 +
   2.731 +
   2.732 +uninstall_demo: 
   2.733 +	-$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/share/vym/demos"
   2.734 +	-$(DEL_DIR) "$(INSTALL_ROOT)/usr/share/vym/"
   2.735 +
   2.736 +
   2.737 +install: install_target install_support install_demo  
   2.738 +
   2.739 +uninstall: uninstall_target uninstall_support uninstall_demo  
   2.740 +
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/branchobj.cpp	Sun Jan 30 12:59:10 2005 +0000
     3.3 @@ -0,0 +1,1184 @@
     3.4 +#include "branchobj.h"
     3.5 +#include "texteditor.h"
     3.6 +#include "mapeditor.h"
     3.7 +#include "mainwindow.h"
     3.8 +
     3.9 +extern TextEditor *textEditor;
    3.10 +extern Main *mainWindow;
    3.11 +extern FlagRowObj *standardFlagsDefault;
    3.12 +extern QAction *actionEditOpenURL;
    3.13 +
    3.14 +
    3.15 +/////////////////////////////////////////////////////////////////
    3.16 +// BranchObj
    3.17 +/////////////////////////////////////////////////////////////////
    3.18 +
    3.19 +BranchObj* BranchObj::itLast=NULL;
    3.20 +
    3.21 +
    3.22 +BranchObj::BranchObj () :OrnamentedObj()
    3.23 +{
    3.24 +//    cout << "Const BranchObj ()\n";
    3.25 +    setParObj (this);	
    3.26 +    init();
    3.27 +    depth=-1;
    3.28 +}
    3.29 +
    3.30 +BranchObj::BranchObj (QCanvas* c):OrnamentedObj (c)
    3.31 +{
    3.32 +//    cout << "Const BranchObj (c)  called from MapCenterObj (c)\n";
    3.33 +    canvas=c;
    3.34 +}
    3.35 +
    3.36 +BranchObj::BranchObj (QCanvas* c, LinkableMapObj* p):OrnamentedObj (c)
    3.37 +{
    3.38 +//    cout << "Const BranchObj (c,p)\n";
    3.39 +    canvas=c;
    3.40 +    setParObj (p);	
    3.41 +    depth=p->getDepth()+1;
    3.42 +	if (depth==1)
    3.43 +		// Calc angle to mapCenter if I am a mainbranch
    3.44 +		// needed for reordering the mainbranches clockwise 
    3.45 +		// around mapcenter 
    3.46 +		angle=getAngle (QPoint ((int)(x() - parObj->getChildPos().x() ), 
    3.47 +								(int)(y() - parObj->getChildPos().y() ) ) );
    3.48 +    init();
    3.49 +}
    3.50 +
    3.51 +BranchObj::~BranchObj ()
    3.52 +{
    3.53 +    //cout << "Destr BranchObj\n";
    3.54 +	// Check, if this branch was the last child to be deleted
    3.55 +	// If so, unset the scrolled flags
    3.56 +
    3.57 +	BranchObj *po=(BranchObj*)(parObj);
    3.58 +	if (po)
    3.59 +	{
    3.60 +		BranchObj *bo=((BranchObj*)(parObj))->getLastBranch();
    3.61 +		if (!bo) po->unScroll();
    3.62 +	}
    3.63 +}
    3.64 +
    3.65 +bool BranchObj::operator< ( const BranchObj & other )
    3.66 +{
    3.67 +    return  angle < other.angle;
    3.68 +}
    3.69 +
    3.70 +bool BranchObj::operator== ( const BranchObj & other )
    3.71 +{
    3.72 +    return angle == other.angle;
    3.73 +}
    3.74 +
    3.75 +int BranchObjPtrList::compareItems ( QPtrCollection::Item i, QPtrCollection::Item j)
    3.76 +{
    3.77 +	// Make sure PtrList::find works
    3.78 +	if (i==j) return 0;
    3.79 +
    3.80 +	if ( ((BranchObj*)(i))->angle > ((BranchObj*)(j))->angle )
    3.81 +		return 1;
    3.82 +	else
    3.83 +		return -1;
    3.84 +}
    3.85 +
    3.86 +void BranchObj::init () 
    3.87 +{
    3.88 +    branch.setAutoDelete (true);
    3.89 +    floatimage.setAutoDelete (true);
    3.90 +
    3.91 +	absPos=getRandPos();
    3.92 +	absPos+=parObj->getChildPos();
    3.93 +
    3.94 +    // TODO This should be done in TextObj later
    3.95 +    QFont font("Sans Serif,8,-1,5,50,0,0,0,0,0");
    3.96 +//    font.setPointSize(12);
    3.97 +   heading->setFont(font );
    3.98 +//    heading->setText(QObject::tr("new branch"));
    3.99 +
   3.100 +    lastSelectedBranch=-1;
   3.101 +
   3.102 +    setChildObj(this);
   3.103 +
   3.104 +	scrolled=false;
   3.105 +	tmpUnscrolled=false;
   3.106 +
   3.107 +	url="";
   3.108 +	vymLink="";
   3.109 +}
   3.110 +
   3.111 +void BranchObj::copy (BranchObj* other)
   3.112 +{
   3.113 +    OrnamentedObj::copy(other);
   3.114 +
   3.115 +	branch.clear();
   3.116 +    BranchObj* b;
   3.117 +    for (b=other->branch.first(); b;b=other->branch.next() ) 
   3.118 +		// Make deep copy of b
   3.119 +		// Because addBranch again calls copy for the childs,
   3.120 +		// Those will get a deep copy, too
   3.121 +		addBranch(b);	
   3.122 +
   3.123 +	FloatImageObj *fi;
   3.124 +	for (fi=other->floatimage.first(); fi;fi=other->floatimage.next() )
   3.125 +		addFloatImage (fi);
   3.126 +
   3.127 +	scrolled=other->scrolled;
   3.128 +	tmpUnscrolled=other->tmpUnscrolled;
   3.129 +	setVisibility (other->visible);
   3.130 +
   3.131 +	url=other->url;
   3.132 +	vymLink=other->vymLink;
   3.133 +
   3.134 +	angle=other->angle;
   3.135 +
   3.136 +    positionBBox();
   3.137 +}
   3.138 +
   3.139 +void BranchObj::clear() 
   3.140 +{
   3.141 +	branch.clear();
   3.142 +	floatimage.clear();
   3.143 +}
   3.144 +
   3.145 +int BranchObj::getNum()
   3.146 +{
   3.147 +	if (parObj)
   3.148 +		return ((BranchObj*)(parObj))->getNum ((BranchObj*)(this));
   3.149 +	else
   3.150 +		return 0;
   3.151 +}
   3.152 +
   3.153 +int BranchObj::getNum(BranchObj *bo)
   3.154 +{
   3.155 +	return branch.findRef (bo);
   3.156 +}
   3.157 +
   3.158 +int BranchObj::getFloatImageNum(FloatImageObj *fio)
   3.159 +{
   3.160 +	return floatimage.findRef (fio);
   3.161 +}
   3.162 +
   3.163 +int BranchObj::countBranches()
   3.164 +{
   3.165 +	return branch.count();
   3.166 +}
   3.167 +
   3.168 +int BranchObj::countFloatImages()
   3.169 +{
   3.170 +	return floatimage.count();
   3.171 +}
   3.172 +
   3.173 +void BranchObj::setParObjTmp(LinkableMapObj* lmo, QPoint m, int off)
   3.174 +{
   3.175 +	// Temporary link to lmo
   3.176 +	// m is position of mouse pointer 
   3.177 +	// offset 0: default 1: below lmo   -1 above lmo  (if possible)
   3.178 +
   3.179 +
   3.180 +	BranchObj* o=(BranchObj*)(lmo);
   3.181 +	if (!parObjTmpBuf) 
   3.182 +		parObjTmpBuf=parObj;
   3.183 +
   3.184 +	// ignore mapcenter and mainbranch
   3.185 +	if (lmo->getDepth()<2) off=0;
   3.186 +	if (off==0)
   3.187 +	{
   3.188 +		link2ParPos=false;
   3.189 +		parObj=o;
   3.190 +	}	
   3.191 +	else
   3.192 +	{	
   3.193 +		link2ParPos=true;
   3.194 +		if (off>0)
   3.195 +			parObj=o->getParObj();
   3.196 +		else	
   3.197 +			parObj=o->getParObj();
   3.198 +		parObj=o;
   3.199 +	}		
   3.200 +
   3.201 +	depth=parObj->getDepth()+1;
   3.202 +
   3.203 +	// setLinkStyle calls updateLink, only set it once
   3.204 +	if (style!=getDefLinkStyle() ) setLinkStyle (getDefLinkStyle());
   3.205 +
   3.206 +	// Move temporary to new position at destination
   3.207 +	// Usually the positioning would be done by reposition(),
   3.208 +	// but then also the destination branch would "Jump" around...
   3.209 +	// Better just do it approximately
   3.210 +	if (depth==1)
   3.211 +	{	// new parent is the mapcenter itself
   3.212 +
   3.213 +		QPoint p= normalise ( QPoint (m.x() - o->getChildPos().x(),
   3.214 +									  m.y() - o->getChildPos().y() ));
   3.215 +		if (p.x()<0) p.setX( p.x()-bbox.width() );
   3.216 +		move2RelPos (p);
   3.217 +	} else
   3.218 +	{	
   3.219 +		int y;
   3.220 +		if (off==0)
   3.221 +		{
   3.222 +			// new parent is just a branch, link to it
   3.223 +			QRect t=o->getBBoxSizeWithChilds();
   3.224 +			if (o->getLastBranch())
   3.225 +				y=t.y() + t.height() ;
   3.226 +			else
   3.227 +				y=t.y();
   3.228 +
   3.229 +		} else
   3.230 +		{
   3.231 +			if (off<0)
   3.232 +				// we want to link above lmo
   3.233 +				y=o->y() - height() + 5;
   3.234 +			else	
   3.235 +				// we want to link below lmo
   3.236 +				// Bottom of sel should be 5 pixels above
   3.237 +				// the bottom of the branch _below_ the target:
   3.238 +				// Don't try to find that branch, guess 12 pixels
   3.239 +				y=o->getChildPos().y()  -height() + 12; 
   3.240 +		}	
   3.241 +		if (o->getOrientation()==OrientLeftOfCenter)
   3.242 +			move ( o->getChildPos().x() - linkwidth, y );
   3.243 +		else	
   3.244 +			move (o->getChildPos().x() + linkwidth, y );
   3.245 +	}	
   3.246 +
   3.247 +	// updateLink is called implicitly in move
   3.248 +	reposition();	// FIXME shouldn't be this a request?
   3.249 +}
   3.250 +
   3.251 +void BranchObj::unsetParObjTmp()
   3.252 +{
   3.253 +	if (parObjTmpBuf) 
   3.254 +	{
   3.255 +		link2ParPos=false;
   3.256 +		parObj=parObjTmpBuf;
   3.257 +		parObjTmpBuf=NULL;
   3.258 +		depth=parObj->getDepth()+1;
   3.259 +		setLinkStyle (getDefLinkStyle() );
   3.260 +	}		
   3.261 +}
   3.262 +
   3.263 +void BranchObj::unScroll()
   3.264 +{
   3.265 +	if (tmpUnscrolled) resetTmpUnscroll();
   3.266 +	if (scrolled) toggleScroll();
   3.267 +}
   3.268 +
   3.269 +void BranchObj::toggleScroll()
   3.270 +{
   3.271 +	BranchObj *bo;
   3.272 +	if (scrolled)
   3.273 +	{
   3.274 +		scrolled=false;
   3.275 +		systemFlags->deactivate("scrolledright");
   3.276 +		for (bo=branch.first(); bo; bo=branch.next() )
   3.277 +		{
   3.278 +			bo->setVisibility(true);
   3.279 +		}
   3.280 +	} else
   3.281 +	{
   3.282 +		scrolled=true;
   3.283 +		systemFlags->activate("scrolledright");
   3.284 +		for (bo=branch.first(); bo; bo=branch.next() )
   3.285 +		{
   3.286 +			bo->setVisibility(false);
   3.287 +		}
   3.288 +	}
   3.289 +	calcBBoxSize();
   3.290 +	positionBBox();	
   3.291 +	move (absPos.x(), absPos.y() );
   3.292 +	forceReposition();
   3.293 +}
   3.294 +
   3.295 +bool BranchObj::isScrolled()
   3.296 +{
   3.297 +	return scrolled;
   3.298 +}
   3.299 +
   3.300 +bool BranchObj::hasScrolledParent(BranchObj *start)
   3.301 +{
   3.302 +	// Calls parents recursivly to
   3.303 +	// find out, if we are scrolled at all.
   3.304 +	// But ignore myself, just look at parents.
   3.305 +
   3.306 +	if (this !=start && scrolled) return true;
   3.307 +
   3.308 +	BranchObj* bo=(BranchObj*)(parObj);
   3.309 +	if (bo) 
   3.310 +		return bo->hasScrolledParent(start);
   3.311 +	else
   3.312 +		return false;
   3.313 +}
   3.314 +
   3.315 +void BranchObj::tmpUnscroll()
   3.316 +{
   3.317 +	// Unscroll parent (recursivly)
   3.318 +	BranchObj* bo=(BranchObj*)(parObj);
   3.319 +	if (bo) bo->tmpUnscroll();
   3.320 +		
   3.321 +	// Unscroll myself
   3.322 +	if (scrolled)
   3.323 +	{
   3.324 +		tmpUnscrolled=true;
   3.325 +		systemFlags->activate("tmpUnscrolledright");
   3.326 +		toggleScroll();
   3.327 +	}	
   3.328 +}
   3.329 +
   3.330 +void BranchObj::resetTmpUnscroll()
   3.331 +{
   3.332 +	// Unscroll parent (recursivly)
   3.333 +	BranchObj* bo=(BranchObj*)(parObj);
   3.334 +	if (bo)
   3.335 +		bo->resetTmpUnscroll();
   3.336 +		
   3.337 +	// Unscroll myself
   3.338 +	if (tmpUnscrolled)
   3.339 +	{
   3.340 +		tmpUnscrolled=false;
   3.341 +		systemFlags->deactivate("tmpUnscrolledright");
   3.342 +		toggleScroll();
   3.343 +	}	
   3.344 +}
   3.345 +
   3.346 +void BranchObj::setVisibility(bool v, int toDepth)
   3.347 +{
   3.348 +    if (depth <= toDepth)
   3.349 +    {
   3.350 +		frame->setVisibility(v);
   3.351 +		heading->setVisibility(v);
   3.352 +		systemFlags->setVisibility(v);
   3.353 +		standardFlags->setVisibility(v);
   3.354 +		LinkableMapObj::setVisibility (v);
   3.355 +		
   3.356 +		if (!scrolled && (depth < toDepth))
   3.357 +		{
   3.358 +			// Now go recursivly through all childs
   3.359 +			BranchObj* b;
   3.360 +			for (b=branch.first(); b;b=branch.next() ) 
   3.361 +				b->setVisibility (v,toDepth);	
   3.362 +			FloatImageObj *fio;
   3.363 +			for (fio=floatimage.first(); fio; fio=floatimage.next())
   3.364 +				fio->setVisibility (v);
   3.365 +		}
   3.366 +    } // depth <= toDepth	
   3.367 +	move (absPos.x(), absPos.y() );
   3.368 +	requestReposition();
   3.369 +}	
   3.370 +
   3.371 +void BranchObj::setVisibility(bool v)
   3.372 +{
   3.373 +    setVisibility (v,MAX_DEPTH);
   3.374 +}
   3.375 +
   3.376 +
   3.377 +void BranchObj::setLinkColor ()
   3.378 +{
   3.379 +	// Overloaded from LinkableMapObj
   3.380 +	// BranchObj can use color of heading
   3.381 +
   3.382 +	if (mapEditor->getLinkColorHint()==HeadingColor)
   3.383 +		LinkableMapObj::setLinkColor (heading->getColor() );
   3.384 +	else	
   3.385 +		LinkableMapObj::setLinkColor ();
   3.386 +}
   3.387 +
   3.388 +void BranchObj::setColor (QColor col, bool colorChilds)
   3.389 +{
   3.390 +    heading->setColor(col);
   3.391 +	setLinkColor();
   3.392 +    if (colorChilds) 
   3.393 +    {
   3.394 +		BranchObj *bo;
   3.395 +		for (bo=branch.first(); bo; bo=branch.next() )
   3.396 +			bo->setColor(col,colorChilds);
   3.397 +    }	
   3.398 +}
   3.399 +
   3.400 +
   3.401 +BranchObj* BranchObj::first()
   3.402 +{
   3.403 +	itLast=NULL;	
   3.404 +	return this; 
   3.405 +}
   3.406 +	
   3.407 +BranchObj* BranchObj::next()
   3.408 +{
   3.409 +	BranchObj *lmo;
   3.410 +	BranchObj *bo=branch.first();
   3.411 +	BranchObj *po=(BranchObj*)(parObj);
   3.412 +
   3.413 +	if (!itLast)
   3.414 +	{	// We are just beginning at the mapCenter
   3.415 +		if (bo) 
   3.416 +		{
   3.417 +			itLast=this;
   3.418 +			return bo;
   3.419 +		}	
   3.420 +		else
   3.421 +		{
   3.422 +			itLast=NULL;
   3.423 +			return NULL;
   3.424 +		}	
   3.425 +	}
   3.426 +
   3.427 +	if (itLast==parObj)
   3.428 +	{	// We come from above
   3.429 +		if (bo)
   3.430 +		{
   3.431 +			// there are childs, go there
   3.432 +			itLast=this;
   3.433 +			return bo;
   3.434 +		}	
   3.435 +		else
   3.436 +		{	// no childs, try to go up again
   3.437 +			if (po)
   3.438 +			{
   3.439 +				// go up
   3.440 +				itLast=this;
   3.441 +				lmo=po->next();
   3.442 +				itLast=this;
   3.443 +				return lmo;
   3.444 +
   3.445 +			}	
   3.446 +			else
   3.447 +			{
   3.448 +				// can't go up, I am mapCenter
   3.449 +				itLast=NULL;
   3.450 +				return NULL;
   3.451 +			}	
   3.452 +		}
   3.453 +	}
   3.454 +
   3.455 +	// Try to find last child, we came from, in my own childs
   3.456 +	bool searching=true;
   3.457 +	while (bo && searching)
   3.458 +	{
   3.459 +		if (itLast==bo) searching=false;
   3.460 +		bo=branch.next();
   3.461 +	}
   3.462 +	if (!searching)
   3.463 +	{	// found lastLMO in my childs
   3.464 +		if (bo)
   3.465 +		{
   3.466 +			// found a brother of lastLMO 
   3.467 +			itLast=this;
   3.468 +			return bo;
   3.469 +		}	
   3.470 +		else
   3.471 +		{
   3.472 +			if (po)
   3.473 +			{
   3.474 +				// go up
   3.475 +				itLast=this;
   3.476 +				lmo=po->next();
   3.477 +				itLast=this;
   3.478 +				return lmo;
   3.479 +			}
   3.480 +			else
   3.481 +			{
   3.482 +				// can't go up, I am mapCenter
   3.483 +				itLast=NULL;
   3.484 +				return NULL;
   3.485 +			}	
   3.486 +		}
   3.487 +	}
   3.488 +
   3.489 +	// couldn't find last child, it must be a nephew of mine
   3.490 +	bo=branch.first();
   3.491 +	if (bo)
   3.492 +	{
   3.493 +		// proceed with my first child
   3.494 +		itLast=this;	
   3.495 +		return bo;
   3.496 +	}	
   3.497 +	else
   3.498 +	{
   3.499 +		// or go back to my parents
   3.500 +		if (po)
   3.501 +		{
   3.502 +			// go up
   3.503 +			itLast=this;
   3.504 +			lmo=po->next();
   3.505 +			itLast=this;
   3.506 +			return lmo;
   3.507 +		}	
   3.508 +		else
   3.509 +		{
   3.510 +			// can't go up, I am mapCenter
   3.511 +			itLast=NULL;
   3.512 +			return NULL;
   3.513 +		}	
   3.514 +	}	
   3.515 +}
   3.516 +
   3.517 +BranchObj* BranchObj::getLastIterator()
   3.518 +{
   3.519 +	return itLast;
   3.520 +}
   3.521 +
   3.522 +void BranchObj::setLastIterator(BranchObj* it)
   3.523 +{
   3.524 +	itLast=it;
   3.525 +}
   3.526 +
   3.527 +
   3.528 +void BranchObj::move (double x, double y)
   3.529 +{
   3.530 +	OrnamentedObj::move (x,y);
   3.531 +    positionBBox();
   3.532 +}
   3.533 +
   3.534 +void BranchObj::move (QPoint p)
   3.535 +{
   3.536 +	move (p.x(), p.y());
   3.537 +}
   3.538 +
   3.539 +void BranchObj::moveBy (double x, double y)
   3.540 +{
   3.541 +	OrnamentedObj::moveBy (x,y);
   3.542 +    positionBBox();
   3.543 +    BranchObj* b;
   3.544 +    for (b=branch.first(); b;b=branch.next() ) 
   3.545 +		b->moveBy (x,y);
   3.546 +}
   3.547 +
   3.548 +void BranchObj::moveBy (QPoint p)
   3.549 +{
   3.550 +	moveBy (p.x(), p.y());
   3.551 +}
   3.552 +
   3.553 +
   3.554 +void BranchObj::positionBBox()
   3.555 +{
   3.556 +
   3.557 +    heading->positionBBox();
   3.558 +	systemFlags->positionBBox();
   3.559 +	standardFlags->positionBBox();
   3.560 +	// It seems that setting x,y also affects width,height
   3.561 +	int w_old=bbox.width();
   3.562 +	int h_old=bbox.height();
   3.563 +    bbox.setX (absPos.x() );
   3.564 +	bbox.setY (absPos.y() );
   3.565 +	bbox.setWidth(w_old);
   3.566 +	bbox.setHeight(h_old);
   3.567 +
   3.568 +
   3.569 +	setSelBox();
   3.570 +
   3.571 +	// set the frame
   3.572 +	frame->setRect(QRect(bbox.x(),bbox.y(),bbox.width(),bbox.height() ) );
   3.573 +}
   3.574 +
   3.575 +void BranchObj::calcBBoxSize()
   3.576 +{
   3.577 +    QSize heading_r=heading->getSize();
   3.578 +    int heading_w=static_cast <int> (heading_r.width() );
   3.579 +    int heading_h=static_cast <int> (heading_r.height() );
   3.580 +    QSize sysflags_r=systemFlags->getSize();
   3.581 +	int sysflags_h=sysflags_r.height();
   3.582 +	int sysflags_w=sysflags_r.width();
   3.583 +    QSize stanflags_r=standardFlags->getSize();
   3.584 +	int stanflags_h=stanflags_r.height();
   3.585 +	int stanflags_w=stanflags_r.width();
   3.586 +    int w;
   3.587 +    int h;
   3.588 +
   3.589 +	// set width to sum of all widths
   3.590 +	w=heading_w + sysflags_w + stanflags_w;
   3.591 +	// set height to maximum needed height
   3.592 +	h=max (sysflags_h,stanflags_h);
   3.593 +	h=max (h,heading_h);
   3.594 +
   3.595 +    w+=frame->getBorder();
   3.596 +    h+=frame->getBorder();
   3.597 +    bbox.setSize (QSize (w,h));
   3.598 +}
   3.599 +
   3.600 +LinkableMapObj* BranchObj::findMapObj(QPoint p, LinkableMapObj* excludeLMO)
   3.601 +{
   3.602 +	// Search branches
   3.603 +    BranchObj *b;
   3.604 +    LinkableMapObj *lmo;
   3.605 +    for (b=branch.first(); b; b=branch.next() )
   3.606 +    {	
   3.607 +		lmo=b->findMapObj(p, excludeLMO);
   3.608 +		if (lmo != NULL) return lmo;
   3.609 +    }
   3.610 +	
   3.611 +	// Search myself
   3.612 +    if (inBBox (p) && (this != excludeLMO) && isVisibleObj() ) 
   3.613 +		return this;
   3.614 +
   3.615 +	// Search float images
   3.616 +	FloatImageObj *foi;
   3.617 +    for (foi=floatimage.first(); foi; foi=floatimage.next() )
   3.618 +		if (foi->inBBox(p) && (foi != excludeLMO) && foi->getParObj()!= excludeLMO) return foi;
   3.619 +
   3.620 +    return NULL;
   3.621 +}
   3.622 +
   3.623 +void BranchObj::setHeading(QString s)
   3.624 +{
   3.625 +    // Adjusting font size
   3.626 +    QFont font=heading->getFont();
   3.627 +	if (depth==0)
   3.628 +		font.setPointSize(16);
   3.629 +	else	
   3.630 +		if (depth>1) 
   3.631 +			font.setPointSize(10);
   3.632 +		else
   3.633 +			font.setPointSize(12);
   3.634 +    heading->setFont(font);
   3.635 +    heading->setText(s);	// set new heading
   3.636 +	calcBBoxSize();			// recalculate bbox
   3.637 +    positionBBox();			// rearrange contents
   3.638 +	requestReposition();
   3.639 +}
   3.640 +
   3.641 +void BranchObj::setURL(QString s)
   3.642 +{
   3.643 +	url=s;
   3.644 +	if (!url.isEmpty())
   3.645 +		systemFlags->activate("url");
   3.646 +	else	
   3.647 +		systemFlags->deactivate("url");
   3.648 +	calcBBoxSize();			// recalculate bbox
   3.649 +    positionBBox();			// rearrange contents
   3.650 +	forceReposition();
   3.651 +}
   3.652 +
   3.653 +QString BranchObj::getURL()
   3.654 +{
   3.655 +	return url;
   3.656 +}
   3.657 +
   3.658 +void BranchObj::setVymLink(QString s)
   3.659 +{
   3.660 +	if (!s.isEmpty())
   3.661 +	{
   3.662 +		// We need the relative (from loading) 
   3.663 +		// or absolute path (from User event)
   3.664 +		// and build the absolute path.
   3.665 +		// Note: If we have relative, use path of
   3.666 +		// current map to build absolute path
   3.667 +		QDir d(s);
   3.668 +		if (!d.path().startsWith ("/"))
   3.669 +		{
   3.670 +			QString p=mapEditor->getDestPath();
   3.671 +			int i=p.findRev("/",-1);
   3.672 +			d.setPath(p.left(i)+"/"+s);
   3.673 +			d.convertToAbs();
   3.674 +		}
   3.675 +		vymLink=d.path();
   3.676 +		systemFlags->activate("vymLink");
   3.677 +	}	
   3.678 +	else	
   3.679 +	{
   3.680 +		systemFlags->deactivate("vymLink");
   3.681 +		vymLink="";
   3.682 +	}	
   3.683 +	calcBBoxSize();			// recalculate bbox
   3.684 +    positionBBox();			// rearrange contents
   3.685 +	forceReposition();
   3.686 +}
   3.687 +
   3.688 +QString BranchObj::getVymLink()
   3.689 +{
   3.690 +	return vymLink;
   3.691 +}
   3.692 +
   3.693 +QString BranchObj::saveToDir (const QString &tmpdir,const QString &prefix, const QPoint& offset)
   3.694 +{
   3.695 +    QString s,a;
   3.696 +	QString scrolledAttr;
   3.697 +	if (scrolled) 
   3.698 +		scrolledAttr=attribut ("scrolled","yes");
   3.699 +	else
   3.700 +		scrolledAttr="";
   3.701 +
   3.702 +	QString posAttr;
   3.703 +	if (depth<2) posAttr=
   3.704 +		attribut("absPosX",QString().setNum(absPos.x(),10)) +
   3.705 +		attribut("absPosY",QString().setNum(absPos.y(),10)); 
   3.706 +	else
   3.707 +		posAttr="";
   3.708 +
   3.709 +	QString urlAttr;
   3.710 +	if (!url.isEmpty())
   3.711 +		urlAttr=attribut ("url",url);
   3.712 +
   3.713 +	QString vymLinkAttr;
   3.714 +	if (!vymLink.isEmpty())
   3.715 +		vymLinkAttr=attribut ("vymLink",convertToRel(mapEditor->getDestPath(),vymLink) );
   3.716 +
   3.717 +	QString frameAttr;
   3.718 +	if (frame->getFrameType()!=NoFrame)
   3.719 +		frameAttr=attribut ("frameType",frame->getFrameTypeName());
   3.720 +	else
   3.721 +		frameAttr="";
   3.722 +
   3.723 +	// save area, if not scrolled
   3.724 +	QString areaAttr;
   3.725 +	if (!((BranchObj*)(parObj))->isScrolled() )
   3.726 +	{
   3.727 +		areaAttr=
   3.728 +			attribut("x1",QString().setNum(absPos.x()-offset.x(),10)) +
   3.729 +			attribut("y1",QString().setNum(absPos.y()-offset.y(),10)) +
   3.730 +			attribut("x2",QString().setNum(absPos.x()+width()-offset.x(),10)) +
   3.731 +			attribut("y2",QString().setNum(absPos.y()+height()-offset.y(),10));
   3.732 +
   3.733 +	} else
   3.734 +		areaAttr="";
   3.735 +	
   3.736 +    s=beginElement ("branch" +scrolledAttr +posAttr +urlAttr +vymLinkAttr +frameAttr +areaAttr);
   3.737 +    incIndent();
   3.738 +
   3.739 +	// save heading
   3.740 +    s=s+valueElement("heading", getHeading(),
   3.741 +		attribut ("textColor",QColor(heading->getColor()).name()));
   3.742 +
   3.743 +	// save names of flags set
   3.744 +	s+=standardFlags->saveToDir(tmpdir,prefix,0);
   3.745 +	
   3.746 +	// save note
   3.747 +	if (!note.isEmpty() )
   3.748 +		s+=note.saveToDir();
   3.749 +	
   3.750 +	// Save branches
   3.751 +    BranchObj *bo;
   3.752 +    for (bo=branch.first(); bo; bo=branch.next() )
   3.753 +		s+=bo->saveToDir(tmpdir,prefix,offset);
   3.754 +    decIndent();
   3.755 +
   3.756 +	// Save FloatImages
   3.757 +	FloatImageObj *fio;
   3.758 +	for (fio=floatimage.first(); fio; fio=floatimage.next() )
   3.759 +		s+=fio->saveToDir (tmpdir,prefix);
   3.760 +
   3.761 +    s+=endElement   ("branch");
   3.762 +    return s;
   3.763 +}
   3.764 +
   3.765 +LinkableMapObj* BranchObj::addFloatImage ()
   3.766 +{
   3.767 +	FloatImageObj *newfi=new FloatImageObj (canvas,this);
   3.768 +	floatimage.append (newfi);
   3.769 +	if (hasScrolledParent(this) )
   3.770 +		newfi->setVisibility (false);
   3.771 +	else	
   3.772 +		newfi->setVisibility(visible);
   3.773 +	requestReposition();
   3.774 +	return newfi;
   3.775 +}
   3.776 +
   3.777 +LinkableMapObj* BranchObj::addFloatImage (FloatImageObj *fio)
   3.778 +{
   3.779 +	FloatImageObj *newfi=new FloatImageObj (canvas,this);
   3.780 +	floatimage.append (newfi);
   3.781 +	newfi->copy (fio);
   3.782 +	if (hasScrolledParent(this) )
   3.783 +		newfi->setVisibility (false);
   3.784 +	else	
   3.785 +		newfi->setVisibility(visible);
   3.786 +	requestReposition();
   3.787 +	return newfi;
   3.788 +}
   3.789 +
   3.790 +FloatImageObj* BranchObj::getFirstFloatImage ()
   3.791 +{
   3.792 +    return floatimage.first();
   3.793 +}
   3.794 +
   3.795 +FloatImageObj* BranchObj::getLastFloatImage ()
   3.796 +{
   3.797 +    return floatimage.last();
   3.798 +}
   3.799 +
   3.800 +FloatImageObj* BranchObj::getFloatImageNum (const uint &i)
   3.801 +{
   3.802 +    return floatimage.at(i);
   3.803 +}
   3.804 +
   3.805 +void BranchObj::removeFloatImage (FloatImageObj *fio)
   3.806 +{
   3.807 +	floatimage.remove (fio);
   3.808 +	requestReposition();
   3.809 +}
   3.810 +
   3.811 +void BranchObj::savePosInAngle ()
   3.812 +{
   3.813 +	// Save position in angle
   3.814 +    BranchObj *b;
   3.815 +	int i=0;
   3.816 +    for (b=branch.first(); b; b=branch.next() )
   3.817 +	{
   3.818 +		b->angle=i;
   3.819 +		i++;
   3.820 +	}
   3.821 +}
   3.822 +
   3.823 +BranchObj* BranchObj::addBranch()
   3.824 +{
   3.825 +    BranchObj* newbo=new BranchObj(canvas,this);
   3.826 +    branch.append (newbo);
   3.827 +    newbo->setParObj(this);
   3.828 +    newbo->setColor(getColor(),false);	
   3.829 +    newbo->setLinkColor();	
   3.830 +    newbo->setHeading ("new");
   3.831 +	newbo->setLinkStyle (newbo->getDefLinkStyle());
   3.832 +	if (scrolled)
   3.833 +		newbo->setVisibility (false);
   3.834 +	else	
   3.835 +		newbo->setVisibility(visible);
   3.836 +	requestReposition();
   3.837 +	return newbo;
   3.838 +}
   3.839 +
   3.840 +BranchObj* BranchObj::addBranch(BranchObj* bo)
   3.841 +{
   3.842 +    BranchObj* newbo=new BranchObj(canvas,this);
   3.843 +    branch.append (newbo);
   3.844 +    newbo->copy(bo);
   3.845 +    newbo->setParObj(this);
   3.846 +	newbo->setHeading (newbo->getHeading());	// adjust fontsize to depth
   3.847 +	newbo->setLinkStyle (newbo->getDefLinkStyle());
   3.848 +	if (scrolled)
   3.849 +		newbo->setVisibility (false);
   3.850 +	else	
   3.851 +		newbo->setVisibility(bo->visible);
   3.852 +	requestReposition();
   3.853 +	return newbo;
   3.854 +}
   3.855 +
   3.856 +BranchObj* BranchObj::insertBranch(int pos)
   3.857 +{
   3.858 +	savePosInAngle();
   3.859 +	// Add new bo and resort branches
   3.860 +	BranchObj *newbo=addBranch ();
   3.861 +	newbo->angle=pos-0.5;
   3.862 +	branch.sort();
   3.863 +	return newbo;
   3.864 +}
   3.865 +
   3.866 +BranchObj* BranchObj::insertBranch(BranchObj* bo, int pos)
   3.867 +{
   3.868 +	savePosInAngle();
   3.869 +	// Add new bo and resort branches
   3.870 +	bo->angle=pos-0.5;
   3.871 +	BranchObj *newbo=addBranch (bo);
   3.872 +	branch.sort();
   3.873 +	return newbo;
   3.874 +}
   3.875 +
   3.876 +void BranchObj::removeBranch(BranchObj* bo)
   3.877 +{
   3.878 +    // if bo is not in branch remove returns false, we
   3.879 +    // don't care...
   3.880 +    branch.remove (bo);
   3.881 +	requestReposition();
   3.882 +}
   3.883 +
   3.884 +void BranchObj::setLastSelectedBranch (BranchObj* bo)
   3.885 +{
   3.886 +    lastSelectedBranch=branch.find(bo);
   3.887 +}
   3.888 +
   3.889 +BranchObj* BranchObj::getLastSelectedBranch ()
   3.890 +{
   3.891 +    if (lastSelectedBranch>=0) 
   3.892 +	{
   3.893 +		BranchObj* bo=branch.at(lastSelectedBranch);
   3.894 +		if (bo) return bo;
   3.895 +    }	
   3.896 +    return branch.first();
   3.897 +}
   3.898 +
   3.899 +BranchObj* BranchObj::getFirstBranch ()
   3.900 +{
   3.901 +    return branch.first();
   3.902 +}
   3.903 +
   3.904 +BranchObj* BranchObj::getLastBranch ()
   3.905 +{
   3.906 +    return branch.last();
   3.907 +}
   3.908 +
   3.909 +BranchObj* BranchObj::getBranchNum (const uint &i)
   3.910 +{
   3.911 +    return branch.at(i);
   3.912 +}
   3.913 +
   3.914 +
   3.915 +BranchObj* BranchObj::moveBranchUp(BranchObj* bo1) // move a branch up (modify myself)
   3.916 +{
   3.917 +	savePosInAngle();
   3.918 +    int i=branch.find(bo1);
   3.919 +    if (i>0) 
   3.920 +	{	// -1 if bo1 not found 
   3.921 +		branch.at(i)->angle--;
   3.922 +		branch.at(i-1)->angle++;
   3.923 +		branch.sort();
   3.924 +		return branch.at(i-1);
   3.925 +	} else
   3.926 +		return branch.at(i);
   3.927 +}
   3.928 +
   3.929 +BranchObj* BranchObj::moveBranchDown(BranchObj* bo1)
   3.930 +{
   3.931 +	savePosInAngle();
   3.932 +    int i=branch.find(bo1);
   3.933 +	int j;
   3.934 +	if (branch.next())
   3.935 +	{
   3.936 +		j = branch.at();
   3.937 +		branch.at(i)->angle++;
   3.938 +		branch.at(j)->angle--;
   3.939 +		branch.sort();
   3.940 +		return branch.at(j);
   3.941 +	} else
   3.942 +		return branch.at(i);
   3.943 +}
   3.944 +
   3.945 +void BranchObj::alignRelativeTo (QPoint ref)
   3.946 +{
   3.947 +/* FIXME testing
   3.948 +	if (!getHeading().isEmpty())
   3.949 +		cout << "BO::alignRelTo "<<getHeading()<<endl;
   3.950 +	else	
   3.951 +		cout << "BO::alignRelTo  ???"<<endl;
   3.952 +	cout << "  d="<<depth<<endl;
   3.953 +*/	
   3.954 +	int th = bboxTotal.height();	
   3.955 +
   3.956 +	// If I am the mapcenter or a mainbranch, reposition heading
   3.957 +	if (depth<2)
   3.958 +	{
   3.959 +		move (absPos.x(),absPos.y());
   3.960 +		if (depth==1)
   3.961 +		{
   3.962 +			// Calc angle to mapCenter if I am a mainbranch
   3.963 +			// needed for reordering the mainbranches clockwise 
   3.964 +			// around mapcenter 
   3.965 +			angle=getAngle (QPoint ((int)(x() - parObj->getChildPos().x() ), 
   3.966 +									(int)(y() - parObj->getChildPos().y() ) ) );
   3.967 +		}	
   3.968 +	} 
   3.969 +	else
   3.970 +    {
   3.971 +		// Align myself depending on orientation and parent, but
   3.972 +		// only if I am not the mainbranch or mapcenter itself
   3.973 +		switch (orientation) 
   3.974 +		{
   3.975 +			case OrientLeftOfCenter:
   3.976 +				move (ref.x()-bbox.width(), ref.y() + (th-bbox.height())/2 );
   3.977 +			break;
   3.978 +			case OrientRightOfCenter:	
   3.979 +				move (ref.x(), ref.y() + (th-bbox.height())/2 );
   3.980 +			break;
   3.981 +			default:
   3.982 +				cout <<"LMO::alignRelativeTo: oops, no orientation given...\n";
   3.983 +			break;
   3.984 +		}		
   3.985 +    }		
   3.986 +
   3.987 +	FloatImageObj *fio;
   3.988 +    for (fio=floatimage.first(); fio; fio=floatimage.next() )
   3.989 +		fio->reposition();
   3.990 +
   3.991 +	if (scrolled) return;
   3.992 +
   3.993 +    // Set reference point for alignment of childs
   3.994 +    QPoint ref2;
   3.995 +    if (orientation==OrientLeftOfCenter)
   3.996 +		ref2.setX(childPos.x() - linkwidth);
   3.997 +    else	
   3.998 +		ref2.setX(childPos.x() + linkwidth);
   3.999 +
  3.1000 +	if (depth==1)
  3.1001 +		ref2.setY(absPos.y()-(bboxTotal.height()-bbox.height())/2);
  3.1002 +	else	
  3.1003 +		ref2.setY(ref.y() );	
  3.1004 +
  3.1005 +    // Align the childs depending on reference point 
  3.1006 +    BranchObj *b;
  3.1007 +    for (b=branch.first(); b; b=branch.next() )
  3.1008 +    {	
  3.1009 +		b->alignRelativeTo (ref2);
  3.1010 +		ref2.setY(ref2.y() + b->getBBoxSizeWithChilds().height() );
  3.1011 +    }
  3.1012 +}
  3.1013 +
  3.1014 +
  3.1015 +void BranchObj::reposition()
  3.1016 +{	
  3.1017 +/* FIXME testing
  3.1018 +	if (!getHeading().isEmpty())
  3.1019 +		cout << "BO::reposition  "<<getHeading()<<endl;
  3.1020 +	else	
  3.1021 +		cout << "BO::reposition  ???"<<endl;
  3.1022 +*/		
  3.1023 +	if (depth==0)
  3.1024 +	{
  3.1025 +		// only calculate the sizes once. If the deepest LMO 
  3.1026 +		// changes its height,
  3.1027 +		// all upper LMOs have to change, too.
  3.1028 +		calcBBoxSizeWithChilds();
  3.1029 +	    alignRelativeTo ( QPoint (absPos.x(),
  3.1030 +			absPos.y()-(bboxTotal.height()-bbox.height())/2) );
  3.1031 +		branch.sort();	
  3.1032 +	} else
  3.1033 +	{
  3.1034 +		// This is only important for moving branches:
  3.1035 +		// For editing a branch it isn't called...
  3.1036 +	    alignRelativeTo ( QPoint (absPos.x(),
  3.1037 +							absPos.y()-(bboxTotal.height()-bbox.height())/2) );
  3.1038 +	}
  3.1039 +}
  3.1040 +
  3.1041 +
  3.1042 +QRect BranchObj::getTotalBBox()
  3.1043 +{
  3.1044 +	QRect r=bbox;
  3.1045 +
  3.1046 +	if (scrolled) return r;
  3.1047 +
  3.1048 +	BranchObj* b;
  3.1049 +	for (b=branch.first();b ;b=branch.next() )
  3.1050 +		r=addBBox(b->getTotalBBox(),r);
  3.1051 +
  3.1052 +	FloatImageObj* fio;
  3.1053 +	for (fio=floatimage.first();fio ;fio=floatimage.next() )
  3.1054 +		r=addBBox(fio->getTotalBBox(),r);
  3.1055 +		
  3.1056 +	return r;
  3.1057 +}
  3.1058 +
  3.1059 +QRect BranchObj::getBBoxSizeWithChilds()
  3.1060 +{
  3.1061 +	return bboxTotal;
  3.1062 +}
  3.1063 +
  3.1064 +void BranchObj::calcBBoxSizeWithChilds()
  3.1065 +{
  3.1066 +	// This is called only from reposition and
  3.1067 +	// and only for mapcenter. So it won't be
  3.1068 +	// called more than once for a single user 
  3.1069 +	// action
  3.1070 +	
  3.1071 +	// Calculate size of LMO including all childs (to align them later)
  3.1072 +
  3.1073 +	bboxTotal.setX(bbox.x() );
  3.1074 +	bboxTotal.setY(bbox.y() );
  3.1075 +
  3.1076 +	// if branch is scrolled, ignore childs, but still consider floatimages
  3.1077 +	if (scrolled)
  3.1078 +	{
  3.1079 +		bboxTotal.setWidth (bbox.width());
  3.1080 +		bboxTotal.setHeight(bbox.height());
  3.1081 +		return;
  3.1082 +	}
  3.1083 +	
  3.1084 +	QRect r(0,0,0,0);
  3.1085 +	QRect br;
  3.1086 +	// Now calculate recursivly
  3.1087 +	// sum of heights 
  3.1088 +	// maximum of widths 
  3.1089 +	// minimum of y
  3.1090 +	BranchObj* b;
  3.1091 +	for (b=branch.first();b ;b=branch.next() )
  3.1092 +	{
  3.1093 +		b->calcBBoxSizeWithChilds();
  3.1094 +		br=b->getBBoxSizeWithChilds();
  3.1095 +		r.setWidth( max (br.width(), r.width() ));
  3.1096 +		r.setHeight(br.height() + r.height() );
  3.1097 +		if (br.y()<bboxTotal.y()) bboxTotal.setY(br.y());
  3.1098 +	}
  3.1099 +	// Add myself and also
  3.1100 +	// add width of link to sum if necessary
  3.1101 +	if (branch.isEmpty())
  3.1102 +		bboxTotal.setWidth (bbox.width() + r.width() );
  3.1103 +	else	
  3.1104 +		bboxTotal.setWidth (bbox.width() + r.width() + linkwidth);
  3.1105 +	bboxTotal.setHeight(max (r.height(),  bbox.height() ) );
  3.1106 +//	frame->setRect(QRect(bbox.x(),bbox.y(),bbox.width(),bbox.height() ) );
  3.1107 +}
  3.1108 +
  3.1109 +void BranchObj::select()
  3.1110 +{
  3.1111 +    LinkableMapObj::select();
  3.1112 +	// Tell parent that I am selected now:
  3.1113 +	BranchObj* po=(BranchObj*)(parObj);
  3.1114 +    if (po)	// TODO	    Try to get rid of this cast...
  3.1115 +        po->setLastSelectedBranch(this);
  3.1116 +		
  3.1117 +	// temporary unscroll, if we have scrolled parents somewhere
  3.1118 +	if (parObj) ((BranchObj*)(parObj))->tmpUnscroll();
  3.1119 +
  3.1120 +	// set Text in Editor	
  3.1121 +	textEditor->setText(note.getNote() );
  3.1122 +	textEditor->setFilename(note.getFilenameHint() );
  3.1123 +	textEditor->setFontHint (note.getFontHint() );
  3.1124 +	connect (textEditor, SIGNAL (textHasChanged() ), this, SLOT (updateNoteFlag() ) ); 
  3.1125 +	connect (textEditor, SIGNAL (fontSizeHasChanged() ), this, SLOT (updateNoteFlag() ) ); 
  3.1126 +
  3.1127 +	// Show URL and link in statusbar
  3.1128 +	QString status;
  3.1129 +	if (!url.isEmpty()) status+="URL: "+url+"  ";
  3.1130 +	if (!vymLink.isEmpty()) status+="Link: "+vymLink;
  3.1131 +	if (!status.isEmpty()) mainWindow->statusMessage (status);
  3.1132 +
  3.1133 +	// Update Toolbar
  3.1134 +	standardFlags->updateToolBar();
  3.1135 +
  3.1136 +	// Update Browserbutton
  3.1137 +	if (!url.isEmpty())
  3.1138 +		actionEditOpenURL->setEnabled (true);
  3.1139 +	else	
  3.1140 +		actionEditOpenURL->setEnabled (false);
  3.1141 +
  3.1142 +	// Update actions in mapeditor
  3.1143 +	mapEditor->updateActions();
  3.1144 +}
  3.1145 +
  3.1146 +void BranchObj::unselect()
  3.1147 +{
  3.1148 +	LinkableMapObj::unselect();
  3.1149 +	// Delete any messages like vymLink in StatusBar
  3.1150 +	mainWindow->statusMessage ("");
  3.1151 +
  3.1152 +	// save note from editor and set flag
  3.1153 +	// text is done by updateNoteFlag(), just save
  3.1154 +	// filename here
  3.1155 +	note.setFilenameHint (textEditor->getFilename());
  3.1156 +
  3.1157 +	// reset temporary unscroll, if we have scrolled parents somewhere
  3.1158 +	if (parObj) ((BranchObj*)(parObj))->resetTmpUnscroll();
  3.1159 +
  3.1160 +	// Disconnect textEditor from this LMO
  3.1161 +	disconnect( textEditor, SIGNAL(textHasChanged()), 0, 0 );
  3.1162 +	disconnect( textEditor, SIGNAL (fontSizeHasChanged()),0,0 ); 
  3.1163 +
  3.1164 +	// Erase content of editor 
  3.1165 +	textEditor->setInactive();
  3.1166 +
  3.1167 +	// unselect all buttons in toolbar
  3.1168 +	standardFlagsDefault->updateToolBar();
  3.1169 +}
  3.1170 +
  3.1171 +QString BranchObj::getSelectString()
  3.1172 +{
  3.1173 +	QString s;
  3.1174 +	if (parObj)
  3.1175 +	{
  3.1176 +		if (parObj->getDepth()==0)
  3.1177 +			s= "bo:" + QString("%1").arg(getNum());
  3.1178 +		else	
  3.1179 +			s= ((BranchObj*)(parObj))->getSelectString() + ",bo:" + QString("%1").arg(getNum());
  3.1180 +	} else
  3.1181 +	{
  3.1182 +		s="mc:";
  3.1183 +	}
  3.1184 +	
  3.1185 +	return s;
  3.1186 +}
  3.1187 +
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/branchobj.h	Sun Jan 30 12:59:10 2005 +0000
     4.3 @@ -0,0 +1,113 @@
     4.4 +#ifndef BRANCHOBJ_H
     4.5 +#define BRANCHOBJ_H
     4.6 +
     4.7 +#include "floatimageobj.h"
     4.8 +#include "linkablemapobj.h"
     4.9 +#include "ornamentedobj.h"
    4.10 +
    4.11 +class BranchObjPtrList : public QPtrList<BranchObj>
    4.12 +{
    4.13 +	virtual int compareItems (QPtrCollection::Item i, QPtrCollection::Item j);
    4.14 +};
    4.15 +
    4.16 +/////////////////////////////////////////////////////////////////////////////
    4.17 +class BranchObj:public OrnamentedObj {
    4.18 +public:
    4.19 +    BranchObj ();
    4.20 +    BranchObj (QCanvas*);
    4.21 +    BranchObj (QCanvas*, LinkableMapObj* parent);
    4.22 +    ~BranchObj ();
    4.23 +	bool operator< ( const BranchObj & );
    4.24 +	bool operator== ( const BranchObj & );
    4.25 +    virtual void init ();
    4.26 +    virtual void copy (BranchObj*);
    4.27 +    void clear();
    4.28 +	virtual int getNum();				// return number of this in parent
    4.29 +	virtual int getNum(BranchObj*);		// return number of this in parent
    4.30 +	virtual int getFloatImageNum(FloatImageObj*);		
    4.31 +	virtual int countBranches();		
    4.32 +	virtual int countFloatImages();		
    4.33 +    virtual void setParObjTmp (LinkableMapObj*,QPoint,int);// Only for moving Obj around
    4.34 +	virtual void unsetParObjTmp();			// reuse original ParObj
    4.35 +
    4.36 +	virtual void unScroll();				
    4.37 +	virtual void toggleScroll();			// scroll or unscroll
    4.38 +	virtual bool isScrolled();				// returns scroll state
    4.39 +	virtual bool hasScrolledParent(BranchObj*);	// true, if any of the parents is scrolled
    4.40 +	virtual void tmpUnscroll();				// unscroll scrolled parents temporary e.g. during "find" process
    4.41 +	virtual void resetTmpUnscroll();		// scroll all tmp scrolled parents again e.g. when unselecting
    4.42 +
    4.43 +	virtual void setVisibility(bool,int);	// set visibility
    4.44 +    virtual void setVisibility(bool);	    // set vis. for w
    4.45 +	virtual void setLinkColor();			// set the color of link
    4.46 +	virtual void setColor(QColor,bool);		// set the color of heading
    4.47 +
    4.48 +
    4.49 +	BranchObj* first ();				// set Iterator to first LMO
    4.50 +	BranchObj* next ();					// find next LMO after given one
    4.51 +	BranchObj* getLastIterator();		// to interrupt and resume next iteration
    4.52 +	void setLastIterator (BranchObj*);	// needed by next() 
    4.53 +
    4.54 +    virtual void move (double x,double y);
    4.55 +    virtual void move (QPoint);
    4.56 +    virtual void moveBy (double x,double y);
    4.57 +    virtual void moveBy (QPoint);
    4.58 +    virtual void positionBBox();
    4.59 +    virtual void calcBBoxSize();
    4.60 +    virtual LinkableMapObj* findMapObj(QPoint,LinkableMapObj*);	// find MapObj 
    4.61 +    virtual void setHeading (QString);
    4.62 +    virtual void setURL (QString);
    4.63 +    virtual QString getURL ();
    4.64 +    virtual void setVymLink (QString);
    4.65 +    virtual QString getVymLink ();
    4.66 +	virtual QString saveToDir (const QString&,const QString&, const QPoint&);// Save data recursivly to tempdir
    4.67 +	virtual LinkableMapObj* addFloatImage();
    4.68 +	virtual LinkableMapObj* addFloatImage(FloatImageObj*);
    4.69 +	virtual void removeFloatImage(FloatImageObj*);
    4.70 +    virtual FloatImageObj* getFirstFloatImage();
    4.71 +    virtual FloatImageObj* getLastFloatImage();
    4.72 +	virtual FloatImageObj* getFloatImageNum(const uint &);
    4.73 +protected:	
    4.74 +	virtual void savePosInAngle();			// write pos in angle for resorting			
    4.75 +public:	
    4.76 +    virtual BranchObj* addBranch();
    4.77 +    virtual BranchObj* addBranch(BranchObj*);		// makes deep copy of BranchObj
    4.78 +    virtual BranchObj* insertBranch(int);
    4.79 +    virtual BranchObj* insertBranch(BranchObj*,int);
    4.80 +    virtual void removeBranch(BranchObj*);  
    4.81 +    virtual void setLastSelectedBranch(BranchObj*);
    4.82 +    virtual BranchObj* getLastSelectedBranch();
    4.83 +    virtual BranchObj* getFirstBranch();
    4.84 +    virtual BranchObj* getLastBranch();
    4.85 +	virtual BranchObj* getBranchNum(const uint &);
    4.86 +    virtual BranchObj* moveBranchUp(BranchObj*);
    4.87 +    virtual BranchObj* moveBranchDown(BranchObj*);
    4.88 +
    4.89 +    virtual void alignRelativeTo(const QPoint );
    4.90 +	virtual void reposition();
    4.91 +
    4.92 +	virtual QRect getTotalBBox();			// return BBox including childs			
    4.93 +	virtual QRect getBBoxSizeWithChilds();	// return size of BBox including childs  
    4.94 +	virtual void calcBBoxSizeWithChilds();	// calc size of  BBox including childs recursivly
    4.95 +
    4.96 +    virtual void select();
    4.97 +    virtual void unselect();
    4.98 +	virtual QString getSelectString();
    4.99 +
   4.100 +protected:
   4.101 +	static BranchObj* itLast;		// iterator for first(), next()
   4.102 +    BranchObjPtrList branch;		// all child branches
   4.103 +	QPtrList<FloatImageObj> floatimage;	// child images
   4.104 +public:	
   4.105 +	float angle;					// used in mainbranch to reorder mainbranches
   4.106 +protected:	
   4.107 +    int lastSelectedBranch;			// for going deeper into tree
   4.108 +	bool scrolled;					// true if all childs are scrolled and thus invisible
   4.109 +	bool tmpUnscrolled;				// can only be true (temporary) for a scrolled subtree
   4.110 +	QString url;					// url to external doc
   4.111 +	QString vymLink;				// path to another map
   4.112 +};
   4.113 +
   4.114 +
   4.115 +#endif
   4.116 +
     5.1 Binary file demos/liveform.vym has changed
     6.1 Binary file demos/math.vym has changed
     7.1 Binary file demos/time-management.vym has changed
     8.1 Binary file demos/todo.vym has changed
     9.1 Binary file doc/vym.pdf has changed
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/exporthtmldialog.ui	Sun Jan 30 12:59:10 2005 +0000
    10.3 @@ -0,0 +1,321 @@
    10.4 +<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
    10.5 +<class>ExportHTMLDialog</class>
    10.6 +<author>Uwe Drechsel</author>
    10.7 +<widget class="QDialog">
    10.8 +    <property name="name">
    10.9 +        <cstring>ExportHTMLDialog</cstring>
   10.10 +    </property>
   10.11 +    <property name="geometry">
   10.12 +        <rect>
   10.13 +            <x>0</x>
   10.14 +            <y>0</y>
   10.15 +            <width>364</width>
   10.16 +            <height>346</height>
   10.17 +        </rect>
   10.18 +    </property>
   10.19 +    <property name="caption">
   10.20 +        <string>Export HTML</string>
   10.21 +    </property>
   10.22 +    <property name="modal">
   10.23 +        <bool>false</bool>
   10.24 +    </property>
   10.25 +    <vbox>
   10.26 +        <property name="name">
   10.27 +            <cstring>unnamed</cstring>
   10.28 +        </property>
   10.29 +        <widget class="QLayoutWidget">
   10.30 +            <property name="name">
   10.31 +                <cstring>layout33</cstring>
   10.32 +            </property>
   10.33 +            <hbox>
   10.34 +                <property name="name">
   10.35 +                    <cstring>unnamed</cstring>
   10.36 +                </property>
   10.37 +                <widget class="QLabel">
   10.38 +                    <property name="name">
   10.39 +                        <cstring>textLabel1</cstring>
   10.40 +                    </property>
   10.41 +                    <property name="text">
   10.42 +                        <string>Directory:</string>
   10.43 +                    </property>
   10.44 +                </widget>
   10.45 +                <widget class="QLineEdit">
   10.46 +                    <property name="name">
   10.47 +                        <cstring>lineEdit1</cstring>
   10.48 +                    </property>
   10.49 +                </widget>
   10.50 +                <widget class="QPushButton">
   10.51 +                    <property name="name">
   10.52 +                        <cstring>browseButton</cstring>
   10.53 +                    </property>
   10.54 +                    <property name="text">
   10.55 +                        <string>Browse</string>
   10.56 +                    </property>
   10.57 +                </widget>
   10.58 +            </hbox>
   10.59 +        </widget>
   10.60 +        <widget class="QButtonGroup">
   10.61 +            <property name="name">
   10.62 +                <cstring>buttonGroup2</cstring>
   10.63 +            </property>
   10.64 +            <property name="sizePolicy">
   10.65 +                <sizepolicy>
   10.66 +                    <hsizetype>3</hsizetype>
   10.67 +                    <vsizetype>5</vsizetype>
   10.68 +                    <horstretch>0</horstretch>
   10.69 +                    <verstretch>0</verstretch>
   10.70 +                </sizepolicy>
   10.71 +            </property>
   10.72 +            <property name="minimumSize">
   10.73 +                <size>
   10.74 +                    <width>0</width>
   10.75 +                    <height>230</height>
   10.76 +                </size>
   10.77 +            </property>
   10.78 +            <property name="title">
   10.79 +                <string>Options</string>
   10.80 +            </property>
   10.81 +            <vbox>
   10.82 +                <property name="name">
   10.83 +                    <cstring>unnamed</cstring>
   10.84 +                </property>
   10.85 +                <widget class="QCheckBox">
   10.86 +                    <property name="name">
   10.87 +                        <cstring>checkBox4</cstring>
   10.88 +                    </property>
   10.89 +                    <property name="text">
   10.90 +                        <string>Include image of map</string>
   10.91 +                    </property>
   10.92 +                </widget>
   10.93 +                <widget class="QCheckBox">
   10.94 +                    <property name="name">
   10.95 +                        <cstring>checkBox5_2</cstring>
   10.96 +                    </property>
   10.97 +                    <property name="text">
   10.98 +                        <string>create image only</string>
   10.99 +                    </property>
  10.100 +                </widget>
  10.101 +                <widget class="QCheckBox">
  10.102 +                    <property name="name">
  10.103 +                        <cstring>checkBox5</cstring>
  10.104 +                    </property>
  10.105 +                    <property name="text">
  10.106 +                        <string>use WIKI style</string>
  10.107 +                    </property>
  10.108 +                </widget>
  10.109 +                <widget class="QCheckBox">
  10.110 +                    <property name="name">
  10.111 +                        <cstring>checkBox4_2</cstring>
  10.112 +                    </property>
  10.113 +                    <property name="text">
  10.114 +                        <string>use heading for URLs (instead of link target)</string>
  10.115 +                    </property>
  10.116 +                </widget>
  10.117 +                <widget class="QCheckBox">
  10.118 +                    <property name="name">
  10.119 +                        <cstring>checkBox6</cstring>
  10.120 +                    </property>
  10.121 +                    <property name="text">
  10.122 +                        <string>use image of earth to mark URLs in text</string>
  10.123 +                    </property>
  10.124 +                </widget>
  10.125 +                <widget class="QCheckBox">
  10.126 +                    <property name="name">
  10.127 +                        <cstring>checkBox7</cstring>
  10.128 +                    </property>
  10.129 +                    <property name="text">
  10.130 +                        <string>use default CSS file</string>
  10.131 +                    </property>
  10.132 +                </widget>
  10.133 +                <widget class="QCheckBox">
  10.134 +                    <property name="name">
  10.135 +                        <cstring>checkBox3</cstring>
  10.136 +                    </property>
  10.137 +                    <property name="sizePolicy">
  10.138 +                        <sizepolicy>
  10.139 +                            <hsizetype>1</hsizetype>
  10.140 +                            <vsizetype>0</vsizetype>
  10.141 +                            <horstretch>0</horstretch>
  10.142 +                            <verstretch>0</verstretch>
  10.143 +                        </sizepolicy>
  10.144 +                    </property>
  10.145 +                    <property name="text">
  10.146 +                        <string>show output of external scripts</string>
  10.147 +                    </property>
  10.148 +                </widget>
  10.149 +            </vbox>
  10.150 +        </widget>
  10.151 +        <spacer>
  10.152 +            <property name="name">
  10.153 +                <cstring>spacer6</cstring>
  10.154 +            </property>
  10.155 +            <property name="orientation">
  10.156 +                <enum>Vertical</enum>
  10.157 +            </property>
  10.158 +            <property name="sizeType">
  10.159 +                <enum>Expanding</enum>
  10.160 +            </property>
  10.161 +            <property name="sizeHint">
  10.162 +                <size>
  10.163 +                    <width>21</width>
  10.164 +                    <height>60</height>
  10.165 +                </size>
  10.166 +            </property>
  10.167 +        </spacer>
  10.168 +        <widget class="QLayoutWidget">
  10.169 +            <property name="name">
  10.170 +                <cstring>layout17</cstring>
  10.171 +            </property>
  10.172 +            <hbox>
  10.173 +                <property name="name">
  10.174 +                    <cstring>unnamed</cstring>
  10.175 +                </property>
  10.176 +                <spacer>
  10.177 +                    <property name="name">
  10.178 +                        <cstring>spacer5</cstring>
  10.179 +                    </property>
  10.180 +                    <property name="orientation">
  10.181 +                        <enum>Horizontal</enum>
  10.182 +                    </property>
  10.183 +                    <property name="sizeType">
  10.184 +                        <enum>Expanding</enum>
  10.185 +                    </property>
  10.186 +                    <property name="sizeHint">
  10.187 +                        <size>
  10.188 +                            <width>61</width>
  10.189 +                            <height>21</height>
  10.190 +                        </size>
  10.191 +                    </property>
  10.192 +                </spacer>
  10.193 +                <widget class="QPushButton">
  10.194 +                    <property name="name">
  10.195 +                        <cstring>pushButton4</cstring>
  10.196 +                    </property>
  10.197 +                    <property name="text">
  10.198 +                        <string>Export</string>
  10.199 +                    </property>
  10.200 +                    <property name="default">
  10.201 +                        <bool>true</bool>
  10.202 +                    </property>
  10.203 +                </widget>
  10.204 +                <widget class="QPushButton">
  10.205 +                    <property name="name">
  10.206 +                        <cstring>pushButton5</cstring>
  10.207 +                    </property>
  10.208 +                    <property name="text">
  10.209 +                        <string>Cancel</string>
  10.210 +                    </property>
  10.211 +                </widget>
  10.212 +            </hbox>
  10.213 +        </widget>
  10.214 +    </vbox>
  10.215 +</widget>
  10.216 +<connections>
  10.217 +    <connection>
  10.218 +        <sender>pushButton5</sender>
  10.219 +        <signal>pressed()</signal>
  10.220 +        <receiver>ExportHTMLDialog</receiver>
  10.221 +        <slot>reject()</slot>
  10.222 +    </connection>
  10.223 +    <connection>
  10.224 +        <sender>pushButton4</sender>
  10.225 +        <signal>clicked()</signal>
  10.226 +        <receiver>ExportHTMLDialog</receiver>
  10.227 +        <slot>accept()</slot>
  10.228 +    </connection>
  10.229 +    <connection>
  10.230 +        <sender>browseButton</sender>
  10.231 +        <signal>pressed()</signal>
  10.232 +        <receiver>ExportHTMLDialog</receiver>
  10.233 +        <slot>browseDirectory()</slot>
  10.234 +    </connection>
  10.235 +    <connection>
  10.236 +        <sender>checkBox4</sender>
  10.237 +        <signal>toggled(bool)</signal>
  10.238 +        <receiver>ExportHTMLDialog</receiver>
  10.239 +        <slot>includeImage(bool)</slot>
  10.240 +    </connection>
  10.241 +    <connection>
  10.242 +        <sender>checkBox5</sender>
  10.243 +        <signal>toggled(bool)</signal>
  10.244 +        <receiver>ExportHTMLDialog</receiver>
  10.245 +        <slot>useWIKIpressed(bool)</slot>
  10.246 +    </connection>
  10.247 +    <connection>
  10.248 +        <sender>lineEdit1</sender>
  10.249 +        <signal>textChanged(const QString&amp;)</signal>
  10.250 +        <receiver>ExportHTMLDialog</receiver>
  10.251 +        <slot>dirChanged()</slot>
  10.252 +    </connection>
  10.253 +    <connection>
  10.254 +        <sender>checkBox3</sender>
  10.255 +        <signal>toggled(bool)</signal>
  10.256 +        <receiver>ExportHTMLDialog</receiver>
  10.257 +        <slot>showOut(bool)</slot>
  10.258 +    </connection>
  10.259 +    <connection>
  10.260 +        <sender>checkBox4_2</sender>
  10.261 +        <signal>toggled(bool)</signal>
  10.262 +        <receiver>ExportHTMLDialog</receiver>
  10.263 +        <slot>useHeadingPressed(bool)</slot>
  10.264 +    </connection>
  10.265 +    <connection>
  10.266 +        <sender>checkBox5_2</sender>
  10.267 +        <signal>toggled(bool)</signal>
  10.268 +        <receiver>ExportHTMLDialog</receiver>
  10.269 +        <slot>imgOnly(bool)</slot>
  10.270 +    </connection>
  10.271 +    <connection>
  10.272 +        <sender>checkBox6</sender>
  10.273 +        <signal>toggled(bool)</signal>
  10.274 +        <receiver>ExportHTMLDialog</receiver>
  10.275 +        <slot>useURLImagePressed(bool)</slot>
  10.276 +    </connection>
  10.277 +</connections>
  10.278 +<includes>
  10.279 +    <include location="local" impldecl="in declaration">showtextdialog.h</include>
  10.280 +    <include location="global" impldecl="in declaration">qprocess.h</include>
  10.281 +    <include location="global" impldecl="in implementation">iostream</include>
  10.282 +    <include location="local" impldecl="in implementation">settings.h</include>
  10.283 +    <include location="global" impldecl="in implementation">qfiledialog.h</include>
  10.284 +    <include location="global" impldecl="in implementation">qmessagebox.h</include>
  10.285 +    <include location="local" impldecl="in implementation">misc.h</include>
  10.286 +    <include location="local" impldecl="in implementation">icons/flag-url.xpm</include>
  10.287 +    <include location="local" impldecl="in implementation">exporthtmldialog.ui.h</include>
  10.288 +</includes>
  10.289 +<variables>
  10.290 +    <variable>QString css;</variable>
  10.291 +    <variable>QString xsl;</variable>
  10.292 +    <variable>QString scriptpath;</variable>
  10.293 +    <variable>QString stylepath;</variable>
  10.294 +    <variable>QString dir;</variable>
  10.295 +    <variable>bool image;</variable>
  10.296 +    <variable>bool wikistyle;</variable>
  10.297 +    <variable>QString script;</variable>
  10.298 +    <variable>bool showOutput;</variable>
  10.299 +    <variable>QProcess *proc;</variable>
  10.300 +    <variable>ShowTextDialog *dia;</variable>
  10.301 +    <variable>bool imageOnly;</variable>
  10.302 +    <variable>bool useHeading;</variable>
  10.303 +    <variable>bool useURLImage;</variable>
  10.304 +</variables>
  10.305 +<slots>
  10.306 +    <slot>browseDirectory()</slot>
  10.307 +    <slot>useWIKIpressed( bool b )</slot>
  10.308 +    <slot>includeImage( bool b )</slot>
  10.309 +    <slot>imgOnly( bool b )</slot>
  10.310 +    <slot>useHeadingPressed( bool b )</slot>
  10.311 +    <slot>useURLImagePressed( bool b )</slot>
  10.312 +    <slot>showOut( bool b )</slot>
  10.313 +    <slot>dirChanged()</slot>
  10.314 +    <slot>doExport( const QString &amp; mapname )</slot>
  10.315 +    <slot returnType="QString">getDir()</slot>
  10.316 +    <slot>readOutput()</slot>
  10.317 +</slots>
  10.318 +<functions>
  10.319 +    <function access="private" specifier="non virtual">init()</function>
  10.320 +    <function access="private" specifier="non virtual">destroy()</function>
  10.321 +</functions>
  10.322 +<pixmapinproject/>
  10.323 +<layoutdefaults spacing="6" margin="11"/>
  10.324 +</UI>
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/exporthtmldialog.ui.h	Sun Jan 30 12:59:10 2005 +0000
    11.3 @@ -0,0 +1,218 @@
    11.4 +/****************************************************************************
    11.5 +** ui.h extension file, included from the uic-generated form implementation.
    11.6 +**
    11.7 +** If you wish to add, delete or rename functions or slots use
    11.8 +** Qt Designer which will update this file, preserving your code. Create an
    11.9 +** init() function in place of a constructor, and a destroy() function in
   11.10 +** place of a destructor.
   11.11 +*****************************************************************************/
   11.12 +
   11.13 +
   11.14 +extern Settings settings;
   11.15 +
   11.16 +void ExportHTMLDialog::init()
   11.17 +{
   11.18 +	dir=settings.readEntry ("/vym/export/html/dir","" );
   11.19 +	lineEdit1->setText(dir);
   11.20 +	
   11.21 +    if ( settings.readEntry ("/vym/export/html/image","yes")=="yes")
   11.22 +		image=true;
   11.23 +	else	
   11.24 +		image=false;
   11.25 +	checkBox4->setChecked(image);
   11.26 +	
   11.27 +	if ( settings.readEntry ("/vym/export/html/imageOnly","no")=="yes")
   11.28 +		imageOnly=true;
   11.29 +	else	
   11.30 +		imageOnly=false;
   11.31 +	checkBox5_2->setChecked(imageOnly);
   11.32 +		
   11.33 +    if ( settings.readEntry ("/vym/export/html/wiki","no")=="yes")
   11.34 +		wikistyle=true;
   11.35 +	else	
   11.36 +		wikistyle=false;
   11.37 +	checkBox5->setChecked(wikistyle);
   11.38 +	
   11.39 +	if ( settings.readEntry ("/vym/export/html/useHeading","no")=="yes")
   11.40 +		useHeading=true;
   11.41 +	else	
   11.42 +		useHeading=false;
   11.43 +	checkBox4_2->setChecked(useHeading);
   11.44 +		
   11.45 +	if ( settings.readEntry ("/vym/export/html/useURLImage","yes")=="yes")
   11.46 +		useURLImage=true;
   11.47 +	else	
   11.48 +		useURLImage=false;
   11.49 +	checkBox6->setChecked(useURLImage);
   11.50 +	
   11.51 +	if ( settings.readEntry ("/vym/export/html/showOutput","no")=="yes")
   11.52 +		showOutput=true;
   11.53 +	else	
   11.54 +		showOutput=false;
   11.55 +	checkBox3->setChecked(showOutput);
   11.56 +		
   11.57 +	stylepath=settings.readEntry
   11.58 +		("/vym/export/html/styles","styles");
   11.59 +	scriptpath=settings.readEntry 
   11.60 +		("/vym/export/html/scripts","scripts");
   11.61 +	xsl=settings.readEntry 
   11.62 +		("/vym/export/html/xsl","vym2html.xsl");
   11.63 +	css=settings.readEntry 
   11.64 +		("/vym/export/html/css","vym.css");	
   11.65 +	script=settings.readEntry 
   11.66 +		("/vym/export/html/script","vym2html.sh");	
   11.67 +	
   11.68 +	proc = new QProcess( this );
   11.69 +	connect( proc, SIGNAL(readyReadStdout()),
   11.70 +			 this, SLOT(readOutput()) );
   11.71 +
   11.72 +	dia=new ShowTextDialog ();
   11.73 +}
   11.74 +
   11.75 +void ExportHTMLDialog::destroy()
   11.76 +{
   11.77 +	delete (proc);
   11.78 +	delete (dia);
   11.79 +}
   11.80 +
   11.81 +void ExportHTMLDialog::browseDirectory()
   11.82 +{
   11.83 +   	QFileDialog fd( this, tr("VYM - Export HTML to directory"));
   11.84 +	fd.setMode (QFileDialog::DirectoryOnly);
   11.85 +	fd.setCaption(tr("VYM - Export HTML to directory"));
   11.86 +	fd.setModal (true);
   11.87 +	fd.show();
   11.88 +
   11.89 +	if ( fd.exec() == QDialog::Accepted )
   11.90 +	{
   11.91 +		dir=fd.selectedFile();
   11.92 +		lineEdit1->setText (dir );
   11.93 +	}
   11.94 +}
   11.95 +
   11.96 +void ExportHTMLDialog::useWIKIpressed(bool b)
   11.97 +{
   11.98 +	wikistyle=b;
   11.99 +}
  11.100 +
  11.101 +void ExportHTMLDialog::includeImage(bool b)
  11.102 +{
  11.103 +	image=b;
  11.104 +}
  11.105 +
  11.106 +void ExportHTMLDialog::imgOnly(bool b)
  11.107 +{
  11.108 +	imageOnly=b;
  11.109 +}
  11.110 +
  11.111 +void ExportHTMLDialog::useHeadingPressed(bool b)
  11.112 +{
  11.113 +	useHeading=b;
  11.114 +}
  11.115 +
  11.116 +void ExportHTMLDialog::useURLImagePressed(bool b)
  11.117 +{
  11.118 +	useURLImage=b;
  11.119 +}
  11.120 +
  11.121 +void ExportHTMLDialog::showOut(bool b)
  11.122 +{
  11.123 +	showOutput=b;
  11.124 +}
  11.125 +
  11.126 +void ExportHTMLDialog::dirChanged()
  11.127 +{
  11.128 +	dir=lineEdit1->text();
  11.129 +}
  11.130 +
  11.131 +
  11.132 +
  11.133 +
  11.134 +void ExportHTMLDialog::doExport (const QString &mapname)
  11.135 +{
  11.136 +	// Save options to settings file 
  11.137 +	// (but don't save at destructor, which
  11.138 +	// is called for "cancel", too)
  11.139 +	settings.writeEntry ("/vym/export/html/dir",lineEdit1->text() );
  11.140 +
  11.141 +	if (wikistyle)
  11.142 +		settings.writeEntry ("/vym/export/html/wiki","yes");
  11.143 +	else	
  11.144 +		settings.writeEntry ("/vym/export/html/wiki","no");
  11.145 +
  11.146 +    if (image)
  11.147 +		settings.writeEntry ("/vym/export/html/image","yes");
  11.148 +    else
  11.149 +		settings.writeEntry ("/vym/export/html/image","no");	
  11.150 +	
  11.151 +  if (imageOnly)
  11.152 +		settings.writeEntry ("/vym/export/html/imageOnly","yes");
  11.153 +    else
  11.154 +		settings.writeEntry ("/vym/export/html/imageOnly","no");	
  11.155 +	
  11.156 +  if (useHeading)
  11.157 +		settings.writeEntry ("/vym/export/html/useHeading","yes");
  11.158 +    else
  11.159 +		settings.writeEntry ("/vym/export/html/useHeading","no");	
  11.160 +			
  11.161 +    if (showOutput)
  11.162 +		settings.writeEntry ("/vym/export/html/showOutput","yes");
  11.163 +    else
  11.164 +		settings.writeEntry ("/vym/export/html/showOutput","no");	
  11.165 +		
  11.166 +	settings.writeEntry
  11.167 +		("/vym/export/html/styles",stylepath);
  11.168 +	settings.writeEntry 
  11.169 +		("/vym/export/html/scripts",scriptpath);
  11.170 +	settings.writeEntry 
  11.171 +		("/vym/export/html/xsl",xsl);
  11.172 +	settings.writeEntry 
  11.173 +		("/vym/export/html/css",css);	
  11.174 +	settings.writeEntry 
  11.175 +		("/vym/export/html/script",script);	
  11.176 +
  11.177 +	proc->addArgument (scriptpath + "/" + script );
  11.178 +	proc->addArgument(dir + maskPath(mapname) + ".xml");
  11.179 +	proc->addArgument("-sp=" + stylepath +"/" + xsl );
  11.180 +	proc->addArgument("-css=" + css );
  11.181 +	if (image) proc->addArgument("-image" );
  11.182 +	if (wikistyle) proc->addArgument("-wikistyle" );
  11.183 +	if (useHeading) proc->addArgument("-useURLHeading" );
  11.184 +	if (useURLImage) 
  11.185 +	{	
  11.186 +		proc->addArgument("-useURLImage" );
  11.187 +		QPixmap pm (flag_url_xpm);
  11.188 +		pm.save (dir + "/flags/url.png","PNG");
  11.189 +	}	
  11.190 +
  11.191 +	dia->append ("vym is executing: " + proc->arguments().join(" ") );
  11.192 +	if ( !proc->start() ) 
  11.193 +	{
  11.194 +		// error handling
  11.195 +		dia->show();
  11.196 +		QString s;
  11.197 +		QStringList list = proc->arguments();
  11.198 +		QStringList::Iterator it = list.begin();
  11.199 +		while( it != list.end() ) 
  11.200 +		{
  11.201 +			s+= ( *it ) + "\n";
  11.202 +			++it;
  11.203 +		}
  11.204 +		QMessageBox::critical(0, tr("Critcal export error"),"Couldn't start script to export:\n"+s);
  11.205 +	} else 
  11.206 +		if (showOutput) dia->exec();
  11.207 +	
  11.208 +
  11.209 +}
  11.210 +
  11.211 +
  11.212 +QString ExportHTMLDialog::getDir()
  11.213 +{
  11.214 +	return dir;
  11.215 +}
  11.216 +
  11.217 +
  11.218 +void ExportHTMLDialog::readOutput()
  11.219 +{
  11.220 +	dia->append (proc->readStdout() );
  11.221 +}
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/exports.cpp	Sun Jan 30 12:59:10 2005 +0000
    12.3 @@ -0,0 +1,132 @@
    12.4 +#include "exports.h"
    12.5 +
    12.6 +#include "linkablemapobj.h"
    12.7 +
    12.8 +
    12.9 +Export::Export()
   12.10 +{
   12.11 +	indentPerDepth="  ";
   12.12 +}
   12.13 +
   12.14 +bool Export::setOutputDir(QString dirname)
   12.15 +{
   12.16 +	outdir.setPath (dirname);
   12.17 +	if ( outdir.exists() )
   12.18 +	{
   12.19 +		// FIXME
   12.20 +		// ask for confirmation
   12.21 +		// then delete outdir
   12.22 +		return true;
   12.23 +	} else
   12.24 +	{
   12.25 +		// try to create directory
   12.26 +		//return outdir.mkdir (outdir.absPath());
   12.27 +		// FIXME
   12.28 +		return true;
   12.29 +	}
   12.30 +}
   12.31 +
   12.32 +void Export::setPath (const QString &p)
   12.33 +{
   12.34 +	filepath=p;
   12.35 +}
   12.36 +
   12.37 +void Export::setMapCenter(MapCenterObj *mc)
   12.38 +{
   12.39 +	mapCenter=mc;
   12.40 +}
   12.41 +
   12.42 +void Export::exportMap()
   12.43 +{
   12.44 +	QFile file (filepath);
   12.45 +	if ( !file.open( IO_WriteOnly ) )
   12.46 +	{
   12.47 +		// FIXME
   12.48 +		cout << "Export::exportMap  couldn't open "<<filepath<<endl;
   12.49 +		return;
   12.50 +	}
   12.51 +	QTextStream ts( &file );	// use LANG decoding here...
   12.52 +
   12.53 +	// Main loop over all branches
   12.54 +	QString s;
   12.55 +	QString actIndent("");
   12.56 +	int i;
   12.57 +	BranchObj *bo;
   12.58 +	bo=mapCenter->first();
   12.59 +	while (bo) 
   12.60 +	{
   12.61 +		// Make indentstring
   12.62 +		for (i=0;i<bo->getDepth();i++) actIndent+= indentPerDepth;
   12.63 +
   12.64 +		// Write heading
   12.65 +		//	write (actIndent + getSectionString(bo) + bo->getHeading()+ "\n");
   12.66 +		if (bo->getDepth()==1)
   12.67 +			ts << (getSectionString(bo) + bo->getHeading()+ "\n");
   12.68 +		else	
   12.69 +			ts << (actIndent + " - " + bo->getHeading()+ "\n");
   12.70 +		
   12.71 +		// If necessary, write note
   12.72 +		if (!bo->getNote().isEmpty())
   12.73 +		{
   12.74 +			ts << ("-------------------Begin of Note-----------------\n");
   12.75 +			ts << (bo->getNote());
   12.76 +			ts << ("\n");
   12.77 +			ts << ("-------------------End of Note-------------------\n");
   12.78 +		}
   12.79 +		
   12.80 +		bo=bo->next();
   12.81 +		actIndent="";
   12.82 +	}
   12.83 +	file.close();
   12.84 +}
   12.85 +
   12.86 +QString Export::getSectionString(BranchObj *bostart)
   12.87 +{
   12.88 +	QString r;
   12.89 +	BranchObj *bo=bostart;
   12.90 +	int depth=bo->getDepth();
   12.91 +	while (depth>0)
   12.92 +	{
   12.93 +		r=QString("%1").arg(1+bo->getNum(),0,10)+"." + r;
   12.94 +		bo=(BranchObj*)(bo->getParObj());
   12.95 +		depth=bo->getDepth();
   12.96 +	}	
   12.97 +	if (r.isEmpty())
   12.98 +		return r;
   12.99 +	else	
  12.100 +		return r + " ";
  12.101 +}
  12.102 +
  12.103 +void Export::exportAsHTML()
  12.104 +{
  12.105 +	// FIXME  just testing...
  12.106 +	// Main loop over all branches
  12.107 +	QString s;
  12.108 +	QString actIndent("");
  12.109 +	int i;
  12.110 +	BranchObj *bo;
  12.111 +	bo=mapCenter->first();
  12.112 +	while (bo) 
  12.113 +	{
  12.114 +		// Make indentstring
  12.115 +		for (i=0;i<bo->getDepth();i++) actIndent+= indentPerDepth;
  12.116 +
  12.117 +		// Write heading
  12.118 +		write (actIndent + getSectionString(bo) + bo->getHeading()+ "\n");
  12.119 +		
  12.120 +		// If necessary, write note
  12.121 +		if (!bo->getNote().isEmpty())
  12.122 +		{
  12.123 +			write (bo->getNote());
  12.124 +		}
  12.125 +		
  12.126 +		bo=bo->next();
  12.127 +		actIndent="";
  12.128 +	}
  12.129 +}
  12.130 +
  12.131 +void Export::write(QString s)
  12.132 +{
  12.133 +	cout << s;
  12.134 +}
  12.135 +
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/exports.h	Sun Jan 30 12:59:10 2005 +0000
    13.3 @@ -0,0 +1,34 @@
    13.4 +#ifndef EXPORTS_H
    13.5 +#define EXPORTS_H
    13.6 +
    13.7 +#include <qdir.h>
    13.8 +#include <qstring.h>
    13.9 +#include <iostream>
   13.10 +
   13.11 +#include "mapcenterobj.h"
   13.12 +
   13.13 +using namespace std;
   13.14 +
   13.15 +/////////////////////////////////////////////////////////////////////////////
   13.16 +class Export
   13.17 +{
   13.18 +public:
   13.19 +	Export();
   13.20 +	bool setOutputDir (QString);
   13.21 +	void setPath(const QString &);
   13.22 +	void setMapCenter (MapCenterObj*);
   13.23 +	void setIndentPerDepth (QString);
   13.24 +	void exportMap();
   13.25 +	void exportAsHTML();
   13.26 +protected:  
   13.27 +	QString getSectionString (BranchObj*);
   13.28 +	void write (QString);
   13.29 +
   13.30 +private:
   13.31 +	QDir outdir;
   13.32 +	QString filepath;
   13.33 +	MapCenterObj *mapCenter;
   13.34 +	QString	indentPerDepth;
   13.35 +};
   13.36 +
   13.37 +#endif
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/exportxhtmldialog.ui	Sun Jan 30 12:59:10 2005 +0000
    14.3 @@ -0,0 +1,555 @@
    14.4 +<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
    14.5 +<class>ExportXHTMLDialog</class>
    14.6 +<widget class="QDialog">
    14.7 +    <property name="name">
    14.8 +        <cstring>ExportXHTMLDialog</cstring>
    14.9 +    </property>
   14.10 +    <property name="geometry">
   14.11 +        <rect>
   14.12 +            <x>0</x>
   14.13 +            <y>0</y>
   14.14 +            <width>582</width>
   14.15 +            <height>599</height>
   14.16 +        </rect>
   14.17 +    </property>
   14.18 +    <property name="minimumSize">
   14.19 +        <size>
   14.20 +            <width>0</width>
   14.21 +            <height>130</height>
   14.22 +        </size>
   14.23 +    </property>
   14.24 +    <property name="caption">
   14.25 +        <string>Export XHTML</string>
   14.26 +    </property>
   14.27 +    <vbox>
   14.28 +        <property name="name">
   14.29 +            <cstring>unnamed</cstring>
   14.30 +        </property>
   14.31 +        <widget class="QLayoutWidget">
   14.32 +            <property name="name">
   14.33 +                <cstring>layout33</cstring>
   14.34 +            </property>
   14.35 +            <hbox>
   14.36 +                <property name="name">
   14.37 +                    <cstring>unnamed</cstring>
   14.38 +                </property>
   14.39 +                <widget class="QLabel">
   14.40 +                    <property name="name">
   14.41 +                        <cstring>textLabel1</cstring>
   14.42 +                    </property>
   14.43 +                    <property name="text">
   14.44 +                        <string>Export to directory:</string>
   14.45 +                    </property>
   14.46 +                </widget>
   14.47 +                <widget class="QLineEdit">
   14.48 +                    <property name="name">
   14.49 +                        <cstring>lineEditDir</cstring>
   14.50 +                    </property>
   14.51 +                </widget>
   14.52 +                <widget class="QPushButton">
   14.53 +                    <property name="name">
   14.54 +                        <cstring>browseExportDirButton</cstring>
   14.55 +                    </property>
   14.56 +                    <property name="text">
   14.57 +                        <string>Browse</string>
   14.58 +                    </property>
   14.59 +                </widget>
   14.60 +            </hbox>
   14.61 +        </widget>
   14.62 +        <widget class="QButtonGroup">
   14.63 +            <property name="name">
   14.64 +                <cstring>buttonGroup2</cstring>
   14.65 +            </property>
   14.66 +            <property name="sizePolicy">
   14.67 +                <sizepolicy>
   14.68 +                    <hsizetype>3</hsizetype>
   14.69 +                    <vsizetype>3</vsizetype>
   14.70 +                    <horstretch>0</horstretch>
   14.71 +                    <verstretch>0</verstretch>
   14.72 +                </sizepolicy>
   14.73 +            </property>
   14.74 +            <property name="minimumSize">
   14.75 +                <size>
   14.76 +                    <width>0</width>
   14.77 +                    <height>160</height>
   14.78 +                </size>
   14.79 +            </property>
   14.80 +            <property name="title">
   14.81 +                <string>Options</string>
   14.82 +            </property>
   14.83 +            <vbox>
   14.84 +                <property name="name">
   14.85 +                    <cstring>unnamed</cstring>
   14.86 +                </property>
   14.87 +                <widget class="QCheckBox">
   14.88 +                    <property name="name">
   14.89 +                        <cstring>imageButton</cstring>
   14.90 +                    </property>
   14.91 +                    <property name="text">
   14.92 +                        <string>Include image</string>
   14.93 +                    </property>
   14.94 +                </widget>
   14.95 +                <widget class="QCheckBox">
   14.96 +                    <property name="name">
   14.97 +                        <cstring>textColorButton</cstring>
   14.98 +                    </property>
   14.99 +                    <property name="text">
  14.100 +                        <string>Colored headings in text</string>
  14.101 +                    </property>
  14.102 +                </widget>
  14.103 +                <widget class="QCheckBox">
  14.104 +                    <property name="name">
  14.105 +                        <cstring>saveSettingsInMapButton</cstring>
  14.106 +                    </property>
  14.107 +                    <property name="text">
  14.108 +                        <string>Save settings in map</string>
  14.109 +                    </property>
  14.110 +                </widget>
  14.111 +                <widget class="QCheckBox">
  14.112 +                    <property name="name">
  14.113 +                        <cstring>warningsButton</cstring>
  14.114 +                    </property>
  14.115 +                    <property name="text">
  14.116 +                        <string>showWarnings e.g. if directory is not empty</string>
  14.117 +                    </property>
  14.118 +                </widget>
  14.119 +                <widget class="QCheckBox">
  14.120 +                    <property name="name">
  14.121 +                        <cstring>outputButton</cstring>
  14.122 +                    </property>
  14.123 +                    <property name="sizePolicy">
  14.124 +                        <sizepolicy>
  14.125 +                            <hsizetype>1</hsizetype>
  14.126 +                            <vsizetype>0</vsizetype>
  14.127 +                            <horstretch>0</horstretch>
  14.128 +                            <verstretch>0</verstretch>
  14.129 +                        </sizepolicy>
  14.130 +                    </property>
  14.131 +                    <property name="text">
  14.132 +                        <string>show output of external scripts</string>
  14.133 +                    </property>
  14.134 +                </widget>
  14.135 +            </vbox>
  14.136 +        </widget>
  14.137 +        <widget class="QButtonGroup">
  14.138 +            <property name="name">
  14.139 +                <cstring>buttonGroup2_2</cstring>
  14.140 +            </property>
  14.141 +            <property name="sizePolicy">
  14.142 +                <sizepolicy>
  14.143 +                    <hsizetype>3</hsizetype>
  14.144 +                    <vsizetype>3</vsizetype>
  14.145 +                    <horstretch>0</horstretch>
  14.146 +                    <verstretch>0</verstretch>
  14.147 +                </sizepolicy>
  14.148 +            </property>
  14.149 +            <property name="title">
  14.150 +                <string>Stylesheets</string>
  14.151 +            </property>
  14.152 +            <widget class="QLayoutWidget">
  14.153 +                <property name="name">
  14.154 +                    <cstring>layout7</cstring>
  14.155 +                </property>
  14.156 +                <property name="geometry">
  14.157 +                    <rect>
  14.158 +                        <x>10</x>
  14.159 +                        <y>30</y>
  14.160 +                        <width>540</width>
  14.161 +                        <height>84</height>
  14.162 +                    </rect>
  14.163 +                </property>
  14.164 +                <vbox>
  14.165 +                    <property name="name">
  14.166 +                        <cstring>unnamed</cstring>
  14.167 +                    </property>
  14.168 +                    <widget class="QLayoutWidget">
  14.169 +                        <property name="name">
  14.170 +                            <cstring>layout5</cstring>
  14.171 +                        </property>
  14.172 +                        <hbox>
  14.173 +                            <property name="name">
  14.174 +                                <cstring>unnamed</cstring>
  14.175 +                            </property>
  14.176 +                            <widget class="QLabel">
  14.177 +                                <property name="name">
  14.178 +                                    <cstring>textLabel1_2</cstring>
  14.179 +                                </property>
  14.180 +                                <property name="text">
  14.181 +                                    <string>CSS:</string>
  14.182 +                                </property>
  14.183 +                            </widget>
  14.184 +                            <widget class="QLineEdit">
  14.185 +                                <property name="name">
  14.186 +                                    <cstring>lineEditCSS</cstring>
  14.187 +                                </property>
  14.188 +                            </widget>
  14.189 +                            <widget class="QPushButton">
  14.190 +                                <property name="name">
  14.191 +                                    <cstring>browseCSSButton</cstring>
  14.192 +                                </property>
  14.193 +                                <property name="text">
  14.194 +                                    <string>Browse</string>
  14.195 +                                </property>
  14.196 +                            </widget>
  14.197 +                        </hbox>
  14.198 +                    </widget>
  14.199 +                    <widget class="QLayoutWidget">
  14.200 +                        <property name="name">
  14.201 +                            <cstring>layout6</cstring>
  14.202 +                        </property>
  14.203 +                        <hbox>
  14.204 +                            <property name="name">
  14.205 +                                <cstring>unnamed</cstring>
  14.206 +                            </property>
  14.207 +                            <widget class="QLabel">
  14.208 +                                <property name="name">
  14.209 +                                    <cstring>textLabel2</cstring>
  14.210 +                                </property>
  14.211 +                                <property name="text">
  14.212 +                                    <string>XSL:</string>
  14.213 +                                </property>
  14.214 +                            </widget>
  14.215 +                            <widget class="QLineEdit">
  14.216 +                                <property name="name">
  14.217 +                                    <cstring>lineEditXSL</cstring>
  14.218 +                                </property>
  14.219 +                            </widget>
  14.220 +                            <widget class="QPushButton">
  14.221 +                                <property name="name">
  14.222 +                                    <cstring>browseXSLButton</cstring>
  14.223 +                                </property>
  14.224 +                                <property name="text">
  14.225 +                                    <string>Browse</string>
  14.226 +                                </property>
  14.227 +                            </widget>
  14.228 +                        </hbox>
  14.229 +                    </widget>
  14.230 +                </vbox>
  14.231 +            </widget>
  14.232 +        </widget>
  14.233 +        <widget class="QGroupBox">
  14.234 +            <property name="name">
  14.235 +                <cstring>groupBox1</cstring>
  14.236 +            </property>
  14.237 +            <property name="title">
  14.238 +                <string>Scripts</string>
  14.239 +            </property>
  14.240 +            <widget class="QLabel">
  14.241 +                <property name="name">
  14.242 +                    <cstring>textLabel1_3</cstring>
  14.243 +                </property>
  14.244 +                <property name="geometry">
  14.245 +                    <rect>
  14.246 +                        <x>12</x>
  14.247 +                        <y>22</y>
  14.248 +                        <width>110</width>
  14.249 +                        <height>36</height>
  14.250 +                    </rect>
  14.251 +                </property>
  14.252 +                <property name="text">
  14.253 +                    <string>Before export:</string>
  14.254 +                </property>
  14.255 +            </widget>
  14.256 +            <widget class="QLineEdit">
  14.257 +                <property name="name">
  14.258 +                    <cstring>lineEditPreScript</cstring>
  14.259 +                </property>
  14.260 +                <property name="geometry">
  14.261 +                    <rect>
  14.262 +                        <x>128</x>
  14.263 +                        <y>26</y>
  14.264 +                        <width>322</width>
  14.265 +                        <height>28</height>
  14.266 +                    </rect>
  14.267 +                </property>
  14.268 +            </widget>
  14.269 +            <widget class="QPushButton">
  14.270 +                <property name="name">
  14.271 +                    <cstring>browsePreExportButton</cstring>
  14.272 +                </property>
  14.273 +                <property name="geometry">
  14.274 +                    <rect>
  14.275 +                        <x>456</x>
  14.276 +                        <y>22</y>
  14.277 +                        <width>94</width>
  14.278 +                        <height>36</height>
  14.279 +                    </rect>
  14.280 +                </property>
  14.281 +                <property name="text">
  14.282 +                    <string>Browse</string>
  14.283 +                </property>
  14.284 +            </widget>
  14.285 +            <widget class="QLabel">
  14.286 +                <property name="name">
  14.287 +                    <cstring>textLabel2_2</cstring>
  14.288 +                </property>
  14.289 +                <property name="geometry">
  14.290 +                    <rect>
  14.291 +                        <x>11</x>
  14.292 +                        <y>61</y>
  14.293 +                        <width>99</width>
  14.294 +                        <height>36</height>
  14.295 +                    </rect>
  14.296 +                </property>
  14.297 +                <property name="text">
  14.298 +                    <string>After Export:</string>
  14.299 +                </property>
  14.300 +            </widget>
  14.301 +            <widget class="QLineEdit">
  14.302 +                <property name="name">
  14.303 +                    <cstring>lineEditPostScript</cstring>
  14.304 +                </property>
  14.305 +                <property name="geometry">
  14.306 +                    <rect>
  14.307 +                        <x>116</x>
  14.308 +                        <y>65</y>
  14.309 +                        <width>333</width>
  14.310 +                        <height>28</height>
  14.311 +                    </rect>
  14.312 +                </property>
  14.313 +            </widget>
  14.314 +            <widget class="QPushButton">
  14.315 +                <property name="name">
  14.316 +                    <cstring>browsePostExportButton</cstring>
  14.317 +                </property>
  14.318 +                <property name="geometry">
  14.319 +                    <rect>
  14.320 +                        <x>455</x>
  14.321 +                        <y>61</y>
  14.322 +                        <width>94</width>
  14.323 +                        <height>36</height>
  14.324 +                    </rect>
  14.325 +                </property>
  14.326 +                <property name="text">
  14.327 +                    <string>Browse</string>
  14.328 +                </property>
  14.329 +            </widget>
  14.330 +        </widget>
  14.331 +        <spacer>
  14.332 +            <property name="name">
  14.333 +                <cstring>spacer3</cstring>
  14.334 +            </property>
  14.335 +            <property name="orientation">
  14.336 +                <enum>Vertical</enum>
  14.337 +            </property>
  14.338 +            <property name="sizeType">
  14.339 +                <enum>Expanding</enum>
  14.340 +            </property>
  14.341 +            <property name="sizeHint">
  14.342 +                <size>
  14.343 +                    <width>20</width>
  14.344 +                    <height>31</height>
  14.345 +                </size>
  14.346 +            </property>
  14.347 +        </spacer>
  14.348 +        <widget class="QLayoutWidget">
  14.349 +            <property name="name">
  14.350 +                <cstring>layout17</cstring>
  14.351 +            </property>
  14.352 +            <hbox>
  14.353 +                <property name="name">
  14.354 +                    <cstring>unnamed</cstring>
  14.355 +                </property>
  14.356 +                <spacer>
  14.357 +                    <property name="name">
  14.358 +                        <cstring>spacer5</cstring>
  14.359 +                    </property>
  14.360 +                    <property name="orientation">
  14.361 +                        <enum>Horizontal</enum>
  14.362 +                    </property>
  14.363 +                    <property name="sizeType">
  14.364 +                        <enum>Expanding</enum>
  14.365 +                    </property>
  14.366 +                    <property name="sizeHint">
  14.367 +                        <size>
  14.368 +                            <width>61</width>
  14.369 +                            <height>21</height>
  14.370 +                        </size>
  14.371 +                    </property>
  14.372 +                </spacer>
  14.373 +                <widget class="QPushButton">
  14.374 +                    <property name="name">
  14.375 +                        <cstring>exportButton</cstring>
  14.376 +                    </property>
  14.377 +                    <property name="text">
  14.378 +                        <string>Export</string>
  14.379 +                    </property>
  14.380 +                    <property name="default">
  14.381 +                        <bool>true</bool>
  14.382 +                    </property>
  14.383 +                </widget>
  14.384 +                <widget class="QPushButton">
  14.385 +                    <property name="name">
  14.386 +                        <cstring>cancelButton</cstring>
  14.387 +                    </property>
  14.388 +                    <property name="text">
  14.389 +                        <string>Cancel</string>
  14.390 +                    </property>
  14.391 +                </widget>
  14.392 +            </hbox>
  14.393 +        </widget>
  14.394 +    </vbox>
  14.395 +</widget>
  14.396 +<connections>
  14.397 +    <connection>
  14.398 +        <sender>outputButton</sender>
  14.399 +        <signal>toggled(bool)</signal>
  14.400 +        <receiver>ExportXHTMLDialog</receiver>
  14.401 +        <slot>outputButtonPressed(bool)</slot>
  14.402 +    </connection>
  14.403 +    <connection>
  14.404 +        <sender>exportButton</sender>
  14.405 +        <signal>pressed()</signal>
  14.406 +        <receiver>ExportXHTMLDialog</receiver>
  14.407 +        <slot>accept()</slot>
  14.408 +    </connection>
  14.409 +    <connection>
  14.410 +        <sender>cancelButton</sender>
  14.411 +        <signal>pressed()</signal>
  14.412 +        <receiver>ExportXHTMLDialog</receiver>
  14.413 +        <slot>close()</slot>
  14.414 +    </connection>
  14.415 +    <connection>
  14.416 +        <sender>browseExportDirButton</sender>
  14.417 +        <signal>pressed()</signal>
  14.418 +        <receiver>ExportXHTMLDialog</receiver>
  14.419 +        <slot>browseDirectoryPressed()</slot>
  14.420 +    </connection>
  14.421 +    <connection>
  14.422 +        <sender>browseXSLButton</sender>
  14.423 +        <signal>pressed()</signal>
  14.424 +        <receiver>ExportXHTMLDialog</receiver>
  14.425 +        <slot>browseXSLPressed()</slot>
  14.426 +    </connection>
  14.427 +    <connection>
  14.428 +        <sender>browseCSSButton</sender>
  14.429 +        <signal>pressed()</signal>
  14.430 +        <receiver>ExportXHTMLDialog</receiver>
  14.431 +        <slot>browseCSSPressed()</slot>
  14.432 +    </connection>
  14.433 +    <connection>
  14.434 +        <sender>imageButton</sender>
  14.435 +        <signal>toggled(bool)</signal>
  14.436 +        <receiver>ExportXHTMLDialog</receiver>
  14.437 +        <slot>imageButtonPressed(bool)</slot>
  14.438 +    </connection>
  14.439 +    <connection>
  14.440 +        <sender>textColorButton</sender>
  14.441 +        <signal>toggled(bool)</signal>
  14.442 +        <receiver>ExportXHTMLDialog</receiver>
  14.443 +        <slot>textcolorButtonPressed(bool)</slot>
  14.444 +    </connection>
  14.445 +    <connection>
  14.446 +        <sender>lineEditDir</sender>
  14.447 +        <signal>textChanged(const QString&amp;)</signal>
  14.448 +        <receiver>ExportXHTMLDialog</receiver>
  14.449 +        <slot>dirChanged()</slot>
  14.450 +    </connection>
  14.451 +    <connection>
  14.452 +        <sender>lineEditCSS</sender>
  14.453 +        <signal>textChanged(const QString&amp;)</signal>
  14.454 +        <receiver>ExportXHTMLDialog</receiver>
  14.455 +        <slot>cssChanged()</slot>
  14.456 +    </connection>
  14.457 +    <connection>
  14.458 +        <sender>lineEditXSL</sender>
  14.459 +        <signal>textChanged(const QString&amp;)</signal>
  14.460 +        <receiver>ExportXHTMLDialog</receiver>
  14.461 +        <slot>xslChanged()</slot>
  14.462 +    </connection>
  14.463 +    <connection>
  14.464 +        <sender>browsePreExportButton</sender>
  14.465 +        <signal>pressed()</signal>
  14.466 +        <receiver>ExportXHTMLDialog</receiver>
  14.467 +        <slot>browsePreExportButtonPressed()</slot>
  14.468 +    </connection>
  14.469 +    <connection>
  14.470 +        <sender>browsePostExportButton</sender>
  14.471 +        <signal>pressed()</signal>
  14.472 +        <receiver>ExportXHTMLDialog</receiver>
  14.473 +        <slot>browsePostExportButtonPressed()</slot>
  14.474 +    </connection>
  14.475 +    <connection>
  14.476 +        <sender>lineEditPreScript</sender>
  14.477 +        <signal>textChanged(const QString&amp;)</signal>
  14.478 +        <receiver>ExportXHTMLDialog</receiver>
  14.479 +        <slot>prescriptChanged()</slot>
  14.480 +    </connection>
  14.481 +    <connection>
  14.482 +        <sender>lineEditPostScript</sender>
  14.483 +        <signal>textChanged(const QString&amp;)</signal>
  14.484 +        <receiver>ExportXHTMLDialog</receiver>
  14.485 +        <slot>postscriptChanged()</slot>
  14.486 +    </connection>
  14.487 +    <connection>
  14.488 +        <sender>warningsButton</sender>
  14.489 +        <signal>toggled(bool)</signal>
  14.490 +        <receiver>ExportXHTMLDialog</receiver>
  14.491 +        <slot>warningsButtonPressed(bool)</slot>
  14.492 +    </connection>
  14.493 +    <connection>
  14.494 +        <sender>saveSettingsInMapButton</sender>
  14.495 +        <signal>toggled(bool)</signal>
  14.496 +        <receiver>ExportXHTMLDialog</receiver>
  14.497 +        <slot>saveSettingsInMapButtonPressed(bool)</slot>
  14.498 +    </connection>
  14.499 +</connections>
  14.500 +<includes>
  14.501 +    <include location="local" impldecl="in declaration">process.h</include>
  14.502 +    <include location="local" impldecl="in declaration">showtextdialog.h</include>
  14.503 +    <include location="global" impldecl="in implementation">qfiledialog.h</include>
  14.504 +    <include location="global" impldecl="in implementation">qmessagebox.h</include>
  14.505 +    <include location="local" impldecl="in implementation">settings.h</include>
  14.506 +    <include location="local" impldecl="in implementation">icons/flag-url.xpm</include>
  14.507 +    <include location="local" impldecl="in implementation">exportxhtmldialog.ui.h</include>
  14.508 +</includes>
  14.509 +<variables>
  14.510 +    <variable>bool useTextColor;</variable>
  14.511 +    <variable>bool showWarnings;</variable>
  14.512 +    <variable>QString xsl;</variable>
  14.513 +    <variable>QString css;</variable>
  14.514 +    <variable>bool useImage;</variable>
  14.515 +    <variable>bool showOutput;</variable>
  14.516 +    <variable>Process *xsltProc;</variable>
  14.517 +    <variable>ShowTextDialog *dia;</variable>
  14.518 +    <variable>QString dir;</variable>
  14.519 +    <variable>QString xsltprocessor;</variable>
  14.520 +    <variable>QString filepath;</variable>
  14.521 +    <variable>QString prescript;</variable>
  14.522 +    <variable>QString postscript;</variable>
  14.523 +    <variable>bool settingsChanged;</variable>
  14.524 +    <variable>QString mapname;</variable>
  14.525 +    <variable>bool saveSettingsInMap;</variable>
  14.526 +</variables>
  14.527 +<slots>
  14.528 +    <slot>readSettings()</slot>
  14.529 +    <slot>dirChanged()</slot>
  14.530 +    <slot>browseDirectoryPressed()</slot>
  14.531 +    <slot>imageButtonPressed( bool b )</slot>
  14.532 +    <slot>textcolorButtonPressed( bool b )</slot>
  14.533 +    <slot>saveSettingsInMapButtonPressed( bool b )</slot>
  14.534 +    <slot>warningsButtonPressed( bool b )</slot>
  14.535 +    <slot>outputButtonPressed( bool b )</slot>
  14.536 +    <slot>cssChanged()</slot>
  14.537 +    <slot>browseCSSPressed()</slot>
  14.538 +    <slot>xslChanged()</slot>
  14.539 +    <slot>prescriptChanged()</slot>
  14.540 +    <slot>browseXSLPressed()</slot>
  14.541 +    <slot>postscriptChanged()</slot>
  14.542 +    <slot>browsePreExportButtonPressed()</slot>
  14.543 +    <slot>browsePostExportButtonPressed()</slot>
  14.544 +    <slot>doExport( const QString &amp; mapname )</slot>
  14.545 +    <slot>setFilePath( const QString &amp; s )</slot>
  14.546 +    <slot>setMapName( const QString &amp; s )</slot>
  14.547 +</slots>
  14.548 +<functions>
  14.549 +    <function access="private" specifier="non virtual">init()</function>
  14.550 +    <function access="private" specifier="non virtual">destroy()</function>
  14.551 +    <function returnType="QString">getDir()</function>
  14.552 +    <function returnType="bool">warnings()</function>
  14.553 +    <function returnType="bool">hasChanged()</function>
  14.554 +    <function access="private" specifier="non virtual">runScript( QString spath, QString fpath )</function>
  14.555 +</functions>
  14.556 +<pixmapinproject/>
  14.557 +<layoutdefaults spacing="6" margin="11"/>
  14.558 +</UI>
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/exportxhtmldialog.ui.h	Sun Jan 30 12:59:10 2005 +0000
    15.3 @@ -0,0 +1,412 @@
    15.4 +/****************************************************************************
    15.5 +** ui.h extension file, included from the uic-generated form implementation.
    15.6 +**
    15.7 +** If you wish to add, delete or rename functions or slots use
    15.8 +** Qt Designer which will update this file, preserving your code. Create an
    15.9 +** init() function in place of a constructor, and a destroy() function in
   15.10 +** place of a destructor.
   15.11 +*****************************************************************************/
   15.12 +
   15.13 +
   15.14 +extern Settings settings;
   15.15 +
   15.16 +void ExportXHTMLDialog::init()
   15.17 +{
   15.18 +	dia=new ShowTextDialog ();
   15.19 +	xsltprocessor="xsltproc";
   15.20 +	filepath="";
   15.21 +	settingsChanged=false;
   15.22 +}
   15.23 +
   15.24 +void ExportXHTMLDialog::readSettings()
   15.25 +{
   15.26 +
   15.27 +	dir=settings.readLocalEntry (filepath,"/vym/export/xhtml/exportDir","./" );
   15.28 +	lineEditDir->setText(dir);
   15.29 +	
   15.30 +	
   15.31 +    if ( settings.readLocalEntry (filepath,"/vym/export/xhtml/useImage","yes")=="yes")
   15.32 +		useImage=true;
   15.33 +	else	
   15.34 +		useImage=false;
   15.35 +	imageButton->setChecked(useImage);
   15.36 +		
   15.37 +	if ( settings.readLocalEntry (filepath,"/vym/export/xhtml/useTextColor","no")=="yes")
   15.38 +		useTextColor=true;
   15.39 +	else	
   15.40 +		useTextColor=false;
   15.41 +	textColorButton->setChecked(useTextColor);
   15.42 +	
   15.43 +/* FIXME this was used in old html export, is not yet in new stylesheet
   15.44 +	if ( settings.readEntry ("/vym/export/html/useHeading","no")=="yes")
   15.45 +		useHeading=true;
   15.46 +	else	
   15.47 +		useHeading=false;
   15.48 +	checkBox4_2->setChecked(useHeading);
   15.49 +*/		
   15.50 +
   15.51 +	if ( settings.readLocalEntry (filepath,"/vym/export/xhtml/saveSettingsInMap","no")=="yes")
   15.52 +		saveSettingsInMap=true;
   15.53 +	else	
   15.54 +		saveSettingsInMap=false;
   15.55 +	saveSettingsInMapButton->setChecked(saveSettingsInMap);
   15.56 +
   15.57 +	if ( settings.readEntry ("/vym/export/xhtml/showWarnings","yes")=="yes")
   15.58 +		showWarnings=true;
   15.59 +	else	
   15.60 +		showWarnings=false;
   15.61 +	warningsButton->setChecked(showWarnings);
   15.62 +	
   15.63 +	if ( settings.readEntry ("/vym/export/xhtml/showOutput","no")=="yes")
   15.64 +		showOutput=true;
   15.65 +	else	
   15.66 +		showOutput=false;
   15.67 +	outputButton->setChecked(showOutput);
   15.68 +
   15.69 +	xsl=settings.readLocalEntry 
   15.70 +		(filepath,"/vym/export/xhtml/xsl","/usr/share/vym/styles/vym2xhtml.xsl");
   15.71 +	lineEditXSL->setText(xsl);
   15.72 +	
   15.73 +	css=settings.readLocalEntry 
   15.74 +		(filepath,"/vym/export/xhtml/css","/usr/share/vym/styles/vym.css");	
   15.75 +	lineEditCSS->setText(css);
   15.76 +	
   15.77 +	prescript=settings.readLocalEntry
   15.78 +		(filepath,"/vym/export/xhtml/prescript","");
   15.79 +	lineEditPreScript->setText (prescript);	
   15.80 +	
   15.81 +	postscript=settings.readLocalEntry
   15.82 +		(filepath,"/vym/export/xhtml/postscript","");
   15.83 +	lineEditPostScript->setText (postscript);	
   15.84 +
   15.85 +	if (!prescript.isEmpty() || !postscript.isEmpty())
   15.86 +	{
   15.87 +		QMessageBox::warning( 0, tr( "Warning" ),tr(
   15.88 +		"The settings saved in the map "
   15.89 +		"would like to run scripts:\n\n") +
   15.90 +		prescript +"  "+postscript +"\n\n"+
   15.91 +		tr("Please check, if you really\n"
   15.92 +		"want to allow this in your system!"));
   15.93 +		
   15.94 +	}
   15.95 +}
   15.96 +
   15.97 +void ExportXHTMLDialog::destroy()
   15.98 +{
   15.99 +	delete (dia);
  15.100 +}
  15.101 +
  15.102 +void ExportXHTMLDialog::dirChanged()
  15.103 +{
  15.104 +	dir=lineEditDir->text();
  15.105 +	if (dir.right(1)!="/")
  15.106 +		dir+="/";
  15.107 +	settingsChanged=true;
  15.108 +}
  15.109 +
  15.110 +void ExportXHTMLDialog::browseDirectoryPressed()
  15.111 +{
  15.112 +   	QFileDialog fd( this, tr("VYM - Export HTML to directory"));
  15.113 +	fd.setMode (QFileDialog::DirectoryOnly);
  15.114 +	fd.setCaption(tr("VYM - Export HTML to directory"));
  15.115 +	fd.setModal (true);
  15.116 +	fd.show();
  15.117 +
  15.118 +	if ( fd.exec() == QDialog::Accepted )
  15.119 +	{
  15.120 +		dir=fd.selectedFile();
  15.121 +		lineEditDir->setText (dir );
  15.122 +		settingsChanged=true;
  15.123 +	}
  15.124 +}
  15.125 +
  15.126 +void ExportXHTMLDialog::imageButtonPressed(bool b)
  15.127 +{
  15.128 +	useImage=b;
  15.129 +	settingsChanged=true;
  15.130 +}
  15.131 +
  15.132 +void ExportXHTMLDialog::textcolorButtonPressed(bool b)
  15.133 +{
  15.134 +	useTextColor=b;	
  15.135 +	settingsChanged=true;
  15.136 +}
  15.137 +
  15.138 +void ExportXHTMLDialog::saveSettingsInMapButtonPressed(bool b)
  15.139 +{
  15.140 +	saveSettingsInMap=b;	
  15.141 +	settingsChanged=true;
  15.142 +}
  15.143 +
  15.144 +void ExportXHTMLDialog::warningsButtonPressed(bool b)
  15.145 +{
  15.146 +	showWarnings=b;
  15.147 +	settingsChanged=true;
  15.148 +}
  15.149 +
  15.150 +
  15.151 +void ExportXHTMLDialog::outputButtonPressed(bool b)
  15.152 +{
  15.153 +	showOutput=b;
  15.154 +	settingsChanged=true;
  15.155 +}
  15.156 +
  15.157 +void ExportXHTMLDialog::cssChanged()
  15.158 +{
  15.159 +	css=lineEditCSS->text();
  15.160 +	settingsChanged=true;
  15.161 +}
  15.162 +
  15.163 +void ExportXHTMLDialog::browseCSSPressed()
  15.164 +{
  15.165 +   	QFileDialog fd( this, tr("VYM - Path to CSS file"));
  15.166 +	fd.setModal (true);
  15.167 +	fd.addFilter ("Cascading Stylesheet (*.css)");
  15.168 +	fd.show();
  15.169 +
  15.170 +	if ( fd.exec() == QDialog::Accepted )
  15.171 +	{
  15.172 +		css=fd.selectedFile();
  15.173 +		lineEditCSS->setText (css );
  15.174 +		settingsChanged=true;
  15.175 +	}
  15.176 +}
  15.177 +
  15.178 +void ExportXHTMLDialog::xslChanged()
  15.179 +{
  15.180 +	xsl=lineEditXSL->text();
  15.181 +	settingsChanged=true;
  15.182 +}
  15.183 +
  15.184 +void ExportXHTMLDialog::prescriptChanged()
  15.185 +{
  15.186 +	prescript=lineEditPreScript->text();
  15.187 +	settingsChanged=true;
  15.188 +}
  15.189 +
  15.190 +void ExportXHTMLDialog::browseXSLPressed()
  15.191 +{
  15.192 +   	QFileDialog fd( this, tr("VYM - Path to XSL file"));
  15.193 +	fd.setModal (true);
  15.194 +	fd.addFilter ("Extensible Styleshee Language (*.xsl)");
  15.195 +	fd.show();
  15.196 +
  15.197 +	if ( fd.exec() == QDialog::Accepted )
  15.198 +	{
  15.199 +		xsl=fd.selectedFile();
  15.200 +		lineEditXSL->setText (xsl );
  15.201 +		settingsChanged=true;
  15.202 +	}
  15.203 +}
  15.204 +
  15.205 +void ExportXHTMLDialog::postscriptChanged()
  15.206 +{
  15.207 +	postscript=lineEditPostScript->text();
  15.208 +	settingsChanged=true;
  15.209 +}
  15.210 +
  15.211 +void ExportXHTMLDialog::browsePreExportButtonPressed()
  15.212 +{
  15.213 +	QFileDialog fd( this, tr("VYM - Path to pre export script"));
  15.214 +	fd.setModal (true);
  15.215 +	fd.addFilter ("Scripts (*.sh *.pl *.py *.php)");
  15.216 +	fd.show();
  15.217 +
  15.218 +	if ( fd.exec() == QDialog::Accepted )
  15.219 +	{
  15.220 +		prescript=fd.selectedFile();
  15.221 +		lineEditPreScript->setText (prescript );
  15.222 +		settingsChanged=true;
  15.223 +	}
  15.224 +
  15.225 +}
  15.226 +
  15.227 +void ExportXHTMLDialog::browsePostExportButtonPressed()
  15.228 +{
  15.229 +	QFileDialog fd( this, tr("VYM - Path to post export script"));
  15.230 +	fd.setModal (true);
  15.231 +	fd.addFilter ("Scripts (*.sh *.pl *.py *.php)");
  15.232 +	fd.show();
  15.233 +
  15.234 +	if ( fd.exec() == QDialog::Accepted )
  15.235 +	{
  15.236 +		postscript=fd.selectedFile();
  15.237 +		lineEditPostScript->setText (postscript );
  15.238 +		settingsChanged=true;
  15.239 +	}
  15.240 +}
  15.241 +
  15.242 +
  15.243 +void ExportXHTMLDialog::doExport (const QString &mapname)
  15.244 +{
  15.245 +	// Save options to settings file 
  15.246 +	// (but don't save at destructor, which
  15.247 +	// is called for "cancel", too)
  15.248 +	settings.setLocalEntry (filepath,"/vym/export/xhtml/exportDir",dir);
  15.249 +
  15.250 +	settings.setLocalEntry (filepath,"/vym/export/xhtml/prescript",prescript);
  15.251 +	settings.setLocalEntry (filepath,"/vym/export/xhtml/postscript",postscript);
  15.252 +
  15.253 +    if (useImage)
  15.254 +		settings.setLocalEntry (filepath,"/vym/export/xhtml/useImage","yes");
  15.255 +    else
  15.256 +		settings.setLocalEntry (filepath,"/vym/export/xhtml/useImage","no");	
  15.257 +	
  15.258 +  if (useTextColor)
  15.259 +		settings.setLocalEntry (filepath,"/vym/export/xhtml/useTextColor","yes");
  15.260 +    else
  15.261 +		settings.setLocalEntry (filepath,"/vym/export/xhtml/useTextColor","no");	
  15.262 +	
  15.263 +   if (showWarnings)
  15.264 +		settings.writeEntry ("/vym/export/xhtml/showWarnings","yes");
  15.265 +    else
  15.266 +		settings.writeEntry ("/vym/export/xhtml/showWarnings","no");	
  15.267 +			
  15.268 +	if (showOutput)
  15.269 +		settings.writeEntry ("/vym/export/xhtml/showOutput","yes");
  15.270 +	else
  15.271 +		settings.writeEntry ("/vym/export/xhtml/showOutput","no");	
  15.272 +		
  15.273 +	settings.setLocalEntry 
  15.274 +		(filepath,"/vym/export/xhtml/xsl",xsl);
  15.275 +	settings.setLocalEntry 
  15.276 +		(filepath,"/vym/export/xhtml/css",css);	
  15.277 +
  15.278 +	//FIXME add option for url image (globe flag) here	
  15.279 +	if (true) 
  15.280 +	{	
  15.281 +		QPixmap pm (flag_url_xpm);
  15.282 +		pm.save (dir + "/flags/url.png","PNG");
  15.283 +	}
  15.284 +
  15.285 +	if (!saveSettingsInMap)
  15.286 +		settings.clearLocal("/vym/export/xhtml");
  15.287 +	else	
  15.288 +		settings.setLocalEntry 
  15.289 +			(filepath,"/vym/export/xhtml/saveSettingsInMap","yes");
  15.290 +
  15.291 +	// Copy CSS file
  15.292 +	QFile css_src (css);
  15.293 +	QFile css_dst (dir+"vym.css");
  15.294 +	if (!css_src.open ( IO_ReadOnly))
  15.295 +		QMessageBox::warning( 0, tr( "Warning" ),css +tr(" could not be opened!"));
  15.296 +	else
  15.297 +	{
  15.298 +		if (!css_dst.open( IO_WriteOnly))
  15.299 +			QMessageBox::warning( 0, tr( "Warning" ), dir+"vym.css" +tr(" could not be opened!"));
  15.300 +		else
  15.301 +		{	
  15.302 +		
  15.303 +			QTextStream tsout( &css_dst);
  15.304 +			QTextStream tsin ( &css_src);
  15.305 +			QString s= tsin.read();
  15.306 +			tsout << s;
  15.307 +			css_dst.close();
  15.308 +		}	
  15.309 +		css_src.close();
  15.310 +	}
  15.311 +
  15.312 +	if (!prescript.isEmpty()) runScript (prescript,dir+mapname+".xml");
  15.313 +	
  15.314 +	Process *xsltProc=new Process ();
  15.315 +	xsltProc->clearArguments();
  15.316 +	xsltProc->addArgument (xsltprocessor);	
  15.317 +	if (useImage)
  15.318 +	{
  15.319 +		xsltProc->addArgument ("--stringparam");
  15.320 +		xsltProc->addArgument ("imagemap");
  15.321 +		xsltProc->addArgument ("images/"+mapname+".png");
  15.322 +	}	
  15.323 +	if (useTextColor)
  15.324 +	{
  15.325 +		xsltProc->addArgument ("--stringparam");
  15.326 +		xsltProc->addArgument ("use.textcolor");
  15.327 +		xsltProc->addArgument ("1");
  15.328 +	}	
  15.329 +	xsltProc->addArgument ("--stringparam");
  15.330 +	xsltProc->addArgument ("mapname");
  15.331 +	xsltProc->addArgument (mapname+".vym");
  15.332 +	
  15.333 +	xsltProc->addArgument ("--output");
  15.334 +	xsltProc->addArgument (dir+mapname+".html");
  15.335 +	xsltProc->addArgument (xsl);
  15.336 +	xsltProc->addArgument (dir+mapname+".xml");
  15.337 +	dia->append ("vym is executing: \n" + xsltProc->arguments().join(" ") );	
  15.338 +	if (!xsltProc->start() )
  15.339 +	{
  15.340 +		QMessageBox::critical( 0, tr( "Critical Error" ),
  15.341 +					   tr("Couldn't start ") + xsltprocessor );
  15.342 +	} else
  15.343 +	{
  15.344 +		xsltProc->waitFinished();
  15.345 +		if (!xsltProc->normalExit() )
  15.346 +			QMessageBox::critical( 0, tr( "Critical Error" ),
  15.347 +			   xsltprocessor +" " +tr("didn't exit normally") +
  15.348 +			   xsltProc->getErrout() );
  15.349 +		else
  15.350 +			if (xsltProc->exitStatus()>0) showOutput=true;
  15.351 +			
  15.352 +	}	
  15.353 +	dia->append ("\n");
  15.354 +	dia->append (xsltProc->getErrout());
  15.355 +	dia->append (xsltProc->getStdout());
  15.356 +	
  15.357 +	if (!postscript.isEmpty()) runScript (postscript,dir+mapname+".html");
  15.358 +
  15.359 +	if (showOutput) dia->exec();
  15.360 +}
  15.361 +
  15.362 +void ExportXHTMLDialog::setFilePath(const QString &s)
  15.363 +{
  15.364 +	filepath=s;
  15.365 +}
  15.366 +
  15.367 +void ExportXHTMLDialog::setMapName(const QString &s)
  15.368 +{
  15.369 +	mapname=s;
  15.370 +}
  15.371 +
  15.372 +QString ExportXHTMLDialog::getDir()
  15.373 +{
  15.374 +	return dir;
  15.375 +}
  15.376 +
  15.377 +bool ExportXHTMLDialog::warnings()
  15.378 +{
  15.379 +	return showWarnings;
  15.380 +}
  15.381 +
  15.382 +bool ExportXHTMLDialog::hasChanged()
  15.383 +{
  15.384 +	return settingsChanged;
  15.385 +}
  15.386 +
  15.387 +
  15.388 +void ExportXHTMLDialog::runScript(QString spath, QString fpath)
  15.389 +{
  15.390 +	spath.replace ("%f",fpath);
  15.391 +	QStringList args=QStringList::split (' ',spath,false);
  15.392 +		
  15.393 +	Process *scriptProc=new Process ();
  15.394 +	scriptProc->clearArguments();
  15.395 +	scriptProc->setArguments (args);	
  15.396 +	dia->append ("vym is executing: \n" + scriptProc->arguments().join(" ") );	
  15.397 +	if (!scriptProc->start() )
  15.398 +	{
  15.399 +		QMessageBox::critical( 0, tr( "Critical Error" ),
  15.400 +					   tr("Couldn't start ") + spath );
  15.401 +	} else
  15.402 +	{
  15.403 +		scriptProc->waitFinished();
  15.404 +		if (!scriptProc->normalExit() )
  15.405 +			QMessageBox::critical( 0, tr( "Critical Error" ),
  15.406 +			   spath +" " +tr("didn't exit normally") +
  15.407 +			   scriptProc->getErrout() );
  15.408 +		else
  15.409 +			if (scriptProc->exitStatus()>0) showOutput=true;
  15.410 +			
  15.411 +	}	
  15.412 +	dia->append ("\n");
  15.413 +	dia->append (scriptProc->getErrout());
  15.414 +	dia->append (scriptProc->getStdout());
  15.415 +}
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/extrainfodialog.ui	Sun Jan 30 12:59:10 2005 +0000
    16.3 @@ -0,0 +1,204 @@
    16.4 +<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
    16.5 +<class>ExtraInfoDialog</class>
    16.6 +<author>Uwe Drechsel</author>
    16.7 +<widget class="QDialog">
    16.8 +    <property name="name">
    16.9 +        <cstring>ExtraInfoDialog</cstring>
   16.10 +    </property>
   16.11 +    <property name="geometry">
   16.12 +        <rect>
   16.13 +            <x>0</x>
   16.14 +            <y>0</y>
   16.15 +            <width>338</width>
   16.16 +            <height>410</height>
   16.17 +        </rect>
   16.18 +    </property>
   16.19 +    <property name="caption">
   16.20 +        <string>VYM - Info</string>
   16.21 +    </property>
   16.22 +    <vbox>
   16.23 +        <property name="name">
   16.24 +            <cstring>unnamed</cstring>
   16.25 +        </property>
   16.26 +        <widget class="QLabel">
   16.27 +            <property name="name">
   16.28 +                <cstring>textLabel1_2</cstring>
   16.29 +            </property>
   16.30 +            <property name="text">
   16.31 +                <string>Map:</string>
   16.32 +            </property>
   16.33 +        </widget>
   16.34 +        <widget class="QLineEdit">
   16.35 +            <property name="name">
   16.36 +                <cstring>lineEdit7</cstring>
   16.37 +            </property>
   16.38 +            <property name="paletteBackgroundColor">
   16.39 +                <color>
   16.40 +                    <red>225</red>
   16.41 +                    <green>225</green>
   16.42 +                    <blue>225</blue>
   16.43 +                </color>
   16.44 +            </property>
   16.45 +            <property name="backgroundOrigin">
   16.46 +                <enum>WidgetOrigin</enum>
   16.47 +            </property>
   16.48 +            <property name="readOnly">
   16.49 +                <bool>true</bool>
   16.50 +            </property>
   16.51 +        </widget>
   16.52 +        <widget class="QLabel">
   16.53 +            <property name="name">
   16.54 +                <cstring>textLabel1</cstring>
   16.55 +            </property>
   16.56 +            <property name="text">
   16.57 +                <string>Author:</string>
   16.58 +            </property>
   16.59 +        </widget>
   16.60 +        <widget class="QLineEdit">
   16.61 +            <property name="name">
   16.62 +                <cstring>lineEdit2</cstring>
   16.63 +            </property>
   16.64 +        </widget>
   16.65 +        <widget class="QLabel">
   16.66 +            <property name="name">
   16.67 +                <cstring>textLabel2</cstring>
   16.68 +            </property>
   16.69 +            <property name="text">
   16.70 +                <string>Comment:</string>
   16.71 +            </property>
   16.72 +        </widget>
   16.73 +        <widget class="QTextEdit">
   16.74 +            <property name="name">
   16.75 +                <cstring>textEdit4</cstring>
   16.76 +            </property>
   16.77 +            <property name="sizePolicy">
   16.78 +                <sizepolicy>
   16.79 +                    <hsizetype>7</hsizetype>
   16.80 +                    <vsizetype>4</vsizetype>
   16.81 +                    <horstretch>0</horstretch>
   16.82 +                    <verstretch>0</verstretch>
   16.83 +                </sizepolicy>
   16.84 +            </property>
   16.85 +            <property name="maximumSize">
   16.86 +                <size>
   16.87 +                    <width>32767</width>
   16.88 +                    <height>76</height>
   16.89 +                </size>
   16.90 +            </property>
   16.91 +        </widget>
   16.92 +        <widget class="QLabel">
   16.93 +            <property name="name">
   16.94 +                <cstring>textLabel2_2</cstring>
   16.95 +            </property>
   16.96 +            <property name="text">
   16.97 +                <string>Statistics:</string>
   16.98 +            </property>
   16.99 +        </widget>
  16.100 +        <widget class="QTextEdit">
  16.101 +            <property name="name">
  16.102 +                <cstring>textEdit4_2</cstring>
  16.103 +            </property>
  16.104 +            <property name="paletteBackgroundColor">
  16.105 +                <color>
  16.106 +                    <red>225</red>
  16.107 +                    <green>225</green>
  16.108 +                    <blue>225</blue>
  16.109 +                </color>
  16.110 +            </property>
  16.111 +            <property name="font">
  16.112 +                <font>
  16.113 +                    <family>Courier</family>
  16.114 +                    <pointsize>12</pointsize>
  16.115 +                </font>
  16.116 +            </property>
  16.117 +            <property name="textFormat">
  16.118 +                <enum>PlainText</enum>
  16.119 +            </property>
  16.120 +            <property name="readOnly">
  16.121 +                <bool>true</bool>
  16.122 +            </property>
  16.123 +        </widget>
  16.124 +        <widget class="QLayoutWidget">
  16.125 +            <property name="name">
  16.126 +                <cstring>layout21</cstring>
  16.127 +            </property>
  16.128 +            <hbox>
  16.129 +                <property name="name">
  16.130 +                    <cstring>unnamed</cstring>
  16.131 +                </property>
  16.132 +                <spacer>
  16.133 +                    <property name="name">
  16.134 +                        <cstring>spacer10</cstring>
  16.135 +                    </property>
  16.136 +                    <property name="orientation">
  16.137 +                        <enum>Horizontal</enum>
  16.138 +                    </property>
  16.139 +                    <property name="sizeType">
  16.140 +                        <enum>Expanding</enum>
  16.141 +                    </property>
  16.142 +                    <property name="sizeHint">
  16.143 +                        <size>
  16.144 +                            <width>160</width>
  16.145 +                            <height>21</height>
  16.146 +                        </size>
  16.147 +                    </property>
  16.148 +                </spacer>
  16.149 +                <widget class="QPushButton">
  16.150 +                    <property name="name">
  16.151 +                        <cstring>pushButton13</cstring>
  16.152 +                    </property>
  16.153 +                    <property name="text">
  16.154 +                        <string>Cancel</string>
  16.155 +                    </property>
  16.156 +                </widget>
  16.157 +                <widget class="QPushButton">
  16.158 +                    <property name="name">
  16.159 +                        <cstring>pushButton7</cstring>
  16.160 +                    </property>
  16.161 +                    <property name="text">
  16.162 +                        <string>Close</string>
  16.163 +                    </property>
  16.164 +                </widget>
  16.165 +            </hbox>
  16.166 +        </widget>
  16.167 +    </vbox>
  16.168 +</widget>
  16.169 +<connections>
  16.170 +    <connection>
  16.171 +        <sender>pushButton7</sender>
  16.172 +        <signal>clicked()</signal>
  16.173 +        <receiver>ExtraInfoDialog</receiver>
  16.174 +        <slot>accept()</slot>
  16.175 +    </connection>
  16.176 +    <connection>
  16.177 +        <sender>pushButton13</sender>
  16.178 +        <signal>clicked()</signal>
  16.179 +        <receiver>ExtraInfoDialog</receiver>
  16.180 +        <slot>reject()</slot>
  16.181 +    </connection>
  16.182 +</connections>
  16.183 +<tabstops>
  16.184 +    <tabstop>lineEdit2</tabstop>
  16.185 +    <tabstop>textEdit4</tabstop>
  16.186 +    <tabstop>pushButton7</tabstop>
  16.187 +    <tabstop>pushButton13</tabstop>
  16.188 +    <tabstop>lineEdit7</tabstop>
  16.189 +    <tabstop>textEdit4_2</tabstop>
  16.190 +</tabstops>
  16.191 +<includes>
  16.192 +    <include location="global" impldecl="in implementation">qstring.h</include>
  16.193 +    <include location="local" impldecl="in implementation">extrainfodialog.ui.h</include>
  16.194 +</includes>
  16.195 +<slots>
  16.196 +    <slot>setMapName( const QString &amp; s )</slot>
  16.197 +    <slot>setComment( const QString &amp; s )</slot>
  16.198 +    <slot>setAuthor( const QString &amp; s )</slot>
  16.199 +</slots>
  16.200 +<functions>
  16.201 +    <function returnType="QString">getComment()</function>
  16.202 +    <function returnType="QString">getAuthor()</function>
  16.203 +    <function>setStats( const QString &amp; s )</function>
  16.204 +</functions>
  16.205 +<pixmapinproject/>
  16.206 +<layoutdefaults spacing="6" margin="11"/>
  16.207 +</UI>
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/extrainfodialog.ui.h	Sun Jan 30 12:59:10 2005 +0000
    17.3 @@ -0,0 +1,39 @@
    17.4 +/****************************************************************************
    17.5 +** ui.h extension file, included from the uic-generated form implementation.
    17.6 +**
    17.7 +** If you wish to add, delete or rename functions or slots use
    17.8 +** Qt Designer which will update this file, preserving your code. Create an
    17.9 +** init() function in place of a constructor, and a destroy() function in
   17.10 +** place of a destructor.
   17.11 +*****************************************************************************/
   17.12 +
   17.13 +void ExtraInfoDialog::setMapName(const QString &s)
   17.14 +{
   17.15 +	lineEdit7->setText (s);
   17.16 +}
   17.17 +
   17.18 +void ExtraInfoDialog::setComment (const QString &s)
   17.19 +{
   17.20 +	textEdit4->setText (s);
   17.21 +}
   17.22 +
   17.23 +QString ExtraInfoDialog::getComment()
   17.24 +{
   17.25 +	return textEdit4->text();
   17.26 +}	
   17.27 +
   17.28 +
   17.29 +void ExtraInfoDialog::setAuthor(const QString &s)
   17.30 +{
   17.31 +	lineEdit2->setText (s);
   17.32 +}
   17.33 +
   17.34 +QString ExtraInfoDialog::getAuthor()
   17.35 +{
   17.36 +	return lineEdit2->text();
   17.37 +}
   17.38 +
   17.39 +void ExtraInfoDialog::setStats(const QString &s)
   17.40 +{
   17.41 +	textEdit4_2->setText (s);
   17.42 +}
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/findwindow.cpp	Sun Jan 30 12:59:10 2005 +0000
    18.3 @@ -0,0 +1,85 @@
    18.4 +#include <qlineedit.h>
    18.5 +
    18.6 +#include "findwindow.h"
    18.7 +
    18.8 +
    18.9 +FindWindow::FindWindow(QWidget* parent, const char* name, WFlags f) 
   18.10 +	: QGroupBox( 0, Horizontal, "Find", parent, name )
   18.11 +
   18.12 +{
   18.13 +	setCaption ("VYM - Find Text");
   18.14 +	//resize (180,130);
   18.15 +	move (130,130);
   18.16 +
   18.17 +	setMargin( 100 );
   18.18 +
   18.19 +    QVBoxLayout* box = new QVBoxLayout( layout() );
   18.20 +    
   18.21 +    QHBoxLayout *row1 = new QHBoxLayout( box );
   18.22 +    row1->setMargin( 10 );
   18.23 +
   18.24 +    // Create a Label
   18.25 +    QLabel* label = new QLabel( "Text to find: ", this);
   18.26 +    row1->addWidget( label );
   18.27 +
   18.28 +	// Create LineEdit (here QComboBox)
   18.29 +    QHBoxLayout *row2 = new QHBoxLayout( box );
   18.30 +    row2->setMargin( 10 );
   18.31 +    findcombo = new QComboBox( true, this );
   18.32 +	findcombo->setMinimumWidth(150);
   18.33 +    row2->addWidget( findcombo );
   18.34 +	connect ( findcombo, SIGNAL( highlighted(int) ), 
   18.35 +		this, SLOT( findPressed() ) );
   18.36 +	connect ( findcombo, SIGNAL( textChanged(const QString &) ), 
   18.37 +		this, SLOT( findTextChanged(const QString&) ) );
   18.38 +    //findcombo->insertItem( "Normal", -1 );
   18.39 +
   18.40 +	// Create Buttons
   18.41 +    QHBoxLayout *row3 = new QHBoxLayout( box );
   18.42 +    row3->setMargin( 10 );
   18.43 +	clearbutton = new QPushButton (tr("Clear"),this);
   18.44 +	connect ( clearbutton, SIGNAL( clicked() ), 
   18.45 +		findcombo, SLOT( clearEdit() ) );
   18.46 +	row3->addWidget (clearbutton);
   18.47 +	
   18.48 +	QSpacerItem *si1= new QSpacerItem (10,0,QSizePolicy::Minimum, QSizePolicy::Expanding );
   18.49 +	row3->addItem(si1);
   18.50 +	
   18.51 +	cancelbutton = new QPushButton (tr("Cancel"),this);
   18.52 +	cancelbutton->setAccel (Key_Escape);
   18.53 +	connect ( cancelbutton, SIGNAL( clicked() ), 
   18.54 +		this, SLOT( cancelPressed() ) );
   18.55 +	row3->addWidget (cancelbutton);
   18.56 +
   18.57 +	QSpacerItem *si2= new QSpacerItem (10,0,QSizePolicy::Fixed, QSizePolicy::Fixed);
   18.58 +	row3->addItem(si2);
   18.59 +	
   18.60 +	findbutton = new QPushButton (tr("Find"),this);
   18.61 +	findbutton->setDefault (true);
   18.62 +	connect ( findbutton, SIGNAL( clicked() ), 
   18.63 +		this, SLOT( findPressed() ) );
   18.64 +	row3->add(findbutton);
   18.65 +	
   18.66 +	findcombo->setFocus();
   18.67 +}
   18.68 +
   18.69 +void FindWindow::popup()
   18.70 +{
   18.71 +	findcombo->lineEdit()->selectAll();
   18.72 +	show();
   18.73 +}
   18.74 +
   18.75 +void FindWindow::cancelPressed()
   18.76 +{
   18.77 +	hide();
   18.78 +}
   18.79 +
   18.80 +void FindWindow::findPressed()
   18.81 +{
   18.82 +	emit (findButton(findcombo->currentText() ) );
   18.83 +}
   18.84 +
   18.85 +void FindWindow::findTextChanged(const QString&)
   18.86 +{
   18.87 +	emit (somethingChanged() );
   18.88 +}
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/findwindow.h	Sun Jan 30 12:59:10 2005 +0000
    19.3 @@ -0,0 +1,38 @@
    19.4 +#ifndef FINDWINDOW_H 
    19.5 +#define FINDWINDOW_H
    19.6 +
    19.7 +#include <qmainwindow.h>
    19.8 +#include <qcombobox.h>
    19.9 +#include <qpushbutton.h>
   19.10 +#include <qgroupbox.h>
   19.11 +#include <qlayout.h>
   19.12 +#include <qlabel.h>
   19.13 +
   19.14 +
   19.15 +class FindWindow : public QGroupBox
   19.16 +{
   19.17 +	Q_OBJECT
   19.18 +
   19.19 +public:
   19.20 +	FindWindow (QWidget* parent=0, const char* namme=0, WFlags f=0);
   19.21 +
   19.22 +public slots:	
   19.23 +	void popup();
   19.24 +	void cancelPressed();
   19.25 +	void findPressed();
   19.26 +	void findTextChanged(const QString&);
   19.27 +
   19.28 +signals:
   19.29 +	void findButton(QString);		// emit to mainwindow
   19.30 +	void somethingChanged();	// emit to mainwindow
   19.31 +
   19.32 +private:
   19.33 +	QGroupBox *findbox;
   19.34 +	QComboBox *findcombo;
   19.35 +	QPushButton *clearbutton;
   19.36 +	QPushButton *findbutton;
   19.37 +	QPushButton *cancelbutton;
   19.38 +};
   19.39 +
   19.40 +
   19.41 +#endif
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/flagobj.cpp	Sun Jan 30 12:59:10 2005 +0000
    20.3 @@ -0,0 +1,201 @@
    20.4 +#include "flagobj.h"
    20.5 +
    20.6 +/////////////////////////////////////////////////////////////////
    20.7 +// FlagObj
    20.8 +/////////////////////////////////////////////////////////////////
    20.9 +FlagObj::FlagObj()
   20.10 +{
   20.11 +//    cout << "Const FlagObj ()\n";
   20.12 +    init ();
   20.13 +}
   20.14 +
   20.15 +FlagObj::FlagObj(QCanvas* c):MapObj(c) 
   20.16 +{
   20.17 +//    cout << "Const FlagObj\n";
   20.18 +    init ();
   20.19 +}
   20.20 +
   20.21 +FlagObj::FlagObj (FlagObj* io)
   20.22 +{
   20.23 +    copy (io);
   20.24 +}
   20.25 +
   20.26 +FlagObj::~FlagObj()
   20.27 +{
   20.28 +//    cout << "Destr FlagObj  " << name << "\n";
   20.29 +	delete (icon);
   20.30 +}
   20.31 +
   20.32 +
   20.33 +void FlagObj::init ()
   20.34 +{
   20.35 +	name="undefined";
   20.36 +
   20.37 +	icon=new ImageObj (canvas);
   20.38 +	icon->move (absPos.x(), absPos.y() );
   20.39 +	button=NULL;
   20.40 +	state=false;
   20.41 +}
   20.42 +
   20.43 +void FlagObj::copy (FlagObj* other)
   20.44 +{
   20.45 +    MapObj::copy(other);
   20.46 +	name=other->name;
   20.47 +	tooltip=other->tooltip;
   20.48 +	state=other->state;
   20.49 +	icon->copy(other->icon);
   20.50 +	setVisibility (other->isVisibleObj() );
   20.51 +	// button is not copied, because
   20.52 +	// we won't copy to a parentRow and
   20.53 +	// all others don't need a button
   20.54 +}
   20.55 +
   20.56 +void FlagObj::move(double x, double y)
   20.57 +{
   20.58 +    MapObj::move(x,y);
   20.59 +	icon->move(x,y);
   20.60 +	positionBBox();
   20.61 +}
   20.62 +
   20.63 +void FlagObj::moveBy(double x, double y)
   20.64 +{
   20.65 +    move (x+absPos.x(),y+absPos.y() );
   20.66 +}
   20.67 +
   20.68 +void FlagObj::setVisibility (bool v)
   20.69 +{
   20.70 +    MapObj::setVisibility(v);
   20.71 +	if (v && state)
   20.72 +	    icon->setVisibility(true);
   20.73 +	else
   20.74 +	    icon->setVisibility(false);
   20.75 +}
   20.76 +
   20.77 +void FlagObj::load (const QString &fn)
   20.78 +{
   20.79 +	icon->load(fn);
   20.80 +	calcBBoxSize();
   20.81 +	positionBBox();
   20.82 +}
   20.83 +
   20.84 +void FlagObj::load (const QPixmap &pm)
   20.85 +{
   20.86 +	icon->load(pm);
   20.87 +	calcBBoxSize();
   20.88 +	positionBBox();
   20.89 +}
   20.90 +
   20.91 +void FlagObj::setName(const QString &n)
   20.92 +{
   20.93 +	name=n;
   20.94 +}
   20.95 +
   20.96 +const QString FlagObj::getName()
   20.97 +{
   20.98 +	return name;
   20.99 +}
  20.100 +
  20.101 +void FlagObj::setToolTip(const QString &n)
  20.102 +{
  20.103 +	tooltip=n;
  20.104 +}
  20.105 +
  20.106 +const QString FlagObj::getToolTip()
  20.107 +{
  20.108 +	return tooltip;
  20.109 +}
  20.110 +
  20.111 +void FlagObj::setButton(QAction* b)
  20.112 +{
  20.113 +    button=b;
  20.114 +}
  20.115 +
  20.116 +void FlagObj::updateButton()
  20.117 +{
  20.118 +	if (button)
  20.119 +		button->setOn(state);
  20.120 +	else
  20.121 +		qWarning ("FlagObj::updateButton  no button defined");
  20.122 +}
  20.123 +
  20.124 +QPixmap FlagObj::getPixmap()
  20.125 +{
  20.126 +	return icon->getPixmap();
  20.127 +}
  20.128 +
  20.129 +bool FlagObj::isActive()
  20.130 +{
  20.131 +	return state;
  20.132 +}
  20.133 +
  20.134 +void FlagObj::toggle()
  20.135 +{
  20.136 +	if (state)
  20.137 +		deactivate();
  20.138 +	else
  20.139 +		activate();
  20.140 +}
  20.141 +
  20.142 +void FlagObj::activate()
  20.143 +{
  20.144 +	state=true;
  20.145 +	// only show icon, if flag itself is visible 
  20.146 +	if (visible) 
  20.147 +	{
  20.148 +		icon->setVisibility (true);
  20.149 +		calcBBoxSize();
  20.150 +	}	
  20.151 +}
  20.152 +
  20.153 +void FlagObj::deactivate()
  20.154 +{
  20.155 +	state=false;
  20.156 +	// if flag itself is invisible we don't need to call 
  20.157 +	if (visible) 
  20.158 +	{
  20.159 +		icon->setVisibility (false);
  20.160 +		calcBBoxSize();
  20.161 +	}	
  20.162 +}
  20.163 +
  20.164 +void FlagObj::setEnabled(bool b)
  20.165 +{
  20.166 +	button->setEnabled (b);
  20.167 +}	
  20.168 +	
  20.169 +
  20.170 +void FlagObj::setUsed (bool b)
  20.171 +{
  20.172 +	used=b;
  20.173 +}
  20.174 +
  20.175 +bool FlagObj::isUsed()
  20.176 +{
  20.177 +	return used;
  20.178 +}
  20.179 +
  20.180 +void FlagObj::saveToDir (const QString &tmpdir, const QString &prefix)
  20.181 +{
  20.182 +	QString fn=tmpdir + prefix + name + ".png";
  20.183 +	icon->save (fn,"PNG");
  20.184 +}
  20.185 +
  20.186 +void FlagObj::positionBBox()
  20.187 +{
  20.188 +    bbox.setX (absPos.x() );
  20.189 +    bbox.setY (absPos.y() );
  20.190 +}
  20.191 +
  20.192 +void FlagObj::calcBBoxSize()
  20.193 +{
  20.194 +	if (visible && state)
  20.195 +	{
  20.196 +		bbox.setSize (	QSize(
  20.197 +			icon->boundingRect().width(), 
  20.198 +			icon->boundingRect().height() ) );
  20.199 +	} else
  20.200 +	{
  20.201 +		bbox.setSize (QSize(0,0));
  20.202 +	}
  20.203 +}
  20.204 +
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/flagobj.h	Sun Jan 30 12:59:10 2005 +0000
    21.3 @@ -0,0 +1,53 @@
    21.4 +#ifndef FLAGOBJ_H
    21.5 +#define FLAGOBJ_H
    21.6 +
    21.7 +
    21.8 +#include <qcanvas.h>
    21.9 +#include <qaction.h>
   21.10 +
   21.11 +#include "mapobj.h"
   21.12 +#include "imageobj.h"
   21.13 +
   21.14 +/////////////////////////////////////////////////////////////////////////////
   21.15 +class FlagObj:public MapObj {
   21.16 +public:
   21.17 +    FlagObj ();
   21.18 +    FlagObj (QCanvas*);
   21.19 +    FlagObj (FlagObj*);
   21.20 +    ~FlagObj ();
   21.21 +    virtual void init ();
   21.22 +    virtual void copy (FlagObj*);
   21.23 +    virtual void move (double x,double y);      // move to absolute Position
   21.24 +    virtual void moveBy (double x,double y);    // move to relative Position
   21.25 +    virtual void setVisibility(bool);
   21.26 +	void load (const QString&);
   21.27 +	void load (const QPixmap&);
   21.28 +	void setName (const QString&);
   21.29 +	const QString getName ();
   21.30 +	void setToolTip(const QString&);
   21.31 +	const QString getToolTip();
   21.32 +	void setButton (QAction*);
   21.33 +	void updateButton ();
   21.34 +	QPixmap getPixmap();
   21.35 +	bool isActive();
   21.36 +	void toggle();
   21.37 +	void activate();
   21.38 +	void deactivate();
   21.39 +	void setEnabled (bool);
   21.40 +	void setUsed (bool);
   21.41 +	bool isUsed();
   21.42 +	void saveToDir (const QString&, const QString&);
   21.43 +	
   21.44 +protected:	
   21.45 +	QString name;
   21.46 +	QString tooltip;
   21.47 +	bool state;
   21.48 +	bool used;
   21.49 +    virtual void positionBBox();
   21.50 +    virtual void calcBBoxSize();
   21.51 +private:
   21.52 +	ImageObj* icon;
   21.53 +	QAction* button;
   21.54 +};
   21.55 +
   21.56 +#endif
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/flagrowobj.cpp	Sun Jan 30 12:59:10 2005 +0000
    22.3 @@ -0,0 +1,322 @@
    22.4 +#include "flagrowobj.h"
    22.5 +
    22.6 +/////////////////////////////////////////////////////////////////
    22.7 +// FlagRowObj
    22.8 +/////////////////////////////////////////////////////////////////
    22.9 +FlagRowObj::FlagRowObj()
   22.10 +{
   22.11 +    cout << "Const FlagRowObj ()\n";
   22.12 +    init ();
   22.13 +}
   22.14 +
   22.15 +FlagRowObj::FlagRowObj(QCanvas* c):MapObj(c) 
   22.16 +{
   22.17 +//    cout << "Const FlagRowObj\n";
   22.18 +    init ();
   22.19 +}
   22.20 +
   22.21 +FlagRowObj::~FlagRowObj()
   22.22 +{
   22.23 +//    cout << "Destr FlagRowObj\n";
   22.24 +	flag.clear();
   22.25 +}
   22.26 +
   22.27 +void FlagRowObj::init ()
   22.28 +{
   22.29 +    flag.setAutoDelete (true);
   22.30 +	parentRow=NULL;
   22.31 +}
   22.32 +
   22.33 +void FlagRowObj::copy (FlagRowObj* other)
   22.34 +{
   22.35 +    MapObj::copy(other);
   22.36 +	parentRow=other->parentRow;
   22.37 +	flag.clear();
   22.38 +	FlagObj *fo;
   22.39 +    for (fo=other->flag.first(); fo; fo=other->flag.next() )
   22.40 +		addFlag (fo);
   22.41 +}
   22.42 +
   22.43 +void FlagRowObj::clone (FlagRowObj* pr)
   22.44 +{
   22.45 +	// Difference to copy:
   22.46 +	// We don't copy the flags here, they
   22.47 +	// are created on the fly by toggle and activate
   22.48 +	// This saves lots of canvas objects.
   22.49 +	MapObj::copy(pr);
   22.50 +	flag.clear();
   22.51 +	parentRow=pr;
   22.52 +}
   22.53 +
   22.54 +void FlagRowObj::move(double x, double y)
   22.55 +{
   22.56 +    MapObj::move(x,y);
   22.57 +	int dx=0;
   22.58 +	FlagObj *fo;
   22.59 +    for (fo=flag.first(); fo; fo=flag.next() )
   22.60 +	{
   22.61 +		fo->move(x+dx,y);
   22.62 +		dx+=QSize(fo->getSize() ).width();
   22.63 +	}
   22.64 +}
   22.65 +
   22.66 +void FlagRowObj::moveBy(double x, double y)
   22.67 +{
   22.68 +    move (x+absPos.x(),y+absPos.y() );
   22.69 +}
   22.70 +
   22.71 +void FlagRowObj::setVisibility (bool v)
   22.72 +{
   22.73 +	MapObj::setVisibility(v);
   22.74 +	FlagObj *fo;
   22.75 +	for (fo=flag.first(); fo; fo=flag.next() )
   22.76 +		fo->setVisibility (v);
   22.77 +}
   22.78 +
   22.79 +FlagObj* FlagRowObj::addFlag (FlagObj *fo)
   22.80 +{
   22.81 +	FlagObj *newfo=new FlagObj (canvas);
   22.82 +	newfo->move (absPos.x() + bbox.width(), absPos.y() );
   22.83 +	newfo->copy (fo);	// create a deep copy of fo
   22.84 +	flag.append(newfo);
   22.85 +	calcBBoxSize();
   22.86 +	positionBBox();
   22.87 +	return newfo;
   22.88 +}
   22.89 +
   22.90 +void FlagRowObj::positionBBox()
   22.91 +{
   22.92 +    bbox.setX (absPos.x() );
   22.93 +    bbox.setY (absPos.y() );
   22.94 +}
   22.95 +
   22.96 +void FlagRowObj::calcBBoxSize()
   22.97 +{
   22.98 +	QSize size(0,0);
   22.99 +	QSize boxsize(0,0);
  22.100 +	FlagObj *fo;
  22.101 +    for (fo=flag.first(); fo; fo=flag.next() )
  22.102 +	{
  22.103 +		size=fo->getSize();
  22.104 +		// add widths
  22.105 +		boxsize.setWidth(boxsize.width() + size.width() );
  22.106 +		// maximize height
  22.107 +		if (size.height() > boxsize.height() ) 
  22.108 +			boxsize.setHeight(size.height() );
  22.109 +	}
  22.110 +	bbox.setSize (QSize(boxsize.width(), boxsize.height() ));
  22.111 +}
  22.112 +
  22.113 +QString FlagRowObj::getFlagName (const QPoint &p)
  22.114 +{
  22.115 +	if (!inBBox (p)) return "";
  22.116 +	FlagObj *fo;
  22.117 +	for (fo=flag.first();fo; fo=flag.next() )
  22.118 +		if (fo->inBBox (p)) return fo->getName();
  22.119 +	return "";	
  22.120 +
  22.121 +	
  22.122 +}
  22.123 +
  22.124 +bool FlagRowObj::isActive (const QString &foname)
  22.125 +{
  22.126 +	FlagObj *fo=findFlag (foname);
  22.127 +	if (parentRow)
  22.128 +	{
  22.129 +		if (fo)
  22.130 +			return fo->isActive();
  22.131 +		else
  22.132 +			qWarning ("FlagRowObj::isActive of "+name+" couldn't find "+foname);
  22.133 +			
  22.134 +	} else
  22.135 +		if (fo) return true;
  22.136 +	return false;
  22.137 +}
  22.138 +
  22.139 +void FlagRowObj::toggle (const QString &foname)
  22.140 +{
  22.141 +	FlagObj *fo=findFlag (foname);
  22.142 +	if (fo)
  22.143 +	{
  22.144 +		// FlagObj is here, it will be active, too.
  22.145 +		// Deactivate it by removing it from this row.
  22.146 +		flag.remove (fo);
  22.147 +	} else
  22.148 +	{
  22.149 +		// FlagObj is not present in this row.
  22.150 +		// Copy it from parentRow
  22.151 +		fo=parentRow->findFlag (foname);
  22.152 +		if (fo)
  22.153 +		{
  22.154 +			fo=addFlag (fo);
  22.155 +			fo->activate();
  22.156 +		} else
  22.157 +			qWarning ("FlagRowObj ("+name+")::toggle ("+foname+")  failed - could not find it in parentRow");
  22.158 +	}	
  22.159 +	calcBBoxSize();
  22.160 +	positionBBox();	
  22.161 +}
  22.162 +
  22.163 +void FlagRowObj::activate (const QString &foname)
  22.164 +{
  22.165 +	FlagObj *fo=findFlag (foname);
  22.166 +	if (parentRow)
  22.167 +	{
  22.168 +		if (!fo)
  22.169 +		{
  22.170 +			// FlagObj is not present in this row.
  22.171 +			// Copy it from parentRow and activate there
  22.172 +			fo=parentRow->findFlag (foname);
  22.173 +			if (fo)
  22.174 +			{
  22.175 +				fo=addFlag (fo);
  22.176 +				fo->activate();
  22.177 +				fo->setVisibility (visible);
  22.178 +				calcBBoxSize();
  22.179 +				positionBBox();
  22.180 +			} else
  22.181 +				qWarning ("FlagRowObj ("+name+")::activate ("+foname+")  failed - could not find it in parentRow");
  22.182 +		}	
  22.183 +	} else
  22.184 +	{
  22.185 +		// I am the parentRow, mark flag as used
  22.186 +		if (fo)
  22.187 +		{
  22.188 +			fo->setUsed(true);
  22.189 +			fo->activate();
  22.190 +		}	
  22.191 +		else
  22.192 +			qWarning ("FlagRowObj::activate no FlagObj \""+foname+"\" found in parentRow");
  22.193 +	}
  22.194 +}
  22.195 +
  22.196 +void FlagRowObj::deactivate (const QString &foname)
  22.197 +{
  22.198 +	FlagObj *fo=findFlag (foname);
  22.199 +	if (fo) flag.remove(fo);
  22.200 +	calcBBoxSize();
  22.201 +	positionBBox();
  22.202 +}
  22.203 +
  22.204 +void FlagRowObj::deactivateAll ()
  22.205 +{
  22.206 +	if (!parentRow)
  22.207 +	{
  22.208 +		FlagObj *fo;
  22.209 +		for (fo=flag.first();fo; fo=flag.next() )
  22.210 +		{
  22.211 +			fo->deactivate();
  22.212 +		}
  22.213 +	} else
  22.214 +		qWarning ("FlagRowObj::deactivateAll mustn't be called for ordinary rows");
  22.215 +}
  22.216 +
  22.217 +void FlagRowObj::setEnabled (bool b)
  22.218 +{
  22.219 +	// If we have no parent, we are the default FlagRowObj
  22.220 +	// and have QToolbarButtons
  22.221 +	if (!parentRow)
  22.222 +	{
  22.223 +		FlagObj *fo;
  22.224 +		for (fo=flag.first();fo; fo=flag.next() )
  22.225 +			fo->setEnabled (b);
  22.226 +	}
  22.227 +}
  22.228 +
  22.229 +void FlagRowObj::resetUsedCounter()
  22.230 +{
  22.231 +	FlagObj *fo;
  22.232 +	for (fo=flag.first();fo; fo=flag.next() )
  22.233 +		fo->setUsed (false);
  22.234 +}
  22.235 +
  22.236 +QString FlagRowObj::saveToDir (const QString &tmpdir,const QString &prefix, bool writeflags)
  22.237 +{
  22.238 +	// Build xml string
  22.239 +	QString s;
  22.240 +	FlagObj *fo;
  22.241 +	if (parentRow)
  22.242 +		for (fo=flag.first();fo; fo=flag.next() )
  22.243 +		{
  22.244 +			// save flag to xml, if flag is set 
  22.245 +			s+=valueElement("standardflag",fo->getName() );
  22.246 +
  22.247 +			// and tell parentRow, that this flag is used
  22.248 +			parentRow->activate(fo->getName() );
  22.249 +		}	
  22.250 +	else
  22.251 +		// Save icons to dir, if verbose is set (xml export)
  22.252 +		// and I am a parentRow 
  22.253 +		// and this flag is really used somewhere
  22.254 +		if (writeflags)
  22.255 +			for (fo=flag.first();fo; fo=flag.next() )
  22.256 +				if (fo->isUsed()) fo->saveToDir (tmpdir,prefix);
  22.257 +	return s;		
  22.258 +
  22.259 +}
  22.260 +
  22.261 +void FlagRowObj::setName (const QString &n)
  22.262 +{
  22.263 +	name=n;
  22.264 +}
  22.265 +
  22.266 +void FlagRowObj::makeToolbar (QMainWindow *w, const QString &n)
  22.267 +{
  22.268 +	if (!parentRow)
  22.269 +	{
  22.270 +		// create bar and buttons
  22.271 +		QToolBar* tb = new QToolBar( w);
  22.272 +		tb->setLabel (n);
  22.273 +		QAction *a;
  22.274 +		FlagObj *fo;
  22.275 +		for (fo=flag.first();fo; fo=flag.next() )
  22.276 +		{
  22.277 +			a=new QAction (
  22.278 +				fo->getToolTip(),
  22.279 +				fo->getPixmap(),
  22.280 +				fo->getName(),
  22.281 +				0,
  22.282 +				w,
  22.283 +				fo->getName()
  22.284 +			);
  22.285 +			a->setToggleAction(true);
  22.286 +			// FIXME should not be enabled by default, later in updateToolbar
  22.287 +			a->setEnabled(true);
  22.288 +			a->addTo (tb);
  22.289 +			fo->setButton (a);
  22.290 +			connect(a, SIGNAL( activated() ), 
  22.291 +					w, SLOT( standardFlagChanged() ) );
  22.292 +		}
  22.293 +	} else
  22.294 +		qWarning ("FlagRowObj::makeToolbar mustn't be called for ordinary rows");
  22.295 +}
  22.296 +
  22.297 +void  FlagRowObj::updateToolBar()
  22.298 +{
  22.299 +	FlagObj *fo;
  22.300 +	if (parentRow)
  22.301 +	{
  22.302 +		// We are just a branch, not the toolbar default
  22.303 +		parentRow->deactivateAll();
  22.304 +		// In parentRow activate all existing (==active) flags
  22.305 +		for (fo=flag.first();fo; fo=flag.next() ) 
  22.306 +			parentRow->activate(fo->getName());
  22.307 +		parentRow->updateToolBar();	
  22.308 +	} else
  22.309 +	{
  22.310 +		// We are the toolbar default
  22.311 +		for (fo=flag.first();fo; fo=flag.next() ) 
  22.312 +			fo->updateButton();
  22.313 +	}
  22.314 +}
  22.315 +
  22.316 +FlagObj* FlagRowObj::findFlag (const QString &name)
  22.317 +{
  22.318 +	FlagObj *fo;
  22.319 +	for (fo=flag.first();fo; fo=flag.next() )
  22.320 +	{
  22.321 +		if (fo->getName()==name) return fo;
  22.322 +	}
  22.323 +	return NULL;
  22.324 +}
  22.325 +
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/flagrowobj.h	Sun Jan 30 12:59:10 2005 +0000
    23.3 @@ -0,0 +1,41 @@
    23.4 +#ifndef FLAGROWOBJ_H
    23.5 +#define FLAGROWOBJ_H
    23.6 +
    23.7 +#include <qmainwindow.h>
    23.8 +
    23.9 +#include "mapobj.h"
   23.10 +#include "flagobj.h"
   23.11 +
   23.12 +class FlagRowObj:public QObject,public MapObj {
   23.13 +public:
   23.14 +    FlagRowObj ();
   23.15 +    FlagRowObj (QCanvas*);
   23.16 +    ~FlagRowObj ();
   23.17 +    virtual void init ();
   23.18 +    virtual void copy (FlagRowObj*);
   23.19 +    virtual void clone(FlagRowObj*);
   23.20 +    virtual void move   (double,double);
   23.21 +    virtual void moveBy (double,double);
   23.22 +    virtual void setVisibility(bool);
   23.23 +    virtual FlagObj* addFlag (FlagObj *fo);			// make deep copy of FlagObj
   23.24 +    virtual void positionBBox();
   23.25 +    virtual void calcBBoxSize();
   23.26 +	virtual QString getFlagName (const QPoint &p);	// Find flag by position
   23.27 +	bool isActive(const QString&);
   23.28 +	void toggle (const QString&);
   23.29 +	void activate(const QString&);
   23.30 +	void deactivate(const QString&);
   23.31 +	void deactivateAll();
   23.32 +	void setEnabled (bool);
   23.33 +	void resetUsedCounter();
   23.34 +	QString saveToDir (const QString &,const QString &,bool);
   23.35 +	void setName (const QString&);			// prefix for exporting flags to dir
   23.36 +	void makeToolbar (QMainWindow*, const QString &);	// Create Toolbar buttons
   23.37 +	void updateToolBar();					// Update Toolbar buttons	
   23.38 +private:	
   23.39 +	FlagRowObj* parentRow;					// look for flags in this row
   23.40 +	FlagObj* findFlag (const QString&);
   23.41 +    QPtrList <FlagObj> flag; 
   23.42 +	QString name;
   23.43 +};
   23.44 +#endif
    24.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.2 +++ b/floatimageobj.cpp	Sun Jan 30 12:59:10 2005 +0000
    24.3 @@ -0,0 +1,219 @@
    24.4 +#include "floatimageobj.h"
    24.5 +#include "branchobj.h"
    24.6 +#include <math.h>
    24.7 +
    24.8 +
    24.9 +/////////////////////////////////////////////////////////////////
   24.10 +// FloatImageObj
   24.11 +/////////////////////////////////////////////////////////////////
   24.12 +
   24.13 +int FloatImageObj::counter=0;		// make instance 
   24.14 +
   24.15 +
   24.16 +FloatImageObj::FloatImageObj ():FloatObj()
   24.17 +{
   24.18 +//    cout << "Const FloatImageObj ()\n";
   24.19 +    setParObj (this);	
   24.20 +    init();
   24.21 +    depth=-1;
   24.22 +}
   24.23 +
   24.24 +FloatImageObj::FloatImageObj (QCanvas* c):FloatObj(c)
   24.25 +{
   24.26 + //   cout << "Const FloatImageObj (c)  called from MapCenterObj (c)\n";
   24.27 +    setParObj (this);	
   24.28 +    init();
   24.29 +    depth=-1;
   24.30 +}
   24.31 +
   24.32 +FloatImageObj::FloatImageObj (QCanvas* c, LinkableMapObj* p):FloatObj(c,p)
   24.33 +{
   24.34 + //   cout << "Const FloatImageObj (c,p)\n";
   24.35 +    init();
   24.36 +}
   24.37 +
   24.38 +FloatImageObj::~FloatImageObj ()
   24.39 +{
   24.40 +//	cout << "Destr FloatImageObj "<<this<<"\n";
   24.41 +	delete(icon);
   24.42 +}
   24.43 +
   24.44 +void FloatImageObj::init () 
   24.45 +{
   24.46 +	icon=new ImageObj (canvas);
   24.47 +	icon->move (absPos.x(), absPos.y() );
   24.48 +	icon->setVisibility (true);
   24.49 +	bbox.setSize (QSize(icon->size().width(), icon->size().height()));
   24.50 +	filename="";
   24.51 +	originalFilename="no original name available";
   24.52 +	filetype="";
   24.53 +	saveInMap=true;
   24.54 +}
   24.55 +
   24.56 +void FloatImageObj::copy (FloatImageObj* other)
   24.57 +{					
   24.58 +	FloatObj::copy (other);
   24.59 +	icon->copy (other->icon);
   24.60 +	filename=other->filename;
   24.61 +	saveInMap=other->saveInMap;
   24.62 +    positionBBox();
   24.63 +}
   24.64 +
   24.65 +void FloatImageObj::setZ (const int &i)
   24.66 +{
   24.67 +	icon->setZ (i);
   24.68 +	zPlane=i;
   24.69 +}
   24.70 +
   24.71 +int FloatImageObj::z ()
   24.72 +{
   24.73 +	return lrint (icon->z());
   24.74 +}
   24.75 +
   24.76 +bool FloatImageObj::load (const QString &fn)
   24.77 +{	
   24.78 +	if( icon->load (fn))
   24.79 +	{
   24.80 +		bbox.setSize (QSize(icon->size().width()+8, icon->size().height()+8));
   24.81 +		positionBBox();
   24.82 +		filename=fn;
   24.83 +		filetype=QPixmap::imageFormat (fn);
   24.84 +		return true;
   24.85 +	} else
   24.86 +		return false;
   24.87 +	
   24.88 +}
   24.89 +
   24.90 +void FloatImageObj::save (const QString &fn, const char *format)
   24.91 +{	
   24.92 +	icon->save (fn,format);
   24.93 +}
   24.94 +
   24.95 +void FloatImageObj::setOriginalFilename(const QString & fn)
   24.96 +{
   24.97 +	originalFilename=fn;
   24.98 +}
   24.99 +
  24.100 +QString FloatImageObj::getOriginalFilename()
  24.101 +{
  24.102 +	return originalFilename;
  24.103 +}
  24.104 +
  24.105 +void FloatImageObj::setVisibility(bool v)
  24.106 +{
  24.107 +    LinkableMapObj::setVisibility(v);
  24.108 +	if (v)
  24.109 +	    icon->setVisibility(true);
  24.110 +	else
  24.111 +	    icon->setVisibility(false);
  24.112 +}
  24.113 +
  24.114 +void FloatImageObj::move (double x, double y)
  24.115 +{
  24.116 +	FloatObj::move(x,y);
  24.117 +	icon->move (x+4,y+4);
  24.118 +    positionBBox();
  24.119 +}
  24.120 +
  24.121 +void FloatImageObj::move (QPoint p)
  24.122 +{
  24.123 +	move (p.x(), p.y());
  24.124 +}
  24.125 +
  24.126 +void FloatImageObj::positionBBox()
  24.127 +{
  24.128 +	// TODO
  24.129 +}
  24.130 +
  24.131 +void FloatImageObj::calcBBoxSize()
  24.132 +{
  24.133 +	// TODO
  24.134 +}
  24.135 +
  24.136 +QString FloatImageObj::saveToDir (const QString &tmpdir,const QString &prefix)
  24.137 +{
  24.138 +	counter++;
  24.139 +
  24.140 +	QString posAttr=
  24.141 +		attribut("relPosX",QString().setNum(relPos.x(),10)) +
  24.142 +		attribut("relPosY",QString().setNum(relPos.y(),10)); 
  24.143 +
  24.144 +	QString useOrientAttr;
  24.145 +	if (useOrientation)
  24.146 +		useOrientAttr=attribut ("useOrientation","true");
  24.147 +	else	
  24.148 +		useOrientAttr=attribut ("useOrientation","false");
  24.149 +		
  24.150 +	QString saveInMapAttr;
  24.151 +	if (saveInMap)
  24.152 +		saveInMapAttr=attribut ("saveInMap","true");
  24.153 +	else	
  24.154 +		
  24.155 +		saveInMapAttr=attribut ("saveInMap","false");
  24.156 +
  24.157 +	QString exportAttr;
  24.158 +	if (floatExport)
  24.159 +		exportAttr=attribut ("floatExport","true");
  24.160 +	else	
  24.161 +		exportAttr=attribut ("floatExport","false");
  24.162 +
  24.163 +	QString zAttr=attribut ("zPlane",QString().setNum(zPlane));
  24.164 +	QString url;
  24.165 +
  24.166 +	// prevent saving as GIF
  24.167 +	if (filetype=="GIF")
  24.168 +		filetype="PNG";
  24.169 +		
  24.170 +	url="images/"+prefix+"image-" + QString().number(counter,10) + "." +filetype;
  24.171 +
  24.172 +	// And really save the image
  24.173 +	icon->save (tmpdir + "/" + url, filetype);
  24.174 +
  24.175 +    return singleElement ("floatimage",  
  24.176 +		posAttr + 
  24.177 +		useOrientAttr + 
  24.178 +		saveInMapAttr + 
  24.179 +		exportAttr + 
  24.180 +		zAttr + 
  24.181 +		attribut ("href",QString ("file:")+url)
  24.182 +	);	
  24.183 +}
  24.184 +
  24.185 +void FloatImageObj::resetSaveCounter()
  24.186 +{
  24.187 +	counter=0;
  24.188 +}
  24.189 +
  24.190 +
  24.191 +QRect FloatImageObj::getTotalBBox()
  24.192 +{
  24.193 +	return bbox;
  24.194 +}
  24.195 +
  24.196 +QRect FloatImageObj::getBBoxSizeWithChilds()
  24.197 +{
  24.198 +	//FIXME  abstract in linkablemapobj.h, not calculated
  24.199 +	return bboxTotal;
  24.200 +}
  24.201 +
  24.202 +void FloatImageObj::calcBBoxSizeWithChilds()
  24.203 +{
  24.204 +	//FIXME  abstract in linkablemapobj.h
  24.205 +}
  24.206 +
  24.207 +QString FloatImageObj::getSelectString()
  24.208 +{
  24.209 +	QString s;
  24.210 +	if (parObj)
  24.211 +	{
  24.212 +		if (parObj->getDepth()==0)
  24.213 +			s= "fi:" + QString("%1").arg( ((BranchObj*)(parObj))->getFloatImageNum(this));
  24.214 +		else	
  24.215 +			s= ((BranchObj*)(parObj))->getSelectString() + ",fi:" + QString("%1").arg( ((BranchObj*)(parObj))->getFloatImageNum(this));
  24.216 +	} else
  24.217 +		s="mc:";
  24.218 +	
  24.219 +	return s;
  24.220 +
  24.221 +}
  24.222 +
    25.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.2 +++ b/floatimageobj.h	Sun Jan 30 12:59:10 2005 +0000
    25.3 @@ -0,0 +1,44 @@
    25.4 +#ifndef FLOATIMAGEOBJ_H
    25.5 +#define FLOATIMAGEOBJ_H
    25.6 +
    25.7 +#include "floatobj.h"
    25.8 +
    25.9 +/////////////////////////////////////////////////////////////////////////////
   25.10 +class FloatImageObj:public FloatObj {
   25.11 +public:
   25.12 +    FloatImageObj ();
   25.13 +    FloatImageObj (QCanvas*);
   25.14 +    FloatImageObj (QCanvas*, LinkableMapObj* parent);
   25.15 +    ~FloatImageObj ();
   25.16 +    virtual void init ();
   25.17 +    virtual void copy (FloatImageObj*);
   25.18 +	virtual void setZ (const int&);
   25.19 +	virtual int z();
   25.20 +
   25.21 +	virtual bool load (const QString &);
   25.22 +	virtual void save (const QString &, const char *);
   25.23 +	virtual void setOriginalFilename(const QString &);
   25.24 +	virtual QString getOriginalFilename();
   25.25 +    virtual void setVisibility(bool);	    // set vis. for w
   25.26 +    virtual void move (double x,double y);
   25.27 +    virtual void move (QPoint);
   25.28 +	virtual void positionBBox();
   25.29 +	virtual void calcBBoxSize();
   25.30 +	virtual QRect getTotalBBox();			// return BBox including childs			
   25.31 +	virtual QRect getBBoxSizeWithChilds();	// return size of BBox including childs  
   25.32 +	virtual void calcBBoxSizeWithChilds();	// calc size of  BBox including childs recursivly
   25.33 +	virtual QString saveToDir(const QString &,const QString&);
   25.34 +	virtual void resetSaveCounter();
   25.35 +	virtual QString getSelectString();
   25.36 +
   25.37 +
   25.38 +protected:
   25.39 +	ImageObj *icon;
   25.40 +	bool saveInMap;
   25.41 +	static int counter;			// numerate the files during saveToDir
   25.42 +	QString filetype;
   25.43 +	QString filename;
   25.44 +	QString originalFilename;
   25.45 +};
   25.46 +
   25.47 +#endif
    26.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.2 +++ b/floatobj.cpp	Sun Jan 30 12:59:10 2005 +0000
    26.3 @@ -0,0 +1,163 @@
    26.4 +#include "floatobj.h"
    26.5 +
    26.6 +extern QAction* actionEditToggleFloatExport;
    26.7 +
    26.8 +/////////////////////////////////////////////////////////////////
    26.9 +// FloatObj
   26.10 +/////////////////////////////////////////////////////////////////
   26.11 +
   26.12 +FloatObj::FloatObj ():LinkableMapObj() 
   26.13 +{
   26.14 +//    cout << "Const FloatObj ()\n";
   26.15 +    setParObj (this);	
   26.16 +    init();
   26.17 +    depth=-1;
   26.18 +}
   26.19 +
   26.20 +FloatObj::FloatObj (QCanvas* c):LinkableMapObj(c)
   26.21 +{
   26.22 +//	cout << "Const FloatObj (c)  called from MapCenterObj (c)\n";
   26.23 +    setParObj (this);	
   26.24 +    init();
   26.25 +    depth=-1;
   26.26 +}
   26.27 +
   26.28 +FloatObj::FloatObj (QCanvas* c, LinkableMapObj* p):LinkableMapObj (c)
   26.29 +{
   26.30 +//    cout << "Const FloatObj (c,p)\n";
   26.31 +    setParObj (p);	
   26.32 +    depth=p->getDepth()+1;
   26.33 +    init();
   26.34 +}
   26.35 +
   26.36 +FloatObj::~FloatObj ()
   26.37 +{
   26.38 +//   cout << "Destr FloatObj\n";
   26.39 +}
   26.40 +
   26.41 +void FloatObj::init () 
   26.42 +{
   26.43 +    setChildObj(this);
   26.44 +	relPos=getRandPos();
   26.45 +	useOrientation=true;
   26.46 +	floatExport=true;
   26.47 +	zPlane=Z_ICON;
   26.48 +}
   26.49 +
   26.50 +void FloatObj::copy (FloatObj* other)
   26.51 +{
   26.52 +	LinkableMapObj::copy (other);
   26.53 +	relPos=other->relPos;
   26.54 +	useOrientation=other->useOrientation;
   26.55 +	setVisibility (other->visible);
   26.56 +}
   26.57 +
   26.58 +void FloatObj::setRelPos()
   26.59 +{
   26.60 +	if (useOrientation)
   26.61 +	{
   26.62 +		if (parObj->getOrientation()==OrientLeftOfCenter)
   26.63 +			relPos.setX ( parObj->x() +parObj->width() - bbox.width() -absPos.x());
   26.64 +		else	
   26.65 +			relPos.setX (absPos.x() - parObj->x() );
   26.66 +	}
   26.67 +	else
   26.68 +		relPos.setX (absPos.x() - parObj->x() );
   26.69 +	relPos.setY (absPos.y() - parObj->y() );
   26.70 +}
   26.71 +
   26.72 +void FloatObj::setRelPos(const QPoint &p)
   26.73 +{
   26.74 +	relPos=p;
   26.75 +}
   26.76 +
   26.77 +void FloatObj::setZ(const int &i)
   26.78 +{
   26.79 +	zPlane=i;
   26.80 +}
   26.81 +
   26.82 +int FloatObj::z()
   26.83 +{
   26.84 +	return zPlane;
   26.85 +}
   26.86 +
   26.87 +
   26.88 +void FloatObj::setUseOrientation (const bool &b)
   26.89 +{	
   26.90 +	if (useOrientation!=b)
   26.91 +	{
   26.92 +		useOrientation=b;
   26.93 +		requestReposition();
   26.94 +	}	
   26.95 +}
   26.96 +
   26.97 +void FloatObj::setFloatExport(const bool& b)
   26.98 +{
   26.99 +	floatExport=b;
  26.100 +}
  26.101 +
  26.102 +bool FloatObj::getFloatExport()
  26.103 +{
  26.104 +	return floatExport;
  26.105 +}
  26.106 +
  26.107 +void FloatObj::move (double x, double y)
  26.108 +{
  26.109 +	MapObj::move(x,y);
  26.110 +	selbox->move(x,y);
  26.111 +}
  26.112 +
  26.113 +void FloatObj::move (QPoint p)
  26.114 +{
  26.115 +	move (p.x(), p.y());
  26.116 +}
  26.117 +
  26.118 +void FloatObj::reposition()
  26.119 +{
  26.120 +	if (useOrientation)
  26.121 +	{
  26.122 +		if (parObj->getOrientation()==OrientLeftOfCenter)
  26.123 +			move (parObj->x() - relPos.x() + parObj->width() - bbox.width(), parObj->y()+relPos.y());
  26.124 +		else	
  26.125 +			move (parObj->x()+relPos.x(), parObj->y()+relPos.y());
  26.126 +	}		
  26.127 +	else
  26.128 +		move (parObj->x()+relPos.x(), parObj->y()+relPos.y());
  26.129 +	updateLink();	
  26.130 +}
  26.131 +
  26.132 +QRect FloatObj::getTotalBBox()
  26.133 +{
  26.134 +	return bbox;
  26.135 +}
  26.136 +
  26.137 +QRect FloatObj::getBBoxSizeWithChilds()
  26.138 +{
  26.139 +	return bboxTotal;
  26.140 +}
  26.141 +
  26.142 +void FloatObj::select()
  26.143 +{
  26.144 +    LinkableMapObj::select();
  26.145 +	// Temporary draw the link while FO is selected
  26.146 +	if (style==StyleUndef) 
  26.147 +	{
  26.148 +		setLinkStyle(getDefLinkStyle());
  26.149 +		setLinkColor(parObj->getLinkColor());
  26.150 +	}	
  26.151 +
  26.152 +	// Update FloatExport switch in context menu
  26.153 +	if (floatExport)
  26.154 +		actionEditToggleFloatExport->setEnabled (true);
  26.155 +	else	
  26.156 +		actionEditToggleFloatExport->setEnabled (true);
  26.157 +
  26.158 +
  26.159 +}
  26.160 +
  26.161 +void FloatObj::unselect()
  26.162 +{
  26.163 +	LinkableMapObj::unselect();
  26.164 +	setLinkStyle (StyleUndef);
  26.165 +}
  26.166 +
    27.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.2 +++ b/floatobj.h	Sun Jan 30 12:59:10 2005 +0000
    27.3 @@ -0,0 +1,45 @@
    27.4 +#ifndef FLOATOBJ_H
    27.5 +#define FLOATOBJ_H
    27.6 +
    27.7 +#include "linkablemapobj.h"
    27.8 +
    27.9 +/////////////////////////////////////////////////////////////////////////////
   27.10 +class FloatObj:public LinkableMapObj {
   27.11 +public:
   27.12 +    FloatObj ();
   27.13 +    FloatObj (QCanvas*);
   27.14 +    FloatObj (QCanvas*, LinkableMapObj* parent);
   27.15 +    ~FloatObj ();
   27.16 +    virtual void init ();
   27.17 +    virtual void copy (FloatObj*);
   27.18 +	virtual bool load (const QString&)=0;
   27.19 +	virtual void setRelPos();				// set relPos to current parentPos
   27.20 +	virtual void setRelPos(const QPoint&);	
   27.21 +	virtual void setZ(const int&);		// set zPlane
   27.22 +	virtual int z();
   27.23 +	virtual void setUseOrientation (const bool &);
   27.24 +	virtual void setFloatExport (const bool &);
   27.25 +	virtual bool getFloatExport ();
   27.26 +
   27.27 +	virtual void move (double,double);
   27.28 +	virtual void move (QPoint);
   27.29 +
   27.30 +	virtual void reposition();
   27.31 +											
   27.32 +	virtual QRect getTotalBBox();			// return BBox including childs			
   27.33 +	virtual QRect getBBoxSizeWithChilds();	// return size of BBox including childs  
   27.34 +
   27.35 +	virtual QString saveToDir(const QString &,const QString&)=0;
   27.36 +	virtual void resetSaveCounter()=0;
   27.37 +
   27.38 +	virtual void select();
   27.39 +	virtual void unselect();
   27.40 +
   27.41 +protected:
   27.42 +	QPoint relPos;
   27.43 +	bool useOrientation;		
   27.44 +	bool floatExport;
   27.45 +	int zPlane;
   27.46 +};
   27.47 +
   27.48 +#endif
    28.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.2 +++ b/frameobj.cpp	Sun Jan 30 12:59:10 2005 +0000
    28.3 @@ -0,0 +1,146 @@
    28.4 +#include "frameobj.h"
    28.5 +
    28.6 +#include <qcolor.h>
    28.7 +
    28.8 +/////////////////////////////////////////////////////////////////
    28.9 +// FrameObj
   28.10 +/////////////////////////////////////////////////////////////////
   28.11 +FrameObj::FrameObj() : MapObj()
   28.12 +{
   28.13 +//    cout << "Const FrameObj ()\n";
   28.14 +    init ();
   28.15 +}
   28.16 +
   28.17 +FrameObj::FrameObj(QCanvas* c) :MapObj(c)
   28.18 +{
   28.19 +//    cout << "Const FrameObj\n";
   28.20 +    init ();
   28.21 +}
   28.22 +
   28.23 +FrameObj::~FrameObj()
   28.24 +{
   28.25 +	clear();
   28.26 +}
   28.27 +
   28.28 +void FrameObj::init()
   28.29 +{
   28.30 +    type=NoFrame;
   28.31 +    border=0;
   28.32 +}
   28.33 +
   28.34 +void FrameObj::clear()
   28.35 +{
   28.36 +    switch (type)
   28.37 +    {
   28.38 +		case NoFrame:
   28.39 +			break;
   28.40 +		case Rectangle:
   28.41 +			delete rectFrame;
   28.42 +			break;
   28.43 +    }
   28.44 +	type=NoFrame;
   28.45 +	border=0;
   28.46 +}
   28.47 +
   28.48 +void FrameObj::move(double x, double y)
   28.49 +{
   28.50 +    switch (type)
   28.51 +    {
   28.52 +		case NoFrame:
   28.53 +			break;
   28.54 +		case Rectangle:
   28.55 +			rectFrame->move (x,y);
   28.56 +			break;
   28.57 +    }
   28.58 +}
   28.59 +
   28.60 +void FrameObj::moveBy(double x, double y)
   28.61 +{
   28.62 +	MapObj::moveBy (x,y);
   28.63 +}
   28.64 +
   28.65 +void FrameObj::positionBBox()
   28.66 +{
   28.67 +}
   28.68 +
   28.69 +void FrameObj::calcBBoxSize()
   28.70 +{
   28.71 +}
   28.72 +
   28.73 +void FrameObj::setRect(const QRect &r)
   28.74 +{
   28.75 +	bbox=r;
   28.76 +    switch (type)
   28.77 +    {
   28.78 +		case NoFrame:
   28.79 +			break;
   28.80 +		case Rectangle:
   28.81 +			rectFrame->setX (bbox.x() );
   28.82 +			rectFrame->setY (bbox.y() );
   28.83 +			rectFrame->setSize (bbox.width(),bbox.height() );
   28.84 +			break;
   28.85 +    }
   28.86 +}
   28.87 +
   28.88 +int FrameObj::getBorder()
   28.89 +{
   28.90 +	return border;
   28.91 +}
   28.92 +
   28.93 +FrameType FrameObj::getFrameType()
   28.94 +{
   28.95 +	return type;
   28.96 +}
   28.97 +
   28.98 +QString FrameObj::getFrameTypeName()
   28.99 +{
  28.100 +    switch (type)
  28.101 +    {
  28.102 +		case Rectangle:
  28.103 +			return "Rectangle";
  28.104 +			break;
  28.105 +		default:
  28.106 +			return "NoFrame";
  28.107 +    }
  28.108 +}
  28.109 +
  28.110 +void FrameObj::setFrameType(const FrameType &t)
  28.111 +{
  28.112 +	if (t!=type)
  28.113 +	{
  28.114 +		clear();
  28.115 +		type=t;
  28.116 +		switch (type)
  28.117 +		{
  28.118 +			case NoFrame:
  28.119 +				border=0;
  28.120 +				break;
  28.121 +			case Rectangle:
  28.122 +				border=10;
  28.123 +				rectFrame = new QCanvasRectangle (canvas);
  28.124 +				rectFrame->setZ(Z_FRAME);
  28.125 +				rectFrame->setBrush( QColor("white") );
  28.126 +				rectFrame->setPen( QPen(QColor("black") ));
  28.127 +				if (visible)
  28.128 +					rectFrame->show();
  28.129 +				else    
  28.130 +					rectFrame->hide();
  28.131 +				break;
  28.132 +		}
  28.133 +	}
  28.134 +}
  28.135 +
  28.136 +void FrameObj::setFrameType(const QString &t)
  28.137 +{
  28.138 +	if (t=="Rectangle")
  28.139 +		FrameObj::setFrameType (Rectangle);
  28.140 +	else	
  28.141 +		FrameObj::setFrameType (NoFrame);
  28.142 +}
  28.143 +
  28.144 +void FrameObj::setVisibility (bool v)
  28.145 +{
  28.146 +    MapObj::setVisibility(v);
  28.147 +    setFrameType (type);    // changes on visibility depend on type...
  28.148 +}
  28.149 +
    29.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.2 +++ b/frameobj.h	Sun Jan 30 12:59:10 2005 +0000
    29.3 @@ -0,0 +1,33 @@
    29.4 +#ifndef FRAMEOBJ_H
    29.5 +#define FRAMEOBJ_H
    29.6 +
    29.7 +#include "mapobj.h"
    29.8 +
    29.9 +enum FrameType {NoFrame,Rectangle};
   29.10 +
   29.11 +class FrameObj:public MapObj {
   29.12 +public:
   29.13 +    FrameObj();
   29.14 +    FrameObj(QCanvas*);
   29.15 +    ~FrameObj();
   29.16 +    void init();
   29.17 +    void clear();
   29.18 +    void move (double x,double y);    // move to absolute Position
   29.19 +    void moveBy (double x,double y);  // move to relative Position
   29.20 +	void positionBBox();			 
   29.21 +	void calcBBoxSize();			
   29.22 +	void setRect (const QRect &);	  // set dimensions			
   29.23 +    int getBorder();
   29.24 +    FrameType getFrameType ();
   29.25 +    QString getFrameTypeName ();
   29.26 +    void setFrameType (const FrameType &);
   29.27 +    void setFrameType (const QString &);
   29.28 +    void setVisibility(bool);
   29.29 +
   29.30 +protected:
   29.31 +    FrameType type;
   29.32 +    QCanvasRectangle* rectFrame;
   29.33 +    int border;									// distance text - frame
   29.34 +};
   29.35 +#endif
   29.36 +
    30.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.2 +++ b/headingobj.cpp	Sun Jan 30 12:59:10 2005 +0000
    30.3 @@ -0,0 +1,246 @@
    30.4 +#include "headingobj.h"
    30.5 +
    30.6 +/////////////////////////////////////////////////////////////////
    30.7 +// HeadingObj
    30.8 +/////////////////////////////////////////////////////////////////
    30.9 +HeadingObj::HeadingObj() : MapObj()
   30.10 +{
   30.11 +//    cout << "Const HeadingObj ()\n";
   30.12 +    init ();
   30.13 +}
   30.14 +
   30.15 +HeadingObj::HeadingObj(QCanvas* c) :MapObj(c)
   30.16 +{
   30.17 +//    cout << "Const HeadingObj\n";
   30.18 +    init ();
   30.19 +}
   30.20 +
   30.21 +HeadingObj::~HeadingObj()
   30.22 +{
   30.23 +    textline.clear();
   30.24 +}
   30.25 +
   30.26 +void HeadingObj::init()
   30.27 +{
   30.28 +    textline.setAutoDelete (TRUE);
   30.29 +    textwidth=40;
   30.30 +    color=QColor ("black");
   30.31 +    font=QFont();
   30.32 +}
   30.33 +
   30.34 +void HeadingObj::copy(HeadingObj *other)
   30.35 +{
   30.36 +    MapObj::copy (other);
   30.37 +    textwidth=other->textwidth;
   30.38 +    color=other->color;
   30.39 +    font=other->font;
   30.40 +    setText (other->text() );
   30.41 +}
   30.42 +
   30.43 +void HeadingObj::move(double x, double y)
   30.44 +{
   30.45 +    MapObj::move(x,y);
   30.46 +    int h;	// height of a textline
   30.47 +    int ho;	// offset of height while drawing all lines
   30.48 +    if (textline.first() )
   30.49 +		h=textline.first()->boundingRect().height();
   30.50 +    else
   30.51 +		h=2;
   30.52 +    QCanvasText *t;
   30.53 +    ho=0;
   30.54 +    for (t=textline.first(); t; t=textline.next() )
   30.55 +    {
   30.56 +		t->move(x,y+ho);
   30.57 +		ho=ho+h;
   30.58 +    }	
   30.59 +}
   30.60 +
   30.61 +
   30.62 +void HeadingObj::moveBy(double x, double y)
   30.63 +{
   30.64 +    move (x+absPos.x(),y+absPos.y() );
   30.65 +}
   30.66 +
   30.67 +void HeadingObj::positionBBox()
   30.68 +{
   30.69 +    bbox.setX (absPos.x());
   30.70 +    bbox.setY (absPos.y());
   30.71 +}
   30.72 +
   30.73 +void HeadingObj::calcBBoxSize()
   30.74 +{	
   30.75 +	int w=0;
   30.76 +	int h=0;
   30.77 +	// Using Backspace an empty heading might easily be created, then there
   30.78 +	// would be textline.first()==NULL This can be worked around by the following, but
   30.79 +	// then no selection would be visible, thus we prevent it in ::setText()
   30.80 +	if (!textline.isEmpty() )
   30.81 +	{
   30.82 +		QCanvasText *t;
   30.83 +		for (t=textline.first(); t; t=textline.next() )
   30.84 +		{
   30.85 +			h+=t->boundingRect().height();
   30.86 +			if (w<t->boundingRect().width() )
   30.87 +				w=t->boundingRect().width();
   30.88 +		}	
   30.89 +	} 
   30.90 +    bbox.setSize (QSize(w,h));
   30.91 +}
   30.92 +
   30.93 +QCanvasText* HeadingObj::newLine(QString s)
   30.94 +{
   30.95 +    QCanvasText *t;
   30.96 +    t = new QCanvasText(canvas);
   30.97 +    t->setFont (font);
   30.98 +    t->setColor (color);
   30.99 +    t->setZ(Z_TEXT);
  30.100 +    t->setText(s);
  30.101 +    t->show();
  30.102 +    return t;
  30.103 +}
  30.104 +
  30.105 +void HeadingObj::setText (QString s)
  30.106 +{
  30.107 +    heading=s;
  30.108 +
  30.109 +    // remove old textlines and prepare generating new ones
  30.110 +    textline.clear();
  30.111 +
  30.112 +	// prevent empty textline, so at least a small selection stays
  30.113 +	// visible for this heading
  30.114 +	if (s.length()==0) s="  ";
  30.115 +
  30.116 +    int i=0;	// index for actual search for ws
  30.117 +    int j=0;	// index of last ws
  30.118 +	int k=0;	// index of "<br>" or similar linebreak
  30.119 +	int br=0;	// width of found break, e.g. for <br> it is 4
  30.120 +
  30.121 +    // set the text and wrap lines
  30.122 +    while (s.length()>0)
  30.123 +    {
  30.124 +		// ok, some people wanted manual linebreaks, here we go
  30.125 +		k=s.find ("<br>",i,false);
  30.126 +		if (k>=0)
  30.127 +		{
  30.128 +			br=4;
  30.129 +			i=k;
  30.130 +		} else
  30.131 +			i=s.find (" ",i,false);
  30.132 +		if (i<0 && j==0)
  30.133 +		{   // no ws found at all in s
  30.134 +			// append whole s
  30.135 +			textline.append (newLine(s));
  30.136 +			s="";
  30.137 +		} else
  30.138 +		{
  30.139 +			if (i<0 && j>0)
  30.140 +			{	// no ws found in actual search
  30.141 +				if (s.length()<=textwidth)
  30.142 +				{
  30.143 +					textline.append (newLine(s));
  30.144 +					s="";
  30.145 +				} else
  30.146 +				{
  30.147 +					textline.append (newLine(s.left(j)));
  30.148 +					s=s.mid(j+1,s.length());
  30.149 +					j=0;
  30.150 +				}		    
  30.151 +			} else
  30.152 +			{
  30.153 +				if (i>= 0 && i<=static_cast <int> (textwidth))
  30.154 +				{   // there is a ws in textwidth
  30.155 +					if (br>0)
  30.156 +					{
  30.157 +						// here is a linebreak
  30.158 +						textline.append (newLine(s.left(i)));
  30.159 +						s=s.mid(i+br,s.length());
  30.160 +						i=0;
  30.161 +						j=0;
  30.162 +						br=0;
  30.163 +					} else
  30.164 +					{
  30.165 +						j=i;
  30.166 +						i++;
  30.167 +					}
  30.168 +				} else
  30.169 +				{
  30.170 +					if (i>static_cast <int> (textwidth)  )
  30.171 +					{	
  30.172 +						if (j>0)
  30.173 +						{   // a ws out of textwidth, but we have also one in
  30.174 +							textline.append (newLine(s.left(j)));
  30.175 +							s=s.mid(j+1,s.length());
  30.176 +							i=0;
  30.177 +							j=0;
  30.178 +						} else
  30.179 +						{   // a ws out of text, but none in
  30.180 +							textline.append (newLine(s.left(i)));
  30.181 +							s=s.mid(i+1,s.length());
  30.182 +							i=0;
  30.183 +						}
  30.184 +					}
  30.185 +				} 
  30.186 +			}	  
  30.187 +		}		    
  30.188 +    }
  30.189 +	setVisibility (visible);
  30.190 +	calcBBoxSize();
  30.191 +}
  30.192 +
  30.193 +QString HeadingObj::text ()
  30.194 +{
  30.195 +    return heading;
  30.196 +}
  30.197 +
  30.198 +void HeadingObj::setFont (QFont f)
  30.199 +{
  30.200 +    if (font!=f) 
  30.201 +    {
  30.202 +		font=f;
  30.203 +		setText (text());
  30.204 +    }
  30.205 +}
  30.206 +
  30.207 +QFont HeadingObj::getFont()
  30.208 +{
  30.209 +    return font;
  30.210 +}    
  30.211 +	
  30.212 +	
  30.213 +void HeadingObj::setColor (QColor c)
  30.214 +{
  30.215 +    if (color!=c)
  30.216 +    {
  30.217 +		color=c;
  30.218 +		QCanvasText *t;
  30.219 +		for (t=textline.first(); t; t=textline.next() )
  30.220 +			t->setColor(c);
  30.221 +    }	    
  30.222 +}
  30.223 +
  30.224 +QColor HeadingObj::getColor()
  30.225 +{
  30.226 +    return color;
  30.227 +}    
  30.228 +
  30.229 +void HeadingObj::setVisibility (bool v)
  30.230 +{
  30.231 +    MapObj::setVisibility(v);
  30.232 +    QCanvasText *t;
  30.233 +    for (t=textline.first(); t; t=textline.next() )
  30.234 +		if (v)
  30.235 +			t->show();
  30.236 +		else
  30.237 +			t->hide();
  30.238 +}
  30.239 +
  30.240 +int HeadingObj::getHeight ()
  30.241 +{
  30.242 +	return bbox.height();
  30.243 +}
  30.244 +
  30.245 +int HeadingObj::getWidth()
  30.246 +{
  30.247 +	return bbox.width();
  30.248 +}
  30.249 +
    31.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.2 +++ b/headingobj.h	Sun Jan 30 12:59:10 2005 +0000
    31.3 @@ -0,0 +1,37 @@
    31.4 +#ifndef HEADINGOBJ_H
    31.5 +#define HEADINGOBJ_H
    31.6 +
    31.7 +#include "mapobj.h"
    31.8 +
    31.9 +class HeadingObj:public MapObj {
   31.10 +public:
   31.11 +    HeadingObj();
   31.12 +    HeadingObj(QCanvas*);
   31.13 +    virtual ~HeadingObj();
   31.14 +    virtual void init();
   31.15 +    virtual void copy(HeadingObj*);
   31.16 +    virtual void move (double x,double y);      // move to absolute Position
   31.17 +    virtual void moveBy (double x,double y);    // move to relative Position
   31.18 +    virtual void positionBBox();
   31.19 +	virtual void calcBBoxSize();
   31.20 +private:
   31.21 +    QCanvasText* newLine(QString);				// generate new textline
   31.22 +public:    
   31.23 +    virtual void setText(QString);
   31.24 +    virtual QString text();
   31.25 +    virtual void setFont(QFont);
   31.26 +    virtual QFont getFont();
   31.27 +    virtual void setColor(QColor);
   31.28 +    virtual QColor getColor();
   31.29 +    virtual void setVisibility(bool);
   31.30 +	virtual int getHeight();
   31.31 +	virtual int getWidth();
   31.32 +
   31.33 +protected:
   31.34 +    QString heading;
   31.35 +    uint textwidth;								// width for formatting text
   31.36 +    QPtrList <QCanvasText> textline;			// a part of e.g. the parabel
   31.37 +    QColor color;
   31.38 +    QFont font;
   31.39 +};
   31.40 +#endif
    32.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.2 +++ b/icons/cursorcolorpicker.xpm	Sun Jan 30 12:59:10 2005 +0000
    32.3 @@ -0,0 +1,38 @@
    32.4 +/* XPM */
    32.5 +static const char * cursorcolorpicker_xpm[] = {
    32.6 +"32 32 3 1",
    32.7 +" 	c None",
    32.8 +".	c #000000",
    32.9 +"+	c #FFFFFF",
   32.10 +"                                ",
   32.11 +"                                ",
   32.12 +"                                ",
   32.13 +"                                ",
   32.14 +"                                ",
   32.15 +"                                ",
   32.16 +"                                ",
   32.17 +"                                ",
   32.18 +"                                ",
   32.19 +"                                ",
   32.20 +"                                ",
   32.21 +"                  ...           ",
   32.22 +"                 .....          ",
   32.23 +"                 .....          ",
   32.24 +"             .........          ",
   32.25 +"              .......           ",
   32.26 +"             .  ...             ",
   32.27 +"            .    ..             ",
   32.28 +"           .    . .             ",
   32.29 +"          .    .                ",
   32.30 +"         .    .                 ",
   32.31 +"        .    .                  ",
   32.32 +"       .    .                   ",
   32.33 +"      .    .                    ",
   32.34 +"      .   .                     ",
   32.35 +"      . ..                      ",
   32.36 +"       .                        ",
   32.37 +"                                ",
   32.38 +"                                ",
   32.39 +"                                ",
   32.40 +"                                ",
   32.41 +"                                "};
    33.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.2 +++ b/icons/cursorcolorpicker16.xpm	Sun Jan 30 12:59:10 2005 +0000
    33.3 @@ -0,0 +1,22 @@
    33.4 +/* XPM */
    33.5 +static const char * cursorcolorpicker_xpm[] = {
    33.6 +"16 16 3 1",
    33.7 +" 	c None",
    33.8 +".	c #000000",
    33.9 +"+	c #FFFFFF",
   33.10 +"            ... ",
   33.11 +"           .....",
   33.12 +"           .....",
   33.13 +"       .........",
   33.14 +"        ....... ",
   33.15 +"       .  ...   ",
   33.16 +"      .    ..   ",
   33.17 +"     .    . .   ",
   33.18 +"    .    .      ",
   33.19 +"   .    .       ",
   33.20 +"  .    .        ",
   33.21 +" .    .         ",
   33.22 +".    .          ",
   33.23 +".   .           ",
   33.24 +". ..            ",
   33.25 +" .              "};
    34.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.2 +++ b/icons/cursorhandopen.xpm	Sun Jan 30 12:59:10 2005 +0000
    34.3 @@ -0,0 +1,24 @@
    34.4 +static unsigned char chandopen[] = {		// cursor bitmap
    34.5 +    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    34.6 +    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    34.7 +    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x01,0x00,0x00,0x40,0x02,0x00,0x00,
    34.8 +    0x70,0x0e,0x00,0x00,0x48,0x12,0x00,0x00,0x48,0x12,0x00,0x00,0x48,0x32,0x00,
    34.9 +    0x00,0x48,0x52,0x00,0xc0,0x48,0x52,0x00,0x20,0x49,0x50,0x00,0x20,0x06,0x50,
   34.10 +    0x00,0x40,0x00,0x40,0x00,0x80,0x00,0x40,0x00,0x00,0x01,0x40,0x00,0x00,0x02,
   34.11 +    0x20,0x00,0x00,0x04,0x10,0x00,0x00,0x08,0x10,0x00,0x00,0x08,0x08,0x00,0x00,
   34.12 +    0x08,0x08,0x00,0x00,0x10,0x08,0x00,0x00,0x10,0x08,0x00,0x00,0x00,0x00,0x00,
   34.13 +    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
   34.14 +
   34.15 +static unsigned char chandopenmask[] = {	// cursor bitmap mask
   34.16 +   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   34.17 +   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   34.18 +   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   34.19 +   0x00, 0x80, 0x01, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xf0, 0x0f, 0x00,
   34.20 +   0x00, 0xf8, 0x1f, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0xf8, 0x3f, 0x00,
   34.21 +   0x00, 0xf8, 0x7f, 0x00, 0xc0, 0xf8, 0x7f, 0x00, 0xe0, 0xf9, 0x7f, 0x00,
   34.22 +   0xe0, 0xff, 0x7f, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x80, 0xff, 0x7f, 0x00,
   34.23 +   0x00, 0xff, 0x7f, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0xfc, 0x1f, 0x00,
   34.24 +   0x00, 0xf8, 0x1f, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0xf8, 0x0f, 0x00,
   34.25 +   0x00, 0xf0, 0x0f, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
   34.26 +   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
   34.27 +
    35.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.2 +++ b/icons/cursorhandopen16.xpm	Sun Jan 30 12:59:10 2005 +0000
    35.3 @@ -0,0 +1,10 @@
    35.4 +static unsigned char chandopen[] = {		// cursor bitmap
    35.5 + 0x00,0x06,0x00,0x09,0xc0,0x39,0x20,0x29,0x20,0x69,0x20,0xa9,0x20,0xa9,0x22,
    35.6 + 0xa9,0x25,0xa1,0x19,0xa0,0x01,0x80,0x02,0x80,0x04,0x80,0x08,0x80,0x10,0x40,
    35.7 + 0x20,0x40};
    35.8 +
    35.9 +static unsigned char chandopenmask[] = {	// cursor bitmap mask
   35.10 + 0x00,0x06,0x00,0x0f,0xc0,0x3f,0xe0,0x3f,0xe0,0x7f,0xe0,0xff,0xe0,0xff,0xe2,
   35.11 + 0xff,0xe7,0xff,0xff,0xff,0xff,0xff,0xfe,0xff,0xfc,0xff,0xf8,0xff,0xf0,0x7f,
   35.12 + 0xe0,0x7f};
   35.13 +
    36.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.2 +++ b/icons/editcopy.xpm	Sun Jan 30 12:59:10 2005 +0000
    36.3 @@ -0,0 +1,36 @@
    36.4 +/* XPM */
    36.5 +static const char *editcopy_xpm[] = {
    36.6 +/* columns rows colors chars-per-pixel */
    36.7 +"22 22 8 1",
    36.8 +"  c Gray100",
    36.9 +". c #8b8bfd",
   36.10 +"X c #3c3cfd",
   36.11 +"o c #000082",
   36.12 +"O c Gray0",
   36.13 +"+ c None",
   36.14 +"@ c Gray0",
   36.15 +"# c Gray0",
   36.16 +/* pixels */
   36.17 +"++++++++++++++++++++++",
   36.18 +"++++++++++++++++++++++",
   36.19 +"OOOOOOOO++++++++++++++",
   36.20 +"O      OO+++++++++++++",
   36.21 +"O OOOO O O++++++++++++",
   36.22 +"O      O  O+++++++++++",
   36.23 +"O OOOO Ooooooooo++++++",
   36.24 +"O      Oo      oo+++++",
   36.25 +"O OOOOO o OOOO oXo++++",
   36.26 +"O       o      o.Xo+++",
   36.27 +"O OOOOO o OOOO o .Xo++",
   36.28 +"O       o      oooooo+",
   36.29 +"O OOOOO o OOOO      o+",
   36.30 +"O       o           o+",
   36.31 +"O OOOOO o OOOOOOOOO o+",
   36.32 +"O       o           o+",
   36.33 +"OOOOOOOOo OOOOOOOOO o+",
   36.34 +"++++++++o           o+",
   36.35 +"++++++++o OOOOOOOOO o+",
   36.36 +"++++++++o           o+",
   36.37 +"++++++++ooooooooooooo+",
   36.38 +"++++++++++++++++++++++"
   36.39 +};
    37.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.2 +++ b/icons/editcut.xpm	Sun Jan 30 12:59:10 2005 +0000
    37.3 @@ -0,0 +1,32 @@
    37.4 +/* XPM */
    37.5 +static const char *editcut_xpm[] = {
    37.6 +/* columns rows colors chars-per-pixel */
    37.7 +"22 22 4 1",
    37.8 +"  c Gray100",
    37.9 +". c #000082",
   37.10 +"X c Gray0",
   37.11 +"o c None",
   37.12 +/* pixels */
   37.13 +"oooooooooooooooooooooo",
   37.14 +"oooooooXoooooXoooooooo",
   37.15 +"oooooooXoooooXoooooooo",
   37.16 +"oooooooXoooooXoooooooo",
   37.17 +"oooooooXooooXXoooooooo",
   37.18 +"oooooooXXoooXooooooooo",
   37.19 +"ooooooooXoooXooooooooo",
   37.20 +"ooooooooXXoXXooooooooo",
   37.21 +"oooooooooXXXoooooooooo",
   37.22 +"oooooooooXXXoooooooooo",
   37.23 +"ooooooooooXooooooooooo",
   37.24 +"ooooooooo.X.oooooooooo",
   37.25 +"oooooooo..o...oooooooo",
   37.26 +"ooooooo.o.o.oo.ooooooo",
   37.27 +"oooooo.oo.o.ooo.oooooo",
   37.28 +"ooooo.ooo.o.oooo.ooooo",
   37.29 +"oooo.oooo.o.oooo.ooooo",
   37.30 +"oooo.oooo.oo.ooo.ooooo",
   37.31 +"oooo.oooo.oo.oo.oooooo",
   37.32 +"oooo.ooo.oooo..ooooooo",
   37.33 +"ooooo...oooooooooooooo",
   37.34 +"oooooooooooooooooooooo"
   37.35 +};
    38.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.2 +++ b/icons/editmovedown.xpm	Sun Jan 30 12:59:10 2005 +0000
    38.3 @@ -0,0 +1,27 @@
    38.4 +/* XPM */
    38.5 +static const  char * editmovedown_xpm[] = {
    38.6 +"22 22 2 1",
    38.7 +" 	c None",
    38.8 +".	c #000000",
    38.9 +"                      ",
   38.10 +"                      ",
   38.11 +"                      ",
   38.12 +"                      ",
   38.13 +"         ..           ",
   38.14 +"         ..           ",
   38.15 +"         ..           ",
   38.16 +"         ..           ",
   38.17 +"         ..           ",
   38.18 +"         ..           ",
   38.19 +"         ..           ",
   38.20 +"         ..           ",
   38.21 +"         ..           ",
   38.22 +"         ..           ",
   38.23 +"         ..           ",
   38.24 +"    ..   ..   ..      ",
   38.25 +"     ..  ..  ..       ",
   38.26 +"      .. .. ..        ",
   38.27 +"       ......         ",
   38.28 +"        ....          ",
   38.29 +"                      ",
   38.30 +"                      "};
    39.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.2 +++ b/icons/editmoveup.xpm	Sun Jan 30 12:59:10 2005 +0000
    39.3 @@ -0,0 +1,27 @@
    39.4 +/* XPM */
    39.5 +static const char * editmoveup_xpm[] = {
    39.6 +"22 22 2 1",
    39.7 +" 	c None",
    39.8 +".	c #000000",
    39.9 +"                      ",
   39.10 +"                      ",
   39.11 +"                      ",
   39.12 +"                      ",
   39.13 +"         ....         ",
   39.14 +"        ......        ",
   39.15 +"       .. .. ..       ",
   39.16 +"      ..  ..  ..      ",
   39.17 +"     ..   ..   ..     ",
   39.18 +"          ..          ",
   39.19 +"          ..          ",
   39.20 +"          ..          ",
   39.21 +"          ..          ",
   39.22 +"          ..          ",
   39.23 +"          ..          ",
   39.24 +"          ..          ",
   39.25 +"          ..          ",
   39.26 +"          ..          ",
   39.27 +"          ..          ",
   39.28 +"          ..          ",
   39.29 +"                      ",
   39.30 +"                      "};
    40.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    40.2 +++ b/icons/editpaste.xpm	Sun Jan 30 12:59:10 2005 +0000
    40.3 @@ -0,0 +1,36 @@
    40.4 +/* XPM */
    40.5 +static const char *editpaste_xpm[] = {
    40.6 +/* columns rows colors chars-per-pixel */
    40.7 +"22 22 8 1",
    40.8 +"  c Gray100",
    40.9 +". c Yellow",
   40.10 +"X c #c6c3c6",
   40.11 +"o c #848284",
   40.12 +"O c #848200",
   40.13 +"+ c #000084",
   40.14 +"@ c Gray0",
   40.15 +"# c None",
   40.16 +/* pixels */
   40.17 +"######################",
   40.18 +"#######@@@@@##########",
   40.19 +"##@@@@@@...@@@@@@#####",
   40.20 +"#@@@@@@.....@@@@@@####",
   40.21 +"@@oOo@@.@@@.@@oOo@@###",
   40.22 +"@oOo@XXXXXXXXX@oOo@###",
   40.23 +"@OoO@XXXXXXXXX@OoO@###",
   40.24 +"@oOo@@@@@@@@@@@oOo@###",
   40.25 +"@OoOoOoOoOoOoOoOoO@###",
   40.26 +"@oOoOoOoOoOoOoOoOo@###",
   40.27 +"@OoOoOoO++++++++++@###",
   40.28 +"@oOoOoOo+       + +###",
   40.29 +"@OoOoOoO+ +++++ +  +##",
   40.30 +"@oOoOoOo+       +   +#",
   40.31 +"@OoOoOoO+ +++++ +    +",
   40.32 +"@oOoOoOo+       ++++++",
   40.33 +"@OoOoOoO+ +++++      +",
   40.34 +"@oOoOoOo+            +",
   40.35 +"@OoOoOoO+ ++++++++++ +",
   40.36 +"#@@@@@@@+            +",
   40.37 +"########++++++++++++++",
   40.38 +"######################"
   40.39 +};
    41.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    41.2 +++ b/icons/editredo.xpm	Sun Jan 30 12:59:10 2005 +0000
    41.3 @@ -0,0 +1,36 @@
    41.4 +/* XPM */
    41.5 +static const char *editredo_xpm[] = {
    41.6 +/* columns rows colors chars-per-pixel */
    41.7 +"22 22 8 1",
    41.8 +"  c Gray100",
    41.9 +". c #848284",
   41.10 +"X c #000084",
   41.11 +"o c Gray0",
   41.12 +"O c None",
   41.13 +"+ c Gray0",
   41.14 +"@ c Gray0",
   41.15 +"# c Gray0",
   41.16 +/* pixels */
   41.17 +"OOOOOOOOOOOOOOOOOOOOOO",
   41.18 +"OOOOOOOOOOOOOOOOOOOOOO",
   41.19 +"OOOOOOOOOOOOOOOOOOOOOO",
   41.20 +"OOOOOOOOOOOOOOOOOOOOOO",
   41.21 +"OOOOOOOOOOOOOOOOOOOOOO",
   41.22 +"OOOO.XXXXXXOOOOOOOOOOO",
   41.23 +"OOOXXXXXXXXXXOOOOOOXOO",
   41.24 +"OO.XXOOOOOOXXXXOOOXXOO",
   41.25 +"OOXXOOOOOOOOOXXXOXXXOO",
   41.26 +"OOXXOOOOOOOOOOXXXXXXOO",
   41.27 +"OOXXOOOOOOOOOOOXXXXXOO",
   41.28 +"OOXXOOOOOOOOOOXXXXXXOO",
   41.29 +"OOXXOOOOOOOOOXXXXXXXOO",
   41.30 +"OO.XXOOOOOOOXXXXXXXXOO",
   41.31 +"OOOXXX.OOOOOOOOOOOOOOO",
   41.32 +"OOOOXXXOOOOOOOOOOOOOOO",
   41.33 +"OOOOOOOOOOOOOOOOOOOOOO",
   41.34 +"OOOOOOOOOOOOOOOOOOOOOO",
   41.35 +"OOOOOOOOOOOOOOOOOOOOOO",
   41.36 +"OOOOOOOOOOOOOOOOOOOOOO",
   41.37 +"OOOOOOOOOOOOOOOOOOOOOO",
   41.38 +"OOOOOOOOOOOOOOOOOOOOOO"
   41.39 +};
    42.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    42.2 +++ b/icons/edittrash.xpm	Sun Jan 30 12:59:10 2005 +0000
    42.3 @@ -0,0 +1,82 @@
    42.4 +/* XPM */
    42.5 +static const char * edittrash_xpm[] = {
    42.6 +"22 22 57 1",
    42.7 +" 	c None",
    42.8 +".	c #000000",
    42.9 +"+	c #505050",
   42.10 +"@	c #494949",
   42.11 +"#	c #373737",
   42.12 +"$	c #818181",
   42.13 +"%	c #101010",
   42.14 +"&	c #282828",
   42.15 +"*	c #2F2F2F",
   42.16 +"=	c #232323",
   42.17 +"-	c #1F1F1F",
   42.18 +";	c #DADADA",
   42.19 +">	c #FBFBFB",
   42.20 +",	c #DCDCDC",
   42.21 +"'	c #696969",
   42.22 +")	c #6C6C6C",
   42.23 +"!	c #747474",
   42.24 +"~	c #3C3C3C",
   42.25 +"{	c #989898",
   42.26 +"]	c #B2B2B2",
   42.27 +"^	c #949494",
   42.28 +"/	c #0F0F0F",
   42.29 +"(	c #919191",
   42.30 +"_	c #EBEBEB",
   42.31 +":	c #F7F7F7",
   42.32 +"<	c #B8B8B8",
   42.33 +"[	c #565656",
   42.34 +"}	c #151515",
   42.35 +"|	c #8B8B8B",
   42.36 +"1	c #C2C2C2",
   42.37 +"2	c #7E7E7E",
   42.38 +"3	c #B4B4B4",
   42.39 +"4	c #E4E4E4",
   42.40 +"5	c #E9E9E9",
   42.41 +"6	c #E0E0E0",
   42.42 +"7	c #7B7B7B",
   42.43 +"8	c #858585",
   42.44 +"9	c #777777",
   42.45 +"0	c #4F4F4F",
   42.46 +"a	c #D7D7D7",
   42.47 +"b	c #AFAFAF",
   42.48 +"c	c #A4A4A4",
   42.49 +"d	c #9F9F9F",
   42.50 +"e	c #444444",
   42.51 +"f	c #8A8A8A",
   42.52 +"g	c #CDCDCD",
   42.53 +"h	c #A0A0A0",
   42.54 +"i	c #616161",
   42.55 +"j	c #242424",
   42.56 +"k	c #080808",
   42.57 +"l	c #363636",
   42.58 +"m	c #BCBCBC",
   42.59 +"n	c #C6C6C6",
   42.60 +"o	c #5D5D5D",
   42.61 +"p	c #585858",
   42.62 +"q	c #1B1B1B",
   42.63 +"r	c #313131",
   42.64 +"                      ",
   42.65 +"       .....+...      ",
   42.66 +"    ....@+#$%&*=-     ",
   42.67 +"   ..;>,'#)!~{]^..    ",
   42.68 +"  /(_:>;<]<[}|1](2.   ",
   42.69 +"  =(3<;4:5678(|9[0..  ",
   42.70 +"  }9,abbcdd!9!7)0e.   ",
   42.71 +"  ..)f1g;hhhd^)ijk    ",
   42.72 +"   .d1))ff|))!90l}    ",
   42.73 +"   .f14g3<{|||)@*%    ",
   42.74 +"   .fm_{bnf|())0*%    ",
   42.75 +"   .|m_|hn7f|0)0*%    ",
   42.76 +"   .fm5(hn7f|0)0*%    ",
   42.77 +"   .f15|cn9f|0)@*%    ",
   42.78 +"   .fm5(cn9f|@)0*%    ",
   42.79 +"   .fm5|cn7f|0)0*%    ",
   42.80 +"   .f15|cn7f|0!@*%    ",
   42.81 +"   .|m5(cn9f|@)+l%    ",
   42.82 +"   .cg5|cn9f|0)o*/    ",
   42.83 +"   .m4>mmnfd|))p-.    ",
   42.84 +"   .q.cga3hh$[lr.     ",
   42.85 +"     ..l#rrrjq..      "};
    43.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    43.2 +++ b/icons/editundo.xpm	Sun Jan 30 12:59:10 2005 +0000
    43.3 @@ -0,0 +1,36 @@
    43.4 +/* XPM */
    43.5 +static const char *editundo_xpm[] = {
    43.6 +/* columns rows colors chars-per-pixel */
    43.7 +"22 22 8 1",
    43.8 +"  c Gray100",
    43.9 +". c #848284",
   43.10 +"X c #000084",
   43.11 +"o c Gray0",
   43.12 +"O c None",
   43.13 +"+ c Gray0",
   43.14 +"@ c Gray0",
   43.15 +"# c Gray0",
   43.16 +/* pixels */
   43.17 +"OOOOOOOOOOOOOOOOOOOOOO",
   43.18 +"OOOOOOOOOOOOOOOOOOOOOO",
   43.19 +"OOOOOOOOOOOOOOOOOOOOOO",
   43.20 +"OOOOOOOOOOOOOOOOOOOOOO",
   43.21 +"OOOOOOOOOOOOOOOOOOOOOO",
   43.22 +"OOOOOOOOOOOXXXXXX.OOOO",
   43.23 +"OOXOOOOOOXXXXXXXXXXOOO",
   43.24 +"OOXXOOOXXXXOOOOOOXX.OO",
   43.25 +"OOXXXOXXXOOOOOOOOOXXOO",
   43.26 +"OOXXXXXXOOOOOOOOOOXXOO",
   43.27 +"OOXXXXXOOOOOOOOOOOXXOO",
   43.28 +"OOXXXXXXOOOOOOOOOOXXOO",
   43.29 +"OOXXXXXXXOOOOOOOOOXXOO",
   43.30 +"OOXXXXXXXXOOOOOOOXX.OO",
   43.31 +"OOOOOOOOOOOOOOO.XXXOOO",
   43.32 +"OOOOOOOOOOOOOOOXXXOOOO",
   43.33 +"OOOOOOOOOOOOOOOOOOOOOO",
   43.34 +"OOOOOOOOOOOOOOOOOOOOOO",
   43.35 +"OOOOOOOOOOOOOOOOOOOOOO",
   43.36 +"OOOOOOOOOOOOOOOOOOOOOO",
   43.37 +"OOOOOOOOOOOOOOOOOOOOOO",
   43.38 +"OOOOOOOOOOOOOOOOOOOOOO"
   43.39 +};
    44.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    44.2 +++ b/icons/filenew.xpm	Sun Jan 30 12:59:10 2005 +0000
    44.3 @@ -0,0 +1,36 @@
    44.4 +/* XPM */
    44.5 +static const char *filenew_xpm[] = {
    44.6 +/* columns rows colors chars-per-pixel */
    44.7 +"22 22 8 1",
    44.8 +"  c Gray100",
    44.9 +". c Gray76",
   44.10 +"X c Gray53",
   44.11 +"o c Gray36",
   44.12 +"O c Gray18",
   44.13 +"+ c Gray0",
   44.14 +"@ c None",
   44.15 +"# c Gray0",
   44.16 +/* pixels */
   44.17 +"@@@@@@@@@@@@@@@@@@@@@@",
   44.18 +"@@@@++++++++++@@@@@@@@",
   44.19 +"@@@@+       +O+@@@@@@@",
   44.20 +"@@@@+       +oO+@@@@@@",
   44.21 +"@@@@+       +XoO+@@@@@",
   44.22 +"@@@@+       +.XoO+@@@@",
   44.23 +"@@@@+       + .XoO+@@@",
   44.24 +"@@@@+       +++++++@@@",
   44.25 +"@@@@+             +@@@",
   44.26 +"@@@@+             +@@@",
   44.27 +"@@@@+             +@@@",
   44.28 +"@@@@+             +@@@",
   44.29 +"@@@@+             +@@@",
   44.30 +"@@@@+             +@@@",
   44.31 +"@@@@+             +@@@",
   44.32 +"@@@@+             +@@@",
   44.33 +"@@@@+             +@@@",
   44.34 +"@@@@+             +@@@",
   44.35 +"@@@@+             +@@@",
   44.36 +"@@@@+++++++++++++++@@@",
   44.37 +"@@@@@@@@@@@@@@@@@@@@@@",
   44.38 +"@@@@@@@@@@@@@@@@@@@@@@"
   44.39 +};
    45.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    45.2 +++ b/icons/fileopen.xpm	Sun Jan 30 12:59:10 2005 +0000
    45.3 @@ -0,0 +1,36 @@
    45.4 +/* XPM */
    45.5 +static const char *fileopen_xpm[] = {
    45.6 +/* columns rows colors chars-per-pixel */
    45.7 +"22 22 8 1",
    45.8 +"  c Gray100",
    45.9 +". c Yellow",
   45.10 +"X c #848200",
   45.11 +"o c Gray0",
   45.12 +"O c None",
   45.13 +"+ c Gray0",
   45.14 +"@ c Gray0",
   45.15 +"# c Gray0",
   45.16 +/* pixels */
   45.17 +"OOOOOOOOOOOOOOOOOOOOOO",
   45.18 +"OOOOOOOOOOOOOOOOOOOOOO",
   45.19 +"OOOOOOOOOOOOOOOOOOOOOO",
   45.20 +"OOOOOOOOOOOOooooOOOOoO",
   45.21 +"OOOOOOOOOOOoOOOOooOooO",
   45.22 +"OOOOOOOOOOOOOOOOOOoooO",
   45.23 +"OOOOOOOOOOOOOOOOOooooO",
   45.24 +"OooooOOOOOOOOOOOoooooO",
   45.25 +"o. . ooooooooooOOOOOOO",
   45.26 +"o . . . . . . oOOOOOOO",
   45.27 +"o. . . . . . .oOOOOOOO",
   45.28 +"o . . . . . . oOOOOOOO",
   45.29 +"o. . . ooooooooooooooo",
   45.30 +"o . . ooXXXXXXXXXXXXoo",
   45.31 +"o. . ooXXXXXXXXXXXXooO",
   45.32 +"o . ooXXXXXXXXXXXXooOO",
   45.33 +"o. ooXXXXXXXXXXXXooOOO",
   45.34 +"o ooXXXXXXXXXXXXooOOOO",
   45.35 +"oooXXXXXXXXXXXXooOOOOO",
   45.36 +"ooXXXXXXXXXXXXooOOOOOO",
   45.37 +"oooooooooooooooOOOOOOO",
   45.38 +"OOOOOOOOOOOOOOOOOOOOOO"
   45.39 +};
    46.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    46.2 +++ b/icons/fileprint.xpm	Sun Jan 30 12:59:10 2005 +0000
    46.3 @@ -0,0 +1,117 @@
    46.4 +/* XPM */
    46.5 +static const char *fileprint_xpm[] = {
    46.6 +/* columns rows colors chars-per-pixel */
    46.7 +"22 22 89 1",
    46.8 +"  c Gray0",
    46.9 +". c #101008081010",
   46.10 +"X c #101010101010",
   46.11 +"o c #101010101818",
   46.12 +"O c #181810101818",
   46.13 +"+ c #181818181818",
   46.14 +"@ c #181818182121",
   46.15 +"# c #212118182121",
   46.16 +"$ c Gray13",
   46.17 +"% c #212121212929",
   46.18 +"& c #292921212929",
   46.19 +"* c Gray16",
   46.20 +"= c #292929293131",
   46.21 +"- c #313129293131",
   46.22 +"; c #313131313131",
   46.23 +": c #313131313939",
   46.24 +"> c #393931313939",
   46.25 +", c #393939393939",
   46.26 +"< c #393939394242",
   46.27 +"1 c #424239394242",
   46.28 +"2 c Gray26",
   46.29 +"3 c #4a4a4a4a5252",
   46.30 +"4 c #5a5a52525a5a",
   46.31 +"5 c #5a5a5a5a6363",
   46.32 +"6 c #6b6b63636b6b",
   46.33 +"7 c Gray42",
   46.34 +"8 c #6b6b6b6b7373",
   46.35 +"9 c #73736b6b7373",
   46.36 +"0 c #7b7b73737b7b",
   46.37 +"q c #7b7b73738484",
   46.38 +"w c #0808ffff0808",
   46.39 +"e c #2929ffff2929",
   46.40 +"r c #3131ffff3131",
   46.41 +"t c #5a5acece5a5a",
   46.42 +"y c #6b6bffff6363",
   46.43 +"u c #7b7bffff7b7b",
   46.44 +"i c #84847b7b8484",
   46.45 +"p c #84847b7b8c8c",
   46.46 +"a c #8c8c7b7b9494",
   46.47 +"s c #848484848c8c",
   46.48 +"d c #8c8c84848c8c",
   46.49 +"f c Gray55",
   46.50 +"g c #8c8c84849494",
   46.51 +"h c #8c8c8c8c9494",
   46.52 +"j c #94948c8c9494",
   46.53 +"k c #94948c8c9c9c",
   46.54 +"l c Gray58",
   46.55 +"z c #949494949c9c",
   46.56 +"x c #9c9c94949c9c",
   46.57 +"c c Gray61",
   46.58 +"v c #9c9c9494a5a5",
   46.59 +"b c #9c9c9c9ca5a5",
   46.60 +"n c #a5a59c9ca5a5",
   46.61 +"m c #a5a59c9cadad",
   46.62 +"M c #adad9c9cadad",
   46.63 +"N c #a5a5a5a5a5a5",
   46.64 +"B c #a5a5a5a5adad",
   46.65 +"V c #adada5a5adad",
   46.66 +"C c Gray68",
   46.67 +"Z c #adadadadb5b5",
   46.68 +"A c #b5b5adadb5b5",
   46.69 +"S c Gray71",
   46.70 +"D c Gray74",
   46.71 +"F c #9494c6c69494",
   46.72 +"G c #9c9ccecea5a5",
   46.73 +"H c #bdbdd6d6bdbd",
   46.74 +"J c #c0c0c0c0c0c0",
   46.75 +"K c #c6c6c6c6c6c6",
   46.76 +"L c #cecec6c6cece",
   46.77 +"P c #cececececece",
   46.78 +"I c #cecececed6d6",
   46.79 +"U c #d6d6ceced6d6",
   46.80 +"Y c #d6d6cecedede",
   46.81 +"T c Gray84",
   46.82 +"R c #d6d6d6d6dede",
   46.83 +"E c #deded6d6dede",
   46.84 +"W c Gray87",
   46.85 +"Q c #deded6d6e7e7",
   46.86 +"! c #dedededee7e7",
   46.87 +"~ c #d6d6ffffd6d6",
   46.88 +"^ c #e7e7dedee7e7",
   46.89 +"/ c #e7e7e7e7e7e7",
   46.90 +"( c #e7e7e7e7efef",
   46.91 +") c #efefe7e7efef",
   46.92 +"_ c #efefefefefef",
   46.93 +"` c #e7e7ffffe7e7",
   46.94 +"' c Gray97",
   46.95 +"] c Gray100",
   46.96 +"[ c None",
   46.97 +/* pixels */
   46.98 +"[[[[[[SDPPPPKKDDCD[[[[",
   46.99 +"[[[[[[D_/////___WD[[[[",
  46.100 +"[[[[[[DKKKPPKKKKDK[[[[",
  46.101 +"[[[[[[SDDDDSDDSSCD[[[[",
  46.102 +"[[[[[KCKDKKKDDDKS[[[[[",
  46.103 +"[[[[[DDSDDDDDDKKS[[[[[",
  46.104 +"[[[[[DSKDDDDDKDKC[[[[[",
  46.105 +"[[[[[KDDDDDDDDDDS[[[[[",
  46.106 +"[[[[[CP/WWWWWWTWNNZ[[[",
  46.107 +"[[[Dc9STPTPTPTWWj427S[",
  46.108 +"[[Dziq0000000pag8<%@2N",
  46.109 +"[DcE(!ERRRRUYGtFn2##O<",
  46.110 +"Db)]]]]]]]]]~ewePa;@X#",
  46.111 +"V']]]]]]]]]]`yru]Q0@ #",
  46.112 +"BRILITRRW^!E!RHUILhO @",
  46.113 +"jAZVBmBnmmNmnmMvzh6o #",
  46.114 +"jZZmBnnnbnbbbbvxxg6o +",
  46.115 +"lmmnbnbbbvcvxxxvjs6O 3",
  46.116 +"jBnnvcvxvcvxvxzjhd8o+C",
  46.117 +"lsdgfgdhgdhhjhjkhg6+l[",
  46.118 +"S9%@$%&&&=--::>>:-:l[[",
  46.119 +"[[C511,:;;;**%++.2c[[["
  46.120 +};
    47.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    47.2 +++ b/icons/filesave.xpm	Sun Jan 30 12:59:10 2005 +0000
    47.3 @@ -0,0 +1,36 @@
    47.4 +/* XPM */
    47.5 +static const char *filesave_xpm[] = {
    47.6 +/* columns rows colors chars-per-pixel */
    47.7 +"22 22 8 1",
    47.8 +"  c Gray100",
    47.9 +". c #cab5d1",
   47.10 +"X c #c1c1c1",
   47.11 +"o c #848200",
   47.12 +"O c Gray0",
   47.13 +"+ c None",
   47.14 +"@ c Gray0",
   47.15 +"# c Gray0",
   47.16 +/* pixels */
   47.17 +"++++++++++++++++++++++",
   47.18 +"+OOOOOOOOOOOOOOOOOOOO+",
   47.19 +"+OooOXXXXXXXXXXXXOXXO+",
   47.20 +"+OooOXXXXXXXXXXXXOXXO+",
   47.21 +"+OooOXXXXXXXXX.XXOOOO+",
   47.22 +"+OooOXXX..XXXXXXXOooO+",
   47.23 +"+OooOXXX..XXXXXXXOooO+",
   47.24 +"+OooOXXXXXXXXXXXXOooO+",
   47.25 +"+OooOXXXXXXXXXXXXOooO+",
   47.26 +"+OooOXXXXXXXXXXXXOooO+",
   47.27 +"+OooOXXXXXXXXXXXXOooO+",
   47.28 +"+OoooOOOOOOOOOOOOoooO+",
   47.29 +"+OooooooooooooooooooO+",
   47.30 +"+OooooooooooooooooooO+",
   47.31 +"+OoooOOOOOOOOOOOOOooO+",
   47.32 +"+OoooOOOOOOOOOXXXOooO+",
   47.33 +"+OoooOOOOOOOOOXXXOooO+",
   47.34 +"+OoooOOOOOOOOOXXXOooO+",
   47.35 +"+OoooOOOOOOOOOXXXOooO+",
   47.36 +"+OoooOOOOOOOOOXXXOooO+",
   47.37 +"++OOOOOOOOOOOOOOOOOO++",
   47.38 +"++++++++++++++++++++++"
   47.39 +};
    48.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    48.2 +++ b/icons/flag-arrow-down.xpm	Sun Jan 30 12:59:10 2005 +0000
    48.3 @@ -0,0 +1,28 @@
    48.4 +/* XPM */
    48.5 +static char * flag_arrow_down_xpm[] = {
    48.6 +"22 22 3 1",
    48.7 +" 	c None",
    48.8 +".	c #000000",
    48.9 +"+	c #4F54FF",
   48.10 +"                      ",
   48.11 +"                      ",
   48.12 +"                      ",
   48.13 +"                      ",
   48.14 +"         .+++.        ",
   48.15 +"         .+++.        ",
   48.16 +"         .+++.        ",
   48.17 +"         .+++.        ",
   48.18 +"         .+++.        ",
   48.19 +"         .+++.        ",
   48.20 +"         .+++.        ",
   48.21 +"         .+++.        ",
   48.22 +"         .+++.        ",
   48.23 +"         .+++.        ",
   48.24 +"     ... .+++. ...    ",
   48.25 +"       .........      ",
   48.26 +"        .......       ",
   48.27 +"         .....        ",
   48.28 +"          ...         ",
   48.29 +"                      ",
   48.30 +"                      ",
   48.31 +"                      "};
    49.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    49.2 +++ b/icons/flag-arrow-up.xpm	Sun Jan 30 12:59:10 2005 +0000
    49.3 @@ -0,0 +1,28 @@
    49.4 +/* XPM */
    49.5 +static char * flag_arrow_up_xpm[] = {
    49.6 +"22 22 3 1",
    49.7 +" 	c None",
    49.8 +".	c #000000",
    49.9 +"+	c #4F54FF",
   49.10 +"                      ",
   49.11 +"                      ",
   49.12 +"                      ",
   49.13 +"                      ",
   49.14 +"          ...         ",
   49.15 +"         .....        ",
   49.16 +"        .......       ",
   49.17 +"       .........      ",
   49.18 +"     ... .+++. ...    ",
   49.19 +"         .+++.        ",
   49.20 +"         .+++.        ",
   49.21 +"         .+++.        ",
   49.22 +"         .+++.        ",
   49.23 +"         .+++.        ",
   49.24 +"         .+++.        ",
   49.25 +"         .+++.        ",
   49.26 +"         .+++.        ",
   49.27 +"         .+++.        ",
   49.28 +"         .+++.        ",
   49.29 +"                      ",
   49.30 +"                      ",
   49.31 +"                      "};
    50.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    50.2 +++ b/icons/flag-clock.xpm	Sun Jan 30 12:59:10 2005 +0000
    50.3 @@ -0,0 +1,31 @@
    50.4 +/* XPM */
    50.5 +static const char * flag_clock_xpm[] = {
    50.6 +"22 22 6 1",
    50.7 +" 	c None",
    50.8 +".	c #000000",
    50.9 +"+	c #FFFFFF",
   50.10 +"@	c #FF0000",
   50.11 +"#	c #FCFCFC",
   50.12 +"$	c #FDFDFD",
   50.13 +"                      ",
   50.14 +"                      ",
   50.15 +"        ......        ",
   50.16 +"      ...+@++...      ",
   50.17 +"    ...+++@++++...    ",
   50.18 +"    .+.++#@+++.++.    ",
   50.19 +"   ..++.+$@++++++..   ",
   50.20 +"   ..++++$@++++++..   ",
   50.21 +"  ..+.+++$@+++++.+..  ",
   50.22 +"  .+++++++@++@@++++.  ",
   50.23 +"  .+++++++@@@@+++++.  ",
   50.24 +"  ....++++@@++++....  ",
   50.25 +"  .++++++++++++++++.  ",
   50.26 +"  ..++++++++++++++..  ",
   50.27 +"   .+.++++++++++.+.   ",
   50.28 +"   ..++++++++++++..   ",
   50.29 +"    .++.++.+++.++.    ",
   50.30 +"    ...+++.++++...    ",
   50.31 +"      ...+.++...      ",
   50.32 +"        ......        ",
   50.33 +"                      ",
   50.34 +"                      "};
    51.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    51.2 +++ b/icons/flag-cross-red.xpm	Sun Jan 30 12:59:10 2005 +0000
    51.3 @@ -0,0 +1,27 @@
    51.4 +/* XPM */
    51.5 +static const char * flag_cross_red_xpm[] = {
    51.6 +"22 22 2 1",
    51.7 +" 	c None",
    51.8 +".	c #FF0000",
    51.9 +"                      ",
   51.10 +"                      ",
   51.11 +"                      ",
   51.12 +"                      ",
   51.13 +"  .....        ...    ",
   51.14 +"    ....     .....    ",
   51.15 +"      ...   ...       ",
   51.16 +"       .......        ",
   51.17 +"         ....         ",
   51.18 +"         ....         ",
   51.19 +"        ......        ",
   51.20 +"        .. ...        ",
   51.21 +"       ..   ...       ",
   51.22 +"      ..     ..       ",
   51.23 +"     ...      ..      ",
   51.24 +"     ...      ...     ",
   51.25 +"    ...        ..     ",
   51.26 +"   ...          ..    ",
   51.27 +"   ..            .    ",
   51.28 +"   .             ..   ",
   51.29 +"                      ",
   51.30 +"                      "};
    52.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    52.2 +++ b/icons/flag-exclamationmark.xpm	Sun Jan 30 12:59:10 2005 +0000
    52.3 @@ -0,0 +1,22 @@
    52.4 +/* XPM */
    52.5 +static const char * flag_exclamationmark_xpm[] = {
    52.6 +"14 17 2 1",
    52.7 +" 	c None",
    52.8 +".	c #FF0000",
    52.9 +"       .      ",
   52.10 +"      ...     ",
   52.11 +"      ...     ",
   52.12 +"      ...     ",
   52.13 +"      ...     ",
   52.14 +"      ...     ",
   52.15 +"      ...     ",
   52.16 +"      ...     ",
   52.17 +"      ...     ",
   52.18 +"       .      ",
   52.19 +"       .      ",
   52.20 +"       .      ",
   52.21 +"       .      ",
   52.22 +"              ",
   52.23 +"       .      ",
   52.24 +"      ...     ",
   52.25 +"       .      "};
    53.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    53.2 +++ b/icons/flag-flash.xpm	Sun Jan 30 12:59:10 2005 +0000
    53.3 @@ -0,0 +1,93 @@
    53.4 +/* XPM */
    53.5 +static char * flag_flash_xpm[] = {
    53.6 +"22 22 68 1",
    53.7 +" 	c None",
    53.8 +".	c #FFAC00",
    53.9 +"+	c #FEB805",
   53.10 +"@	c #FAB605",
   53.11 +"#	c #F8B105",
   53.12 +"$	c #FEAC00",
   53.13 +"%	c #FEEE18",
   53.14 +"&	c #FEF51B",
   53.15 +"*	c #FDF01B",
   53.16 +"=	c #EFB70B",
   53.17 +"-	c #E17F01",
   53.18 +";	c #FFFF1E",
   53.19 +">	c #FFFE1E",
   53.20 +",	c #FCED1B",
   53.21 +"'	c #FFF91C",
   53.22 +")	c #FFFF1C",
   53.23 +"!	c #FFFF27",
   53.24 +"~	c #F1B80A",
   53.25 +"{	c #FBB408",
   53.26 +"]	c #FEFC1D",
   53.27 +"^	c #FFFF24",
   53.28 +"/	c #FBC60C",
   53.29 +"(	c #DD7A00",
   53.30 +"_	c #EFA210",
   53.31 +":	c #F6CF15",
   53.32 +"<	c #F8E51B",
   53.33 +"[	c #FCF01A",
   53.34 +"}	c #FBE217",
   53.35 +"|	c #F6D313",
   53.36 +"1	c #F1C410",
   53.37 +"2	c #E27E01",
   53.38 +"3	c #F1B209",
   53.39 +"4	c #FFF31B",
   53.40 +"5	c #FEF31B",
   53.41 +"6	c #F1C511",
   53.42 +"7	c #D88113",
   53.43 +"8	c #F5C40F",
   53.44 +"9	c #FFE619",
   53.45 +"0	c #FFF71B",
   53.46 +"a	c #E68500",
   53.47 +"b	c #FDD814",
   53.48 +"c	c #FFFC1B",
   53.49 +"d	c #F5BB0B",
   53.50 +"e	c #FFDD14",
   53.51 +"f	c #FFDC14",
   53.52 +"g	c #F7D213",
   53.53 +"h	c #FCD412",
   53.54 +"i	c #FFD412",
   53.55 +"j	c #FED311",
   53.56 +"k	c #F0B20C",
   53.57 +"l	c #CD6200",
   53.58 +"m	c #CB6B0B",
   53.59 +"n	c #F0A607",
   53.60 +"o	c #FFCF10",
   53.61 +"p	c #F9C00D",
   53.62 +"q	c #D78205",
   53.63 +"r	c #DA7100",
   53.64 +"s	c #F19E06",
   53.65 +"t	c #FFFF15",
   53.66 +"u	c #D86A00",
   53.67 +"v	c #D56A00",
   53.68 +"w	c #FFD30D",
   53.69 +"x	c #E28704",
   53.70 +"y	c #E88C04",
   53.71 +"z	c #F8AB06",
   53.72 +"A	c #DA6800",
   53.73 +"B	c #F49A03",
   53.74 +"C	c #D06100",
   53.75 +"         .+@#..       ",
   53.76 +"         $%&*=-       ",
   53.77 +"        ..;>,-        ",
   53.78 +"        .')!~.        ",
   53.79 +"        {;]^-         ",
   53.80 +"       ./;^---(       ",
   53.81 +"       _:<[}|12       ",
   53.82 +"       ...3456-       ",
   53.83 +"         7890-        ",
   53.84 +"         abc--        ",
   53.85 +"        .def---       ",
   53.86 +"        .ghijkl       ",
   53.87 +"        .mnopq        ",
   53.88 +"         rstul        ",
   53.89 +"         vwxl         ",
   53.90 +"         yzA          ",
   53.91 +"         B-l          ",
   53.92 +"        .-l           ",
   53.93 +"        -C            ",
   53.94 +"        l             ",
   53.95 +"        -             ",
   53.96 +"                      "};
    54.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    54.2 +++ b/icons/flag-heart.xpm	Sun Jan 30 12:59:10 2005 +0000
    54.3 @@ -0,0 +1,106 @@
    54.4 +/* XPM */
    54.5 +static const char * flag_heart_xpm[] = {
    54.6 +"22 22 81 1",
    54.7 +" 	c None",
    54.8 +".	c #020204",
    54.9 +"+	c #B63604",
   54.10 +"@	c #D23E04",
   54.11 +"#	c #C63A04",
   54.12 +"$	c #B62E04",
   54.13 +"%	c #760204",
   54.14 +"&	c #9D0204",
   54.15 +"*	c #AA0204",
   54.16 +"=	c #A23A04",
   54.17 +"-	c #D65604",
   54.18 +";	c #FE6A0C",
   54.19 +">	c #FE7A04",
   54.20 +",	c #FC6204",
   54.21 +"'	c #F25604",
   54.22 +")	c #EA2604",
   54.23 +"!	c #AA2204",
   54.24 +"~	c #820204",
   54.25 +"{	c #D50204",
   54.26 +"]	c #B80204",
   54.27 +"^	c #2A1604",
   54.28 +"/	c #FA8624",
   54.29 +"(	c #FE9A44",
   54.30 +"_	c #FE9E55",
   54.31 +":	c #FE7E0C",
   54.32 +"<	c #A22A04",
   54.33 +"[	c #EE0204",
   54.34 +"}	c #FE4A04",
   54.35 +"|	c #FE3A04",
   54.36 +"1	c #E20204",
   54.37 +"2	c #BE4204",
   54.38 +"3	c #F47E1C",
   54.39 +"4	c #FEAA76",
   54.40 +"5	c #FEB699",
   54.41 +"6	c #FEAE80",
   54.42 +"7	c #F05A04",
   54.43 +"8	c #BE3204",
   54.44 +"9	c #3E0204",
   54.45 +"0	c #FE4204",
   54.46 +"a	c #FE0204",
   54.47 +"b	c #D24604",
   54.48 +"c	c #FEB28F",
   54.49 +"d	c #FE8214",
   54.50 +"e	c #CE1A04",
   54.51 +"f	c #160204",
   54.52 +"g	c #D24A04",
   54.53 +"h	c #F6821C",
   54.54 +"i	c #FEA674",
   54.55 +"j	c #FEA664",
   54.56 +"k	c #FE8E1C",
   54.57 +"l	c #FA4E04",
   54.58 +"m	c #DE0E04",
   54.59 +"n	c #FE5A04",
   54.60 +"o	c #FE1A04",
   54.61 +"p	c #BA3A04",
   54.62 +"q	c #EA5A04",
   54.63 +"r	c #FE8624",
   54.64 +"s	c #FEA27C",
   54.65 +"t	c #FE8E2C",
   54.66 +"u	c #FE7608",
   54.67 +"v	c #FD5604",
   54.68 +"w	c #FE1204",
   54.69 +"x	c #F50204",
   54.70 +"y	c #C20204",
   54.71 +"z	c #C62A04",
   54.72 +"A	c #FA7614",
   54.73 +"B	c #FE0E04",
   54.74 +"C	c #A63204",
   54.75 +"D	c #EA5E04",
   54.76 +"E	c #222204",
   54.77 +"F	c #AE3E04",
   54.78 +"G	c #FE0A04",
   54.79 +"H	c #EA2A04",
   54.80 +"I	c #BE0204",
   54.81 +"J	c #AA2604",
   54.82 +"K	c #FE4604",
   54.83 +"L	c #860204",
   54.84 +"M	c #EC1E04",
   54.85 +"N	c #FE2E04",
   54.86 +"O	c #C22204",
   54.87 +"P	c #F60E04",
   54.88 +"                      ",
   54.89 +"    .....     .....   ",
   54.90 +"  ..+@@#$.   .%&*&%.  ",
   54.91 +" .=-;>,')!. .~{{{{]&. ",
   54.92 +" ^-/(__:')<.%{[}|[1]~.",
   54.93 +".23_456_:789*[}0a[[]~.",
   54.94 +".b345c4(d,ef{||aaa[]~.",
   54.95 +".ghi56jk>lm~[aaaaa[]~.",
   54.96 +".b3_c4(:no1*[aaaaa[]~.",
   54.97 +".pqrs4tuvwxyaaaaaa[]~.",
   54.98 +" .zA__t,lBaaaaaaa[]~. ",
   54.99 +" .CDdtk,noaaaaaaa[]~. ",
  54.100 +"  EFq;d;,|Gaaaaa[{]~. ",
  54.101 +"   .#Hlu,0Gaaaaa1I~.  ",
  54.102 +"    .J)K,}waaaa[{L.   ",
  54.103 +"     .#)0n|Gaax{~.    ",
  54.104 +"      .!M||Gax{&.     ",
  54.105 +"       .#MNGa1*.      ",
  54.106 +"       ..OPa1].       ",
  54.107 +"         .#a].        ",
  54.108 +"          .I.         ",
  54.109 +"           .          "};
    55.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    55.2 +++ b/icons/flag-hook-green.xpm	Sun Jan 30 12:59:10 2005 +0000
    55.3 @@ -0,0 +1,27 @@
    55.4 +/* XPM */
    55.5 +static char * flag_hook_green_xpm[] = {
    55.6 +"22 22 2 1",
    55.7 +" 	c None",
    55.8 +".	c #00B700",
    55.9 +"                      ",
   55.10 +"                      ",
   55.11 +"                      ",
   55.12 +"                      ",
   55.13 +"                  ..  ",
   55.14 +"                 ...  ",
   55.15 +"                ...   ",
   55.16 +"               ...    ",
   55.17 +"              ...     ",
   55.18 +"             ...      ",
   55.19 +"  ...        ...      ",
   55.20 +"   ...     ....       ",
   55.21 +"    ...    ..         ",
   55.22 +"    ...   ..          ",
   55.23 +"      ..  ..          ",
   55.24 +"      ... ..          ",
   55.25 +"       ....           ",
   55.26 +"       ....           ",
   55.27 +"        ...           ",
   55.28 +"        ...           ",
   55.29 +"                      ",
   55.30 +"                      "};
    56.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    56.2 +++ b/icons/flag-lamp.xpm	Sun Jan 30 12:59:10 2005 +0000
    56.3 @@ -0,0 +1,29 @@
    56.4 +/* XPM */
    56.5 +static const char * flag_lamp_xpm[] = {
    56.6 +"22 22 4 1",
    56.7 +" 	c None",
    56.8 +".	c #FFF200",
    56.9 +"+	c #000000",
   56.10 +"@	c #B56503",
   56.11 +"  .                 . ",
   56.12 +"  ...   ++++++    ..  ",
   56.13 +"    . +++....+++ ..   ",
   56.14 +"     ++........++     ",
   56.15 +"     +..........+     ",
   56.16 +"    ++..........++    ",
   56.17 +"    +............+    ",
   56.18 +"....+............+....",
   56.19 +"    +............+    ",
   56.20 +"    ++..........++    ",
   56.21 +"     +..........+     ",
   56.22 +"   ..++........++..   ",
   56.23 +"  ..  +++....+++  ..  ",
   56.24 +"..      ++++++     ...",
   56.25 +"        +@@@@+        ",
   56.26 +"        +@@@@+        ",
   56.27 +"         +@@+         ",
   56.28 +"         +@@+         ",
   56.29 +"        +@@@@+        ",
   56.30 +"         ++++         ",
   56.31 +"          ++          ",
   56.32 +"                      "};
    57.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    57.2 +++ b/icons/flag-lifebelt.xpm	Sun Jan 30 12:59:10 2005 +0000
    57.3 @@ -0,0 +1,209 @@
    57.4 +/* XPM */
    57.5 +static char * flag_lifebelt_xpm[] = {
    57.6 +"22 22 184 2",
    57.7 +"  	c None",
    57.8 +". 	c #EC0000",
    57.9 +"+ 	c #FF8B8B",
   57.10 +"@ 	c #FFFFFF",
   57.11 +"# 	c #DCB3B3",
   57.12 +"$ 	c #6F3737",
   57.13 +"% 	c #979090",
   57.14 +"& 	c #F24343",
   57.15 +"* 	c #FEDCDC",
   57.16 +"= 	c #F9DEDE",
   57.17 +"- 	c #F4C5C5",
   57.18 +"; 	c #F3C2C1",
   57.19 +"> 	c #F4CCCD",
   57.20 +", 	c #FEFEFE",
   57.21 +"' 	c #FDFCFC",
   57.22 +") 	c #FEFDFD",
   57.23 +"! 	c #EEE3E3",
   57.24 +"~ 	c #8E6C6C",
   57.25 +"{ 	c #A47F7F",
   57.26 +"] 	c #F3B8B8",
   57.27 +"^ 	c #F2AEB0",
   57.28 +"/ 	c #FEEADE",
   57.29 +"( 	c #F7DCF5",
   57.30 +"_ 	c #D51374",
   57.31 +": 	c #FF48A5",
   57.32 +"< 	c #F6F1F1",
   57.33 +"[ 	c #FCFFFF",
   57.34 +"} 	c #FF9898",
   57.35 +"| 	c #010000",
   57.36 +"1 	c #F9FBFB",
   57.37 +"2 	c #FAECEC",
   57.38 +"3 	c #E48C88",
   57.39 +"4 	c #D05970",
   57.40 +"5 	c #B41300",
   57.41 +"6 	c #F3F5F2",
   57.42 +"7 	c #FDFDF9",
   57.43 +"8 	c #F4D5D5",
   57.44 +"9 	c #F9A5A5",
   57.45 +"0 	c #FF2F2F",
   57.46 +"a 	c #AAA2A2",
   57.47 +"b 	c #FBFBFB",
   57.48 +"c 	c #FCFCFC",
   57.49 +"d 	c #FFFEFE",
   57.50 +"e 	c #FCE5F9",
   57.51 +"f 	c #816704",
   57.52 +"g 	c #5A7357",
   57.53 +"h 	c #E3788A",
   57.54 +"i 	c #E37F81",
   57.55 +"j 	c #EF8C8C",
   57.56 +"k 	c #FFA0A0",
   57.57 +"l 	c #C61E1E",
   57.58 +"m 	c #FEFFFF",
   57.59 +"n 	c #F9F9F9",
   57.60 +"o 	c #D00C33",
   57.61 +"p 	c #E88281",
   57.62 +"q 	c #F58181",
   57.63 +"r 	c #EB4343",
   57.64 +"s 	c #8DC5C5",
   57.65 +"t 	c #C9BFBF",
   57.66 +"u 	c #FCFCFB",
   57.67 +"v 	c #FFFEFF",
   57.68 +"w 	c #D4E39F",
   57.69 +"x 	c #8D4307",
   57.70 +"y 	c #DD4C59",
   57.71 +"z 	c #ED605F",
   57.72 +"A 	c #FA4C4C",
   57.73 +"B 	c #856565",
   57.74 +"C 	c #E6DFDF",
   57.75 +"D 	c #F7FDFD",
   57.76 +"E 	c #FDFFFF",
   57.77 +"F 	c #FEFFFA",
   57.78 +"G 	c #C92F30",
   57.79 +"H 	c #E6504F",
   57.80 +"I 	c #FB4444",
   57.81 +"J 	c #AD2828",
   57.82 +"K 	c #EABABA",
   57.83 +"L 	c #F6BFBF",
   57.84 +"M 	c #F2C6C4",
   57.85 +"N 	c #ECB8B9",
   57.86 +"O 	c #B64640",
   57.87 +"P 	c #E25C5B",
   57.88 +"Q 	c #F65454",
   57.89 +"R 	c #CC2929",
   57.90 +"S 	c #F00000",
   57.91 +"T 	c #F30303",
   57.92 +"U 	c #D30B13",
   57.93 +"V 	c #B70900",
   57.94 +"W 	c #C8D1C2",
   57.95 +"X 	c #F3FFFF",
   57.96 +"Y 	c #ECFFFF",
   57.97 +"Z 	c #D8BDBD",
   57.98 +"` 	c #EC2424",
   57.99 +" .	c #F40303",
  57.100 +"..	c #D5130E",
  57.101 +"+.	c #C10813",
  57.102 +"@.	c #CFCBCD",
  57.103 +"#.	c #EBEAEA",
  57.104 +"$.	c #E7EAEA",
  57.105 +"%.	c #BE8484",
  57.106 +"&.	c #F86D6D",
  57.107 +"*.	c #F30202",
  57.108 +"=.	c #E21613",
  57.109 +"-.	c #C30201",
  57.110 +";.	c #FFFDFF",
  57.111 +">.	c #EBEBEB",
  57.112 +",.	c #E3E3E3",
  57.113 +"'.	c #976464",
  57.114 +").	c #F80202",
  57.115 +"!.	c #EF1211",
  57.116 +"~.	c #CE0808",
  57.117 +"{.	c #AD531E",
  57.118 +"].	c #F4F4F4",
  57.119 +"^.	c #E8E6E6",
  57.120 +"/.	c #DDDCDC",
  57.121 +"(.	c #7E5959",
  57.122 +"_.	c #FF5F5F",
  57.123 +":.	c #FD0F0F",
  57.124 +"<.	c #E21A1A",
  57.125 +"[.	c #CB0000",
  57.126 +"}.	c #D3F8DE",
  57.127 +"|.	c #6B0000",
  57.128 +"1.	c #FA6D68",
  57.129 +"2.	c #EDFFFF",
  57.130 +"3.	c #DACECE",
  57.131 +"4.	c #C7BBBB",
  57.132 +"5.	c #895454",
  57.133 +"6.	c #EF0D0D",
  57.134 +"7.	c #F40101",
  57.135 +"8.	c #F08585",
  57.136 +"9.	c #A1B578",
  57.137 +"0.	c #2F242C",
  57.138 +"a.	c #F40902",
  57.139 +"b.	c #D70404",
  57.140 +"c.	c #E5A5A5",
  57.141 +"d.	c #E2F6F6",
  57.142 +"e.	c #D0B4B4",
  57.143 +"f.	c #FF0000",
  57.144 +"g.	c #E1CBCB",
  57.145 +"h.	c #EDFAFA",
  57.146 +"i.	c #F5F5F5",
  57.147 +"j.	c #FBFCFA",
  57.148 +"k.	c #D8AEF0",
  57.149 +"l.	c #B10002",
  57.150 +"m.	c #F80000",
  57.151 +"n.	c #D60A06",
  57.152 +"o.	c #F30B0B",
  57.153 +"p.	c #F51010",
  57.154 +"q.	c #F20000",
  57.155 +"r.	c #E77878",
  57.156 +"s.	c #DCE9E9",
  57.157 +"t.	c #E4E4E4",
  57.158 +"u.	c #ECECEC",
  57.159 +"v.	c #EFEFEE",
  57.160 +"w.	c #F1F2EF",
  57.161 +"x.	c #FDE6E8",
  57.162 +"y.	c #DE0202",
  57.163 +"z.	c #E10D0B",
  57.164 +"A.	c #F00E0E",
  57.165 +"B.	c #F20F0F",
  57.166 +"C.	c #EE0C0C",
  57.167 +"D.	c #FF2424",
  57.168 +"E.	c #DAD4D4",
  57.169 +"F.	c #E6E7E7",
  57.170 +"G.	c #E8E8E8",
  57.171 +"H.	c #E9EEEE",
  57.172 +"I.	c #E9D2D2",
  57.173 +"J.	c #F20303",
  57.174 +"K.	c #F20E0E",
  57.175 +"L.	c #F50A0A",
  57.176 +"M.	c #D91616",
  57.177 +"N.	c #BBA4A4",
  57.178 +"O.	c #E2D4D4",
  57.179 +"P.	c #E8EEEE",
  57.180 +"Q.	c #E5F5F5",
  57.181 +"R.	c #E7CECE",
  57.182 +"S.	c #E30000",
  57.183 +"T.	c #E3D5D5",
  57.184 +"U.	c #AEB1B1",
  57.185 +"V.	c #B8B1B1",
  57.186 +"W.	c #AF9E9E",
  57.187 +"X.	c #DBCACA",
  57.188 +"Y.	c #CFADAD",
  57.189 +"Z.	c #DE3B3B",
  57.190 +"`.	c #9E4E4E",
  57.191 +"                                            ",
  57.192 +"            . + @ @ @ @ @ @ # $             ",
  57.193 +"        % & * = - ; > , ' ) @ ! ~           ",
  57.194 +"      { @ ] ^ / ( _ : @ @ , < [ } |         ",
  57.195 +"      @ 1 2 3 4 5       6 7 @ 8 9 0         ",
  57.196 +"    a b c d e f         g   h i j k l       ",
  57.197 +"    m n @ @                   o p q r s     ",
  57.198 +"  t b u v w                   x y z A B     ",
  57.199 +"  C D E F                       G H I J     ",
  57.200 +"  K L M N                       O P Q R     ",
  57.201 +"  S T U V                       W X Y Z     ",
  57.202 +"  `  ...+.                      @.#.$.%.    ",
  57.203 +"  &.*.=.-.                      ;.>.,.'.    ",
  57.204 +"    ).!.~.{.                    ].^./.(.    ",
  57.205 +"    _.:.<.[.}.              |.1.2.3.4.      ",
  57.206 +"    5.6.7.8.@ 9.          0.a.b.c.d.e.      ",
  57.207 +"      f.g.h.i.j.@ @ k.l.m.n.o.p.q.r.        ",
  57.208 +"        s.t.u.v.w.n x.y.z.A.B.C.D.          ",
  57.209 +"          E.F.F.G.H.I.J.K.L.f.M.            ",
  57.210 +"            N.O.P.Q.R.f.f.S.T.              ",
  57.211 +"            U.V.W.X.Y.Z.`.                  ",
  57.212 +"                                            "};
    58.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    58.2 +++ b/icons/flag-note.xpm	Sun Jan 30 12:59:10 2005 +0000
    58.3 @@ -0,0 +1,31 @@
    58.4 +/* XPM */
    58.5 +static const char *flag_note_xpm[] = {
    58.6 +/* columns rows colors chars-per-pixel */
    58.7 +"14 17 8 1",
    58.8 +"  c Gray100",
    58.9 +". c #8b8bfd",
   58.10 +"X c #3c3cfd",
   58.11 +"o c #000082",
   58.12 +"O c Gray0",
   58.13 +"+ c None",
   58.14 +"@ c Gray0",
   58.15 +"# c Gray0",
   58.16 +/* pixels */
   58.17 +"++++++++++++++",
   58.18 +"oooooooo++++++",
   58.19 +"o      oo+++++",
   58.20 +"o OOOO oXo++++",
   58.21 +"o      o.Xo+++",
   58.22 +"o OOOO o .Xo++",
   58.23 +"o      oooooo+",
   58.24 +"o OOOO      o+",
   58.25 +"o           o+",
   58.26 +"o OOOOOOOOO o+",
   58.27 +"o           o+",
   58.28 +"o OOOOOOOOO o+",
   58.29 +"o           o+",
   58.30 +"o OOOOOOOOO o+",
   58.31 +"o           o+",
   58.32 +"ooooooooooooo+",
   58.33 +"++++++++++++++"
   58.34 +};
    59.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    59.2 +++ b/icons/flag-questionmark.xpm	Sun Jan 30 12:59:10 2005 +0000
    59.3 @@ -0,0 +1,22 @@
    59.4 +/* XPM */
    59.5 +static const char * flag_questionmark_xpm[] = {
    59.6 +"14 17 2 1",
    59.7 +" 	c None",
    59.8 +".	c #FF0000",
    59.9 +"   ......     ",
   59.10 +"  .........   ",
   59.11 +"   .........  ",
   59.12 +"         ...  ",
   59.13 +"         ...  ",
   59.14 +"        ....  ",
   59.15 +"      .....   ",
   59.16 +"     .....    ",
   59.17 +"     ....     ",
   59.18 +"      ..      ",
   59.19 +"      ..      ",
   59.20 +"      ..      ",
   59.21 +"      ..      ",
   59.22 +"              ",
   59.23 +"       .      ",
   59.24 +"      ...     ",
   59.25 +"       .      "};
    60.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    60.2 +++ b/icons/flag-scrolled-right.xpm	Sun Jan 30 12:59:10 2005 +0000
    60.3 @@ -0,0 +1,30 @@
    60.4 +/* XPM */
    60.5 +static char * flag_scrolled_right_xpm[] = {
    60.6 +"22 22 5 1",
    60.7 +" 	c None",
    60.8 +".	c #000000",
    60.9 +"+	c #FFFFFF",
   60.10 +"@	c #898989",
   60.11 +"#	c #0000FF",
   60.12 +"  ..................  ",
   60.13 +" .++++++++++++++.@@@. ",
   60.14 +".++++++++++++++.@@@@@.",
   60.15 +".++++++++++++++.@@@@@.",
   60.16 +".++++++++++++++.@@@@@.",
   60.17 +".##++++++++++++..@@@.@",
   60.18 +".++#+++++++++++.@...@@",
   60.19 +".++#+++++++++++.@@@@@ ",
   60.20 +".###+++++++++##.@@@@  ",
   60.21 +".++#++....++#++.@@    ",
   60.22 +".+++##.++.##+++.@@    ",
   60.23 +".++#++....++#++.@@    ",
   60.24 +".###+++++++++##.@@    ",
   60.25 +".++#+++++++++++.@@    ",
   60.26 +".++#+++++++++++.@@    ",
   60.27 +".##++++++++++++.@@    ",
   60.28 +".++++++++++++++.@@    ",
   60.29 +"................@@    ",
   60.30 +"  @@@@@@@@@@@@@@@@    ",
   60.31 +"  @@@@@@@@@@@@@@@@    ",
   60.32 +"                      ",
   60.33 +"                      "};
    61.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    61.2 +++ b/icons/flag-smiley-good.xpm	Sun Jan 30 12:59:10 2005 +0000
    61.3 @@ -0,0 +1,28 @@
    61.4 +/* XPM */
    61.5 +static char * flag_smiley_good_xpm[] = {
    61.6 +"22 22 3 1",
    61.7 +" 	c None",
    61.8 +".	c #000000",
    61.9 +"+	c #FFF200",
   61.10 +"                      ",
   61.11 +"                      ",
   61.12 +"        ......        ",
   61.13 +"      ...++++...      ",
   61.14 +"    ...++++++++...    ",
   61.15 +"    .++++++++++++.    ",
   61.16 +"   ..++++++++++++..   ",
   61.17 +"   .++++.++++.++++.   ",
   61.18 +"  ..++++.++++.++++..  ",
   61.19 +"  .+++++.++++.+++++.  ",
   61.20 +"  .+++++.++++.+++++.  ",
   61.21 +"  .++++++++++++++++.  ",
   61.22 +"  .++.++++++++++.++.  ",
   61.23 +"  ..++.++++++++.++..  ",
   61.24 +"   .+++.++++++.+++.   ",
   61.25 +"   ..+++......+++..   ",
   61.26 +"    .++++++++++++.    ",
   61.27 +"    ...++++++++...    ",
   61.28 +"      ...++++...      ",
   61.29 +"        ......        ",
   61.30 +"                      ",
   61.31 +"                      "};
    62.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    62.2 +++ b/icons/flag-smiley-sad.xpm	Sun Jan 30 12:59:10 2005 +0000
    62.3 @@ -0,0 +1,28 @@
    62.4 +/* XPM */
    62.5 +static char * flag_smiley_sad_xpm[] = {
    62.6 +"22 22 3 1",
    62.7 +" 	c None",
    62.8 +".	c #000000",
    62.9 +"+	c #FFF200",
   62.10 +"                      ",
   62.11 +"                      ",
   62.12 +"        ......        ",
   62.13 +"      ...++++...      ",
   62.14 +"    ...++++++++...    ",
   62.15 +"    .++++++++++++.    ",
   62.16 +"   ..++++++++++++..   ",
   62.17 +"   .++++.++++.++++.   ",
   62.18 +"  ..++++.++++.++++..  ",
   62.19 +"  .+++++.++++.+++++.  ",
   62.20 +"  .+++++.++++.+++++.  ",
   62.21 +"  .++++++++++++++++.  ",
   62.22 +"  .++++++++++++++++.  ",
   62.23 +"  ..++++......++++..  ",
   62.24 +"   .+++.++++++.+++.   ",
   62.25 +"   ..+.++++++++.+..   ",
   62.26 +"    .++++++++++++.    ",
   62.27 +"    ...++++++++...    ",
   62.28 +"      ...++++...      ",
   62.29 +"        ......        ",
   62.30 +"                      ",
   62.31 +"                      "};
    63.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    63.2 +++ b/icons/flag-stopsign.xpm	Sun Jan 30 12:59:10 2005 +0000
    63.3 @@ -0,0 +1,28 @@
    63.4 +/* XPM */
    63.5 +static const char * flag_stopsign_xpm[] = {
    63.6 +"22 22 3 1",
    63.7 +" 	c None",
    63.8 +".	c #FF0000",
    63.9 +"+	c #FFFFFF",
   63.10 +"                      ",
   63.11 +"       ..........     ",
   63.12 +"      ............    ",
   63.13 +"     ..............   ",
   63.14 +"    ................  ",
   63.15 +"   .................. ",
   63.16 +"   .................. ",
   63.17 +"   .................. ",
   63.18 +"   .+++.+++..++..+++. ",
   63.19 +"   .+....+..+..+.+.+. ",
   63.20 +"   .+++..+..+..+.+++. ",
   63.21 +"   ...+..+..+..+.+... ",
   63.22 +"   .+++..+...++..+... ",
   63.23 +"   .................. ",
   63.24 +"   .................. ",
   63.25 +"    ................  ",
   63.26 +"     ..............   ",
   63.27 +"      ............    ",
   63.28 +"       ..........     ",
   63.29 +"                      ",
   63.30 +"                      ",
   63.31 +"                      "};
    64.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    64.2 +++ b/icons/flag-thumb-down.xpm	Sun Jan 30 12:59:10 2005 +0000
    64.3 @@ -0,0 +1,28 @@
    64.4 +/* XPM */
    64.5 +static char * flag_thumb_down_xpm[] = {
    64.6 +"22 22 3 1",
    64.7 +" 	c None",
    64.8 +".	c #000000",
    64.9 +"+	c #FFCA4F",
   64.10 +"       .....++++++    ",
   64.11 +"       .++++.+++++    ",
   64.12 +"      ......++++++    ",
   64.13 +"     .+++++.++++++    ",
   64.14 +"     .++++..++++++    ",
   64.15 +"     .....++++++++    ",
   64.16 +"    .+++++.++++++.    ",
   64.17 +"    .+++++.++++++.    ",
   64.18 +"     .....+++++++.    ",
   64.19 +"    .+++++.++++++.    ",
   64.20 +"    .+++++.+++++.     ",
   64.21 +"     .....++++++.     ",
   64.22 +"      .+++.+++++.     ",
   64.23 +"       .....++++.     ",
   64.24 +"           .+++.      ",
   64.25 +"          .++++.      ",
   64.26 +"          .++++.      ",
   64.27 +"          .+++.       ",
   64.28 +"           .++.       ",
   64.29 +"           .++.       ",
   64.30 +"           .++.       ",
   64.31 +"            ...       "};
    65.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    65.2 +++ b/icons/flag-thumb-up.xpm	Sun Jan 30 12:59:10 2005 +0000
    65.3 @@ -0,0 +1,28 @@
    65.4 +/* XPM */
    65.5 +static char * flag_thumb_up_xpm[] = {
    65.6 +"22 22 3 1",
    65.7 +" 	c None",
    65.8 +".	c #000000",
    65.9 +"+	c #FFCA4F",
   65.10 +"            ...       ",
   65.11 +"           .++.       ",
   65.12 +"           .++.       ",
   65.13 +"           .++.       ",
   65.14 +"          .+++.       ",
   65.15 +"          .++++.      ",
   65.16 +"          .++++.      ",
   65.17 +"           .+++.      ",
   65.18 +"       .....++++.     ",
   65.19 +"      .+++.+++++.     ",
   65.20 +"     .....++++++.     ",
   65.21 +"    .+++++.+++++.     ",
   65.22 +"    .+++++.++++++.    ",
   65.23 +"     .....+++++++.    ",
   65.24 +"    .+++++.++++++.    ",
   65.25 +"    .+++++.++++++.    ",
   65.26 +"     .....++++++++    ",
   65.27 +"     .++++..++++++    ",
   65.28 +"     .+++++.++++++    ",
   65.29 +"      ......++++++    ",
   65.30 +"       .++++.+++++    ",
   65.31 +"       .....++++++    "};
    66.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    66.2 +++ b/icons/flag-tmpUnscrolled-right.xpm	Sun Jan 30 12:59:10 2005 +0000
    66.3 @@ -0,0 +1,31 @@
    66.4 +/* XPM */
    66.5 +static char * flag_tmpUnscrolled_right_xpm[] = {
    66.6 +"22 22 6 1",
    66.7 +" 	c None",
    66.8 +".	c #000000",
    66.9 +"+	c #FFFFFF",
   66.10 +"@	c #898989",
   66.11 +"#	c #0037FF",
   66.12 +"$	c #FFEE00",
   66.13 +"  ..................  ",
   66.14 +" .++++++++++++++.@@@. ",
   66.15 +".++++++++++++++.@@@@@.",
   66.16 +".++++++++++++++.@@@@@.",
   66.17 +".++++++++++++++.@@@@@.",
   66.18 +".++++++++++++++..@@@.@",
   66.19 +".++++++++++++++.@...@@",
   66.20 +".++..........++.@@@@@ ",
   66.21 +".++.########.@+.@@@@  ",
   66.22 +".++.########.@+.@@    ",
   66.23 +".++.$$$$$$$$.@+.@@    ",
   66.24 +".+++.$$$$$$.@@+.@@    ",
   66.25 +".+++..$$$$.@@++.@@    ",
   66.26 +".++++..$$.@@+++.@@    ",
   66.27 +".+++++.$$.@@+++.@@    ",
   66.28 +".++++.####.@@@+.@@    ",
   66.29 +".+++.##$$##.@@+.@@    ",
   66.30 +"....########.@..@@    ",
   66.31 +"  @.###$$###.@@@@@    ",
   66.32 +"  @.$$$$$$$$.@@@@@    ",
   66.33 +"   ..........@        ",
   66.34 +"    @@@@@@@@@@        "};
    67.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    67.2 +++ b/icons/flag-url.xpm	Sun Jan 30 12:59:10 2005 +0000
    67.3 @@ -0,0 +1,222 @@
    67.4 +/* XPM */
    67.5 +static char * flag_url_xpm[] = {
    67.6 +"22 22 197 2",
    67.7 +"  	c None",
    67.8 +". 	c #000000",
    67.9 +"+ 	c #29673B",
   67.10 +"@ 	c #21D167",
   67.11 +"# 	c #010105",
   67.12 +"$ 	c #2A30C6",
   67.13 +"% 	c #040515",
   67.14 +"& 	c #1B626A",
   67.15 +"* 	c #2CFF00",
   67.16 +"= 	c #202496",
   67.17 +"- 	c #211A9D",
   67.18 +"; 	c #1F447C",
   67.19 +"> 	c #273D8B",
   67.20 +", 	c #111E34",
   67.21 +"' 	c #06071E",
   67.22 +") 	c #1C208C",
   67.23 +"! 	c #6D785C",
   67.24 +"~ 	c #24F128",
   67.25 +"{ 	c #1A14A0",
   67.26 +"] 	c #2A3989",
   67.27 +"^ 	c #1800C0",
   67.28 +"/ 	c #20BF14",
   67.29 +"( 	c #2C5B3F",
   67.30 +"_ 	c #1D784E",
   67.31 +": 	c #262BB4",
   67.32 +"< 	c #1E2292",
   67.33 +"[ 	c #363AC6",
   67.34 +"} 	c #3B3FCF",
   67.35 +"| 	c #0C258B",
   67.36 +"1 	c #3CCC36",
   67.37 +"2 	c #48E527",
   67.38 +"3 	c #249058",
   67.39 +"4 	c #42DC30",
   67.40 +"5 	c #32934D",
   67.41 +"6 	c #25976A",
   67.42 +"7 	c #1A4245",
   67.43 +"8 	c #0D0F3D",
   67.44 +"9 	c #181B71",
   67.45 +"0 	c #5559FF",
   67.46 +"a 	c #5155FF",
   67.47 +"b 	c #6408FF",
   67.48 +"c 	c #28FF20",
   67.49 +"d 	c #19FF11",
   67.50 +"e 	c #51A249",
   67.51 +"f 	c #2AFF00",
   67.52 +"g 	c #2B5648",
   67.53 +"h 	c #060100",
   67.54 +"i 	c #111452",
   67.55 +"j 	c #13177A",
   67.56 +"k 	c #4549E6",
   67.57 +"l 	c #5B5FFF",
   67.58 +"m 	c #000086",
   67.59 +"n 	c #794771",
   67.60 +"o 	c #33E62B",
   67.61 +"p 	c #2EFF00",
   67.62 +"q 	c #20FF08",
   67.63 +"r 	c #28006A",
   67.64 +"s 	c #24BA53",
   67.65 +"t 	c #2428A0",
   67.66 +"u 	c #3539C2",
   67.67 +"v 	c #4C50F5",
   67.68 +"w 	c #3D41D4",
   67.69 +"x 	c #27FF1F",
   67.70 +"y 	c #2BF823",
   67.71 +"z 	c #1D2899",
   67.72 +"A 	c #368253",
   67.73 +"B 	c #27FF1D",
   67.74 +"C 	c #2A953E",
   67.75 +"D 	c #1D2188",
   67.76 +"E 	c #9795B7",
   67.77 +"F 	c #5D61FF",
   67.78 +"G 	c #262AA4",
   67.79 +"H 	c #7A00FF",
   67.80 +"I 	c #00FF05",
   67.81 +"J 	c #74526C",
   67.82 +"K 	c #25FF1D",
   67.83 +"L 	c #73546B",
   67.84 +"M 	c #1DFF15",
   67.85 +"N 	c #0E825D",
   67.86 +"O 	c #25AF4B",
   67.87 +"P 	c #3F47FF",
   67.88 +"Q 	c #040413",
   67.89 +"R 	c #242324",
   67.90 +"S 	c #8785A7",
   67.91 +"T 	c #5357FF",
   67.92 +"U 	c #4B4FF3",
   67.93 +"V 	c #2E31FF",
   67.94 +"W 	c #94AD7A",
   67.95 +"X 	c #32E82A",
   67.96 +"Y 	c #2EF126",
   67.97 +"Z 	c #46BB3E",
   67.98 +"` 	c #31564D",
   67.99 +" .	c #249659",
  67.100 +"..	c #1A1D7B",
  67.101 +"+.	c #080A28",
  67.102 +"@.	c #010102",
  67.103 +"#.	c #201F20",
  67.104 +"$.	c #4F53FA",
  67.105 +"%.	c #5A5EFF",
  67.106 +"&.	c #4D64EB",
  67.107 +"*.	c #40E335",
  67.108 +"=.	c #20FF00",
  67.109 +"-.	c #448F3A",
  67.110 +";.	c #1CFF00",
  67.111 +">.	c #1B1F8C",
  67.112 +",.	c #4144BC",
  67.113 +"'.	c #575BFF",
  67.114 +").	c #3A3ECE",
  67.115 +"!.	c #4E60F0",
  67.116 +"~.	c #37C073",
  67.117 +"{.	c #272BA6",
  67.118 +"].	c #3E42D5",
  67.119 +"^.	c #4A4EF0",
  67.120 +"/.	c #3236BC",
  67.121 +"(.	c #22269F",
  67.122 +"_.	c #02020A",
  67.123 +":.	c #908EC8",
  67.124 +"<.	c #171B83",
  67.125 +"[.	c #5458FF",
  67.126 +"}.	c #5256FF",
  67.127 +"|.	c #630CFF",
  67.128 +"1.	c #21FF00",
  67.129 +"2.	c #5A50FF",
  67.130 +"3.	c #476D67",
  67.131 +"4.	c #6339FF",
  67.132 +"5.	c #211C9C",
  67.133 +"6.	c #262BB1",
  67.134 +"7.	c #2227A1",
  67.135 +"8.	c #3F45FD",
  67.136 +"9.	c #060606",
  67.137 +"0.	c #464AE7",
  67.138 +"a.	c #4E52F9",
  67.139 +"b.	c #1A00A0",
  67.140 +"c.	c #39AC6E",
  67.141 +"d.	c #29FF0B",
  67.142 +"e.	c #26358C",
  67.143 +"f.	c #22367A",
  67.144 +"g.	c #236261",
  67.145 +"h.	c #112920",
  67.146 +"i.	c #0B0C32",
  67.147 +"j.	c #070B7E",
  67.148 +"k.	c #4044DB",
  67.149 +"l.	c #565AFF",
  67.150 +"m.	c #393DCB",
  67.151 +"n.	c #104858",
  67.152 +"o.	c #080C63",
  67.153 +"p.	c #474BEA",
  67.154 +"q.	c #5E62FF",
  67.155 +"r.	c #2D31B3",
  67.156 +"s.	c #237A6B",
  67.157 +"t.	c #004D21",
  67.158 +"u.	c #1F744D",
  67.159 +"v.	c #285D49",
  67.160 +"w.	c #3F9474",
  67.161 +"x.	c #3438C1",
  67.162 +"y.	c #474BE9",
  67.163 +"z.	c #3135BA",
  67.164 +"A.	c #4F53FB",
  67.165 +"B.	c #595DFF",
  67.166 +"C.	c #244B6E",
  67.167 +"D.	c #408649",
  67.168 +"E.	c #24674B",
  67.169 +"F.	c #16362B",
  67.170 +"G.	c #11261E",
  67.171 +"H.	c #0E1270",
  67.172 +"I.	c #131779",
  67.173 +"J.	c #4448E2",
  67.174 +"K.	c #23397A",
  67.175 +"L.	c #245749",
  67.176 +"M.	c #2C5C2B",
  67.177 +"N.	c #AAA59B",
  67.178 +"O.	c #2328DB",
  67.179 +"P.	c #0A0E66",
  67.180 +"Q.	c #676BFF",
  67.181 +"R.	c #2629A4",
  67.182 +"S.	c #00001D",
  67.183 +"T.	c #0D116C",
  67.184 +"U.	c #2429AD",
  67.185 +"V.	c #327259",
  67.186 +"W.	c #3A876A",
  67.187 +"X.	c #676998",
  67.188 +"Y.	c #4D51F5",
  67.189 +"Z.	c #5F63FF",
  67.190 +"`.	c #252B9F",
  67.191 +" +	c #212598",
  67.192 +".+	c #171862",
  67.193 +"++	c #2C654F",
  67.194 +"@+	c #112B23",
  67.195 +"#+	c #000085",
  67.196 +"$+	c #000095",
  67.197 +"%+	c #2227A4",
  67.198 +"&+	c #030000",
  67.199 +"*+	c #000047",
  67.200 +"=+	c #353996",
  67.201 +"-+	c #373A98",
  67.202 +";+	c #313277",
  67.203 +">+	c #222894",
  67.204 +"            . + @ # $ % . . .               ",
  67.205 +"          & * = = = - ; > , . '             ",
  67.206 +"        = ) ! ~ { ] ^ / ( _ : . .           ",
  67.207 +"      < [ } | 1 2 3 4 5 6 7 8 9 . .         ",
  67.208 +"    = 0 [ a b c d e f = g & h i = . .       ",
  67.209 +"  j k a l a m c n o p q r s = = . . .       ",
  67.210 +"  t u v w a b c x y z A B C = = D $ . .     ",
  67.211 +"E F G a a a H I J K L M N O = = = P Q . R   ",
  67.212 +"S T U a a a V W X Y M Z `  .= = ..+.@.. #.  ",
  67.213 +"S $.%.a a a a &.c *.=.-.;.>.= = = . . . ,.  ",
  67.214 +"S '.).a a a a !.~.c {.].^./.= = = (._.. #.  ",
  67.215 +":.<.[.a a a a }.|.1.2.3.4.= = 5.6.. 7.8.9.  ",
  67.216 +"  <.0.a a a a a.a a b.c.d.e.f.g.h.. i..     ",
  67.217 +"  j.k.l.m.a n.a o.p.q.r.= s.t.u.v.w.. .     ",
  67.218 +"    /.x.y.a z.A.B.} q.{.).C.D.E.F.. G.      ",
  67.219 +"      0 [ a a a H.a I.J.= K.L.M.c .         ",
  67.220 +"      N.O.P.Q.R.S.%.T.[.= U.. V.W.          ",
  67.221 +"        X.Y.Z.`.F  += = = .+++@+            ",
  67.222 +"            #+$+= = = %+&+*+.               ",
  67.223 +"                =+=+-+;+>+                  ",
  67.224 +"                                            ",
  67.225 +"                                            "};
    68.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    68.2 +++ b/icons/flag-vymlink.xpm	Sun Jan 30 12:59:10 2005 +0000
    68.3 @@ -0,0 +1,36 @@
    68.4 +/* XPM */
    68.5 +static const char *flag_vymlink_xpm[] = {
    68.6 +/* columns rows colors chars-per-pixel */
    68.7 +"22 22 8 1",
    68.8 +"  c Gray100",
    68.9 +". c #848284",
   68.10 +"X c #000084",
   68.11 +"o c Gray0",
   68.12 +"O c None",
   68.13 +"+ c Gray0",
   68.14 +"@ c Gray0",
   68.15 +"# c Gray0",
   68.16 +/* pixels */
   68.17 +"OOOOOOOOOOOOOOOOOOOOOO",
   68.18 +"OOOOOOOOOOOOOOOOOOOOOO",
   68.19 +"OOOOOOOOOOOOOOOOOOOOOO",
   68.20 +"OOOOOOOOOOOOOOOOOOOOOO",
   68.21 +"OOOOOOOOOOOOOOOOOOOOOO",
   68.22 +"OOOO.XXXXXXOOOOOOOOOOO",
   68.23 +"OOOXXXXXXXXXXOOOOOOXOO",
   68.24 +"OO.XXOOOOOOXXXXOOOXXOO",
   68.25 +"OOXXOOOOOOOOOXXXOXXXOO",
   68.26 +"OOXXOOOOOOOOOOXXXXXXOO",
   68.27 +"OOXXOOOOOOOOOOOXXXXXOO",
   68.28 +"OOXXOOOOOOOOOOXXXXXXOO",
   68.29 +"OOXXOOOOOOOOOXXXXXXXOO",
   68.30 +"OO.XXOOOOOOOXXXXXXXXOO",
   68.31 +"OOOXXX.OOOOOOOOOOOOOOO",
   68.32 +"OOOOXXXOOOOOOOOOOOOOOO",
   68.33 +"OOOOOOOOOOOOOOOOOOOOOO",
   68.34 +"OOOOOOOOOOOOOOOOOOOOOO",
   68.35 +"OOOOOOOOOOOOOOOOOOOOOO",
   68.36 +"OOOOOOOOOOOOOOOOOOOOOO",
   68.37 +"OOOOOOOOOOOOOOOOOOOOOO",
   68.38 +"OOOOOOOOOOOOOOOOOOOOOO"
   68.39 +};
    69.1 Binary file icons/flags.xcf has changed
    70.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    70.2 +++ b/icons/formatcolorbranch.xpm	Sun Jan 30 12:59:10 2005 +0000
    70.3 @@ -0,0 +1,32 @@
    70.4 +/* XPM */
    70.5 +static char * formatcolorbranch_xpm[] = {
    70.6 +"22 22 7 1",
    70.7 +" 	c None",
    70.8 +".	c #949194",
    70.9 +"+	c #DEDADE",
   70.10 +"@	c #000000",
   70.11 +"#	c #FFFFFF",
   70.12 +"$	c #FF0000",
   70.13 +"%	c #0000FF",
   70.14 +"      ..              ",
   70.15 +"     ....             ",
   70.16 +"    ..++..            ",
   70.17 +"    ..+@..            ",
   70.18 +"    ..@#..            ",
   70.19 +"    @@##..@$          ",
   70.20 +"    @##+..+@$$        ",
   70.21 +"   @##+#@.++@$$       ",
   70.22 +"  @##+#@+@++.$$$      ",
   70.23 +" @##+#++@++..$$$      ",
   70.24 +"@##+#+++++..@$$$      ",
   70.25 +"@#+#+++++..@ $$$      ",
   70.26 +" @#+++++..@  $$$      ",
   70.27 +"  @#+++..@   $$$      ",
   70.28 +"   @++..@    $$%%%%%%%",
   70.29 +"    @..@     $ %%%%%%%",
   70.30 +"     @@       %%      ",
   70.31 +"         %%%%%%       ",
   70.32 +"         %%%%%%       ",
   70.33 +"             %%%      ",
   70.34 +"              %%%%%%%%",
   70.35 +"               %%%%%%%"};
    71.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    71.2 +++ b/icons/formatcoloritem.xpm	Sun Jan 30 12:59:10 2005 +0000
    71.3 @@ -0,0 +1,31 @@
    71.4 +/* XPM */
    71.5 +static char * formatcoloritem_xpm[] = {
    71.6 +"22 21 7 1",
    71.7 +" 	c None",
    71.8 +".	c #949194",
    71.9 +"+	c #DEDADE",
   71.10 +"@	c #000000",
   71.11 +"#	c #FFFFFF",
   71.12 +"$	c #FF0000",
   71.13 +"%	c #0000FF",
   71.14 +"      ..              ",
   71.15 +"     ....             ",
   71.16 +"    ..++..            ",
   71.17 +"    ..+@..            ",
   71.18 +"    ..@#..            ",
   71.19 +"    @@##..@$          ",
   71.20 +"    @##+..+@$$        ",
   71.21 +"   @##+#@.++@$$       ",
   71.22 +"  @##+#@+@++.$$$      ",
   71.23 +" @##+#++@++..$$$      ",
   71.24 +"@##+#+++++..@$$$      ",
   71.25 +"@#+#+++++..@ $$$      ",
   71.26 +" @#+++++..@  $$$      ",
   71.27 +"  @#+++..@   $$$      ",
   71.28 +"   @++..@    $$       ",
   71.29 +"    @..@     $        ",
   71.30 +"     @@               ",
   71.31 +"                      ",
   71.32 +"                      ",
   71.33 +"            %%%%%%%%%%",
   71.34 +"            %%%%%%%%%%"};
    72.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    72.2 +++ b/icons/formatcolorpicker.xpm	Sun Jan 30 12:59:10 2005 +0000
    72.3 @@ -0,0 +1,29 @@
    72.4 +/* XPM */
    72.5 +static const char * formatcolorpicker_xpm[] = {
    72.6 +"22 22 4 1",
    72.7 +" 	c None",
    72.8 +".	c #000000",
    72.9 +"+	c #949194",
   72.10 +"@	c #FFFFFF",
   72.11 +"                      ",
   72.12 +"                      ",
   72.13 +"                      ",
   72.14 +"               ...    ",
   72.15 +"              .....   ",
   72.16 +"              .....   ",
   72.17 +"           ........   ",
   72.18 +"            ......    ",
   72.19 +"           +@...      ",
   72.20 +"          +@@@..      ",
   72.21 +"         +@@@. .      ",
   72.22 +"        +@@@.         ",
   72.23 +"       +@@@.          ",
   72.24 +"      +@@@.           ",
   72.25 +"     +@@@.            ",
   72.26 +"    +@@@.             ",
   72.27 +"    +@@.              ",
   72.28 +"   +@..               ",
   72.29 +"    .                 ",
   72.30 +"                      ",
   72.31 +"                      ",
   72.32 +"                      "};
    73.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    73.2 +++ b/icons/formatfixedfont.xpm	Sun Jan 30 12:59:10 2005 +0000
    73.3 @@ -0,0 +1,28 @@
    73.4 +/* XPM */
    73.5 +static const char * formatfixedfont_xpm[] = {
    73.6 +"22 22 3 1",
    73.7 +" 	c None",
    73.8 +".	c #0000FF",
    73.9 +"+	c #BC0000",
   73.10 +"                      ",
   73.11 +"                      ",
   73.12 +"                      ",
   73.13 +"      .          .    ",
   73.14 +"      .          .    ",
   73.15 +"      .          .    ",
   73.16 +"  ....++++++++++..... ",
   73.17 +"      ++++++++++ .    ",
   73.18 +"      . ++    ++ .    ",
   73.19 +"      . ++  + ++ .    ",
   73.20 +"      . +++++    .    ",
   73.21 +"      . +++++    .    ",
   73.22 +"      . ++  +    .    ",
   73.23 +"      . ++       .    ",
   73.24 +"      . ++       .    ",
   73.25 +"      +++++++    .    ",
   73.26 +"  ....+++++++........ ",
   73.27 +"      .          .    ",
   73.28 +"      .          .    ",
   73.29 +"      .          .    ",
   73.30 +"                      ",
   73.31 +"                      "};
    74.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    74.2 +++ b/icons/formattextbold.xpm	Sun Jan 30 12:59:10 2005 +0000
    74.3 @@ -0,0 +1,27 @@
    74.4 +/* XPM */
    74.5 +static const char * formattextbold_xpm[] = {
    74.6 +"22 22 2 1",
    74.7 +" 	c None",
    74.8 +".	c #000000",
    74.9 +"                      ",
   74.10 +"                      ",
   74.11 +"                      ",
   74.12 +"                      ",
   74.13 +"     .........        ",
   74.14 +"      ...   ...       ",
   74.15 +"      ...    ...      ",
   74.16 +"      ...    ...      ",
   74.17 +"      ...    ...      ",
   74.18 +"      ...   ...       ",
   74.19 +"      ........        ",
   74.20 +"      ...   ....      ",
   74.21 +"      ...    ....     ",
   74.22 +"      ...     ...     ",
   74.23 +"      ...     ...     ",
   74.24 +"      ...     ...     ",
   74.25 +"      ...    ...      ",
   74.26 +"     ..........       ",
   74.27 +"                      ",
   74.28 +"                      ",
   74.29 +"                      ",
   74.30 +"                      "};
    75.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    75.2 +++ b/icons/formattextcenter.xpm	Sun Jan 30 12:59:10 2005 +0000
    75.3 @@ -0,0 +1,27 @@
    75.4 +/* XPM */
    75.5 +static const char * formattextcenter_xpm[] = {
    75.6 +"22 22 2 1",
    75.7 +" 	c None",
    75.8 +".	c #000000",
    75.9 +"                      ",
   75.10 +"                      ",
   75.11 +"   .................  ",
   75.12 +"                      ",
   75.13 +"     .............    ",
   75.14 +"                      ",
   75.15 +"   .................  ",
   75.16 +"                      ",
   75.17 +"     .............    ",
   75.18 +"                      ",
   75.19 +"   .................  ",
   75.20 +"                      ",
   75.21 +"     .............    ",
   75.22 +"                      ",
   75.23 +"   .................  ",
   75.24 +"                      ",
   75.25 +"     .............    ",
   75.26 +"                      ",
   75.27 +"   .................  ",
   75.28 +"                      ",
   75.29 +"                      ",
   75.30 +"                      "};
    76.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    76.2 +++ b/icons/formattextitalic.xpm	Sun Jan 30 12:59:10 2005 +0000
    76.3 @@ -0,0 +1,27 @@
    76.4 +/* XPM */
    76.5 +static const char * formattextitalic_xpm[] = {
    76.6 +"22 22 2 1",
    76.7 +" 	c None",
    76.8 +".	c #000000",
    76.9 +"                      ",
   76.10 +"                      ",
   76.11 +"                      ",
   76.12 +"                      ",
   76.13 +"          .....       ",
   76.14 +"           ...        ",
   76.15 +"           ...        ",
   76.16 +"           ...        ",
   76.17 +"           ...        ",
   76.18 +"          ...         ",
   76.19 +"          ...         ",
   76.20 +"          ...         ",
   76.21 +"          ...         ",
   76.22 +"         ...          ",
   76.23 +"         ...          ",
   76.24 +"         ...          ",
   76.25 +"         ...          ",
   76.26 +"        .....         ",
   76.27 +"                      ",
   76.28 +"                      ",
   76.29 +"                      ",
   76.30 +"                      "};
    77.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    77.2 +++ b/icons/formattextjustify.xpm	Sun Jan 30 12:59:10 2005 +0000
    77.3 @@ -0,0 +1,27 @@
    77.4 +/* XPM */
    77.5 +static const char * formattextjustify_xpm[] = {
    77.6 +"22 22 2 1",
    77.7 +" 	c None",
    77.8 +".	c #000000",
    77.9 +"                      ",
   77.10 +"                      ",
   77.11 +"   .................  ",
   77.12 +"                      ",
   77.13 +"   .................  ",
   77.14 +"                      ",
   77.15 +"   .................  ",
   77.16 +"                      ",
   77.17 +"   .................  ",
   77.18 +"                      ",
   77.19 +"   .................  ",
   77.20 +"                      ",
   77.21 +"   .................  ",
   77.22 +"                      ",
   77.23 +"   .................  ",
   77.24 +"                      ",
   77.25 +"   .................  ",
   77.26 +"                      ",
   77.27 +"   .............      ",
   77.28 +"                      ",
   77.29 +"                      ",
   77.30 +"                      "};
    78.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    78.2 +++ b/icons/formattextleft.xpm	Sun Jan 30 12:59:10 2005 +0000
    78.3 @@ -0,0 +1,27 @@
    78.4 +/* XPM */
    78.5 +static const char * formattextleft_xpm[] = {
    78.6 +"22 22 2 1",
    78.7 +" 	c None",
    78.8 +".	c #000000",
    78.9 +"                      ",
   78.10 +"                      ",
   78.11 +"  .................   ",
   78.12 +"                      ",
   78.13 +"  .............       ",
   78.14 +"                      ",
   78.15 +"  .................   ",
   78.16 +"                      ",
   78.17 +"  .............       ",
   78.18 +"                      ",
   78.19 +"  .................   ",
   78.20 +"                      ",
   78.21 +"  .............       ",
   78.22 +"                      ",
   78.23 +"  .................   ",
   78.24 +"                      ",
   78.25 +"  .............       ",
   78.26 +"                      ",
   78.27 +"  .................   ",
   78.28 +"                      ",
   78.29 +"                      ",
   78.30 +"                      "};
    79.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    79.2 +++ b/icons/formattextright.xpm	Sun Jan 30 12:59:10 2005 +0000
    79.3 @@ -0,0 +1,27 @@
    79.4 +/* XPM */
    79.5 +static const char * formattextright_xpm[] = {
    79.6 +"22 22 2 1",
    79.7 +" 	c None",
    79.8 +".	c #000000",
    79.9 +"                      ",
   79.10 +"                      ",
   79.11 +"   .................  ",
   79.12 +"                      ",
   79.13 +"       .............  ",
   79.14 +"                      ",
   79.15 +"   .................  ",
   79.16 +"                      ",
   79.17 +"       .............  ",
   79.18 +"                      ",
   79.19 +"   .................  ",
   79.20 +"                      ",
   79.21 +"       .............  ",
   79.22 +"                      ",
   79.23 +"   .................  ",
   79.24 +"                      ",
   79.25 +"       .............  ",
   79.26 +"                      ",
   79.27 +"   .................  ",
   79.28 +"                      ",
   79.29 +"                      ",
   79.30 +"                      "};
    80.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    80.2 +++ b/icons/formattextunder.xpm	Sun Jan 30 12:59:10 2005 +0000
    80.3 @@ -0,0 +1,27 @@
    80.4 +/* XPM */
    80.5 +static const char * formattextunder_xpm[] = {
    80.6 +"22 22 2 1",
    80.7 +" 	c None",
    80.8 +".	c #000000",
    80.9 +"                      ",
   80.10 +"                      ",
   80.11 +"                      ",
   80.12 +"                      ",
   80.13 +"     .....   ....     ",
   80.14 +"      ...      .      ",
   80.15 +"      ...      .      ",
   80.16 +"      ...      .      ",
   80.17 +"      ...      .      ",
   80.18 +"      ...      .      ",
   80.19 +"      ...      .      ",
   80.20 +"      ...      .      ",
   80.21 +"      ...      .      ",
   80.22 +"      ...      .      ",
   80.23 +"      ...     ..      ",
   80.24 +"       ...   ..       ",
   80.25 +"        ......        ",
   80.26 +"                      ",
   80.27 +"     ............     ",
   80.28 +"                      ",
   80.29 +"                      ",
   80.30 +"                      "};
    81.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    81.2 +++ b/icons/formatvarfont.xpm	Sun Jan 30 12:59:10 2005 +0000
    81.3 @@ -0,0 +1,28 @@
    81.4 +/* XPM */
    81.5 +static const char * formatvarfont_xpm[] = {
    81.6 +"22 22 3 1",
    81.7 +" 	c None",
    81.8 +".	c #0000FF",
    81.9 +"+	c #00B200",
   81.10 +"                      ",
   81.11 +"                      ",
   81.12 +"                      ",
   81.13 +"      .          .    ",
   81.14 +"      .          .    ",
   81.15 +"      .          .    ",
   81.16 +"  ....++++..++++..... ",
   81.17 +"      .++    ++  .    ",
   81.18 +"      .++   +++  .    ",
   81.19 +"      . ++  ++   .    ",
   81.20 +"      . ++  ++   .    ",
   81.21 +"      . ++  ++   .    ",
   81.22 +"      . ++ ++    .    ",
   81.23 +"      . ++ ++    .    ",
   81.24 +"      . ++++     .    ",
   81.25 +"      .  +++     .    ",
   81.26 +"  .......++.......... ",
   81.27 +"      .          .    ",
   81.28 +"      .          .    ",
   81.29 +"      .          .    ",
   81.30 +"                      ",
   81.31 +"                      "};
    82.1 Binary file icons/icons.xcf has changed
    83.1 Binary file icons/mouse.xcf has changed
    84.1 Binary file icons/mouse16.xcf has changed
    85.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    85.2 +++ b/icons/viewzoomin.xpm	Sun Jan 30 12:59:10 2005 +0000
    85.3 @@ -0,0 +1,31 @@
    85.4 +/* XPM */
    85.5 +static const char * viewzoomin_xpm[] = {
    85.6 +"22 22 6 1",
    85.7 +" 	c None",
    85.8 +".	c #000000",
    85.9 +"+	c #949194",
   85.10 +"@	c #DEDADE",
   85.11 +"#	c #FFFFFF",
   85.12 +"$	c #D5D6D5",
   85.13 +"                      ",
   85.14 +"                      ",
   85.15 +"                      ",
   85.16 +"                      ",
   85.17 +"            ....      ",
   85.18 +"          +.@##$.+    ",
   85.19 +"          .##++##.+   ",
   85.20 +"         .@#+####@.   ",
   85.21 +"         .#+######.+  ",
   85.22 +"         .########.+  ",
   85.23 +"         .@######@.+  ",
   85.24 +"          .######.++  ",
   85.25 +"         ...@##@.++   ",
   85.26 +"        ...+....++    ",
   85.27 +"       ...++ ++++     ",
   85.28 +"      ...++           ",
   85.29 +"     ...++        .   ",
   85.30 +"    ...++         .   ",
   85.31 +"    +.++        ..... ",
   85.32 +"     ++           .   ",
   85.33 +"                  .   ",
   85.34 +"                      "};
    86.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    86.2 +++ b/icons/viewzoomout.xpm	Sun Jan 30 12:59:10 2005 +0000
    86.3 @@ -0,0 +1,31 @@
    86.4 +/* XPM */
    86.5 +static const char * viewzoomout_xpm[] = {
    86.6 +"22 22 6 1",
    86.7 +" 	c None",
    86.8 +".	c #000000",
    86.9 +"+	c #949194",
   86.10 +"@	c #DEDADE",
   86.11 +"#	c #FFFFFF",
   86.12 +"$	c #D5D6D5",
   86.13 +"                      ",
   86.14 +"                      ",
   86.15 +"                      ",
   86.16 +"                      ",
   86.17 +"            ....      ",
   86.18 +"          +.@##$.+    ",
   86.19 +"          .##++##.+   ",
   86.20 +"         .@#+####@.   ",
   86.21 +"         .#+######.+  ",
   86.22 +"         .########.+  ",
   86.23 +"         .@######@.+  ",
   86.24 +"          .######.++  ",
   86.25 +"         ...@##@.++   ",
   86.26 +"        ...+....++    ",
   86.27 +"       ...++ ++++     ",
   86.28 +"      ...++           ",
   86.29 +"     ...++            ",
   86.30 +"    ...++             ",
   86.31 +"    +.++        ..... ",
   86.32 +"     ++               ",
   86.33 +"                      ",
   86.34 +"                      "};
    87.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    87.2 +++ b/icons/viewzoomreset.xpm	Sun Jan 30 12:59:10 2005 +0000
    87.3 @@ -0,0 +1,51 @@
    87.4 +/* XPM */
    87.5 +static const char * viewzoomreset_xpm[] = {
    87.6 +"22 22 26 1",
    87.7 +" 	c None",
    87.8 +".	c #000000",
    87.9 +"+	c #949194",
   87.10 +"@	c #DEDADE",
   87.11 +"#	c #FFFFFF",
   87.12 +"$	c #D5D6D5",
   87.13 +"%	c #FF0000",
   87.14 +"&	c #FFACAC",
   87.15 +"*	c #FFB2B2",
   87.16 +"=	c #EB8285",
   87.17 +"-	c #C94849",
   87.18 +";	c #FF8B8B",
   87.19 +">	c #FF7D7D",
   87.20 +",	c #FFE8E8",
   87.21 +"'	c #FF1E1E",
   87.22 +")	c #1C0000",
   87.23 +"!	c #FF9E9E",
   87.24 +"~	c #FF6F6F",
   87.25 +"{	c #E0C6C9",
   87.26 +"]	c #680000",
   87.27 +"^	c #CE4143",
   87.28 +"/	c #0C0000",
   87.29 +"(	c #EB1A1A",
   87.30 +"_	c #460000",
   87.31 +":	c #D13D3F",
   87.32 +"<	c #5A0000",
   87.33 +"                      ",
   87.34 +"                      ",
   87.35 +"                      ",
   87.36 +"                      ",
   87.37 +"            ....      ",
   87.38 +"          +.@##$.+    ",
   87.39 +"        %%%&#++*%%+   ",
   87.40 +"         .=%-#%%#@.   ",
   87.41 +"         .#+;%%###.+  ",
   87.42 +"         .##>%%,##.+  ",
   87.43 +"         .@#%#%'#@.+  ",
   87.44 +"          )%!#~%#.++  ",
   87.45 +"         .%%@##{%++   ",
   87.46 +"        .]%^.../%(    ",
   87.47 +"       ._%:+ ++++%    ",
   87.48 +"      ..<++       %   ",
   87.49 +"     ...++            ",
   87.50 +"    ...++             ",
   87.51 +"    +.++              ",
   87.52 +"     ++               ",
   87.53 +"                      ",
   87.54 +"                      "};
    88.1 Binary file icons/vym-16x16.png has changed
    89.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    89.2 +++ b/icons/vym-16x16.xpm	Sun Jan 30 12:59:10 2005 +0000
    89.3 @@ -0,0 +1,32 @@
    89.4 +/* XPM */
    89.5 +static char * vym_16x16_xpm[] = {
    89.6 +"16 16 13 1",
    89.7 +" 	c None",
    89.8 +".	c #0026FF",
    89.9 +"+	c #CC0833",
   89.10 +"@	c #FF0000",
   89.11 +"#	c #801380",
   89.12 +"$	c #5519AA",
   89.13 +"%	c #8E1171",
   89.14 +"&	c #1C22E3",
   89.15 +"*	c #71158E",
   89.16 +"=	c #990F66",
   89.17 +"-	c #C60839",
   89.18 +";	c #391EC6",
   89.19 +">	c #6D1692",
   89.20 +"                ",
   89.21 +"       ...+     ",
   89.22 +"  @  #$%&$*=    ",
   89.23 +"     ...%$..    ",
   89.24 +"     ..*%&..    ",
   89.25 +"     ..*.**-@   ",
   89.26 +"    @%*;....    ",
   89.27 +"    >%......    ",
   89.28 +"      ......    ",
   89.29 +"      .....     ",
   89.30 +"      .....     ",
   89.31 +"       ....     ",
   89.32 +"       ....     ",
   89.33 +"                ",
   89.34 +"                ",
   89.35 +"                "};
    90.1 Binary file icons/vym-32x32.png has changed
    91.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    91.2 +++ b/icons/vym-32x32.xpm	Sun Jan 30 12:59:10 2005 +0000
    91.3 @@ -0,0 +1,48 @@
    91.4 +/* XPM */
    91.5 +static char * vym_32x32_xpm[] = {
    91.6 +"32 32 13 1",
    91.7 +" 	c None",
    91.8 +".	c #FF0000",
    91.9 +"+	c #0026FF",
   91.10 +"@	c #5519AA",
   91.11 +"#	c #BF0940",
   91.12 +"$	c #AA0D55",
   91.13 +"%	c #C60839",
   91.14 +"&	c #8E1171",
   91.15 +"*	c #391EC6",
   91.16 +"=	c #1C22E3",
   91.17 +"-	c #71158E",
   91.18 +";	c #E3041C",
   91.19 +">	c #DB0524",
   91.20 +"                                ",
   91.21 +"                        .....   ",
   91.22 +"                     ...        ",
   91.23 +"  ..         +++++++@.          ",
   91.24 +"    .......#$$%&+++*&%#.....    ",
   91.25 +"    ..     +++=%-+*;@=+         ",
   91.26 +"  ..       +++++$+;*+++         ",
   91.27 +"           +++++;$*++++         ",
   91.28 +"           ++++$%@++++++        ",
   91.29 +"           +++*;@%-+++++  ...   ",
   91.30 +"           +++@@++$;@@@%..      ",
   91.31 +"          ++++%@+++*@%....      ",
   91.32 +"   .....  @=+*$+++++++++  ..    ",
   91.33 +"        ...%$;*+++++++++        ",
   91.34 +"      ..>*&%++++++++++++        ",
   91.35 +"         -%=++++++++++++        ",
   91.36 +"       ...+++++++++++++         ",
   91.37 +"   ...      +++++++++++         ",
   91.38 +"            +++++++++++         ",
   91.39 +"            ++++++++++          ",
   91.40 +"           +++++++++++          ",
   91.41 +"            +++++++++           ",
   91.42 +"              +++++++           ",
   91.43 +"               ++++++           ",
   91.44 +"               ++++++           ",
   91.45 +"               ++++++           ",
   91.46 +"                ++++            ",
   91.47 +"                                ",
   91.48 +"                                ",
   91.49 +"                                ",
   91.50 +"                                ",
   91.51 +"                                "};
    92.1 Binary file icons/vym-48x48.png has changed
    93.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    93.2 +++ b/icons/vym-48x48.xpm	Sun Jan 30 12:59:10 2005 +0000
    93.3 @@ -0,0 +1,54 @@
    93.4 +/* XPM */
    93.5 +static char * vym_logo_xpm[] = {
    93.6 +"48 48 3 1",
    93.7 +" 	c None",
    93.8 +".	c #FF0000",
    93.9 +"+	c #0026FF",
   93.10 +"                                                ",
   93.11 +"                                                ",
   93.12 +"                                   .........    ",
   93.13 +"                                ....            ",
   93.14 +"                    ++++++++++  .               ",
   93.15 +"  ....             ++++++++++++..               ",
   93.16 +"     ... ..............++++++++............     ",
   93.17 +"       ...       +++++..+++++...++              ",
   93.18 +"     ...        +++++++..+++..++++              ",
   93.19 +"  ....          ++++++++.++..++++++             ",
   93.20 +"                ++++++++.++.+++++++             ",
   93.21 +"                ++++++++...++++++++             ",
   93.22 +"                +++++++..+++++++++++            ",
   93.23 +"                +++++++....+++++++++            ",
   93.24 +"                 +++++..++..++++++++  ......    ",
   93.25 +"                 +++++.++++...+++++....         ",
   93.26 +"                ++++++.++++++.......            ",
   93.27 +"               ++++++..+++++++++.......         ",
   93.28 +"    ........   ++++++.++++++++++++++  .....     ",
   93.29 +"           ......+++..++++++++++++++            ",
   93.30 +"             ........+++++++++++++++            ",
   93.31 +"         .....++..++++++++++++++++++            ",
   93.32 +"     .....   ++..+++++++++++++++++++            ",
   93.33 +"             +..++++++++++++++++++++            ",
   93.34 +"           ....++++++++++++++++++++             ",
   93.35 +"       .....      +++++++++++++++++             ",
   93.36 +"    ....          +++++++++++++++++             ",
   93.37 +"                  ++++++++++++++++              ",
   93.38 +"                  ++++++++++++++++              ",
   93.39 +"                 ++++++++++++++++               ",
   93.40 +"                 ++++++++++++++++               ",
   93.41 +"                 +++++++++++++++                ",
   93.42 +"                  ++++++++++++++                ",
   93.43 +"                     +++++++++++                ",
   93.44 +"                      ++++++++++                ",
   93.45 +"                      ++++++++++                ",
   93.46 +"                      ++++++++++                ",
   93.47 +"                      ++++++++++                ",
   93.48 +"                       +++++++++                ",
   93.49 +"                        +++++++                 ",
   93.50 +"                                                ",
   93.51 +"                                                ",
   93.52 +"                                                ",
   93.53 +"                                                ",
   93.54 +"                                                ",
   93.55 +"                                                ",
   93.56 +"                                                ",
   93.57 +"                                                "};
    94.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    94.2 +++ b/icons/vym-editor.xpm	Sun Jan 30 12:59:10 2005 +0000
    94.3 @@ -0,0 +1,59 @@
    94.4 +/* XPM */
    94.5 +static char * vym_editor_xpm[] = {
    94.6 +"48 48 8 1",
    94.7 +" 	c None",
    94.8 +".	c #FF0000",
    94.9 +"+	c #0026FF",
   94.10 +"@	c #FFFFFF",
   94.11 +"#	c #000082",
   94.12 +"$	c #000000",
   94.13 +"%	c #3C3CFD",
   94.14 +"&	c #8B8BFD",
   94.15 +"                                                ",
   94.16 +"                                                ",
   94.17 +"                                   .........    ",
   94.18 +"                                ....            ",
   94.19 +"                    ++++++++++  .               ",
   94.20 +"  ....             ++++++++++++..               ",
   94.21 +"     ... ..............++++++++............     ",
   94.22 +"       ...       +++++..+++++...++              ",
   94.23 +"     ...        +++++++..+++..++++              ",
   94.24 +"  ....          ++++++++.++..++++++             ",
   94.25 +"                ++++++++.++.+++++++             ",
   94.26 +"                ++++++++...++++++++             ",
   94.27 +"                +++++++..+++++++++++            ",
   94.28 +"                +++++++....+++++++++            ",
   94.29 +"                 +++++..++..++++++++  ......    ",
   94.30 +"                 +++++.++++...+++++....         ",
   94.31 +"                ++++++.++++++.......            ",
   94.32 +"               ++++++..+++++++++.......         ",
   94.33 +"    ........   ++++++.++++++++++++++  .....     ",
   94.34 +"           ......+++..++++++++++++++            ",
   94.35 +"             ........+++++++++++++++            ",
   94.36 +"         .....++..++++++++++++++++++            ",
   94.37 +"     .....   ++..+++++++++++++++++++            ",
   94.38 +"             +..++++++++++++++++++++            ",
   94.39 +"           ....++++++++++++++++++++             ",
   94.40 +"       .....      +++++++++++++++++             ",
   94.41 +"    ....          +++++++++++++++++             ",
   94.42 +"                  ++++++++++++++@@              ",
   94.43 +"                  ++++++++++++++########        ",
   94.44 +"                 +++++++++++++++#@@@@@@##       ",
   94.45 +"                 +++++++++++++++#@$$$$@#%#      ",
   94.46 +"                 +++++++++++++++#@@@@@@#&%#     ",
   94.47 +"                  ++++++++++++++#@$$$$@#@&%#    ",
   94.48 +"                     +++++++++++#@@@@@@######   ",
   94.49 +"                      ++++++++++#@$$$$@@@@@@#   ",
   94.50 +"                      ++++++++++#@@@@@@@@@@@#   ",
   94.51 +"                      ++++++++++#@$$$$$$$$$@#   ",
   94.52 +"                      ++++++++++#@@@@@@@@@@@#   ",
   94.53 +"                       +++++++++#@$$$$$$$$$@#   ",
   94.54 +"                        +++++++ #@@@@@@@@@@@#   ",
   94.55 +"                                #@$$$$$$$$$@#   ",
   94.56 +"                                #@@@@@@@@@@@#   ",
   94.57 +"                                #############   ",
   94.58 +"                                                ",
   94.59 +"                                                ",
   94.60 +"                                                ",
   94.61 +"                                                ",
   94.62 +"                                                "};
    95.1 Binary file icons/vym.png has changed
    96.1 Binary file icons/vym.xcf has changed
    97.1 Binary file icons/wiki.xcf has changed
    98.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    98.2 +++ b/imageobj.cpp	Sun Jan 30 12:59:10 2005 +0000
    98.3 @@ -0,0 +1,100 @@
    98.4 +#include "imageobj.h"
    98.5 +
    98.6 +/////////////////////////////////////////////////////////////////
    98.7 +// ImageObj
    98.8 +/////////////////////////////////////////////////////////////////
    98.9 +ImageObj::ImageObj( QCanvas *canvas )
   98.10 +    : QCanvasRectangle( canvas )
   98.11 +{
   98.12 +//	cout << "Const ImageObj (canvas)\n";
   98.13 +    setZ(Z_ICON);	
   98.14 +	type=undef;
   98.15 +}
   98.16 +
   98.17 +ImageObj::~ImageObj()
   98.18 +{
   98.19 +//   cout << "Destr ImageObj\n";
   98.20 +}
   98.21 +
   98.22 +void ImageObj::copy(ImageObj* other)
   98.23 +{
   98.24 +	setSize (other->width(), other->height() );
   98.25 +	setVisibility (other->isVisible() );
   98.26 +	type=other->type;
   98.27 +//	if (type==qimage)
   98.28 +		image=other->image;
   98.29 +//	if (type==qpixmap)
   98.30 +		pixmap=other->pixmap;
   98.31 +}
   98.32 +
   98.33 +void ImageObj::setVisibility (bool v)
   98.34 +{
   98.35 +	if (v)	
   98.36 +		show();
   98.37 +	else
   98.38 +		hide();
   98.39 +}
   98.40 +
   98.41 +void ImageObj::save(const QString &fn, const char *format)
   98.42 +{
   98.43 +	switch (type)
   98.44 +	{
   98.45 +		case undef: qWarning("undef");break;
   98.46 +		case qimage: image.save (fn,format,-1);break;
   98.47 +		case qpixmap: pixmap.save (fn,format,-1);break;
   98.48 +	}
   98.49 +}
   98.50 +
   98.51 +bool ImageObj::load (const QString &fn)
   98.52 +{
   98.53 +	if (!image.load( fn) )
   98.54 +		//cout << "Fatal Error in ImageObj::load ("<<fn<<")\n";
   98.55 +		return false;
   98.56 +    setSize( image.width(), image.height() );
   98.57 +	type=qimage;
   98.58 +
   98.59 +#if !defined(Q_WS_QWS)
   98.60 +    pixmap.convertFromImage(image, OrderedAlphaDither);
   98.61 +#endif
   98.62 +	return true;
   98.63 +}
   98.64 +
   98.65 +bool ImageObj::load (QPixmap pm)
   98.66 +{
   98.67 +#if !defined(Q_WS_QWS)
   98.68 +    //pixmap.convertFromImage(image, OrderedAlphaDither);
   98.69 +	type=qpixmap;
   98.70 +	pixmap=pm;
   98.71 +    setSize( pm.width(), pm.height() );
   98.72 +#else
   98.73 +	type=qimage;
   98.74 +	image=pm;
   98.75 +    setSize( image.width(), image.height() );
   98.76 +#endif
   98.77 +	return true;
   98.78 +}
   98.79 +
   98.80 +void ImageObj::setImage(QImage img)
   98.81 +{
   98.82 +	type=qimage;
   98.83 +	image=img;
   98.84 +    pixmap.convertFromImage(image, OrderedAlphaDither);
   98.85 +}
   98.86 +
   98.87 +QPixmap ImageObj::getPixmap()
   98.88 +{
   98.89 +	return pixmap;
   98.90 +}
   98.91 +
   98.92 +void ImageObj::drawShape( QPainter &p )
   98.93 +{
   98.94 +// On Qt/Embedded, we can paint a QImage as fast as a QPixmap,
   98.95 +// but on other platforms, we need to use a QPixmap.
   98.96 +#if defined(Q_WS_QWS)
   98.97 +    p.drawImage( int(x()), int(y()), image, 0, 0, -1, -1, OrderedAlphaDither );
   98.98 +#else
   98.99 +    p.drawPixmap( int(x()), int(y()), pixmap );
  98.100 +#endif
  98.101 +}
  98.102 +
  98.103 +
    99.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    99.2 +++ b/imageobj.h	Sun Jan 30 12:59:10 2005 +0000
    99.3 @@ -0,0 +1,31 @@
    99.4 +#ifndef IMAGEOBJ_H
    99.5 +#define IMAGEOBJ_H
    99.6 +
    99.7 +#include <qimage.h>
    99.8 +#include <qcanvas.h>
    99.9 +#include <qpainter.h>
   99.10 +
   99.11 +#include "mapobj.h"
   99.12 +
   99.13 +enum ImageType {qimage,qpixmap,undef};
   99.14 +
   99.15 +class ImageObj: public QCanvasRectangle
   99.16 +{
   99.17 +public:
   99.18 +    ImageObj( QCanvas *canvas );
   99.19 +    ~ImageObj();
   99.20 +	virtual void copy (ImageObj*);
   99.21 +    virtual void setVisibility(bool);
   99.22 +	void save (const QString &, const char *);
   99.23 +	bool load (const QString &);
   99.24 +	bool load (QPixmap);
   99.25 +	void setImage(QImage img);
   99.26 +	QPixmap getPixmap();
   99.27 +protected:
   99.28 +    void drawShape( QPainter & );
   99.29 +private:
   99.30 +    QImage image;
   99.31 +    QPixmap pixmap;
   99.32 +	ImageType type;
   99.33 +};
   99.34 +#endif
   100.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   100.2 +++ b/linkablemapobj.cpp	Sun Jan 30 12:59:10 2005 +0000
   100.3 @@ -0,0 +1,693 @@
   100.4 +//#include <math.h>
   100.5 +
   100.6 +#include "linkablemapobj.h"
   100.7 +#include "branchobj.h"
   100.8 +#include "mapeditor.h"
   100.9 +
  100.10 +#include "version.h"
  100.11 +
  100.12 +
  100.13 +/////////////////////////////////////////////////////////////////
  100.14 +// LinkableMapObj
  100.15 +/////////////////////////////////////////////////////////////////
  100.16 +
  100.17 +LinkableMapObj::LinkableMapObj():MapObj()
  100.18 +{
  100.19 +  //  cout << "Const LinkableMapObj ()\n";
  100.20 +    init ();
  100.21 +}
  100.22 +
  100.23 +LinkableMapObj::LinkableMapObj(QCanvas* c) :MapObj(c)
  100.24 +{
  100.25 +//    cout << "Const LinkableMapObj\n";
  100.26 +    init ();
  100.27 +}
  100.28 +
  100.29 +LinkableMapObj::LinkableMapObj (LinkableMapObj* lmo) : MapObj (lmo->canvas)
  100.30 +{
  100.31 +    copy (lmo);
  100.32 +}
  100.33 +
  100.34 +LinkableMapObj::~LinkableMapObj()
  100.35 +{
  100.36 +    delete (bottomline);
  100.37 +    delete (selbox);
  100.38 +	delete (frame);
  100.39 +	delLink();
  100.40 +}
  100.41 +
  100.42 +void LinkableMapObj::delLink()
  100.43 +{
  100.44 +	switch (style)
  100.45 +	{
  100.46 +		case StyleLine:
  100.47 +			delete (l);
  100.48 +			break;
  100.49 +		case StyleParabel:
  100.50 +			segment.clear();
  100.51 +			break;
  100.52 +		case StylePolyLine:
  100.53 +			delete (p);
  100.54 +			delete (l);
  100.55 +			break;
  100.56 +		case StylePolyParabel:
  100.57 +			delete (p);
  100.58 +			segment.clear();
  100.59 +			break;
  100.60 +		default:
  100.61 +			break;
  100.62 +	}		
  100.63 +}
  100.64 +
  100.65 +void LinkableMapObj::init ()
  100.66 +{
  100.67 +    depth=-1;	
  100.68 +    childObj=NULL;
  100.69 +    parObj=NULL;
  100.70 +    parObjTmpBuf=NULL;
  100.71 +    parPos=QPoint(0,0);
  100.72 +    childPos=QPoint(0,0);
  100.73 +	link2ParPos=false;
  100.74 +    l=NULL;
  100.75 +    orientation=OrientUndef;
  100.76 +    linkwidth=20;		
  100.77 +	thickness_start=8;
  100.78 +    style=StyleUndef;
  100.79 +	linkpos=LinkBottom;
  100.80 +    segment.setAutoDelete (TRUE);
  100.81 +    arcsegs=13;
  100.82 +	QPointArray pa(arcsegs*2+2);
  100.83 +    
  100.84 +    bottomline=new QCanvasLine(canvas);
  100.85 +    bottomline->setPen( QPen(linkcolor, 1) );
  100.86 +    bottomline->setZ(Z_LINK);
  100.87 +    bottomline->show();
  100.88 +
  100.89 +    // Prepare showing the selection of a MapObj
  100.90 +    selbox = new QCanvasRectangle (canvas);
  100.91 +    selbox->setZ(Z_SELBOX);
  100.92 +    selbox->setBrush( QColor(255,255,0) );
  100.93 +    selbox->setPen( QPen(QColor(255,255,0) ));
  100.94 +    selbox->hide();
  100.95 +    selected=false;
  100.96 +
  100.97 +	// initialize frame
  100.98 +	frame = new FrameObj (canvas);
  100.99 +	
 100.100 +	repositionRequest=false;
 100.101 +}
 100.102 +
 100.103 +void LinkableMapObj::copy (LinkableMapObj* other)
 100.104 +{
 100.105 +    MapObj::copy(other);
 100.106 +	bboxTotal=other->bboxTotal;
 100.107 +//    linkwidth=other->linkwidth;		
 100.108 +
 100.109 +    setLinkStyle(other->style);
 100.110 +    setLinkColor (other->linkcolor);
 100.111 +}
 100.112 +
 100.113 +void LinkableMapObj::setChildObj(LinkableMapObj* o)
 100.114 +{
 100.115 +    childObj=o;
 100.116 +}
 100.117 +
 100.118 +void LinkableMapObj::setParObj(LinkableMapObj* o)
 100.119 +{
 100.120 +    parObj=o;
 100.121 +	mapEditor=parObj->getMapEditor();
 100.122 +}
 100.123 +
 100.124 +void LinkableMapObj::setParObjTmp(LinkableMapObj*,QPoint,int)
 100.125 +{
 100.126 +}
 100.127 +
 100.128 +void LinkableMapObj::unsetParObjTmp()
 100.129 +{
 100.130 +}
 100.131 +
 100.132 +LinkStyle LinkableMapObj::getDefLinkStyle ()
 100.133 +{
 100.134 +	LinkStyle ls=mapEditor->getLinkStyle();
 100.135 +	switch (ls)
 100.136 +	{
 100.137 +		case StyleLine: 
 100.138 +			return ls;
 100.139 +			break;
 100.140 +		case StyleParabel:
 100.141 +			return ls;
 100.142 +			break;
 100.143 +		case StylePolyLine:	
 100.144 +			if (depth>1)
 100.145 +				return StyleLine;
 100.146 +			else	
 100.147 +				return ls;
 100.148 +			break;
 100.149 +		case StylePolyParabel:	
 100.150 +			if (depth>1)
 100.151 +				return StyleParabel;
 100.152 +			else	
 100.153 +				return ls;
 100.154 +			break;
 100.155 +		default: 
 100.156 +			break;	
 100.157 +	}	
 100.158 +	return StyleUndef;
 100.159 +}
 100.160 +
 100.161 +void LinkableMapObj::setLinkStyle(LinkStyle newstyle)
 100.162 +{
 100.163 +	delLink();
 100.164 +		
 100.165 +	style=newstyle;
 100.166 +
 100.167 +    if (childObj!=NULL && parObj != NULL)
 100.168 +    {
 100.169 +		int i;
 100.170 +		QCanvasLine* cl;
 100.171 +		switch (style)
 100.172 +		{
 100.173 +			case StyleUndef:
 100.174 +				bottomline->hide();
 100.175 +				break;
 100.176 +			case StyleLine: 
 100.177 +				l = new QCanvasLine(canvas);
 100.178 +				l->setPen( QPen(linkcolor, 1) );
 100.179 +				l->setZ(Z_LINK);
 100.180 +				if (visible)
 100.181 +					l->show();
 100.182 +				else
 100.183 +					l->hide();
 100.184 +				break;
 100.185 +			case StyleParabel:
 100.186 +				for (i=0;i<arcsegs;i++)
 100.187 +				{
 100.188 +					cl = new QCanvasLine(canvas);
 100.189 +					cl->setPen( QPen(linkcolor, 1) );
 100.190 +					cl->setPoints( 0,0,i*10,100);
 100.191 +					cl->setZ(Z_LINK);
 100.192 +					if (visible)
 100.193 +						cl->show();
 100.194 +					else
 100.195 +						cl->hide();
 100.196 +					segment.append(cl);
 100.197 +				}
 100.198 +				pa0.resize (arcsegs+1);
 100.199 +				break;
 100.200 +			case StylePolyLine:	
 100.201 +				p = new QCanvasPolygon(canvas);
 100.202 +				p->setBrush( linkcolor );
 100.203 +				p->setZ(Z_LINK);
 100.204 +				if (visible)
 100.205 +					p->show();
 100.206 +				else
 100.207 +					p->hide();
 100.208 +				pa0.resize (3);
 100.209 +				// TODO
 100.210 +				// a bit awkward: draw the lines additionally to polygon, to avoid
 100.211 +				// missing pixels, when polygon is extremly flat
 100.212 +				l = new QCanvasLine(canvas);
 100.213 +				l->setPen( QPen(linkcolor, 1) );
 100.214 +				l->setZ(Z_LINK);
 100.215 +				if (visible)
 100.216 +					l->show();
 100.217 +				else
 100.218 +					l->hide();
 100.219 +				break;
 100.220 +			case StylePolyParabel:	
 100.221 +				p = new QCanvasPolygon(canvas);
 100.222 +				p->setBrush( linkcolor );
 100.223 +				p->setZ(Z_LINK);
 100.224 +				if (visible)
 100.225 +					p->show();
 100.226 +				else
 100.227 +					p->hide();
 100.228 +				pa0.resize (arcsegs*2+2);
 100.229 +				pa1.resize (arcsegs+1);
 100.230 +				pa2.resize (arcsegs+1);
 100.231 +
 100.232 +				// TODO
 100.233 +				// a bit awkward: draw the lines additionally 
 100.234 +				// to polygon, to avoid missing pixels, 
 100.235 +				// if polygon is extremly flat
 100.236 +				for (i=0;i<arcsegs;i++)
 100.237 +				{
 100.238 +					cl = new QCanvasLine(canvas);
 100.239 +					cl->setPen( QPen(linkcolor, 1) );
 100.240 +					cl->setPoints( 0,0,i*10,100);
 100.241 +					cl->setZ(Z_LINK);
 100.242 +					if (visible)
 100.243 +						cl->show();
 100.244 +					else
 100.245 +						cl->hide();
 100.246 +					segment.append(cl);
 100.247 +				}
 100.248 +				break;
 100.249 +			default: 
 100.250 +				break;	
 100.251 +		}	
 100.252 +	} else
 100.253 +	{
 100.254 +		cout << "Error: ChildObj or parObj == NULL in LinkableMapObj::setLinkStyle\n";
 100.255 +	}
 100.256 +}
 100.257 +
 100.258 +LinkStyle LinkableMapObj::getLinkStyle()
 100.259 +{
 100.260 +	return style;
 100.261 +}
 100.262 +
 100.263 +void LinkableMapObj::setLinkPos(LinkPos lp)
 100.264 +{
 100.265 +	linkpos=lp;
 100.266 +}
 100.267 +
 100.268 +LinkPos LinkableMapObj::getLinkPos()
 100.269 +{
 100.270 +	return linkpos;
 100.271 +}
 100.272 +
 100.273 +
 100.274 +void LinkableMapObj::setLinkColor()
 100.275 +{
 100.276 +	// Overloaded in BranchObj and childs
 100.277 +	// here only set default color
 100.278 +	setLinkColor (mapEditor->getDefLinkColor());
 100.279 +}
 100.280 +
 100.281 +void LinkableMapObj::setLinkColor(QColor col)
 100.282 +{
 100.283 +	linkcolor=col;
 100.284 +    bottomline->setPen( QPen(linkcolor, 1) );
 100.285 +	QCanvasLine *cl;
 100.286 +	switch (style)
 100.287 +	{
 100.288 +		case StyleLine:
 100.289 +			l->setPen( QPen(col,1));
 100.290 +			break;	
 100.291 +		case StyleParabel:	
 100.292 +			for (cl=segment.first(); cl; cl=segment.next() )
 100.293 +				cl->setPen( QPen(col,1));
 100.294 +			break;
 100.295 +		case StylePolyLine:
 100.296 +			p->setBrush( QBrush(col));
 100.297 +			l->setPen( QPen(col,1));
 100.298 +			break;
 100.299 +		case StylePolyParabel:	
 100.300 +			p->setBrush( QBrush(col));
 100.301 +			for (cl=segment.first(); cl; cl=segment.next() )
 100.302 +				cl->setPen( QPen(col,1));
 100.303 +			break;
 100.304 +		default:
 100.305 +			break;
 100.306 +	} // switch (style)	
 100.307 +	updateLink();
 100.308 +}
 100.309 +
 100.310 +QColor LinkableMapObj::getLinkColor()
 100.311 +{
 100.312 +	return linkcolor;
 100.313 +}
 100.314 +
 100.315 +FrameType LinkableMapObj::getFrameType()
 100.316 +{
 100.317 +	return frame->getFrameType();
 100.318 +}
 100.319 +
 100.320 +void LinkableMapObj::setFrameType(const FrameType &t)
 100.321 +{
 100.322 +	frame->setFrameType(t);
 100.323 +	calcBBoxSize();
 100.324 +	positionBBox();
 100.325 +	requestReposition();
 100.326 +}
 100.327 +
 100.328 +void LinkableMapObj::setFrameType(const QString &t)
 100.329 +{
 100.330 +	frame->setFrameType(t);
 100.331 +	calcBBoxSize();
 100.332 +	positionBBox();
 100.333 +	requestReposition();
 100.334 +}
 100.335 +
 100.336 +void LinkableMapObj::setVisibility (bool v)
 100.337 +{
 100.338 +	MapObj::setVisibility (v);
 100.339 +	if (visible) 
 100.340 +	{
 100.341 +		bottomline->show();
 100.342 +		// FIXME lines and segments should be done in LMO?
 100.343 +		if (style==StyleLine && l) 
 100.344 +		{
 100.345 +			l->show();
 100.346 +		} else
 100.347 +		{
 100.348 +			QCanvasLine* cl;
 100.349 +			for (cl=segment.first(); cl; cl=segment.next() )
 100.350 +				cl->show();
 100.351 +		} 
 100.352 +	} else 
 100.353 +	{
 100.354 +		bottomline->hide();
 100.355 +		if (style==StyleLine && l) 
 100.356 +		{
 100.357 +			l->hide();
 100.358 +		} else
 100.359 +		{
 100.360 +			QCanvasLine* cl;
 100.361 +			for (cl=segment.first(); cl; cl=segment.next() )
 100.362 +				cl->hide();
 100.363 +		} 
 100.364 +	}	
 100.365 +}
 100.366 +
 100.367 +void LinkableMapObj::updateLink()
 100.368 +{
 100.369 +    // needs:
 100.370 +    //	childPos of parent
 100.371 +    //	orient   of parent
 100.372 +    //	style
 100.373 +    // 
 100.374 +    // sets:
 100.375 +    //	orientation
 100.376 +    //	childPos
 100.377 +    //	parPos
 100.378 +	//  offset
 100.379 +    //	drawing of the link itself
 100.380 +
 100.381 +
 100.382 +	// updateLink is called from move, but called from constructor we don't
 100.383 +	// have parents yet...
 100.384 +	if (style==StyleUndef) return;	
 100.385 +
 100.386 +	if (frame->getFrameType() == NoFrame)
 100.387 +		linkpos=LinkBottom;
 100.388 +	else	
 100.389 +		linkpos=LinkMiddle;
 100.390 +	switch (linkpos)
 100.391 +	{
 100.392 +		case LinkMiddle:
 100.393 +			offset=bbox.height() /2;
 100.394 +			break;
 100.395 +		default :
 100.396 +			offset=bbox.height()-1;			// draw link to bottom of bbox
 100.397 +			break;
 100.398 +	}
 100.399 +	
 100.400 +    double p2x,p2y;								// Set P2 Before setting
 100.401 +	if (!link2ParPos)
 100.402 +	{
 100.403 +		p2x=QPoint( parObj->getChildPos() ).x();	// P1, we have to look at
 100.404 +		p2y=QPoint( parObj->getChildPos() ).y();	// orientation
 100.405 +	} else	
 100.406 +	{
 100.407 +		p2x=QPoint( parObj->getParPos() ).x();	
 100.408 +		p2y=QPoint( parObj->getParPos() ).y();
 100.409 +	} 
 100.410 +
 100.411 +	LinkOrient orientOld=orientation;
 100.412 +
 100.413 +    // Set orientation, first look for orientation of parent
 100.414 +    if (parObj->getOrientation() != OrientUndef ) 
 100.415 +		// use the orientation of the parent:
 100.416 +		orientation=parObj->getOrientation();
 100.417 +    else
 100.418 +    {
 100.419 +		// calc orientation depending on position rel to mapCenter
 100.420 +		if (absPos.x() < QPoint(parObj->getChildPos() ).x() )
 100.421 +			orientation=OrientLeftOfCenter; 
 100.422 +		else
 100.423 +			orientation=OrientRightOfCenter;
 100.424 +    }
 100.425 +
 100.426 +	if ((orientation!=orientOld) && (orientOld!= OrientUndef))
 100.427 +	{
 100.428 +		// Orientation just changed. Reorient this subbranch, because move is called
 100.429 +		// before updateLink => Position is still the old one, which could lead to 
 100.430 +		// linking of subranch to itself => segfault
 100.431 +		//
 100.432 +		// Also possible: called in BranchObj::init(), then orientOld==OrientUndef,
 100.433 +		// no need to reposition now
 100.434 +		reposition();
 100.435 +	}
 100.436 +	
 100.437 +    if (orientation==OrientLeftOfCenter )
 100.438 +    {
 100.439 +		childPos=QPoint (absPos.x(),absPos.y()+offset);
 100.440 +		parPos=QPoint (absPos.x()+ bbox.width(), absPos.y() + offset );
 100.441 +    } else
 100.442 +    {
 100.443 +		childPos=QPoint (absPos.x()+ bbox.width(), absPos.y() + offset ); 
 100.444 +		parPos=QPoint (absPos.x(),absPos.y()+offset);
 100.445 +    }
 100.446 +	/* FIXME
 100.447 +		cout << "      LMO::updateLink   absPos="<<absPos<<endl;
 100.448 +		cout << "      LMO::updateLink childPos="<<childPos<<endl;
 100.449 +		cout << "      LMO::updateLink   parPos="<<parPos<<endl;
 100.450 +		cout << "      LMO::updateLink   offset="<<offset<<endl;
 100.451 +		cout << "      LMO::updateLink   bbox.w="<<bbox.width()<<endl;
 100.452 +		cout << "      LMO::updateLink   bbox.h="<<bbox.height()<<endl;
 100.453 +	*/	
 100.454 +
 100.455 +	double p1x=parPos.x();	// Link is drawn from P1 to P2
 100.456 +	double p1y=parPos.y();
 100.457 +
 100.458 +	double vx=p2x - p1x;	// V=P2-P1
 100.459 +	double vy=p2y - p1y;
 100.460 +
 100.461 +	// Draw the horizontal line below heading (from ChildPos to ParPos)
 100.462 +	bottomline->setPoints (lrint(childPos.x()),
 100.463 +		lrint(childPos.y()),
 100.464 +		lrint(p1x),
 100.465 +		lrint(p1y) );
 100.466 +
 100.467 +	double a;	// angle
 100.468 +	if (vx > -0.000001 && vx < 0.000001)
 100.469 +		a=M_PI_2;
 100.470 +	else
 100.471 +		a=atan( vy / vx );
 100.472 +	// "turning point" for drawing polygonal links
 100.473 +	QPoint tp (-lrint(sin (a)*thickness_start), lrint(cos (a)*thickness_start));	
 100.474 +	
 100.475 +	QCanvasLine *cl;
 100.476 +
 100.477 +	int i;
 100.478 +
 100.479 +    // Draw the link
 100.480 +	switch (style)
 100.481 +	{
 100.482 +		case StyleLine:
 100.483 +			l->setPoints( lrint (parPos.x()),
 100.484 +				lrint(parPos.y()),
 100.485 +				lrint(p2x),
 100.486 +				lrint(p2y) );
 100.487 +			break;	
 100.488 +		case StyleParabel:	
 100.489 +			parabel (pa0, p1x,p1y,p2x,p2y);
 100.490 +			i=0;
 100.491 +			for (cl=segment.first(); cl; cl=segment.next() )
 100.492 +			{	
 100.493 +				cl->setPoints( pa0.point(i).x(), pa0.point(i).y(),pa0.point(i+1).x(),pa0.point(i+1).y());
 100.494 +				i++;
 100.495 +			}
 100.496 +			break;
 100.497 +		case StylePolyLine:
 100.498 +			pa0[0]=QPoint (lrint(p2x+tp.x()), lrint(p2y+tp.y()));
 100.499 +			pa0[1]=QPoint (lrint(p2x-tp.x()), lrint(p2y-tp.y()));
 100.500 +			pa0[2]=QPoint (lrint (parPos.x()), lrint(parPos.y()) );
 100.501 +			p->setPoints (pa0);
 100.502 +			// here too, draw line to avoid missing pixels
 100.503 +			l->setPoints( lrint (parPos.x()),
 100.504 +				lrint(parPos.y()),
 100.505 +				lrint(p2x),
 100.506 +				lrint(p2y) );
 100.507 +			break;
 100.508 +		case StylePolyParabel:	
 100.509 +			parabel (pa1, p1x,p1y,p2x+tp.x(),p2y+tp.y());
 100.510 +			parabel (pa2, p1x,p1y,p2x-tp.x(),p2y-tp.y());
 100.511 +			for (i=0;i<=arcsegs;i++)
 100.512 +			{
 100.513 +				// Combine the arrays to a single one
 100.514 +				pa0[i]=pa1[i];
 100.515 +				pa0[i+arcsegs+1]=pa2[arcsegs-i];
 100.516 +			}	
 100.517 +			p->setPoints (pa0);
 100.518 +			i=0;
 100.519 +			for (cl=segment.first(); cl; cl=segment.next() )
 100.520 +			{	
 100.521 +				cl->setPoints( pa1.point(i).x(), pa1.point(i).y(),pa1.point(i+1).x(),pa1.point(i+1).y());
 100.522 +				i++;
 100.523 +			}
 100.524 +			break;
 100.525 +		default:
 100.526 +			break;
 100.527 +	} // switch (style)	
 100.528 +}
 100.529 +	
 100.530 +LinkableMapObj* LinkableMapObj::getChildObj()
 100.531 +{
 100.532 +    return childObj;
 100.533 +}
 100.534 +
 100.535 +LinkableMapObj* LinkableMapObj::getParObj()
 100.536 +{
 100.537 +    return parObj;
 100.538 +}
 100.539 +
 100.540 +QPoint LinkableMapObj::getChildPos()
 100.541 +{
 100.542 +    return childPos;
 100.543 +}
 100.544 +
 100.545 +QPoint LinkableMapObj::getParPos()
 100.546 +{
 100.547 +    return parPos;
 100.548 +}
 100.549 +
 100.550 +QPoint LinkableMapObj::getRelPos()
 100.551 +{
 100.552 +	if (!parObj) return QPoint (0,0);
 100.553 +    return QPoint(
 100.554 +		absPos.x() - parObj->x(),
 100.555 +		absPos.y() - parObj->y()
 100.556 +	);
 100.557 +}
 100.558 +
 100.559 +LinkOrient LinkableMapObj::getOrientation()
 100.560 +{
 100.561 +    return orientation;
 100.562 +}
 100.563 +
 100.564 +int LinkableMapObj::getDepth()
 100.565 +{
 100.566 +    return depth;
 100.567 +}
 100.568 +
 100.569 +void LinkableMapObj::setMapEditor (MapEditor *me)
 100.570 +{
 100.571 +	mapEditor=me;
 100.572 +}
 100.573 +
 100.574 +MapEditor* LinkableMapObj::getMapEditor ()
 100.575 +{
 100.576 +	return mapEditor;
 100.577 +}
 100.578 +
 100.579 +QPoint LinkableMapObj::getRandPos()
 100.580 +{
 100.581 +	// Choose a random position with given distance to parent:
 100.582 +	double a=rand()%360 * 2 * M_PI / 360;
 100.583 +    return QPoint ( (int)( + 150*cos (a)),
 100.584 +                    (int)( + 150*sin (a)));
 100.585 +}
 100.586 +
 100.587 +void LinkableMapObj::alignRelativeTo (QPoint ref)
 100.588 +{
 100.589 +}
 100.590 +
 100.591 +void LinkableMapObj::reposition()
 100.592 +{
 100.593 +cout << "LMO::reposition  ???"<<endl;
 100.594 +	if (depth==0)
 100.595 +	{
 100.596 +		// only calculate the sizes once. If the deepest LMO changes its height,
 100.597 +		// all upper LMOs have to change, too.
 100.598 +		calcBBoxSizeWithChilds();
 100.599 +
 100.600 +	    alignRelativeTo ( QPoint (absPos.x(),
 100.601 +							absPos.y()-(bboxTotal.height()-bbox.height())/2) );
 100.602 +	} else
 100.603 +	{
 100.604 +		// This is only important for moving branches:
 100.605 +		// For editing a branch it isn't called...
 100.606 +	    alignRelativeTo ( QPoint (absPos.x(),
 100.607 +							absPos.y()-(bboxTotal.height()-bbox.height())/2) );
 100.608 +	}
 100.609 +}
 100.610 +
 100.611 +void LinkableMapObj::requestReposition()
 100.612 +{
 100.613 +	if (!repositionRequest)
 100.614 +	{
 100.615 +		// Pass on the request to parental objects, if this hasn't
 100.616 +		// been done yet
 100.617 +		repositionRequest=true;
 100.618 +		if (parObj) parObj->requestReposition();
 100.619 +	}
 100.620 +}
 100.621 +
 100.622 +void LinkableMapObj::forceReposition()
 100.623 +{
 100.624 +	// Sometimes a reposition has to be done immediatly: For example
 100.625 +	// if the note editor flag changes, there is no user event in mapeditor
 100.626 +	// which could collect requests for a reposition.
 100.627 +	// Then we have to call forceReposition()
 100.628 +	// But no rule without exception: While loading a map or undoing it,
 100.629 +	// we want to block expensive repositioning, but just do it once at
 100.630 +	// the end, thus check first:
 100.631 +
 100.632 +	if (mapEditor->blockReposition()) return;
 100.633 +	
 100.634 +	// Pass on the request to parental objects, if this hasn't been done yet
 100.635 +	
 100.636 +	if (parObj) 
 100.637 +		parObj->forceReposition(); 
 100.638 +	else 
 100.639 +		reposition(); }
 100.640 +
 100.641 +bool LinkableMapObj::repositionRequested()
 100.642 +{
 100.643 +	return repositionRequest;
 100.644 +}
 100.645 +
 100.646 +
 100.647 +void LinkableMapObj::setSelBox()
 100.648 +{
 100.649 +    selbox->setX (bbox.x() );
 100.650 +    selbox->setY (bbox.y() );
 100.651 +    selbox->setSize (bbox.width(), bbox.height() );
 100.652 +}
 100.653 +
 100.654 +void LinkableMapObj::select()
 100.655 +{
 100.656 +	setSelBox();
 100.657 +    selected=true;
 100.658 +    selbox->show();
 100.659 +}
 100.660 +
 100.661 +
 100.662 +void LinkableMapObj::unselect()
 100.663 +{
 100.664 +    selected=false;
 100.665 +    selbox->hide();
 100.666 +}
 100.667 +
 100.668 +void LinkableMapObj::parabel (QPointArray &ya, double p1x, double p1y, double p2x, double p2y)
 100.669 +
 100.670 +{
 100.671 +	double vx=p2x - p1x;	// V=P2-P1
 100.672 +	double vy=p2y - p1y;
 100.673 +
 100.674 +	double dx;				// delta x during calculation of parabel
 100.675 +	
 100.676 +	double pnx;				// next point
 100.677 +	double pny;
 100.678 +	double m;
 100.679 +
 100.680 +	if (vx > -0.0001 && vx < 0.0001)
 100.681 +		m=0;
 100.682 +	else	
 100.683 +		m=(vy / (vx*vx));
 100.684 +	dx=vx/(arcsegs);
 100.685 +	int i;
 100.686 +	ya.setPoint (0,QPoint (lrint(p1x),lrint(p1y)));
 100.687 +	for (i=1;i<=arcsegs;i++)
 100.688 +	{	
 100.689 +		pnx=p1x+dx;
 100.690 +		pny=m*(pnx-parPos.x())*(pnx-parPos.x())+parPos.y();
 100.691 +		ya.setPoint (i,QPoint (lrint(pnx),lrint(pny)));
 100.692 +		p1x=pnx;
 100.693 +		p1y=pny;
 100.694 +	}	
 100.695 +}
 100.696 +
   101.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   101.2 +++ b/linkablemapobj.h	Sun Jan 30 12:59:10 2005 +0000
   101.3 @@ -0,0 +1,113 @@
   101.4 +#ifndef LINKABLEMAPOBJ_H
   101.5 +#define LINKABLEMAPOBJ_H
   101.6 +
   101.7 +#include "frameobj.h"
   101.8 +#include "noteobj.h"
   101.9 +#include "headingobj.h"
  101.10 +#include "flagrowobj.h"
  101.11 +
  101.12 +#define MAX_DEPTH 999
  101.13 +
  101.14 +enum LinkOrient {OrientUndef,OrientLeftOfCenter, OrientRightOfCenter};
  101.15 +enum LinkStyle {
  101.16 +	StyleUndef,
  101.17 +	StyleLine, 
  101.18 +	StyleParabel, 
  101.19 +	StylePolyLine,
  101.20 +	StylePolyParabel
  101.21 +};
  101.22 +enum LinkPos {LinkMiddle,LinkBottom};
  101.23 +enum LinkColorHint {DefaultColor,HeadingColor};
  101.24 +
  101.25 +class LinkableMapObj:public QObject, public MapObj {
  101.26 +	Q_OBJECT
  101.27 +public:
  101.28 +    LinkableMapObj ();
  101.29 +    LinkableMapObj (QCanvas*);
  101.30 +    LinkableMapObj (LinkableMapObj*);
  101.31 +    ~LinkableMapObj ();
  101.32 +	virtual void delLink();
  101.33 +    virtual void init ();
  101.34 +    virtual void copy (LinkableMapObj*);
  101.35 +    void setChildObj (LinkableMapObj*);
  101.36 +    virtual void setParObj (LinkableMapObj*);
  101.37 +    virtual void setParObjTmp (LinkableMapObj*,QPoint,int);	// Only for moving Obj around
  101.38 +	virtual void unsetParObjTmp();						// reuse original ParObj
  101.39 +	LinkStyle getDefLinkStyle();
  101.40 +    void setLinkStyle(LinkStyle);            
  101.41 +	LinkStyle getLinkStyle();
  101.42 +	void setLinkPos (LinkPos);
  101.43 +	LinkPos getLinkPos ();
  101.44 +
  101.45 +	virtual void setLinkColor();					// sets color according to colorhint, overloaded
  101.46 +	virtual void setLinkColor(QColor);
  101.47 +	QColor getLinkColor();
  101.48 +	virtual FrameType getFrameType ();
  101.49 +	virtual void setFrameType (const FrameType &);
  101.50 +	virtual void setFrameType (const QString &);
  101.51 +	virtual void setVisibility (bool);
  101.52 +    virtual void updateLink();				// update parPos and childPos
  101.53 +											// depending on pos
  101.54 +											// redraw link with given style
  101.55 +    LinkableMapObj* getChildObj();			// returns pointer to fromObj
  101.56 +    LinkableMapObj* getParObj();			// returns pointer to toObj
  101.57 +    QPoint getChildPos();					// returns pos where childs dock
  101.58 +    QPoint getParPos();						// returns pos where parents dock
  101.59 +    QPoint getRelPos();						// get position relative to parent (or (0,0))
  101.60 +    LinkOrient getOrientation();			// get orientation
  101.61 +    virtual int getDepth();					// return depth
  101.62 +	virtual void setMapEditor(MapEditor*);	// set MapEditor (needed in LMO::updateNoteFlag)
  101.63 +	virtual MapEditor* getMapEditor();		// get MapEditor (usually from parent);
  101.64 +	virtual QPoint getRandPos();			// make randomised position
  101.65 +
  101.66 +    virtual void alignRelativeTo(const QPoint );
  101.67 +	virtual void reposition();
  101.68 +	virtual void requestReposition();		// do reposition after next user event
  101.69 +	virtual void forceReposition();			// to force a reposition now (outside
  101.70 +											// of mapeditor e.g. in noteeditor
  101.71 +	virtual bool repositionRequested();
  101.72 +
  101.73 +	virtual QRect getTotalBBox()=0;			// return BBox including childs			
  101.74 +	virtual QRect getBBoxSizeWithChilds()=0;// return size of BBox including childs  
  101.75 +	virtual void calcBBoxSizeWithChilds()=0;// calc size of  BBox including childs recursivly
  101.76 +
  101.77 +	virtual void setSelBox();
  101.78 +    virtual void select();
  101.79 +    virtual void unselect();
  101.80 +	virtual	QString getSelectString()=0;
  101.81 +
  101.82 +protected:
  101.83 +	void parabel(QPointArray &,double,double,double,double);	// Create Parabel connecting two points
  101.84 +    QPoint childPos;
  101.85 +    QPoint parPos;
  101.86 +	bool link2ParPos;				// While moving around, sometimes link to parent
  101.87 +	MapEditor* mapEditor;			// for updateNoteFlag() and toggleScroll()
  101.88 +    LinkOrient orientation;     
  101.89 +    int linkwidth;					// width of a link
  101.90 +    int depth;						// depth: undef=-1 mapCenter=0 branch=1..n
  101.91 +	QRect bboxTotal;				// bounding box including childs
  101.92 +
  101.93 +    LinkableMapObj* childObj;
  101.94 +    LinkableMapObj* parObj;
  101.95 +    LinkableMapObj* parObjTmpBuf;	// temporary buffer the original parent
  101.96 +    int offset;                     // vertical offset of dockpos to pos
  101.97 +
  101.98 +	int thickness_start;			// for StylePoly*	
  101.99 +    LinkStyle style;
 101.100 +	LinkPos linkpos;
 101.101 +    QColor linkcolor;               // Link color
 101.102 +    QCanvasLine* l;                 // line style
 101.103 +	QCanvasPolygon* p;				// poly styles
 101.104 +    int arcsegs;                    // arc: number of segments
 101.105 +    QPtrList <QCanvasLine> segment; // a part of e.g. the parabel
 101.106 +	QPointArray pa0;				// For drawing of PolyParabel and PolyLine
 101.107 +	QPointArray pa1;				// For drawing of PolyParabel 
 101.108 +	QPointArray pa2;				// For drawing of PolyParabel	
 101.109 +    QCanvasLine* bottomline;        // on bottom of BBox
 101.110 +	bool repositionRequest;			// 
 101.111 +
 101.112 +	bool selected;					// Used for marking the selection
 101.113 +	QCanvasRectangle* selbox;
 101.114 +	FrameObj *frame;				// frame around object
 101.115 +};
 101.116 +#endif
   102.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   102.2 +++ b/main.cpp	Sun Jan 30 12:59:10 2005 +0000
   102.3 @@ -0,0 +1,177 @@
   102.4 +#include <qapplication.h>
   102.5 +#include <qpixmap.h>
   102.6 +#include <qtranslator.h>
   102.7 +
   102.8 +#include "settings.h"
   102.9 +#include "options.h"
  102.10 +#include "mainwindow.h"
  102.11 +
  102.12 +#include "icons/vym-48x48.xpm"
  102.13 +#include "icons/vym-editor.xpm"
  102.14 +
  102.15 +#include "flagrowobj.h"
  102.16 +
  102.17 +// Global variables
  102.18 +TextEditor *textEditor;			// used in Constr. of LinkableMapObj
  102.19 +								// initialized in mainwindow
  102.20 +
  102.21 +Main *mainWindow;				// used in BranchObj::select()								
  102.22 +MapEditor *clipboardME;			
  102.23 +FlagRowObj *systemFlagsDefault;	// used to copy from in LinkableMapObj
  102.24 +FlagRowObj *standardFlagsDefault;
  102.25 +
  102.26 +// Actions which change sometimes
  102.27 +QAction *actionFileSave;
  102.28 +QAction *actionFilePrint;
  102.29 +QAction *actionEditUndo;
  102.30 +QAction *actionEditCopy;
  102.31 +QAction *actionEditCut;
  102.32 +QAction *actionEditPaste;
  102.33 +QAction *actionEditMoveUp;
  102.34 +QAction *actionEditMoveDown;
  102.35 +QAction *actionEditToggleScroll;
  102.36 +QAction *actionEditOpenURL;
  102.37 +QAction *actionEditURL;
  102.38 +QAction *actionEditHeading2URL;
  102.39 +QAction *actionEditBugzilla2URL;
  102.40 +QAction *actionEditOpenVymLink;
  102.41 +QAction *actionEditVymLink;
  102.42 +QAction *actionEditDeleteVymLink;
  102.43 +QAction *actionEditMapInfo;
  102.44 +QAction *actionEditHeading;
  102.45 +QAction *actionEditDelete;
  102.46 +QAction *actionEditAddBranch;
  102.47 +QAction *actionEditAddBranchAbove;
  102.48 +QAction *actionEditAddBranchBelow;
  102.49 +QAction *actionEditImportAdd;
  102.50 +QAction *actionEditImportReplace;
  102.51 +QAction *actionEditSaveBranch;
  102.52 +QAction *actionEditSelectFirst;
  102.53 +QAction *actionEditSelectLast;
  102.54 +QAction *actionEditLoadImage;
  102.55 +QAction *actionEditToggleFloatExport;
  102.56 +
  102.57 +QAction *actionFormatColor;		
  102.58 +QAction *actionFormatPickColor;		
  102.59 +QAction *actionFormatColorBranch;
  102.60 +QAction *actionFormatColorSubtree;
  102.61 +QAction *actionFormatBackColor;
  102.62 +QAction *actionFormatLinkColorHint;
  102.63 +QAction *actionFormatLinkColor;		
  102.64 +
  102.65 +QActionGroup *actionGroupFormatFrameTypes;
  102.66 +QAction *actionFormatFrameNone;
  102.67 +QAction *actionFormatFrameRectangle;
  102.68 +
  102.69 +QActionGroup *actionGroupFormatLinkStyles;
  102.70 +QAction *actionFormatLinkStyleLine;
  102.71 +QAction *actionFormatLinkStyleParabel;
  102.72 +QAction *actionFormatLinkStylePolyLine;
  102.73 +QAction *actionFormatLinkStylePolyParabel;
  102.74 +
  102.75 +QAction *actionViewToggleNoteEditor;
  102.76 +
  102.77 +QAction *actionSettingsAutoselectHeading;
  102.78 +QAction *actionSettingsAutoselectText;
  102.79 +QAction *actionSettingsPasteNewHeading;
  102.80 +QAction *actionSettingsAutoedit;
  102.81 +QAction *actionSettingsUseDelKey;
  102.82 +
  102.83 +QPopupMenu *branchContextMenu;
  102.84 +QPopupMenu *floatimageContextMenu;
  102.85 +QPopupMenu *saveImageFormatMenu;
  102.86 +QPopupMenu *canvasContextMenu;
  102.87 +QPopupMenu *lastMapsMenu;
  102.88 +QPopupMenu *exportMenu;
  102.89 +QPopupMenu *exportImageFormatMenu;
  102.90 +
  102.91 +
  102.92 +Settings settings;
  102.93 +Options options;
  102.94 +
  102.95 +int statusbarTime=3500;
  102.96 +
  102.97 +int main(int argc, char** argv)
  102.98 +{
  102.99 +    QApplication app(argc,argv);
 102.100 +
 102.101 +
 102.102 +	// Initialize translations
 102.103 +	QTranslator translator (0);
 102.104 +	translator.load( "vym_de", "." );
 102.105 +    app.installTranslator( &translator );
 102.106 +
 102.107 +	// Initializing the row of system flags
 102.108 +	// is done in first call to MapEditor(),
 102.109 +	// because we need at least one canvas first
 102.110 +	systemFlagsDefault=NULL;
 102.111 +	standardFlagsDefault=NULL;
 102.112 +
 102.113 +	// Reading and initializing options commandline options
 102.114 +	options.add ("version", SwitchOption, "v","version");
 102.115 +	options.add ("help", SwitchOption, "h", "help");
 102.116 +	options.add ("quit", SwitchOption, "q", "quit");
 102.117 +	options.add ("test", StringOption, "t", "test");
 102.118 +	options.setHelpText (
 102.119 +		"VYM - View Your Mind\n"
 102.120 +		"--------------------\n\n"
 102.121 +		"Information about vym can be found in vym.pdf,\n"
 102.122 +		"which should be part of the vym package.\n"
 102.123 +		"It is also available at the project homepage:\n\n"
 102.124 +		"http://www.InSilmaril.de/vym\n");
 102.125 +	if (options.parse())
 102.126 +	{
 102.127 +		cout << endl << options.getHelpText()<<endl;
 102.128 +		return 1;
 102.129 +	}
 102.130 +
 102.131 +	if (options.isOn ("version"))
 102.132 +	{
 102.133 +		cout << "vym version "<<__VYM_VERSION__
 102.134 +			<<"  (c) 2004 Uwe Drechsel - "
 102.135 +			<<__BUILD_DATE__<<endl;
 102.136 +			
 102.137 +		return 0;	
 102.138 +	}		
 102.139 +	
 102.140 +	if (options.isOn ("help"))
 102.141 +	{
 102.142 +		cout << options.getHelpText()<<endl;
 102.143 +		return 0;	
 102.144 +	}	
 102.145 +
 102.146 +	if (options.isOn ("test"))
 102.147 +	{
 102.148 +		// FIXME testing string option only
 102.149 +		cout << "Testing: "<<options.getArg("test")<< endl;
 102.150 +	}	
 102.151 +
 102.152 +	// Initialize window of TextEditor
 102.153 +	textEditor = new TextEditor();
 102.154 +	textEditor->setIcon (QPixmap (vym_editor_xpm));
 102.155 +	if (textEditor->showWithMain()) textEditor->show();
 102.156 +
 102.157 +	clipboardME = new MapEditor();
 102.158 +	clipboardME->resize (800,600);
 102.159 +	clipboardME->setCaption("VYM - clipboard");
 102.160 +	clipboardME->hide();
 102.161 +
 102.162 +	// Initialize mainwindow after Mapeditors (because of Flags)
 102.163 +    Main m;
 102.164 +	//m.resize(m.sizeHint());
 102.165 +	m.setIcon (QPixmap (vym_logo_xpm));
 102.166 +	m.show();
 102.167 +	m.fileNew();
 102.168 +	m.loadCmdLine();
 102.169 +
 102.170 +	// For benchmarking we may want to quit immediatly after drawing
 102.171 +	if (options.isOn ("quit"))
 102.172 +	{
 102.173 +		return 0;
 102.174 +	}	
 102.175 +
 102.176 +    QObject::connect( &app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()) );
 102.177 +
 102.178 +    return app.exec();
 102.179 +}
 102.180 +
   103.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   103.2 +++ b/mainwindow.cpp	Sun Jan 30 12:59:10 2005 +0000
   103.3 @@ -0,0 +1,2213 @@
   103.4 +#include "mainwindow.h"
   103.5 +
   103.6 +#include <qstatusbar.h>
   103.7 +#include <qmessagebox.h>
   103.8 +#include <qmenubar.h>
   103.9 +#include <qapplication.h>
  103.10 +#include <qpainter.h>
  103.11 +#include <qprinter.h>
  103.12 +#include <qfile.h>
  103.13 +#include <qfiledialog.h>
  103.14 +#include <qcolor.h>
  103.15 +#include <qcolordialog.h>
  103.16 +#include <qbitmap.h>
  103.17 +#include <qinputdialog.h>
  103.18 +
  103.19 +
  103.20 +#include <iostream>
  103.21 +#include <stdlib.h>
  103.22 +#include <typeinfo>
  103.23 +
  103.24 +#include "version.h"
  103.25 +
  103.26 +#include "icons/filenew.xpm"
  103.27 +#include "icons/fileopen.xpm"
  103.28 +#include "icons/filesave.xpm"
  103.29 +#include "icons/fileprint.xpm"
  103.30 +#include "icons/editundo.xpm"
  103.31 +//#include "icons/editredo.xpm"	// TODO
  103.32 +#include "icons/editcopy.xpm"
  103.33 +#include "icons/editcut.xpm"
  103.34 +#include "icons/editpaste.xpm"
  103.35 +#include "icons/editmoveup.xpm"
  103.36 +#include "icons/editmovedown.xpm"
  103.37 +#include "icons/formatcoloritem.xpm"
  103.38 +#include "icons/formatcolorbranch.xpm"
  103.39 +#include "icons/formatcolorpicker.xpm"
  103.40 +#include "icons/viewzoomreset.xpm"
  103.41 +#include "icons/viewzoomin.xpm"
  103.42 +#include "icons/viewzoomout.xpm"
  103.43 +#include "icons/vym-48x48.xpm"
  103.44 +#include "icons/flag-note.xpm"
  103.45 +#include "icons/flag-url.xpm"
  103.46 +#include "icons/flag-vymlink.xpm"	
  103.47 +#include "icons/flag-scrolled-right.xpm"
  103.48 +
  103.49 +#include "flagrowobj.h"
  103.50 +#include "texteditor.h"
  103.51 +#include "mapeditor.h"
  103.52 +#include "exporthtmldialog.h"
  103.53 +#include "exportxhtmldialog.h"
  103.54 +#include "showtextdialog.h"
  103.55 +#include "process.h"
  103.56 +#include "settings.h"
  103.57 +#include "options.h"
  103.58 +
  103.59 +extern TextEditor *textEditor;
  103.60 +extern Main *mainWindow;
  103.61 +extern int statusbarTime;
  103.62 +extern MapEditor *clipboardME;
  103.63 +extern FlagRowObj* standardFlagsDefault;
  103.64 +
  103.65 +extern QAction* actionFileSave;
  103.66 +extern QAction* actionFilePrint;
  103.67 +extern QAction* actionEditUndo;
  103.68 +extern QAction *actionEditCopy;
  103.69 +extern QAction *actionEditCut;
  103.70 +extern QAction *actionEditPaste;
  103.71 +extern QAction *actionEditMoveUp;
  103.72 +extern QAction *actionEditMoveDown;
  103.73 +extern QAction *actionEditToggleScroll;
  103.74 +extern QAction* actionEditOpenURL;
  103.75 +extern QAction* actionEditURL;
  103.76 +extern QAction* actionEditHeading2URL;
  103.77 +extern QAction* actionEditBugzilla2URL;
  103.78 +extern QAction *actionEditOpenVymLink;
  103.79 +extern QAction *actionEditVymLink;
  103.80 +extern QAction *actionEditDeleteVymLink;
  103.81 +extern QAction *actionEditMapInfo;
  103.82 +extern QAction *actionEditHeading;
  103.83 +extern QAction *actionEditDelete;
  103.84 +extern QAction *actionEditAddBranch;
  103.85 +extern QAction *actionEditAddBranchAbove;
  103.86 +extern QAction *actionEditAddBranchBelow;
  103.87 +extern QAction *actionEditImportAdd;
  103.88 +extern QAction *actionEditImportReplace;
  103.89 +extern QAction *actionEditSaveBranch;
  103.90 +extern QAction *actionEditSelectFirst;
  103.91 +extern QAction *actionEditSelectLast;
  103.92 +extern QAction *actionEditLoadImage;
  103.93 +extern QAction *actionEditToggleFloatExport;
  103.94 +
  103.95 +extern QAction* actionFormatColor;
  103.96 +extern QAction* actionFormatPickColor;
  103.97 +extern QAction* actionFormatColorBranch;
  103.98 +extern QAction* actionFormatColorSubtree;
  103.99 +extern QAction* actionFormatLinkColorHint;
 103.100 +extern QAction* actionFormatBackColor;
 103.101 +extern QAction* actionFormatLinkColor;
 103.102 +
 103.103 +extern QActionGroup *actionGroupFormatFrameTypes;
 103.104 +extern QAction *actionFormatFrameNone;
 103.105 +extern QAction *actionFormatFrameRectangle;
 103.106 +
 103.107 +extern QActionGroup *actionGroupFormatLinkStyles;
 103.108 +extern QAction *actionFormatLinkStyleLine;
 103.109 +extern QAction *actionFormatLinkStyleParabel;
 103.110 +extern QAction *actionFormatLinkStylePolyLine;
 103.111 +extern QAction *actionFormatLinkStylePolyParabel;
 103.112 +
 103.113 +extern QAction *actionViewToggleNoteEditor;
 103.114 +
 103.115 +extern QAction* actionSettingsAutoedit;
 103.116 +extern QAction* actionSettingsAutoselectHeading;
 103.117 +extern QAction* actionSettingsAutoselectHeading;
 103.118 +extern QAction* actionSettingsAutoselectText;
 103.119 +extern QAction* actionSettingsPasteNewHeading;
 103.120 +extern QAction* actionSettingsUseDelKey;
 103.121 +
 103.122 +extern QPopupMenu* branchContextMenu;
 103.123 +extern QPopupMenu* floatimageContextMenu;
 103.124 +extern QPopupMenu* saveImageFormatMenu;
 103.125 +extern QPopupMenu* canvasContextMenu;
 103.126 +extern QPopupMenu* lastMapsMenu;
 103.127 +extern QPopupMenu* exportMenu;
 103.128 +extern QPopupMenu* exportImageFormatMenu;
 103.129 +
 103.130 +
 103.131 +extern Settings settings;
 103.132 +extern Options options;
 103.133 +
 103.134 +#if defined(Q_OS_LINUX)
 103.135 +extern void qt_wait_for_window_manager( QWidget* w );
 103.136 +#endif
 103.137 +
 103.138 +Main::Main(QWidget* parent, const char* name, WFlags f) :
 103.139 +    QMainWindow(parent,name,f)
 103.140 +{
 103.141 +	mainWindow=this;
 103.142 +
 103.143 +	setCaption ("VYM - View Your Mind");
 103.144 +
 103.145 +	// Load window settings
 103.146 +	resize (settings.readNumEntry( "/vym/mainwindow/geometry/width", 800),
 103.147 +	        settings.readNumEntry( "/vym/mainwindow/geometry/height",600));
 103.148 +	move   (settings.readNumEntry( "/vym/mainwindow/geometry/posX", 100),
 103.149 +	        settings.readNumEntry( "/vym/mainwindow/geometry/posY", 100));
 103.150 +
 103.151 +
 103.152 +	// Initialize some settings, which are platform dependant
 103.153 +	QString p,s;
 103.154 +
 103.155 +		// application to open URLs
 103.156 +		p="/vym/mainwindow/readerURL";
 103.157 +		#if defined(Q_OS_LINUX)
 103.158 +			s=settings.readEntry (p,"konqueror");
 103.159 +		#else
 103.160 +			#if defined(Q_OS_MACX)
 103.161 +				s=settings.readEntry (p,"/Applications/Safari.app/Contents/MacOS/Safari");
 103.162 +			#else
 103.163 +				s=settings.readEntry (p,"mozilla");
 103.164 +			#endif
 103.165 +		#endif
 103.166 +		settings.writeEntry( p,s);
 103.167 +
 103.168 +		// application to open PDFs
 103.169 +		p="/vym/mainwindow/readerPDF";
 103.170 +		#if defined(Q_OS_LINUX)
 103.171 +			s=settings.readEntry (p,"acroread");
 103.172 +		#else
 103.173 +			#if defined(Q_OS_MACX)
 103.174 +				s=settings.readEntry (p,"/Applications/Safari.app/Contents/MacOS/Safari");
 103.175 +			#else
 103.176 +				s=settings.readEntry (p,"acroread");
 103.177 +			#endif
 103.178 +		#endif
 103.179 +		settings.writeEntry( p,s);
 103.180 +
 103.181 +	
 103.182 +	maxLastMaps=9;
 103.183 +
 103.184 +	// Create tab widget which holds the maps
 103.185 +	tabWidget= new QTabWidget (this);
 103.186 +	connect( tabWidget, SIGNAL( currentChanged( QWidget * ) ), 
 103.187 +		this, SLOT( editorChanged( QWidget * ) ) );
 103.188 +
 103.189 +	setCentralWidget(tabWidget);	
 103.190 +
 103.191 +    setupFileActions();
 103.192 +    setupEditActions();
 103.193 +    setupFormatActions();
 103.194 +    setupViewActions();
 103.195 +	setupFlagActions();
 103.196 +    setupSettingsActions();
 103.197 +	setupContextMenus();
 103.198 +    if (settings.readBoolEntry( "/vym/mainwindow/showTestMenu",false)) setupTestActions();
 103.199 +    setupHelpActions();
 103.200 +    
 103.201 +	// After menu is created, we can enable some actions
 103.202 +	actionFilePrint->setEnabled (true);
 103.203 +
 103.204 +    statusBar();
 103.205 +
 103.206 +	// Create the default map into first tab
 103.207 +//	fileNew();
 103.208 +//	tabWidget->addTab (new MapEditor(tabWidget,true), "unnamed");
 103.209 +//	currentMapEditor()->show();
 103.210 +
 103.211 +	// Initialize Find window
 103.212 +	findWindow=new FindWindow(NULL,"findwindow");
 103.213 +	connect (findWindow, SIGNAL( findButton(QString) ), 
 103.214 +		this, SLOT(editFind(QString) ) );	
 103.215 +	connect (findWindow, SIGNAL( somethingChanged() ), 
 103.216 +		this, SLOT(editFindChanged() ) );	
 103.217 +
 103.218 +	updateGeometry();
 103.219 +}
 103.220 +
 103.221 +Main::~Main()
 103.222 +{
 103.223 +	// Save Settings
 103.224 +	settings.writeEntry( "/vym/mainwindow/geometry/width", width() );
 103.225 +	settings.writeEntry( "/vym/mainwindow/geometry/height", height() );
 103.226 +	settings.writeEntry( "/vym/mainwindow/geometry/posX", pos().x() );
 103.227 +	settings.writeEntry( "/vym/mainwindow/geometry/posY", pos().y() );
 103.228 +
 103.229 +	settings.writeEntry( "/vym/version/version", __VYM_VERSION__ );
 103.230 +	settings.writeEntry( "/vym/version/builddate", __BUILD_DATE__ );
 103.231 +
 103.232 +	settings.writeEntry( "/vym/mapeditor/editmode/autoselectheading",actionSettingsAutoselectHeading->isOn() );
 103.233 +	settings.writeEntry( "/vym/mapeditor/editmode/autoselecttext",actionSettingsAutoselectText->isOn() );
 103.234 +	settings.writeEntry( "/vym/mapeditor/editmode/pastenewheading",actionSettingsPasteNewHeading->isOn() );
 103.235 +	settings.writeEntry( "/vym/mapeditor/editmode/autoedit",actionSettingsAutoedit->isOn() );
 103.236 +	settings.writeEntry( "/vym/mapeditor/editmode/useDelKey",actionSettingsUseDelKey->isOn() );
 103.237 +
 103.238 +	QString s;
 103.239 +	int maps=lastMaps.count();
 103.240 +	settings.writeEntry( "/vym/lastMaps/number",maps );
 103.241 +	for (int i=1;i<=maps;i++)
 103.242 +	{
 103.243 +		QStringList::Iterator it = lastMaps.at(i-1);
 103.244 +		s=QString("/vym/lastMaps/map-%1").arg(i);
 103.245 +		if (!s.isEmpty() && i<=maxLastMaps) 
 103.246 +			settings.writeEntry (s, *it);
 103.247 +	}
 103.248 +
 103.249 +
 103.250 +	// To make the texteditor save its settings, call the destructor
 103.251 +	delete (textEditor);
 103.252 +}
 103.253 +
 103.254 +void Main::loadCmdLine()
 103.255 +{
 103.256 +	/* TODO draw some kind of splashscreen while loading...
 103.257 +	if (qApp->argc()>1)
 103.258 +	{
 103.259 +	}
 103.260 +	*/
 103.261 +	
 103.262 +	QStringList flist=options.getFileList();
 103.263 +	QStringList::Iterator it=flist.begin();
 103.264 +
 103.265 +	while (it !=flist.end() )
 103.266 +	{
 103.267 +		fileLoad (*it, NewMap);
 103.268 +		*it++;
 103.269 +	}	
 103.270 +}
 103.271 +
 103.272 +
 103.273 +void Main::statusMessage(const QString &s)
 103.274 +{
 103.275 +	statusBar()->message (s);
 103.276 +}
 103.277 +
 103.278 +void Main::closeEvent (QCloseEvent* )
 103.279 +{
 103.280 +	fileExitVYM();
 103.281 +}
 103.282 +
 103.283 +// File Actions
 103.284 +void Main::setupFileActions()
 103.285 +{
 103.286 +    QToolBar *tb = new QToolBar( this );
 103.287 +    tb->setLabel( "File Actions" );
 103.288 +    QPopupMenu *menu = new QPopupMenu( this );
 103.289 +    menuBar()->insertItem( tr( "&File" ), menu );
 103.290 +
 103.291 +	// Keycodes:  /usr/lib64/qt3/include/qnamespace.h
 103.292 +
 103.293 +    QAction *a;
 103.294 +    a = new QAction( tr( "New map" ), QPixmap( filenew_xpm ), tr( "&New..." ), CTRL + Key_N, this, "fileNew" );
 103.295 +    connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) );
 103.296 +    a->addTo( tb );
 103.297 +    a->addTo( menu );
 103.298 +	
 103.299 +    a = new QAction( tr( "Open" ), QPixmap( fileopen_xpm), tr( "&Open..." ), CTRL + Key_O, this, "fileOpen" );
 103.300 +    connect( a, SIGNAL( activated() ), this, SLOT( fileLoad() ) );
 103.301 +    a->addTo( tb );
 103.302 +    a->addTo( menu );
 103.303 +	
 103.304 +	lastMapsMenu = new QPopupMenu (this);
 103.305 +
 103.306 +    menu->insertItem (tr("Open Recent"),lastMapsMenu );
 103.307 +    menu->insertSeparator();
 103.308 +	
 103.309 +    a = new QAction( tr( "Save" ), QPixmap( filesave_xpm ), tr( "&Save..." ), CTRL + Key_S, this, "fileSave" );
 103.310 +    connect( a, SIGNAL( activated() ), this, SLOT( fileSave() ) );
 103.311 +    a->addTo( tb );
 103.312 +    a->addTo( menu );
 103.313 +	actionFileSave=a;
 103.314 +	
 103.315 +    a = new QAction( tr( "Save &As" ), QPixmap(), tr( "Save &As..." ), 0, this, "fileSaveAs" );
 103.316 +    connect( a, SIGNAL( activated() ), this, SLOT( fileSaveAs() ) );
 103.317 +    a->addTo( menu );
 103.318 +
 103.319 +    menu->insertSeparator();
 103.320 +
 103.321 +    a = new QAction( tr( "Import directory structure (experimental)" ), QPixmap(), tr( "Import Dir" ), 0, this, "export" );
 103.322 +    connect( a, SIGNAL( activated() ), this, SLOT( fileImportDir() ) );
 103.323 +    a->addTo( menu );
 103.324 +
 103.325 +	exportMenu = new QPopupMenu (this);
 103.326 +    menu->insertItem (tr("Export"),exportMenu );
 103.327 +
 103.328 +    menu->insertSeparator();
 103.329 +
 103.330 +
 103.331 +    a = new QAction( tr( "Print" ), QPixmap( fileprint_xpm ), tr( "&Print..." ), CTRL + Key_P, this, "filePrint" );
 103.332 +    connect( a, SIGNAL( activated() ), this, SLOT( filePrint() ) );
 103.333 +    a->addTo( tb );
 103.334 +    a->addTo( menu );
 103.335 +	actionFilePrint=a;
 103.336 +
 103.337 +    a = new QAction( tr( "Close Map" ), QPixmap(), tr( "&Close Map" ), ALT + Key_C, this, "fileCloseMap" );
 103.338 +    connect( a, SIGNAL( activated() ), this, SLOT( fileCloseMap() ) );
 103.339 +    a->addTo( menu );
 103.340 +
 103.341 +    a = new QAction( tr( "Exit VYM" ), QPixmap(), tr( "E&xit VYM" ), CTRL + Key_Q, this, "fileExitVYM" );
 103.342 +    connect( a, SIGNAL( activated() ), this, SLOT( fileExitVYM() ) );
 103.343 +    a->addTo( menu );
 103.344 +}
 103.345 +
 103.346 +
 103.347 +//Edit Actions
 103.348 +void Main::setupEditActions()
 103.349 +{
 103.350 +    QToolBar *tb = new QToolBar( this );
 103.351 +    tb->setLabel( "Edit Actions" );
 103.352 +    QPopupMenu *menu = new QPopupMenu( this );
 103.353 +    menuBar()->insertItem( tr( "&Edit" ), menu );
 103.354 +
 103.355 +    QAction *a;
 103.356 +    a = new QAction( tr( "Undo" ), QPixmap( editundo_xpm ), tr( "&Undo" ), CTRL + Key_Z, this, "editUndo" );
 103.357 +    connect( a, SIGNAL( activated() ), this, SLOT( editUndo() ) );
 103.358 +	a->setEnabled (false);
 103.359 +    a->addTo( tb );
 103.360 +    a->addTo( menu );
 103.361 +	actionEditUndo=a;
 103.362 +    /*
 103.363 +    a = new QAction( tr( "Redo" ), QPixmap( editredo_xpm ), tr( "&Redo" ), CTRL + Key_Y, this, "editRedo" ); 
 103.364 +    connect( a, SIGNAL( activated() ), this, SLOT( editRedo() ) );
 103.365 +    a->addTo( tb );
 103.366 +    a->addTo( menu );
 103.367 +    */
 103.368 +    menu->insertSeparator();
 103.369 +    a = new QAction( tr( "Copy" ), QPixmap( editcopy_xpm ), tr( "&Copy" ), CTRL + Key_C, this, "editCopy" );
 103.370 +    connect( a, SIGNAL( activated() ), this, SLOT( editCopy() ) );
 103.371 +	a->setEnabled (false);
 103.372 +    a->addTo( tb );
 103.373 +    a->addTo( menu );
 103.374 +	actionEditCopy=a;
 103.375 +    a = new QAction( tr( "Cut" ), QPixmap( editcut_xpm ), tr( "Cu&t" ), CTRL + Key_X, this, "editCut" );
 103.376 +    connect( a, SIGNAL( activated() ), this, SLOT( editCut() ) );
 103.377 +	a->setEnabled (false);
 103.378 +    a->addTo( tb );
 103.379 +    a->addTo( menu );
 103.380 +	actionEditCut=a;
 103.381 +    a = new QAction( tr( "Paste" ), QPixmap( editpaste_xpm ), tr( "&Paste" ), CTRL + Key_V, this, "editPaste" );
 103.382 +    connect( a, SIGNAL( activated() ), this, SLOT( editPaste() ) );
 103.383 +	a->setEnabled (false);
 103.384 +    a->addTo( tb );
 103.385 +    a->addTo( menu );
 103.386 +	actionEditPaste=a;
 103.387 +    a = new QAction( tr( "Move branch up" ), QPixmap( editmoveup_xpm ), tr( "Move up" ), Key_PageUp, this, "editMoveUp" );
 103.388 +    connect( a, SIGNAL( activated() ), this, SLOT( editMoveUp() ) );
 103.389 +	a->setEnabled (false);
 103.390 +    a->addTo( tb );
 103.391 +    a->addTo( menu );
 103.392 +	actionEditMoveUp=a;
 103.393 +    a = new QAction( tr( "Move branch down" ), QPixmap( editmovedown_xpm ), tr( "Move down" ), Key_PageDown, this, "editMoveDown" );
 103.394 +    connect( a, SIGNAL( activated() ), this, SLOT( editMoveDown() ) );
 103.395 +	a->setEnabled (false);
 103.396 +    a->addTo( tb );
 103.397 +    a->addTo( menu );
 103.398 +	actionEditMoveDown=a;
 103.399 +
 103.400 +    a = new QAction( tr( "Scroll branch" ), QPixmap(flag_scrolled_right_xpm), tr( "Scroll branch" ), Key_ScrollLock, this, "scroll" );
 103.401 +    connect( a, SIGNAL( activated() ), this, SLOT( editToggleScroll() ) );
 103.402 +	a->setEnabled (false);
 103.403 +    a->addTo( tb );
 103.404 +    a->addTo( menu );
 103.405 +	actionEditToggleScroll=a;
 103.406 +	
 103.407 +    a = new QAction( tr( "Unscroll all" ), QPixmap(), tr( "Unscroll all scrolled branches" ), 0, this, "scroll" );
 103.408 +    connect( a, SIGNAL( activated() ), this, SLOT( editUnScrollAll() ) );
 103.409 +    a->addTo( menu );
 103.410 +	
 103.411 +    menu->insertSeparator();
 103.412 +
 103.413 +	a = new QAction( tr( "Find" ), QPixmap(), tr( "Find" ), CTRL + Key_F, this, "find" );
 103.414 +    connect( a, SIGNAL( activated() ), this, SLOT( editOpenFindWindow() ) );
 103.415 +    a->addTo( menu );
 103.416 +    
 103.417 +	menu->insertSeparator();
 103.418 +
 103.419 +	a = new QAction( tr( "Open URL" ), QPixmap(flag_url_xpm), tr( "Open URL" ), CTRL + Key_U, this, "url" );
 103.420 +    connect( a, SIGNAL( activated() ), this, SLOT( editOpenURL() ) );
 103.421 +    a->addTo( menu );
 103.422 +    a->addTo( tb );
 103.423 +	a->setEnabled (false);
 103.424 +	actionEditOpenURL=a;
 103.425 +
 103.426 +	a = new QAction( tr( "Edit URL" ), QPixmap(), tr( "Edit URL" ), SHIFT + CTRL + Key_U, this, "url" );
 103.427 +    connect( a, SIGNAL( activated() ), this, SLOT( editURL() ) );
 103.428 +    a->addTo( menu );
 103.429 +	a->setEnabled (false);
 103.430 +	actionEditURL=a;
 103.431 +	
 103.432 +	a = new QAction( tr( "Use heading of selected branch as URL" ), QPixmap(), tr( "Use heading for URL" ), 0, this, "heading2url" );
 103.433 +    connect( a, SIGNAL( activated() ), this, SLOT( editHeading2URL() ) );
 103.434 +    a->addTo( menu );
 103.435 +	a->setEnabled (false);
 103.436 +	actionEditHeading2URL=a;
 103.437 +    
 103.438 +	a = new QAction( tr( "Create URL to Bugzilla" ), QPixmap(), tr( "Create URL to Bugzilla" ), 0, this, "bugzilla2url" );
 103.439 +    connect( a, SIGNAL( activated() ), this, SLOT( editBugzilla2URL() ) );
 103.440 +	a->setEnabled (false);
 103.441 +	actionEditBugzilla2URL=a;
 103.442 +    
 103.443 +	menu->insertSeparator();
 103.444 +	
 103.445 +    a = new QAction( tr( "Jump to another vym map, if needed load it first" ), QPixmap(flag_vymlink_xpm), tr( "Jump to map" ), 0, this, "jumpMap" );
 103.446 +    connect( a, SIGNAL( activated() ), this, SLOT( editOpenVymLink() ) );
 103.447 +    a->addTo( menu );
 103.448 +    a->addTo( tb );
 103.449 +	a->setEnabled (false);
 103.450 +	actionEditOpenVymLink=a;
 103.451 +	
 103.452 +    a = new QAction( tr( "Edit link to another vym map" ), QPixmap(), tr( "Edit vym link" ), 0, this, "editLinkMap" );
 103.453 +    connect( a, SIGNAL( activated() ), this, SLOT( editVymLink() ) );
 103.454 +    a->addTo( menu );
 103.455 +	a->setEnabled (false);
 103.456 +	actionEditVymLink=a;
 103.457 +
 103.458 +    a = new QAction( tr( "Delete link to another vym map" ), QPixmap(), tr( "Delete vym link" ), 0, this, "deleteLinkMap" );
 103.459 +    connect( a, SIGNAL( activated() ), this, SLOT( editDeleteVymLink() ) );
 103.460 +    a->addTo( menu );
 103.461 +	a->setEnabled (false);
 103.462 +	actionEditDeleteVymLink=a;
 103.463 +
 103.464 +	menu->insertSeparator();
 103.465 +
 103.466 +    a = new QAction( tr( "Edit Map Info" ), QPixmap(), tr( "Edit Map Info" ), 0, this, "editMapInfo" );
 103.467 +    connect( a, SIGNAL( activated() ), this, SLOT( editMapInfo() ) );
 103.468 +    a->addTo( menu );
 103.469 +	a->setEnabled (true);
 103.470 +	actionEditMapInfo=a;
 103.471 +
 103.472 +	menu->insertSeparator();
 103.473 +
 103.474 +    // Shortcuts to modify heading:
 103.475 +    a = new QAction( tr( "edit Heading" ),tr( "Edit heading" ), Key_Enter, this, "editHeading" );
 103.476 +    connect( a, SIGNAL( activated() ), this, SLOT( editHeading() ) );
 103.477 +	a->setEnabled (false);
 103.478 +    a->addTo ( menu );
 103.479 +	actionEditHeading=a;
 103.480 +    a = new QAction( tr( "edit Heading" ),tr( "Edit heading" ), Key_Return, this, "editHeading" );
 103.481 +    connect( a, SIGNAL( activated() ), this, SLOT( editHeading() ) );
 103.482 +    //a->addTo ( menu );
 103.483 +    
 103.484 +    // Shortcut to delete selection
 103.485 +    a = new QAction( tr( "Delete Selection" ),tr( "Delete Selection" ), Key_Delete, this, "deleteBranch" );
 103.486 +    connect( a, SIGNAL( activated() ), this, SLOT( editDeleteSelection() ) );
 103.487 +	a->setEnabled (false);
 103.488 +    a->addTo ( menu );
 103.489 +	actionEditDelete=a;
 103.490 +    
 103.491 +    // Shortcut to add branch
 103.492 +	#if defined (Q_OS_MACX)
 103.493 +		a = new QAction( tr( "Add a branch as child of selection" ),tr( "Add branch as child" ), CTRL + Key_I, this, "newBranch" );
 103.494 +	#else
 103.495 +		a = new QAction( tr( "Add a branch as child of selection" ),tr( "Add branch as child" ), Key_Insert, this, "newBranch" );
 103.496 +	#endif
 103.497 +    connect( a, SIGNAL( activated() ), this, SLOT( editNewBranch() ) );
 103.498 +	a->setEnabled (false);
 103.499 +    a->addTo ( menu );
 103.500 +	actionEditAddBranch=a;
 103.501 +
 103.502 +	// Add branch above
 103.503 +    a = new QAction( tr( "Add a branch above selection" ),tr( "Add branch above" ), SHIFT+Key_Insert, this, "newBranch" );
 103.504 +    connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchAbove() ) );
 103.505 +	a->setEnabled (false);
 103.506 +    a->addTo ( menu );
 103.507 +	actionEditAddBranchAbove=a;
 103.508 +
 103.509 +	// Add branch below 
 103.510 +    a = new QAction( tr( "Add a branch below selection" ),tr( "Add branch below" ), CTRL +Key_Insert, this, "newBranch" );
 103.511 +    connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchBelow() ) );
 103.512 +	a->setEnabled (false);
 103.513 +    a->addTo ( menu );
 103.514 +	actionEditAddBranchBelow=a;
 103.515 +
 103.516 +	// Import at selection (adding to selection)
 103.517 +    a = new QAction( tr( "Add map at selection" ),tr( "Import (add)" ), 0, this, "importAdd" );
 103.518 +    connect( a, SIGNAL( activated() ), this, SLOT( editImportAdd() ) );
 103.519 +	a->setEnabled (false);
 103.520 +    a->addTo ( menu );
 103.521 +	actionEditImportAdd=a;
 103.522 +
 103.523 +	// Import at selection (replacing selection)
 103.524 +    a = new QAction( tr( "Replace selection with map" ),tr( "Import (replace)" ), 0, this, "importReplace" );
 103.525 +    connect( a, SIGNAL( activated() ), this, SLOT( editImportReplace() ) );
 103.526 +	a->setEnabled (false);
 103.527 +    a->addTo ( menu );
 103.528 +	actionEditImportReplace=a;
 103.529 +
 103.530 +	// Save selection 
 103.531 +    a = new QAction( tr( "Save selction" ),tr( "Save selection" ), 0, this, "saveSelection" );
 103.532 +    connect( a, SIGNAL( activated() ), this, SLOT( editSaveBranch() ) );
 103.533 +	a->setEnabled (false);
 103.534 +    a->addTo ( menu );
 103.535 +	actionEditSaveBranch=a;
 103.536 +
 103.537 +    // Shortcuts for navigating with cursor:
 103.538 +    a = new QAction( tr( "Select upper branch" ),tr( "Select upper branch" ), Key_Up, this, "upperBranch" );
 103.539 +    connect( a, SIGNAL( activated() ), this, SLOT( editUpperBranch() ) );
 103.540 +    a = new QAction( tr( "Select lower branch" ),tr( "Select lower branch" ), Key_Down, this, "lowerBranch" );
 103.541 +    connect( a, SIGNAL( activated() ), this, SLOT( editLowerBranch() ) );
 103.542 +    a = new QAction( tr( "Select left branch" ),tr( "Select left branch" ), Key_Left, this, "upperBranch" );
 103.543 +    connect( a, SIGNAL( activated() ), this, SLOT( editLeftBranch() ) );
 103.544 +    a = new QAction( tr( "Select right branch" ),tr( "Select child branch" ), Key_Right, this, "rightBranch" );
 103.545 +    connect( a, SIGNAL( activated() ), this, SLOT( editRightBranch() ) );
 103.546 +    a = new QAction( tr( "Select first branch" ),tr( "Select first branch" ), Key_Home, this, "firstBranch" );
 103.547 +	a->setEnabled (false);
 103.548 +    a->addTo ( menu );
 103.549 +	actionEditSelectFirst=a;
 103.550 +    connect( a, SIGNAL( activated() ), this, SLOT( editFirstBranch() ) );
 103.551 +    a = new QAction( tr( "Select last branch" ),tr( "Select last branch" ), Key_End, this, "lastBranch" );
 103.552 +    connect( a, SIGNAL( activated() ), this, SLOT( editLastBranch() ) );
 103.553 +	a->setEnabled (false);
 103.554 +    a->addTo ( menu );
 103.555 +	actionEditSelectLast=a;
 103.556 +
 103.557 +    a = new QAction( tr( "Add Image" ),tr( "Add Image" ), 0, this, "loadImage" );
 103.558 +    connect( a, SIGNAL( activated() ), this, SLOT( editLoadImage() ) );
 103.559 +	actionEditLoadImage=a;
 103.560 +}
 103.561 +
 103.562 +// Format Actions
 103.563 +void Main::setupFormatActions()
 103.564 +{
 103.565 +    QPopupMenu *menu = new QPopupMenu( this );
 103.566 +    menuBar()->insertItem( tr( "&Format" ), menu );
 103.567 +
 103.568 +    QToolBar *tb = new QToolBar( this );
 103.569 +    QAction *a;
 103.570 +    QPixmap pix( 16,16);
 103.571 +    pix.fill (black);
 103.572 +    actionFormatColor= new QAction( tr( "Set Color" ), pix, tr( "Set &Color" ), 0, this, "formatColor" );
 103.573 +    connect( actionFormatColor, SIGNAL( activated() ), this, SLOT( formatSelectColor() ) );
 103.574 +    actionFormatColor->addTo( tb );
 103.575 +    actionFormatColor->addTo( menu );
 103.576 +    a= new QAction( tr( "Pick color\nHint: You can pick a color from another branch and color using CTRL+Left Button" ), QPixmap(formatcolorpicker_xpm), tr( "Pic&k color" ), CTRL + Key_K, this, "pickColor" );
 103.577 +    connect( a, SIGNAL( activated() ), this, SLOT( formatPickColor() ) );
 103.578 +	a->setEnabled (false);
 103.579 +    a->addTo( tb );
 103.580 +    a->addTo( menu );
 103.581 +	actionFormatPickColor=a;
 103.582 +    a= new QAction( tr( "Color branch" ), QPixmap(formatcoloritem_xpm), tr( "Color &branch" ), CTRL + Key_I, this, "colorItem" );
 103.583 +    connect( a, SIGNAL( activated() ), this, SLOT( formatColorItem() ) );
 103.584 +	a->setEnabled (false);
 103.585 +    a->addTo( tb );
 103.586 +    a->addTo( menu );
 103.587 +	actionFormatColorBranch=a;
 103.588 +    a= new QAction( tr( "Color Subtree" ), QPixmap(formatcolorbranch_xpm), tr( "Color sub&tree" ), CTRL + Key_T, this, "colorBranch" );
 103.589 +    connect( a, SIGNAL( activated() ), this, SLOT( formatColorBranch() ) );
 103.590 +	a->setEnabled (false);
 103.591 +    a->addTo( menu );
 103.592 +    a->addTo( tb );
 103.593 +	actionFormatColorSubtree=a;
 103.594 +
 103.595 +    menu->insertSeparator();
 103.596 +	actionGroupFormatLinkStyles=new QActionGroup ( this, "formatLinkStyles");
 103.597 +	actionGroupFormatLinkStyles->setExclusive (true);
 103.598 +    a= new QAction( tr( "Line" ), QPixmap(), tr( "Linkstyle Line" ), 0, actionGroupFormatLinkStyles, "formatLinkStyleLine" );
 103.599 +	a->setToggleAction(true);
 103.600 +    connect( a, SIGNAL( activated() ), this, SLOT( formatLinkStyleLine() ) );
 103.601 +	actionFormatLinkStyleLine=a;
 103.602 +    a= new QAction( tr( "Line" ), QPixmap(), tr( "Linkstyle Parabel" ), 0, actionGroupFormatLinkStyles, "formatLinkStyleLine" );
 103.603 +	a->setToggleAction(true);
 103.604 +    connect( a, SIGNAL( activated() ), this, SLOT( formatLinkStyleParabel() ) );
 103.605 +	actionFormatLinkStyleParabel=a;
 103.606 +    a= new QAction( tr( "PolyLine" ), QPixmap(), tr( "Linkstyle Thick Line" ), 0, actionGroupFormatLinkStyles, "formatLinkStyleLine" );
 103.607 +	a->setToggleAction(true);
 103.608 +    connect( a, SIGNAL( activated() ), this, SLOT( formatLinkStylePolyLine() ) );
 103.609 +	actionFormatLinkStylePolyLine=a;
 103.610 +    a= new QAction( tr( "PolyParabel" ), QPixmap(), tr( "Linkstyle Thick Parabel" ), 0, actionGroupFormatLinkStyles, "formatLinkStylePolyParabel" );
 103.611 +	a->setToggleAction(true);
 103.612 +    connect( a, SIGNAL( activated() ), this, SLOT( formatLinkStylePolyParabel() ) );
 103.613 +	actionFormatLinkStylePolyParabel=a;
 103.614 +	actionGroupFormatLinkStyles->addTo (menu);
 103.615 +	
 103.616 +	actionGroupFormatFrameTypes=new QActionGroup ( this, "formatFrameTypes");
 103.617 +	actionGroupFormatFrameTypes->setExclusive (true);
 103.618 +    a = new QAction( tr( "No Frame" ),tr( "No Frame" ), 0, actionGroupFormatFrameTypes, "frameNone" );
 103.619 +	a->setToggleAction(true);
 103.620 +    connect( a, SIGNAL( activated() ), this, SLOT( formatFrameNone() ) );
 103.621 +	actionFormatFrameNone=a;
 103.622 +    a = new QAction( tr( "Rectangle" ),tr( "Rectangle" ), 0, actionGroupFormatFrameTypes, "frameRectangle" );
 103.623 +	a->setToggleAction(true);
 103.624 +    connect( a, SIGNAL( activated() ), this, SLOT( formatFrameRectangle() ) );
 103.625 +	actionFormatFrameRectangle=a;
 103.626 +
 103.627 +    menu->insertSeparator();
 103.628 +    a= new QAction( tr( "Use same color for links and headings" ), QPixmap(), tr( "&Use color of heading for link" ), 0, this, "formatLinkColorHint" );
 103.629 +	a->setToggleAction(true);
 103.630 +    connect( a, SIGNAL( activated() ), this, SLOT( formatToggleLinkColorHint() ) );
 103.631 +	a->addTo( menu );
 103.632 +	actionFormatLinkColorHint=a;
 103.633 +    pix.fill (white);
 103.634 +    actionFormatLinkColor= new QAction( tr( "Set Link Color" ), pix, tr( "Set &Link Color" ), 0, this, "formatLinkColor" );
 103.635 +    connect( actionFormatLinkColor, SIGNAL( activated() ), this, SLOT( formatSelectLinkColor() ) );
 103.636 +    actionFormatLinkColor->addTo( menu );
 103.637 +    actionFormatBackColor= new QAction( tr( "Set Background Color" ), pix, tr( "Set &Background Color" ), 0, this, "formatBackColor" );
 103.638 +    connect( actionFormatBackColor, SIGNAL( activated() ), this, SLOT( formatSelectBackColor() ) );
 103.639 +    actionFormatBackColor->addTo( menu );
 103.640 +}
 103.641 +
 103.642 +// View Actions
 103.643 +void Main::setupViewActions()
 103.644 +{
 103.645 +    QToolBar *tb = new QToolBar( this );
 103.646 +    tb->setLabel( "View Actions" );
 103.647 +    QPopupMenu *menu = new QPopupMenu( this );
 103.648 +    menuBar()->insertItem( tr( "&View" ), menu );
 103.649 +
 103.650 +    QAction *a;
 103.651 +    a = new QAction( tr( "Zoom reset" ), QPixmap(viewzoomreset_xpm), tr( "reset Zoom" ), 0, this, "zoomReset" );
 103.652 +    connect( a, SIGNAL( activated() ), this, SLOT(viewZoomReset() ) );
 103.653 +    a->addTo( tb );
 103.654 +    a->addTo( menu );
 103.655 +    a = new QAction( tr( "Zoom in" ), QPixmap(viewzoomin_xpm), tr( "Zoom in" ), CTRL + Key_Plus, this, "zoomIn" );
 103.656 +    connect( a, SIGNAL( activated() ), this, SLOT(viewZoomIn() ) );
 103.657 +    a->addTo( tb );
 103.658 +    a->addTo( menu );
 103.659 +    a = new QAction( tr( "Zoom out" ), QPixmap(viewzoomout_xpm), tr( "Zoom out" ), CTRL + Key_Minus, this, "zoomOut" );
 103.660 +    connect( a, SIGNAL( activated() ), this, SLOT( viewZoomOut() ) );
 103.661 +    a->addTo( tb );
 103.662 +    a->addTo( menu );
 103.663 +    a = new QAction( tr( "Toggle Note Editor" ), QPixmap(flag_note_xpm), tr( "Toggle Note Editor" ), CTRL + Key_E , this, "noteEditor" );
 103.664 +    connect( a, SIGNAL( activated() ), this, SLOT(windowToggleNoteEditor() ) );
 103.665 +	a->setToggleAction(true);
 103.666 +	if (textEditor->showWithMain())
 103.667 +		a->setOn(true);
 103.668 +	else	
 103.669 +		a->setOn(false);
 103.670 +    a->addTo( tb );
 103.671 +    a->addTo( menu );
 103.672 +	actionViewToggleNoteEditor=a;
 103.673 +    a = new QAction( tr( "&Next Window" ), QPixmap(), tr( "Next Window" ), ALT + Key_N , this, "nextWindow" );
 103.674 +    connect( a, SIGNAL( activated() ), this, SLOT(windowNextEditor() ) );
 103.675 +    a->addTo( menu );
 103.676 +    a = new QAction( tr( "&Previous Window" ), QPixmap(), tr( "Previous Window" ), ALT + Key_P , this, "previousWindow" );
 103.677 +    connect( a, SIGNAL( activated() ), this, SLOT(windowPreviousEditor() ) );
 103.678 +    a->addTo( menu );
 103.679 +}
 103.680 +
 103.681 +// Flag Actions
 103.682 +void Main::setupFlagActions()
 103.683 +{
 103.684 +	standardFlagsDefault->makeToolbar(this, "Standard Flags");
 103.685 +}
 103.686 +
 103.687 +// Settings Actions
 103.688 +void Main::setupSettingsActions()
 103.689 +{
 103.690 +    QPopupMenu *menu = new QPopupMenu( this );
 103.691 +    menuBar()->insertItem( tr( "&Settings" ), menu );
 103.692 +
 103.693 +	QAction *a;
 103.694 +
 103.695 +
 103.696 +    a = new QAction( tr( "Set application to open pdf files" ), QPixmap(), tr( "Set application to open pdf files" ), 0, this, "setPDF" );
 103.697 +    connect( a, SIGNAL( activated() ), this, SLOT( settingsPDF() ) );
 103.698 +    a->addTo( menu );
 103.699 +
 103.700 +    a = new QAction( tr( "Set application to open an URL" ), QPixmap(), tr( "Set application to open an URL" ), 0, this, "setURL" );
 103.701 +    connect( a, SIGNAL( activated() ), this, SLOT( settingsURL() ) );
 103.702 +    a->addTo( menu );
 103.703 +
 103.704 +    menu->insertSeparator();
 103.705 +    a = new QAction( tr( "Edit branch after adding it" ), QPixmap(), tr( "Edit branch after adding it" ), 0, this, "autoedit" );
 103.706 +	a->setToggleAction(true);
 103.707 +	a->setOn ( settings.readBoolEntry ("/vym/mapeditor/editmode/autoedit",true) );
 103.708 +    a->addTo( menu );
 103.709 +	actionSettingsAutoedit=a;
 103.710 +
 103.711 +    a= new QAction( tr( "Select branch after adding it" ), QPixmap(), tr( "Select branch after adding it" ), 0, this, "autoselectheading" );
 103.712 +	a->setToggleAction(true);
 103.713 +	a->setOn ( settings.readBoolEntry ("/vym/mapeditor/editmode/autoselect",false) );
 103.714 +    a->addTo( menu );
 103.715 +	actionSettingsAutoselectHeading=a;
 103.716 +	
 103.717 +    a= new QAction( tr( "Select heading before editing" ), QPixmap(), tr( "Select existing heading" ), 0, this, "autoselectexistingtext" );
 103.718 +	a->setToggleAction(true);
 103.719 +	a->setOn ( settings.readBoolEntry ("/vym/mapeditor/editmode/autoselectexistingtext",true) );
 103.720 +    a->addTo( menu );
 103.721 +	actionSettingsAutoselectText=a;
 103.722 +	
 103.723 +    a= new QAction( tr( "Enable pasting into new branch" ), QPixmap(), tr( "Enable pasting into new branch" ), 0, this, "pastenewheading" );
 103.724 +	a->setToggleAction(true);
 103.725 +	a->setOn ( settings.readBoolEntry ("/vym/mapeditor/editmode/newheadingisempty",true) );
 103.726 +    a->addTo( menu );
 103.727 +	actionSettingsPasteNewHeading=a;
 103.728 +	
 103.729 +    a= new QAction( tr( "Enable Delete key for deleting branches" ), QPixmap(), tr( "Enable Delete key" ), 0, this, "delkey" );
 103.730 +	a->setToggleAction(true);
 103.731 +	a->setOn ( settings.readBoolEntry ("/vym/mapeditor/editmode/useDelKey",false) );
 103.732 +    a->addTo( menu );
 103.733 +	actionSettingsUseDelKey=a;
 103.734 +}
 103.735 +
 103.736 +// Test Actions
 103.737 +void Main::setupTestActions()
 103.738 +{
 103.739 +    QPopupMenu *menu = new QPopupMenu( this );
 103.740 +    menuBar()->insertItem( tr( "&Test" ), menu );
 103.741 +
 103.742 +    QAction *a;
 103.743 +    a = new QAction( tr( "Test Flag" ), QPixmap(), tr( "test flag" ), 0, this, "flag" );
 103.744 +    connect( a, SIGNAL( activated() ), this, SLOT( testFunction() ) );
 103.745 +    a->addTo( menu );
 103.746 +
 103.747 +	a = new QAction( tr( "Show Clipboard" ), QPixmap(), tr( "Show clipboard" ), 0, this, "clipboard" );
 103.748 +    connect( a, SIGNAL( activated() ), this, SLOT( testShowClipboard() ) );
 103.749 +    a->addTo( menu );
 103.750 +}
 103.751 +
 103.752 +// Help Actions
 103.753 +void Main::setupHelpActions()
 103.754 +{
 103.755 +    QPopupMenu *menu = new QPopupMenu( this );
 103.756 +    menuBar()->insertItem( tr( "&Help" ), menu );
 103.757 +
 103.758 +    QAction *a;
 103.759 +    a = new QAction( tr( "Open VYM Documentation (pdf)" ), QPixmap(), tr( "Open VYM Documentation (pdf) " ), 0, this, "about" );
 103.760 +    connect( a, SIGNAL( activated() ), this, SLOT( helpDoc() ) );
 103.761 +    a->addTo( menu );
 103.762 +
 103.763 +    a = new QAction( tr( "Information about VYM" ), QPixmap(), tr( "About VYM" ), 0, this, "about" );
 103.764 +    connect( a, SIGNAL( activated() ), this, SLOT( helpAbout() ) );
 103.765 +    a->addTo( menu );
 103.766 +
 103.767 +    a = new QAction( tr( "Information about QT toolkit" ), QPixmap(), tr( "About QT" ), 0, this, "about" );
 103.768 +    connect( a, SIGNAL( activated() ), this, SLOT( helpAboutQT() ) );
 103.769 +    a->addTo( menu );
 103.770 +}
 103.771 +
 103.772 +// Context Menus
 103.773 +void Main::setupContextMenus()
 103.774 +{
 103.775 +	QAction*a;
 103.776 +
 103.777 +	// Context Menu for branch or mapcenter
 103.778 +	branchContextMenu =new QPopupMenu (this);
 103.779 +	actionEditAddBranch->addTo ( branchContextMenu );
 103.780 +	actionEditAddBranchAbove->addTo ( branchContextMenu );
 103.781 +	actionEditAddBranchBelow->addTo ( branchContextMenu );
 103.782 +	actionEditSaveBranch->addTo( branchContextMenu );
 103.783 +	branchContextMenu->insertSeparator();	
 103.784 +	actionEditImportAdd->addTo ( branchContextMenu );
 103.785 +	actionEditImportReplace->addTo ( branchContextMenu );
 103.786 +	branchContextMenu->insertSeparator();	
 103.787 +	actionEditOpenURL->addTo ( branchContextMenu );
 103.788 +	actionEditURL->addTo ( branchContextMenu );
 103.789 +	actionEditHeading2URL->addTo ( branchContextMenu );
 103.790 +    if (settings.readBoolEntry( "/vym/mainwindow/showTestMenu",false)) 
 103.791 +		actionEditBugzilla2URL->addTo( branchContextMenu );
 103.792 +	branchContextMenu->insertSeparator();	
 103.793 +	actionEditOpenVymLink->addTo ( branchContextMenu );
 103.794 +	actionEditVymLink->addTo ( branchContextMenu );
 103.795 +	actionEditDeleteVymLink->addTo ( branchContextMenu );
 103.796 +	branchContextMenu->insertSeparator();	
 103.797 +	actionEditLoadImage->addTo( branchContextMenu );
 103.798 +	branchContextMenu->insertSeparator();	
 103.799 +	actionEditCopy->addTo( branchContextMenu );
 103.800 +	actionEditCut->addTo( branchContextMenu );
 103.801 +	actionEditPaste->addTo( branchContextMenu );
 103.802 +	branchContextMenu->insertSeparator();	
 103.803 +	actionGroupFormatFrameTypes->addTo( branchContextMenu );
 103.804 +
 103.805 +	// Context menu for floatimage
 103.806 +	floatimageContextMenu =new QPopupMenu (this);
 103.807 +	saveImageFormatMenu=new QPopupMenu (this);
 103.808 +	exportImageFormatMenu=new QPopupMenu (this);
 103.809 +
 103.810 +	QStrList fmt = QImage::outputFormats();
 103.811 +	for (const char* f = fmt.first(); f; f = fmt.next()) 
 103.812 +	{
 103.813 +		saveImageFormatMenu->insertItem( f );
 103.814 +		exportImageFormatMenu->insertItem( f );
 103.815 +	}	
 103.816 +	connect( saveImageFormatMenu, SIGNAL( activated(int) ), this, SLOT( editSaveImage(int ) ) );
 103.817 +	connect( exportImageFormatMenu, SIGNAL( activated(int) ), this, SLOT( fileExportImage(int ) ) );
 103.818 +	floatimageContextMenu->insertItem( tr("Save image"),saveImageFormatMenu );
 103.819 +	
 103.820 +	floatimageContextMenu->insertSeparator();	
 103.821 +	actionEditCopy->addTo( floatimageContextMenu );
 103.822 +	actionEditCut->addTo( floatimageContextMenu );
 103.823 +
 103.824 +	floatimageContextMenu->insertSeparator();	
 103.825 +    a = new QAction( tr( "Use for Export" ), QPixmap(), tr( "Use for Export"), 0, this, "useForExport" );
 103.826 +	a->setToggleAction(true);
 103.827 +    connect( a, SIGNAL( activated() ), this, SLOT( editToggleFloatExport() ) );
 103.828 +    a->addTo( floatimageContextMenu);
 103.829 +	actionEditToggleFloatExport=a;
 103.830 +
 103.831 +
 103.832 +
 103.833 +	// Context menu for exports
 103.834 +	exportMenu->insertItem ( tr("Export map as image"),exportImageFormatMenu);
 103.835 +
 103.836 +    a = new QAction( tr( "Export as ASCII (still experimental)" ), QPixmap(), tr( "Export (ASCII)" ), 0, this, "exportASCII" );
 103.837 +    connect( a, SIGNAL( activated() ), this, SLOT( fileExportASCII() ) );
 103.838 +    a->addTo( exportMenu );
 103.839 +
 103.840 +	a = new QAction( tr( "Export XML" ), QPixmap(), tr( "Export XML" ),  0, this, "exportXML" );
 103.841 +    connect( a, SIGNAL( activated() ), this, SLOT( fileExportXML() ) );
 103.842 +    a->addTo( exportMenu );
 103.843 +	
 103.844 +    if (settings.readBoolEntry( "/vym/mainwindow/showTestMenu",false)) 
 103.845 +	{
 103.846 +		a = new QAction( tr( "Export HTML" ), QPixmap(), tr( "Export HTML" ), 0, this, "exportHTML" );
 103.847 +		connect( a, SIGNAL( activated() ), this, SLOT( fileExportHTML() ) );
 103.848 +		a->addTo( exportMenu );
 103.849 +	}
 103.850 +
 103.851 +	a = new QAction( tr( "Export XHTML" ), QPixmap(), tr( "Export XHTML" ), ALT + Key_X, this, "exportXHTML" );
 103.852 +    connect( a, SIGNAL( activated() ), this, SLOT( fileExportXHTML() ) );
 103.853 +    a->addTo( exportMenu );
 103.854 +
 103.855 +	
 103.856 +	// Context menu for canvas
 103.857 +	canvasContextMenu =new QPopupMenu (this);
 103.858 +	actionEditMapInfo->addTo( canvasContextMenu );
 103.859 +	canvasContextMenu->insertSeparator();	
 103.860 +	actionGroupFormatLinkStyles->addTo( canvasContextMenu );
 103.861 +	canvasContextMenu->insertSeparator();	
 103.862 +	actionFormatLinkColorHint->addTo( canvasContextMenu );
 103.863 +	actionFormatLinkColor->addTo( canvasContextMenu );
 103.864 +	actionFormatBackColor->addTo( canvasContextMenu );
 103.865 +
 103.866 +	// Menu for last opened files
 103.867 +	// Read settings initially
 103.868 +	QString s;
 103.869 +	int j=settings.readNumEntry( "/vym/lastMaps/number",0);
 103.870 +	for (int i=1;i<=j;i++)
 103.871 +	{
 103.872 +		s=settings.readEntry(QString("/vym/lastMaps/map-%1").arg(i),"");
 103.873 +		if (!s.isEmpty() && j<=maxLastMaps) 
 103.874 +			lastMaps.append(s);
 103.875 +	}
 103.876 +	setupLastMapsMenu();
 103.877 +	connect( lastMapsMenu, SIGNAL( activated(int) ), this, SLOT( fileLoadLast(int ) ) );
 103.878 +}
 103.879 +
 103.880 +void Main::setupLastMapsMenu()
 103.881 +{
 103.882 +	// Remove double entries
 103.883 +	QStringList::Iterator it=lastMaps.begin();
 103.884 +	QStringList::Iterator jt;
 103.885 +	while (it!=lastMaps.end() )
 103.886 +	{
 103.887 +		jt=it;
 103.888 +		++jt;
 103.889 +		while (jt!=lastMaps.end() )
 103.890 +		{
 103.891 +			if (*it == *jt)		
 103.892 +				jt=lastMaps.remove(jt);
 103.893 +			else	
 103.894 +				jt++;
 103.895 +		}
 103.896 +		it++;
 103.897 +	}	
 103.898 +
 103.899 +	// Limit length of list to maxLastMaps
 103.900 +	while ((int)(lastMaps.count()) > maxLastMaps) lastMaps.pop_back();
 103.901 +	
 103.902 +	// build Menu from lastMaps string list
 103.903 +	lastMapsMenu->clear();
 103.904 +	for (it = lastMaps.begin(); it != lastMaps.end(); ++it ) 
 103.905 +		lastMapsMenu->insertItem (*it );
 103.906 +		
 103.907 +}
 103.908 +
 103.909 +void Main::hideEvent (QHideEvent * )
 103.910 +{
 103.911 +	if (!textEditor->isMinimized() ) textEditor->hide();
 103.912 +}
 103.913 +
 103.914 +void Main::showEvent (QShowEvent * )
 103.915 +{
 103.916 +	if (textEditor->showWithMain()) textEditor->show();
 103.917 +}
 103.918 +
 103.919 +bool Main::reallyWriteDirectory(const QString &dir)
 103.920 +{
 103.921 +	QStringList eList = QDir(dir).entryList();
 103.922 +	if (eList.first() ==".")  eList.pop_front();	// remove "."
 103.923 +	if (eList.first() =="..") eList.pop_front();	// remove "."
 103.924 +	if (!eList.isEmpty())
 103.925 +	{
 103.926 +		QMessageBox mb( "VYM",
 103.927 +			tr("The directory ") + dir + 
 103.928 +			tr(" is not empty. Do you risk to overwrite its contents?"),
 103.929 +		QMessageBox::Warning,
 103.930 +		QMessageBox::Yes ,
 103.931 +		QMessageBox::Cancel | QMessageBox::Default,
 103.932 +		QMessageBox::QMessageBox::NoButton );
 103.933 +
 103.934 +		mb.setButtonText( QMessageBox::Yes, tr("Overwrite") );
 103.935 +		mb.setButtonText( QMessageBox::No, tr("Cancel"));
 103.936 +		switch( mb.exec() ) 
 103.937 +		{
 103.938 +			case QMessageBox::Yes:
 103.939 +				// save 
 103.940 +				return true;
 103.941 +			case QMessageBox::Cancel:
 103.942 +				// do nothing
 103.943 +				return false;
 103.944 +		}
 103.945 +	}
 103.946 +	return true;
 103.947 +}
 103.948 +
 103.949 +QString Main::browseDirectory (const QString &caption)
 103.950 +{
 103.951 +	QFileDialog fd(this,caption);
 103.952 +	fd.setMode (QFileDialog::DirectoryOnly);
 103.953 +	fd.setCaption("VYM - "+caption);
 103.954 +	fd.show();
 103.955 +	
 103.956 +	if ( fd.exec() == QDialog::Accepted )
 103.957 +		return fd.selectedFile();
 103.958 +	else
 103.959 +		return "";
 103.960 +}
 103.961 +
 103.962 +MapEditor* Main::currentMapEditor() const
 103.963 +{
 103.964 +    if ( tabWidget->currentPage() &&
 103.965 +	 tabWidget->currentPage()->inherits( "MapEditor" ) )
 103.966 +		return (MapEditor*)tabWidget->currentPage();
 103.967 +    return NULL;	
 103.968 +}
 103.969 +
 103.970 +//TODO not used now, maybe use this for overview window later
 103.971 +void Main::newView() 
 103.972 +{
 103.973 +    // Open a new view... have it delete when closed.
 103.974 +    Main *m = new Main(0, 0, WDestructiveClose);
 103.975 +    qApp->setMainWidget(m);
 103.976 +    m->show();
 103.977 +    qApp->setMainWidget(0);
 103.978 +}
 103.979 +
 103.980 +void Main::editorChanged(QWidget *)
 103.981 +{
 103.982 +	// Unselect all possibly selected objects
 103.983 +	// (Important to update note editor)
 103.984 +	int i;
 103.985 +	MapEditor *me;
 103.986 +	for (i=0;i<=tabWidget->count() -1;i++)
 103.987 +	{
 103.988 +		
 103.989 +		me=(MapEditor*)tabWidget->page(i);
 103.990 +		me->unselect();
 103.991 +	}	
 103.992 +	currentMapEditor()->reselect();
 103.993 +
 103.994 +	// Update actions to in menus and toolbars according to editor
 103.995 +	currentMapEditor()->updateActions();
 103.996 +}
 103.997 +
 103.998 +void Main::fileNew()
 103.999 +{
103.1000 +	QString fn="unnamed";
103.1001 +	MapEditor* medit = new MapEditor (tabWidget, true);
103.1002 +	tabWidget->addTab (medit,fn);
103.1003 +	tabWidget->showPage(medit);
103.1004 +	medit->viewport()->setFocus();
103.1005 +	medit->select("mc:");
103.1006 +}
103.1007 +
103.1008 +void Main::fileLoad(QString fn, const LoadMode &lmode)
103.1009 +{
103.1010 +	// Error codes
103.1011 +	enum errorCode {success,aborted};
103.1012 +	errorCode err=success;
103.1013 +	
103.1014 +	// fn is usually the archive, mapfile the file after uncompressing
103.1015 +	QString mapfile;
103.1016 +
103.1017 +	// Make fn absolute (needed for unzip)
103.1018 +	fn=QDir (fn).absPath();
103.1019 +
103.1020 +	MapEditor *me;
103.1021 +
103.1022 +	if (lmode==NewMap)
103.1023 +	{
103.1024 +		// Check, if map is already loaded
103.1025 +		int i=0;
103.1026 +		while (i<=tabWidget->count() -1)
103.1027 +		{
103.1028 +			me=(MapEditor*)tabWidget->page(i);
103.1029 +			if (me->getFilePath() == fn)
103.1030 +			{
103.1031 +				// Already there, ask for confirmation
103.1032 +				QMessageBox mb( "VYM",
103.1033 +					tr("The map ") + fn + tr ("\n is already opened."
103.1034 +					"Opening the same map in multiple editors may lead \n"
103.1035 +					"to confusion when finishing working with vym."
103.1036 +					"Do you want to"),
103.1037 +					QMessageBox::Warning,
103.1038 +					QMessageBox::Yes | QMessageBox::Default,
103.1039 +					QMessageBox::Cancel | QMessageBox::Escape,
103.1040 +					QMessageBox::QMessageBox::NoButton);
103.1041 +				mb.setButtonText( QMessageBox::Yes, tr("Open anyway") );
103.1042 +				mb.setButtonText( QMessageBox::Cancel, tr("Cancel"));
103.1043 +				switch( mb.exec() ) 
103.1044 +				{
103.1045 +					case QMessageBox::Yes:
103.1046 +						// load anyway
103.1047 +						i=tabWidget->count();
103.1048 +						break;
103.1049 +					case QMessageBox::Cancel:
103.1050 +						// do nothing
103.1051 +						return;
103.1052 +						break;
103.1053 +				}
103.1054 +			}
103.1055 +			i++;
103.1056 +		}
103.1057 +	}
103.1058 +
103.1059 +
103.1060 +	// Try to load map
103.1061 +    if ( !fn.isEmpty() )
103.1062 +	{
103.1063 +		me = currentMapEditor();
103.1064 +		int tabIndex=tabWidget->currentPageIndex();
103.1065 +		// Check first, if mapeditor exists
103.1066 +		// If it is not default AND we want a new map, 
103.1067 +		// create a new mapeditor in a new tab
103.1068 +		if ( lmode==NewMap && (!me || !me->isDefault() ) )
103.1069 +		{
103.1070 +			me = new MapEditor (tabWidget,true);
103.1071 +			tabWidget->addTab (me,fn);
103.1072 +			tabIndex=tabWidget->indexOf (me);
103.1073 +			tabWidget->setCurrentPage (tabIndex);
103.1074 +		}
103.1075 +		
103.1076 +		// Check, if file exists (important for creating new files
103.1077 +		// from command line
103.1078 +		if (!QFile(fn).exists() )
103.1079 +		{
103.1080 +			QMessageBox mb( "VYM",
103.1081 +				tr("The map") + fn + 
103.1082 +				tr(" does not exist.\n Do you want to create a new one?"),
103.1083 +				QMessageBox::Question,
103.1084 +				QMessageBox::Yes ,
103.1085 +				QMessageBox::Cancel | QMessageBox::Default,
103.1086 +				QMessageBox::QMessageBox::NoButton );
103.1087 +
103.1088 +			mb.setButtonText( QMessageBox::Yes, tr("Create"));
103.1089 +			mb.setButtonText( QMessageBox::No, tr("Cancel"));
103.1090 +			switch( mb.exec() ) 
103.1091 +			{
103.1092 +				case QMessageBox::Yes:
103.1093 +					// Create new map
103.1094 +					currentMapEditor()->setFilePath(fn);
103.1095 +					tabWidget->setTabLabel (currentMapEditor(),
103.1096 +						currentMapEditor()->getFileName() );
103.1097 +					statusBar()->message( "Created " + fn , statusbarTime );
103.1098 +					return;
103.1099 +						
103.1100 +				case QMessageBox::Cancel:
103.1101 +					// don't create new map
103.1102 +					statusBar()->message( "Loading " + fn + " failed!", statusbarTime );
103.1103 +					fileCloseMap();
103.1104 +					return;
103.1105 +			}
103.1106 +		}	
103.1107 +
103.1108 +
103.1109 +		//tabWidget->currentPage() won't be NULL here, because of above...
103.1110 +		tabWidget->showPage(me);
103.1111 +		me->viewport()->setFocus();
103.1112 +
103.1113 +		// Create temporary directory for packing
103.1114 +		char tmpdir1[]="/tmp/vym-XXXXXX";	
103.1115 +		QString tmpMapDir=mkdtemp(tmpdir1);
103.1116 +
103.1117 +		// Try to unzip file
103.1118 +		Process *zipProc=new Process ();
103.1119 +		zipProc->clearArguments();
103.1120 +		zipProc->setWorkingDirectory (QDir(tmpMapDir));
103.1121 +		zipProc->addArgument ("unzip");
103.1122 +		zipProc->addArgument (fn );
103.1123 +		zipProc->addArgument ("-d");
103.1124 +		zipProc->addArgument (tmpMapDir);
103.1125 +
103.1126 +		if (!zipProc->start() )
103.1127 +		{
103.1128 +			QMessageBox::critical( 0, tr( "Critical Load Error" ),
103.1129 +						   tr("Couldn't start unzip to decompress data."));
103.1130 +			err=aborted;
103.1131 +			
103.1132 +		} else
103.1133 +		{
103.1134 +			zipProc->waitFinished();
103.1135 +			if (!zipProc->normalExit() )
103.1136 +			{
103.1137 +				QMessageBox::critical( 0, tr( "Critical Load Error" ),
103.1138 +							   tr("unzip didn't exit normally") +
103.1139 +							   zipProc->getErrout() );
103.1140 +				err=aborted;
103.1141 +			} else
103.1142 +			{
103.1143 +				if (zipProc->exitStatus()>0)
103.1144 +				{
103.1145 +					if (zipProc->exitStatus()==9)
103.1146 +					{
103.1147 +						// no zipped file, but maybe .xml or old version? Try again.
103.1148 +						mapfile=fn;
103.1149 +						me->setZipped(false);
103.1150 +					}	
103.1151 +					else	
103.1152 +					{
103.1153 +						QMessageBox::critical( 0, tr( "Critical Load Error" ),
103.1154 +									   QString("unzip exit code:  %1").arg(zipProc->exitStatus() ) +
103.1155 +									   zipProc->getErrout() );
103.1156 +						err=aborted;
103.1157 +					}
103.1158 +				} else
103.1159 +				{	// Uncompressing was successfull,
103.1160 +					// load from uncompressed temporary directory
103.1161 +
103.1162 +					me->setZipped(true);
103.1163 +
103.1164 +					
103.1165 +					// Look for mapname.xml
103.1166 +					mapfile= fn.left(fn.findRev(".",-1,true));
103.1167 +					mapfile=mapfile.section( '/', -1 );
103.1168 +					QFile file( tmpMapDir + "/" + mapfile + ".xml");
103.1169 +					if (!file.exists() )
103.1170 +					{
103.1171 +						// mapname.xml does not exist, well, 
103.1172 +						// maybe some renamed the mapname.vym file...
103.1173 +						// Try to find any .xml in the toplevel 
103.1174 +						// directory of the .vym file
103.1175 +						QStringList flist=QDir (tmpMapDir).entryList("*.xml");
103.1176 +						if (flist.count()==1) 
103.1177 +						{
103.1178 +							// Only one entry, take this one
103.1179 +							mapfile=tmpMapDir + "/"+flist.first();
103.1180 +						} else
103.1181 +						{
103.1182 +							for ( QStringList::Iterator it = flist.begin(); it != flist.end(); ++it ) 
103.1183 +								*it=tmpMapDir + "/" + *it;
103.1184 +							// FIXME	
103.1185 +							// Multiple entries, load all (but only the first one into this ME)
103.1186 +							//mainWindow->fileLoadFromTmp (flist);
103.1187 +							//returnCode=1;	// Silently forget this attempt to load
103.1188 +							qWarning ("MainWindow::load (fn)  multimap found...");
103.1189 +						}	
103.1190 +							
103.1191 +						if (flist.isEmpty() )
103.1192 +						{
103.1193 +							QMessageBox::critical( 0, tr( "Critical Load Error" ),
103.1194 +									   tr("Couldn't find a map (*.xml) in .vym archive.\n"));
103.1195 +							err=aborted;				   
103.1196 +						}	
103.1197 +					} //file doesn't exist	
103.1198 +					else
103.1199 +						mapfile=file.name();
103.1200 +				} // Uncompressing successfull
103.1201 +			}
103.1202 +		}
103.1203 +
103.1204 +		// Finally load map into mapEditor
103.1205 +		me->setFilePath (mapfile,fn);
103.1206 +		if (me->load(mapfile,lmode))
103.1207 +			err=aborted;
103.1208 +
103.1209 +		// Delete tmpDir
103.1210 +		system ( "rm -rf "+tmpMapDir);
103.1211 +
103.1212 +		// Check for errors
103.1213 +		if (err==success) 
103.1214 +		{
103.1215 +			if (lmode==NewMap)
103.1216 +			{
103.1217 +				me->setFilePath (fn);
103.1218 +				tabWidget->changeTab(tabWidget->page(tabIndex), me->getFileName());
103.1219 +				lastMaps.prepend(me->getFilePath() );
103.1220 +				setupLastMapsMenu();
103.1221 +				actionFilePrint->setEnabled (true);
103.1222 +			}	
103.1223 +			statusBar()->message( "Loaded " + fn, statusbarTime );
103.1224 +			return;
103.1225 +		} else 
103.1226 +		{
103.1227 +			if (lmode==NewMap)
103.1228 +				fileCloseMap();
103.1229 +		}	
103.1230 +
103.1231 +
103.1232 +	}
103.1233 +	statusBar()->message( "Could not load " + fn, statusbarTime );
103.1234 +}
103.1235 +
103.1236 +
103.1237 +void Main::fileLoad(const LoadMode &lmode)
103.1238 +{
103.1239 +	QFileDialog *fd=new QFileDialog( this);
103.1240 +	if (!lastFileDir.isEmpty()) 
103.1241 +		fd->setDir (lastFileDir);
103.1242 +	fd->addFilter ("XML (*.xml)");
103.1243 +	fd->addFilter ("VYM map (*.vym *.vyp)");
103.1244 +	switch (lmode)
103.1245 +	{
103.1246 +		case NewMap:
103.1247 +			fd->setCaption(tr("Load vym map"));
103.1248 +			break;
103.1249 +		case ImportAdd:
103.1250 +			fd->setCaption(tr("Import: Add vym map to selection"));
103.1251 +			break;
103.1252 +		case ImportReplace:
103.1253 +			fd->setCaption(tr("Import: Replace selection with vym map"));
103.1254 +			break;
103.1255 +	}
103.1256 +	fd->show();
103.1257 +
103.1258 +	QString fn;
103.1259 +	if ( fd->exec() == QDialog::Accepted )
103.1260 +	{
103.1261 +		lastFileDir=fd->dirPath();
103.1262 +        fn = fd->selectedFile();
103.1263 +		fileLoad(fn, lmode);				   
103.1264 +	}
103.1265 +}
103.1266 +
103.1267 +void Main::fileLoad()
103.1268 +{
103.1269 +	fileLoad (NewMap);
103.1270 +}
103.1271 +
103.1272 +void Main::fileLoadLast(int i)
103.1273 +{
103.1274 +	fileLoad(*lastMaps.at(lastMapsMenu->indexOf (i) ),NewMap);			   
103.1275 +}
103.1276 +
103.1277 +void Main::fileSave(const SaveMode &savemode)
103.1278 +{
103.1279 +	// tmp dir for zipping 
103.1280 +	QString tmpMapDir;
103.1281 +	
103.1282 +	// Error codes
103.1283 +	enum errorCode {success,aborted};
103.1284 +	errorCode err=success;
103.1285 +	
103.1286 +	QString safeFilePath;
103.1287 +
103.1288 +	bool saveZipped=currentMapEditor()->saveZipped();
103.1289 +
103.1290 +	if (currentMapEditor())
103.1291 +	{
103.1292 +		QString fn=currentMapEditor()->getFilePath();
103.1293 +		// filename=unnamed, filepath="" in constructor...
103.1294 +		if ( !fn.isEmpty() ) 
103.1295 +		{	
103.1296 +			// We have a filepath, go on saving			
103.1297 +			// First remove existing file, we 
103.1298 +			// don't want to add to old zip archives
103.1299 +			QFile f(fn);
103.1300 +			if (f.exists() ) 
103.1301 +				if (!f.remove())
103.1302 +					QMessageBox::warning( 0, tr( "Save Error" ),
103.1303 +						fn+   tr("\ncould not be removed before saving"));
103.1304 +
103.1305 +			// Look, if we should zip the data:
103.1306 +			if (!saveZipped)
103.1307 +			{
103.1308 +				QMessageBox mb( "VYM",
103.1309 +					tr("The map ") + fn + 
103.1310 +					tr ("\ndid not use the compressed "
103.1311 +					"vym file format.\nWriting it uncompressed will also write images \n"
103.1312 +					"and flags and thus may overwrite files in the "
103.1313 +					"given directory\n\nDo you want to write the map"),
103.1314 +					QMessageBox::Warning,
103.1315 +					QMessageBox::Yes | QMessageBox::Default,
103.1316 +					QMessageBox::No ,
103.1317 +					QMessageBox::Cancel | QMessageBox::Escape);
103.1318 +				mb.setButtonText( QMessageBox::Yes, tr("compressed (vym default)") );
103.1319 +				mb.setButtonText( QMessageBox::No, tr("uncompressed") );
103.1320 +				mb.setButtonText( QMessageBox::Cancel, tr("Cancel"));
103.1321 +				switch( mb.exec() ) 
103.1322 +				{
103.1323 +					case QMessageBox::Yes:
103.1324 +						// save compressed (default file format)
103.1325 +						saveZipped=true;
103.1326 +						break;
103.1327 +					case QMessageBox::No:
103.1328 +						// save uncompressed
103.1329 +						saveZipped=false;
103.1330 +						break;
103.1331 +					case QMessageBox::Cancel:
103.1332 +						// do nothing
103.1333 +						return;
103.1334 +						break;
103.1335 +				}
103.1336 +			}
103.1337 +
103.1338 +			if (saveZipped)
103.1339 +			{
103.1340 +				char tmpdir1[]="/tmp/vym-XXXXXX";	
103.1341 +				tmpMapDir=mkdtemp(tmpdir1);
103.1342 +			
103.1343 +				safeFilePath=currentMapEditor()->getFilePath();
103.1344 +				currentMapEditor()->setFilePath (tmpMapDir+"/"+
103.1345 +					currentMapEditor()->getMapName()+ ".xml",
103.1346 +					safeFilePath);
103.1347 +				currentMapEditor()->save (savemode);
103.1348 +				currentMapEditor()->setFilePath (safeFilePath);
103.1349 +				
103.1350 +				// zip the temporary directory
103.1351 +				Process *zipProc=new Process ();
103.1352 +				zipProc->clearArguments();
103.1353 +				zipProc->setWorkingDirectory (QDir(tmpMapDir));
103.1354 +				zipProc->addArgument ("zip");
103.1355 +				zipProc->addArgument ("-r");
103.1356 +				zipProc->addArgument (fn);
103.1357 +				zipProc->addArgument (".");
103.1358 +
103.1359 +				if (!zipProc->start() )
103.1360 +				{	
103.1361 +					// zip could not be started
103.1362 +					QMessageBox::critical( 0, tr( "Critical Save Error" ),
103.1363 +								   tr("Couldn't start zip to compress data."));
103.1364 +					err=aborted;
103.1365 +				} else
103.1366 +				{
103.1367 +					// zip could be started
103.1368 +					zipProc->waitFinished();
103.1369 +					if (!zipProc->normalExit() )
103.1370 +					{
103.1371 +						QMessageBox::critical( 0, tr( "Critical Save Error" ),
103.1372 +									   tr("zip didn't exit normally")+
103.1373 +									   "\n" + zipProc->getErrout());
103.1374 +						err=aborted;
103.1375 +					} else
103.1376 +					{
103.1377 +						if (zipProc->exitStatus()>0)
103.1378 +						{
103.1379 +							QMessageBox::critical( 0, tr( "Critical Save Error" ),
103.1380 +									   QString("zip exit code:  %1").arg(zipProc->exitStatus() )+
103.1381 +									   "\n" + zipProc->getErrout() );
103.1382 +							err=aborted;
103.1383 +						}
103.1384 +					}
103.1385 +				}	// zip could be started
103.1386 +			} // save zipped
103.1387 +			else
103.1388 +			{
103.1389 +				// Save unzipped. 
103.1390 +				safeFilePath=currentMapEditor()->getFilePath();
103.1391 +				currentMapEditor()->setFilePath (fn, safeFilePath);
103.1392 +				currentMapEditor()->save (savemode);
103.1393 +				currentMapEditor()->setFilePath (safeFilePath);
103.1394 +			} // save zipped 	
103.1395 +		} // filepath available
103.1396 +		else
103.1397 +		{
103.1398 +			// We have  no filepath yet,
103.1399 +			// call fileSaveAs() now, this will call fileSave() 
103.1400 +			// again.
103.1401 +			fileSaveAs(savemode);
103.1402 +		}
103.1403 +    }
103.1404 +
103.1405 +	if (currentMapEditor()->saveZipped())
103.1406 +	{
103.1407 +		// Delete tmpDir
103.1408 +		system ( "rm -rf "+ tmpMapDir );
103.1409 +	} 
103.1410 +
103.1411 +	if (err==success)
103.1412 +		statusBar()->message( 
103.1413 +			tr("Saved")+" " + currentMapEditor()->getFilePath(), 
103.1414 +			statusbarTime );
103.1415 +	else		
103.1416 +		statusBar()->message( 
103.1417 +			tr("Couldn't save")+" " + currentMapEditor()->getFilePath(), 
103.1418 +			statusbarTime );
103.1419 +}
103.1420 +
103.1421 +void Main::fileSave()
103.1422 +{
103.1423 +	fileSave (CompleteMap);
103.1424 +}
103.1425 +
103.1426 +void Main::fileSaveAs(const SaveMode& savemode)
103.1427 +{
103.1428 +	QString tmpMapDir;
103.1429 +	QString fn;
103.1430 +
103.1431 +	if (currentMapEditor())
103.1432 +	{
103.1433 +		if (savemode==CompleteMap)
103.1434 +			fn = QFileDialog::getSaveFileName( QString::null, "VYM map (*.vym)", this );
103.1435 +		else		
103.1436 +			fn = QFileDialog::getSaveFileName( QString::null, "VYM part of map (*.vyp)", this );
103.1437 +		if ( !fn.isEmpty() ) 
103.1438 +		{
103.1439 +			// Check for existing file
103.1440 +			if (QFile (fn).exists())
103.1441 +			{
103.1442 +				QMessageBox mb( "VYM",
103.1443 +					tr("The file ") + fn + tr ("\nexists already. Do you want to"),
103.1444 +					QMessageBox::Warning,
103.1445 +					QMessageBox::Yes | QMessageBox::Default,
103.1446 +					QMessageBox::Cancel | QMessageBox::Escape,
103.1447 +					QMessageBox::QMessageBox::NoButton);
103.1448 +				mb.setButtonText( QMessageBox::Yes, tr("Overwrite") );
103.1449 +				mb.setButtonText( QMessageBox::Cancel, tr("Cancel"));
103.1450 +				switch( mb.exec() ) 
103.1451 +				{
103.1452 +					case QMessageBox::Yes:
103.1453 +						// save 
103.1454 +						break;
103.1455 +					case QMessageBox::Cancel:
103.1456 +						// do nothing
103.1457 +						return;
103.1458 +						break;
103.1459 +				}
103.1460 +			} else
103.1461 +			{
103.1462 +				// New file, add extension to filename, if missing
103.1463 +				// This is always .vym or .vyp, depending on savemode
103.1464 +				if (savemode==CompleteMap)
103.1465 +				{
103.1466 +					if (!fn.contains (".vym") && !fn.contains (".xml"))
103.1467 +						fn +=".vym";
103.1468 +				} else		
103.1469 +				{
103.1470 +					if (!fn.contains (".vyp") && !fn.contains (".xml"))
103.1471 +						fn +=".vyp";
103.1472 +				}
103.1473 +			}
103.1474 +	
103.1475 +
103.1476 +
103.1477 +
103.1478 +			// Save now
103.1479 +			currentMapEditor()->setFilePath(fn);
103.1480 +			fileSave(savemode);
103.1481 +
103.1482 +			// Set name of tab
103.1483 +			tabWidget->setTabLabel (currentMapEditor(),
103.1484 +				currentMapEditor()->getFileName() );
103.1485 +			return;
103.1486 +		} 
103.1487 +	}
103.1488 +}
103.1489 +
103.1490 +void Main::fileSaveAs()
103.1491 +{
103.1492 +	fileSaveAs (CompleteMap);
103.1493 +}
103.1494 +
103.1495 +void Main::fileImportDir()
103.1496 +{
103.1497 +	if (currentMapEditor())
103.1498 +		currentMapEditor()->importDir();	
103.1499 +}
103.1500 +
103.1501 +void Main::fileExportXML()
103.1502 +{
103.1503 +	if (currentMapEditor())
103.1504 +	{
103.1505 +		QString dir=browseDirectory(tr("Export XML to directory"));
103.1506 +		if (dir !="" && reallyWriteDirectory(dir) )
103.1507 +			currentMapEditor()->exportXML(dir);
103.1508 +	}	
103.1509 +}
103.1510 +
103.1511 +void Main::fileExportHTML()
103.1512 +{
103.1513 +	if (currentMapEditor())
103.1514 +	{
103.1515 +		ExportHTMLDialog dia(this);
103.1516 +		
103.1517 +		if (dia.exec()==QDialog::Accepted)
103.1518 +		{
103.1519 +			QString dir=dia.getDir();
103.1520 +			if (reallyWriteDirectory(dir) )
103.1521 +			{
103.1522 +				currentMapEditor()->exportXML (dia.getDir() );
103.1523 +				dia.doExport(currentMapEditor()->getMapName() );
103.1524 +			}	
103.1525 +		}
103.1526 +	}	
103.1527 +}
103.1528 +
103.1529 +void Main::fileExportXHTML()
103.1530 +{
103.1531 +	QString dir;
103.1532 +	if (currentMapEditor())
103.1533 +	{
103.1534 +		ExportXHTMLDialog dia(this);
103.1535 +		dia.setFilePath (currentMapEditor()->getFilePath() );
103.1536 +		dia.setMapName (currentMapEditor()->getMapName() );
103.1537 +		dia.readSettings();
103.1538 +		
103.1539 +		if (dia.exec()==QDialog::Accepted)
103.1540 +		{
103.1541 +			QString dir=dia.getDir();
103.1542 +			// Check, if warnings should be used before overwriting
103.1543 +			// the output directory
103.1544 +			bool ok;
103.1545 +			if (dia.warnings()) 
103.1546 +				ok=reallyWriteDirectory(dir);
103.1547 +			else
103.1548 +				ok=true;
103.1549 +
103.1550 +			if (ok)
103.1551 +			{
103.1552 +				currentMapEditor()->exportXML (dia.getDir() );
103.1553 +				dia.doExport(currentMapEditor()->getMapName() );
103.1554 +				if (dia.hasChanged())
103.1555 +					currentMapEditor()->setChanged();
103.1556 +			}	
103.1557 +		}
103.1558 +	}	
103.1559 +}
103.1560 +
103.1561 +void Main::fileExportImage(int item)
103.1562 +{
103.1563 +	if (currentMapEditor())
103.1564 +	{
103.1565 +		QString fn = QFileDialog::getSaveFileName( QString::null, "Image  (*.bmp *.jpg *.pbm *.pgm *.png *.ppm *xbm *.xpm)",
103.1566 +							   this );
103.1567 +		if ( !fn.isEmpty() ) 
103.1568 +		{
103.1569 +			currentMapEditor()->exportImage(fn,item);
103.1570 +		} else {
103.1571 +			statusBar()->message( tr("Couldn't save") + fn, statusbarTime );
103.1572 +		}
103.1573 +	}
103.1574 +}
103.1575 +
103.1576 +void Main::fileExportASCII()
103.1577 +{
103.1578 +	if (currentMapEditor())
103.1579 +		currentMapEditor()->exportASCII();	
103.1580 +}
103.1581 +
103.1582 +void Main::fileCloseMap()
103.1583 +{
103.1584 +	if (currentMapEditor())
103.1585 +	{
103.1586 +		if (currentMapEditor()->hasChanged())
103.1587 +		{
103.1588 +			QMessageBox mb( "VYM",
103.1589 +				tr("The map ") + currentMapEditor()->getFileName() +
103.1590 +				tr(" has been modified but not saved yet. Do you want to"),
103.1591 +				QMessageBox::Warning,
103.1592 +				QMessageBox::Yes | QMessageBox::Default,
103.1593 +				QMessageBox::No,
103.1594 +				QMessageBox::Cancel | QMessageBox::Escape );
103.1595 +			mb.setButtonText( QMessageBox::Yes, tr("Save modified map before closing it") );
103.1596 +			mb.setButtonText( QMessageBox::No, tr("Discard changes"));
103.1597 +			switch( mb.exec() ) 
103.1598 +			{
103.1599 +				case QMessageBox::Yes:
103.1600 +					// save and close
103.1601 +					fileSave(CompleteMap);
103.1602 +					break;
103.1603 +				case QMessageBox::No:
103.1604 +				// close  without saving
103.1605 +					break;
103.1606 +				case QMessageBox::Cancel:
103.1607 +					// do nothing
103.1608 +				return;
103.1609 +			}
103.1610 +		} 
103.1611 +		currentMapEditor()->closeMap();
103.1612 +		tabWidget->removePage(currentMapEditor());
103.1613 +		if (tabWidget->count()==0)
103.1614 +			actionFilePrint->setEnabled (false);
103.1615 +	}	
103.1616 +}
103.1617 +
103.1618 +void Main::filePrint()
103.1619 +{
103.1620 +	if (currentMapEditor())
103.1621 +		currentMapEditor()->print();
103.1622 +}
103.1623 +
103.1624 +void Main::fileExitVYM()
103.1625 +{
103.1626 +	// Check if one or more editors have changed
103.1627 +	MapEditor *me;
103.1628 +	int i;
103.1629 +	for (i=0;i<=tabWidget->count() -1;i++)
103.1630 +	{
103.1631 +		
103.1632 +		me=(MapEditor*)tabWidget->page(i);
103.1633 +
103.1634 +		// If something changed, ask what to do
103.1635 +		if (me->isUnsaved())
103.1636 +		{
103.1637 +			tabWidget->setCurrentPage(i);
103.1638 +			QMessageBox mb( "VYM",
103.1639 +				tr("This map is not saved yet. Do you want to"),
103.1640 +				QMessageBox::Warning,
103.1641 +				QMessageBox::Yes | QMessageBox::Default,
103.1642 +				QMessageBox::No,
103.1643 +				QMessageBox::Cancel | QMessageBox::Escape );
103.1644 +			mb.setButtonText( QMessageBox::Yes, tr("Save map") );
103.1645 +			mb.setButtonText( QMessageBox::No, tr("Discard changes") );
103.1646 +			mb.show();
103.1647 +			// Call undocumented function: setActiveWindow is only
103.1648 +			// possible, if widget is visible. This depends on
103.1649 +			// windowmanager...
103.1650 +#if defined(Q_OS_LINUX)
103.1651 +			qt_wait_for_window_manager( this);
103.1652 +#endif			
103.1653 +			mb.setActiveWindow();
103.1654 +			switch( mb.exec() ) {
103.1655 +				case QMessageBox::Yes:
103.1656 +					// save (the changed editors) and exit
103.1657 +					fileSave(CompleteMap);
103.1658 +					break;
103.1659 +				case QMessageBox::No:
103.1660 +					// exit without saving
103.1661 +					break;
103.1662 +				case QMessageBox::Cancel:
103.1663 +					// don't save and don't exit
103.1664 +				return;
103.1665 +			}
103.1666 +		}
103.1667 +	} // loop over all MEs	
103.1668 +    qApp->quit();
103.1669 +}
103.1670 +
103.1671 +void Main::editUndo()
103.1672 +{
103.1673 +	if (currentMapEditor())
103.1674 +		currentMapEditor()->undo();
103.1675 +}
103.1676 +
103.1677 +void Main::editRedo()	    // TODO
103.1678 +{
103.1679 +}
103.1680 +
103.1681 +void Main::editCopy()
103.1682 +{
103.1683 +	if (currentMapEditor())
103.1684 +		currentMapEditor()->copy();
103.1685 +}
103.1686 +
103.1687 +void Main::editPaste()
103.1688 +{
103.1689 +	if (currentMapEditor())
103.1690 +		currentMapEditor()->paste();
103.1691 +}
103.1692 +
103.1693 +void Main::editCut()
103.1694 +{
103.1695 +	if (currentMapEditor())
103.1696 +		currentMapEditor()->cut();
103.1697 +}
103.1698 +
103.1699 +void Main::editOpenFindWindow()
103.1700 +{
103.1701 +	findWindow->popup();
103.1702 +	findWindow->raise();
103.1703 +
103.1704 +	// Call undocumented function: setActiveWindow is only
103.1705 +	// possible, if widget is visible. This depends on
103.1706 +	// windowmanager...
103.1707 +#if defined(Q_OS_LINUX)
103.1708 +	qt_wait_for_window_manager( this);
103.1709 +#endif	
103.1710 +	findWindow->setActiveWindow();
103.1711 +}
103.1712 +
103.1713 +void Main::editFind(QString s)
103.1714 +{
103.1715 +	bool cs=false;
103.1716 +	BranchObj *bo=currentMapEditor()->findText(s, cs);
103.1717 +	if (bo)
103.1718 +	{	
103.1719 +		statusBar()->message( "Found: " + bo->getHeading(), statusbarTime );
103.1720 +	} else
103.1721 +	{
103.1722 +		QMessageBox::information( findWindow, tr( "VYM -Information:" ),
103.1723 +							   tr("No matches found for ")+
103.1724 +							   "'<b>"+s+"</b>'");
103.1725 +	}	
103.1726 +}
103.1727 +
103.1728 +void Main::editFindChanged()
103.1729 +{	// Notify editor, to abort the current find process
103.1730 +	currentMapEditor()->findReset();
103.1731 +}
103.1732 +
103.1733 +void Main::editOpenURL()
103.1734 +{
103.1735 +	if (currentMapEditor())
103.1736 +	    currentMapEditor()->openURL();
103.1737 +}
103.1738 +
103.1739 +void Main::editURL()
103.1740 +{
103.1741 +	if (currentMapEditor())
103.1742 +	    currentMapEditor()->editURL();
103.1743 +}
103.1744 +
103.1745 +void Main::editHeading2URL()
103.1746 +{
103.1747 +	if (currentMapEditor())
103.1748 +	    currentMapEditor()->editHeading2URL();
103.1749 +}
103.1750 +
103.1751 +void Main::editBugzilla2URL()
103.1752 +{
103.1753 +	if (currentMapEditor())
103.1754 +	    currentMapEditor()->editBugzilla2URL();
103.1755 +}
103.1756 +
103.1757 +void Main::editOpenVymLink()
103.1758 +{
103.1759 +	// Get current path to map
103.1760 +	QString currentVymLink;
103.1761 +	if (currentMapEditor())
103.1762 +	{
103.1763 +		currentVymLink=currentMapEditor()->getVymLink();	
103.1764 +		// compare path with already loaded maps
103.1765 +		int index=-1;
103.1766 +		int i;
103.1767 +		MapEditor *me;
103.1768 +		for (i=0;i<=tabWidget->count() -1;i++)
103.1769 +		{
103.1770 +			me=(MapEditor*)tabWidget->page(i);
103.1771 +			if (currentVymLink==me->getFilePath() )
103.1772 +			{
103.1773 +				index=i;
103.1774 +				break;
103.1775 +			}
103.1776 +		}	
103.1777 +		if (index<0)
103.1778 +		// Load map
103.1779 +		{
103.1780 +			if (!QFile(currentVymLink).exists() )
103.1781 +				QMessageBox::critical( 0, tr( "Critical Error" ),
103.1782 +				   tr("Couldn't open map " +currentVymLink)+".");
103.1783 +			else
103.1784 +			{
103.1785 +				fileLoad (currentVymLink, NewMap);
103.1786 +				tabWidget->setCurrentPage (tabWidget->count()-1);	
103.1787 +			}
103.1788 +		} else
103.1789 +			// Go to tab containing the map
103.1790 +			tabWidget->setCurrentPage (index);	
103.1791 +	}
103.1792 +}
103.1793 +
103.1794 +void Main::editVymLink()
103.1795 +{
103.1796 +	if (currentMapEditor())
103.1797 +		currentMapEditor()->editVymLink();	
103.1798 +}
103.1799 +
103.1800 +void Main::editDeleteVymLink()
103.1801 +{
103.1802 +	if (currentMapEditor())
103.1803 +		currentMapEditor()->deleteVymLink();	
103.1804 +}
103.1805 +
103.1806 +void Main::editMapInfo()
103.1807 +{
103.1808 +	if (currentMapEditor())
103.1809 +		currentMapEditor()->editMapInfo();	
103.1810 +}
103.1811 +
103.1812 +void Main::editMoveUp()
103.1813 +{
103.1814 +	if (currentMapEditor())
103.1815 +	    currentMapEditor()->moveBranchUp();
103.1816 +}
103.1817 +
103.1818 +void Main::editMoveDown()
103.1819 +{
103.1820 +	if (currentMapEditor())
103.1821 +		currentMapEditor()->moveBranchDown();
103.1822 +}
103.1823 +
103.1824 +void Main::editToggleScroll()
103.1825 +{
103.1826 +	if (currentMapEditor())
103.1827 +	{
103.1828 +		currentMapEditor()->toggleScroll();	
103.1829 +	}	
103.1830 +}
103.1831 +
103.1832 +void Main::editUnScrollAll()
103.1833 +{
103.1834 +	if (currentMapEditor())
103.1835 +	{
103.1836 +		currentMapEditor()->unScrollAll();	
103.1837 +	}	
103.1838 +}
103.1839 +
103.1840 +void Main::editHeading()
103.1841 +{
103.1842 +	if (currentMapEditor())
103.1843 +		currentMapEditor()->editHeading();
103.1844 +}
103.1845 +
103.1846 +void Main::editNewBranch()
103.1847 +{
103.1848 +	if (currentMapEditor())
103.1849 +		currentMapEditor()->addNewBranch(0);
103.1850 +}
103.1851 +
103.1852 +void Main::editNewBranchAbove()
103.1853 +{
103.1854 +	if (currentMapEditor())
103.1855 +		currentMapEditor()->addNewBranch(-1);
103.1856 +}
103.1857 +
103.1858 +void Main::editNewBranchBelow()
103.1859 +{
103.1860 +	if (currentMapEditor())
103.1861 +		currentMapEditor()->addNewBranch(1);
103.1862 +}
103.1863 +
103.1864 +void Main::editImportAdd()
103.1865 +{
103.1866 +	fileLoad (ImportAdd);
103.1867 +}
103.1868 +
103.1869 +void Main::editImportReplace()
103.1870 +{
103.1871 +	fileLoad (ImportReplace);
103.1872 +}
103.1873 +
103.1874 +void Main::editSaveBranch()
103.1875 +{
103.1876 +	fileSaveAs (PartOfMap);
103.1877 +}
103.1878 +
103.1879 +void Main::editDeleteSelection()
103.1880 +{
103.1881 +	if (currentMapEditor())
103.1882 +		currentMapEditor()->deleteSelection();
103.1883 +}
103.1884 +
103.1885 +void Main::editUpperBranch()
103.1886 +{
103.1887 +	if (currentMapEditor())
103.1888 +		currentMapEditor()->selectUpperBranch();
103.1889 +}
103.1890 +
103.1891 +void Main::editLowerBranch()
103.1892 +{
103.1893 +	if (currentMapEditor())
103.1894 +		currentMapEditor()->selectLowerBranch();
103.1895 +}
103.1896 +
103.1897 +void Main::editLeftBranch()
103.1898 +{
103.1899 +	if (currentMapEditor())
103.1900 +		currentMapEditor()->selectLeftBranch();
103.1901 +}
103.1902 +
103.1903 +void Main::editRightBranch()
103.1904 +{
103.1905 +	if (currentMapEditor())
103.1906 +		currentMapEditor()->selectRightBranch();
103.1907 +}
103.1908 +
103.1909 +void Main::editFirstBranch()
103.1910 +{
103.1911 +	if (currentMapEditor())
103.1912 +		currentMapEditor()->selectFirstBranch();
103.1913 +}
103.1914 +
103.1915 +void Main::editLastBranch()
103.1916 +{
103.1917 +	if (currentMapEditor())
103.1918 +		currentMapEditor()->selectLastBranch();
103.1919 +}
103.1920 +
103.1921 +void Main::editLoadImage()
103.1922 +{
103.1923 +	if (currentMapEditor())
103.1924 +		currentMapEditor()->loadFloatImage();
103.1925 +}
103.1926 +
103.1927 +void Main::editSaveImage(int item)
103.1928 +{
103.1929 +	if (currentMapEditor())
103.1930 +		currentMapEditor()->saveFloatImage(item);
103.1931 +}
103.1932 +
103.1933 +void Main::editToggleFloatExport()
103.1934 +{
103.1935 +	if (currentMapEditor())
103.1936 +		currentMapEditor()->toggleFloatExport();
103.1937 +}
103.1938 +
103.1939 +void Main::formatSelectColor()
103.1940 +{
103.1941 +	if (currentMapEditor())
103.1942 +	{
103.1943 +		QColor col = QColorDialog::getColor( currentMapEditor()->color(), this );
103.1944 +		if ( !col.isValid() ) return;
103.1945 +		currentMapEditor()->setColor( col );
103.1946 +		colorChanged( col );
103.1947 +	}	
103.1948 +}
103.1949 +
103.1950 +void Main::formatPickColor()
103.1951 +{
103.1952 +	if (currentMapEditor())
103.1953 +		colorChanged( currentMapEditor()->pickColor() );
103.1954 +}
103.1955 +
103.1956 +void Main::colorChanged(QColor c)
103.1957 +{
103.1958 +    QPixmap pix( 16, 16 );
103.1959 +    pix.fill( c );
103.1960 +    actionFormatColor->setIconSet( pix );
103.1961 +}
103.1962 +
103.1963 +void Main::formatColorItem()
103.1964 +{
103.1965 +	if (currentMapEditor())
103.1966 +		currentMapEditor()->colorItem();
103.1967 +}
103.1968 +
103.1969 +void Main::formatColorBranch()
103.1970 +{
103.1971 +	if (currentMapEditor())
103.1972 +		currentMapEditor()->colorBranch();
103.1973 +}
103.1974 +
103.1975 +void Main::formatLinkStyleLine()
103.1976 +{
103.1977 +	if (currentMapEditor())
103.1978 +		currentMapEditor()->setLinkStyle(StyleLine);
103.1979 +}
103.1980 +
103.1981 +void Main::formatLinkStyleParabel()
103.1982 +{
103.1983 +	if (currentMapEditor())
103.1984 +		currentMapEditor()->setLinkStyle(StyleParabel);
103.1985 +}
103.1986 +
103.1987 +void Main::formatLinkStylePolyLine()
103.1988 +{
103.1989 +	if (currentMapEditor())
103.1990 +		currentMapEditor()->setLinkStyle(StylePolyLine);
103.1991 +}
103.1992 +
103.1993 +void Main::formatLinkStylePolyParabel()
103.1994 +{
103.1995 +	if (currentMapEditor())
103.1996 +		currentMapEditor()->setLinkStyle(StylePolyParabel);
103.1997 +}
103.1998 +
103.1999 +void Main::formatSelectBackColor()
103.2000 +{
103.2001 +	if (currentMapEditor())
103.2002 +		currentMapEditor()->selectBackgroundColor();
103.2003 +}
103.2004 +
103.2005 +void Main::formatSelectLinkColor()
103.2006 +{
103.2007 +	if (currentMapEditor())
103.2008 +		currentMapEditor()->selectLinkColor();
103.2009 +}
103.2010 +
103.2011 +void Main::formatToggleLinkColorHint()
103.2012 +{
103.2013 +	currentMapEditor()->toggleLinkColorHint();
103.2014 +}
103.2015 +
103.2016 +void Main::formatFrameNone()
103.2017 +{
103.2018 +	if (currentMapEditor())
103.2019 +		currentMapEditor()->setFrame(NoFrame);
103.2020 +}
103.2021 +
103.2022 +void Main::formatFrameRectangle()
103.2023 +{
103.2024 +	if (currentMapEditor())
103.2025 +		currentMapEditor()->setFrame(Rectangle);
103.2026 +}
103.2027 +
103.2028 +void Main::viewZoomReset()
103.2029 +{
103.2030 +	if (currentMapEditor())
103.2031 +	{
103.2032 +		QWMatrix m;
103.2033 +		m.reset();
103.2034 +		currentMapEditor()->setWorldMatrix( m );
103.2035 +		currentMapEditor()->setViewCenter();
103.2036 +		currentMapEditor()->adjustCanvasSize();
103.2037 +	}	
103.2038 +}
103.2039 +
103.2040 +void Main::viewZoomIn()
103.2041 +{
103.2042 +	if (currentMapEditor())
103.2043 +	{
103.2044 +		QWMatrix m = currentMapEditor()->worldMatrix();
103.2045 +		m.scale( 1.25, 1.25 );
103.2046 +		currentMapEditor()->setWorldMatrix( m );
103.2047 +		currentMapEditor()->setViewCenter();
103.2048 +		currentMapEditor()->adjustCanvasSize();
103.2049 +	}	
103.2050 +}
103.2051 +
103.2052 +void Main::viewZoomOut()
103.2053 +{
103.2054 +	if (currentMapEditor())
103.2055 +	{
103.2056 +		QWMatrix m = currentMapEditor()->worldMatrix();
103.2057 +		m.scale( 0.8, 0.8 );
103.2058 +		currentMapEditor()->setWorldMatrix( m );
103.2059 +		currentMapEditor()->setViewCenter();
103.2060 +		currentMapEditor()->adjustCanvasSize();
103.2061 +	}	
103.2062 +}
103.2063 +bool Main::settingsPDF()
103.2064 +{
103.2065 +	// Default browser is set in constructor
103.2066 +	bool ok;
103.2067 +	QString text = QInputDialog::getText(
103.2068 +		"VYM", tr("Enter path for pdf reader:"), QLineEdit::Normal,
103.2069 +		settings.readEntry("/vym/mainwindow/readerPDF"), &ok, this );
103.2070 +	if (ok)
103.2071 +		settings.writeEntry ("/vym/mainwindow/readerPDF",text);
103.2072 +	return ok;
103.2073 +}
103.2074 +
103.2075 +
103.2076 +bool Main::settingsURL()
103.2077 +{
103.2078 +	// Default browser is set in constructor
103.2079 +	bool ok;
103.2080 +	QString text = QInputDialog::getText(
103.2081 +		"VYM", tr("Enter path for application to open an URL:"), QLineEdit::Normal,
103.2082 +		settings.readEntry("/vym/mainwindow/readerURL")
103.2083 +		, &ok, this );
103.2084 +	if (ok)
103.2085 +		settings.writeEntry ("/vym/mainwindow/readerURL",text);
103.2086 +	return ok;
103.2087 +}
103.2088 +
103.2089 +void Main::windowToggleNoteEditor()
103.2090 +{
103.2091 +	if (textEditor->showWithMain() )
103.2092 +		windowHideNoteEditor();
103.2093 +	else	
103.2094 +		windowShowNoteEditor();
103.2095 +}
103.2096 +
103.2097 +void Main::windowShowNoteEditor()
103.2098 +{
103.2099 +	textEditor->setShowWithMain(true);
103.2100 +	textEditor->show();
103.2101 +	actionViewToggleNoteEditor->setOn (true);
103.2102 +}
103.2103 +
103.2104 +void Main::windowHideNoteEditor()
103.2105 +{
103.2106 +	textEditor->setShowWithMain(false);
103.2107 +	textEditor->hide();
103.2108 +	actionViewToggleNoteEditor->setOn (false);
103.2109 +}
103.2110 +
103.2111 +void Main::windowNextEditor()
103.2112 +{
103.2113 +	if (tabWidget->currentPageIndex() < tabWidget->count())
103.2114 +		tabWidget->setCurrentPage (tabWidget->currentPageIndex() +1);
103.2115 +}
103.2116 +
103.2117 +void Main::windowPreviousEditor()
103.2118 +{
103.2119 +	if (tabWidget->currentPageIndex() >0)
103.2120 +		tabWidget->setCurrentPage (tabWidget->currentPageIndex() -1);
103.2121 +}
103.2122 +
103.2123 +void Main::standardFlagChanged()
103.2124 +{
103.2125 +	currentMapEditor()->toggleStandardFlag(sender()->name());
103.2126 +}
103.2127 +
103.2128 +void Main::testFunction()
103.2129 +{
103.2130 +	//textEditor->stackUnder(this);
103.2131 +	currentMapEditor()->testFunction();
103.2132 +}
103.2133 +
103.2134 +void Main::testShowClipboard()
103.2135 +{
103.2136 +	clipboardME->show();
103.2137 +}
103.2138 +
103.2139 +void Main::helpDoc()
103.2140 +{
103.2141 +	QString docpath;
103.2142 +	// default path in SUSE LINUX
103.2143 +	docpath="/usr/share/doc/packages/vym/doc/vym.pdf";
103.2144 +
103.2145 +	if (!QFile (docpath).exists() )
103.2146 +	{
103.2147 +		// relative path for easy testing in tarball
103.2148 +		docpath="doc/vym.pdf";
103.2149 +		if (!QFile (docpath).exists() )
103.2150 +		{
103.2151 +			// relative path for testing while still writing vym.tex
103.2152 +			docpath="doc/tex/vym.pdf";
103.2153 +			if (!QFile (docpath).exists() )
103.2154 +			{
103.2155 +				QMessageBox::critical(0, 
103.2156 +				tr("Critcal error"),
103.2157 +				tr("Couldn't find the documentation\n"
103.2158 +				"vym.pdf in various places."));
103.2159 +				return;
103.2160 +			}	
103.2161 +		}
103.2162 +	}
103.2163 +	
103.2164 +	Process *pdfProc = new Process();
103.2165 +	pdfProc->clearArguments();
103.2166 +	pdfProc->addArgument( settings.readEntry("/vym/mainwindow/readerPDF"));
103.2167 +	pdfProc->addArgument( docpath);
103.2168 +
103.2169 +	if ( !pdfProc->start() ) 
103.2170 +	{
103.2171 +		// error handling
103.2172 +		QMessageBox::critical(0, 
103.2173 +		tr("Critcal error"),
103.2174 +		tr("Couldn't find a viewer to read vym.pdf.\n"
103.2175 +		"Please use Settings->")+tr("Set application to open pdf files"));
103.2176 +		return;
103.2177 +	}
103.2178 +}
103.2179 +
103.2180 +
103.2181 +void Main::helpAbout()
103.2182 +{
103.2183 +    static QMessageBox* about = new QMessageBox( "VYM",
103.2184 +			"<h3>VYM - View Your Mind </h3>"
103.2185 +			"<p> A tool to put the things you have got in your mind into a map.</p>"
103.2186 +			"<ul>"
103.2187 +				"<li> (c) by Uwe Drechsel (vym@InSilmaril.de)</li>"
103.2188 +				"<li> vym is released under the GPL (Gnu General Public License)"
103.2189 +				", with one exception (see the file \"LICENSE\"which "
103.2190 +				"comes with vym). This exception is needed to build vym with QT libraries for proprietary operating systems.</li>"
103.2191 +				"<li> Project homepage <a href=\"http:/www.InSilmaril.de/vym\">"
103.2192 +    					"http:/www.InSilmaril.de/vym</a></li>"
103.2193 +			"<li> Credits " 
103.2194 +				"<ul>"
103.2195 +					"<li>Thomas Schraitle for the stylesheet  used for XHTML-export </li>"
103.2196 +					"<li>Clemens Kraus for stylesheets and script used for HTML-export "
103.2197 +					"<a href=\"http://www.clemens-kraus.de\">(www.clemens-kraus.de)</a></li>"
103.2198 +					"<li>Alexander Johannesen for providing stylesheets from his xsiteable project " 
103.2199 +					"<a href=\"http://www.shelter.nu/xsiteable/xsiteable.html\">(www.shelter.nu/xsiteable/xsiteable.html)</a>. </li>"
103.2200 +					"<li>Ken Wimer and Olaf Hering for Mac support</li>"
103.2201 +				"</ul>"
103.2202 +			"</li>"
103.2203 +			"<li> Version "  __VYM_VERSION__  "</li>"
103.2204 +				"<li> Build date "  __BUILD_DATE__"</li>"
103.2205 +			"</ul>", QMessageBox::Information, 1, 0, 0, this, 0, FALSE );
103.2206 +    about->setButtonText( 1, "Dismiss" );
103.2207 +    about->setMinimumSize(QSize(300,300));
103.2208 +	about->setIconPixmap (QPixmap(vym_logo_xpm));
103.2209 +    about->show();
103.2210 +}
103.2211 +
103.2212 +void Main::helpAboutQT()
103.2213 +{
103.2214 +	QMessageBox::aboutQt( this, "Qt Application Example" );
103.2215 +}
103.2216 +
   104.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   104.2 +++ b/mainwindow.h	Sun Jan 30 12:59:10 2005 +0000
   104.3 @@ -0,0 +1,168 @@
   104.4 +#ifndef MAINWINDOW_H 
   104.5 +#define MAINWINDOW_H
   104.6 +
   104.7 +#include <qpopupmenu.h>
   104.8 +#include <qmainwindow.h>
   104.9 +#include <qtextedit.h>
  104.10 +#include <qintdict.h>
  104.11 +#include <qcanvas.h>
  104.12 +#include <qlineedit.h>
  104.13 +#include <qaction.h>
  104.14 +#include <qcursor.h>
  104.15 +#include <qtabwidget.h>
  104.16 +#include <qmap.h>
  104.17 +
  104.18 +#include "xml.h"
  104.19 +#include "texteditor.h"
  104.20 +#include "mapeditor.h"
  104.21 +#include "findwindow.h"
  104.22 +
  104.23 +class Main : public QMainWindow 
  104.24 +{
  104.25 +    Q_OBJECT
  104.26 +
  104.27 +public:
  104.28 +    Main(QWidget* parent=0, const char* name=0, WFlags f=0);
  104.29 +    ~Main();
  104.30 +	void loadCmdLine();
  104.31 +	void statusMessage (const QString &);
  104.32 +
  104.33 +public slots:
  104.34 +    void fileNew();
  104.35 +
  104.36 +protected:
  104.37 +	void closeEvent( QCloseEvent* );
  104.38 +
  104.39 +private:
  104.40 +    void setupFileActions();
  104.41 +    void setupEditActions();
  104.42 +    void setupFormatActions();
  104.43 +    void setupViewActions();
  104.44 +    void setupWindowActions();
  104.45 +    void setupFlagActions();
  104.46 +    void setupSettingsActions();
  104.47 +    void setupTestActions();
  104.48 +    void setupHelpActions();
  104.49 +    void setupContextMenus();
  104.50 +	void setupLastMapsMenu();
  104.51 +	void hideEvent (QHideEvent * );
  104.52 +	void showEvent (QShowEvent * );
  104.53 +	bool reallyWriteDirectory(const QString&);
  104.54 +	QString browseDirectory(const QString&);
  104.55 +	MapEditor* currentMapEditor() const;
  104.56 +    
  104.57 +private slots:
  104.58 +    void newView();
  104.59 +	void editorChanged(QWidget*);
  104.60 +
  104.61 +    void fileLoad(QString ,const LoadMode &);
  104.62 +    void fileLoad(const LoadMode &);
  104.63 +    void fileLoad();
  104.64 +	void fileLoadLast(int);
  104.65 +    void fileSave(const SaveMode & );
  104.66 +    void fileSave();
  104.67 +    void fileSaveAs(const SaveMode &);
  104.68 +    void fileSaveAs();
  104.69 +    void fileImportDir();
  104.70 +    void fileExportXML();
  104.71 +    void fileExportHTML();
  104.72 +    void fileExportXHTML();
  104.73 +    void fileExportImage(int);
  104.74 +    void fileExportASCII();
  104.75 +    void fileCloseMap();
  104.76 +    void filePrint();
  104.77 +    void fileExitVYM();
  104.78 +
  104.79 +    void editUndo();	
  104.80 +    void editRedo();	
  104.81 +    void editCopy();	
  104.82 +    void editPaste();	
  104.83 +    void editCut();	
  104.84 +    void editOpenFindWindow();
  104.85 +	void editFind(QString);
  104.86 +	void editFindChanged();
  104.87 +public slots:
  104.88 +	void editOpenURL();
  104.89 +private slots:
  104.90 +	void editURL();
  104.91 +	void editHeading2URL();
  104.92 +	void editBugzilla2URL();
  104.93 +	void editVymLink();
  104.94 +public slots:
  104.95 +	void editOpenVymLink();
  104.96 +private slots:
  104.97 +	void editDeleteVymLink();
  104.98 +	void editMapInfo();
  104.99 +    void editMoveUp();	
 104.100 +    void editMoveDown();	
 104.101 +    void editToggleScroll();
 104.102 +    void editUnScrollAll();
 104.103 +    void editHeading();
 104.104 +    void editNewBranch();
 104.105 +    void editNewBranchAbove();
 104.106 +    void editNewBranchBelow();
 104.107 +    void editImportAdd();
 104.108 +    void editImportReplace();
 104.109 +    void editSaveBranch();
 104.110 +    void editDeleteSelection();
 104.111 +    void editUpperBranch();
 104.112 +    void editLowerBranch();
 104.113 +    void editLeftBranch();
 104.114 +    void editRightBranch();
 104.115 +    void editFirstBranch();
 104.116 +    void editLastBranch();
 104.117 +    void editLoadImage();
 104.118 +    void editSaveImage(int);
 104.119 +    void editToggleFloatExport();
 104.120 +
 104.121 +    void formatSelectColor();
 104.122 +    void formatPickColor();
 104.123 +    void colorChanged(QColor);
 104.124 +    void formatColorItem();
 104.125 +    void formatColorBranch();
 104.126 +	void formatLinkStyleLine();
 104.127 +	void formatLinkStyleParabel();
 104.128 +	void formatLinkStylePolyLine();
 104.129 +	void formatLinkStylePolyParabel();
 104.130 +    void formatSelectBackColor();
 104.131 +    void formatSelectLinkColor();
 104.132 +    void formatToggleLinkColorHint();
 104.133 +	void formatFrameNone();
 104.134 +	void formatFrameRectangle();
 104.135 +
 104.136 +    void viewZoomReset();
 104.137 +    void viewZoomIn();
 104.138 +    void viewZoomOut();
 104.139 +
 104.140 +public slots:
 104.141 +	bool settingsPDF();
 104.142 +	bool settingsURL();
 104.143 +
 104.144 +	void windowToggleNoteEditor();
 104.145 +private slots:
 104.146 +	void windowNextEditor();
 104.147 +	void windowPreviousEditor();
 104.148 +	void windowShowNoteEditor();
 104.149 +	void windowHideNoteEditor();
 104.150 +
 104.151 +	void standardFlagChanged();
 104.152 +
 104.153 +    void testFunction();
 104.154 +    void testShowClipboard();
 104.155 +
 104.156 +    void helpDoc();
 104.157 +    void helpAbout();
 104.158 +    void helpAboutQT();
 104.159 +
 104.160 +private:
 104.161 +    QCanvas* canvas;
 104.162 +	QTabWidget *tabWidget;
 104.163 +	FindWindow *findWindow;
 104.164 +	QStringList lastMaps;
 104.165 +	int maxLastMaps;
 104.166 +	QString lastFileDir;
 104.167 +};
 104.168 +
 104.169 +
 104.170 +#endif
 104.171 +
   105.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   105.2 +++ b/mapcenterobj.cpp	Sun Jan 30 12:59:10 2005 +0000
   105.3 @@ -0,0 +1,235 @@
   105.4 +#include <qdatetime.h>
   105.5 +
   105.6 +#include "mapcenterobj.h"
   105.7 +#include "floatimageobj.h"
   105.8 +#include "mapeditor.h"
   105.9 +
  105.10 +/////////////////////////////////////////////////////////////////
  105.11 +// MapCenterObj
  105.12 +/////////////////////////////////////////////////////////////////
  105.13 +MapCenterObj::MapCenterObj() : BranchObj ()
  105.14 +{
  105.15 +//    cout << "Const MapCenterObj\n";
  105.16 +    init();
  105.17 +}
  105.18 +
  105.19 +MapCenterObj::MapCenterObj(QCanvas* c) : BranchObj (c)
  105.20 +{
  105.21 +//    cout << "Const MapCenterObj   canvas="<<c<<"\n";
  105.22 +    init();
  105.23 +}
  105.24 +
  105.25 +MapCenterObj::~MapCenterObj() 
  105.26 +{
  105.27 +//    cout << "Destr MapCenterObj\n";
  105.28 +}	
  105.29 +
  105.30 +void MapCenterObj::clear() 
  105.31 +{
  105.32 +	BranchObj::clear();
  105.33 +    init();
  105.34 +}
  105.35 +
  105.36 +void MapCenterObj::init () 
  105.37 +{
  105.38 +    orientation=OrientUndef;
  105.39 +    absPos=QPoint (canvas->width()/2, canvas->height()/2);
  105.40 +
  105.41 +	// FIXME this should be done in TextObj later...
  105.42 +	QFont font ("Sans Serif,16,-1,5,50,0,0,0,0,0");		
  105.43 +	heading->setFont(font);
  105.44 +
  105.45 +	branch.setAutoDelete (TRUE);
  105.46 +	floatimage.setAutoDelete (TRUE);
  105.47 +
  105.48 +	move (absPos.x(), absPos.y() );
  105.49 +	depth=0;
  105.50 +
  105.51 +	scrolled=false;
  105.52 +	tmpUnscrolled=false;
  105.53 +
  105.54 +	frame->setFrameType (Rectangle);
  105.55 +}
  105.56 +
  105.57 +void MapCenterObj::move (double x, double y)
  105.58 +{
  105.59 +	BranchObj::move(x,y);
  105.60 +	positionBBox();
  105.61 +}
  105.62 +
  105.63 +void MapCenterObj::moveBy (double x, double y)
  105.64 +{
  105.65 +	BranchObj::moveBy(x,y);
  105.66 +	positionBBox();
  105.67 +}
  105.68 +
  105.69 +void MapCenterObj::moveAll (double x, double y)
  105.70 +{
  105.71 +	// Get rel. position
  105.72 +	double dx=x-absPos.x();
  105.73 +	double dy=y-absPos.y();
  105.74 +
  105.75 +	// Move myself and branches
  105.76 +	moveAllBy (dx,dy);
  105.77 +}
  105.78 +
  105.79 +void MapCenterObj::moveAllBy (double dx, double dy)
  105.80 +{
  105.81 +	// Move myself
  105.82 +	moveBy(dx,dy);
  105.83 +
  105.84 +	positionBBox();
  105.85 +}
  105.86 +
  105.87 +void MapCenterObj::updateLink()
  105.88 +{
  105.89 +	// set childPos to middle of MapCenterObj
  105.90 +	childPos=QPoint(
  105.91 +		absPos.x() + QSize(getSize() ).width()/2, 
  105.92 +		absPos.y() + QSize(getSize() ).height()/2);
  105.93 +	parPos=childPos;		
  105.94 +	BranchObj *b;
  105.95 +	for (b=branch.first(); b; b=branch.next() )
  105.96 +		b->updateLink();
  105.97 +}
  105.98 +
  105.99 +LinkableMapObj* MapCenterObj::findMapObj(QPoint p, LinkableMapObj *excludeLMO)
 105.100 +	{
 105.101 +	BranchObj *bo;
 105.102 +	LinkableMapObj *lmo;
 105.103 +
 105.104 +	// Search through child branches
 105.105 +	for (bo=branch.first(); bo; bo=branch.next() )
 105.106 +	{	
 105.107 +		lmo = bo->findMapObj(p, excludeLMO);
 105.108 +		
 105.109 +		if (lmo!= NULL) 
 105.110 +		{
 105.111 +			return lmo;
 105.112 +		}	
 105.113 +	}
 105.114 +	// is p in MapCenter?
 105.115 +	if (inBBox (p) && (this != excludeLMO) ) return this;
 105.116 +
 105.117 +	// Search float images
 105.118 +	FloatImageObj *foi;
 105.119 +	for (foi=floatimage.first(); foi; foi=floatimage.next() )
 105.120 +		if (foi->inBBox(p) && (foi != excludeLMO) && foi->getParObj()!= excludeLMO) return foi;
 105.121 +
 105.122 +	// nothing found
 105.123 +	return NULL;
 105.124 +}
 105.125 +
 105.126 +QString MapCenterObj::saveToDir (const QString &tmpdir,const QString &prefix, int verbose, const QPoint &offset)
 105.127 +{
 105.128 +    QString s,a;
 105.129 +
 105.130 +	// save area, if not scrolled
 105.131 +	QString areaAttr=
 105.132 +		attribut("x1",QString().setNum(absPos.x()-offset.x(),10)) +
 105.133 +		attribut("y1",QString().setNum(absPos.y()-offset.y(),10)) +
 105.134 +		attribut("x2",QString().setNum(absPos.x()+width()-offset.x(),10)) +
 105.135 +		attribut("y2",QString().setNum(absPos.y()+height()-offset.y(),10));
 105.136 +	
 105.137 +    s=beginElement ("mapcenter" 
 105.138 +		+attribut("absPosX",QString().setNum(absPos.x(),10))
 105.139 +		+attribut("absPosY",QString().setNum(absPos.y(),10))
 105.140 +		+attribut("frameType",frame->getFrameTypeName()) 
 105.141 +		+areaAttr 
 105.142 +		);
 105.143 +		
 105.144 +    incIndent();
 105.145 +    if (heading->getColor()!=QColor("black"))
 105.146 +		a=attribut ("textColor",QColor(heading->getColor()).name() );
 105.147 +    else	
 105.148 +		a="";
 105.149 +    
 105.150 +	// Save flags. If verbose is set (export to xml dir), also write
 105.151 +	// the flags as picture
 105.152 +	s+=standardFlags->saveToDir(tmpdir+"/flags", "/standardFlag-", verbose);
 105.153 +    s=s+valueElement("heading", getHeading(),a);
 105.154 +
 105.155 +	// Reset the counters before saving
 105.156 +	FloatImageObj (canvas).resetSaveCounter();
 105.157 +
 105.158 +	// add link to file in s
 105.159 +	if (!note.isEmpty() )
 105.160 +		s+=note.saveToDir();
 105.161 +	
 105.162 +	// Save FloatImages
 105.163 +	FloatImageObj *fio;
 105.164 +	for (fio=floatimage.first(); fio; fio=floatimage.next() )
 105.165 +		s+=fio->saveToDir (tmpdir,prefix);
 105.166 +
 105.167 +	// Save branches
 105.168 +    BranchObj *bo;
 105.169 +    for (bo=branch.first(); bo; bo=branch.next() )
 105.170 +		s+=bo->saveToDir(tmpdir,prefix, offset);
 105.171 +
 105.172 +    decIndent();
 105.173 +    s+=endElement   ("mapcenter");
 105.174 +    return s;
 105.175 +}
 105.176 +
 105.177 +void MapCenterObj::setVersion (const QString &s)
 105.178 +{
 105.179 +	version=s;
 105.180 +}
 105.181 +
 105.182 +bool MapCenterObj::checkVersion ()
 105.183 +{
 105.184 +	// returns true, if vym is able to read file regarding 
 105.185 +	// the version set with setVersion
 105.186 +	QString s1=version.section (".",0,0);
 105.187 +	QString s2=version.section (".",1,1);
 105.188 +	QString s3=version.section (".",2,2);
 105.189 +	bool ok;
 105.190 +	int vv1 =QString(__VYM_VERSION__).section (".",0,0).toInt(&ok,10);
 105.191 +	int vv2 =QString(__VYM_VERSION__).section (".",1,1).toInt(&ok,10);
 105.192 +	int vv3 =QString(__VYM_VERSION__).section (".",2,2).toInt(&ok,10);
 105.193 +	int mv1=0;
 105.194 +	int mv2=0;
 105.195 +	int mv3=0;
 105.196 +	if (!s1.isEmpty() ) mv1=s1.toInt(&ok,10);
 105.197 +	if (!s2.isEmpty() ) mv2=s2.toInt(&ok,10);
 105.198 +	if (!s3.isEmpty() ) mv3=s3.toInt(&ok,10);
 105.199 +	
 105.200 +	if (vv1 > mv1)
 105.201 +		return true;
 105.202 +	if (vv1 < mv1)
 105.203 +		return false;
 105.204 +	if (vv2 > mv2)
 105.205 +		return true;
 105.206 +	if (vv2 < mv2)
 105.207 +		return false;
 105.208 +	if (vv3 > mv3)
 105.209 +		return true;
 105.210 +	if (vv3 < mv3)
 105.211 +		return false;
 105.212 +	return true;	
 105.213 +}
 105.214 +
 105.215 +void MapCenterObj::setAuthor (const QString &s)
 105.216 +{
 105.217 +	author=s;
 105.218 +}
 105.219 +
 105.220 +QString MapCenterObj::getAuthor()
 105.221 +{
 105.222 +	return author;
 105.223 +}
 105.224 +
 105.225 +void MapCenterObj::setComment (const QString &s)
 105.226 +{
 105.227 +	comment=s;
 105.228 +}
 105.229 +
 105.230 +QString MapCenterObj::getComment ()
 105.231 +{
 105.232 +	return comment;
 105.233 +}
 105.234 +
 105.235 +QString MapCenterObj::getDate ()
 105.236 +{
 105.237 +	return QDate::currentDate().toString ("yyyy-MM-dd");
 105.238 +}
   106.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   106.2 +++ b/mapcenterobj.h	Sun Jan 30 12:59:10 2005 +0000
   106.3 @@ -0,0 +1,35 @@
   106.4 +#ifndef MAPCENTEROBJ_H
   106.5 +#define MAPCENTEROBJ_H
   106.6 +
   106.7 +#include "branchobj.h"
   106.8 +#include "version.h"
   106.9 +
  106.10 +/////////////////////////////////////////////////////////////////////////////
  106.11 +class MapCenterObj:public BranchObj {
  106.12 +public:
  106.13 +    MapCenterObj ();
  106.14 +    MapCenterObj (QCanvas*);
  106.15 +    ~MapCenterObj ();
  106.16 +    void clear();
  106.17 +    void init();
  106.18 +    virtual void move      (double,double);
  106.19 +    virtual void moveBy    (double,double);
  106.20 +    virtual void moveAll   (double,double);
  106.21 +    virtual void moveAllBy (double,double);
  106.22 +    virtual void updateLink();
  106.23 +    LinkableMapObj* findMapObj(QPoint,LinkableMapObj*);	// find MapObj 
  106.24 +	virtual QString saveToDir (const QString&,const QString&,int, const QPoint&);// Save data recursivly to tempdir
  106.25 +	void setVersion(const  QString &);
  106.26 +	bool checkVersion();				// check if program version is higher than saved version
  106.27 +	void setAuthor  (const QString &);
  106.28 +	QString getAuthor ();
  106.29 +	void setComment (const QString &);
  106.30 +	QString getComment ();
  106.31 +	QString getDate();
  106.32 +private:
  106.33 +	QString version;					// version string saved in vym file
  106.34 +	QString author;
  106.35 +	QString comment;
  106.36 +	QDate date;
  106.37 +};
  106.38 +#endif
   107.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   107.2 +++ b/mapeditor.cpp	Sun Jan 30 12:59:10 2005 +0000
   107.3 @@ -0,0 +1,3062 @@
   107.4 +#include "mapeditor.h"
   107.5 +
   107.6 +#include <qstatusbar.h>
   107.7 +#include <qmessagebox.h>
   107.8 +#include <qapplication.h>
   107.9 +#include <qpainter.h>
  107.10 +#include <qpopupmenu.h>
  107.11 +#include <qprinter.h>
  107.12 +#include <qpaintdevicemetrics.h>
  107.13 +#include <qfile.h>
  107.14 +#include <qfiledialog.h>
  107.15 +#include <qdir.h>
  107.16 +#include <qcolor.h>
  107.17 +#include <qcolordialog.h>
  107.18 +#include <qbitmap.h>
  107.19 +#include <qprocess.h>
  107.20 +#include <qinputdialog.h>
  107.21 +
  107.22 +#include <iostream>
  107.23 +#include <stdlib.h>
  107.24 +#include <typeinfo>
  107.25 +
  107.26 +#include "version.h"
  107.27 +
  107.28 +#include "xml.h"
  107.29 +#include "texteditor.h"
  107.30 +#include "linkablemapobj.h"
  107.31 +#include "exports.h"
  107.32 +#include "misc.h"
  107.33 +#include "mainwindow.h"
  107.34 +#include "extrainfodialog.h"
  107.35 +#include "settings.h"
  107.36 +
  107.37 +#include "icons/flag-note.xpm"
  107.38 +#include "icons/flag-url.xpm"
  107.39 +#include "icons/flag-vymlink.xpm"	
  107.40 +#include "icons/flag-scrolled-right.xpm"
  107.41 +#include "icons/flag-tmpUnscrolled-right.xpm"
  107.42 +#include "icons/flag-questionmark.xpm"
  107.43 +#include "icons/flag-exclamationmark.xpm"
  107.44 +#include "icons/flag-hook-green.xpm"
  107.45 +#include "icons/flag-cross-red.xpm"
  107.46 +#include "icons/flag-stopsign.xpm"
  107.47 +#include "icons/flag-smiley-good.xpm"
  107.48 +#include "icons/flag-smiley-sad.xpm"
  107.49 +#include "icons/flag-clock.xpm"
  107.50 +#include "icons/flag-lamp.xpm"
  107.51 +#include "icons/flag-arrow-up.xpm"
  107.52 +#include "icons/flag-arrow-down.xpm"
  107.53 +#include "icons/flag-thumb-up.xpm"
  107.54 +#include "icons/flag-thumb-down.xpm"
  107.55 +#include "icons/flag-heart.xpm"
  107.56 +#include "icons/flag-flash.xpm"
  107.57 +#include "icons/flag-lifebelt.xpm"
  107.58 +
  107.59 +extern TextEditor *textEditor;
  107.60 +extern int statusbarTime;
  107.61 +extern Main *mainWindow;
  107.62 +extern FlagRowObj *systemFlagsDefault;
  107.63 +extern FlagRowObj *standardFlagsDefault;
  107.64 +extern MapEditor *clipboardME;
  107.65 +
  107.66 +extern QAction *actionFileSave;
  107.67 +extern QAction *actionEditUndo;
  107.68 +extern QAction *actionEditCopy;
  107.69 +extern QAction *actionEditCut;
  107.70 +extern QAction *actionEditPaste;
  107.71 +extern QAction *actionEditMoveUp;
  107.72 +extern QAction *actionEditMoveDown;
  107.73 +extern QAction *actionEditToggleScroll;
  107.74 +extern QAction *actionEditOpenURL;
  107.75 +extern QAction *actionEditURL;
  107.76 +extern QAction *actionEditHeading2URL;
  107.77 +extern QAction *actionEditBugzilla2URL;
  107.78 +extern QAction *actionEditOpenVymLink;
  107.79 +extern QAction *actionEditVymLink;
  107.80 +extern QAction *actionEditDeleteVymLink;
  107.81 +extern QAction *actionEditHeading;
  107.82 +extern QAction *actionEditDelete;
  107.83 +extern QAction *actionEditAddBranch;
  107.84 +extern QAction *actionEditAddBranchAbove;
  107.85 +extern QAction *actionEditAddBranchBelow;
  107.86 +extern QAction *actionEditImportAdd;
  107.87 +extern QAction *actionEditImportReplace;
  107.88 +extern QAction *actionEditSaveBranch;
  107.89 +extern QAction *actionEditSelectFirst;
  107.90 +extern QAction *actionEditSelectLast;
  107.91 +extern QAction *actionEditLoadImage;
  107.92 +extern QAction *actionEditToggleFloatExport;
  107.93 +
  107.94 +extern QAction* actionFormatPickColor;
  107.95 +extern QAction* actionFormatColorBranch;
  107.96 +extern QAction* actionFormatColorSubtree;
  107.97 +extern QAction *actionFormatLinkColorHint;
  107.98 +extern QAction *actionFormatBackColor;
  107.99 +extern QAction *actionFormatLinkColor;
 107.100 +
 107.101 +extern QActionGroup *actionGroupFormatFrameTypes;
 107.102 +extern QAction *actionFormatFrameNone;
 107.103 +extern QAction *actionFormatFrameRectangle;
 107.104 +
 107.105 +extern QActionGroup *actionGroupFormatLinkStyles;
 107.106 +extern QAction *actionFormatLinkStyleLine;
 107.107 +extern QAction *actionFormatLinkStyleParabel;
 107.108 +extern QAction *actionFormatLinkStylePolyLine;
 107.109 +extern QAction *actionFormatLinkStylePolyParabel;
 107.110 +
 107.111 +extern QAction *actionViewToggleNoteEditor;
 107.112 +
 107.113 +extern QAction *actionSettingsAutoedit;
 107.114 +extern QAction *actionSettingsAutoselectHeading;
 107.115 +extern QAction *actionSettingsAutoselectText;
 107.116 +extern QAction *actionSettingsPasteNewHeading;
 107.117 +
 107.118 +extern QPopupMenu *branchContextMenu;
 107.119 +extern QPopupMenu *floatimageContextMenu;
 107.120 +extern QPopupMenu *saveImageFormatMenu;
 107.121 +extern QPopupMenu *exportImageFormatMenu;
 107.122 +extern QPopupMenu *canvasContextMenu;
 107.123 +
 107.124 +extern Settings settings;
 107.125 +
 107.126 +
 107.127 +///////////////////////////////////////////////////////////////////////
 107.128 +///////////////////////////////////////////////////////////////////////
 107.129 +MapEditor::MapEditor(
 107.130 +	QWidget* parent, bool interactive, const char* name, WFlags f) :
 107.131 +    QCanvasView(parent,name,f)
 107.132 +{
 107.133 +	//cout << "Constructor ME "<<this<<endl;
 107.134 +
 107.135 +    mapCanvas = new QCanvas(1000,800);
 107.136 +	mapCanvas->setAdvancePeriod(30);
 107.137 +
 107.138 +    setCanvas (mapCanvas);
 107.139 +	
 107.140 +	setVScrollBarMode ( QScrollView::AlwaysOn );
 107.141 +	setHScrollBarMode ( QScrollView::AlwaysOn );
 107.142 +
 107.143 +	// Now create the _global_ system flags _once_:
 107.144 +	// (Later all OrnamentedObj copy from this 
 107.145 +	// and set their own canvas)
 107.146 +	if (!systemFlagsDefault)
 107.147 +	{
 107.148 +		systemFlagsDefault = new FlagRowObj (mapCanvas);
 107.149 +		systemFlagsDefault->setVisibility (false);
 107.150 +		systemFlagsDefault->setName ("systemFlagsDef");
 107.151 +
 107.152 +		FlagObj *fo = new FlagObj (mapCanvas);
 107.153 +		fo->load(QPixmap(flag_note_xpm));
 107.154 +		fo->setName("note");
 107.155 +		fo->setToolTip(tr("Note"));
 107.156 +		systemFlagsDefault->addFlag (fo);	// makes deep copy
 107.157 +
 107.158 +		fo->load(QPixmap(flag_url_xpm));
 107.159 +		fo->setName("url");
 107.160 +		fo->setToolTip(tr("WWW Document (external)"));
 107.161 +		systemFlagsDefault->addFlag (fo);
 107.162 +		
 107.163 +		fo->load(QPixmap(flag_vymlink_xpm));
 107.164 +		fo->setName("vymLink");
 107.165 +		fo->setToolTip(tr("Link to another vym map"));
 107.166 +		systemFlagsDefault->addFlag (fo);	
 107.167 +
 107.168 +		fo->load(QPixmap(flag_scrolled_right_xpm));
 107.169 +		fo->setName("scrolledright");
 107.170 +		fo->setToolTip(tr("subtree is scrolled"));
 107.171 +		systemFlagsDefault->addFlag (fo);
 107.172 +		
 107.173 +		fo->load(QPixmap(flag_tmpUnscrolled_right_xpm));
 107.174 +		fo->setName("tmpUnscrolledright");
 107.175 +		fo->setToolTip(tr("subtree is temporary scrolled"));
 107.176 +		systemFlagsDefault->addFlag (fo);
 107.177 +		delete (fo);
 107.178 +	}
 107.179 +	if (!standardFlagsDefault)
 107.180 +	{
 107.181 +		standardFlagsDefault = new FlagRowObj (mapCanvas);
 107.182 +		standardFlagsDefault->setVisibility (false);
 107.183 +		standardFlagsDefault->setName ("standardFlagsDef");
 107.184 +
 107.185 +		FlagObj *fo = new FlagObj (mapCanvas);
 107.186 +		fo->load(QPixmap(flag_exclamationmark_xpm));
 107.187 +		fo->setName("exclamationmark");
 107.188 +		fo->setToolTip(tr("Take care!"));
 107.189 +		standardFlagsDefault->addFlag (fo);	// makes deep copy
 107.190 +		
 107.191 +		fo->load(QPixmap(flag_questionmark_xpm));
 107.192 +		fo->setName("questionmark");
 107.193 +		fo->setToolTip(tr("Really?"));
 107.194 +		standardFlagsDefault->addFlag (fo);	
 107.195 +
 107.196 +		fo->load(QPixmap(flag_hook_green_xpm));
 107.197 +		fo->setName("hook-green");
 107.198 +		fo->setToolTip(tr("ok!"));
 107.199 +		standardFlagsDefault->addFlag (fo);	
 107.200 +
 107.201 +		fo->load(QPixmap(flag_cross_red_xpm));
 107.202 +		fo->setName("cross-red");
 107.203 +		fo->setToolTip(tr("Not ok!"));
 107.204 +		standardFlagsDefault->addFlag (fo);	
 107.205 +
 107.206 +		fo->load(QPixmap(flag_stopsign_xpm));
 107.207 +		fo->setName("stopsign");
 107.208 +		fo->setToolTip(tr("This won't work!"));
 107.209 +		standardFlagsDefault->addFlag (fo);	
 107.210 +
 107.211 +		fo->load(QPixmap(flag_smiley_good_xpm));
 107.212 +		fo->setName("smiley-good");
 107.213 +		fo->setToolTip(tr("Good"));
 107.214 +		standardFlagsDefault->addFlag (fo);	
 107.215 +
 107.216 +		fo->load(QPixmap(flag_smiley_sad_xpm));
 107.217 +		fo->setName("smiley-sad");
 107.218 +		fo->setToolTip(tr("Bad"));
 107.219 +		standardFlagsDefault->addFlag (fo);	
 107.220 +
 107.221 +		fo->load(QPixmap(flag_clock_xpm));
 107.222 +		fo->setName("clock");
 107.223 +		fo->setToolTip(tr("Time critical"));
 107.224 +		standardFlagsDefault->addFlag (fo);	
 107.225 +
 107.226 +		fo->load(QPixmap(flag_lamp_xpm));
 107.227 +		fo->setName("lamp");
 107.228 +		fo->setToolTip(tr("Idea!"));
 107.229 +		standardFlagsDefault->addFlag (fo);	
 107.230 +
 107.231 +		fo->load(QPixmap(flag_arrow_up_xpm));
 107.232 +		fo->setName("arrow-up");
 107.233 +		fo->setToolTip(tr("Important"));
 107.234 +		standardFlagsDefault->addFlag (fo);	
 107.235 +
 107.236 +		fo->load(QPixmap(flag_arrow_down_xpm));
 107.237 +		fo->setName("arrow-down");
 107.238 +		fo->setToolTip(tr("Unimportant"));
 107.239 +		standardFlagsDefault->addFlag (fo);	
 107.240 +
 107.241 +		fo->load(QPixmap(flag_thumb_up_xpm));
 107.242 +		fo->setName("thumb-up");
 107.243 +		fo->setToolTip(tr("I like this"));
 107.244 +		standardFlagsDefault->addFlag (fo);	
 107.245 +
 107.246 +		fo->load(QPixmap(flag_thumb_down_xpm));
 107.247 +		fo->setName("thumb-down");
 107.248 +		fo->setToolTip(tr("I do not like this"));
 107.249 +		standardFlagsDefault->addFlag (fo);	
 107.250 +		
 107.251 +		fo->load(QPixmap(flag_heart_xpm));
 107.252 +		fo->setName("heart");
 107.253 +		fo->setToolTip(tr("I just love... "));
 107.254 +		standardFlagsDefault->addFlag (fo);	
 107.255 +
 107.256 +		fo->load(QPixmap(flag_flash_xpm));
 107.257 +		fo->setName("flash");
 107.258 +		fo->setToolTip(tr("Dangerous"));
 107.259 +		standardFlagsDefault->addFlag (fo);	
 107.260 +		
 107.261 +		fo->load(QPixmap(flag_lifebelt_xpm));
 107.262 +		fo->setName("lifebelt");
 107.263 +		fo->setToolTip(tr("This will help"));
 107.264 +		standardFlagsDefault->addFlag (fo);	
 107.265 +		delete (fo);
 107.266 +
 107.267 +	}
 107.268 +	
 107.269 +    mapCenter = new MapCenterObj(mapCanvas);
 107.270 +    mapCenter->setVisibility (true);
 107.271 +	mapCenter->setMapEditor (this);
 107.272 +	mapCenter->setHeading (tr("New Map"));
 107.273 +
 107.274 +    printer=NULL;
 107.275 +
 107.276 +    lineedit = new QLineEdit(this, "lineedit"  );
 107.277 +    connect( lineedit, SIGNAL( returnPressed() ), SLOT( finishedLineEditNoSave() ) );
 107.278 +    lineedit->hide();
 107.279 +
 107.280 +    actColor=black; setColor (actColor);
 107.281 +	deflinkcolor=QColor (0,0,255);
 107.282 +	linkcolorhint=DefaultColor;
 107.283 +	linkstyle=StylePolyParabel;
 107.284 +	mapCanvas->setBackgroundColor (white);
 107.285 +
 107.286 +	// Create bitmap cursors, patform dependant
 107.287 +	#if defined(Q_OS_MACX)
 107.288 +		#include "icons/cursorhandopen16.xpm"
 107.289 +		#include "icons/cursorcolorpicker16.xpm"
 107.290 +		QBitmap cb( 16, 16, chandopen, TRUE );
 107.291 +		QBitmap cm( 16, 16, chandopenmask, TRUE );
 107.292 +		handOpenCursor=QCursor ( cb, cm );		
 107.293 +		// set hot spot to tip of picker			
 107.294 +		pickColorCursor=QCursor ( cursorcolorpicker_xpm, 1,15 ); 
 107.295 +	#else
 107.296 +		#include "icons/cursorhandopen.xpm"
 107.297 +		#include "icons/cursorcolorpicker.xpm"
 107.298 +
 107.299 +		QBitmap cb( 32, 32, chandopen, TRUE );
 107.300 +		QBitmap cm( 32, 32, chandopenmask, TRUE );
 107.301 +		handOpenCursor=QCursor ( cb, cm );		
 107.302 +		// set hot spot to tip of picker			
 107.303 +		pickColorCursor=QCursor ( cursorcolorpicker_xpm, 5,27 ); 
 107.304 +	#endif
 107.305 +
 107.306 +
 107.307 +	pickingColor=false;
 107.308 +
 107.309 +    editingBO=NULL;
 107.310 +    selection=NULL;
 107.311 +    selectionLast=NULL;
 107.312 +    movingObj=NULL;
 107.313 +
 107.314 +    mapChanged=false;
 107.315 +	mapDefault=true;
 107.316 +	mapUnsaved=false;
 107.317 +	undoSelection=NULL;
 107.318 +	
 107.319 +	zipped=true;
 107.320 +	filePath="";
 107.321 +	fileName="unnamed";
 107.322 +	mapName="";
 107.323 +
 107.324 +	// Initialize find routine
 107.325 +	itFind=NULL;				
 107.326 +	EOFind=false;
 107.327 +
 107.328 +	printFrame=true;
 107.329 +	printFooter=true;
 107.330 +
 107.331 +	blockreposition=false;
 107.332 +	isInteractive=interactive;
 107.333 +	if (isInteractive)
 107.334 +		// Create temporary files
 107.335 +		makeTmpDirs();
 107.336 +
 107.337 +	// Initially set movingCentre
 107.338 +	updateViewCenter();
 107.339 +
 107.340 +	mapCenter->reposition();	//	for positioning heading
 107.341 +}
 107.342 +
 107.343 +MapEditor::~MapEditor()
 107.344 +{
 107.345 +	//cout <<"Destructor MapEditor\n";
 107.346 +	if (isInteractive) delTmpDirs();
 107.347 +
 107.348 +	// Save Settings
 107.349 +	//settings.writeEntry( "/vym/mapeditor/editmode/autoselect",  );
 107.350 +
 107.351 +}
 107.352 +
 107.353 +QColor MapEditor::color()
 107.354 +{
 107.355 +    return actColor;
 107.356 +}
 107.357 +
 107.358 +QColor MapEditor::backgroundColor()
 107.359 +{
 107.360 +    return mapCanvas->backgroundColor();
 107.361 +}
 107.362 +
 107.363 +MapCenterObj* MapEditor::getMapCenter()
 107.364 +{
 107.365 +    return mapCenter;
 107.366 +}
 107.367 +
 107.368 +QCanvas* MapEditor::getCanvas()
 107.369 +{
 107.370 +    return mapCanvas;
 107.371 +}
 107.372 +
 107.373 +void MapEditor::adjustCanvasSize()
 107.374 +{
 107.375 +	// To adjust the canvas to map, viewport size and position, we have to
 107.376 +	// do some coordinate magic...
 107.377 +	//
 107.378 +	// Get rectangle of (scroll-)view. 
 107.379 +	// We want to be in canvas coords, so
 107.380 +	// we map. Important if view is zoomed...
 107.381 +	QRect view = inverseWorldMatrix().mapRect( QRect( contentsX(), contentsY(),
 107.382 +												visibleWidth(), visibleHeight()) );	
 107.383 +												
 107.384 +	// Now we need the bounding box of view AND map to calc the correct canvas size.
 107.385 +	// Why? Because if the map itself is moved out of view, the view has to be enlarged
 107.386 +	// to avoid jumping aroung...
 107.387 +	QRect map=mapCenter->getTotalBBox();
 107.388 +
 107.389 +	// right edge - left edge
 107.390 +	int cw= max(map.x() + map.width(),  view.x() + view.width())  - min(map.x(), view.x());
 107.391 +	int ch= max(map.y() + map.height(), view.y() + view.height()) - min(map.y(), view.y());
 107.392 +
 107.393 +
 107.394 +	if ( (cw!=mapCanvas->width()) || (ch!=mapCanvas->height()) ||
 107.395 +		!mapCanvas->onCanvas (map.topLeft()) || !mapCanvas->onCanvas (map.bottomRight())
 107.396 +	)	
 107.397 +	{	
 107.398 +		// move the map on canvas (in order to not move it on screen) this is neccessary
 107.399 +		// a) if topleft corner of canvas is left or above topleft corner of view and also left of
 107.400 +		//    above topleft corner of map. E.g. if map is completly inside view, but it would be possible 
 107.401 +		//    to scroll to an empty area of canvas to the left.
 107.402 +		// b) if topleft corner of map left of or above topleft of canvas
 107.403 +		int dx=0;
 107.404 +		int dy=0;
 107.405 +
 107.406 +		if (cw > mapCanvas->width() )
 107.407 +		{
 107.408 +			if (map.x()<0) dx=-map.x();	
 107.409 +		}
 107.410 +		if (cw <  mapCanvas->width() )
 107.411 +			dx=-min (view.x(),map.x());
 107.412 +		if (ch > mapCanvas->height() )
 107.413 +		{
 107.414 +			if (map.y()<0) dy=-map.y();	
 107.415 +		}
 107.416 +		if (ch <  mapCanvas->height() )
 107.417 +		{
 107.418 +			dy=-min (view.y(),map.y());
 107.419 +		}
 107.420 +		// We really have to resize now. Let's go...
 107.421 +		mapCanvas->resize (cw,ch);
 107.422 +		if ( (dx!=0) || (dy!=0) ) 
 107.423 +		{
 107.424 +			mapCenter->moveAllBy(dx,dy);
 107.425 +			mapCenter->reposition();
 107.426 +
 107.427 +			// scroll the view (in order to not move map on screen)
 107.428 +			scrollBy (dx,dy);
 107.429 +		}	
 107.430 +	}
 107.431 +}
 107.432 +
 107.433 +bool MapEditor::blockReposition()
 107.434 +{
 107.435 +	return blockreposition;
 107.436 +}
 107.437 +
 107.438 +void MapEditor::makeTmpDirs()
 107.439 +{
 107.440 +	// Create unique temporary directories
 107.441 +	char tmpdir[]="/tmp/vym-XXXXXX";	
 107.442 +	bakMapDir=mkdtemp(tmpdir);
 107.443 +	makeSubDirs(bakMapDir);
 107.444 +	// FIXME set permissions
 107.445 +	// and maybe use QT method for portability
 107.446 +}
 107.447 +
 107.448 +void MapEditor::delTmpDirs()
 107.449 +{
 107.450 +	//FIXME delete tmp directory, better use QT methods here:
 107.451 +	system ( "rm -rf "+ bakMapDir );
 107.452 +}
 107.453 +
 107.454 +
 107.455 +void MapEditor::makeSubDirs(const QString &s)
 107.456 +{
 107.457 +	QDir d(s);
 107.458 +	d.mkdir ("images");	
 107.459 +	d.mkdir ("flags");	
 107.460 +}
 107.461 +
 107.462 +
 107.463 +QString MapEditor::saveToDir(const QString &tmpdir, const QString &prefix, bool writeflags, const QPoint &offset, SaveMode savemode)
 107.464 +{
 107.465 +	// tmpdir		temporary directory to which data will be writte
 107.466 +	// prefix		mapname, which will be appended to images etc.
 107.467 +	// writeflags	Only write flags for "real" save of map, not undo
 107.468 +	// offset		offset of bbox of whole map in canvas. 
 107.469 +	//				Needed for XML export
 107.470 +	// completeMap	if false, only vympart will be written, without
 107.471 +	//				mapcenter
 107.472 +	
 107.473 +	// Save Header
 107.474 +	QString ls;
 107.475 +	switch (linkstyle)
 107.476 +	{
 107.477 +		case StyleLine: 
 107.478 +			ls="StyleLine";
 107.479 +			break;
 107.480 +		case StyleParabel:
 107.481 +			ls="StyleParabel";
 107.482 +			break;
 107.483 +		case StylePolyLine:	
 107.484 +			ls="StylePolyLine";
 107.485 +			break;
 107.486 +		default:
 107.487 +			ls="StylePolyParabel";
 107.488 +			break;
 107.489 +	}	
 107.490 +
 107.491 +	QString s="<?xml version=\"1.0\" encoding=\"utf-8\"?><!DOCTYPE vymmap>\n";
 107.492 +	QString colhint="";
 107.493 +	if (linkcolorhint==HeadingColor) 
 107.494 +		colhint=attribut("linkColorHint","HeadingColor");
 107.495 +
 107.496 +	QString mapAttr=attribut("version",__VYM_VERSION__);
 107.497 +	if (savemode==CompleteMap)
 107.498 +		mapAttr+= attribut("author",mapCenter->getAuthor()) +
 107.499 +				  attribut("comment",mapCenter->getComment()) +
 107.500 +			      attribut("date",mapCenter->getDate()) +
 107.501 +		          attribut("backgroundColor", mapCanvas->backgroundColor().name() ) +
 107.502 +		          attribut("linkStyle", ls ) +
 107.503 +		          attribut("linkColor", deflinkcolor.name() ) +
 107.504 +		          colhint; 
 107.505 +	s+=beginElement("vymmap",mapAttr);
 107.506 +	incIndent();
 107.507 +
 107.508 +	// Find the used flags while traversing the tree
 107.509 +	standardFlagsDefault->resetUsedCounter();
 107.510 +	
 107.511 +	// Build xml recursivly
 107.512 +	if (savemode==CompleteMap)
 107.513 +		s+=mapCenter->saveToDir(tmpdir,prefix,writeflags,offset);
 107.514 +	else
 107.515 +	{
 107.516 +		if ( undoSelection &&
 107.517 +			typeid(*undoSelection) == typeid(BranchObj) )
 107.518 +			s+=((BranchObj*)(undoSelection))->saveToDir(tmpdir,prefix,offset);
 107.519 +	}
 107.520 +
 107.521 +	// Save local settings
 107.522 +	s+=settings.getXMLData (destPath);
 107.523 +
 107.524 +	// Save selection
 107.525 +	if (selection) 
 107.526 +		s+=valueElement("select",selection->getSelectString());
 107.527 +
 107.528 +	decIndent();
 107.529 +	s+=endElement("vymmap");
 107.530 +
 107.531 +	if (writeflags)
 107.532 +		standardFlagsDefault->saveToDir (tmpdir+"/flags/","",writeflags);
 107.533 +	
 107.534 +	return s;
 107.535 +}
 107.536 +
 107.537 +void MapEditor::saveState()
 107.538 +{
 107.539 +	saveState (CompleteMap,NULL);
 107.540 +}
 107.541 +
 107.542 +void MapEditor::saveState(const SaveMode &mode, LinkableMapObj *part)
 107.543 +{
 107.544 +	// all binary data is saved in bakMapDir (created in Constructor)
 107.545 +	// the xml data itself is kept in memory in backupXML
 107.546 +	// 
 107.547 +	// For faster write/read of data, a part of the map can be
 107.548 +	// written. Then the undoSelection will mark, which part of the
 107.549 +	// map should be replaced if an undo is wanted later.
 107.550 +
 107.551 +	if (mode==PartOfMap && part && (typeid(*part) == typeid (BranchObj) ) ) 
 107.552 +	{
 107.553 +		// Writing a vympart only is useful for BranchObj
 107.554 +		undoSelection=part;
 107.555 +		backupXML=saveToDir (bakMapDir,mapName+"-",false, QPoint (),PartOfMap);
 107.556 +	} else	
 107.557 +	{
 107.558 +		undoSelection=NULL;
 107.559 +		backupXML=saveToDir (bakMapDir,mapName+"-",false, QPoint (),CompleteMap);
 107.560 +	}	
 107.561 +}
 107.562 +
 107.563 +void MapEditor::finishedLineEditNoSave()
 107.564 +{
 107.565 +	// This is called by finishedLineEdit or any MapEditor method,
 107.566 +	// which wants to assure, that lineedits finish, before e.g. a branch is 
 107.567 +	// deleted
 107.568 +    
 107.569 +	// After calling LineEdit and using the clipboard, the 
 107.570 +    // focus is not any longer on the main widget, we
 107.571 +    // have to restore it using parentWidget()->setFocus()
 107.572 +
 107.573 +    if (editingBO!=NULL) 
 107.574 +	{
 107.575 +		editingBO->setHeading(lineedit->text() );
 107.576 +		editingBO=NULL;
 107.577 +		lineedit->releaseKeyboard();
 107.578 +		lineedit->hide();
 107.579 +		parentWidget()->setFocus();
 107.580 +		mapCenter->reposition();
 107.581 +		adjustCanvasSize();
 107.582 +		ensureSelectionVisible();
 107.583 +    }		
 107.584 +}
 107.585 +
 107.586 +
 107.587 +bool MapEditor::isDefault()
 107.588 +{
 107.589 +    return mapDefault;
 107.590 +}
 107.591 +
 107.592 +bool MapEditor::isUnsaved()
 107.593 +{
 107.594 +    return mapUnsaved;
 107.595 +}
 107.596 +
 107.597 +bool MapEditor::hasChanged()
 107.598 +{
 107.599 +    return mapChanged;
 107.600 +}
 107.601 +
 107.602 +void MapEditor::setChanged()
 107.603 +{
 107.604 +	mapChanged=true;
 107.605 +	mapDefault=false;
 107.606 +	mapUnsaved=true;
 107.607 +	actionEditUndo->setEnabled (true);
 107.608 +	actionFileSave->setEnabled (true);
 107.609 +	findReset();
 107.610 +}
 107.611 +
 107.612 +void MapEditor::closeMap()
 107.613 +{
 107.614 +	// Finish open lineEdits
 107.615 +	if (lineedit) finishedLineEditNoSave();
 107.616 +
 107.617 +	// Unselect before disabling the toolbar actions
 107.618 +	if (selection) selection->unselect();
 107.619 +	selection=NULL;
 107.620 +	updateActions();
 107.621 +
 107.622 +    clear();
 107.623 +	close();
 107.624 +}
 107.625 +
 107.626 +void MapEditor::setFilePath(QString fname)
 107.627 +{
 107.628 +	setFilePath (fname,fname);
 107.629 +}
 107.630 +
 107.631 +void MapEditor::setFilePath(QString fname, QString destname)
 107.632 +{
 107.633 +	filePath=fname;
 107.634 +	fileName=fname;
 107.635 +	destPath=destname;
 107.636 +
 107.637 +	// If fname is not an absolute path, complete it
 107.638 +	filePath=QDir(fname).absPath();
 107.639 +	fileDir=filePath.left (1+filePath.findRev ("/"));
 107.640 +
 107.641 +	// Set short name, too. Search from behind:
 107.642 +	int i=fileName.findRev("/");
 107.643 +	if (i>=0) fileName=fileName.remove (0,i+1);
 107.644 +
 107.645 +	// Forget the .vym (or .xml) for name of map
 107.646 +	mapName=fileName.left(fileName.findRev(".",-1,true) );
 107.647 +}
 107.648 +
 107.649 +QString MapEditor::getFilePath()
 107.650 +{
 107.651 +	return filePath;
 107.652 +}
 107.653 +
 107.654 +QString MapEditor::getFileName()
 107.655 +{
 107.656 +	return fileName;
 107.657 +}
 107.658 +
 107.659 +QString MapEditor::getMapName()
 107.660 +{
 107.661 +	return mapName;
 107.662 +}
 107.663 +
 107.664 +QString MapEditor::getDestPath()
 107.665 +{
 107.666 +	return destPath;
 107.667 +}
 107.668 +
 107.669 +int MapEditor::load (QString &fname, const LoadMode &lmode)
 107.670 +{
 107.671 +	// Finish open lineEdits
 107.672 +	if (lineedit) finishedLineEditNoSave();
 107.673 +
 107.674 +	int returnCode=0;
 107.675 +
 107.676 +	if (lmode==NewMap)
 107.677 +	{
 107.678 +		if (selection) selection->unselect();
 107.679 +		selection=NULL;
 107.680 +		mapCenter->clear();
 107.681 +		mapCenter->setMapEditor(this);
 107.682 +		// (map state is set later at end of load...)
 107.683 +	} else
 107.684 +	{
 107.685 +		setChanged();
 107.686 +		saveState(PartOfMap,selection);
 107.687 +	}	
 107.688 +	
 107.689 +    
 107.690 +    mapBuilderHandler handler;
 107.691 +	QFile file( fname );
 107.692 +
 107.693 +	// I am paranoid: file should exist anyway
 107.694 +	// according to check in mainwindow.
 107.695 +	if (!file.exists() )
 107.696 +	{
 107.697 +		QMessageBox::critical( 0, tr( "Critical Parse Error" ),
 107.698 +				   tr("Couldn't open map " +fname)+".");
 107.699 +		returnCode=1;	
 107.700 +	} else
 107.701 +	{
 107.702 +		blockreposition=true;
 107.703 +		QXmlInputSource source( file);
 107.704 +		QXmlSimpleReader reader;
 107.705 +		reader.setContentHandler( &handler );
 107.706 +		reader.setErrorHandler( &handler );
 107.707 +		handler.setMapEditor( this );
 107.708 +		handler.setTmpDir (filePath.left(filePath.findRev("/",-1)));	// needed to load files with rel. path
 107.709 +		handler.setLoadMode (lmode);
 107.710 +		bool ok = reader.parse( source );
 107.711 +		blockreposition=false;
 107.712 +		file.close();
 107.713 +		if ( ok ) 
 107.714 +		{
 107.715 +			mapCenter->reposition();
 107.716 +			adjustCanvasSize();
 107.717 +			if (lmode==NewMap)
 107.718 +			{
 107.719 +				mapDefault=false;
 107.720 +				mapChanged=false;
 107.721 +				mapUnsaved=false;
 107.722 +			}
 107.723 +		} else 
 107.724 +		{
 107.725 +			QMessageBox::critical( 0, tr( "Critical Parse Error" ),
 107.726 +					   tr( handler.errorProtocol() ) );
 107.727 +			// returnCode=1;	
 107.728 +			// Still return "success": the map maybe at least
 107.729 +			// partially read by the parser
 107.730 +		}	
 107.731 +	}	
 107.732 +	updateActions();
 107.733 +	return returnCode;
 107.734 +}
 107.735 +
 107.736 +int MapEditor::save (const SaveMode &savemode)
 107.737 +{
 107.738 +	// Finish open lineEdits
 107.739 +	if (lineedit) finishedLineEditNoSave();
 107.740 +
 107.741 +	int returnCode=0;
 107.742 +
 107.743 +	// Create mapName and fileDir
 107.744 +	makeSubDirs (fileDir);
 107.745 +	QString fname;
 107.746 +	if (saveZipped())
 107.747 +		// save as .xml
 107.748 +		fname=mapName+".xml";
 107.749 +	else
 107.750 +		// use name given by user, even if he chooses .doc
 107.751 +		fname=fileName;
 107.752 +
 107.753 +
 107.754 +	// Check if fname is writeable
 107.755 +	QFile file( fileDir+fname);
 107.756 +	if (!file.open( IO_WriteOnly ) ) 
 107.757 +	{
 107.758 +		QMessageBox::critical( 0, tr( "Critical Save Error" ),
 107.759 +					   tr("Couldn't write to ") +fileDir+fname);
 107.760 +		return 1;
 107.761 +	}	
 107.762 +	file.close();
 107.763 +
 107.764 +	QString saveFile;
 107.765 +	saveFile=saveToDir (fileDir,mapName+"-",true,QPoint(),savemode);
 107.766 +
 107.767 +	file.setName ( fileDir  + fname);
 107.768 +	if ( !file.open( IO_WriteOnly ) )
 107.769 +	{
 107.770 +		// This should neverever happen
 107.771 +		QMessageBox::critical(0, tr("Critcal save error"),"MapEditor::save() Couldn't open "+file.name());
 107.772 +		return 1;
 107.773 +	}	
 107.774 +
 107.775 +	// Write it finally, and write in UTF8, no matter what 
 107.776 +	QTextStream ts( &file );
 107.777 +	ts.setEncoding (QTextStream::UnicodeUTF8);
 107.778 +	ts << saveFile;
 107.779 +	file.close();
 107.780 +
 107.781 +	if (returnCode==0)
 107.782 +	{
 107.783 +		mapChanged=false;
 107.784 +		mapUnsaved=false;
 107.785 +		actionFileSave->setEnabled(false);
 107.786 +	}
 107.787 +
 107.788 +	return returnCode;
 107.789 +}
 107.790 +
 107.791 +void MapEditor::setZipped (bool z)
 107.792 +{
 107.793 +	zipped=z;
 107.794 +}
 107.795 +
 107.796 +bool MapEditor::saveZipped ()
 107.797 +{
 107.798 +	return zipped;
 107.799 +}
 107.800 +
 107.801 +void MapEditor::print()
 107.802 +{
 107.803 +	// Finish open lineEdits
 107.804 +	if (lineedit) finishedLineEditNoSave();
 107.805 +
 107.806 +	if ( !printer ) 
 107.807 +	{
 107.808 +		printer = new QPrinter;
 107.809 +		printer->setColorMode (QPrinter::Color);
 107.810 +	}
 107.811 +
 107.812 +	QRect totalBBox=mapCenter->getTotalBBox();
 107.813 +
 107.814 +	// Try to set orientation automagically
 107.815 +	// Note: Interpretation of generated postscript is amibiguous, if 
 107.816 +	// there are problems with landscape mode, see
 107.817 +	// http://sdb.suse.de/de/sdb/html/jsmeix_print-cups-landscape-81.html
 107.818 +
 107.819 +	if (totalBBox.width()>totalBBox.height())
 107.820 +		// recommend landscape
 107.821 +		printer->setOrientation (QPrinter::Landscape);
 107.822 +	else	
 107.823 +		// recommend portrait
 107.824 +		printer->setOrientation (QPrinter::Portrait);
 107.825 +
 107.826 +	if ( printer->setup(this) ) 
 107.827 +	// returns false, if printing is canceled
 107.828 +	{
 107.829 +		QPainter pp(printer);
 107.830 +
 107.831 +		// Don't print the visualisation of selection
 107.832 +		LinkableMapObj *oldselection=NULL;
 107.833 +		if (selection) 
 107.834 +		{
 107.835 +			oldselection=selection;
 107.836 +			selection->unselect();
 107.837 +		}
 107.838 +
 107.839 +		// Handle sizes of map and paper:
 107.840 +		//
 107.841 +		// setWindow defines which part of the canvas will be transformed 
 107.842 +		// setViewport defines area on paper in device coordinates (dpi)
 107.843 +		// e.g. (0,50,700,700) is upper part on A4
 107.844 +		// see also /usr/lib/qt3/doc/html/coordsys.html
 107.845 +
 107.846 +		QPaintDeviceMetrics metrics (printer);
 107.847 +
 107.848 +		double paperAspect = (double)metrics.width()   / (double)metrics.height();
 107.849 +		double   mapAspect = (double)totalBBox.width() / (double)totalBBox.height();
 107.850 +
 107.851 +		QRect mapRect=mapCenter->getTotalBBox();
 107.852 +		QCanvasRectangle *frame=NULL;
 107.853 +		QCanvasText *footerFN=NULL;
 107.854 +		QCanvasText *footerDate=NULL;
 107.855 +		if (printFrame || printFooter)
 107.856 +		{
 107.857 +			
 107.858 +			if (printFrame) 
 107.859 +			{
 107.860 +				// Print frame around map
 107.861 +				mapRect.setRect (mapRect.x()-10, mapRect.y()-10, 
 107.862 +					mapRect.width()+20, mapRect.height()+20);
 107.863 +				frame=new QCanvasRectangle (mapRect,mapCanvas);
 107.864 +				frame->setBrush (QColor(white));
 107.865 +				frame->setPen (QColor(black));
 107.866 +				frame->setZ(0);
 107.867 +				frame->show();    
 107.868 +			}		
 107.869 +			if (printFooter) 
 107.870 +			{
 107.871 +				// Print footer below map
 107.872 +				QFont font;		
 107.873 +				font.setPointSize(10);
 107.874 +				footerFN=new QCanvasText (mapCanvas);
 107.875 +				footerFN->setText ("VYM - " + fileName);
 107.876 +				footerFN->setFont(font);
 107.877 +				footerFN->move (mapRect.x(), mapRect.y() + mapRect.height() );
 107.878 +				footerFN->setZ(Z_TEXT);
 107.879 +				footerFN->show();    
 107.880 +				footerDate=new QCanvasText (mapCanvas);
 107.881 +				footerDate->setText (QDate::currentDate().toString(Qt::TextDate));
 107.882 +				footerDate->setFont(font);
 107.883 +				footerDate->move (mapRect.x()+mapRect.width()-footerDate->boundingRect().width(), mapRect.y() + mapRect.height() );
 107.884 +				footerDate->setZ(Z_TEXT);
 107.885 +				footerDate->show();    
 107.886 +				mapRect.setRect (mapRect.x(), mapRect.y(), 
 107.887 +					mapRect.width(), mapRect.height()+20);
 107.888 +			}
 107.889 +			pp.setWindow (mapRect.x(), mapRect.y(), mapRect.width(), mapRect.height());
 107.890 +		}	else	
 107.891 +		{
 107.892 +			pp.setWindow (mapRect);
 107.893 +		}	
 107.894 +
 107.895 +		if (mapAspect>=paperAspect)
 107.896 +		{
 107.897 +			// Fit horizontally to paper width
 107.898 +			pp.setViewport(0,0, metrics.width(),(int)(metrics.width()/mapAspect) );	
 107.899 +		}	else
 107.900 +		{
 107.901 +			// Fit vertically to paper height
 107.902 +			pp.setViewport(0,0,(int)(metrics.height()*mapAspect),metrics.height());	
 107.903 +		}	
 107.904 +
 107.905 +		mapCanvas->drawArea(mapRect, &pp);	// draw Canvas to printer
 107.906 +
 107.907 +		// Delete Frame and footer
 107.908 +		if (footerFN) 
 107.909 +		{
 107.910 +			delete (footerFN);
 107.911 +			delete (footerDate);
 107.912 +		}	
 107.913 +		if (frame)  delete (frame);
 107.914 +
 107.915 +		// Restore selection
 107.916 +		if (oldselection) 
 107.917 +		{
 107.918 +			selection=oldselection;
 107.919 +			selection->select();
 107.920 +		}	
 107.921 +	}
 107.922 +}
 107.923 +
 107.924 +QPixmap MapEditor::getPixmap()
 107.925 +{
 107.926 +	QRect mapRect=mapCenter->getTotalBBox();
 107.927 +	QPixmap pix (mapRect.size());
 107.928 +	QPainter pp (&pix);
 107.929 +
 107.930 +	// Don't print the visualisation of selection
 107.931 +	LinkableMapObj *oldselection=NULL;
 107.932 +	if (selection) 
 107.933 +	{
 107.934 +		oldselection=selection;
 107.935 +		selection->unselect();
 107.936 +	}
 107.937 +
 107.938 +	pp.setWindow (mapRect);
 107.939 +
 107.940 +	mapCanvas->drawArea(mapRect, &pp);	// draw Canvas to painter
 107.941 +
 107.942 +
 107.943 +	// Restore selection
 107.944 +	if (oldselection) 
 107.945 +	{
 107.946 +		selection=oldselection;
 107.947 +		selection->select();
 107.948 +	}	
 107.949 +	
 107.950 +	return pix;
 107.951 +}
 107.952 +
 107.953 +void MapEditor::exportImage(QString fn)
 107.954 +{
 107.955 +	// Finish open lineEdits
 107.956 +	if (lineedit) finishedLineEditNoSave();
 107.957 +
 107.958 +	QPixmap pix (getPixmap());
 107.959 +	pix.save(fn, "PNG");
 107.960 +}
 107.961 +
 107.962 +void MapEditor::exportImage(QString fn, int item)
 107.963 +{
 107.964 +	// Finish open lineEdits
 107.965 +	if (lineedit) finishedLineEditNoSave();
 107.966 +
 107.967 +	QPixmap pix (getPixmap());
 107.968 +	pix.save(fn, exportImageFormatMenu->text(item) );
 107.969 +}
 107.970 +
 107.971 +void MapEditor::exportASCII()
 107.972 +{
 107.973 +	// FIXME still experimental
 107.974 +	QFileDialog *fd=new QFileDialog( this, tr("VYM - Export (ASCII)"));
 107.975 +	fd->addFilter ("TXT (*.txt)");
 107.976 +	fd->setCaption("VYM - Export (ASCII) (still experimental)");
 107.977 +	fd->setMode( QFileDialog::AnyFile );
 107.978 +	fd->show();
 107.979 +
 107.980 +	if ( fd->exec() == QDialog::Accepted )
 107.981 +	{
 107.982 +		if (QFile (fd->selectedFile()).exists() )
 107.983 +		{
 107.984 +			QMessageBox mb( "VYM",
 107.985 +				tr("The file ") + fd->selectedFile() + 
 107.986 +				tr(" exists already. Do you want to overwrite it?"),
 107.987 +			QMessageBox::Warning,
 107.988 +			QMessageBox::Yes | QMessageBox::Default,
 107.989 +			QMessageBox::Cancel | QMessageBox::Escape,
 107.990 +			QMessageBox::NoButton );
 107.991 +
 107.992 +			mb.setButtonText( QMessageBox::Yes, tr("Overwrite") );
 107.993 +			mb.setButtonText( QMessageBox::No, tr("Cancel"));
 107.994 +			Export ex;
 107.995 +			switch( mb.exec() ) 
 107.996 +			{
 107.997 +				case QMessageBox::Yes:
 107.998 +					// save 
 107.999 +					if (!ex.setOutputDir ("out"))
107.1000 +					{
107.1001 +						QMessageBox::critical (0,tr("Critical Export Error "),tr("Couldn't create directory ") + "out");
107.1002 +						return;
107.1003 +					}
107.1004 +					break;;
107.1005 +				case QMessageBox::Cancel:
107.1006 +					// do nothing
107.1007 +					return;
107.1008 +					break;
107.1009 +			}
107.1010 +		}
107.1011 +		Export ex;
107.1012 +		ex.setPath (fd->selectedFile() );
107.1013 +		ex.setMapCenter(mapCenter);
107.1014 +		ex.exportMap();
107.1015 +	}
107.1016 +}
107.1017 +
107.1018 +
107.1019 +void MapEditor::exportXML(const QString &dir)
107.1020 +{
107.1021 +	// Create subdirectories
107.1022 +	makeSubDirs (dir);
107.1023 +
107.1024 +	// write to directory
107.1025 +	QString saveFile=saveToDir (dir,mapName+"-",true,mapCenter->getTotalBBox().topLeft() ,CompleteMap);
107.1026 +	QFile file;
107.1027 +
107.1028 +	file.setName ( dir + "/"+mapName+".xml");
107.1029 +	if ( !file.open( IO_WriteOnly ) )
107.1030 +	{
107.1031 +		// This should neverever happen
107.1032 +		QMessageBox::critical (0,tr("Critical Export Error"),tr("MapEditor::exportXML couldn't open ")+file.name());
107.1033 +		return;
107.1034 +	}	
107.1035 +
107.1036 +	// Write it finally, and write in UTF8, no matter what 
107.1037 +	QTextStream ts( &file );
107.1038 +	ts.setEncoding (QTextStream::UnicodeUTF8);
107.1039 +	ts << saveFile;
107.1040 +	file.close();
107.1041 +
107.1042 +	// Now write image, too
107.1043 +	exportImage (dir+"/images/"+mapName+".png");
107.1044 +}
107.1045 +
107.1046 +void MapEditor::clear()
107.1047 +{
107.1048 +	if (selection)
107.1049 +	{
107.1050 +		selection->unselect();
107.1051 +		selection=NULL;
107.1052 +	}	
107.1053 +
107.1054 +	mapCenter->clear();
107.1055 +}
107.1056 +
107.1057 +void MapEditor::undo()
107.1058 +{
107.1059 +	QDir d;
107.1060 +	d.setPath(bakMapDir);
107.1061 +	if (d.exists() )
107.1062 +	{
107.1063 +		// Finish open lineEdits
107.1064 +		if (lineedit) finishedLineEditNoSave();
107.1065 +
107.1066 +		if (selection) 
107.1067 +		{
107.1068 +			selection->unselect();
107.1069 +			selection=NULL;
107.1070 +		}	
107.1071 +		
107.1072 +		mapBuilderHandler handler;
107.1073 +		QXmlInputSource source;
107.1074 +		source.setData(backupXML);
107.1075 +		QXmlSimpleReader reader;
107.1076 +		reader.setContentHandler( &handler );
107.1077 +		reader.setErrorHandler( &handler );
107.1078 +		handler.setMapEditor( this );
107.1079 +		handler.setTmpDir ( bakMapDir );	// needed to load files with rel. path
107.1080 +		if (undoSelection)
107.1081 +		{
107.1082 +			selection=undoSelection;
107.1083 +			selection->select();
107.1084 +			handler.setLoadMode (ImportReplace);
107.1085 +
107.1086 +		} else	
107.1087 +		{
107.1088 +			mapCenter->clear();
107.1089 +			handler.setLoadMode (NewMap);
107.1090 +		}	
107.1091 +		blockreposition=true;
107.1092 +		bool ok = reader.parse( source );
107.1093 +		blockreposition=false;
107.1094 +		if ( ok ) 
107.1095 +			mapCenter->reposition();
107.1096 +			
107.1097 +		else 
107.1098 +		{	
107.1099 +			// This should never ever happen
107.1100 +			QMessageBox::critical( 0, tr( "Critical Parse Error by reading backupFile" ),
107.1101 +								   tr( handler.errorProtocol() )+" in "+backupXML );
107.1102 +		}
107.1103 +		// Undo not longer available now
107.1104 +		actionEditUndo->setEnabled (false);
107.1105 +		undoSelection=false;
107.1106 +		mapChanged=false;
107.1107 +		return;
107.1108 +	} else	
107.1109 +	{
107.1110 +		QMessageBox::critical( 0, tr( "Critical Error" ),
107.1111 +			"Temporary directory " +bakMapDir + 
107.1112 +			tr (" used for undo is gone. \n"
107.1113 +			"I will create a new one, but at the moment no undo is available.\n"
107.1114 +			"Maybe you want to reload your original data.\n\n"
107.1115 +			"Sorry for any inconveniences.") );
107.1116 +		makeTmpDirs();	
107.1117 +	}							
107.1118 +}
107.1119 +
107.1120 +void MapEditor::copy()
107.1121 +{
107.1122 +	// Finish open lineEdits
107.1123 +	if (lineedit) finishedLineEditNoSave();
107.1124 +
107.1125 +	if (selection) 
107.1126 +	{
107.1127 +		if (typeid(*selection) == typeid(BranchObj) ) 
107.1128 +		{
107.1129 +			BranchObj* to;
107.1130 +			BranchObj* from;
107.1131 +			clipboardME->clear();
107.1132 +			clipboardME->getMapCenter()->addBranch();
107.1133 +			to=clipboardME->getMapCenter()->getLastBranch();
107.1134 +			if (to) 
107.1135 +			{
107.1136 +				from=(BranchObj*)(selection);
107.1137 +				to->copy(from);
107.1138 +
107.1139 +				// keep position relative to parent
107.1140 +				to->move2RelPos ( from->getRelPos());
107.1141 +
107.1142 +				// select data in clipboard
107.1143 +				clipboardME->select ("bo:0");
107.1144 +
107.1145 +				// repositioning makes testing nicer,
107.1146 +				// but is not needed usually:
107.1147 +				if (clipboardME->isVisible())
107.1148 +				{
107.1149 +					clipboardME->getMapCenter()->reposition();  
107.1150 +				}	
107.1151 +				else
107.1152 +					clipboardME->hide();
107.1153 +			}
107.1154 +		}    
107.1155 +		if (typeid(*selection) == typeid(FloatImageObj) ) 
107.1156 +		{
107.1157 +			FloatImageObj* to;
107.1158 +			FloatImageObj* from;
107.1159 +			clipboardME->clear();
107.1160 +			clipboardME->getMapCenter()->addFloatImage();
107.1161 +			to=clipboardME->getMapCenter()->getLastFloatImage();
107.1162 +			if (to) 
107.1163 +			{
107.1164 +				from=(FloatImageObj*)(selection);
107.1165 +				to->copy(from);
107.1166 +
107.1167 +				// select data in clipboard
107.1168 +				clipboardME->select ("fi:0");
107.1169 +
107.1170 +				// repositioning makes testing nicer,
107.1171 +				// but is not needed usually:
107.1172 +				if (clipboardME->isVisible())
107.1173 +				{
107.1174 +					clipboardME->getMapCenter()->reposition();  
107.1175 +				}	
107.1176 +				else
107.1177 +					clipboardME->hide();
107.1178 +			}
107.1179 +		}    
107.1180 +	}	    
107.1181 +}
107.1182 +
107.1183 +LinkableMapObj* MapEditor::pasteNoSave()
107.1184 +{
107.1185 +	return pasteAtNoSave (-1);
107.1186 +}
107.1187 +
107.1188 +LinkableMapObj* MapEditor::pasteAtNoSave(int pos)
107.1189 +{
107.1190 +	// Finish open lineEdits
107.1191 +	if (lineedit) finishedLineEditNoSave();
107.1192 +
107.1193 +	LinkableMapObj *fromLMO=clipboardME->getSelection();
107.1194 +	LinkableMapObj *returnLMO=NULL;
107.1195 +
107.1196 +	if (selection && fromLMO) 
107.1197 +	{
107.1198 +
107.1199 +		if (typeid(*fromLMO) == typeid(BranchObj) ) 
107.1200 +		{
107.1201 +			if (typeid(*selection) == typeid(MapCenterObj)) 
107.1202 +			{
107.1203 +				returnLMO=mapCenter->addBranch( (BranchObj*)(fromLMO) );
107.1204 +				((BranchObj*)(returnLMO))->move2RelPos(normalise(fromLMO->getRelPos() ) );
107.1205 +			}     
107.1206 +			if (typeid(*selection) == typeid(BranchObj)) 
107.1207 +				if (pos<0)
107.1208 +					returnLMO=((BranchObj*)(selection))->addBranch((BranchObj*)(fromLMO) );
107.1209 +				else
107.1210 +				{
107.1211 +					BranchObj *par=(BranchObj*)(selection->getParObj());
107.1212 +					if (par) returnLMO=par->insertBranch((BranchObj*)(fromLMO),pos );
107.1213 +				}	
107.1214 +		}
107.1215 +		
107.1216 +		if (typeid(*fromLMO) == typeid(FloatImageObj) &&
107.1217 +			(typeid(*selection) == typeid (BranchObj) || 
107.1218 +			 typeid(*selection)==typeid(MapCenterObj)) )
107.1219 +			returnLMO=((BranchObj*) (selection))->addFloatImage ((FloatImageObj*)(fromLMO));
107.1220 +		
107.1221 +	}	    
107.1222 +	return returnLMO;
107.1223 +}
107.1224 +
107.1225 +void MapEditor::cutNoSave()
107.1226 +{
107.1227 +	// Finish open lineEdits
107.1228 +	if (lineedit) finishedLineEditNoSave();
107.1229 +
107.1230 +	BranchObj* bo;
107.1231 +	BranchObj* par; 
107.1232 +	if (selection != NULL) {
107.1233 +		if (typeid(*selection) == typeid(BranchObj) ) 
107.1234 +		{
107.1235 +			bo=(BranchObj*)(selection);
107.1236 +			par=(BranchObj*)(bo->getParObj());
107.1237 +			bo->unselect();
107.1238 +			selection=NULL;
107.1239 +			par->removeBranch(bo);
107.1240 +			selection=par;
107.1241 +			selection->select();
107.1242 +		}
107.1243 +		if (typeid(*selection) == typeid(FloatImageObj) ) 
107.1244 +		{
107.1245 +			FloatImageObj* fio=(FloatImageObj*)(selection);
107.1246 +			par=(BranchObj*)(fio->getParObj());
107.1247 +			fio->unselect();
107.1248 +			selection=NULL;
107.1249 +			par->removeFloatImage(fio);
107.1250 +			selection=par;
107.1251 +			selection->select();
107.1252 +		}
107.1253 +	}	    
107.1254 +}
107.1255 +
107.1256 +void MapEditor::paste()
107.1257 +{   
107.1258 +	setChanged();
107.1259 +	saveState(PartOfMap,selection);
107.1260 +	pasteNoSave();
107.1261 +	mapCenter->reposition();
107.1262 +	adjustCanvasSize();
107.1263 +}
107.1264 +
107.1265 +void MapEditor::cut()
107.1266 +{
107.1267 +	setChanged();
107.1268 +	saveState(PartOfMap,selection->getParObj());
107.1269 +	copy();
107.1270 +	cutNoSave();
107.1271 +	mapCenter->reposition();
107.1272 +	adjustCanvasSize();
107.1273 +}
107.1274 +
107.1275 +void MapEditor::moveBranchUp()
107.1276 +{
107.1277 +	// Finish open lineEdits
107.1278 +	if (lineedit) finishedLineEditNoSave();
107.1279 +
107.1280 +	BranchObj* bo;
107.1281 +	BranchObj* par;
107.1282 +	if (typeid(*selection) == typeid(BranchObj)  ) 
107.1283 +	{
107.1284 +		setChanged();
107.1285 +		saveState(PartOfMap,selection->getParObj());
107.1286 +		bo=(BranchObj*)(selection);
107.1287 +		par=(BranchObj*)(bo->getParObj());
107.1288 +		selection->unselect();
107.1289 +		selection=par->moveBranchUp (bo);
107.1290 +		selection->select();
107.1291 +		mapCenter->reposition();
107.1292 +		ensureSelectionVisible();
107.1293 +	}
107.1294 +}
107.1295 +
107.1296 +void MapEditor::moveBranchDown()
107.1297 +{
107.1298 +	// Finish open lineEdits
107.1299 +	if (lineedit) finishedLineEditNoSave();
107.1300 +
107.1301 +	BranchObj* bo;
107.1302 +	BranchObj* par;
107.1303 +	if (typeid(*selection) == typeid(BranchObj)  ) 
107.1304 +	{
107.1305 +		setChanged();
107.1306 +		saveState(PartOfMap,selection->getParObj());
107.1307 +		bo=(BranchObj*)(selection);
107.1308 +		par=(BranchObj*)(bo->getParObj());
107.1309 +		selection->unselect(); 
107.1310 +		selection=par->moveBranchDown(bo);
107.1311 +		selection->select();
107.1312 +		mapCenter->reposition();
107.1313 +		ensureSelectionVisible();
107.1314 +	}	
107.1315 +}
107.1316 +
107.1317 +void MapEditor::editHeading()
107.1318 +{
107.1319 +	// Finish open lineEdits
107.1320 +	if (lineedit) finishedLineEditNoSave();
107.1321 +
107.1322 +	if (selection  &&  
107.1323 +		 (typeid(*selection) == typeid(BranchObj) || 
107.1324 +		  typeid(*selection) == typeid(MapCenterObj) ) ) 
107.1325 +	{
107.1326 +		setChanged();
107.1327 +		saveState(PartOfMap,selection);
107.1328 +
107.1329 +		ensureSelectionVisible();
107.1330 +		BranchObj *bo=(BranchObj*)(selection);
107.1331 +		editingBO=(BranchObj*)(selection);
107.1332 +		QPoint p = worldMatrix().map(QPoint (bo->x(),bo->y()));
107.1333 +		lineedit->setGeometry(p.x()-contentsX(),p.y()-contentsY(),200,25);
107.1334 +		QString s=bo->getHeading();
107.1335 +		lineedit->setText(s);
107.1336 +		lineedit->setCursorPosition(1);
107.1337 +		if (actionSettingsAutoselectText->isOn() && !s.isEmpty() && actionSettingsPasteNewHeading->isOn() )
107.1338 +			lineedit->selectAll();
107.1339 +		lineedit->show();
107.1340 +
107.1341 +		lineedit->grabKeyboard();
107.1342 +		lineedit->setFocus();
107.1343 +	}				
107.1344 +}
107.1345 +
107.1346 +
107.1347 +void MapEditor::addNewBranch(int pos)
107.1348 +{
107.1349 +	// Finish open lineEdits
107.1350 +	if (lineedit) finishedLineEditNoSave();
107.1351 +
107.1352 +	if (selection  &&  
107.1353 +		 (typeid(*selection) == typeid(BranchObj) || 
107.1354 +		  typeid(*selection) == typeid(MapCenterObj) ) ) 
107.1355 +	{
107.1356 +		setChanged();
107.1357 +		saveState(PartOfMap,selection);
107.1358 +
107.1359 +		BranchObj* bo1 = (BranchObj*) (selection);
107.1360 +		bool wasScrolled=false;
107.1361 +		BranchObj *newbo=NULL;
107.1362 +		if (pos==0)
107.1363 +		{
107.1364 +			// save scroll state. If scrolled, automatically select
107.1365 +			// new branch in order to tmp unscroll parent...
107.1366 +			wasScrolled=bo1->isScrolled();
107.1367 +			newbo=bo1->addBranch();
107.1368 +		}	else 
107.1369 +		{
107.1370 +			BranchObj *parbo=(BranchObj*)(selection->getParObj());
107.1371 +			if (parbo)
107.1372 +			{
107.1373 +				if (pos<0)
107.1374 +					// add above selection
107.1375 +					newbo=parbo->insertBranch(bo1->getNum());
107.1376 +				else
107.1377 +					// add below selection
107.1378 +					newbo=parbo->insertBranch(bo1->getNum()+1);
107.1379 +			} else
107.1380 +				// This should not happen...
107.1381 +				return;
107.1382 +			
107.1383 +		}	
107.1384 +
107.1385 +		LinkableMapObj *oldselection=selection;
107.1386 +
107.1387 +		mapCenter->reposition();
107.1388 +		adjustCanvasSize();
107.1389 +		if (actionSettingsAutoedit->isOn() ||
107.1390 +			actionSettingsAutoselectHeading->isOn() )
107.1391 +		{
107.1392 +			selection->unselect();
107.1393 +			selection=newbo;
107.1394 +			selection->select();
107.1395 +			if (actionSettingsPasteNewHeading->isOn() )
107.1396 +			{
107.1397 +				BranchObj *bo2= (BranchObj*)(selection);
107.1398 +				bo2->setHeading("");
107.1399 +			}	
107.1400 +			if (actionSettingsAutoedit->isOn() )
107.1401 +				editHeading();
107.1402 +			if (!actionSettingsAutoselectHeading->isOn()
107.1403 +				&& !wasScrolled)
107.1404 +			{
107.1405 +				selection->unselect();
107.1406 +				selection=oldselection;
107.1407 +				selection->select();
107.1408 +			}
107.1409 +		}	
107.1410 +	}	
107.1411 +}
107.1412 +
107.1413 +void MapEditor::deleteSelection()
107.1414 +{
107.1415 +	// Finish open lineEdits
107.1416 +	if (lineedit) finishedLineEditNoSave();
107.1417 +
107.1418 +	if (selection  && typeid(*selection) ==typeid(BranchObj) ) 
107.1419 +	{
107.1420 +		setChanged();
107.1421 +		saveState(PartOfMap,selection->getParObj());
107.1422 +		BranchObj* bo=dynamic_cast <BranchObj*> (selection);
107.1423 +		BranchObj* par=(BranchObj*)(bo->getParObj());
107.1424 +		bo->unselect();
107.1425 +		selection=NULL;
107.1426 +		par->removeBranch(bo);
107.1427 +		selection=par;
107.1428 +		selection->select();
107.1429 +		ensureSelectionVisible();
107.1430 +		mapCenter->reposition();
107.1431 +		adjustCanvasSize();
107.1432 +	}
107.1433 +	if (selection  && typeid(*selection) ==typeid(FloatImageObj) ) 
107.1434 +	{
107.1435 +		setChanged();
107.1436 +		saveState(PartOfMap,selection->getParObj());
107.1437 +		FloatImageObj* fio=dynamic_cast <FloatImageObj*> (selection);
107.1438 +		BranchObj* par=(BranchObj*)(fio->getParObj());
107.1439 +		fio->unselect();
107.1440 +		selection=NULL;
107.1441 +		par->removeFloatImage(fio);
107.1442 +		selection=par;
107.1443 +		selection->select();
107.1444 +		ensureSelectionVisible();
107.1445 +		mapCenter->reposition();
107.1446 +		adjustCanvasSize();
107.1447 +	}
107.1448 +}
107.1449 +
107.1450 +LinkableMapObj* MapEditor::getSelection()
107.1451 +{
107.1452 +	return selection;
107.1453 +}
107.1454 +
107.1455 +bool MapEditor::select (QString s)
107.1456 +{
107.1457 +	LinkableMapObj *lmo=mapCenter;
107.1458 +	QString part;
107.1459 +	QString typ;
107.1460 +	QString num;
107.1461 +	while (!s.isEmpty() )
107.1462 +	{
107.1463 +		part=s.section(",",0,0);
107.1464 +		typ=part.left (3);
107.1465 +		num=part.right(part.length() - 3);
107.1466 +		
107.1467 +		if (typ=="mc:")
107.1468 +		{
107.1469 +			if (num=="")
107.1470 +				break;
107.1471 +			else
107.1472 +				lmo=mapCenter->getBranchNum (num.toUInt());
107.1473 +		} else
107.1474 +			if (typ=="bo:")
107.1475 +				lmo=((BranchObj*)(lmo))->getBranchNum (num.toUInt());
107.1476 +			else
107.1477 +				if (typ=="fi:")
107.1478 +					lmo=((BranchObj*)(lmo))->getFloatImageNum (num.toUInt());
107.1479 +				
107.1480 +		
107.1481 +		
107.1482 +		if (!lmo) break;
107.1483 +		
107.1484 +		if (s.contains(","))
107.1485 +			s=s.right(s.length() - part.length() -1 );
107.1486 +		else	
107.1487 +			break;
107.1488 +	}
107.1489 +
107.1490 +	// Finally select the found object
107.1491 +	if (lmo)
107.1492 +	{
107.1493 +		if (selection) selection->unselect();
107.1494 +		selection=lmo;
107.1495 +		selection->select();
107.1496 +		adjustCanvasSize();
107.1497 +		ensureSelectionVisible();
107.1498 +		return true;
107.1499 +	} else
107.1500 +		return false;
107.1501 +	
107.1502 +	
107.1503 +}
107.1504 +
107.1505 +void MapEditor::unselect()
107.1506 +{
107.1507 +	if (selection) 
107.1508 +	{
107.1509 +		selectionLast=selection;
107.1510 +		selection->unselect();
107.1511 +		selection=NULL;
107.1512 +	}
107.1513 +}	
107.1514 +
107.1515 +void MapEditor::reselect()
107.1516 +{
107.1517 +	if (selectionLast)
107.1518 +	{
107.1519 +		selection=selectionLast;
107.1520 +		selection->select();
107.1521 +		selectionLast=NULL;
107.1522 +	}
107.1523 +}	
107.1524 +
107.1525 +void MapEditor::selectNextBranch()
107.1526 +{
107.1527 +	// Increase number of branch
107.1528 +	if (selection)
107.1529 +	{
107.1530 +		QString s=selection->getSelectString();
107.1531 +		QString part;
107.1532 +		QString typ;
107.1533 +		QString num;
107.1534 +
107.1535 +		// Where am I? 
107.1536 +		part=s.section(",",-1);
107.1537 +		typ=part.left (3);
107.1538 +		num=part.right(part.length() - 3);
107.1539 +
107.1540 +		s=s.left (s.length() -num.length());
107.1541 +
107.1542 +		// Go to next lmo
107.1543 +		num=QString ("%1").arg(num.toUInt()+1);
107.1544 +
107.1545 +		s=s+num;
107.1546 +		
107.1547 +		// Try to select this one
107.1548 +		if (select (s)) return;
107.1549 +
107.1550 +		// We have no direct successor, 
107.1551 +		// try to increase the parental number in order to
107.1552 +		// find a successor with same depth
107.1553 +
107.1554 +		int d=selection->getDepth();
107.1555 +		int oldDepth=d;
107.1556 +		int i;
107.1557 +		bool found=false;
107.1558 +		bool b;
107.1559 +		while (!found && d>0)
107.1560 +		{
107.1561 +			s=s.section (",",0,d-1);
107.1562 +			// replace substring of current depth in s with "1"
107.1563 +			part=s.section(",",-1);
107.1564 +			typ=part.left (3);
107.1565 +			num=part.right(part.length() - 3);
107.1566 +
107.1567 +			if (d>1)
107.1568 +			{	
107.1569 +				// increase number of parent
107.1570 +				num=QString ("%1").arg(num.toUInt()+1);
107.1571 +				s=s.section (",",0,d-2) + ","+ typ+num;
107.1572 +			} else
107.1573 +			{
107.1574 +				// Special case, look at orientation
107.1575 +				if (selection->getOrientation()==OrientRightOfCenter)
107.1576 +					num=QString ("%1").arg(num.toUInt()+1);
107.1577 +				else	
107.1578 +					num=QString ("%1").arg(num.toUInt()-1);
107.1579 +				s=typ+num;
107.1580 +			}	
107.1581 +
107.1582 +			if (select (s))
107.1583 +				// pad to oldDepth, select the first branch for each depth
107.1584 +				for (i=d;i<oldDepth;i++)
107.1585 +				{
107.1586 +					b=select (s);
107.1587 +					if (b)
107.1588 +					{	
107.1589 +						if ( ((BranchObj*)(selection))->countBranches()>0)
107.1590 +							s+=",bo:0";
107.1591 +						else	
107.1592 +							break;
107.1593 +					} else
107.1594 +						break;
107.1595 +				}	
107.1596 +
107.1597 +			// try to select the freshly built string
107.1598 +			found=select(s);
107.1599 +			d--;
107.1600 +		}
107.1601 +		return;
107.1602 +	}	
107.1603 +}
107.1604 +
107.1605 +void MapEditor::selectPrevBranch()
107.1606 +{
107.1607 +	// Decrease number of branch
107.1608 +	if (selection)
107.1609 +	{
107.1610 +		QString s=selection->getSelectString();
107.1611 +		QString part;
107.1612 +		QString typ;
107.1613 +		QString num;
107.1614 +
107.1615 +		// Where am I? 
107.1616 +		part=s.section(",",-1);
107.1617 +		typ=part.left (3);
107.1618 +		num=part.right(part.length() - 3);
107.1619 +
107.1620 +		s=s.left (s.length() -num.length());
107.1621 +
107.1622 +		// Go to next lmo
107.1623 +		num=QString ("%1").arg(num.toUInt()-1);
107.1624 +
107.1625 +		s=s+num;
107.1626 +		
107.1627 +		// Try to select this one
107.1628 +		if (select (s)) return;
107.1629 +
107.1630 +		// We have no direct precessor, 
107.1631 +		// try to decrease the parental number in order to
107.1632 +		// find a precessor with same depth
107.1633 +
107.1634 +		int d=selection->getDepth();
107.1635 +		int oldDepth=d;
107.1636 +		int i;
107.1637 +		bool found=false;
107.1638 +		bool b;
107.1639 +		while (!found && d>0)
107.1640 +		{
107.1641 +			s=s.section (",",0,d-1);
107.1642 +			// replace substring of current depth in s with "1"
107.1643 +			part=s.section(",",-1);
107.1644 +			typ=part.left (3);
107.1645 +			num=part.right(part.length() - 3);
107.1646 +
107.1647 +			if (d>1)
107.1648 +			{
107.1649 +				// decrease number of parent
107.1650 +				num=QString ("%1").arg(num.toUInt()-1);
107.1651 +				s=s.section (",",0,d-2) + ","+ typ+num;
107.1652 +			} else
107.1653 +			{
107.1654 +				// Special case, look at orientation
107.1655 +				if (selection->getOrientation()==OrientRightOfCenter)
107.1656 +					num=QString ("%1").arg(num.toUInt()-1);
107.1657 +				else	
107.1658 +					num=QString ("%1").arg(num.toUInt()+1);
107.1659 +				s=typ+num;
107.1660 +			}	
107.1661 +
107.1662 +			if (select(s))
107.1663 +				// pad to oldDepth, select the last branch for each depth
107.1664 +				for (i=d;i<oldDepth;i++)
107.1665 +				{
107.1666 +					b=select (s);
107.1667 +					if (b)
107.1668 +						if ( ((BranchObj*)(selection))->countBranches()>0)
107.1669 +							s+=",bo:"+ QString ("%1").arg( ((BranchObj*)(selection))->countBranches()-1 );
107.1670 +						else	
107.1671 +							break;
107.1672 +					else
107.1673 +						break;
107.1674 +				}	
107.1675 +			
107.1676 +			// try to select the freshly built string
107.1677 +			found=select(s);
107.1678 +			d--;
107.1679 +		}
107.1680 +		return;
107.1681 +	}	
107.1682 +}
107.1683 +
107.1684 +void MapEditor::selectUpperBranch()
107.1685 +{
107.1686 +	// Finish open lineEdits
107.1687 +	if (lineedit) finishedLineEditNoSave();
107.1688 +
107.1689 +	if (selection) 
107.1690 +	{
107.1691 +		if (typeid(*selection) == typeid(BranchObj))
107.1692 +		{
107.1693 +			if (selection->getOrientation()==OrientRightOfCenter)
107.1694 +				selectPrevBranch();
107.1695 +			else
107.1696 +				if (selection->getDepth()==1)
107.1697 +					selectNextBranch();
107.1698 +				else
107.1699 +					selectPrevBranch();
107.1700 +		}		
107.1701 +	}
107.1702 +}
107.1703 +
107.1704 +void MapEditor::selectLowerBranch()
107.1705 +{
107.1706 +	// Finish open lineEdits
107.1707 +	if (lineedit) finishedLineEditNoSave();
107.1708 +
107.1709 +	if (selection) 
107.1710 +	{
107.1711 +		if (typeid(*selection) == typeid(BranchObj))
107.1712 +		{
107.1713 +			if (selection->getOrientation()==OrientRightOfCenter)
107.1714 +				selectNextBranch();
107.1715 +			else
107.1716 +				if (selection->getDepth()==1)
107.1717 +					selectPrevBranch();
107.1718 +				else
107.1719 +					selectNextBranch();
107.1720 +		}		
107.1721 +	}
107.1722 +}
107.1723 +
107.1724 +
107.1725 +void MapEditor::selectLeftBranch()
107.1726 +{
107.1727 +	// Finish open lineEdits
107.1728 +	if (lineedit) finishedLineEditNoSave();
107.1729 +
107.1730 +	BranchObj* bo;
107.1731 +	BranchObj* par;
107.1732 +	if (selection) 
107.1733 +	{
107.1734 +		if (typeid(*selection) == typeid(MapCenterObj))
107.1735 +		{
107.1736 +			par=  (BranchObj*) (selection);
107.1737 +			bo=par->getLastSelectedBranch();
107.1738 +			if (bo)
107.1739 +			{
107.1740 +				// Workaround for reselecting on left and right side
107.1741 +				if (bo->getOrientation()==OrientRightOfCenter)
107.1742 +				{
107.1743 +					bo=par->getLastBranch();
107.1744 +				}	
107.1745 +				if (bo)
107.1746 +				{
107.1747 +					par->unselect();
107.1748 +					selection=bo;
107.1749 +					selection->select();
107.1750 +					adjustCanvasSize();
107.1751 +					ensureSelectionVisible();
107.1752 +				}
107.1753 +			}	
107.1754 +		} else
107.1755 +		{
107.1756 +			par=(BranchObj*)(selection->getParObj());
107.1757 +			if (selection->getOrientation()==OrientRightOfCenter)
107.1758 +			{
107.1759 +				if (typeid(*selection) == typeid(BranchObj) ||
107.1760 +					typeid(*selection) == typeid(FloatImageObj))
107.1761 +				{
107.1762 +					selection->unselect();
107.1763 +					selection=par;
107.1764 +					selection->select();
107.1765 +					adjustCanvasSize();
107.1766 +					ensureSelectionVisible();
107.1767 +				}
107.1768 +			} else
107.1769 +			{
107.1770 +				if (typeid(*selection) == typeid(BranchObj) )
107.1771 +				{
107.1772 +					bo=((BranchObj*)(selection))->getLastSelectedBranch();
107.1773 +					if (bo) 
107.1774 +					{
107.1775 +						selection->unselect();
107.1776 +						selection=bo;
107.1777 +						selection->select();
107.1778 +						adjustCanvasSize();
107.1779 +						ensureSelectionVisible();
107.1780 +					}
107.1781 +				}
107.1782 +			}
107.1783 +		}	
107.1784 +	}
107.1785 +}
107.1786 +
107.1787 +void MapEditor::selectRightBranch()
107.1788 +{
107.1789 +	// Finish open lineEdits
107.1790 +	if (lineedit) finishedLineEditNoSave();
107.1791 +
107.1792 +	BranchObj* bo;
107.1793 +	BranchObj* par;
107.1794 +
107.1795 +	if (selection) 
107.1796 +	{
107.1797 +		if (typeid(*selection) == typeid(MapCenterObj))
107.1798 +		{
107.1799 +			par=  (BranchObj*) (selection);
107.1800 +			bo=par->getLastSelectedBranch();
107.1801 +			if (bo)
107.1802 +			{
107.1803 +				// Workaround for relecting on left and right side
107.1804 +				if (bo->getOrientation()==OrientLeftOfCenter)
107.1805 +					bo=par->getFirstBranch();
107.1806 +				if (bo)
107.1807 +				{
107.1808 +					par->unselect();
107.1809 +					selection=bo;
107.1810 +					selection->select();
107.1811 +					ensureSelectionVisible();
107.1812 +				}
107.1813 +			}
107.1814 +		} else
107.1815 +		{
107.1816 +			par=(BranchObj*)(selection->getParObj());
107.1817 +			if (selection->getOrientation()==OrientLeftOfCenter)
107.1818 +			{
107.1819 +				if (typeid(*selection) == typeid(BranchObj) ||
107.1820 +					typeid(*selection) == typeid(FloatImageObj))
107.1821 +				{
107.1822 +					selection->unselect();
107.1823 +					selection=par;
107.1824 +					selection->select();
107.1825 +					adjustCanvasSize();
107.1826 +					ensureSelectionVisible();
107.1827 +				}
107.1828 +			} else
107.1829 +			{
107.1830 +				if (typeid(*selection) == typeid(BranchObj) )
107.1831 +				{
107.1832 +					bo=((BranchObj*)(selection))->getLastSelectedBranch();
107.1833 +					if (bo) 
107.1834 +					{
107.1835 +						selection->unselect();
107.1836 +						selection=bo;
107.1837 +						selection->select();
107.1838 +						adjustCanvasSize();
107.1839 +						ensureSelectionVisible();
107.1840 +					}
107.1841 +				}
107.1842 +			}
107.1843 +		}
107.1844 +	}
107.1845 +}
107.1846 +
107.1847 +void MapEditor::selectFirstBranch()
107.1848 +{
107.1849 +	// Finish open lineEdits
107.1850 +	if (lineedit) finishedLineEditNoSave();
107.1851 +
107.1852 +	BranchObj *bo1;
107.1853 +	BranchObj *bo2;
107.1854 +	BranchObj* par;
107.1855 +	if (selection) {
107.1856 +		if (typeid(*selection) == typeid(BranchObj))
107.1857 +		{
107.1858 +			bo1=  (BranchObj*) (selection);
107.1859 +			par=(BranchObj*)(bo1->getParObj());
107.1860 +			bo2=par->getFirstBranch();
107.1861 +			if (bo2) {
107.1862 +				bo1->unselect();
107.1863 +				selection=bo2;
107.1864 +				selection->select();
107.1865 +				ensureSelectionVisible();
107.1866 +			}
107.1867 +		}		
107.1868 +		adjustCanvasSize();
107.1869 +	}
107.1870 +}
107.1871 +
107.1872 +void MapEditor::selectLastBranch()
107.1873 +{
107.1874 +	// Finish open lineEdits
107.1875 +	if (lineedit) finishedLineEditNoSave();
107.1876 +
107.1877 +	BranchObj *bo1;
107.1878 +	BranchObj *bo2;
107.1879 +	BranchObj* par;
107.1880 +	if (selection) {
107.1881 +		if (typeid(*selection) == typeid(BranchObj))
107.1882 +		{
107.1883 +			bo1=  (BranchObj*) (selection);
107.1884 +			par=(BranchObj*)(bo1->getParObj());
107.1885 +			bo2=par->getLastBranch();
107.1886 +			if (bo2) {
107.1887 +				bo1->unselect();
107.1888 +				selection=bo2;
107.1889 +				selection->select();
107.1890 +				ensureSelectionVisible();
107.1891 +			}
107.1892 +		}		
107.1893 +		adjustCanvasSize();
107.1894 +	}
107.1895 +}
107.1896 +
107.1897 +void MapEditor::setColor(QColor c)
107.1898 +{
107.1899 +	actColor=c;
107.1900 +}
107.1901 +
107.1902 +void MapEditor::selectBackgroundColor()
107.1903 +{
107.1904 +	// Finish open lineEdits
107.1905 +	if (lineedit) finishedLineEditNoSave();
107.1906 +
107.1907 +	QColor col = QColorDialog::getColor( mapCanvas->backgroundColor(), this );
107.1908 +	if ( !col.isValid() ) return;
107.1909 +	setBackgroundColor( col );
107.1910 +	setChanged();
107.1911 +}
107.1912 +
107.1913 +void MapEditor::setBackgroundColor(QColor c)
107.1914 +{
107.1915 +	mapCanvas->setBackgroundColor (c);
107.1916 +}
107.1917 +
107.1918 +QColor MapEditor::pickColor()
107.1919 +{
107.1920 +	if (selection) 
107.1921 +	{
107.1922 +		if (typeid(*selection) == typeid(BranchObj) ||
107.1923 +			typeid(*selection) == typeid(MapCenterObj))
107.1924 +		{
107.1925 +			BranchObj *bo=(BranchObj*)(selection);
107.1926 +			actColor=bo->getColor(); 
107.1927 +		}    
107.1928 +	}
107.1929 +	return actColor;
107.1930 +}
107.1931 +
107.1932 +void MapEditor::colorItem()
107.1933 +{
107.1934 +	if (selection) 
107.1935 +	{
107.1936 +		if (typeid(*selection) == typeid(BranchObj) ||
107.1937 +			typeid(*selection) == typeid(MapCenterObj))
107.1938 +		{
107.1939 +			setChanged();
107.1940 +			saveState(PartOfMap,selection);
107.1941 +			BranchObj *bo=(BranchObj*)(selection);
107.1942 +			bo->setColor(actColor, false); // color links, color childs
107.1943 +		}    
107.1944 +	}
107.1945 +}
107.1946 +
107.1947 +void MapEditor::colorBranch()
107.1948 +{
107.1949 +	if (selection) 
107.1950 +	{
107.1951 +		if (typeid(*selection) == typeid(BranchObj) ||
107.1952 +			typeid(*selection) == typeid(MapCenterObj))
107.1953 +		{
107.1954 +			setChanged();
107.1955 +			saveState(PartOfMap,selection);
107.1956 +			BranchObj *bo=(BranchObj*)(selection);
107.1957 +			bo->setColor(actColor, true); // color links, color childs
107.1958 +		}    
107.1959 +	}
107.1960 +}
107.1961 +
107.1962 +
107.1963 +void MapEditor::toggleStandardFlag(QString f)
107.1964 +{
107.1965 +	if (selection)
107.1966 +	{
107.1967 +		setChanged();
107.1968 +		saveState(PartOfMap,selection);	
107.1969 +		((BranchObj*)(selection))->toggleStandardFlag (f);
107.1970 +	}	
107.1971 +}
107.1972 +
107.1973 +void MapEditor::setViewCenter()
107.1974 +{
107.1975 +	// transform to CanvasView Coord:
107.1976 +	QPoint p=worldMatrix().map(movingCenter);
107.1977 +	center ( p.x(), p.y());
107.1978 +}
107.1979 +
107.1980 +
107.1981 +BranchObj* MapEditor::findText (QString s, bool cs)
107.1982 +{
107.1983 +	if (!itFind) 
107.1984 +	{	// Nothing found or new find process
107.1985 +		if (EOFind)
107.1986 +			// nothing found, start again
107.1987 +			EOFind=false;
107.1988 +		itFind=mapCenter->first();
107.1989 +	}	
107.1990 +	bool searching=true;
107.1991 +	bool foundNote=false;
107.1992 +	while (searching && !EOFind)
107.1993 +	{
107.1994 +		if (itFind)
107.1995 +		{
107.1996 +			// Searching in Note
107.1997 +			if (itFind->getNote().contains(s,cs))
107.1998 +			{
107.1999 +				if (selection!=itFind) 
107.2000 +				{
107.2001 +					if (selection) ((BranchObj*)(selection))->unselect();
107.2002 +					selection=itFind;
107.2003 +					selection->select();
107.2004 +					adjustCanvasSize();
107.2005 +					ensureSelectionVisible();
107.2006 +				}
107.2007 +				if (textEditor->findText(s,cs)) 
107.2008 +				{
107.2009 +					searching=false;
107.2010 +					foundNote=true;
107.2011 +				}	
107.2012 +			}
107.2013 +			// Searching in Heading
107.2014 +			if (searching && itFind->getHeading().contains (s,cs) ) 
107.2015 +			{
107.2016 +				if (selection) ((BranchObj*)(selection))->unselect();
107.2017 +				selection=itFind;
107.2018 +				selection->select();
107.2019 +				adjustCanvasSize();
107.2020 +				ensureSelectionVisible();
107.2021 +				searching=false;
107.2022 +			}
107.2023 +		}	
107.2024 +		if (!foundNote)
107.2025 +		{
107.2026 +			itFind=itFind->next();
107.2027 +			if (!itFind) EOFind=true;
107.2028 +		}
107.2029 +	}	
107.2030 +	if (!searching)
107.2031 +	{
107.2032 +		adjustCanvasSize();
107.2033 +		return (BranchObj*)(selection);
107.2034 +	}	else
107.2035 +		return NULL;
107.2036 +}
107.2037 +
107.2038 +void MapEditor::findReset()
107.2039 +{	// Necessary if text to find changes during a find process
107.2040 +	itFind=NULL;
107.2041 +	EOFind=false;
107.2042 +}
107.2043 +
107.2044 +void MapEditor::openURL()
107.2045 +{
107.2046 +	if (selection )
107.2047 +	{
107.2048 +		if (typeid(*selection) == typeid(BranchObj) ||
107.2049 +			typeid(*selection) == typeid(MapCenterObj))
107.2050 +		{
107.2051 +			QString url=((BranchObj*)(selection))->getURL();
107.2052 +
107.2053 +			QProcess *proc = new QProcess( this );
107.2054 +
107.2055 +#if !defined(Q_OS_MACX)
107.2056 +			proc->addArgument( settings.readEntry("/vym/mainwindow/readerURL","konqueror" ));
107.2057 +#else			
107.2058 +			proc->addArgument( settings.readEntry("/vym/mainwindow/readerURL",
107.2059 +				"/Applications/Safari.app/Contents/MacOS/Safari" ));
107.2060 +#endif			
107.2061 +
107.2062 +			proc->addArgument( url);
107.2063 +
107.2064 +			if ( !proc->start() ) 
107.2065 +				// error handling
107.2066 +				if (mainWindow->settingsURL() ) 
107.2067 +					openURL();
107.2068 +		}	
107.2069 +	}	
107.2070 +}
107.2071 +
107.2072 +void MapEditor::editURL()
107.2073 +{
107.2074 +	if (selection && (typeid(*selection) == typeid(BranchObj) ||
107.2075 +			typeid(*selection) == typeid(MapCenterObj)) )
107.2076 +	{		
107.2077 +		bool ok;
107.2078 +		QString text = QInputDialog::getText(
107.2079 +				"VYM", tr("Enter URL:"), QLineEdit::Normal,
107.2080 +				((BranchObj*)(selection))->getURL(), &ok, this );
107.2081 +		if ( ok) 
107.2082 +		{
107.2083 +			// user entered something and pressed OK
107.2084 +			((BranchObj*)(selection))->setURL (text);
107.2085 +			updateActions();
107.2086 +			setChanged();
107.2087 +		}	
107.2088 +	}
107.2089 +}
107.2090 +
107.2091 +void MapEditor::editHeading2URL()
107.2092 +{
107.2093 +	if (selection && (typeid(*selection) == typeid(BranchObj) ||
107.2094 +			typeid(*selection) == typeid(MapCenterObj)) )
107.2095 +	{		
107.2096 +		BranchObj *b=(BranchObj*)(selection);
107.2097 +		b->setURL (b->getHeading());
107.2098 +		updateActions();
107.2099 +		setChanged();
107.2100 +	}
107.2101 +}	
107.2102 +
107.2103 +void MapEditor::editBugzilla2URL()
107.2104 +{
107.2105 +	if (selection && (typeid(*selection) == typeid(BranchObj) ||
107.2106 +			typeid(*selection) == typeid(MapCenterObj)) )
107.2107 +	{		
107.2108 +		BranchObj *b=(BranchObj*)(selection);
107.2109 +		b->setURL ("http://bugzilla.suse.de/show_bug.cgi?id="+b->getHeading());
107.2110 +		updateActions();
107.2111 +		setChanged();
107.2112 +	}
107.2113 +}	
107.2114 +
107.2115 +void MapEditor::editVymLink()
107.2116 +{
107.2117 +	if (selection && (typeid(*selection) == typeid(BranchObj) ||
107.2118 +			typeid(*selection) == typeid(MapCenterObj)) )
107.2119 +	{		
107.2120 +		QFileDialog *fd=new QFileDialog( this,tr("VYM - Link to another map"));
107.2121 +		fd->addFilter (QString (tr("vym map") + " (*.vym)"));
107.2122 +		fd->setCaption(tr("VYM - Link to another map"));
107.2123 +		if (! ((BranchObj*)(selection))->getVymLink().isEmpty() )
107.2124 +			fd->setSelection( ((BranchObj*)(selection))->getVymLink() );
107.2125 +		fd->show();
107.2126 +
107.2127 +		QString fn;
107.2128 +		if ( fd->exec() == QDialog::Accepted )
107.2129 +			((BranchObj*)(selection))->setVymLink (fd->selectedFile() );
107.2130 +		updateActions();
107.2131 +		mapCenter->reposition();
107.2132 +		adjustCanvasSize();
107.2133 +		canvas()->update();
107.2134 +		setChanged();
107.2135 +	}
107.2136 +}
107.2137 +
107.2138 +void MapEditor::deleteVymLink()
107.2139 +{
107.2140 +	if (selection && (typeid(*selection) == typeid(BranchObj) ||
107.2141 +			typeid(*selection) == typeid(MapCenterObj)) )
107.2142 +	{		
107.2143 +		((BranchObj*)(selection))->setVymLink ("" );
107.2144 +		updateActions();
107.2145 +		mapCenter->reposition();
107.2146 +		adjustCanvasSize();
107.2147 +		canvas()->update();
107.2148 +		setChanged();
107.2149 +	}
107.2150 +}
107.2151 +
107.2152 +QString MapEditor::getVymLink()
107.2153 +{
107.2154 +	if (selection && (typeid(*selection) == typeid(BranchObj) ||
107.2155 +			typeid(*selection) == typeid(MapCenterObj)) )
107.2156 +	{		
107.2157 +		return ((BranchObj*)(selection))->getVymLink();
107.2158 +	}
107.2159 +	return "";
107.2160 +	
107.2161 +}
107.2162 +
107.2163 +void MapEditor::editMapInfo()
107.2164 +{
107.2165 +	ExtraInfoDialog dia;
107.2166 +	dia.setMapName (getFileName() );
107.2167 +	dia.setAuthor (mapCenter->getAuthor() );
107.2168 +	dia.setComment(mapCenter->getComment() );
107.2169 +
107.2170 +	// Calc some stats
107.2171 +	QString stats;
107.2172 +    int i=0;
107.2173 +    QCanvasItemList l=canvas()->allItems();
107.2174 +    for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) 
107.2175 +        i++;
107.2176 +    stats+=QString ("%1 items on canvas\n").arg (i,6);
107.2177 +
107.2178 +	uint b=0;
107.2179 +	uint f=0;
107.2180 +	uint n=0;
107.2181 +	BranchObj *bo;
107.2182 +	bo=mapCenter->first();
107.2183 +	while (bo) 
107.2184 +	{
107.2185 +		if (!bo->getNote().isEmpty() ) n++;
107.2186 +		f+= bo->countFloatImages();
107.2187 +		b++;
107.2188 +		bo=bo->next();
107.2189 +	}
107.2190 +    stats+=QString ("%1 branches\n").arg (b-1,6);
107.2191 +    stats+=QString ("%1 notes\n").arg (n,6);
107.2192 +    stats+=QString ("%1 images\n").arg (f,6);
107.2193 +	dia.setStats (stats);
107.2194 +
107.2195 +	// Finally show dialog
107.2196 +	if (dia.exec() == QDialog::Accepted)
107.2197 +	{
107.2198 +		mapCenter->setAuthor (dia.getAuthor() );
107.2199 +		mapCenter->setComment (dia.getComment() );
107.2200 +		setChanged();
107.2201 +	}
107.2202 +}
107.2203 +
107.2204 +void MapEditor::updateActions()
107.2205 +{
107.2206 +	if (getLinkColorHint()==HeadingColor) 
107.2207 +		actionFormatLinkColorHint->setOn(true);
107.2208 +	else	
107.2209 +		actionFormatLinkColorHint->setOn(false);
107.2210 +
107.2211 +	switch (linkstyle)
107.2212 +	{
107.2213 +		case StyleLine: 
107.2214 +			actionFormatLinkStyleLine->setOn(true);
107.2215 +			break;
107.2216 +		case StyleParabel:
107.2217 +			actionFormatLinkStyleParabel->setOn(true);
107.2218 +			break;
107.2219 +		case StylePolyLine:	
107.2220 +			actionFormatLinkStylePolyLine->setOn(true);
107.2221 +			break;
107.2222 +		case StylePolyParabel:	
107.2223 +			actionFormatLinkStylePolyParabel->setOn(true);
107.2224 +			break;
107.2225 +		default:
107.2226 +			break;
107.2227 +	}	
107.2228 +
107.2229 +	QPixmap pix( 16, 16 );
107.2230 +    pix.fill( mapCanvas->backgroundColor() );
107.2231 +    actionFormatBackColor->setIconSet( pix );
107.2232 +    pix.fill( deflinkcolor );
107.2233 +    actionFormatLinkColor->setIconSet( pix );
107.2234 +
107.2235 +	actionEditUndo->setEnabled( mapChanged );
107.2236 +	actionFileSave->setEnabled( mapUnsaved );
107.2237 +
107.2238 +	if (selection)
107.2239 +	{
107.2240 +		if ( (typeid(*selection) == typeid(BranchObj)) || 
107.2241 +			(typeid(*selection) == typeid(MapCenterObj))  )
107.2242 +		{
107.2243 +			standardFlagsDefault->setEnabled (true);
107.2244 +
107.2245 +			if ( ((BranchObj*)(selection))->getURL().isEmpty() )
107.2246 +				actionEditOpenURL->setEnabled (false);
107.2247 +			else	
107.2248 +				actionEditOpenURL->setEnabled (true);
107.2249 +			actionEditURL->setEnabled (true);	
107.2250 +			actionEditHeading2URL->setEnabled (true);	
107.2251 +			actionEditBugzilla2URL->setEnabled (true);	
107.2252 +
107.2253 +			if ( ((BranchObj*)(selection))->getVymLink().isEmpty() )
107.2254 +			{
107.2255 +				actionEditOpenVymLink->setEnabled (false);
107.2256 +				actionEditDeleteVymLink->setEnabled (false);
107.2257 +			} else	
107.2258 +			{
107.2259 +				actionEditOpenVymLink->setEnabled (true);
107.2260 +				actionEditDeleteVymLink->setEnabled (true);
107.2261 +			}	
107.2262 +			actionEditVymLink->setEnabled (true);	
107.2263 +
107.2264 +			actionEditCopy->setEnabled (true);	
107.2265 +			actionEditCut->setEnabled (true);	
107.2266 +			actionEditPaste->setEnabled (true);	
107.2267 +			actionEditMoveUp->setEnabled (true);	
107.2268 +			actionEditMoveDown->setEnabled (true);	
107.2269 +			actionEditToggleScroll->setEnabled (true);	
107.2270 +			actionEditHeading->setEnabled (true);
107.2271 +			actionEditDelete->setEnabled (true);
107.2272 +			actionEditAddBranch->setEnabled (true);
107.2273 +			actionEditAddBranchAbove->setEnabled (true);
107.2274 +			actionEditAddBranchBelow->setEnabled (true);
107.2275 +			actionEditImportAdd->setEnabled (true);
107.2276 +			actionEditImportReplace->setEnabled (true);
107.2277 +			actionEditSaveBranch->setEnabled (true);
107.2278 +			actionEditSelectFirst->setEnabled (true);
107.2279 +			actionEditSelectLast->setEnabled (true);
107.2280 +			actionEditToggleFloatExport->setEnabled (false);
107.2281 +			actionFormatPickColor->setEnabled (true);
107.2282 +			actionFormatColorBranch->setEnabled (true);
107.2283 +			actionFormatColorSubtree->setEnabled (true);
107.2284 +			switch (selection->getFrameType())
107.2285 +			{
107.2286 +				case NoFrame: 
107.2287 +					actionFormatFrameNone->setOn(true);
107.2288 +					break;
107.2289 +				case Rectangle:
107.2290 +					actionFormatFrameRectangle->setOn(true);
107.2291 +					break;
107.2292 +				default:
107.2293 +					break;
107.2294 +			}	
107.2295 +		}
107.2296 +		if ( (typeid(*selection) == typeid(FloatImageObj)) )
107.2297 +		{
107.2298 +			standardFlagsDefault->setEnabled (false);
107.2299 +
107.2300 +			actionEditOpenURL->setEnabled (false);
107.2301 +			actionEditURL->setEnabled (false);	
107.2302 +			actionEditHeading2URL->setEnabled (false);	
107.2303 +			actionEditBugzilla2URL->setEnabled (false);	
107.2304 +			actionEditOpenVymLink->setEnabled (false);
107.2305 +			actionEditVymLink->setEnabled (false);	
107.2306 +			actionEditDeleteVymLink->setEnabled (false);	
107.2307 +
107.2308 +			actionEditCopy->setEnabled (true);
107.2309 +			actionEditCut->setEnabled (true);	
107.2310 +			actionEditPaste->setEnabled (false);	//FIXME
107.2311 +			actionEditMoveUp->setEnabled (false);	
107.2312 +			actionEditMoveDown->setEnabled (false);	
107.2313 +			actionEditToggleScroll->setEnabled (false);	
107.2314 +			actionEditHeading->setEnabled (false);
107.2315 +			actionEditDelete->setEnabled (true);
107.2316 +			actionEditAddBranch->setEnabled (false);
107.2317 +			actionEditAddBranchAbove->setEnabled (false);
107.2318 +			actionEditAddBranchBelow->setEnabled (false);
107.2319 +			actionEditImportAdd->setEnabled (false);
107.2320 +			actionEditSaveBranch->setEnabled (false);
107.2321 +			actionEditImportReplace->setEnabled (false);
107.2322 +			actionEditSelectFirst->setEnabled (false);
107.2323 +			actionEditSelectLast->setEnabled (false);
107.2324 +			actionEditToggleFloatExport->setOn
107.2325 +				( ((FloatImageObj*)(selection))->getFloatExport() );
107.2326 +			actionFormatPickColor->setEnabled (false);
107.2327 +			actionFormatColorBranch->setEnabled (false);
107.2328 +			actionFormatColorSubtree->setEnabled (false);
107.2329 +		}
107.2330 +
107.2331 +	} else
107.2332 +	{
107.2333 +		standardFlagsDefault->setEnabled (false);
107.2334 +
107.2335 +		actionEditCopy->setEnabled (false);	
107.2336 +		actionEditCut->setEnabled (false);	
107.2337 +		actionEditPaste->setEnabled (false);	
107.2338 +		actionEditMoveUp->setEnabled (false);	
107.2339 +		actionEditMoveDown->setEnabled (false);	
107.2340 +		actionEditToggleScroll->setEnabled (false);	
107.2341 +		actionEditOpenURL->setEnabled (false);
107.2342 +		actionEditURL->setEnabled (false);	
107.2343 +		actionEditOpenVymLink->setEnabled (false);
107.2344 +		actionEditVymLink->setEnabled (false);	
107.2345 +		actionEditDeleteVymLink->setEnabled (false);	
107.2346 +		actionEditHeading2URL->setEnabled (false);	
107.2347 +		actionEditBugzilla2URL->setEnabled (false);	
107.2348 +		actionEditHeading->setEnabled (false);
107.2349 +		actionEditDelete->setEnabled (false);
107.2350 +		actionEditAddBranch->setEnabled (false);
107.2351 +		actionEditAddBranchAbove->setEnabled (false);
107.2352 +		actionEditAddBranchBelow->setEnabled (false);
107.2353 +		actionEditSaveBranch->setEnabled (false);
107.2354 +		actionEditImportReplace->setEnabled (false);
107.2355 +		actionEditSelectFirst->setEnabled (false);
107.2356 +		actionEditSelectLast->setEnabled (false);
107.2357 +		actionEditToggleFloatExport->setEnabled (false);
107.2358 +		actionFormatPickColor->setEnabled (false);
107.2359 +		actionFormatColorBranch->setEnabled (false);
107.2360 +		actionFormatColorSubtree->setEnabled (false);
107.2361 +	}	
107.2362 +}
107.2363 +
107.2364 +void MapEditor::setLinkStyle (LinkStyle ls)
107.2365 +{
107.2366 +	linkstyle=ls;
107.2367 +
107.2368 +	BranchObj *bo;
107.2369 +	bo=mapCenter->first();
107.2370 +	bo=bo->next();
107.2371 +	while (bo) 
107.2372 +	{
107.2373 +		bo->setLinkStyle(bo->getDefLinkStyle());
107.2374 +		bo=bo->next();
107.2375 +	}
107.2376 +	//setChanged();
107.2377 +	//saveState();
107.2378 +}
107.2379 +
107.2380 +LinkStyle MapEditor::getLinkStyle ()
107.2381 +{
107.2382 +	return linkstyle;
107.2383 +}	
107.2384 +
107.2385 +void MapEditor::setLinkColor(QColor c)
107.2386 +{
107.2387 +	deflinkcolor=c;
107.2388 +	updateActions();
107.2389 +}
107.2390 +
107.2391 +void MapEditor::setLinkColorHint()
107.2392 +{
107.2393 +	// called from setLinkColorHint(lch) or at end of parse
107.2394 +	BranchObj *bo;
107.2395 +	bo=mapCenter->first();
107.2396 +	while (bo) 
107.2397 +	{
107.2398 +		bo->setLinkColor();
107.2399 +		bo=bo->next();
107.2400 +	}
107.2401 +}
107.2402 +
107.2403 +void MapEditor::setLinkColorHint(LinkColorHint lch)
107.2404 +{
107.2405 +	linkcolorhint=lch;
107.2406 +	setLinkColorHint();
107.2407 +}
107.2408 +
107.2409 +void MapEditor::toggleLinkColorHint()
107.2410 +{
107.2411 +	if (linkcolorhint==HeadingColor)
107.2412 +		linkcolorhint=DefaultColor;
107.2413 +	else	
107.2414 +		linkcolorhint=HeadingColor;
107.2415 +	BranchObj *bo;
107.2416 +	bo=mapCenter->first();
107.2417 +	while (bo) 
107.2418 +	{
107.2419 +		bo->setLinkColor();
107.2420 +		bo=bo->next();
107.2421 +	}
107.2422 +}
107.2423 +
107.2424 +LinkColorHint MapEditor::getLinkColorHint()
107.2425 +{
107.2426 +	return linkcolorhint;
107.2427 +}
107.2428 +
107.2429 +QColor MapEditor::getDefLinkColor()
107.2430 +{
107.2431 +	return deflinkcolor;
107.2432 +}
107.2433 +
107.2434 +void MapEditor::selectLinkColor()
107.2435 +{
107.2436 +	// Finish open lineEdits
107.2437 +	if (lineedit) finishedLineEditNoSave();
107.2438 +
107.2439 +	QColor col = QColorDialog::getColor( deflinkcolor, this );
107.2440 +	if ( !col.isValid() ) return;
107.2441 +	setLinkColor( col );
107.2442 +	setChanged();
107.2443 +}
107.2444 +
107.2445 +void MapEditor::toggleScroll()
107.2446 +{
107.2447 +	if (selection && (typeid(*selection) == typeid(BranchObj)) )
107.2448 +	{
107.2449 +		BranchObj *bo=((BranchObj*)(selection));
107.2450 +		if (bo->countBranches()==0) return;
107.2451 +		if (bo->getDepth()==0) return;
107.2452 +		setChanged();
107.2453 +		saveState(PartOfMap,selection);
107.2454 +		bo->toggleScroll();
107.2455 +		adjustCanvasSize();
107.2456 +		canvas()->update();
107.2457 +	}
107.2458 +}
107.2459 +
107.2460 +void MapEditor::unScrollAll()
107.2461 +{
107.2462 +	BranchObj *bo;
107.2463 +	bo=mapCenter->first();
107.2464 +	while (bo) 
107.2465 +	{
107.2466 +		if (bo->isScrolled()) bo->toggleScroll();
107.2467 +		bo=bo->next();
107.2468 +	}
107.2469 +}
107.2470 +
107.2471 +void MapEditor::loadFloatImage ()
107.2472 +{
107.2473 +	if (selection && 
107.2474 +		(typeid(*selection) == typeid(BranchObj)) || 
107.2475 +		(typeid(*selection) == typeid(MapCenterObj))  )
107.2476 +	{
107.2477 +		BranchObj *bo=((BranchObj*)(selection));
107.2478 +
107.2479 +		QFileDialog *fd=new QFileDialog( this,tr("vym - load image"));
107.2480 +		fd->addFilter (QString (tr("Images") + " (*.png *.bmp *.xbm *.jpg *.png *.xpm *.gif *.pnm)"));
107.2481 +		ImagePreview *p =new ImagePreview (fd);
107.2482 +		fd->setContentsPreviewEnabled( TRUE );
107.2483 +		fd->setContentsPreview( p, p );
107.2484 +		fd->setPreviewMode( QFileDialog::Contents );
107.2485 +		fd->setCaption(tr("vym - Load image"));
107.2486 +		fd->setDir (lastImageDir);
107.2487 +		fd->show();
107.2488 +
107.2489 +		QString fn;
107.2490 +		if ( fd->exec() == QDialog::Accepted )
107.2491 +		{
107.2492 +			setChanged();
107.2493 +			saveState(PartOfMap,selection);
107.2494 +			QString fn=fd->selectedFile();
107.2495 +			lastImageDir=fn.left(fn.findRev ("/"));
107.2496 +			bo->addFloatImage();
107.2497 +			// FIXME check if load was successful
107.2498 +			bo->getLastFloatImage()->load(fn);
107.2499 +			bo->getLastFloatImage()->setOriginalFilename(fn);
107.2500 +			mapCenter->reposition();
107.2501 +			adjustCanvasSize();
107.2502 +			canvas()->update();
107.2503 +		}
107.2504 +	}
107.2505 +}
107.2506 +
107.2507 +void MapEditor::saveFloatImage (int item)
107.2508 +{
107.2509 +	if (selection && 
107.2510 +		(typeid(*selection) == typeid(FloatImageObj)) )
107.2511 +	{
107.2512 +		FloatImageObj *fio=((FloatImageObj*)(selection));
107.2513 +		const char* fmt = saveImageFormatMenu->text(item);
107.2514 +
107.2515 +		QFileDialog *fd=new QFileDialog( this, tr("vym - save image as") + fmt);
107.2516 +		fd->addFilter ("PNG (*.png)");
107.2517 +		fd->addFilter ("BMP (*.bmp)");
107.2518 +		fd->addFilter ("XBM (*.xbm)");
107.2519 +		fd->addFilter ("JPG (*.jpg)");
107.2520 +		fd->addFilter ("XPM (*.xpm)");
107.2521 +		fd->addFilter ("GIF (*.gif)");
107.2522 +		fd->addFilter ("PNM (*.pnm)");
107.2523 +		fd->addFilter (QString (tr("Images") + " (*.png *.bmp *.xbm *.jpg *.png *.xpm *.gif *.pnm)"));
107.2524 +		fd->setCaption(tr("vym - Save image as ") + fmt);
107.2525 +		fd->setMode( QFileDialog::AnyFile );
107.2526 +		fd->setSelection (fio->getOriginalFilename());
107.2527 +		fd->show();
107.2528 +
107.2529 +		QString fn;
107.2530 +		if ( fd->exec() == QDialog::Accepted )
107.2531 +		{
107.2532 +			if (QFile (fd->selectedFile()).exists() )
107.2533 +			{
107.2534 +				QMessageBox mb( "VYM",
107.2535 +					tr("The file ") + fd->selectedFile() + 
107.2536 +					tr(" exists already. "
107.2537 +					"Do you want to overwrite it?"),
107.2538 +				QMessageBox::Warning,
107.2539 +				QMessageBox::Yes | QMessageBox::Default,
107.2540 +				QMessageBox::Cancel | QMessageBox::Escape,
107.2541 +				QMessageBox::QMessageBox::NoButton );
107.2542 +
107.2543 +				mb.setButtonText( QMessageBox::Yes, tr("Overwrite") );
107.2544 +				mb.setButtonText( QMessageBox::No, tr("Cancel"));
107.2545 +				switch( mb.exec() ) 
107.2546 +				{
107.2547 +					case QMessageBox::Yes:
107.2548 +						// save 
107.2549 +						break;;
107.2550 +					case QMessageBox::Cancel:
107.2551 +						// do nothing
107.2552 +						return;
107.2553 +						break;
107.2554 +				}
107.2555 +			}
107.2556 +			fio->save (fd->selectedFile(),fmt);
107.2557 +		}
107.2558 +	}
107.2559 +}
107.2560 +
107.2561 +void MapEditor::toggleFloatExport()
107.2562 +{
107.2563 +	if (selection && 
107.2564 +		(typeid(*selection) == typeid(FloatImageObj))|| 
107.2565 +		(typeid(*selection) == typeid(FloatObj)) )
107.2566 +	{
107.2567 +		FloatImageObj *fio=((FloatImageObj*)(selection));
107.2568 +		fio->setFloatExport (actionEditToggleFloatExport->isOn() );
107.2569 +	}
107.2570 +}
107.2571 +
107.2572 +void MapEditor::setFrame(const FrameType &t)
107.2573 +{
107.2574 +	if (selection && 
107.2575 +		(typeid(*selection) == typeid(BranchObj)) || 
107.2576 +		(typeid(*selection) == typeid(MapCenterObj))  )
107.2577 +	{
107.2578 +		selection->setFrameType (t);
107.2579 +		mapCenter->reposition();
107.2580 +		selection->updateLink();
107.2581 +	}
107.2582 +}
107.2583 +
107.2584 +void MapEditor::importDir(BranchObj *dst, QDir d)
107.2585 +{
107.2586 +	if (selection && 
107.2587 +		(typeid(*selection) == typeid(BranchObj)) || 
107.2588 +		(typeid(*selection) == typeid(MapCenterObj))  )
107.2589 +	{
107.2590 +		BranchObj *bo;
107.2591 +		
107.2592 +		// Traverse directories
107.2593 +		d.setFilter( QDir::Dirs| QDir::Hidden | QDir::NoSymLinks );
107.2594 +		const QFileInfoList *dirlist = d.entryInfoList();
107.2595 +		QFileInfoListIterator itdir( *dirlist );
107.2596 +		QFileInfo *fi;
107.2597 +
107.2598 +		while ( (fi = itdir.current()) != 0 ) 
107.2599 +		{
107.2600 +			if (fi->fileName() != "." && fi->fileName() != ".." )
107.2601 +			{
107.2602 +				dst->addBranch();
107.2603 +				bo=dst->getLastBranch();
107.2604 +				bo->setHeading (fi->fileName() );
107.2605 +				bo->setColor (QColor("blue"),false);
107.2606 +				bo->toggleScroll();
107.2607 +				if ( !d.cd(fi->fileName()) ) 
107.2608 +					QMessageBox::critical (0,tr("Critical Import Error"),tr("Cannot find the directory"));
107.2609 +				else 
107.2610 +				{
107.2611 +					importDir (bo,d);
107.2612 +					d.cdUp();
107.2613 +				}
107.2614 +			}	
107.2615 +			++itdir;
107.2616 +		}		
107.2617 +		// Traverse files
107.2618 +		d.setFilter( QDir::Files| QDir::Hidden | QDir::NoSymLinks );
107.2619 +		const QFileInfoList *filelist = d.entryInfoList();
107.2620 +		QFileInfoListIterator itfile( *filelist );
107.2621 +
107.2622 +		while ( (fi = itfile.current()) != 0 ) 
107.2623 +		{
107.2624 +			dst->addBranch();
107.2625 +			bo=dst->getLastBranch();
107.2626 +			bo->setHeading (fi->fileName() );
107.2627 +			bo->setColor (QColor("black"),false);
107.2628 +			++itfile;
107.2629 +		}	
107.2630 +	}		
107.2631 +}
107.2632 +
107.2633 +void MapEditor::importDir()
107.2634 +{
107.2635 +	if (selection && 
107.2636 +		(typeid(*selection) == typeid(BranchObj)) || 
107.2637 +		(typeid(*selection) == typeid(MapCenterObj))  )
107.2638 +	{
107.2639 +		QFileDialog *fd=new QFileDialog( this,tr("VYM - Choose directory structur to import"));
107.2640 +		fd->setMode (QFileDialog::DirectoryOnly);
107.2641 +		fd->addFilter (QString (tr("vym map") + " (*.vym)"));
107.2642 +		fd->setCaption(tr("VYM - Choose directory structur to import"));
107.2643 +		fd->show();
107.2644 +
107.2645 +		QString fn;
107.2646 +		if ( fd->exec() == QDialog::Accepted )
107.2647 +		{
107.2648 +			BranchObj *bo=((BranchObj*)(selection));
107.2649 +			importDir (bo,QDir(fd->selectedFile()) );
107.2650 +			mapCenter->reposition();
107.2651 +			adjustCanvasSize();
107.2652 +			canvas()->update();
107.2653 +		}
107.2654 +	}	
107.2655 +}
107.2656 +
107.2657 +void MapEditor::testFunction()
107.2658 +{
107.2659 +	cout << "MapEditor::testFunction() called\n";
107.2660 +}
107.2661 +
107.2662 +void MapEditor::ensureSelectionVisible()
107.2663 +{
107.2664 +	LinkableMapObj* lmo= dynamic_cast <LinkableMapObj*> (selection);
107.2665 +	QPoint p;
107.2666 +	if (selection->getOrientation() == OrientLeftOfCenter)
107.2667 +		p= worldMatrix().map(QPoint (lmo->x(),lmo->y()));
107.2668 +	else	
107.2669 +		p= worldMatrix().map(QPoint (lmo->x()+lmo->width(),lmo->y()+lmo->height()));
107.2670 +	ensureVisible (p.x(), p.y() );
107.2671 +
107.2672 +}
107.2673 +
107.2674 +void MapEditor::updateViewCenter()
107.2675 +{
107.2676 +	// Update movingCenter, so that we can zoom comfortably later
107.2677 +	QRect rc = QRect( contentsX(), contentsY(),
107.2678 +				  visibleWidth(), visibleHeight() );
107.2679 +	QRect canvasRect = inverseWorldMatrix().mapRect(rc);
107.2680 +	movingCenter.setX((canvasRect.right() + canvasRect.left())/2);
107.2681 +	movingCenter.setY((canvasRect.top() + canvasRect.bottom())/2);
107.2682 +}
107.2683 +
107.2684 +void MapEditor::contentsContextMenuEvent ( QContextMenuEvent * e )
107.2685 +{
107.2686 +	// Lineedits are already closed by preceding
107.2687 +	// mouseEvent, we don't need to close here.
107.2688 +
107.2689 +    QPoint p = inverseWorldMatrix().map(e->pos());
107.2690 +    LinkableMapObj* lmo=mapCenter->findMapObj(p, NULL);
107.2691 +	
107.2692 +    if (lmo) 
107.2693 +	{	// MapObj was found
107.2694 +		if (selection != lmo)
107.2695 +		{
107.2696 +			// select the MapObj
107.2697 +			if (selection) selection->unselect();
107.2698 +			selection=lmo;
107.2699 +			selection->select();
107.2700 +			adjustCanvasSize();
107.2701 +		}
107.2702 +		// Context Menu 
107.2703 +		if (selection) 
107.2704 +		{
107.2705 +			if (typeid(*selection)==typeid(BranchObj) ||
107.2706 +				typeid(*selection)==typeid(MapCenterObj) )
107.2707 +			{
107.2708 +				// Context Menu on branch or mapcenter
107.2709 +				updateActions();
107.2710 +				branchContextMenu->popup(e->globalPos() );
107.2711 +			}	
107.2712 +			if (typeid(*selection)==typeid(FloatImageObj))
107.2713 +			{
107.2714 +				// Context Menu on floatimage
107.2715 +				updateActions();
107.2716 +				floatimageContextMenu->popup(e->globalPos() );
107.2717 +			}	
107.2718 +		}	
107.2719 +	} else 
107.2720 +	{ // No MapObj found, we are on the Canvas itself
107.2721 +		// Context Menu on Canvas
107.2722 +		updateActions();
107.2723 +		canvasContextMenu->popup(e->globalPos() );
107.2724 +    } 
107.2725 +}
107.2726 +
107.2727 +void MapEditor::contentsMousePressEvent(QMouseEvent* e)
107.2728 +{
107.2729 +	// Finish open lineEdits
107.2730 +	if (lineedit) finishedLineEditNoSave();
107.2731 +	
107.2732 +    QPoint p = inverseWorldMatrix().map(e->pos());
107.2733 +    LinkableMapObj* lmo=mapCenter->findMapObj(p, NULL);
107.2734 +	
107.2735 +	// Special case: CTRL is pressed, don't select anything
107.2736 +	if (e->state() & QMouseEvent::ControlButton)
107.2737 +	{
107.2738 +		pickingColor=true;
107.2739 +		setCursor (pickColorCursor);
107.2740 +		return;
107.2741 +	}
107.2742 +
107.2743 +    if (lmo) 
107.2744 +	{	// MapObj was found
107.2745 +		if (selection != lmo)
107.2746 +		{
107.2747 +			// select the MapObj
107.2748 +			if (selection) selection->unselect();
107.2749 +			selection=lmo;
107.2750 +			selection->select();
107.2751 +				
107.2752 +			adjustCanvasSize();
107.2753 +		}
107.2754 +
107.2755 +		// Check, if systemFlag clicked
107.2756 +		if (typeid(*selection)==typeid(BranchObj) ||
107.2757 +			typeid(*selection)==typeid(MapCenterObj) )
107.2758 +		{
107.2759 +			QString foname=((BranchObj*)(selection))->getSystemFlagName(p);
107.2760 +			if (!foname.isEmpty())
107.2761 +			{
107.2762 +				// Do not move, if systemFlag clicked
107.2763 +				if (foname=="url") 
107.2764 +					openURL();
107.2765 +				else
107.2766 +					if (foname=="vymLink")
107.2767 +					{
107.2768 +						mainWindow->editOpenVymLink();
107.2769 +						// tabWidget may change, better return now
107.2770 +						// before segfaulting...
107.2771 +						return;
107.2772 +					} else
107.2773 +						if (foname=="note")
107.2774 +							mainWindow->windowToggleNoteEditor();
107.2775 +			}			
107.2776 +		}	
107.2777 +			
107.2778 +		// Left Button	    Move Branches
107.2779 +		if (e->button() == QMouseEvent::LeftButton )
107.2780 +		{
107.2781 +			movingObj=selection;	
107.2782 +			movingObj_start.setX( p.x() - selection->x() );	
107.2783 +			movingObj_start.setY( p.y() - selection->y() );	
107.2784 +		} else
107.2785 +			// Middle Button    Toggle Scroll
107.2786 +			// (On Mac OS X this won't work, but we still have 
107.2787 +			// a button in the toolbar)
107.2788 +			if (e->button() == QMouseEvent::MidButton )
107.2789 +			{
107.2790 +				toggleScroll();
107.2791 +			} 
107.2792 +		updateActions();
107.2793 +	} else 
107.2794 +	{ // No MapObj found, we are on the Canvas itself
107.2795 +		// Left Button	    move Pos of CanvasView
107.2796 +		if (e->button() == QMouseEvent::LeftButton )
107.2797 +		{
107.2798 +			movingObj=NULL;	// move Content not Obj
107.2799 +			movingObj_start=e->globalPos();
107.2800 +			movingCont_start=QPoint (contentsX(), contentsY() );
107.2801 +			movingVec=QPoint(0,0);
107.2802 +			setCursor(handOpenCursor);
107.2803 +		} 
107.2804 +    } 
107.2805 +}
107.2806 +
107.2807 +void MapEditor::contentsMouseMoveEvent(QMouseEvent* e)
107.2808 +{
107.2809 +    // Move the selected MapObj
107.2810 +    if ( selection && movingObj) 
107.2811 +    {	
107.2812 +		QPoint p = inverseWorldMatrix().map(e->pos());
107.2813 +		
107.2814 +		// Now move the selection, but add relative position (movingObj_start) 
107.2815 +		// where selection 
107.2816 +		// was chosen with mousepointer. (This avoids flickering resp. jumping 
107.2817 +		// of selection back to absPos)
107.2818 +		
107.2819 +		LinkableMapObj *lmosel;
107.2820 +		lmosel =  dynamic_cast <LinkableMapObj*> (selection);
107.2821 +
107.2822 +		// Check if we could link 
107.2823 +		LinkableMapObj* lmo=mapCenter->findMapObj(p, lmosel);
107.2824 +		
107.2825 +
107.2826 +		if (typeid(*selection) == typeid(FloatImageObj))
107.2827 +		{
107.2828 +			setChanged();
107.2829 +			saveState();
107.2830 +			FloatObj *fo=(FloatObj*)(selection);
107.2831 +			if (fo->getLinkStyle()==StyleUndef) 
107.2832 +			{
107.2833 +				fo->setLinkStyle(fo->getDefLinkStyle());
107.2834 +				fo->setLinkColor(fo->getParObj()->getLinkColor());
107.2835 +			}	
107.2836 +			fo->move   (p.x() -movingObj_start.x(), p.y()-movingObj_start.y() );		
107.2837 +			fo->setRelPos();
107.2838 +			fo->reposition();
107.2839 +
107.2840 +			// Relink float to new mapcenter or branch, if shift is pressed	
107.2841 +			// Only relink, if selection really has a new parent
107.2842 +			if ( (e->state() & QMouseEvent::ShiftButton) && lmo &&
107.2843 +				( (typeid(*lmo)==typeid(BranchObj)) ||
107.2844 +				  (typeid(*lmo)==typeid(MapCenterObj)) ) &&
107.2845 +				( lmo != fo->getParObj())  
107.2846 +				)
107.2847 +			{
107.2848 +				if (typeid(*fo) == typeid(FloatImageObj)) 
107.2849 +				{
107.2850 +					FloatImageObj *fio=(FloatImageObj*)(fo);
107.2851 +					((BranchObj*)(lmo))->addFloatImage (fio);
107.2852 +					fio->unselect();
107.2853 +					((BranchObj*)(fio->getParObj()))->removeFloatImage (fio);
107.2854 +					fio=((BranchObj*)(lmo))->getLastFloatImage();
107.2855 +					fio->setRelPos();
107.2856 +					fio->reposition();
107.2857 +					selection=(LinkableMapObj*)(fio);
107.2858 +					selection->select();
107.2859 +					movingObj=(MapObj*)(fio);
107.2860 +					// setLinkStyle calls updateLink, only set it once
107.2861 +					if (fio->getLinkStyle()!=fio->getDefLinkStyle() ) 
107.2862 +						fio->setLinkStyle (fio->getDefLinkStyle());
107.2863 +
107.2864 +				}	
107.2865 +				// TODO if (typeid(*selection) == typeid(FloatTextObj))
107.2866 +			}
107.2867 +		} else	// selection != a FloatObj
107.2868 +		{
107.2869 +			if (lmosel->getDepth()==0)
107.2870 +			{
107.2871 +				if (e->state() == (LeftButton | !ShiftButton)) 
107.2872 +					// If mapCenter is moved, move all the rest by default, too.
107.2873 +					mapCenter->moveAll(p.x() -movingObj_start.x(), p.y()-movingObj_start.y() );		
107.2874 +				else	
107.2875 +					mapCenter->move   (p.x() -movingObj_start.x(), p.y()-movingObj_start.y() );		
107.2876 +			} else
107.2877 +			{	
107.2878 +				if (lmosel->getDepth()==1)
107.2879 +				{
107.2880 +					// depth==1, mainbranch
107.2881 +					setChanged();
107.2882 +					saveState(PartOfMap,lmosel);
107.2883 +					lmosel->move(p.x() -movingObj_start.x(), p.y()-movingObj_start.y() );		
107.2884 +				} else
107.2885 +				{
107.2886 +					// depth>1
107.2887 +					if (lmosel->getOrientation() == OrientLeftOfCenter)
107.2888 +						// Add width of bbox here, otherwise alignRelTo will cause jumping around
107.2889 +						lmosel->move(p.x() -movingObj_start.x()+lmosel->getBBox().width(), 
107.2890 +							p.y()-movingObj_start.y() );		
107.2891 +					else	
107.2892 +						lmosel->move(p.x() -movingObj_start.x(), p.y()-movingObj_start.y() );
107.2893 +				} 
107.2894 +				// reposition subbranch
107.2895 +				lmosel->reposition();	
107.2896 +				ensureSelectionVisible();
107.2897 +
107.2898 +				if (lmo && (lmo!=selection) &&  
107.2899 +					(typeid(*lmo) == typeid(BranchObj) ||
107.2900 +					(typeid(*lmo) == typeid(MapCenterObj) )
107.2901 +					) )
107.2902 +				{
107.2903 +					if (e->state() & QMouseEvent::ControlButton)
107.2904 +					{
107.2905 +						// Special case: CTRL to link below lmo
107.2906 +						lmosel->setParObjTmp (lmo,p,+1);
107.2907 +					}
107.2908 +					else if (e->state() & QMouseEvent::ShiftButton)
107.2909 +						lmosel->setParObjTmp (lmo,p,-1);
107.2910 +					else
107.2911 +						lmosel->setParObjTmp (lmo,p,0);
107.2912 +				} else	
107.2913 +				{
107.2914 +					if (lmo &&(lmo==selection))   
107.2915 +						// Could link to myself (happens sometimes...)
107.2916 +						lmosel->unsetParObjTmp();
107.2917 +					if (!lmo)  
107.2918 +						// no Obj under selection, go back to original Parent
107.2919 +						lmosel->unsetParObjTmp();
107.2920 +				}		
107.2921 +			} // depth>0
107.2922 +
107.2923 +		} // no FloatImageObj
107.2924 +
107.2925 +		canvas()->update();
107.2926 +		return;
107.2927 +	} // selection && moving_obj
107.2928 +		
107.2929 +    // Move CanvasView 
107.2930 +    if (!movingObj && !pickingColor) 
107.2931 +	{
107.2932 +		QPoint p=e->globalPos();
107.2933 +		movingVec.setX(-p.x() + movingObj_start.x() );
107.2934 +		movingVec.setY(-p.y() + movingObj_start.y() );
107.2935 +		setContentsPos( movingCont_start.x() + movingVec.x(),
107.2936 +	    movingCont_start.y() + movingVec.y());
107.2937 +
107.2938 +		updateViewCenter();
107.2939 +    }
107.2940 +}
107.2941 +
107.2942 +
107.2943 +void MapEditor::contentsMouseReleaseEvent(QMouseEvent* e)
107.2944 +{
107.2945 +	LinkableMapObj *dst;
107.2946 +	// Have we been picking color?
107.2947 +	if (pickingColor)
107.2948 +	{
107.2949 +		pickingColor=false;
107.2950 +		setCursor (ArrowCursor);
107.2951 +		// Check if we are over another branch
107.2952 +		dst=mapCenter->findMapObj(inverseWorldMatrix().map(e->pos() ), NULL);
107.2953 +		if (dst && selection) 
107.2954 +		{	
107.2955 +			if (e->state() & QMouseEvent::ShiftButton)
107.2956 +			{
107.2957 +				((BranchObj*)(selection))->setColor (((BranchObj*)(dst))->getColor(),false);
107.2958 +				((BranchObj*)(selection))->setLinkColor ();
107.2959 +			}	
107.2960 +			else	
107.2961 +			{
107.2962 +				((BranchObj*)(selection))->setColor (((BranchObj*)(dst))->getColor(),true);
107.2963 +				((BranchObj*)(selection))->setLinkColor ();
107.2964 +			}	
107.2965 +		} 
107.2966 +		return;
107.2967 +	}
107.2968 +    // Have we been moving something?
107.2969 +    if ( selection && movingObj ) 
107.2970 +    {	
107.2971 +		// Check if we are over another branch, but ignore 
107.2972 +		// any found LMOs, which are FloatObjs
107.2973 +		dst=mapCenter->findMapObj(inverseWorldMatrix().map(e->pos() ), 
107.2974 +			((LinkableMapObj*)(selection)) );
107.2975 +
107.2976 +		if (dst &&
107.2977 +		(typeid(*dst)!=typeid(BranchObj)&&typeid(*dst)!=typeid(MapCenterObj))) 
107.2978 +		{
107.2979 +			dst=NULL;
107.2980 +		}	
107.2981 +		
107.2982 +		// Now check, if we have been moving a branch 
107.2983 +		if (typeid(*selection) == typeid(BranchObj)  )
107.2984 +		{
107.2985 +			// save the position in case we link to mapcenter
107.2986 +			QPoint savePos=QPoint (selection->x(),selection->y() );
107.2987 +
107.2988 +			// Reset the temporary drawn link to the original one
107.2989 +			((LinkableMapObj*)(selection))->unsetParObjTmp();
107.2990 +
107.2991 +			if (dst ) 
107.2992 +			{   
107.2993 +				setChanged();
107.2994 +				saveState();
107.2995 +				// TODO we also could check, if dest and src are on same branch,
107.2996 +				// then it would be sufficient to saveState of this branch
107.2997 +
107.2998 +				// FIXME better introduce BO::move  to speed up and keep IDs
107.2999 +				copy();			// copy selection to clipboard
107.3000 +				cutNoSave();	// remove selection here
107.3001 +
107.3002 +				selection->unselect();	
107.3003 +				selection=dst;
107.3004 +				// Modifiers allow to insert above/below dst
107.3005 +				if (e->state() & QMouseEvent::ShiftButton)
107.3006 +				{
107.3007 +					selection=pasteAtNoSave (((BranchObj*)(dst))->getNum());
107.3008 +					if (selection) selection->select();
107.3009 +				}	
107.3010 +				else if (e->state() & QMouseEvent::ControlButton)
107.3011 +				{
107.3012 +					selection=pasteAtNoSave (((BranchObj*)(dst))->getNum()+1);
107.3013 +					if (selection) selection->select();
107.3014 +				}	
107.3015 +				else	
107.3016 +				{
107.3017 +					selection=pasteNoSave();
107.3018 +					selection->select();
107.3019 +					if (dst->getDepth()==0) 
107.3020 +						((BranchObj*)(selection))->move (savePos);
107.3021 +				}	
107.3022 +			} 
107.3023 +			// Draw the original link, before selection was moved around
107.3024 +			mapCenter->reposition();
107.3025 +		}
107.3026 +		// Finally resize canvas, if needed
107.3027 +		adjustCanvasSize();
107.3028 +		canvas()->update();
107.3029 +		movingObj=NULL;		
107.3030 +	} else 
107.3031 +	{	// maybe we moved View: set old cursor
107.3032 +		setCursor (ArrowCursor);
107.3033 +    }
107.3034 +}
107.3035 +
107.3036 +void MapEditor::contentsMouseDoubleClickEvent(QMouseEvent* e)
107.3037 +{
107.3038 +	// Finish open lineEdits
107.3039 +	if (lineedit) finishedLineEditNoSave();
107.3040 +	
107.3041 +	if (e->button() == QMouseEvent::LeftButton )
107.3042 +	{
107.3043 +		QPoint p = inverseWorldMatrix().map(e->pos());
107.3044 +		LinkableMapObj *lmo=mapCenter->findMapObj(p, NULL);
107.3045 +		if (lmo) {	// MapObj was found
107.3046 +			// First select the MapObj than edit heading
107.3047 +			if (selection) selection->unselect();
107.3048 +			selection=lmo;
107.3049 +			selection->select();
107.3050 +			setChanged();
107.3051 +			saveState(PartOfMap,selection);
107.3052 +			editHeading();
107.3053 +		}
107.3054 +	}
107.3055 +}
107.3056 +
107.3057 +void MapEditor::resizeEvent (QResizeEvent* e)
107.3058 +{
107.3059 +	QCanvasView::resizeEvent( e );
107.3060 +	
107.3061 +	QString s="";
107.3062 +	if (!fileName.isEmpty()) s=fileName;
107.3063 +	adjustCanvasSize();
107.3064 +}
107.3065 +
   108.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   108.2 +++ b/mapeditor.h	Sun Jan 30 12:59:10 2005 +0000
   108.3 @@ -0,0 +1,197 @@
   108.4 +#ifndef MAPEDITOR_H
   108.5 +#define MAPEDITOR_H
   108.6 +
   108.7 +#include <qcanvas.h>
   108.8 +#include <qlineedit.h>
   108.9 +#include <qcursor.h>
  108.10 +#include <qfiledialog.h>
  108.11 +#include <qevent.h>
  108.12 +#include <qprocess.h>
  108.13 +
  108.14 +#include "mapcenterobj.h"
  108.15 +#include "misc.h"
  108.16 +
  108.17 +class MapEditor : public QCanvasView , public xmlObj {
  108.18 +    Q_OBJECT
  108.19 +
  108.20 +public:
  108.21 +    MapEditor(QWidget* parent=0, bool interactive=false, const char* name=0, WFlags f=0);
  108.22 +	~MapEditor();
  108.23 +    QColor color();
  108.24 +    QColor backgroundColor();
  108.25 +    MapCenterObj* getMapCenter();
  108.26 +	QCanvas* getCanvas();
  108.27 +	void adjustCanvasSize();// adjust canvas size to map and scrollview
  108.28 +	bool blockReposition(); // block while load or undo
  108.29 +	
  108.30 +private:
  108.31 +	void makeTmpDirs();		// create temporary directories
  108.32 +	void delTmpDirs();		// delete temporary directories
  108.33 +	void makeSubDirs(const QString&);		
  108.34 +							// create subdirs in dir
  108.35 +    QString saveToDir(const QString&,const QString &,bool, const QPoint
  108.36 +	&,SaveMode);
  108.37 +    void saveState();		// save actual state to backup
  108.38 +    void saveState(const SaveMode&, LinkableMapObj *);
  108.39 +
  108.40 +private slots:
  108.41 +    void finishedLineEditNoSave();
  108.42 +
  108.43 +public:
  108.44 +	bool isDefault();		// false, if map was changed once
  108.45 +    bool isUnsaved();		// save necessary
  108.46 +    bool hasChanged();		// undo possible
  108.47 +	void setChanged();		// called from NoteEditor via LMO
  108.48 +	void closeMap();
  108.49 +	void setFilePath (QString);	
  108.50 +	void setFilePath (QString,QString);	
  108.51 +	QString getFilePath ();	// Full path e.g. "/home/tux/map.xml"
  108.52 +	QString getFileName ();	// e.g. "map.xml"
  108.53 +	QString getMapName ();	// e.g. "map"
  108.54 +	QString getDestPath (); // e.g. "/home/tux/map.vym"
  108.55 +    int load (QString&, const LoadMode &);	// newmap, import/replace selection
  108.56 +    int save(const SaveMode &);	// Save map 
  108.57 +	void setZipped(bool);		// save map zipped
  108.58 +	bool saveZipped();			// 1 if file will be saved zipped
  108.59 +    void print();				// print canvas
  108.60 +private:
  108.61 +    QPixmap getPixmap();
  108.62 +public:
  108.63 +    void exportImage (QString fn);		// export as PNG	
  108.64 +    void exportImage (QString fn, int);	// export in given format
  108.65 +    void exportASCII();
  108.66 +    void exportXML(const QString&);		// export to directory
  108.67 +    void clear();		// clear map
  108.68 +    void undo();		// undo last action
  108.69 +    void copy();		// copy branch to clipboard
  108.70 +private:	
  108.71 +    LinkableMapObj* pasteNoSave();		// paste clipboard to branch
  108.72 +    LinkableMapObj* pasteAtNoSave(int);	// paste clipboard to branch at position i
  108.73 +    void cutNoSave();	// cut to clipboard
  108.74 +public:	
  108.75 +    void paste();		// paste clipboard to branch and backup
  108.76 +    void cut();			// cut to clipboard and backup
  108.77 +    void moveBranchUp();
  108.78 +    void moveBranchDown();
  108.79 +    void editHeading();
  108.80 +    void addNewBranch(int);			// pos allows to add above/below selection
  108.81 +    void deleteSelection();
  108.82 +	LinkableMapObj* getSelection();	// returns selection
  108.83 +	bool select(QString );			// Select 
  108.84 +	void unselect();				// before changing current noteedit
  108.85 +	void reselect();				// after  changing current noteedit
  108.86 +private:	
  108.87 +	void selectNextBranch();		// Increment number of branch
  108.88 +	void selectPrevBranch();		// Decrement number of branch
  108.89 +public:	
  108.90 +    void selectUpperBranch();
  108.91 +    void selectLowerBranch();
  108.92 +    void selectLeftBranch();
  108.93 +    void selectRightBranch();
  108.94 +    void selectFirstBranch();
  108.95 +    void selectLastBranch();
  108.96 +    void setColor(QColor);
  108.97 +    void selectBackgroundColor();
  108.98 +    void setBackgroundColor(QColor);
  108.99 +    QColor pickColor();
 108.100 +    void colorItem();
 108.101 +    void colorBranch();
 108.102 +	void toggleStandardFlag(QString);
 108.103 +	virtual void setViewCenter();			// needed for zooming
 108.104 +    BranchObj* findText(QString,bool);		// Find object
 108.105 +    void findReset();						// Reset Find 
 108.106 +	void openURL();							// open URL in external browser
 108.107 +	void editURL();							// edit the URL
 108.108 +	void editHeading2URL();					// copy heading to URL
 108.109 +	void editBugzilla2URL();				// create URL to Bugzilla
 108.110 +	void editVymLink();						// edit link to another map
 108.111 +	void deleteVymLink();					// delete link to another map
 108.112 +	QString getVymLink();					// return path to map
 108.113 +	void editMapInfo();						// dialog to enter author, ...
 108.114 +	void updateActions();					// update e.g. format buttons
 108.115 +	void setLinkStyle (LinkStyle);			// Set style of link
 108.116 +	LinkStyle getLinkStyle ();				// requested in LMO
 108.117 +	void setLinkColor(QColor);				// default color of links
 108.118 +	void setLinkColorHint();				// color of links
 108.119 +	void setLinkColorHint(LinkColorHint);	// color of links
 108.120 +	LinkColorHint getLinkColorHint();
 108.121 +	QColor getDefLinkColor();
 108.122 +	void toggleLinkColorHint();				// after changing linkStyles
 108.123 +    void selectLinkColor();
 108.124 +    void toggleScroll();
 108.125 +    void unScrollAll();
 108.126 +	void loadFloatImage ();
 108.127 +	void saveFloatImage (int);
 108.128 +	void toggleFloatExport();
 108.129 +	void setFrame(const FrameType &);
 108.130 +private:	
 108.131 +    void importDir(BranchObj *,QDir);
 108.132 +public:	
 108.133 +    void importDir();
 108.134 +    void testFunction();				// FIXME just testing
 108.135 +
 108.136 +protected:
 108.137 +	void ensureSelectionVisible();		
 108.138 +	virtual void updateViewCenter();	// needed for zooming
 108.139 +	virtual void contentsContextMenuEvent ( QContextMenuEvent *e );
 108.140 +    virtual void contentsMousePressEvent(QMouseEvent*);
 108.141 +    virtual void contentsMouseReleaseEvent(QMouseEvent*);
 108.142 +    virtual void contentsMouseDoubleClickEvent(QMouseEvent*);
 108.143 +    virtual void contentsMouseMoveEvent(QMouseEvent*);
 108.144 +
 108.145 +private:
 108.146 +    QCanvas* mapCanvas;
 108.147 +    MapCenterObj* mapCenter;
 108.148 +
 108.149 +	bool adjustCanvasRequested;	// collect requests until end of user event
 108.150 +	BranchObj *editingBO;		// entering Text into BO
 108.151 +    QLineEdit* lineedit;
 108.152 +
 108.153 +    QColor actColor;			// actual color
 108.154 +	QColor deflinkcolor;		// default color for links
 108.155 +	LinkColorHint linkcolorhint;// use heading color or own color
 108.156 +	LinkStyle linkstyle;		// default style for links
 108.157 +
 108.158 +    QCursor handOpenCursor;		// cursor while moving canvas view
 108.159 +	QCursor pickColorCursor;	// cursor while picking color 
 108.160 +	bool pickingColor;			// true while picking Color CTRL-LeftButton
 108.161 +	
 108.162 +    LinkableMapObj* selection;		// select a LinkableMapObj
 108.163 +    LinkableMapObj* selectionLast;	// last selection 
 108.164 +    MapObj* movingObj;				// moving a MapObj
 108.165 +    QPoint movingObj_start;			// rel. pos of mouse to absPos 
 108.166 +    QPoint movingCont_start;		// inital pos of moving Content or
 108.167 +    QPoint movingVec;				// how far has Content moved
 108.168 +	QPoint movingCenter;			// used when zooming
 108.169 +    QPrinter* printer;				// Printing
 108.170 +
 108.171 +    bool mapDefault;				// Flag if map is untouched
 108.172 +    bool mapChanged;				// Flag if undo is possible
 108.173 +	bool mapUnsaved;				// Flag if map should be saved
 108.174 +    QString backupXML;				// backup (XML) for undo
 108.175 +	LinkableMapObj* undoSelection;	// replace this LMO with vympart from backup
 108.176 +									// if != NULL
 108.177 +
 108.178 +	bool printFrame;			// Print frame around map
 108.179 +	bool printFooter;			// Print footer below map
 108.180 +
 108.181 +	bool zipped;				// should map be zipped
 108.182 +	QString fileName;			// short name of file (for tab)
 108.183 +	QString filePath;			// path to file which will be saved
 108.184 +	QString fileDir;			// dir where file is saved
 108.185 +	QString destPath;			// path to .vym file (needed for vymlinks)
 108.186 +	QString mapName;			// fileName without ".vym"
 108.187 +	QString lastImageDir;		// save dir for adding images
 108.188 +
 108.189 +	bool isInteractive;			// non interactive don't need tmpdirs
 108.190 +	QString bakMapDir;			// tmp directory with data for undo
 108.191 +	bool blockreposition;		// block while load or undo
 108.192 +
 108.193 +	BranchObj* itFind;			// next object in find process
 108.194 +	bool EOFind;				// true, if search failed
 108.195 +
 108.196 +	QPoint exportOffset;		// set before export, used in save
 108.197 +    void resizeEvent( QResizeEvent * );
 108.198 +};
 108.199 +#endif
 108.200 +
   109.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   109.2 +++ b/mapobj.cpp	Sun Jan 30 12:59:10 2005 +0000
   109.3 @@ -0,0 +1,143 @@
   109.4 +#include "mapobj.h"
   109.5 +
   109.6 +/////////////////////////////////////////////////////////////////
   109.7 +// MapObj
   109.8 +/////////////////////////////////////////////////////////////////
   109.9 +MapObj::MapObj ()
  109.10 +{
  109.11 +	// TODO not used any longer...
  109.12 +	cout << "Const MapObj (): Please set canvas somehow!!!\n";
  109.13 +    // canvas=actMapEditor->getCanvas();
  109.14 +    init ();
  109.15 +}
  109.16 +
  109.17 +MapObj::MapObj (QCanvas* c)
  109.18 +{
  109.19 +//  cout << "Const MapObj\n";
  109.20 +    canvas=c;
  109.21 +    init ();
  109.22 +}
  109.23 +
  109.24 +
  109.25 +MapObj::MapObj (MapObj* mo)
  109.26 +{
  109.27 +//    cout << "CopyConst MapObj\n";
  109.28 +    copy (mo);
  109.29 +}
  109.30 +
  109.31 +MapObj::~MapObj ()
  109.32 +{
  109.33 +//    cout << "Destr MapObj\n";
  109.34 +}
  109.35 +
  109.36 +void MapObj::init ()
  109.37 +{
  109.38 +    absPos=QPoint(0,0);
  109.39 +    visible=true;
  109.40 +}
  109.41 +
  109.42 +void MapObj::copy(MapObj* other)
  109.43 +{
  109.44 +//    canvas=other->canvas;	// already set in constr. of child, use that one...
  109.45 +    absPos=other->absPos;
  109.46 +	bbox.setX (other->bbox.x() );
  109.47 +	bbox.setY (other->bbox.y() );
  109.48 +	bbox.setSize (QSize(other->bbox.width(), other->bbox.height() ) );
  109.49 +}
  109.50 +
  109.51 +QCanvas* MapObj::getCanvas()
  109.52 +{
  109.53 +	return canvas;
  109.54 +}
  109.55 +
  109.56 +int MapObj::x() 
  109.57 +{
  109.58 +    return absPos.x();
  109.59 +}
  109.60 +
  109.61 +int MapObj::y() 
  109.62 +{
  109.63 +    return absPos.y();
  109.64 +}
  109.65 +
  109.66 +int MapObj::width() 
  109.67 +{
  109.68 +    return bbox.width();
  109.69 +}
  109.70 +
  109.71 +int MapObj::height() 
  109.72 +{
  109.73 +    return bbox.height();
  109.74 +}
  109.75 +
  109.76 +void MapObj::move (double x, double y) 
  109.77 +{
  109.78 +    int xi=static_cast <int> (x);
  109.79 +    int yi=static_cast <int> (y);
  109.80 +    absPos.setX( xi);
  109.81 +    absPos.setY( yi);
  109.82 +    bbox.moveTopLeft(QPoint(xi,yi));
  109.83 +}
  109.84 +
  109.85 +void MapObj::moveBy (double x, double y) 
  109.86 +{
  109.87 +    move (x+absPos.x(),y+absPos.y() );
  109.88 +}
  109.89 +
  109.90 +bool MapObj::inBBox(QPoint p)
  109.91 +{
  109.92 +    if (p.x() >= bbox.left() && p.x() <= bbox.right()  
  109.93 +	&& p.y() <= bbox.bottom() && p.y() >= bbox.top() )
  109.94 +	return true;
  109.95 +    return false;	
  109.96 +}
  109.97 +
  109.98 +QRect MapObj::getBBox()
  109.99 +{
 109.100 +    return bbox;
 109.101 +}
 109.102 +
 109.103 +QRect MapObj::addBBox(QRect r1, QRect r2)
 109.104 +{
 109.105 +	QRect n;
 109.106 +	// Set left border
 109.107 +	if (r1.left() <= r2.left() )
 109.108 +		n.setLeft(r1.left() );
 109.109 +	else
 109.110 +		n.setLeft(r2.left() );
 109.111 +		
 109.112 +	// Set top border		
 109.113 +	if (r1.top() <= r2.top() )
 109.114 +		n.setTop(r1.top() );
 109.115 +	else
 109.116 +		n.setTop(r2.top() );
 109.117 +		
 109.118 +	// Set right border
 109.119 +	if (r1.right() <= r2.right() )
 109.120 +		n.setRight(r2.right() );
 109.121 +	else
 109.122 +		n.setRight(r1.right() );
 109.123 +		
 109.124 +	// Set bottom 
 109.125 +	if (r1.bottom() <= r2.bottom() )
 109.126 +		n.setBottom(r2.bottom() );
 109.127 +	else
 109.128 +		n.setBottom(r1.bottom() );
 109.129 +	return n;
 109.130 +}
 109.131 +
 109.132 +QSize MapObj::getSize()
 109.133 +{
 109.134 +    return bbox.size();
 109.135 +}
 109.136 +
 109.137 +
 109.138 +bool MapObj::isVisibleObj()
 109.139 +{
 109.140 +    return visible;
 109.141 +}
 109.142 +
 109.143 +void MapObj::setVisibility(bool v)
 109.144 +{
 109.145 +    visible=v;
 109.146 +}
   110.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   110.2 +++ b/mapobj.h	Sun Jan 30 12:59:10 2005 +0000
   110.3 @@ -0,0 +1,48 @@
   110.4 +#ifndef MAPOBJ_H
   110.5 +#define MAPOBJ_H
   110.6 +
   110.7 +#include <qcanvas.h>
   110.8 +#include <iostream>
   110.9 +
  110.10 +#include "misc.h"
  110.11 +
  110.12 +using namespace std;
  110.13 +
  110.14 +#define Z_BBOX     0
  110.15 +#define Z_LINK    20
  110.16 +#define Z_FRAME   50
  110.17 +#define Z_SELBOX  60
  110.18 +#define Z_ICON    80
  110.19 +#define Z_TEXT   100
  110.20 +
  110.21 +class MapObj:public xmlObj {
  110.22 +public:
  110.23 +    MapObj ();
  110.24 +    MapObj (QCanvas*);
  110.25 +    MapObj (MapObj*);
  110.26 +    virtual ~MapObj ();
  110.27 +    virtual void init ();
  110.28 +    virtual void copy (MapObj*);
  110.29 +	virtual QCanvas* getCanvas();
  110.30 +    virtual int x();
  110.31 +    virtual int y();
  110.32 +	virtual int width();
  110.33 +	virtual int height();
  110.34 +    virtual void move (double x,double y);      // move to absolute Position
  110.35 +    virtual void moveBy (double x,double y);    // move to relative Position
  110.36 +    virtual bool inBBox(QPoint);				// Check if Point is in bbox
  110.37 +    virtual QRect getBBox();					// returns bounding box
  110.38 +    virtual QRect addBBox(QRect,QRect);			// returns bbox which includes both boxes
  110.39 +    virtual QSize getSize();					// returns size of bounding box
  110.40 +    virtual bool isVisibleObj();
  110.41 +    virtual void setVisibility(bool);
  110.42 +protected:  
  110.43 +    QCanvas* canvas;
  110.44 +    QRect bbox;									// bounding box of MO itself
  110.45 +    virtual void positionBBox()=0;       
  110.46 +	virtual void calcBBoxSize()=0;
  110.47 +    QPoint absPos;							    // Position on canvas
  110.48 +    bool visible;
  110.49 +};
  110.50 +
  110.51 +#endif
   111.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   111.2 +++ b/misc.cpp	Sun Jan 30 12:59:10 2005 +0000
   111.3 @@ -0,0 +1,238 @@
   111.4 +#include <qregexp.h>
   111.5 +#include <qpoint.h>
   111.6 +
   111.7 +#include <math.h>
   111.8 +
   111.9 +#include "misc.h"
  111.10 +
  111.11 +
  111.12 +ostream &operator<< (ostream &stream, QPoint const &p)
  111.13 +{ 
  111.14 +    return (stream << "(" << p.x() << "," << p.y() << ")");
  111.15 +}
  111.16 +
  111.17 +float getAngle(const QPoint &p)
  111.18 +{	
  111.19 +	// Calculate angle of vector to y-axis
  111.20 +	if (p.y()==0)
  111.21 +	{
  111.22 +		if (p.x()>=0)
  111.23 +			return M_PI_2;
  111.24 +		else
  111.25 +			return 3* M_PI_2;
  111.26 +	} else
  111.27 +	{
  111.28 +		if (p.y()>0) 
  111.29 +			return (float)(M_PI  - atan ( (double)(p.x()) / (double)(p.y()) ) );
  111.30 +		else	
  111.31 +			if (p.x()<0)
  111.32 +				return (float)( 2*M_PI - atan ( (double)(p.x()) / (double)(p.y()) ) );
  111.33 +			else	
  111.34 +				return (float)( - atan ( (double)(p.x()) / (double)(p.y()) ) );
  111.35 +	}	
  111.36 +}
  111.37 +
  111.38 +QPoint normalise(const QPoint &p)
  111.39 +{	
  111.40 +	// Calculate normalised position (fixed length) 
  111.41 +
  111.42 +	double px=p.x();
  111.43 +	double py=p.y();
  111.44 +	double x;
  111.45 +	double y;
  111.46 +	double r=150;
  111.47 +
  111.48 +	if (px==0)
  111.49 +	{
  111.50 +		x=0;
  111.51 +		if (py>=0)
  111.52 +			y=r;
  111.53 +		else
  111.54 +			y=-r;
  111.55 +	} else
  111.56 +	{
  111.57 +		double sign;
  111.58 +		double a;
  111.59 +		if (px>0) 
  111.60 +			sign=1; 
  111.61 +		else 
  111.62 +			sign=-1;
  111.63 +		
  111.64 +		a=atan (py / px);
  111.65 +		x=cos (a) * r *sign;
  111.66 +		y=sin (a) * r *sign;
  111.67 +	}	
  111.68 +	return QPoint ((int) (x),(int) (y));
  111.69 +}
  111.70 +
  111.71 +QString maskPath(QString p)
  111.72 +{
  111.73 +	// Change " " to "\ " to enable blanks in filenames
  111.74 +	p=p.replace(QChar('&'),"\\&");
  111.75 +	return p.replace(QChar(' '),"\\ ");
  111.76 +}
  111.77 +
  111.78 +QString convertToRel (const QString &src, const QString &dst)
  111.79 +{
  111.80 +	QString s=src;
  111.81 +	QString d=dst;
  111.82 +	int i;
  111.83 +	// Find relative path from src to dst
  111.84 +
  111.85 +	// Remove the first "/"
  111.86 +	if (s.section ("/",0,0).isEmpty()) 
  111.87 +	{
  111.88 +		s=s.right (s.length()-1);
  111.89 +		d=d.right (d.length()-1);
  111.90 +	}
  111.91 +	
  111.92 +	// remove identical left parts
  111.93 +	while (s.section("/",0,0) == d.section("/",0,0) ) 
  111.94 +	{
  111.95 +		i=s.find ("/");
  111.96 +		s=s.right (s.length()-i-1);
  111.97 +		d=d.right (d.length()-i-1);
  111.98 +	}
  111.99 +
 111.100 +	int srcsep=s.contains("/");
 111.101 +	int dstsep=d.contains("/");
 111.102 +	if (srcsep >=  dstsep )
 111.103 +	{
 111.104 +		// find path to go up first and then back to dst
 111.105 +		i=1;
 111.106 +		while (i<=srcsep) 
 111.107 +		{
 111.108 +			d="../"+d;
 111.109 +			i++;
 111.110 +		}	
 111.111 +	}
 111.112 +	return d;
 111.113 +}
 111.114 +
 111.115 +// returns masked "<" ">" "&"
 111.116 +QString quotemeta(const QString &s)
 111.117 +{
 111.118 +	QString r=s;
 111.119 +    QRegExp  rx("&(?!amp;)");
 111.120 +    r.replace ( rx,"&amp;");
 111.121 +    rx.setPattern( ">");
 111.122 +    r.replace ( rx,"&gt;");
 111.123 +    rx.setPattern( "<");
 111.124 +    r.replace ( rx,"&lt;");
 111.125 +    rx.setPattern( "\"");
 111.126 +    r.replace ( rx,"&quot;");
 111.127 +    return r;
 111.128 +}
 111.129 +
 111.130 +int max(int a, int b)
 111.131 +{
 111.132 +	if (a>b)
 111.133 +		return a;
 111.134 +	return b;
 111.135 +}
 111.136 +
 111.137 +int xmlObj::actindent=0;		// make instance of actindent
 111.138 +
 111.139 +xmlObj::xmlObj()
 111.140 +{
 111.141 +    indentwidth=4;
 111.142 +}
 111.143 +
 111.144 +
 111.145 +// returns <s at />
 111.146 +QString xmlObj::singleElement(QString s, QString at)
 111.147 +{
 111.148 +    return indent() + "<" + s +" " + at +" " + "/>\n";
 111.149 +}
 111.150 +
 111.151 +// returns <s>
 111.152 +QString xmlObj::beginElement(QString s)
 111.153 +{
 111.154 +    return indent() + "<" + s + ">\n";
 111.155 +}
 111.156 +
 111.157 +// returns <s at>
 111.158 +QString xmlObj::beginElement(QString s, QString at)
 111.159 +{
 111.160 +    return indent() + "<" + s + " " + at + ">\n";
 111.161 +}
 111.162 +
 111.163 +// returns </s>
 111.164 +QString xmlObj::endElement(QString s)
 111.165 +{
 111.166 +    return indent() + "</" + s + ">\n";
 111.167 +}
 111.168 +
 111.169 +// returns  at="val"
 111.170 +QString xmlObj::attribut(QString at, QString val)
 111.171 +{
 111.172 +    return " " + at + "=\"" + quotemeta (val) + "\""; 
 111.173 +}
 111.174 +
 111.175 +// returns <s> val </s>
 111.176 +QString xmlObj::valueElement(QString el, QString val)
 111.177 +{
 111.178 +    return indent() + "<" + el + ">" + quotemeta(val) + "</" +el + ">\n";
 111.179 +}
 111.180 +
 111.181 +// returns <s at> val </s>
 111.182 +QString xmlObj::valueElement(QString el, QString val, QString at)
 111.183 +{
 111.184 +    return indent() + "<" + el + " " + at + ">" + quotemeta(val) + "</" +el + ">\n";
 111.185 +}
 111.186 +
 111.187 +void xmlObj::incIndent()
 111.188 +{
 111.189 +    actindent++;
 111.190 +}	
 111.191 +
 111.192 +void xmlObj::decIndent()
 111.193 +{
 111.194 +    actindent--;
 111.195 +    if (actindent<0) actindent=0;
 111.196 +}	
 111.197 +
 111.198 +QString xmlObj::indent()
 111.199 +{
 111.200 +    QString s;
 111.201 +    int i;
 111.202 +    for (i=0; i<actindent*indentwidth; i++)
 111.203 +    {
 111.204 +		s= s + " ";
 111.205 +    }
 111.206 +    return s;
 111.207 +}	
 111.208 +
 111.209 +
 111.210 +
 111.211 +ImagePreview::ImagePreview (QWidget *parent=0): QLabel (parent)
 111.212 +{
 111.213 +}
 111.214 +
 111.215 +void ImagePreview::previewUrl( const QUrl &u )
 111.216 +{
 111.217 +    QString path = u.path();
 111.218 +    QPixmap pix( path );
 111.219 +    if ( pix.isNull() )
 111.220 +        setText( QObject::tr("This is not an image.") );
 111.221 +    else
 111.222 +	{
 111.223 +		float max_w=300;
 111.224 +		float max_h=300;
 111.225 +		float r;
 111.226 +		if (pix.width()>max_w)
 111.227 +		{
 111.228 +			r=max_w / pix.width();
 111.229 +			pix.resize(lrint(pix.width()*r), lrint(pix.height()*r));
 111.230 +			// TODO not a resize, but a shrink/enlarge is needed here...
 111.231 +		}
 111.232 +		if (pix.height()>max_h)
 111.233 +		{
 111.234 +			r=max_h / pix.height();
 111.235 +			pix.resize(lrint(pix.width()*r), lrint(pix.height()*r));
 111.236 +			// TODO not a resize, but a shrink/enlarge is needed here...
 111.237 +		}
 111.238 +        setPixmap( pix );
 111.239 +	}	
 111.240 +}
 111.241 +
   112.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   112.2 +++ b/misc.h	Sun Jan 30 12:59:10 2005 +0000
   112.3 @@ -0,0 +1,64 @@
   112.4 +#ifndef MISC_H
   112.5 +#define MISC_H
   112.6 +
   112.7 +#include <qpoint.h>
   112.8 +#include <iostream>
   112.9 +
  112.10 +using namespace std;
  112.11 +
  112.12 +#define Z_BBOX     0
  112.13 +#define Z_LINK    20
  112.14 +#define Z_FRAME   50
  112.15 +#define Z_SELBOX  60
  112.16 +#define Z_ICON    80
  112.17 +#define Z_TEXT   100
  112.18 +
  112.19 +enum LoadMode {NewMap,ImportAdd,ImportReplace};
  112.20 +enum SaveMode {PartOfMap,CompleteMap};
  112.21 +
  112.22 +/////////////////////////////////////////////////////////////////////////////
  112.23 +extern ostream &operator<< (ostream &stream, QPoint const &p);
  112.24 +float getAngle(const QPoint &);
  112.25 +QPoint normalise (const QPoint &);
  112.26 +QString maskPath (QString );
  112.27 +QString convertToRel (const QString &,const QString &);
  112.28 +QString quotemeta(const QString&);	
  112.29 +int max (int,int);
  112.30 +class BranchObj;
  112.31 +class MapEditor;
  112.32 +
  112.33 +/////////////////////////////////////////////////////////////////////////////
  112.34 +class xmlObj
  112.35 +{
  112.36 +public:
  112.37 +    xmlObj();
  112.38 +    QString singleElement(QString,QString);
  112.39 +    QString beginElement(QString,QString);
  112.40 +    QString beginElement(QString);
  112.41 +    QString endElement  (QString);
  112.42 +    QString attribut    (QString,QString);
  112.43 +    QString valueElement(QString,QString);
  112.44 +    QString valueElement(QString,QString,QString);
  112.45 +    void incIndent();
  112.46 +    void decIndent();
  112.47 +    static int actindent;
  112.48 +
  112.49 +protected:  
  112.50 +    QString indent();
  112.51 +    int indentwidth;
  112.52 +};
  112.53 +
  112.54 +/////////////////////////////////////////////////////////////////////////////
  112.55 +
  112.56 +#include <qlabel.h>
  112.57 +#include <qfiledialog.h>
  112.58 +#include <qpixmap.h>
  112.59 +
  112.60 +class ImagePreview : public QLabel, public QFilePreview
  112.61 +{
  112.62 +public:
  112.63 +    ImagePreview( QWidget * );
  112.64 +    void previewUrl( const QUrl & );
  112.65 +};
  112.66 +
  112.67 +#endif
   113.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   113.2 +++ b/noteobj.cpp	Sun Jan 30 12:59:10 2005 +0000
   113.3 @@ -0,0 +1,105 @@
   113.4 +#include <qfile.h>
   113.5 +#include <qtextstream.h>
   113.6 +#include <qmessagebox.h>
   113.7 +#include <qregexp.h>
   113.8 +
   113.9 +#include "noteobj.h"
  113.10 +
  113.11 +/////////////////////////////////////////////////////////////////
  113.12 +// NoteObj
  113.13 +/////////////////////////////////////////////////////////////////
  113.14 +
  113.15 +NoteObj::NoteObj()
  113.16 +{
  113.17 +	clear();
  113.18 +}
  113.19 +
  113.20 +void NoteObj::copy (NoteObj other)
  113.21 +{
  113.22 +	note=other.note;
  113.23 +	fonthint=other.fonthint;
  113.24 +	filenamehint="";
  113.25 +}
  113.26 +
  113.27 +void NoteObj::clear()
  113.28 +{
  113.29 +	note="";
  113.30 +	fonthint="undef";
  113.31 +	filenamehint="";
  113.32 +}
  113.33 +
  113.34 +void NoteObj::setNote (const QString &s)
  113.35 +{
  113.36 +	note=s;
  113.37 +}
  113.38 +
  113.39 +QString NoteObj::getNote()
  113.40 +{
  113.41 +	return note;
  113.42 +}
  113.43 +
  113.44 +void NoteObj::setFontHint (const QString &s)
  113.45 +{
  113.46 +	// only for backward compatibility (pre 1.5 )
  113.47 +	fonthint=s;
  113.48 +}
  113.49 +
  113.50 +QString NoteObj::getFontHint()
  113.51 +{
  113.52 +	// only for backward compatibility (pre 1.5 )
  113.53 +	return fonthint;
  113.54 +}
  113.55 +
  113.56 +void NoteObj::setFilenameHint (const QString &s)
  113.57 +{
  113.58 +	filenamehint=s;
  113.59 +}
  113.60 +
  113.61 +QString NoteObj::getFilenameHint()
  113.62 +{
  113.63 +	return filenamehint;
  113.64 +}
  113.65 +
  113.66 +bool NoteObj::isEmpty ()
  113.67 +{
  113.68 +	return note.isEmpty();
  113.69 +}
  113.70 +
  113.71 +QString NoteObj::saveToDir ()
  113.72 +{
  113.73 +	// QTextEdit may generate fontnames with unquoted &, like
  113.74 +	// in "Lucida B&H". This is invalid in XML and thus would crash
  113.75 +	// the XML parser
  113.76 +	uint pos=0;
  113.77 +	uint pos2;
  113.78 +	bool inbracket=false;
  113.79 +	bool inquot=false;
  113.80 +	while (pos<note.length())
  113.81 +	{
  113.82 +		if (note.mid(pos,1)=="<") inbracket=true;
  113.83 +		if (note.mid(pos,1)==">") inbracket=false;
  113.84 +		if (note.mid(pos,1)=="\"" && inbracket)
  113.85 +		{
  113.86 +			if (!inquot)
  113.87 +				inquot=true;
  113.88 +			else
  113.89 +				inquot=false;
  113.90 +		}
  113.91 +		if (note.mid(pos,1)=="&" && inquot)
  113.92 +		{
  113.93 +			// Now we are inside  <  "  "  >
  113.94 +			// look for ending "
  113.95 +			pos2=pos+1;
  113.96 +			while (note.mid(pos2,1)!=";" && note.mid(pos2,1)!="\"")
  113.97 +				pos2++;
  113.98 +			if (note.mid(pos2,1)=="\"")
  113.99 +			{
 113.100 +				note.replace(pos,1,"&amp;");
 113.101 +				pos=pos2;
 113.102 +			}
 113.103 +		}
 113.104 +		pos++;
 113.105 +	}
 113.106 +	return beginElement ("htmlnote",attribut("fonthint",fonthint)) + "\n"+ note+ "\n" +endElement ("htmlnote");
 113.107 +}
 113.108 +
   114.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   114.2 +++ b/noteobj.h	Sun Jan 30 12:59:10 2005 +0000
   114.3 @@ -0,0 +1,30 @@
   114.4 +#ifndef NOTEOBJ_H
   114.5 +#define NOTEOBJ_H
   114.6 +
   114.7 +#include <qstring.h>
   114.8 +
   114.9 +class NoteObj;
  114.10 +
  114.11 +#include "misc.h"
  114.12 +
  114.13 +class NoteObj:public xmlObj
  114.14 +{
  114.15 +public:
  114.16 +	NoteObj();
  114.17 +	void copy (NoteObj);
  114.18 +	void clear();
  114.19 +	void setNote (const QString&);
  114.20 +	QString getNote();
  114.21 +	void setFontHint (const QString&);
  114.22 +	QString getFontHint ();
  114.23 +	void setFilenameHint (const QString&);
  114.24 +	QString getFilenameHint ();
  114.25 +	bool isEmpty();
  114.26 +	QString	saveToDir();
  114.27 +
  114.28 +private:
  114.29 +	QString note;
  114.30 +	QString fonthint;
  114.31 +	QString filenamehint;
  114.32 +};
  114.33 +#endif
   115.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   115.2 +++ b/options.cpp	Sun Jan 30 12:59:10 2005 +0000
   115.3 @@ -0,0 +1,144 @@
   115.4 +#include "options.h"
   115.5 +#include <iostream>
   115.6 +
   115.7 +#include <qapplication.h>
   115.8 +
   115.9 +using namespace std;
  115.10 +
  115.11 +
  115.12 +Option::Option()
  115.13 +{
  115.14 +	name="";
  115.15 +	sName="";
  115.16 +	lName="";
  115.17 +	type=SwitchOption;
  115.18 +	sarg="";
  115.19 +	active=false;
  115.20 +}
  115.21 +
  115.22 +void Option::set(const QString &n, const OptionType &t, const QString &s, const QString &l)
  115.23 +{
  115.24 +	sName="-"+s;
  115.25 +	lName="--"+l;
  115.26 +	type=t;
  115.27 +	name=n;
  115.28 +}
  115.29 +
  115.30 +QString Option::getName () { return name; }
  115.31 +QString Option::getShort () { return sName; }
  115.32 +QString Option::getLong() { return lName; }
  115.33 +OptionType Option::getType() { return type; }
  115.34 +void Option::setArg(const QString& s) { sarg=s; }
  115.35 +QString Option::getArg() { return sarg; }	
  115.36 +void Option::setActive() { active=true; }	
  115.37 +bool Option::isActive() { return active; }
  115.38 +
  115.39 +///////////////////////////////////////////////////////////////
  115.40 +Options::Options() {}	
  115.41 +
  115.42 +int Options::parse()
  115.43 +{
  115.44 +	QStringList arglist;
  115.45 +	int i=0;
  115.46 +	while (i<qApp->argc())
  115.47 +	{	
  115.48 +		arglist.append (qApp->argv()[i]);
  115.49 +		i++;
  115.50 +	}
  115.51 +
  115.52 +	// Get program name
  115.53 +	progname=arglist.first();
  115.54 +	arglist.pop_front();
  115.55 +
  115.56 +	// Work through rest of options
  115.57 +	bool isFile;
  115.58 +	OptionList::iterator itopt;
  115.59 +	QStringList::iterator itarg;
  115.60 +	itarg=arglist.begin();
  115.61 +	while (itarg!=arglist.end())
  115.62 +	{
  115.63 +		isFile=true;
  115.64 +		if ((*itarg).left(1)=="-")
  115.65 +		{
  115.66 +			// Compare given option to all defined options
  115.67 +			itopt=optlist.begin();
  115.68 +			while (itopt!=optlist.end())
  115.69 +			{
  115.70 +				if ((*itarg)==(*itopt).getShort() || 
  115.71 +					(*itarg)==(*itopt).getLong())
  115.72 +				{	
  115.73 +					(*itopt).setActive();
  115.74 +					isFile=false;
  115.75 +					if ((*itopt).getType()==StringOption)
  115.76 +					{
  115.77 +						itarg++;
  115.78 +						if (itarg==arglist.end())
  115.79 +						{
  115.80 +							cout << "Error: argument to option missing\n";
  115.81 +							return 1;
  115.82 +						}
  115.83 +						(*itopt).setArg (*itarg);
  115.84 +						isFile=false;
  115.85 +					}
  115.86 +					break;
  115.87 +				} 
  115.88 +				itopt++;
  115.89 +			}
  115.90 +			if (isFile)
  115.91 +			{
  115.92 +				cout << "Error: Unknown argument "<<*itarg<<endl;
  115.93 +				return 1;
  115.94 +			}
  115.95 +		} else
  115.96 +			filelist.append (*itarg);
  115.97 +		itarg++;
  115.98 +	}
  115.99 +	return 0;
 115.100 +}
 115.101 +
 115.102 +void Options::add (const QString &n, const OptionType &t=SwitchOption, const QString &s="", const QString &l="")
 115.103 +{
 115.104 +	Option o;
 115.105 +	o.set (n,t,s,l);
 115.106 +	optlist.append (o);
 115.107 +}
 115.108 +
 115.109 +void Options::setHelpText (const QString &s)
 115.110 +{
 115.111 +	helptext=s;
 115.112 +}
 115.113 +	
 115.114 +QString Options::getHelpText ()
 115.115 +{
 115.116 +	return helptext;
 115.117 +}
 115.118 +
 115.119 +QString Options::getProgramName()
 115.120 +{
 115.121 +	return progname;
 115.122 +}
 115.123 +
 115.124 +QStringList Options::getFileList ()
 115.125 +{
 115.126 +	return filelist;
 115.127 +}
 115.128 +
 115.129 +bool Options::isOn(const QString &s)
 115.130 +{
 115.131 +	OptionList::iterator it;
 115.132 +	for ( it = optlist.begin(); it != optlist.end(); ++it )
 115.133 +		if ((*it).getName()==s && (*it).isActive() )
 115.134 +			return true;
 115.135 +	return false;
 115.136 +}
 115.137 +
 115.138 +QString Options::getArg(const QString &s)
 115.139 +{
 115.140 +	OptionList::iterator it;
 115.141 +	for ( it = optlist.begin(); it != optlist.end(); ++it )
 115.142 +	{
 115.143 +		if ((*it).getName()==s)
 115.144 +			return (*it).getArg();
 115.145 +	}	
 115.146 +	return "";
 115.147 +}
   116.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   116.2 +++ b/options.h	Sun Jan 30 12:59:10 2005 +0000
   116.3 @@ -0,0 +1,55 @@
   116.4 +#ifndef OPTIONS_H
   116.5 +#define OPTIONS_H
   116.6 +
   116.7 +#include <qstring.h>
   116.8 +#include <qstringlist.h>
   116.9 +
  116.10 +enum OptionType  {SwitchOption,StringOption};
  116.11 +
  116.12 +class Option
  116.13 +{
  116.14 +public:
  116.15 +	Option();
  116.16 +	void set (const QString &, const OptionType &, const QString &, const QString &);
  116.17 +	QString getName();
  116.18 +	QString getShort();
  116.19 +	QString getLong();
  116.20 +	OptionType getType();
  116.21 +	void setArg(const QString &);
  116.22 +	QString getArg();
  116.23 +	void setActive();
  116.24 +	bool isActive();
  116.25 +private:
  116.26 +	QString name;
  116.27 +	OptionType type;
  116.28 +	QString sName;
  116.29 +	QString lName;
  116.30 +	QString sarg;
  116.31 +	bool active;
  116.32 +};
  116.33 +
  116.34 +
  116.35 +
  116.36 +typedef QValueList <Option> OptionList;
  116.37 +
  116.38 +class Options
  116.39 +{
  116.40 +public:
  116.41 +	Options();
  116.42 +	int parse();
  116.43 +	void add (const QString &,const OptionType &, const QString &, const QString&);
  116.44 +	void setHelpText(const QString&);
  116.45 +	QString getHelpText();
  116.46 +	QString getProgramName();
  116.47 +	QStringList getFileList();
  116.48 +	bool isOn (const QString &);
  116.49 +	QString getArg (const QString &);
  116.50 +
  116.51 +private:
  116.52 +	QString progname;
  116.53 +	QString helptext;
  116.54 +	QStringList filelist;
  116.55 +    OptionList optlist;
  116.56 +};
  116.57 +
  116.58 +#endif
   117.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   117.2 +++ b/ornamentedobj.cpp	Sun Jan 30 12:59:10 2005 +0000
   117.3 @@ -0,0 +1,211 @@
   117.4 +#include "ornamentedobj.h"
   117.5 +#include "texteditor.h"
   117.6 +#include "mapeditor.h"
   117.7 +#include "linkablemapobj.h"
   117.8 +
   117.9 +extern TextEditor *textEditor;
  117.10 +extern FlagRowObj *systemFlagsDefault;
  117.11 +extern FlagRowObj *standardFlagsDefault;
  117.12 +
  117.13 +
  117.14 +/////////////////////////////////////////////////////////////////
  117.15 +// OrnamentedObj
  117.16 +/////////////////////////////////////////////////////////////////
  117.17 +
  117.18 +OrnamentedObj::OrnamentedObj():LinkableMapObj()
  117.19 +{
  117.20 +  //  cout << "Const OrnamentedObj ()\n";
  117.21 +    init ();
  117.22 +}
  117.23 +
  117.24 +OrnamentedObj::OrnamentedObj(QCanvas* c) :LinkableMapObj(c)
  117.25 +{
  117.26 +//    cout << "Const OrnamentedObj\n";
  117.27 +    init ();
  117.28 +}
  117.29 +
  117.30 +OrnamentedObj::OrnamentedObj (OrnamentedObj* lmo) : LinkableMapObj (lmo->canvas)
  117.31 +{
  117.32 +    copy (lmo);
  117.33 +}
  117.34 +
  117.35 +OrnamentedObj::~OrnamentedObj()
  117.36 +{
  117.37 +    delete (heading);
  117.38 +	delete (systemFlags);
  117.39 +	delete (standardFlags);
  117.40 +
  117.41 +}
  117.42 +
  117.43 +
  117.44 +void OrnamentedObj::init ()
  117.45 +{
  117.46 +	heading = new HeadingObj(canvas);
  117.47 +	heading->move (absPos.x(), absPos.y());
  117.48 +
  117.49 +	note.setNote("");
  117.50 +	note.setFontHint (textEditor->getFontHintDefault() );
  117.51 +
  117.52 +	systemFlags=new FlagRowObj(canvas);
  117.53 +	systemFlags->clone(systemFlagsDefault);
  117.54 +	systemFlags->setName ("systemFlags");
  117.55 +	
  117.56 +	standardFlags=new FlagRowObj(canvas);
  117.57 +	standardFlags->clone(standardFlagsDefault);
  117.58 +	standardFlags->setName ("standardFlags");
  117.59 +
  117.60 +
  117.61 +
  117.62 +}
  117.63 +
  117.64 +void OrnamentedObj::copy (OrnamentedObj* other)
  117.65 +{
  117.66 +    LinkableMapObj::copy(other);
  117.67 +	heading->copy(other->heading);
  117.68 +    setColor   (other->heading->getColor(),false);	
  117.69 +
  117.70 +	note.copy (other->note);
  117.71 +	systemFlags->copy (other->systemFlags);
  117.72 +	standardFlags->copy (other->standardFlags);
  117.73 +
  117.74 +}
  117.75 +
  117.76 +QString OrnamentedObj::getHeading()
  117.77 +{
  117.78 +    return heading->text();
  117.79 +}
  117.80 +
  117.81 +void OrnamentedObj::setLinkColor()
  117.82 +{
  117.83 +	if (mapEditor->getLinkColorHint()==HeadingColor)
  117.84 +		LinkableMapObj::setLinkColor (heading->getColor());
  117.85 +	else	
  117.86 +		LinkableMapObj::setLinkColor (mapEditor->getDefLinkColor());
  117.87 +}
  117.88 +
  117.89 +QColor OrnamentedObj::getColor ()
  117.90 +{
  117.91 +    return heading->getColor();
  117.92 +}
  117.93 +
  117.94 +
  117.95 +void OrnamentedObj::move (double x, double y)
  117.96 +{
  117.97 +	MapObj::move (x,y);
  117.98 +	double dx=frame->getBorder()/2;  // care for border around object
  117.99 +	double dy=frame->getBorder()/2;
 117.100 +	systemFlags-> move (x + dx, y + dy);
 117.101 +
 117.102 +	// vertical align heading to bottom
 117.103 +	int h=max (systemFlags->getBBox().height(), standardFlags->getBBox().height());
 117.104 +	h=max (h,heading->getHeight());
 117.105 +    heading->move (x + dx + systemFlags->getBBox().width(),
 117.106 +					y + dy  + h - heading->getHeight() 
 117.107 +					);
 117.108 +	standardFlags->move (x + heading->getWidth() + systemFlags->getBBox().width(), y + dy );				
 117.109 +
 117.110 +	updateLink();
 117.111 +	requestReposition();
 117.112 +}
 117.113 +
 117.114 +void OrnamentedObj::move (QPoint p)
 117.115 +{
 117.116 +	move (p.x(), p.y());
 117.117 +}	
 117.118 +
 117.119 +void OrnamentedObj::moveBy (double x, double y)
 117.120 +{
 117.121 +
 117.122 +	MapObj::moveBy (x,y);
 117.123 +    frame->moveBy (x,y);
 117.124 +    systemFlags->moveBy (x,y);
 117.125 +    standardFlags->moveBy (x,y);
 117.126 +    heading->moveBy (x,y);
 117.127 +	updateLink();
 117.128 +	requestReposition();
 117.129 +}
 117.130 +
 117.131 +void OrnamentedObj::moveBy (QPoint p)
 117.132 +{
 117.133 +	moveBy (p.x(), p.y());
 117.134 +}	
 117.135 +
 117.136 +void OrnamentedObj::move2RelPos(double x, double y)
 117.137 +{
 117.138 +	if (!parObj) return;
 117.139 +	move (parObj->getChildPos().x()+x, parObj->getChildPos().y()+y);
 117.140 +}
 117.141 +
 117.142 +void OrnamentedObj::move2RelPos(QPoint p)
 117.143 +{
 117.144 +	if (!parObj) return;
 117.145 +	move (parObj->getChildPos().x() + p.x(), parObj->getChildPos().y() + p.y() );
 117.146 +}
 117.147 +
 117.148 +void OrnamentedObj::setNote(QString s)
 117.149 +{
 117.150 +	note.setNote(s);
 117.151 +	if (!note.isEmpty())
 117.152 +		systemFlags->activate("note");
 117.153 +	else		
 117.154 +		systemFlags->deactivate("note");
 117.155 +	calcBBoxSize();
 117.156 +	positionBBox();	
 117.157 +	move (absPos.x(), absPos.y() );
 117.158 +	forceReposition();
 117.159 +}
 117.160 +
 117.161 +void OrnamentedObj::setNote(NoteObj n)
 117.162 +{
 117.163 +	note=n;
 117.164 +	if (!note.isEmpty())
 117.165 +		systemFlags->activate("note");
 117.166 +	else		
 117.167 +		systemFlags->deactivate("note");
 117.168 +	calcBBoxSize();
 117.169 +	positionBBox();	
 117.170 +	move (absPos.x(), absPos.y() );
 117.171 +	forceReposition();
 117.172 +	
 117.173 +}
 117.174 +
 117.175 +QString OrnamentedObj::getNote()
 117.176 +{
 117.177 +    return note.getNote();
 117.178 +}
 117.179 +
 117.180 +void OrnamentedObj::toggleStandardFlag(QString f)
 117.181 +{
 117.182 +	standardFlags->toggle(f);
 117.183 +	calcBBoxSize();
 117.184 +	positionBBox();
 117.185 +	move (absPos.x(), absPos.y() );
 117.186 +	forceReposition();
 117.187 +}
 117.188 +
 117.189 +void OrnamentedObj::activateStandardFlag(QString f)
 117.190 +{
 117.191 +	standardFlags->activate(f);
 117.192 +	calcBBoxSize();
 117.193 +	positionBBox();
 117.194 +	move (absPos.x(), absPos.y() );
 117.195 +	forceReposition();
 117.196 +}
 117.197 +
 117.198 +QString OrnamentedObj::getSystemFlagName(const QPoint &p)
 117.199 +{
 117.200 +	return systemFlags->getFlagName(p);	
 117.201 +}
 117.202 +
 117.203 +void OrnamentedObj::updateNoteFlag()
 117.204 +{
 117.205 +	// text in NoteEditor has changed, notify MapEditor 
 117.206 +	mapEditor->setChanged();
 117.207 +
 117.208 +	// save text
 117.209 +	setNote( textEditor->getText() );
 117.210 +	
 117.211 +	// save font   
 117.212 +	note.setFontHint (textEditor->getFontHint() );
 117.213 +}
 117.214 +
   118.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   118.2 +++ b/ornamentedobj.h	Sun Jan 30 12:59:10 2005 +0000
   118.3 @@ -0,0 +1,47 @@
   118.4 +#ifndef ORNAMENTEDOBJ_H
   118.5 +#define ORNAMENTEDOBJ_H
   118.6 +
   118.7 +#include "linkablemapobj.h"
   118.8 +
   118.9 +class OrnamentedObj:public LinkableMapObj {
  118.10 +	Q_OBJECT
  118.11 +public:	
  118.12 +    OrnamentedObj ();
  118.13 +    OrnamentedObj (QCanvas*);
  118.14 +    OrnamentedObj (OrnamentedObj*);
  118.15 +    ~OrnamentedObj ();
  118.16 +    virtual void init ();
  118.17 +    virtual void copy (OrnamentedObj*);
  118.18 +
  118.19 +    virtual void setHeading (QString s)=0;  // set the heading, pure virtual 
  118.20 +											// to take care of fontsize
  118.21 +    virtual QString getHeading();			// returns the heading	
  118.22 +	virtual void setLinkColor();			// sets color according to colorhint, overloaded
  118.23 +    virtual void setVisibility(bool,int)=0;	// set visibility
  118.24 +    virtual void setVisibility(bool)=0;	    // set vis. for w
  118.25 +	virtual void setColor(QColor,bool)=0;		// set the color of text and link
  118.26 +	QColor getColor ();						// get color of heading
  118.27 +    virtual void move   (double,double);
  118.28 +    virtual void move   (QPoint);
  118.29 +    virtual void moveBy (double,double);
  118.30 +    virtual void moveBy (QPoint);
  118.31 +    virtual void move2RelPos (QPoint);		// move relativly to parent^
  118.32 +    virtual void move2RelPos (double,double);
  118.33 +    virtual void setNote(QString);			// set note
  118.34 +    virtual void setNote(NoteObj);			// set note
  118.35 +    virtual QString getNote();				// returns note	
  118.36 +	virtual void toggleStandardFlag(QString);
  118.37 +	virtual void activateStandardFlag(QString);
  118.38 +	virtual QString getSystemFlagName (const QPoint &p);
  118.39 +
  118.40 +public slots:
  118.41 +	void updateNoteFlag();
  118.42 +
  118.43 +protected:
  118.44 +    HeadingObj *heading;			// Heading
  118.45 +	NoteObj note;					// Notes
  118.46 +	FlagRowObj *systemFlags;		// System Flags
  118.47 +	FlagRowObj *standardFlags;		// Standard Flags
  118.48 +};
  118.49 +
  118.50 +#endif
   119.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   119.2 +++ b/process.cpp	Sun Jan 30 12:59:10 2005 +0000
   119.3 @@ -0,0 +1,51 @@
   119.4 +#include "process.h"
   119.5 +
   119.6 +/////////////////////////////////////////////////////////////////
   119.7 +// Process
   119.8 +/////////////////////////////////////////////////////////////////
   119.9 +Process::Process()
  119.10 +{
  119.11 +	connect( this, SIGNAL(readyReadStderr()),
  119.12 +			 this, SLOT(readProcErrout()) );
  119.13 +	connect( this, SIGNAL(readyReadStdout()),
  119.14 +			 this, SLOT(readProcStdout()) );
  119.15 +	clear();		 
  119.16 +}
  119.17 +
  119.18 +Process::~Process()
  119.19 +{
  119.20 +}
  119.21 +
  119.22 +void Process::clear()
  119.23 +{
  119.24 +	errOut="";
  119.25 +	stdOut="";
  119.26 +}
  119.27 +
  119.28 +void Process::waitFinished()
  119.29 +{
  119.30 +	while (isRunning())
  119.31 +	{
  119.32 +	// FIXME use some kind of sleep here...
  119.33 +	}
  119.34 +}
  119.35 +
  119.36 +void Process::readProcErrout()
  119.37 +{
  119.38 +	errOut+=readStderr();
  119.39 +}
  119.40 +
  119.41 +void Process::readProcStdout()
  119.42 +{
  119.43 +	stdOut+=readStdout();
  119.44 +}
  119.45 +
  119.46 +QString Process::getErrout()
  119.47 +{
  119.48 +	return errOut;
  119.49 +}
  119.50 +
  119.51 +QString Process::getStdout()
  119.52 +{
  119.53 +	return stdOut;
  119.54 +}
   120.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   120.2 +++ b/process.h	Sun Jan 30 12:59:10 2005 +0000
   120.3 @@ -0,0 +1,31 @@
   120.4 +#ifndef PROCESS_H
   120.5 +#define PROCESS_H
   120.6 +
   120.7 +#include <qprocess.h>
   120.8 +#include <qstring.h>
   120.9 +
  120.10 +
  120.11 +using namespace std;
  120.12 +
  120.13 +class Process:public QProcess
  120.14 +{
  120.15 +	Q_OBJECT
  120.16 +public:
  120.17 +    Process ();
  120.18 +	~Process ();
  120.19 +	void clear();
  120.20 +	void waitFinished();
  120.21 +	QString getErrout();
  120.22 +	QString getStdout();
  120.23 +	
  120.24 +
  120.25 +public slots:
  120.26 +	virtual void readProcErrout();
  120.27 +	virtual void readProcStdout();
  120.28 +
  120.29 +private:
  120.30 +	QString errOut;
  120.31 +	QString stdOut;
  120.32 +};
  120.33 +
  120.34 +#endif
   121.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   121.2 +++ b/scripts/exportvym	Sun Jan 30 12:59:10 2005 +0000
   121.3 @@ -0,0 +1,70 @@
   121.4 +#!/usr/bin/perl
   121.5 +#
   121.6 +# Script to convert vym files to arbitrary formats
   121.7 +# Using xml stylesheets
   121.8 +#
   121.9 +# written by Uwe Drechsel	<vym@insilmaril.de>
  121.10 +#
  121.11 +
  121.12 +my $version="0.1";
  121.13 +my $PARSER="xsltproc";
  121.14 +my $OUTDIR="";
  121.15 +my $INPUTDIR="";
  121.16 +my $XSL="vym2html.xsl";
  121.17 +
  121.18 +
  121.19 +use Getopt::Long;
  121.20 +GetOptions (
  121.21 +    "o=s" => \$opt_outdir,
  121.22 +	"x=s"=> \$opt_xst,
  121.23 +    "h!" => \$opt_usage ) || usage ();
  121.24 +
  121.25 +
  121.26 +
  121.27 +if ($opt_usage) {
  121.28 +    $0 =~ s#.*/##g;
  121.29 +    print <<Helpende;
  121.30 +    
  121.31 +exportvym	written by Uwe Drechsel - Version $version
  121.32 +
  121.33 +usage: $0 [-h] VYMFILE
  121.34 +
  121.35 +...TODO...
  121.36 +
  121.37 +Helpende
  121.38 +}
  121.39 +
  121.40 +
  121.41 +if ($opt_xst) { $XST=$opt_XST; }
  121.42 +if ($opt_outdir) { $OUTDIR="$opt_outdir/"; }
  121.43 +if ($#ARGV <0) 
  121.44 +{
  121.45 +	die "not enough parameters given";
  121.46 +} else
  121.47 +{
  121.48 +	# get MAPNAME
  121.49 +	$MAPNAME=pop(@ARGV);
  121.50 +	if ($MAPNAME=~/\//) 
  121.51 +	{
  121.52 +		# Get inputdir from path
  121.53 +		$MAPNAME=~/(.*\/)(.*)/;
  121.54 +		$INPUTDIR=$1;	
  121.55 +		$MAPNAME=$2;	
  121.56 +	}
  121.57 +	if ($MAPNAME=~/(.*)(\.xml)/) { $MAPNAME=$1;}
  121.58 +}
  121.59 +
  121.60 +transform();
  121.61 +
  121.62 +exit;
  121.63 +
  121.64 +########################################################
  121.65 +sub transform {
  121.66 +########################################################
  121.67 +	my $command="$PARSER -o $OUTDIR$MAPNAME.html $XSL $INPUTDIR$MAPNAME.xml"; 
  121.68 +	print "$command\n";
  121.69 +	system ($command);
  121.70 +}
  121.71 +	
  121.72 +
  121.73 +
   122.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   122.2 +++ b/scripts/vym2html.sh	Sun Jan 30 12:59:10 2005 +0000
   122.3 @@ -0,0 +1,250 @@
   122.4 +#!/bin/sh
   122.5 +#
   122.6 +# vym2html.sh
   122.7 +#
   122.8 +VERSION="0.7"
   122.9 +# Date: 20040625
  122.10 +# Author: Clemens Kraus (http://www.clemens-kraus.de)
  122.11 +#
  122.12 +# AddOns: Uwe Drechsel
  122.13 +#echo $@
  122.14 +
  122.15 +
  122.16 +unpacker()
  122.17 +# Unpack vym-file, only if it is one
  122.18 +{
  122.19 +  echo $VYMFILE_EXT | grep -F ".vym" 1>/dev/null
  122.20 +
  122.21 +  if [ $? = 0 ] ; then
  122.22 +	  echo ">> Unpacking files ..."
  122.23 +	  unzip $VYMFILE_EXT -d $VYMPATH 1>/dev/null
  122.24 +	  if [ $? -gt 0 ] ; then
  122.25 +		echo ">>> Error in unzip! Aborting."
  122.26 +	  	exit 4
  122.27 +	  fi
  122.28 +  fi
  122.29 +}
  122.30 +
  122.31 +
  122.32 +transform()
  122.33 +{
  122.34 +  # copy stylesheet
  122.35 +  if [ -z $STYLESHEETP ] ; then
  122.36 +	  echo ">>> Error: could not process stylesheet "$STYLESHEETP"! Aborting."
  122.37 +	  exit 5
  122.38 +  else
  122.39 +	  if [ -n $VYMPATH ] ; then
  122.40 +		  if [ -n "$WIKISTYLEP" ] ; then
  122.41 +		    mkdir -p $VYMPATH/images
  122.42 +			cp `dirname $STYLESHEETP`/wiki/* $VYMPATH/images
  122.43 +			if [ $? -gt 0 ] ; then
  122.44 +				echo ">>> Warning: could not copy images for WIKI style
  122.45 +				\""$STYLESHEETP"/wiki/*\"!"
  122.46 +			else
  122.47 +			  echo ">> WIKI style images \""$STYLESHEETP"/wiki/*\" copied ..."
  122.48 +			fi  
  122.49 +		  fi
  122.50 +	  	cp `dirname $STYLESHEETP`/$CSSFILE $VYMPATH
  122.51 +		if [ $? -gt 0 ] ; then
  122.52 +			echo ">>> Warning: could not copy CSS-file \""$CSSFILE"\"!"
  122.53 +		else
  122.54 +		  echo ">> CSS-file \""$CSSFILE"\" copied ..."
  122.55 +		fi
  122.56 +	  fi
  122.57 +  fi
  122.58 +  
  122.59 +  echo ">> Starting XSLT transformation ..."
  122.60 +
  122.61 +  OPTIONS=" -o $VYMFILE.html \
  122.62 +  --stringparam filenamep \"$VYMFILE\" \
  122.63 +  --stringparam wikistylep \"$WIKISTYLEP\" \
  122.64 +  --stringparam genimagep \"$GENIMAGEP\" \
  122.65 +  --stringparam imageonlyp \"$IMAGEONLYP\" \
  122.66 +  --stringparam urlHeadingp \"$URLHEADING\" \
  122.67 +  --stringparam urlImagep \"$URLIMG\" \
  122.68 +  --stringparam stylesheetp $CSSFILE  \
  122.69 +  `dirname $STYLESHEETP`/vym2html.xsl \
  122.70 +  $VYMFILE.xml "
  122.71 +  
  122.72 +  
  122.73 +# echo Executing: xsltproc $OPTIONS 2>&1
  122.74 +#  xsltproc $OPTIONS 2>&1
  122.75 +
  122.76 +xsltproc -o $VYMPATH/$VYMNAME".html" --stringparam filenamep "$VYMPATH/$VYMNAME" --stringparam wikistylep "$WIKISTYLEP" --stringparam genimagep "$GENIMAGEP" --stringparam imageonlyp "$IMAGEONLYP" --stringparam urlHeadingp "$URLHEADING" --stringparam urlImagep "$URLIMAGE" --stringparam stylesheetp "$CSSFILE"  `dirname $STYLESHEETP`/vym2html.xsl  $VYMPATH/$VYMNAME".xml" 2>&1
  122.77 +
  122.78 +  if [ $? -gt 0 ] ; then
  122.79 +	  echo ">>> Error in xsltproc! Aborting."
  122.80 +	  exit 3
  122.81 +  fi
  122.82 +  
  122.83 +}
  122.84 +
  122.85 +
  122.86 +txt2html()
  122.87 +# change all txt-files into xml-format
  122.88 +{
  122.89 +  for i in `ls $VYMPATH/notes/$VYMNAME-note-*.txt 2>/dev/null`
  122.90 +  do
  122.91 +    # Check whether already modified
  122.92 +	grep "<note>" $i 1>/dev/null
  122.93 +	
  122.94 +	if [ $? -gt 0 ] ; then
  122.95 +	  echo ">> Modifying: "$i
  122.96 +	  cp $i $i"_tmp"
  122.97 +	  echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > $i
  122.98 +	  echo "<note>" >> $i
  122.99 +	  if [ -z "$WIKISTYLEP" ] ; then
 122.100 +		  echo "<![CDATA[" >> $i
 122.101 +	  fi
 122.102 +	  
 122.103 +	  cat $i"_tmp" >> $i
 122.104 +  
 122.105 +	  if [ -z "$WIKISTYLEP" ] ; then
 122.106 +		  echo "]]>" >> $i
 122.107 +	  fi
 122.108 +	  echo "</note>" >> $i
 122.109 +  
 122.110 +	  rm $i"_tmp"
 122.111 +	fi
 122.112 +  done
 122.113 +}
 122.114 +
 122.115 +
 122.116 +remove_files()
 122.117 +# remove all temporary unpacked vym-files
 122.118 +{
 122.119 +  echo $VYMFILE_EXT | grep -F ".vym" 1>/dev/null
 122.120 +	
 122.121 +  if [ $? = 0 ] ; then
 122.122 +	echo ">> Removing temporary files ..."
 122.123 +	for i in `ls $VYMPATH/notes/$VYMNAME-note-*.txt 2>/dev/null`
 122.124 +	do
 122.125 +	  rm $i
 122.126 +	done
 122.127 +  
 122.128 +	for i in `ls $VYMPATH/images/$VYMNAME-image-*.* 2>/dev/null`
 122.129 +	do
 122.130 +	  rm $i
 122.131 +	done
 122.132 +  
 122.133 +	rm $VYMPATH/$VYMFILE".xml" 2>/dev/null
 122.134 +  fi
 122.135 +}
 122.136 +
 122.137 +
 122.138 +reducesize()
 122.139 +{
 122.140 +  # optional: reducing image-size
 122.141 +  echo ">> reducing image size to 256 colors ..."
 122.142 +  convert -colors 255 $VYMPATH/images/$VYMFILE".png" $VYMPATH/images/$VYMFILE".png"
 122.143 +}
 122.144 +
 122.145 +
 122.146 +# -------------------- Parameter check -----------------------
 122.147 +GENIMAGEP=""
 122.148 +IMAGEONLYP=""
 122.149 +WIKISTYLEP=""
 122.150 +STYLESHEETP=""
 122.151 +CSSFILE="vym.css"
 122.152 +
 122.153 +USAGE="USAGE:\t`basename $0`  vymfile.[vym|xml]  -sp=\077  [Options]\n
 122.154 +\t-sp=\077: absolute stylesheet path (including name of stylesheet)\n
 122.155 +Output:\tvymfile.html\n\n
 122.156 +Options:\n
 122.157 +-image: creates a clickable image at the beginning of the HTML-output\n
 122.158 +-imageonly: creates a clickable image without further HTML-output\n
 122.159 +-URLHeading: if set, URLs will show the heading\n
 122.160 +-URLImage: if set, URLs will show the globe visible in the map\n
 122.161 +-css=\077: tell vym2html to use this CSS-file, default is '$CSSFILE'\n
 122.162 +-v: prints the version of vym2html\n
 122.163 +-wikistyle: activates some wiki-shortcuts\n
 122.164 +\tWiki-style notation overview: \n
 122.165 +\tLines:\n
 122.166 +\t+ Big headlines start with the '+' character.\n
 122.167 +\t- Small headlines start with the '-' character.\n
 122.168 +\t  Normal text doesn't have any starting notation.\n
 122.169 +\t! Notes start with an exclamation.\n
 122.170 +\t. Indented text starts with a dot.\n
 122.171 +\t\077 Questions start with a question-mark, and\n
 122.172 +\t= Answers starts with the equal-sign.\n
 122.173 +\t\052 Points for a item-list\n
 122.174 +\t# clues\n
 122.175 +\n
 122.176 +\tLinks:\n
 122.177 +\tuse '{...}' or '{(Clemens homepage) http://www.clemens-kraus.de/}'\n\tfor external links.\n
 122.178 +\n
 122.179 +\tMarkup:\n
 122.180 +\t|This is bold| text, while |/this text is italic|, \n\t|*this is pre-formatted|, and |!this is a note|"
 122.181 +
 122.182 +if [ "$1" = '-v' ]; then
 122.183 +	  echo "vym2html Version: "$VERSION
 122.184 +	  exit 0
 122.185 +fi
 122.186 +
 122.187 +
 122.188 +if [ $# -lt 2  ]; then 
 122.189 +	echo -e $USAGE
 122.190 +	exit 1
 122.191 +else
 122.192 +	VYMFILE_EXT=$1
 122.193 +	VYMNAME=`echo $VYMFILE_EXT | sed "s/.*\///" | sed "s/\\..*$//"`
 122.194 +	VYMPATH=`dirname $VYMFILE_EXT`
 122.195 +fi
 122.196 +
 122.197 +shift 1
 122.198 +
 122.199 +for arg do
 122.200 +  if [ "$arg" = '-wikistyle' ]; then
 122.201 +	  WIKISTYLEP="yes"
 122.202 +  elif [ "$arg" = '-image' ]; then
 122.203 +	  GENIMAGEP="yes"
 122.204 +  elif [ "$arg" = '-imageonly' ]; then
 122.205 +	  IMAGEONLYP="yes"
 122.206 +	  GENIMAGEP="yes"
 122.207 +  elif [ ${arg:0:3} = '-sp' ]; then			# take first 3 chars
 122.208 +	  STYLESHEETP=`echo $arg | cut -d= -f2`
 122.209 +  elif [ ${arg:0:4} = '-css' ]; then		# take first 4 chars
 122.210 +	  CSSFILE=`echo $arg | cut -d= -f2`
 122.211 +  elif [ $arg = "-useURLHeading" ]; then
 122.212 +		URLHEADING="yes"		
 122.213 +  elif [ $arg = "-useURLImage" ]; then
 122.214 +		URLIMAGE="yes"		
 122.215 +  elif [ "$arg" = '-help' ]; then
 122.216 +	echo -e $USAGE
 122.217 +	exit 1
 122.218 +  else
 122.219 +	echo -e $USAGE
 122.220 +	exit 1
 122.221 +  fi
 122.222 +done
 122.223 +
 122.224 +#Debugging
 122.225 +echo VYMFILE_EXT=$VYMFILE_EXT
 122.226 +echo VYMNAME=$VYMNAME
 122.227 +echo VYMPATH=$VYMPATH
 122.228 +#echo WIKISTYLEP=$WIKISTYLEP
 122.229 +
 122.230 +
 122.231 +# ---------------------- Los geht's --------------------------
 122.232 +echo ">> Processing file '$VYMFILE_EXT' ..."
 122.233 +
 122.234 +# Unpack vym-file
 122.235 +unpacker
 122.236 +
 122.237 +# Modify "*-note-x.txt" files
 122.238 +txt2html
 122.239 +
 122.240 +# Transform
 122.241 +transform
 122.242 +
 122.243 +#reducesize
 122.244 +
 122.245 +# clean up
 122.246 +remove_files
 122.247 +
 122.248 +echo ">> Ready!"
 122.249 +echo ">> ---------------------"
 122.250 +
 122.251 +exit 0
 122.252 +
 122.253 +
   123.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   123.2 +++ b/scripts/vym2txt.sh	Sun Jan 30 12:59:10 2005 +0000
   123.3 @@ -0,0 +1,144 @@
   123.4 +#!/bin/sh
   123.5 +#
   123.6 +# vym2txt.sh
   123.7 +#
   123.8 +VERSION="0.11"
   123.9 +# Date: 20040417
  123.10 +# Author: Clemens Kraus (http://www.clemens-kraus.de)
  123.11 +#
  123.12 +#echo $@
  123.13 +
  123.14 +
  123.15 +unpacker()
  123.16 +# Unpack vym-file, only if it is one
  123.17 +{
  123.18 +  echo $VYMFILE_EXT | grep -F ".vym" 1>/dev/null
  123.19 +
  123.20 +  if [ $? = 0 ] ; then
  123.21 +	  echo ">> Unpacking files ..."
  123.22 +	  unzip $VYMFILE_EXT -d $VYMFILE_PATH 1>/dev/null
  123.23 +	  if [ $? -gt 0 ] ; then
  123.24 +		echo ">>> Error in unzip! Aborting."
  123.25 +	  	exit 4
  123.26 +	  fi
  123.27 +  fi
  123.28 +}
  123.29 +
  123.30 +
  123.31 +txt2xml()
  123.32 +# change all txt-files into xml-format
  123.33 +{
  123.34 +  for i in `ls $VYMFILE-note-*.txt 2>/dev/null`
  123.35 +  do
  123.36 +    # Check whether already modified
  123.37 +	grep "<note>" $i 1>/dev/null
  123.38 +	
  123.39 +	if [ $? -gt 0 ] ; then
  123.40 +	  echo ">> Modifying: "$i
  123.41 +	  # Each line gets an additional <line>-tag, because of the indents!
  123.42 +	  sed -e 's,^,<line><![CDATA[,g' -e 's,$,]]>\&#xA;</line>,g' $i > $i"_tmp"
  123.43 +	  
  123.44 +	  #cp $i $i"_tmp"
  123.45 +	  echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>" > $i
  123.46 +	  echo "<note>" >> $i
  123.47 +	  #echo "<![CDATA[" >> $i
  123.48 +	  cat $i"_tmp" >> $i
  123.49 +	  #echo "]]>" >> $i
  123.50 +	  echo "</note>" >> $i
  123.51 +  
  123.52 +	  rm $i"_tmp"
  123.53 +	fi
  123.54 +  done
  123.55 +}
  123.56 +
  123.57 +
  123.58 +transform()
  123.59 +{
  123.60 +  echo ">> Starting XSLT transformation ..."
  123.61 +# sabcmd vym2html.xsl $VYMFILE".xml"  \$filenamep=$VYMFILE \$wikistylep=$WIKISTYLEP \$genimagep=$GENIMAGEP \$stylesheetp=$STYLESHEETP > $VYMFILE".html"
  123.62 +  xsltproc -o $VYMFILE".txt" --stringparam filenamep `pwd`/"$VYMFILE" `dirname $STYLESHEETP`/vym2txt.xsl  $VYMFILE".xml"
  123.63 +  
  123.64 +  if [ $? -gt 0 ] ; then
  123.65 +	  echo ">>> Error in xsltproc! Aborting."
  123.66 +	  exit 3
  123.67 +  fi
  123.68 +}
  123.69 +
  123.70 +
  123.71 +remove_files()
  123.72 +# remove all temporary unpacked vym-files
  123.73 +{
  123.74 +  echo $VYMFILE_EXT | grep -F ".vym" 1>/dev/null
  123.75 +	
  123.76 +  if [ $? = 0 ] ; then
  123.77 +	echo ">> Removing temporary files ..."
  123.78 +	for i in `ls $VYMFILE-note-*.txt 2>/dev/null`
  123.79 +	do
  123.80 +	  rm $i
  123.81 +	done
  123.82 +  
  123.83 +	for i in `ls $VYMFILE-image-*.* 2>/dev/null`
  123.84 +	do
  123.85 +	  rm $i
  123.86 +	done
  123.87 +  
  123.88 +	rm $VYMFILE".xml" 2>/dev/null
  123.89 +  fi
  123.90 +}
  123.91 +
  123.92 +# -------------------- Parameter check -----------------------
  123.93 +STYLESHEETP=""
  123.94 +
  123.95 +USAGE="USAGE:\t`basename $0`  vymfile.[vym|xml]  -sp=\077  [Options]\n"
  123.96 +USAGE=$USAGE"\t-sp=\077: absolute stylesheet path (including name of stylesheet)\n"
  123.97 +USAGE=$USAGE"Output:\tvymfile.txt\n\n"
  123.98 +USAGE=$USAGE"Options:\n"
  123.99 +USAGE=$USAGE"-v: prints the version of vym2txt\n"
 123.100 +
 123.101 +if [ "$1" = '-v' ]; then
 123.102 +	  echo "vym2txt Version: "$VERSION
 123.103 +	  exit 0
 123.104 +fi
 123.105 +if [ $# -lt 1 -o $# -gt 2 -o "$1" = '-help' ]; then 
 123.106 +	echo -e $USAGE
 123.107 +	exit 1
 123.108 +else
 123.109 +	VYMFILE_EXT=$1
 123.110 +	VYMFILE=`echo $VYMFILE_EXT | cut -d. -f1`
 123.111 +	VYMFILE_PATH=`dirname $VYMFILE_EXT`
 123.112 +fi
 123.113 +
 123.114 +for arg in $2
 123.115 +do
 123.116 +  if [ ${arg:0:3} = '-sp' ]; then		# take first 3 chars
 123.117 +	  STYLESHEETP=`echo $arg | cut -d= -f2`
 123.118 +  elif [ "$arg" = '-help' ]; then
 123.119 +	echo -e $USAGE
 123.120 +	exit 1
 123.121 +  else
 123.122 +	echo -e $USAGE
 123.123 +	exit 1
 123.124 +  fi
 123.125 +done
 123.126 +
 123.127 +
 123.128 +# ---------------------- Los geht's --------------------------
 123.129 +echo ">> Processing file '$VYMFILE_EXT' ..."
 123.130 +
 123.131 +# Unpack vym-file
 123.132 +unpacker
 123.133 +
 123.134 +txt2xml
 123.135 +
 123.136 +# Transform
 123.137 +transform
 123.138 +
 123.139 +# clean up
 123.140 +remove_files
 123.141 +
 123.142 +echo ">> Ready!"
 123.143 +echo ">> ---------------------"
 123.144 +
 123.145 +exit 0
 123.146 +
 123.147 +
   124.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   124.2 +++ b/selection.cpp	Sun Jan 30 12:59:10 2005 +0000
   124.3 @@ -0,0 +1,47 @@
   124.4 +#include "selection.h"
   124.5 +
   124.6 +
   124.7 +Selection::Selection()
   124.8 +{
   124.9 +}
  124.10 +
  124.11 +Selection::Selection(const Selection &other)
  124.12 +{
  124.13 +}
  124.14 +
  124.15 +Selection::~Selection()
  124.16 +{
  124.17 +}
  124.18 +
  124.19 +void Selection::init()
  124.20 +{
  124.21 +	selectList.setAutoDelete(true);
  124.22 +}
  124.23 +
  124.24 +void Selection::copy(const Selection &other)
  124.25 +{
  124.26 +}
  124.27 +
  124.28 +void Selection::clear()
  124.29 +{
  124.30 +	selectList.clear();
  124.31 +}
  124.32 +
  124.33 +bool Selection::select(LinkableMapObj *lmo)
  124.34 +{
  124.35 +	return false;
  124.36 +}
  124.37 +
  124.38 +void Selection::unselect(LinkableMapObj *lmo)
  124.39 +{
  124.40 +}
  124.41 +
  124.42 +bool Selection::isEmpty()
  124.43 +{
  124.44 +	return selectList.isEmpty();
  124.45 +}
  124.46 +
  124.47 +uint Selection::count()
  124.48 +{
  124.49 +	return selectList.count();
  124.50 +}
   125.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   125.2 +++ b/selection.h	Sun Jan 30 12:59:10 2005 +0000
   125.3 @@ -0,0 +1,26 @@
   125.4 +#ifndef SELECTIONOBJ_H
   125.5 +#define SELECTIONOBJ_H
   125.6 +
   125.7 +#include "linkablemapobj.h"
   125.8 +#include <qptrlist.h>
   125.9 +
  125.10 +class Selection 
  125.11 +{
  125.12 +public:
  125.13 +	Selection ();
  125.14 +	Selection (const Selection&);
  125.15 +	~Selection();
  125.16 +	void init();
  125.17 +	void copy(const Selection&);
  125.18 +	void clear();
  125.19 +	
  125.20 +	bool select (LinkableMapObj*);
  125.21 +	void unselect (LinkableMapObj*);
  125.22 +	bool isEmpty();
  125.23 +	uint count();
  125.24 +
  125.25 +private:
  125.26 +	QPtrList <LinkableMapObj> selectList;
  125.27 +};
  125.28 +#endif
  125.29 +
   126.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   126.2 +++ b/settings.cpp	Sun Jan 30 12:59:10 2005 +0000
   126.3 @@ -0,0 +1,132 @@
   126.4 +#include <iostream>
   126.5 +#include "settings.h"
   126.6 +#include "misc.h"
   126.7 +
   126.8 +using namespace std;
   126.9 +/////////////////////////////////////////////////////////////////
  126.10 +// Settings
  126.11 +/////////////////////////////////////////////////////////////////
  126.12 +Settings::Settings()
  126.13 +{
  126.14 +	clear();		 
  126.15 +}
  126.16 +
  126.17 +Settings::~Settings()
  126.18 +{
  126.19 +}
  126.20 +
  126.21 +void Settings::clear()
  126.22 +{
  126.23 +	pathlist.clear();
  126.24 +	keylist.clear();
  126.25 +	valuelist.clear();
  126.26 +}
  126.27 +
  126.28 +void Settings::clearLocal(const QString &s)
  126.29 +{
  126.30 +	QStringList::Iterator itp=pathlist.begin();
  126.31 +	QStringList::Iterator itk=keylist.begin();
  126.32 +	QStringList::Iterator itv=valuelist.begin();
  126.33 +
  126.34 +	while (itp !=pathlist.end() )
  126.35 +	{
  126.36 +		if ((*itk).startsWith (s))
  126.37 +		{
  126.38 +			itp=pathlist.remove (itp);
  126.39 +			itk=keylist.remove (itk);
  126.40 +			itv=valuelist.remove (itv);
  126.41 +		}	else
  126.42 +		{
  126.43 +			itp++;
  126.44 +			itk++;
  126.45 +			itv++;
  126.46 +		}
  126.47 +	}
  126.48 +}
  126.49 +
  126.50 +QString Settings::readLocalEntry ( const QString &fpath, const QString & key, const QString & def = QString::null ) 
  126.51 +{
  126.52 +	QStringList::Iterator itp=pathlist.begin();
  126.53 +	QStringList::Iterator itk=keylist.begin();
  126.54 +	QStringList::Iterator itv=valuelist.begin();
  126.55 +
  126.56 +	// First search for value in settings saved in map
  126.57 +	while (itp !=pathlist.end() )
  126.58 +	{
  126.59 +		if (*itp == fpath && *itk == key)
  126.60 +			return *itv;
  126.61 +		itp++;
  126.62 +		itk++;
  126.63 +		itv++;
  126.64 +	}
  126.65 +
  126.66 +	// Fall back to global vym settings
  126.67 +	bool ok;
  126.68 +	return readEntry (key,def, &ok);
  126.69 +}	
  126.70 +
  126.71 +void Settings::setLocalEntry (const QString &fpath, const QString &key, const QString &value)
  126.72 +{
  126.73 +	QStringList::Iterator itp=pathlist.begin();
  126.74 +	QStringList::Iterator itk=keylist.begin();
  126.75 +	QStringList::Iterator itv=valuelist.begin();
  126.76 +
  126.77 +	if (!fpath.isEmpty() && !key.isEmpty() && !value.isEmpty() )
  126.78 +	{
  126.79 +		// Search for existing entry first
  126.80 +		while (itp !=pathlist.end() )
  126.81 +		{
  126.82 +			if (*itp == fpath && *itk == key)
  126.83 +			{
  126.84 +				*itv=value;
  126.85 +				return;
  126.86 +			}
  126.87 +			itp++;
  126.88 +			itk++;
  126.89 +			itv++;
  126.90 +		}
  126.91 +		
  126.92 +		// If no entry exists, append a new one
  126.93 +		pathlist.append (fpath);
  126.94 +		keylist.append (key);
  126.95 +		valuelist.append (value);
  126.96 +	}
  126.97 +}
  126.98 +
  126.99 +QString Settings::getXMLData (const QString &fpath)
 126.100 +{
 126.101 +	QString s;
 126.102 +	QStringList::Iterator itp=pathlist.begin();
 126.103 +	QStringList::Iterator itk=keylist.begin();
 126.104 +	QStringList::Iterator itv=valuelist.begin();
 126.105 +
 126.106 +	while (itp !=pathlist.end() )
 126.107 +	{
 126.108 +		if (*itp == fpath )
 126.109 +			if (!(*itv).isEmpty())
 126.110 +				s+=singleElement (
 126.111 +					"setting",
 126.112 +					attribut ("key",*itk) 
 126.113 +					+attribut ("value",*itv)
 126.114 +				)+"\n";
 126.115 +		itp++;
 126.116 +		itk++;
 126.117 +		itv++;
 126.118 +	}
 126.119 +	return s;
 126.120 +}
 126.121 +
 126.122 +void Settings::write()
 126.123 +{
 126.124 +	QStringList::Iterator itp=pathlist.begin();
 126.125 +	QStringList::Iterator itk=keylist.begin();
 126.126 +	QStringList::Iterator itv=valuelist.begin();
 126.127 +
 126.128 +	while (itp !=pathlist.end() )
 126.129 +	{
 126.130 +		itp++;
 126.131 +		itk++;
 126.132 +		itv++;
 126.133 +	}
 126.134 +}
 126.135 +
   127.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   127.2 +++ b/settings.h	Sun Jan 30 12:59:10 2005 +0000
   127.3 @@ -0,0 +1,29 @@
   127.4 +#ifndef SETTINGS_H
   127.5 +#define SETTINGS_H
   127.6 +
   127.7 +#include <qsettings.h>
   127.8 +#include <qstring.h>
   127.9 +#include <qstringlist.h>
  127.10 +
  127.11 +#include "misc.h"
  127.12 +
  127.13 +
  127.14 +class Settings:public QSettings,public xmlObj
  127.15 +{
  127.16 +public:
  127.17 +    Settings ();
  127.18 +	~Settings ();
  127.19 +	void clear();
  127.20 +	void clearLocal (const QString &);
  127.21 +	QString readLocalEntry ( const QString &, const QString &, const QString &);
  127.22 +	void setLocalEntry (const QString &, const QString &, const QString &);
  127.23 +	QString getXMLData (const QString &);
  127.24 +	void write ();
  127.25 +
  127.26 +protected:
  127.27 +	QStringList pathlist;
  127.28 +	QStringList keylist;
  127.29 +	QStringList valuelist;
  127.30 +};
  127.31 +
  127.32 +#endif
   128.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   128.2 +++ b/showtextdialog.ui	Sun Jan 30 12:59:10 2005 +0000
   128.3 @@ -0,0 +1,135 @@
   128.4 +<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
   128.5 +<class>ShowTextDialog</class>
   128.6 +<author>Uwe Drechsel</author>
   128.7 +<widget class="QDialog">
   128.8 +    <property name="name">
   128.9 +        <cstring>ShowTextDialog</cstring>
  128.10 +    </property>
  128.11 +    <property name="enabled">
  128.12 +        <bool>true</bool>
  128.13 +    </property>
  128.14 +    <property name="geometry">
  128.15 +        <rect>
  128.16 +            <x>0</x>
  128.17 +            <y>0</y>
  128.18 +            <width>560</width>
  128.19 +            <height>383</height>
  128.20 +        </rect>
  128.21 +    </property>
  128.22 +    <property name="sizePolicy">
  128.23 +        <sizepolicy>
  128.24 +            <hsizetype>5</hsizetype>
  128.25 +            <vsizetype>5</vsizetype>
  128.26 +            <horstretch>0</horstretch>
  128.27 +            <verstretch>0</verstretch>
  128.28 +        </sizepolicy>
  128.29 +    </property>
  128.30 +    <property name="backgroundOrigin">
  128.31 +        <enum>WidgetOrigin</enum>
  128.32 +    </property>
  128.33 +    <property name="caption">
  128.34 +        <string>VYM - Info</string>
  128.35 +    </property>
  128.36 +    <property name="sizeGripEnabled">
  128.37 +        <bool>false</bool>
  128.38 +    </property>
  128.39 +    <vbox>
  128.40 +        <property name="name">
  128.41 +            <cstring>unnamed</cstring>
  128.42 +        </property>
  128.43 +        <widget class="QLayoutWidget">
  128.44 +            <property name="name">
  128.45 +                <cstring>layout9</cstring>
  128.46 +            </property>
  128.47 +            <vbox>
  128.48 +                <property name="name">
  128.49 +                    <cstring>unnamed</cstring>
  128.50 +                </property>
  128.51 +                <widget class="QTextEdit">
  128.52 +                    <property name="name">
  128.53 +                        <cstring>textEdit1</cstring>
  128.54 +                    </property>
  128.55 +                    <property name="sizePolicy">
  128.56 +                        <sizepolicy>
  128.57 +                            <hsizetype>7</hsizetype>
  128.58 +                            <vsizetype>7</vsizetype>
  128.59 +                            <horstretch>0</horstretch>
  128.60 +                            <verstretch>0</verstretch>
  128.61 +                        </sizepolicy>
  128.62 +                    </property>
  128.63 +                </widget>
  128.64 +                <widget class="QLayoutWidget">
  128.65 +                    <property name="name">
  128.66 +                        <cstring>layout8</cstring>
  128.67 +                    </property>
  128.68 +                    <hbox>
  128.69 +                        <property name="name">
  128.70 +                            <cstring>unnamed</cstring>
  128.71 +                        </property>
  128.72 +                        <spacer>
  128.73 +                            <property name="name">
  128.74 +                                <cstring>spacer4</cstring>
  128.75 +                            </property>
  128.76 +                            <property name="orientation">
  128.77 +                                <enum>Horizontal</enum>
  128.78 +                            </property>
  128.79 +                            <property name="sizeType">
  128.80 +                                <enum>Expanding</enum>
  128.81 +                            </property>
  128.82 +                            <property name="sizeHint">
  128.83 +                                <size>
  128.84 +                                    <width>141</width>
  128.85 +                                    <height>21</height>
  128.86 +                                </size>
  128.87 +                            </property>
  128.88 +                        </spacer>
  128.89 +                        <widget class="QPushButton">
  128.90 +                            <property name="name">
  128.91 +                                <cstring>pushButton4</cstring>
  128.92 +                            </property>
  128.93 +                            <property name="sizePolicy">
  128.94 +                                <sizepolicy>
  128.95 +                                    <hsizetype>7</hsizetype>
  128.96 +                                    <vsizetype>0</vsizetype>
  128.97 +                                    <horstretch>0</horstretch>
  128.98 +                                    <verstretch>0</verstretch>
  128.99 +                                </sizepolicy>
 128.100 +                            </property>
 128.101 +                            <property name="maximumSize">
 128.102 +                                <size>
 128.103 +                                    <width>150</width>
 128.104 +                                    <height>32767</height>
 128.105 +                                </size>
 128.106 +                            </property>
 128.107 +                            <property name="text">
 128.108 +                                <string>Close</string>
 128.109 +                            </property>
 128.110 +                            <property name="default">
 128.111 +                                <bool>true</bool>
 128.112 +                            </property>
 128.113 +                        </widget>
 128.114 +                    </hbox>
 128.115 +                </widget>
 128.116 +            </vbox>
 128.117 +        </widget>
 128.118 +    </vbox>
 128.119 +</widget>
 128.120 +<connections>
 128.121 +    <connection>
 128.122 +        <sender>pushButton4</sender>
 128.123 +        <signal>clicked()</signal>
 128.124 +        <receiver>ShowTextDialog</receiver>
 128.125 +        <slot>accept()</slot>
 128.126 +    </connection>
 128.127 +</connections>
 128.128 +<includes>
 128.129 +    <include location="local" impldecl="in implementation">showtextdialog.ui.h</include>
 128.130 +</includes>
 128.131 +<slots>
 128.132 +    <slot access="private">init()</slot>
 128.133 +    <slot>setText( const QString &amp; t )</slot>
 128.134 +    <slot>append( const QString &amp; t )</slot>
 128.135 +</slots>
 128.136 +<pixmapinproject/>
 128.137 +<layoutdefaults spacing="6" margin="11"/>
 128.138 +</UI>
   129.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   129.2 +++ b/showtextdialog.ui.h	Sun Jan 30 12:59:10 2005 +0000
   129.3 @@ -0,0 +1,18 @@
   129.4 +void ShowTextDialog::init()
   129.5 +{
   129.6 +	textEdit1->setReadOnly (true);
   129.7 +}
   129.8 +
   129.9 +
  129.10 +void ShowTextDialog::setText(const QString &t)
  129.11 +{
  129.12 +	textEdit1->setText (t);
  129.13 +}
  129.14 +
  129.15 +
  129.16 +
  129.17 +
  129.18 +void ShowTextDialog::append( const QString &t )
  129.19 +{
  129.20 +	textEdit1->append (t);
  129.21 +}
   130.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   130.2 +++ b/styles/cm.xsl	Sun Jan 30 12:59:10 2005 +0000
   130.3 @@ -0,0 +1,295 @@
   130.4 +<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
   130.5 +<xsl:stylesheet 
   130.6 +	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
   130.7 +	xmlns:exsl="http://exslt.org/common"
   130.8 +	extension-element-prefixes="exsl" version="1.0">
   130.9 +	
  130.10 +<xsl:variable name="controlCharacter" select="'¤'" />
  130.11 +<xsl:variable name="crlf" select="'&#10;'" />
  130.12 +<!-- <xsl:variable name="wikistyle" select="false()" /> -->
  130.13 +
  130.14 +<xsl:variable name="supportMenu" select="'true'" />
  130.15 +<xsl:variable name="supportShowme" select="'true'" />
  130.16 +<xsl:variable name="supportSource" select="'true'" />
  130.17 +<xsl:variable name="supportImage" select="'true'" />
  130.18 +
  130.19 +<xsl:template name="findNext">
  130.20 +	<xsl:param name="content" />
  130.21 +	<xsl:variable name="escaped" select="substring-after( $content, '\{' )" />
  130.22 +	<xsl:variable name="item-start" select="substring-after( $content, '{' )" />
  130.23 +	<xsl:variable name="item-end" select="substring-before( $item-start, '}' )" />
  130.24 +	<xsl:if test="normalize-space($escaped) != normalize-space($item-start)">
  130.25 +		<xsl:copy-of select="normalize-space($item-end)" />
  130.26 +	</xsl:if>
  130.27 +</xsl:template>
  130.28 +
  130.29 +<xsl:template name="findNextTag">
  130.30 +	<xsl:param name="content" />
  130.31 +	<xsl:variable name="item-start" select="substring-after( $content, '|' )" />
  130.32 +	<xsl:variable name="item-end" select="substring-before( $item-start, '|' )" />
  130.33 +	<xsl:variable name="name-start" select="substring-after( $item-start, '(' )" />
  130.34 +	<xsl:variable name="name-end" select="substring-before( $name-start, ')' )" />
  130.35 +	<!-- <xsl:copy-of select="normalize-space($item-end)" /> -->
  130.36 +	<xsl:variable name="w" select="substring-after( $item-end, ') ')" />
  130.37 +	<xsl:if test="string($w)">
  130.38 +		<xsl:element name="{$w}">
  130.39 +			<xsl:value-of select="$name-end" />
  130.40 +		</xsl:element>
  130.41 +	</xsl:if>
  130.42 +</xsl:template>
  130.43 +
  130.44 +<xsl:template name="lastCall">
  130.45 +	<xsl:param name="content" />
  130.46 +
  130.47 +	<xsl:variable name="inTheBeginning"   select="substring-before( $content, '|' )" />
  130.48 +	<xsl:variable name="markup-start"     select="substring-after( $content, '|' )" />
  130.49 +	<xsl:variable name="markup-end"       select="substring-before( $markup-start, '|' )" />
  130.50 +	<xsl:variable name="markup-after"     select="substring-after( $markup-start, concat( $markup-end, '|') )" />
  130.51 +	
  130.52 +	<xsl:variable name="cmd"              select="substring-before( $markup-end, ';' )" />
  130.53 +	
  130.54 +	<xsl:copy-of select="$inTheBeginning" />
  130.55 +	
  130.56 +	<xsl:choose>
  130.57 +		<xsl:when test="string($markup-end)">
  130.58 +			<xsl:choose>
  130.59 +				<xsl:when test="starts-with( $markup-end, '!' )">
  130.60 +					<span class="note"><xsl:copy-of select="substring-after( $markup-end, '!')" /></span>
  130.61 +				</xsl:when>
  130.62 +				<xsl:when test="starts-with( $markup-end, '/' )">
  130.63 +					<em><xsl:copy-of select="substring-after( $markup-end, '/')" /></em>
  130.64 +				</xsl:when>
  130.65 +				<xsl:when test="starts-with( $markup-end, '*' )">
  130.66 +					<pre><xsl:copy-of select="substring-after( $markup-end, '*')" /></pre>
  130.67 +				</xsl:when>
  130.68 +				<xsl:otherwise>
  130.69 +					<strong><xsl:copy-of select="$markup-end" /></strong>
  130.70 +				</xsl:otherwise>
  130.71 +			</xsl:choose>
  130.72 +			<xsl:call-template name="lastCall">
  130.73 +				<xsl:with-param name="content" select="$markup-after" />
  130.74 +			</xsl:call-template>
  130.75 +			<!-- [<xsl:copy-of select="$markup-after" />] -->
  130.76 +		</xsl:when>
  130.77 +		<xsl:otherwise>
  130.78 +			<xsl:copy-of select="$content" />
  130.79 +		</xsl:otherwise>
  130.80 +	</xsl:choose>
  130.81 +	
  130.82 +</xsl:template>
  130.83 +
  130.84 +<xsl:template name="replace-tags">
  130.85 +	<xsl:param name="content" />
  130.86 +	<xsl:param name="currentID" />
  130.87 +	<xsl:variable name="topic"><xsl:call-template name="findNext"><xsl:with-param name="content" select="$content" /></xsl:call-template></xsl:variable>
  130.88 +	<!-- <xsl:variable name="this" select="$thisDoc/item[@id=$topic]" /> -->
  130.89 +	<!-- <xsl:variable name="name" select="$this/@name" /> -->
  130.90 +	<xsl:variable name="name"><xsl:call-template name="getTopicName"><xsl:with-param name="id" select="$topic" /></xsl:call-template></xsl:variable>
  130.91 +	
  130.92 +	<xsl:variable name="escaped-start"    select="substring-after( $content, '\{' )" />
  130.93 +	<xsl:variable name="item-start"       select="substring-before( $content, '{' )" />
  130.94 +
  130.95 +	<xsl:variable name="item-end"         select="substring-after( $content, '}' )" />
  130.96 +	<xsl:variable name="escaped-end"      select="substring-after( $content, '\}' )" />
  130.97 +
  130.98 +	<xsl:if test="string(normalize-space($item-start))">
  130.99 +		<xsl:if test="normalize-space($escaped-start) != normalize-space($item-start)">
 130.100 +			<xsl:call-template name="lastCall">
 130.101 +				<xsl:with-param name="content" select="$item-start" />
 130.102 +			</xsl:call-template>
 130.103 +		</xsl:if>
 130.104 +		<xsl:if test="normalize-space($escaped-start) = normalize-space($item-start)">
 130.105 +			<xsl:call-template name="lastCall">
 130.106 +				<xsl:with-param name="content" select="$escaped-start" />
 130.107 +			</xsl:call-template>
 130.108 +		</xsl:if>
 130.109 +	</xsl:if>
 130.110 +
 130.111 +	<xsl:variable name="middle">
 130.112 +		<xsl:if test="string(normalize-space($topic))">
 130.113 +		
 130.114 +			<!-- <xsl:value-of select="$topic" />(<xsl:value-of select="substring($topic, 1)" />) -->
 130.115 +			<xsl:choose>
 130.116 +				<xsl:when test="substring($topic, 1, 1) = '('">
 130.117 +				
 130.118 +					<xsl:variable name="tmp"><xsl:value-of select="substring-before( $topic, ')' )" /></xsl:variable>
 130.119 +					<xsl:variable name="thisName" select="substring-after( $topic, ') ' )" />
 130.120 +					<xsl:variable name="name2">
 130.121 +						<xsl:choose>
 130.122 +							<xsl:when test="substring($topic, 2, 1) = '%'"><img src="{substring( $tmp, 3 )}" class="image" border="0" alt="" /></xsl:when>
 130.123 +							<xsl:otherwise><xsl:value-of select="substring( $tmp, 2 )" /></xsl:otherwise>
 130.124 +						</xsl:choose>	
 130.125 +					</xsl:variable>
 130.126 +					<xsl:choose>
 130.127 +						<xsl:when test="starts-with($thisName, 'http')">
 130.128 +							<xsl:element name="a">
 130.129 +								<xsl:attribute name="href"><xsl:value-of select="$thisName" /></xsl:attribute>
 130.130 +								<xsl:if test="substring($topic, 2, 1) != '%'">
 130.131 +									<xsl:attribute name="class">extLink</xsl:attribute>
 130.132 +								</xsl:if><xsl:copy-of select="$name2" />
 130.133 +							</xsl:element>
 130.134 +						</xsl:when>
 130.135 +						<xsl:when test="starts-with($thisName, 'mailto')">
 130.136 +							<xsl:element name="a">
 130.137 +								<xsl:attribute name="href"><xsl:value-of select="$thisName" /></xsl:attribute>
 130.138 +								<xsl:if test="substring($topic, 2, 1) != '%'">
 130.139 +									<xsl:attribute name="class">extLink</xsl:attribute>
 130.140 +								</xsl:if><xsl:copy-of select="$name2" />
 130.141 +							</xsl:element>
 130.142 +						</xsl:when>
 130.143 +						<xsl:otherwise>
 130.144 +							<xsl:element name="a">
 130.145 +								<xsl:attribute name="href"><xsl:value-of select="$thisName" />.html</xsl:attribute>
 130.146 +								<xsl:if test="not(substring($topic, 2, 1) = '%')">
 130.147 +									<xsl:attribute name="class">topicLink</xsl:attribute>
 130.148 +								</xsl:if>
 130.149 +								<xsl:copy-of select="$name2" />
 130.150 +							</xsl:element>
 130.151 +						</xsl:otherwise>
 130.152 +					</xsl:choose>
 130.153 +	
 130.154 +				</xsl:when>
 130.155 +				<xsl:when test="substring($topic, 1, 1) = '!' and string($supportMenu)">
 130.156 +					<menu style="{substring-after($topic, '!')}"/>
 130.157 +				</xsl:when>
 130.158 +				<xsl:when test="substring($topic, 1, 1) = '#' and string($supportShowme)">
 130.159 +					<show-me what="{substring-after($topic, '#')}" id="{$currentID}" />
 130.160 +				</xsl:when>
 130.161 +				<xsl:when test="substring($topic, 1, 1) = '+' and string($supportSource)">
 130.162 +					<div class="viewSource"><a href="content/{$currentID}.orig" class="viewSource">view content source file</a></div>
 130.163 +				</xsl:when>
 130.164 +				<xsl:when test="substring($topic, 1, 1) = '%' and string($supportImage)">
 130.165 +					<image href="{substring-after($topic, '%')}" id="{$currentID}" />
 130.166 +				</xsl:when>
 130.167 +				<xsl:when test="starts-with($topic, 'http')">
 130.168 +					<xsl:element name="a">
 130.169 +						<xsl:attribute name="href"><xsl:value-of select="$topic" /></xsl:attribute>
 130.170 +						<xsl:attribute name="class">extLink</xsl:attribute><xsl:value-of select="$topic" />
 130.171 +					</xsl:element>
 130.172 +				</xsl:when>
 130.173 +				<xsl:otherwise>
 130.174 +					<xsl:element name="a">
 130.175 +						<xsl:attribute name="href"><xsl:value-of select="$topic" />.html</xsl:attribute>
 130.176 +						<xsl:attribute name="class">topicLink</xsl:attribute><xsl:value-of select="$name" />
 130.177 +					</xsl:element>
 130.178 +				</xsl:otherwise>
 130.179 +			</xsl:choose>
 130.180 +			
 130.181 +		</xsl:if>
 130.182 +	</xsl:variable>
 130.183 +
 130.184 +			<xsl:call-template name="lastCall">
 130.185 +				<xsl:with-param name="content" select="$middle" />
 130.186 +			</xsl:call-template>
 130.187 +<!-- 	<xsl:copy-of select="$middle" />
 130.188 + -->
 130.189 +	<xsl:variable name="more">
 130.190 +		<xsl:call-template name="findNext">
 130.191 +			<xsl:with-param name="content" select="$item-end" />
 130.192 +		</xsl:call-template>
 130.193 +	</xsl:variable>
 130.194 +	
 130.195 +	<xsl:choose>
 130.196 +		<xsl:when test="string(normalize-space($more))">
 130.197 +			<xsl:call-template name="replace-tags"><xsl:with-param name="content" select="$item-end" /><xsl:with-param name="currentID" select="$currentID" /></xsl:call-template>
 130.198 +		</xsl:when>
 130.199 +		<xsl:otherwise>
 130.200 +			<xsl:if test="string(normalize-space($item-end))">
 130.201 +				<xsl:call-template name="lastCall">
 130.202 +					<xsl:with-param name="content" select="$item-end" />
 130.203 +				</xsl:call-template>
 130.204 +<!-- 				<xsl:copy-of select="$item-end" />
 130.205 + -->			</xsl:if>
 130.206 +		</xsl:otherwise>
 130.207 +	</xsl:choose>
 130.208 +
 130.209 +	<xsl:if test="not(string(normalize-space($item-start))) and not(string(normalize-space($item-end))) and not(string(normalize-space($topic)))">
 130.210 +			<xsl:call-template name="lastCall">
 130.211 +				<xsl:with-param name="content" select="$content" />
 130.212 +			</xsl:call-template>
 130.213 +<!-- 		<xsl:copy-of select="$content" /> -->
 130.214 +	</xsl:if>
 130.215 +
 130.216 +</xsl:template>
 130.217 +
 130.218 +<xsl:template name="markupLine">
 130.219 +	<xsl:param name="content" />
 130.220 +	<xsl:param name="currentID" />
 130.221 +	<xsl:variable name="first" select="substring($content, 1, 1)" />
 130.222 +	<xsl:variable name="c">
 130.223 +		<xsl:if test="$wikistyle">
 130.224 +		  <xsl:if test="string($first) = '?'">question</xsl:if>
 130.225 +		  <xsl:if test="string($first) = '='">answer</xsl:if>
 130.226 +		  <xsl:if test="string($first) = '!'">note</xsl:if>
 130.227 +		  <xsl:if test="string($first) = '*'">point</xsl:if>
 130.228 +		  <xsl:if test="string($first) = '.'">indent</xsl:if>
 130.229 +		  <xsl:if test="string($first) = '|'">code</xsl:if>
 130.230 +		  <xsl:if test="string($first) = ':'">blank</xsl:if>
 130.231 +		  <xsl:if test="string($first) = '-'">headerSmall</xsl:if>
 130.232 +		  <xsl:if test="string($first) = '+'">headerLarge</xsl:if>
 130.233 +		  <xsl:if test="string($first) = '#'">meta</xsl:if>
 130.234 +		</xsl:if>
 130.235 +		<xsl:if test="not($wikistyle)"></xsl:if>
 130.236 +	</xsl:variable>
 130.237 +
 130.238 +	<!-- <xsl:message>
 130.239 +		<xsl:text>c: </xsl:text><xsl:value-of select="$c"/>
 130.240 +		<xsl:text> wikistyle: </xsl:text><xsl:value-of select="$wikistyle"/>
 130.241 +	</xsl:message> -->
 130.242 +	
 130.243 +	<xsl:variable name="cont">
 130.244 +		<xsl:if test="string($c) and $wikistyle">
 130.245 +			<xsl:copy-of select="substring($content, 2)" /></xsl:if>
 130.246 +		<xsl:if test="not(string($c))">
 130.247 +			<xsl:copy-of select="$content" /></xsl:if>
 130.248 +	</xsl:variable>
 130.249 +	
 130.250 +	<xsl:variable name="class">
 130.251 +		<xsl:if test="string($c)">
 130.252 +			<xsl:copy-of select="$c" /></xsl:if>
 130.253 +		<xsl:if test="not(string($c))">normal</xsl:if>
 130.254 +	</xsl:variable>
 130.255 +	
 130.256 +	<xsl:choose>
 130.257 +		<xsl:when test="$c = 'meta'">
 130.258 +			<xsl:variable name="what" select="$cont" />
 130.259 +			<xsl:variable name="before" select="substring-before($what, '=')" />
 130.260 +			<xsl:variable name="after" select="substring-after($what, '=')" />
 130.261 +			<xsl:if test="string($before)">
 130.262 +				<xsl:text disable-output-escaping="yes"><![CDATA[<]]></xsl:text><xsl:copy-of select="normalize-space($before)" /><xsl:text disable-output-escaping="yes"><![CDATA[>]]></xsl:text>
 130.263 +					<xsl:copy-of select="$after" />
 130.264 +				<xsl:text disable-output-escaping="yes"><![CDATA[</]]></xsl:text><xsl:copy-of select="normalize-space($before)" /><xsl:text disable-output-escaping="yes"><![CDATA[>]]></xsl:text>
 130.265 +			</xsl:if>
 130.266 +		</xsl:when>
 130.267 +		<xsl:when test="$c = 'code'">
 130.268 +			<p class="{$class}"><xsl:copy-of select="$cont" /></p>
 130.269 +		</xsl:when>
 130.270 +		<xsl:when test="not($wikistyle)">
 130.271 +			<p class="{$class}"><xsl:copy-of select="$cont" /></p>
 130.272 +			<!-- <xsl:message terminate="yes" /> -->
 130.273 +		</xsl:when>
 130.274 +		<xsl:otherwise>
 130.275 +			<p class="{$class}"><xsl:call-template name="replace-tags"><xsl:with-param name="content" select="$cont" /><xsl:with-param name="currentID" select="$currentID" /></xsl:call-template></p>
 130.276 +		</xsl:otherwise>
 130.277 +	</xsl:choose>
 130.278 +</xsl:template>
 130.279 +
 130.280 +<xsl:template name="doLine">
 130.281 +	<xsl:param name="content" />
 130.282 +	<xsl:param name="currentID" />
 130.283 +	<xsl:variable name="line" select="normalize-space(concat( substring-before( $content, $controlCharacter ), $controlCharacter))" />
 130.284 +	<xsl:variable name="lineClear" select="normalize-space(translate( $line,  $controlCharacter, ' ' ))" />
 130.285 +	<xsl:variable name="next" select="normalize-space(substring-after( $content, $line ))" />
 130.286 +<!-- 	[<xsl:value-of select="$content" />]<br/>
 130.287 +	[<xsl:value-of select="$line" />]<br/>
 130.288 +	[<xsl:value-of select="$lineClear" />]<br/>
 130.289 +	[<xsl:value-of select="$next" />]<br/> -->
 130.290 +	<xsl:if test="string(normalize-space($lineClear))">
 130.291 +		<xsl:call-template name="markupLine"><xsl:with-param name="content"><xsl:copy-of select="$lineClear" /></xsl:with-param><xsl:with-param name="currentID" select="$currentID" /></xsl:call-template>
 130.292 +	</xsl:if>
 130.293 +	<xsl:if test="string(normalize-space($next))">
 130.294 +		<xsl:call-template name="doLine"><xsl:with-param name="content"><xsl:copy-of select="$next" /></xsl:with-param><xsl:with-param name="currentID" select="$currentID" /></xsl:call-template>
 130.295 +	</xsl:if>
 130.296 +</xsl:template>
 130.297 +
 130.298 +</xsl:stylesheet>
   131.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   131.2 +++ b/styles/tm.xsl	Sun Jan 30 12:59:10 2005 +0000
   131.3 @@ -0,0 +1,353 @@
   131.4 +<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
   131.5 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:exsl="http://exslt.org/common" extension-element-prefixes="exsl" version="1.0">
   131.6 +
   131.7 +<xsl:template name="getTopicName">
   131.8 +	<xsl:param name="id"/>
   131.9 +	<xsl:variable name="searching" select="$topics[@id=$id]" />
  131.10 +	<xsl:variable name="get"><xsl:value-of select="$searching/baseName/baseNameString" /><xsl:value-of select="$searching/@name" /></xsl:variable>
  131.11 +	<xsl:if test="string( $get )"><xsl:value-of select="$get" /></xsl:if>
  131.12 +	<xsl:if test="not(string( $get ))"><span class="notFound"><xsl:value-of select="$id" /> not found.</span></xsl:if>
  131.13 +</xsl:template>
  131.14 +	
  131.15 +<xsl:template name="getParent">
  131.16 +	<xsl:param name="currentID"/>
  131.17 +	<xsl:call-template name="getAllAssocID">
  131.18 +		<xsl:with-param name="filter" select="'#group-subgroup'" />
  131.19 +		<xsl:with-param name="role" select="'#parent'" />
  131.20 +		<xsl:with-param name="currentID" select="$currentID" />
  131.21 +	</xsl:call-template>
  131.22 +</xsl:template>
  131.23 +
  131.24 +<xsl:template name="getChild">
  131.25 +	<xsl:param name="currentID"/>
  131.26 +	<xsl:call-template name="getAllAssocID">
  131.27 +		<xsl:with-param name="filter" select="'#group-subgroup'" />
  131.28 +		<xsl:with-param name="role" select="'#child'" />
  131.29 +		<xsl:with-param name="currentID" select="$currentID" />
  131.30 +	</xsl:call-template>
  131.31 +</xsl:template>
  131.32 +
  131.33 +<xsl:template name="getAllAssocID">
  131.34 +	<xsl:param name="filter"/>
  131.35 +	<xsl:param name="role"/>
  131.36 +	<xsl:param name="currentID"/>
  131.37 +	
  131.38 +	<xsl:variable name="theseOnes" select="$associations[instanceOf/topicRef/@xlink:href=$filter][member/topicRef/@xlink:href=concat('#',$currentID)]" />
  131.39 +	<xsl:variable name="fiddle" select="$theseOnes/member/topicRef[not(@xlink:href=concat('#',$currentID))][parent::*/roleSpec/topicRef/@xlink:href=$role]" />
  131.40 +
  131.41 +	<xsl:value-of select="substring-after($fiddle[1]/@xlink:href, '#')" />
  131.42 +	
  131.43 +</xsl:template>
  131.44 +
  131.45 +<xsl:template name="getAllAssoc">
  131.46 +	<xsl:param name="filter"/>
  131.47 +	<xsl:param name="role"/>
  131.48 +	<xsl:param name="style" select="'default'" />
  131.49 +	<xsl:param name="title"/>
  131.50 +	<xsl:param name="box"/>
  131.51 +	<xsl:param name="without"/>
  131.52 +	<xsl:param name="currentID"/>
  131.53 +	<xsl:param name="againstID"/>
  131.54 +	
  131.55 +	<xsl:variable name="theseOnes" select="$associations[instanceOf/topicRef/@xlink:href=$filter][member/topicRef/@xlink:href=concat('#',$currentID)]" />
  131.56 +
  131.57 + 	<xsl:variable name="found"><xsl:choose> 
  131.58 +			<xsl:when test="$style = 'sections'">
  131.59 +				<table border="0" cellspacing="0" cellpadding="0" class="sections"><tr>
  131.60 +				<xsl:for-each select="$theseOnes/member/topicRef[@xlink:href!=concat('#',$currentID)][parent::*/roleSpec/topicRef/@xlink:href=$role]"> 
  131.61 +					<xsl:variable name="thisOne" select="substring-after(@xlink:href, '#')" />
  131.62 +					<xsl:variable name="cat" select="concat('#',$currentID)" />
  131.63 +					<td valign="top" class="{$style}Menu">
  131.64 +						<a href="{$pre-link}{$thisOne}{$post-link}" class="{$style}MenuLink"><xsl:call-template name="getTopicName"><xsl:with-param name="id" select="$thisOne" /></xsl:call-template></a>
  131.65 +						<div class="{$style}MenuContent"><xsl:call-template name="getClue"><xsl:with-param name="currentID" select="$thisOne" /></xsl:call-template></div>
  131.66 +					</td>
  131.67 +		 		</xsl:for-each>
  131.68 +				</tr></table>
  131.69 +			</xsl:when>
  131.70 +			<xsl:when test="$style = 'news'">
  131.71 +				<xsl:for-each select="$theseOnes/member/topicRef[@xlink:href!=concat('#',$currentID)][parent::*/roleSpec/topicRef/@xlink:href=$role]"> 
  131.72 +					<xsl:variable name="thisOne" select="substring-after(@xlink:href, '#')" />
  131.73 +					<xsl:variable name="cat" select="concat('#',$currentID)" />
  131.74 +					<div class="{$style}Menu">
  131.75 +						<a href="{$pre-link}{$thisOne}{$post-link}" class="{$style}MenuLink">
  131.76 +							<xsl:call-template name="getTopicName"><xsl:with-param name="id" select="$thisOne" /></xsl:call-template> : 
  131.77 +							<xsl:call-template name="getClue"><xsl:with-param name="currentID" select="$thisOne" /><xsl:with-param name="style" select="'news'" /></xsl:call-template>
  131.78 +						</a>
  131.79 +					</div>
  131.80 +		 		</xsl:for-each>
  131.81 +			</xsl:when>
  131.82 +			<xsl:when test="$style = 'smallnews'">
  131.83 +				<xsl:for-each select="$theseOnes/member/topicRef[@xlink:href!=concat('#',$currentID)][parent::*/roleSpec/topicRef/@xlink:href=$role]"> 
  131.84 +					<xsl:variable name="thisOne" select="substring-after(@xlink:href, '#')" />
  131.85 +					<xsl:variable name="cat" select="concat('#',$currentID)" />
  131.86 +					<div class="{$style}Menu">
  131.87 +						<a href="{$pre-link}{$thisOne}{$post-link}" class="{$style}MenuLink">
  131.88 +							<xsl:call-template name="getTopicName"><xsl:with-param name="id" select="$thisOne" /></xsl:call-template> : 
  131.89 +							 <xsl:call-template name="getShort"><xsl:with-param name="currentID" select="$thisOne" /></xsl:call-template>
  131.90 +						</a>
  131.91 +					</div>
  131.92 +		 		</xsl:for-each>
  131.93 +			</xsl:when>
  131.94 +			<xsl:otherwise>
  131.95 +			
  131.96 +				<xsl:variable name="allThese" select="$theseOnes/member/topicRef[@xlink:href!=concat('#',$currentID)][parent::*/roleSpec/topicRef/@xlink:href=$role]" />
  131.97 +				<xsl:for-each select="$allThese"> 
  131.98 +				
  131.99 +				<xsl:variable name="thisOne" select="substring-after(@xlink:href, '#')" />
 131.100 +					<xsl:variable name="cat" select="concat('#',$currentID)" />
 131.101 +						<xsl:choose> 
 131.102 +							<xsl:when test="$style = 'right' or $style = 'left' or $style = 'full' or $style = 'tree'">
 131.103 +								<xsl:choose>
 131.104 +									<xsl:when test="$thisOne = $againstID">
 131.105 +										<div class="{$style}MenuSelected"><a href="{$pre-link}{$thisOne}{$post-link}"><xsl:call-template name="getTopicName"><xsl:with-param name="id" select="$thisOne" /></xsl:call-template></a> </div>
 131.106 +									</xsl:when>
 131.107 +									<xsl:otherwise>
 131.108 +										<div class="{$style}Menu"><a href="{$pre-link}{$thisOne}{$post-link}"><xsl:call-template name="getTopicName"><xsl:with-param name="id" select="$thisOne" /></xsl:call-template></a> </div>
 131.109 +									</xsl:otherwise>
 131.110 +								</xsl:choose>
 131.111 +							</xsl:when>
 131.112 +							<xsl:when test="$style = 'banner'">
 131.113 +								<xsl:choose>
 131.114 +									<xsl:when test="$thisOne = $againstID">
 131.115 +										<td class="{$style}MenuSelected"><a href="{$pre-link}{$thisOne}{$post-link}"><xsl:call-template name="getTopicName"><xsl:with-param name="id" select="$thisOne" /></xsl:call-template></a> </td>
 131.116 +									</xsl:when>
 131.117 +									<xsl:otherwise>
 131.118 +										<td class="{$style}Menu"><a href="{$pre-link}{$thisOne}{$post-link}"><xsl:call-template name="getTopicName"><xsl:with-param name="id" select="$thisOne" /></xsl:call-template></a> </td>
 131.119 +									</xsl:otherwise>
 131.120 +								</xsl:choose>
 131.121 +							</xsl:when>
 131.122 +							<xsl:otherwise>
 131.123 +								<xsl:if test="position() != 1"> / </xsl:if>
 131.124 +								<a href="{$pre-link}{$thisOne}{$post-link}"><xsl:call-template name="getTopicName"><xsl:with-param name="id" select="$thisOne" /></xsl:call-template> </a>
 131.125 +							</xsl:otherwise>
 131.126 +						</xsl:choose>
 131.127 +		 		</xsl:for-each>
 131.128 +			</xsl:otherwise>
 131.129 +		</xsl:choose>
 131.130 +	</xsl:variable>
 131.131 +	<xsl:if test="string($found)">
 131.132 +		<xsl:choose>
 131.133 +			<xsl:when test="string($box) and $style != 'news' and $style != 'right' and $style != 'left' and $style != 'full' and $style = 'tree' and $style = 'banner'">
 131.134 +				<table class="{$box}">
 131.135 +				<tr>
 131.136 +					<xsl:if test="string($title)"><td class="{$box}Title"><xsl:value-of select="$title" /></td></xsl:if>
 131.137 +					<td class="{$box}Content"><xsl:copy-of select="$found" /></td>
 131.138 +				</tr>
 131.139 +				</table>
 131.140 +			</xsl:when>
 131.141 +			<xsl:otherwise>
 131.142 +				<xsl:copy-of select="$found" />
 131.143 +			</xsl:otherwise>
 131.144 +		</xsl:choose>
 131.145 +	</xsl:if>
 131.146 +</xsl:template>
 131.147 +
 131.148 +<xsl:template name="getAllAssocTwo">
 131.149 +	<xsl:param name="filter"/>
 131.150 +	<xsl:param name="role"/>
 131.151 +	<xsl:param name="type"/>
 131.152 +	<xsl:param name="style" select="'default'" />
 131.153 +	<xsl:param name="title"/>
 131.154 +	<xsl:param name="box"/>
 131.155 +	<xsl:param name="without"/>
 131.156 +	<xsl:param name="currentID"/>
 131.157 +	<xsl:param name="againstID"/>
 131.158 +	<xsl:variable name="theseOnes" select="$associations[instanceOf/topicRef/@xlink:href=$filter][member/topicRef/@xlink:href=concat('#',$currentID)]" />
 131.159 +	<xsl:variable name="allThese" select="$theseOnes/member/topicRef[@xlink:href!=concat('#',$currentID)][parent::*/roleSpec/topicRef/@xlink:href=$role]" />
 131.160 +	<xsl:variable name="w" select="substring-after($type, '#')" />
 131.161 +	<xsl:variable name="all" select="$topics[starts-with(@id, concat($w, '-'))]" />
 131.162 +	<xsl:variable name="found">
 131.163 +		<xsl:for-each select="$all"> 
 131.164 +			<xsl:variable name="this" select="@id" />
 131.165 +			<xsl:variable name="c" select="count( $allThese[substring-after(@xlink:href, '#')=$this])" />
 131.166 +			<xsl:if test="$c &gt; 0">
 131.167 +				<xsl:variable name="single" select="$this[1]" />
 131.168 +				<a href="{$pre-link}{$single}{$post-link}" class="foundLink"><xsl:call-template name="getTopicName"><xsl:with-param name="id" select="$single" /></xsl:call-template></a>
 131.169 +			</xsl:if>
 131.170 +		</xsl:for-each>
 131.171 +	</xsl:variable>
 131.172 +	<xsl:if test="string($found)"><xsl:copy-of select="$found" /></xsl:if>
 131.173 +</xsl:template>
 131.174 +
 131.175 +<xsl:template name="drawNextLevel">	
 131.176 +	<xsl:param name="currentID"/>
 131.177 +	<xsl:param name="againstID"/>
 131.178 +	<xsl:param name="currentType"/>
 131.179 +	<xsl:param name="currentRole"/>
 131.180 +	<xsl:param name="style"/>
 131.181 +	<xsl:call-template name="getAllAssoc">
 131.182 +		<xsl:with-param name="currentID" select="$currentID" />
 131.183 +		<xsl:with-param name="againstID" select="$againstID" />
 131.184 +		<xsl:with-param name="filter" select="'#group-subgroup'" />
 131.185 +		<xsl:with-param name="role" select="$currentRole" />
 131.186 +		<xsl:with-param name="box" select="'box'" />
 131.187 +		<xsl:with-param name="style" select="$style" />
 131.188 +	</xsl:call-template>
 131.189 +</xsl:template>
 131.190 +
 131.191 +<xsl:template name="drawRelated">
 131.192 +	<xsl:param name="currentID"/>
 131.193 +	<xsl:param name="currentType"/>
 131.194 +	<xsl:param name="currentRole"/>
 131.195 +	<xsl:param name="style" select="'box'" />
 131.196 +	<xsl:call-template name="getAll">
 131.197 +		<xsl:with-param name="ThisThat" select="'#this'" />
 131.198 +		<xsl:with-param name="role" select="$currentRole" />
 131.199 +		<xsl:with-param name="box" select="$style" />
 131.200 +		<xsl:with-param name="currentID" select="$currentID" />
 131.201 +	</xsl:call-template>
 131.202 +	<xsl:call-template name="getAll">
 131.203 +		<xsl:with-param name="ThisThat" select="'#that'" />
 131.204 +		<xsl:with-param name="role" select="$currentRole" />
 131.205 +		<xsl:with-param name="box" select="$style" />
 131.206 +		<xsl:with-param name="currentID" select="$currentID" />
 131.207 +	</xsl:call-template>
 131.208 +</xsl:template> 	
 131.209 +
 131.210 +<xsl:template name="getAll">
 131.211 +	<xsl:param name="ThisThat"/>
 131.212 +	<xsl:param name="filter"/>
 131.213 +	<xsl:param name="title"/>
 131.214 +	<xsl:param name="role"/>
 131.215 +	<xsl:param name="box"/>
 131.216 +	<xsl:param name="without"/>
 131.217 +	<xsl:param name="currentID"/>
 131.218 +	<xsl:variable name="allRelations" select="$topics[starts-with(@id, 'relation-')]" />
 131.219 +	<xsl:variable name="allAssociations" select="$associations[member/topicRef/@xlink:href=concat('#',$currentID)]" />
 131.220 +	<xsl:for-each select="$allRelations">
 131.221 +		<xsl:variable name="relID" select="concat('#', @id)" />
 131.222 +		<xsl:variable name="ThisThatRole"><xsl:choose><xsl:when test="$ThisThat = '#that'">#child</xsl:when><xsl:otherwise>#parent</xsl:otherwise></xsl:choose></xsl:variable>
 131.223 +		<xsl:variable name="thisName"><xsl:value-of select="baseName[scope/topicRef/@xlink:href=$ThisThat]/baseNameString" /></xsl:variable>
 131.224 +		<xsl:variable name="found">
 131.225 +			<xsl:for-each select="$allAssociations">
 131.226 +				<xsl:variable name="assocInstance" select="instanceOf/topicRef/@xlink:href" />
 131.227 +				<xsl:variable name="assocHref" select="member[roleSpec/topicRef/@xlink:href=$ThisThatRole]/topicRef/@xlink:href" />
 131.228 +				<xsl:variable name="thisID" select="substring-after($assocHref, '#')" />
 131.229 +				<xsl:if test="$relID = $assocInstance and $thisID != $currentID">			
 131.230 +					<span class="{$box}Element"><a href="{$pre-link}{$thisID}{$post-link}"><xsl:call-template name="getTopicName"><xsl:with-param name="id" select="$thisID" /></xsl:call-template></a></span>
 131.231 +				</xsl:if>
 131.232 +			</xsl:for-each>
 131.233 +		</xsl:variable>
 131.234 +		<xsl:if test="string($found) and string($thisName)">
 131.235 +			<xsl:call-template name="drawRelationsBox">
 131.236 +				<xsl:with-param name="style" select="$box" />
 131.237 +				<xsl:with-param name="title" select="$thisName" />
 131.238 +				<xsl:with-param name="content" select="$found" />
 131.239 +			</xsl:call-template>
 131.240 +		</xsl:if>
 131.241 +	</xsl:for-each>	
 131.242 +</xsl:template>
 131.243 +
 131.244 +<xsl:template name="getAllBlogs">
 131.245 +	<xsl:param name="currentID"/>
 131.246 +	<xsl:param name="notraverse"/>
 131.247 +	
 131.248 +	<xsl:variable name="parentID">
 131.249 +		<xsl:call-template name="getParent">
 131.250 +			<xsl:with-param name="currentID" select="$currentID" />
 131.251 +		</xsl:call-template>
 131.252 +	</xsl:variable>
 131.253 +	<xsl:choose>
 131.254 +		<xsl:when test="string($notraverse)">
 131.255 +			<xsl:variable name="theseOnes" select="$topics[instanceOf/topicRef/@xlink:href='#blog']" />
 131.256 +			<xsl:variable name="assoc" select="$associations[instanceOf/topicRef/@xlink:href='#group-subgroup'][member/topicRef/@xlink:href=concat('#',$currentID)]/member[roleSpec/topicRef/@xlink:href='#child']/topicRef" />
 131.257 +			<div class="doc">
 131.258 +				<xsl:for-each select="$theseOnes">
 131.259 +					<xsl:variable name="ct" select="." />
 131.260 +					<xsl:for-each select="$assoc">
 131.261 +						<xsl:variable name="ca" select="." />
 131.262 +						<xsl:variable name="t" select="substring-after($ca/@xlink:href, '#')" />
 131.263 +						<xsl:if test="$t = $ct/@id">
 131.264 +							<xsl:variable name="currentDate" select="$ct/occurrence[instanceOf/topicRef/@xlink:href='#blog-date']/resourceData" />
 131.265 +							<div class="blogDate"><xsl:value-of select="$currentDate" /></div>
 131.266 +							<xsl:call-template name="displayBlogItem">
 131.267 +								<xsl:with-param name="item" select="$ct" />
 131.268 +							</xsl:call-template>
 131.269 +						</xsl:if>
 131.270 +					</xsl:for-each>
 131.271 +				</xsl:for-each>
 131.272 +			</div>
 131.273 +		</xsl:when>
 131.274 +		<xsl:otherwise>
 131.275 +			<xsl:variable name="items" select="$topics[instanceOf/topicRef/@xlink:href='#blog']" />
 131.276 +			<xsl:call-template name="traverseBlog">
 131.277 +				<xsl:with-param name="items" select="$items[position() &lt; 6]" />
 131.278 +				<xsl:with-param name="currentNo" select="'1'" />
 131.279 +			</xsl:call-template>
 131.280 +		</xsl:otherwise>
 131.281 +	</xsl:choose>
 131.282 +
 131.283 +</xsl:template>
 131.284 +
 131.285 +<xsl:template name="traverseBlog">
 131.286 +	<xsl:param name="items" />
 131.287 +	<xsl:param name="currentNo" />
 131.288 +	<xsl:param name="previousDate" />
 131.289 +	
 131.290 +	<xsl:variable name="item" select="$items[position() = $currentNo]" />
 131.291 +
 131.292 +	<xsl:variable name="currentDate" select="$item/occurrence[instanceOf/topicRef/@xlink:href='#blog-date']/resourceData" />
 131.293 +
 131.294 +	<xsl:if test="string($currentDate)">
 131.295 +	
 131.296 +		<xsl:if test="string($previousDate) = string($currentDate)">
 131.297 +			<div class="blogEnd"> </div>
 131.298 +		</xsl:if>
 131.299 +		
 131.300 +		<xsl:if test="$previousDate != $currentDate">
 131.301 +			<div class="blogDate"><xsl:value-of select="$currentDate" /></div>
 131.302 +		</xsl:if>
 131.303 +		
 131.304 +		<xsl:call-template name="displayBlogItem">
 131.305 +			<xsl:with-param name="item" select="$item" />
 131.306 +		</xsl:call-template>
 131.307 +		
 131.308 +		<xsl:if test="string($items[position() = $currentNo+1])">
 131.309 +			<xsl:call-template name="traverseBlog">
 131.310 +				<xsl:with-param name="items" select="$items" />
 131.311 +				<xsl:with-param name="currentNo" select="$currentNo + 1" />
 131.312 +				<xsl:with-param name="previousDate" select="$currentDate" />
 131.313 +			</xsl:call-template>
 131.314 +		</xsl:if>
 131.315 +	
 131.316 +	</xsl:if>
 131.317 +	
 131.318 +</xsl:template>
 131.319 +
 131.320 +<xsl:template name="displayBlogItem">
 131.321 +	<xsl:param name="item" />
 131.322 +	
 131.323 +	<xsl:variable name="currentHeader" select="$item/baseName/baseNameString" />
 131.324 +	<xsl:variable name="currentDate" select="$item/occurrence[instanceOf/topicRef/@xlink:href='#blog-date']/resourceData" />
 131.325 +	<xsl:variable name="currentLink" select="$item/occurrence[instanceOf/topicRef/@xlink:href='#blog-link']/resourceData" />
 131.326 +	<xsl:variable name="currentShort" select="$item/occurrence[instanceOf/topicRef/@xlink:href='#blog-short']/resourceData" />
 131.327 +	
 131.328 +	<div class="blogItem">
 131.329 +		<xsl:if test="string($currentHeader)"><div class="blogHeader"><xsl:value-of select="$currentHeader" /></div></xsl:if>
 131.330 +		
 131.331 +		<xsl:variable name="fileName">../content/<xsl:value-of select="$item/@id" />.xml</xsl:variable>
 131.332 +		<xsl:variable name="this" select="document($fileName)/div/*" />
 131.333 +		<xsl:apply-templates select="$this"><xsl:with-param name="currentID" select="$item/@id" /></xsl:apply-templates>
 131.334 +		
 131.335 +		<xsl:if test="string($currentLink)"><div class="blogLinkBox">Read the full story at &lt; <a href="{$currentLink}"><xsl:value-of select="$currentHeader" /></a> &gt;</div></xsl:if>
 131.336 +
 131.337 +		<xsl:variable name="theseOnes" select="$associations[instanceOf/topicRef/@xlink:href='#group-subgroup'][member/topicRef/@xlink:href=concat('#',$item/@id)]/member[roleSpec/topicRef/@xlink:href='#parent']" />
 131.338 +
 131.339 +		<span class="blogLinks"><a href="{$item/@id}.html" class="blogLink">Permalink</a>added <strong><xsl:value-of select="$currentDate" /></strong>.</span> 
 131.340 +		
 131.341 +		<xsl:if test="count($theseOnes) &gt; 0">
 131.342 +			<span class="blogLinks">
 131.343 +				Catalogued under:
 131.344 +				<xsl:for-each select="$theseOnes">
 131.345 +					<xsl:variable name="chug" select="substring-after(topicRef/@xlink:href, '#')" />
 131.346 +					<a href="{$pre-link}{$chug}{$post-link}" class="blogLink"><xsl:call-template name="getTopicName"><xsl:with-param name="id" select="$chug" /></xsl:call-template> </a>
 131.347 +				</xsl:for-each>
 131.348 +	 		</span>
 131.349 +		</xsl:if>
 131.350 +		
 131.351 +	</div>
 131.352 +	
 131.353 +</xsl:template>
 131.354 +
 131.355 +
 131.356 +</xsl:stylesheet>
   132.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   132.2 +++ b/styles/vym.css	Sun Jan 30 12:59:10 2005 +0000
   132.3 @@ -0,0 +1,104 @@
   132.4 +html                  { font-family:arial,sans-serif; }
   132.5 +body                  { margin:0; padding:10px; font-family:arial,sans-serif; align:center;  background-color:#ffffff; }
   132.6 +
   132.7 +
   132.8 +
   132.9 +a, a:visited, a:link, a:active
  132.10 +                      { color:#666666; text-decoration:none; }
  132.11 +a:hover               { text-decoration:underline; }
  132.12 +
  132.13 +/* VYM specific elements*/
  132.14 +
  132.15 +.vym-header{ 
  132.16 +	width:96%; 
  132.17 +	padding:2%; 
  132.18 +	margin-bottom:10px; 
  132.19 +	border:solid 1px black; 
  132.20 +	background-color:#f0f0f0; 
  132.21 +	text-align:center; 
  132.22 +	vertical-align:center;
  132.23 +	font-size: 2em;
  132.24 +}
  132.25 +.vym-imagemap{ 
  132.26 +	width:96%; 
  132.27 +	padding:2%; 
  132.28 +	margin-bottom:10px; 
  132.29 +	border: 0px; 
  132.30 +	text-align:center; 
  132.31 +	vertical-align:center;
  132.32 +}
  132.33 +.vym-BoxBottom { 
  132.34 +	padding:10px; 
  132.35 +	font-size:0.7em; 
  132.36 +	border:solid 1px black; 
  132.37 +	margin:0; 
  132.38 +	background-color:#f0f0f0; 
  132.39 +}
  132.40 +.vym-BoxBottomR		
  132.41 +{ 
  132.42 +	padding-top:1em; 
  132.43 +	color:#676767; 
  132.44 +	text-align:right; 
  132.45 +}
  132.46 +.vym-footer { 
  132.47 +	width:100%; 
  132.48 +	border:1;
  132.49 +}
  132.50 +.vym-footerL { font-size:0.7em; color:#676767; text-align:left; }
  132.51 +.vym-footerC { font-size:0.7em; color:#676767; text-align:center; }
  132.52 +.vym-footerR { font-size:0.7em; color:#676767; text-align:right; }
  132.53 +
  132.54 +.vym-url {} 
  132.55 +
  132.56 +.vym-branch0 { 
  132.57 +	color:#000000;  
  132.58 +	font-size: x-large;
  132.59 +	font-weight: bold;
  132.60 +}
  132.61 +.vym-branch1{
  132.62 +	font-size: normal;
  132.63 +	font-weight: normal;
  132.64 +}
  132.65 +.vym-branch2{
  132.66 +	font-size: 0.5em;
  132.67 +	font-weight: normal;
  132.68 +}
  132.69 +.vym-branch3{
  132.70 +	font-size:0.5em;
  132.71 +	font-weight: normal;
  132.72 +}
  132.73 +.vym-branch4{
  132.74 +	font-size:0.5em;
  132.75 +	font-weight: normal;
  132.76 +}
  132.77 +.vym-branch5{
  132.78 +	font-size:0.5em;
  132.79 +	font-weight: normal;
  132.80 +}
  132.81 +.vym-branch6{
  132.82 +	font-size:0.5em;
  132.83 +	font-weight: normal;
  132.84 +}
  132.85 +.vym-branch7{
  132.86 +	font-size:0.5em;
  132.87 +	font-weight: normal;
  132.88 +}
  132.89 +
  132.90 +.vym-htmlnote{ 
  132.91 +	width:96%; 
  132.92 +	border: solid 1px black; 
  132.93 +	border-color: #000000;
  132.94 +	background-color: #eeeeee; 
  132.95 +	font-size: 0.5em;
  132.96 +	font-weight: normal;
  132.97 +	padding: 5px;
  132.98 +}
  132.99 +
 132.100 +.vym-note { 
 132.101 +	width:100%; 
 132.102 +	border: solid 1px black; 
 132.103 +	border-color: #000000;
 132.104 +	background-color: #eeeeee; 
 132.105 +	font-size: 0.5em;
 132.106 +	font-weight: normal;
 132.107 +}
   133.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   133.2 +++ b/styles/vym2html.xsl	Sun Jan 30 12:59:10 2005 +0000
   133.3 @@ -0,0 +1,439 @@
   133.4 +<?xml version="1.0" encoding="UTF-8" ?>
   133.5 +
   133.6 +<!--
   133.7 +    Document   : vym2html.xsl
   133.8 +    Created on : 20040313
   133.9 +	Modified   : 20040512,20040622	Uwe Drechsel
  133.10 +	Version    : 0.7
  133.11 +    Author     : Clemens Kraus (http://www.clemens-kraus.de)
  133.12 +    Description: transforms vym-files into html format.
  133.13 +    
  133.14 +	Hint:
  133.15 +	tm.xsl and cm.xsl were taken from Alexander Johannesen's 
  133.16 +	beautiful xSiteable content management system: 
  133.17 +		http://xsiteable.org
  133.18 +	and are used with kind permission
  133.19 +-->
  133.20 +
  133.21 +	
  133.22 +
  133.23 +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  133.24 +
  133.25 +	<!-- Include external stylesheets -->
  133.26 +	<xsl:include href="tm.xsl" />
  133.27 +	<xsl:include href="cm.xsl" />
  133.28 +  
  133.29 +	<!-- Settings and parameters -->
  133.30 +	<xsl:output method="html" indent="no" encoding="UTF-8"/> 
  133.31 +	<xsl:param name="filenamep" />
  133.32 +	<xsl:param name="wikistylep" />
  133.33 +	<xsl:param name="genimagep" />
  133.34 +	<xsl:param name="imageonlyp" />
  133.35 +	<xsl:param name="stylesheetp" />
  133.36 +	<xsl:param name="urlHeadingp" />
  133.37 +	<xsl:param name="urlImagep" />
  133.38 +	<xsl:variable name="filename" select="$filenamep"/>
  133.39 +	<xsl:variable name="wikistyle" select="$wikistylep"/>
  133.40 +	<xsl:variable name="genimage" select="$genimagep"/>
  133.41 +	<xsl:variable name="imageonly" select="$imageonlyp"/>	
  133.42 +	<xsl:variable name="stylesheet" select="$stylesheetp"/>
  133.43 +	<xsl:variable name="topics" select="//item" /> 
  133.44 +	<xsl:variable name="urlHeading" select="$urlHeadingp"/> 
  133.45 +	<xsl:variable name="urlImage" select="$urlImagep"/> 
  133.46 +
  133.47 +	<xsl:variable name="level" select="'0'"/>			
  133.48 +	<xsl:variable name="contentlist" select="false()"/> 
  133.49 +
  133.50 +  
  133.51 +	<xsl:variable name="fn" >
  133.52 +		<xsl:call-template name="getfn" >
  133.53 +			<xsl:with-param name="txt" select="$filename" />
  133.54 +		</xsl:call-template>
  133.55 +	</xsl:variable>
  133.56 +
  133.57 +	<xsl:variable name="path" >
  133.58 +	  <xsl:value-of select="normalize-space( substring($filename, 1, number(string-length($filename)-string-length($fn))) )" />
  133.59 +	</xsl:variable>
  133.60 +
  133.61 +	<xsl:variable name="stylesheetn" >
  133.62 +	<xsl:call-template name="getfn" >
  133.63 +		<xsl:with-param name="txt" select="$stylesheet" />
  133.64 +	</xsl:call-template>
  133.65 +	</xsl:variable><!-- path -->
  133.66 +
  133.67 +
  133.68 +
  133.69 +	<!-- Beginning of transformation here -->
  133.70 +	<xsl:template match="/">
  133.71 +	<xsl:variable name="mapversion" select="vymmap/@version"/>
  133.72 +	<xsl:variable name="header" >
  133.73 +		<xsl:call-template name="getheading" >
  133.74 +			<xsl:with-param name="txt" select="vymmap/mapcenter/heading" />
  133.75 +		</xsl:call-template>
  133.76 +	</xsl:variable><!-- header -->
  133.77 +		
  133.78 +	<!-- Write head of HTML document -->  
  133.79 +	<xsl:text disable-output-escaping="yes"><![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">]]>&#xA;</xsl:text>
  133.80 +	<html><xsl:text>&#xA;</xsl:text>
  133.81 +		<head><xsl:text>&#xA;</xsl:text>
  133.82 +			<title><xsl:value-of select="$header"/></title>
  133.83 +			<xsl:text disable-output-escaping="yes">&#xA;<![CDATA[<link href="]]></xsl:text>
  133.84 +			<xsl:value-of select="$stylesheetn"/>
  133.85 +			<xsl:text disable-output-escaping="yes"><![CDATA[" rel="stylesheet" id="]]></xsl:text>
  133.86 +			<xsl:value-of select="$stylesheetn"/>
  133.87 +			<xsl:text disable-output-escaping="yes"><![CDATA[">]]>&#xA;</xsl:text>
  133.88 +			<meta name="generator" content="vym (http://www.insilmaril.de/vym/) and vym2html.xsl (http://www.clemens-kraus.de)"/><xsl:text>&#xA;</xsl:text>
  133.89 +		</head>
  133.90 +		<xsl:text>&#xA;</xsl:text>
  133.91 +
  133.92 +		<!-- Write body of HTML document -->  
  133.93 +		<body>
  133.94 +			<!-- vym title box at top of page -->
  133.95 +			<xsl:text>&#xA;</xsl:text>
  133.96 +			<div class="vymTitleBox">
  133.97 +				<xsl:value-of select="$header"/>
  133.98 +			</div>
  133.99 +
 133.100 +			<!-- Include image of map, if wanted -->
 133.101 +			<xsl:if test="$genimage != ''">
 133.102 +				<xsl:variable name="image" select="concat($fn, '.png')" />
 133.103 +
 133.104 +				<div class="vymImageMap">
 133.105 +					<img src="images/{$image}" 
 133.106 +						border="0" 
 133.107 +						usemap="#vymmap"
 133.108 +						alt="vymmap">
 133.109 +					</img>
 133.110 +				</div>
 133.111 +				<xsl:text>&#xA;</xsl:text>
 133.112 +
 133.113 +				<!-- Generate image map by a first walk through all branches -->
 133.114 +				<map name="vymmap">
 133.115 +					<xsl:apply-templates select="vymmap/mapcenter/branch">
 133.116 +						<xsl:with-param name="genarea" select="true()"/>
 133.117 +						<xsl:with-param name="imageonly" select="$imageonly"/>
 133.118 +					</xsl:apply-templates>
 133.119 +				</map>
 133.120 +
 133.121 +				<xsl:text>&#xA;</xsl:text>
 133.122 +			</xsl:if>
 133.123 +
 133.124 +			<!-- Include note of mapcenter here -->
 133.125 +			<xsl:apply-templates select="vymmap/mapcenter/note/@href"/>
 133.126 +
 133.127 +
 133.128 +			<!-- Include all the branches, if not only image is wanted-->
 133.129 +			<xsl:if test="$imageonly = ''">
 133.130 +				<xsl:apply-templates select="vymmap/mapcenter/branch">
 133.131 +					<xsl:with-param name="genarea" select="false()"/>
 133.132 +					<xsl:with-param name="imageonly" select="$imageonly"/>
 133.133 +					<xsl:with-param name="depth" select="0"/>
 133.134 +				</xsl:apply-templates>
 133.135 +			</xsl:if>
 133.136 +
 133.137 +			<!-- Box at bottom of page, containing comment and author -->
 133.138 +			<div class="vymBoxBottom">
 133.139 +				<xsl:value-of select="vymmap/@comment"/>
 133.140 +				<div class="vymBoxBottomR">
 133.141 +					<xsl:value-of select="vymmap/@author"/>
 133.142 +				</div>
 133.143 +			</div>
 133.144 +
 133.145 +			<!-- Footer containing filename, date, selfpromotion -->
 133.146 +			<table class="vymFooter">
 133.147 +				<tr>
 133.148 +					<td class="vymFooterL">
 133.149 +						<xsl:value-of select="$fn"/>.vym
 133.150 +					</td>
 133.151 +					<td class="vymFooterC">
 133.152 +						<xsl:value-of select="vymmap/@date"/>
 133.153 +					</td>
 133.154 +					<td class="vymFooterR">
 133.155 +						vym <xsl:value-of select="$mapversion"/> 
 133.156 +					</td>  
 133.157 +				</tr>
 133.158 +			</table>
 133.159 +
 133.160 +		</body>&#xA;
 133.161 +	</html>&#xA;
 133.162 +	</xsl:template><!-- Beginning of tranformation, "/" template -->
 133.163 +
 133.164 +	
 133.165 +	<!-- Main Function generating a branch  -->
 133.166 +	<xsl:template match="branch">
 133.167 +		<!-- Work a branch twice: a) make id for anchors, b) make output -->
 133.168 +		<xsl:param name="genarea"/>
 133.169 +		<xsl:param name="imageonly"/>
 133.170 +		<xsl:param name="depth"/>
 133.171 +		<xsl:if test="$genarea">
 133.172 +			<!-- Generate id's and anchors, no output yet -->
 133.173 +			<xsl:if test="(@x1 != '' and @y1 != '' and @x2 != '' and @y2 != '') and not(../@scrolled = 'yes')">
 133.174 +				<!-- Heading is used in ALT field of anchor -->
 133.175 +				<xsl:variable name="header">
 133.176 +					<xsl:call-template name="getheading" >
 133.177 +						<xsl:with-param name="txt" select="heading" />
 133.178 +					</xsl:call-template>
 133.179 +				</xsl:variable>
 133.180 +
 133.181 +				<xsl:if test="($imageonly and @url) or ($imageonly and @vymLink) or $imageonly=''">
 133.182 +					<area>
 133.183 +					<xsl:attribute name="shape">
 133.184 +						<xsl:text>rect</xsl:text>
 133.185 +					</xsl:attribute>
 133.186 +					<xsl:attribute name="coords">
 133.187 +						<xsl:value-of select="@x1"/>
 133.188 +						<xsl:text>,</xsl:text>
 133.189 +						<xsl:value-of select="@y1"/>
 133.190 +						<xsl:text>,</xsl:text>
 133.191 +						<xsl:value-of select="@x2"/>
 133.192 +						<xsl:text>,</xsl:text>
 133.193 +						<xsl:value-of select="@y2"/>
 133.194 +					</xsl:attribute>
 133.195 +					<xsl:attribute name="href">
 133.196 +						<xsl:if test="$imageonly = ''">
 133.197 +							<xsl:text>#</xsl:text>
 133.198 +							<xsl:value-of select="generate-id(.)"/>
 133.199 +						</xsl:if>
 133.200 +						<xsl:if test="$imageonly and @url">
 133.201 +							<xsl:value-of select="@url"/>
 133.202 +						</xsl:if>
 133.203 +						<xsl:if test="$imageonly and @vymLink">
 133.204 +							<xsl:value-of select="concat( substring-before(@vymLink, '.vym'), '.html')"/>
 133.205 +						</xsl:if>
 133.206 +					</xsl:attribute>
 133.207 +					<xsl:attribute name="alt">
 133.208 +						<xsl:value-of select="$header"/>
 133.209 +					</xsl:attribute>
 133.210 +					<xsl:attribute name="title">
 133.211 +						<xsl:value-of select="$header"/>
 133.212 +					</xsl:attribute>
 133.213 +					</area>
 133.214 +					<xsl:text>&#xA;</xsl:text>
 133.215 +				</xsl:if>
 133.216 +			</xsl:if> <!--generating id's and anchors -->
 133.217 +
 133.218 +			<xsl:apply-templates select="branch">
 133.219 +				<xsl:with-param name="genarea" select="true()"/>
 133.220 +				<xsl:with-param name="imageonly" select="$imageonly"/>
 133.221 +				<xsl:with-param name="depth" select="$depth +1"/>
 133.222 +			</xsl:apply-templates>
 133.223 +		</xsl:if><!--genarea-->
 133.224 +
 133.225 +		
 133.226 +		<xsl:if test="$imageonly = ''">
 133.227 +			<xsl:if test="not($genarea)">
 133.228 +				<xsl:call-template name="anchor">
 133.229 +					<xsl:with-param name="depth" select="$depth"/>
 133.230 +				</xsl:call-template>
 133.231 +				<xsl:text>&#xA;</xsl:text>
 133.232 +			</xsl:if>
 133.233 +		</xsl:if>
 133.234 +	</xsl:template><!--branch-->
 133.235 +
 133.236 +
 133.237 +
 133.238 +	<xsl:template name="anchor">
 133.239 +		<xsl:param name="depth"/>
 133.240 +		<xsl:if test="$depth=0"> 
 133.241 +			<hr />
 133.242 +			<xsl:call-template name="gen-anchor-tag">
 133.243 +				<xsl:with-param name="depth" select="$depth"/>
 133.244 +			</xsl:call-template>
 133.245 +				<xsl:if test="count(descendant::branch)">
 133.246 +					<ul>
 133.247 +					<xsl:apply-templates select="branch">
 133.248 +						<xsl:with-param name="genarea" select="false()"/>
 133.249 +						<xsl:with-param name="depth" select="$depth+1"/>
 133.250 +					</xsl:apply-templates>
 133.251 +					</ul>
 133.252 +				</xsl:if>	
 133.253 +		</xsl:if>
 133.254 +
 133.255 +	<xsl:if test="$depth > 0">
 133.256 +			<li>
 133.257 +				<xsl:call-template name="gen-anchor-tag">
 133.258 +					<xsl:with-param name="depth" select="$depth"/>
 133.259 +				</xsl:call-template>
 133.260 +				<xsl:if test="count(descendant::branch)">
 133.261 +					<ul>
 133.262 +					<xsl:apply-templates select="branch">
 133.263 +						<xsl:with-param name="genarea" select="false()"/>
 133.264 +						<xsl:with-param name="depth" select="$depth+1"/>
 133.265 +					</xsl:apply-templates>
 133.266 +					</ul>
 133.267 +				</xsl:if>	
 133.268 +			</li>
 133.269 +		</xsl:if>
 133.270 +	</xsl:template><!--anchor-->
 133.271 +
 133.272 +
 133.273 +	<xsl:template name="gen-anchor-tag">
 133.274 +		<xsl:param name="depth"/>
 133.275 +
 133.276 +		<xsl:variable name="header">
 133.277 +			<xsl:call-template name="getheading" >
 133.278 +			<xsl:with-param name="txt" select="heading" />
 133.279 +			</xsl:call-template>
 133.280 +		</xsl:variable><!--header-->
 133.281 +
 133.282 +		<div class="vymBranch{$depth}">
 133.283 +			<xsl:if test="not($genimage = '')">
 133.284 +				<a name="{generate-id(.)}"></a>
 133.285 +			</xsl:if>
 133.286 +
 133.287 +			<!-- start header -->
 133.288 +			<xsl:value-of select="$header"/>
 133.289 +
 133.290 +			<!-- Include flags -->
 133.291 +			<xsl:apply-templates select="./standardFlag" />
 133.292 +
 133.293 +			<!-- URL to external document  -->
 133.294 +			<xsl:if test="@url != ''">
 133.295 +				<p class="vymURL">
 133.296 +				<xsl:element name="a">
 133.297 +					<xsl:attribute name="href">
 133.298 +						<xsl:value-of select="@url"/>
 133.299 +					</xsl:attribute>
 133.300 +					<xsl:if test="$urlImage= 'yes'">
 133.301 +						<img src="flags/url.png" 
 133.302 +							border="0" 
 133.303 +							valign="middle"
 133.304 +							alt="URL">
 133.305 +						</img>
 133.306 +					</xsl:if>
 133.307 +					<xsl:if test="$urlImage!= 'yes'">
 133.308 +						<xsl:text>&gt; </xsl:text>
 133.309 +					</xsl:if>
 133.310 +					<xsl:if test="$urlHeading = 'yes'">
 133.311 +						<xsl:value-of select="$header"/>
 133.312 +					</xsl:if>
 133.313 +					<xsl:if test="$urlHeading != 'yes'">
 133.314 +						<xsl:value-of select="@url"/>
 133.315 +					</xsl:if>
 133.316 +				</xsl:element>
 133.317 +				</p>
 133.318 +			</xsl:if><!-- URL to ext. doc -->
 133.319 +			<xsl:text>&#xA;</xsl:text>
 133.320 +		</div>
 133.321 +
 133.322 +		<xsl:apply-templates select="note/@href"/>
 133.323 +
 133.324 +		<xsl:text>&#xA;</xsl:text>
 133.325 +	</xsl:template><!--gen-anchor-tag-->
 133.326 +
 133.327 +
 133.328 +	<xsl:template match="standardFlag">
 133.329 +		<xsl:variable name="flag" select="concat(., '.png')" />
 133.330 +		<img src="flags/{$flag}" valign="middle" border="0" alt="{$flag}">
 133.331 +		</img>
 133.332 +
 133.333 +	</xsl:template><!--standardFlag-->
 133.334 +
 133.335 +
 133.336 +	<xsl:template match="note/@href">
 133.337 +		<div class="vymNote">
 133.338 +		<xsl:variable name="actualnotename">
 133.339 +			<xsl:value-of select="substring-after(current(),':')"/>
 133.340 +		</xsl:variable>
 133.341 +
 133.342 +		<xsl:variable name="note-name">
 133.343 +			<xsl:if test="$path = ''">
 133.344 +				<xsl:value-of select="$actualnotename"/>
 133.345 +			</xsl:if>
 133.346 +			<xsl:if test="not($path = '')">
 133.347 +				<xsl:value-of select="concat($path, '/', $actualnotename)"/>
 133.348 +			</xsl:if>
 133.349 +		</xsl:variable><!--note-name-->
 133.350 +
 133.351 +
 133.352 +		<xsl:if test="../@fonthint = 'fixed'">
 133.353 +			<xsl:text disable-output-escaping="yes">&lt;pre></xsl:text>
 133.354 +		</xsl:if>
 133.355 +
 133.356 +		<xsl:variable name="currentID" select="@id" />
 133.357 +
 133.358 +		<xsl:apply-templates select="document($note-name)/note">
 133.359 +			<xsl:with-param name="currentID" select="$currentID" />
 133.360 +		</xsl:apply-templates>
 133.361 +
 133.362 +		<xsl:if test="../@fonthint = 'fixed'">
 133.363 +			<xsl:text disable-output-escaping="yes">&lt;/pre></xsl:text>
 133.364 +		</xsl:if>
 133.365 +
 133.366 +		</div>
 133.367 +	</xsl:template><!--note/@href-->
 133.368 +
 133.369 +
 133.370 +  
 133.371 +<!--	Wiki-style notation overview:
 133.372 +  		Lines:
 133.373 +		+ Big headlines start with the '+' character.
 133.374 +		- Small headlines start with the '-' character.
 133.375 +		Normal text doesn't have any starting notation.
 133.376 +		! Notes start with an exclamation.
 133.377 +		. Indented text starts with a dot.
 133.378 +		? Questions start with a question-mark, and
 133.379 +		= Answers starts with the equal-sign.
 133.380 +		* Points for a item-list
 133.381 +		# clues
 133.382 +		
 133.383 +		Links:
 133.384 +		use "{...}" or {(Clemens homepage) http://www.clemens-kraus.de/} for external links.
 133.385 +		
 133.386 +		Markup:
 133.387 +		|This is bold| text, while |/this text is italic|, |*this is pre-formatted|, and |!this is a note|
 133.388 +	-->
 133.389 +  
 133.390 +	<xsl:template match="note">
 133.391 +		<xsl:param name="currentID"/>
 133.392 +
 133.393 +
 133.394 +		<xsl:call-template name="doLine">
 133.395 +			<xsl:with-param name="content" select="concat(translate(.,$crlf,$controlCharacter), $controlCharacter)"/>
 133.396 +			<xsl:with-param name="currentID" select="$currentID"/>
 133.397 +		</xsl:call-template>
 133.398 +	</xsl:template><!--note-->
 133.399 +
 133.400 +	  
 133.401 +  
 133.402 +  
 133.403 +  
 133.404 +	<xsl:template name="getfn">
 133.405 +		<xsl:param name="txt" select="." />
 133.406 +
 133.407 +		<xsl:choose>
 133.408 +			<xsl:when test="contains($txt, '/')" >
 133.409 +				<xsl:variable name="right" select="substring-after($txt, '/')" />
 133.410 +				<xsl:if test="string-length($right)>1" >
 133.411 +					<xsl:call-template name="getfn" >
 133.412 +						<xsl:with-param name="txt" select="$right" />
 133.413 +					</xsl:call-template>
 133.414 +				</xsl:if>
 133.415 +			</xsl:when>
 133.416 +			<xsl:otherwise>
 133.417 +				<xsl:value-of select="$txt" />
 133.418 +			</xsl:otherwise>
 133.419 +		</xsl:choose>
 133.420 +	</xsl:template><!--getfn-->
 133.421 +
 133.422 +  
 133.423 +	<!-- Take care of br's  (WHY?)  --> 
 133.424 +	<xsl:template name="getheading">
 133.425 +		<xsl:param name="txt" select="." />
 133.426 +		<xsl:variable name="br">
 133.427 +			<xsl:text disable-output-escaping="yes">&lt;br&gt;</xsl:text>
 133.428 +		</xsl:variable>
 133.429 +		<xsl:choose>
 133.430 +			<xsl:when test="contains($txt, $br)" >
 133.431 +				<xsl:variable name="right" select="substring-after($txt, $br)" />
 133.432 +				<xsl:variable name="left" select="substring-before($txt, $br)" />
 133.433 +				<xsl:value-of select="concat( $left, ' ', $right )" />
 133.434 +			</xsl:when>
 133.435 +			<xsl:otherwise>
 133.436 +				<xsl:value-of select="$txt" />
 133.437 +			</xsl:otherwise>
 133.438 +		</xsl:choose>
 133.439 +	</xsl:template><!--getheading-->
 133.440 +  
 133.441 +</xsl:stylesheet>
 133.442 +
   134.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   134.2 +++ b/styles/vym2txt.xsl	Sun Jan 30 12:59:10 2005 +0000
   134.3 @@ -0,0 +1,138 @@
   134.4 +<?xml version="1.0" encoding="UTF-8" ?>
   134.5 +
   134.6 +<!--
   134.7 +    Document   : vym2txt.xsl
   134.8 +    Created on : 20040317
   134.9 +	Modified   : 20040417
  134.10 +	Version    : 0.1
  134.11 +    Author     : Clemens Kraus (http://www.clemens-kraus.de)
  134.12 +    Description: transforms vym-files into text-format.
  134.13 +    
  134.14 +-->
  134.15 +
  134.16 +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  134.17 +
  134.18 +  <xsl:output method="text" indent="no" encoding="UTF-8"/> 
  134.19 +  <xsl:param name="filenamep" />
  134.20 +  <xsl:variable name="filename" select="$filenamep"/>
  134.21 +  
  134.22 +  <xsl:variable name="fn" >
  134.23 +	<xsl:call-template name="getfn" >
  134.24 +		<xsl:with-param name="txt" select="$filename" />
  134.25 +	</xsl:call-template>
  134.26 +  </xsl:variable>
  134.27 +
  134.28 +  <xsl:variable name="path" >
  134.29 +	  <xsl:value-of select="normalize-space( substring($filename, 1, number(string-length($filename)-string-length($fn))) )" />
  134.30 +  </xsl:variable>
  134.31 +
  134.32 +
  134.33 +  <xsl:template match="/">
  134.34 +  
  134.35 +    <xsl:text>#VYM-Export VYM-Version:</xsl:text><xsl:value-of select="vymmap/@version"/>
  134.36 +    <xsl:text>&#xA;&#xA;</xsl:text>
  134.37 +	  
  134.38 +	
  134.39 +    <xsl:value-of select="vymmap/mapcenter/heading"/>
  134.40 +	<xsl:text>&#xA;&#xA;</xsl:text>
  134.41 +		
  134.42 +	
  134.43 +	<xsl:apply-templates select="vymmap/mapcenter/branch" >
  134.44 +		<xsl:with-param name="indent" select="''" />
  134.45 +	</xsl:apply-templates>
  134.46 +
  134.47 +  </xsl:template>
  134.48 +
  134.49 +	
  134.50 +  
  134.51 +  
  134.52 +  <xsl:template match="branch">
  134.53 +    <xsl:param name="width" select="70" />
  134.54 +	
  134.55 +	
  134.56 +	<xsl:call-template name="gen-anchor-tag" >
  134.57 +		<xsl:with-param name="indent" select="$indent" />
  134.58 +	</xsl:call-template>
  134.59 +	  
  134.60 +	
  134.61 +	<xsl:apply-templates select="branch" >
  134.62 +		<xsl:with-param name="indent" select="concat($indent, ' ')" />
  134.63 +	</xsl:apply-templates>
  134.64 +
  134.65 +  </xsl:template>
  134.66 +
  134.67 +
  134.68 +  
  134.69 +  
  134.70 +  <xsl:template name="gen-anchor-tag">
  134.71 +    <xsl:param name="indent"/>
  134.72 +
  134.73 +	<xsl:value-of select="$indent"/><xsl:text>- </xsl:text><xsl:value-of select="heading"/>
  134.74 +
  134.75 +	
  134.76 +    <xsl:if test="@url != ''"> (<xsl:value-of select="@url"/>)</xsl:if>
  134.77 +	
  134.78 +	
  134.79 +	<xsl:apply-templates select="note/@href" >
  134.80 +		<xsl:with-param name="indent" select="$indent" />
  134.81 +	</xsl:apply-templates>
  134.82 +
  134.83 +    <xsl:text>&#xA;</xsl:text>
  134.84 +  </xsl:template>
  134.85 +
  134.86 +
  134.87 +  
  134.88 +  
  134.89 +  
  134.90 +  <xsl:template match="note/@href">
  134.91 +    <xsl:param name="indent"/>
  134.92 +    
  134.93 +    <xsl:variable name="actualnotename">
  134.94 +      <xsl:value-of select="substring-after(current(),':')"/>
  134.95 +    </xsl:variable>
  134.96 +
  134.97 +    <xsl:variable name="note-name">
  134.98 +	    <xsl:if test="$path = ''">
  134.99 +			<xsl:value-of select="$actualnotename"/>
 134.100 +		</xsl:if>
 134.101 +	    <xsl:if test="not($path = '')">
 134.102 +			<xsl:value-of select="concat($path, '/', $actualnotename)"/>
 134.103 +		</xsl:if>
 134.104 +	</xsl:variable>
 134.105 +	
 134.106 +	
 134.107 +	<xsl:variable name="currentID" select="@id" />
 134.108 +	
 134.109 +    <xsl:text>&#xA;</xsl:text>
 134.110 +  
 134.111 +	<xsl:for-each select="document($note-name)/note/line">
 134.112 +		<xsl:value-of select="$indent"/><xsl:text>  </xsl:text><xsl:value-of select="."/>
 134.113 +	</xsl:for-each>
 134.114 +		
 134.115 +  </xsl:template>
 134.116 +
 134.117 +  
 134.118 +  
 134.119 +  
 134.120 +  
 134.121 +  <xsl:template name="getfn">
 134.122 +	  <xsl:param name="txt" select="." />
 134.123 +	  
 134.124 +	  <xsl:choose>
 134.125 +		  <xsl:when test="contains($txt, '/')" >
 134.126 +		  	<xsl:variable name="right" select="substring-after($txt, '/')" />
 134.127 +			<xsl:if test="string-length($right)>1" >
 134.128 +			  <xsl:call-template name="getfn" >
 134.129 +				  <xsl:with-param name="txt" select="$right" />
 134.130 +			  </xsl:call-template>
 134.131 +			</xsl:if>
 134.132 +		  </xsl:when>
 134.133 +		  <xsl:otherwise>
 134.134 +			  <xsl:value-of select="$txt" />
 134.135 +		  </xsl:otherwise>
 134.136 +	  </xsl:choose>
 134.137 +	  
 134.138 +  </xsl:template>
 134.139 +  
 134.140 +</xsl:stylesheet>
 134.141 +
   135.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   135.2 +++ b/styles/vym2xhtml.xsl	Sun Jan 30 12:59:10 2005 +0000
   135.3 @@ -0,0 +1,430 @@
   135.4 +<?xml version="1.0" encoding="ISO-8859-1"?>
   135.5 +<!DOCTYPE xsl:stylesheet
   135.6 +[
   135.7 +   <!-- Namespace for XHTML -->
   135.8 +   <!ENTITY xhtmlns "http://www.w3.org/1999/xhtml">
   135.9 +]>
  135.10 +
  135.11 +<!--
  135.12 +    Document    : vym2xhtml.xsl
  135.13 +    Created     : 20040818
  135.14 +    License     : GPL
  135.15 +    Version     : 0.3.4
  135.16 +    VYM version : 1.6.0
  135.17 +    Author      : Thomas Schraitle <tom_schr@web.de>
  135.18 +    Description : transforms vym-files into XHTML.
  135.19 +    Bugs        : Many. ;) Produces at the moment not valid XHTML
  135.20 +                  Needs to checked.
  135.21 +-->
  135.22 +
  135.23 +<xsl:stylesheet version="1.0"
  135.24 +    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  135.25 +    xmlns:date="http://exslt.org/dates-and-times"
  135.26 +    extension-element-prefixes="date"
  135.27 +    xmlns="&xhtmlns;">
  135.28 +
  135.29 +
  135.30 +<xsl:output method="xml"
  135.31 +    doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
  135.32 +    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
  135.33 +    encoding="UTF-8"
  135.34 +    indent="yes"
  135.35 +    media-type="application/xhtml+xml"/>
  135.36 +
  135.37 +
  135.38 +
  135.39 +<!-- ====================================================================== -->
  135.40 +<!-- 1 = true, 0 = false -->
  135.41 +
  135.42 +<!-- URL to CSS stylesheet -->
  135.43 +<xsl:param name="css.stylesheet" select="'vym.css'"/>
  135.44 +
  135.45 +<!-- Should a default CSS stylesheet be used? -->
  135.46 +<xsl:param name="use.default.css.stylesheet" select="1"/>
  135.47 +
  135.48 +<!-- Should textcolors be used? -->
  135.49 +<xsl:param name="use.textcolor" select="0"/>
  135.50 +
  135.51 +<!-- Should an imagemap be generated? -->
  135.52 +<xsl:param name="use.imagemap" select="1"/>
  135.53 +
  135.54 +<!-- URL to image for imagemap -->
  135.55 +<xsl:param name="imagemap" select="''"/>
  135.56 +
  135.57 +<!-- This stylesheet is able to process the following VYM version -->
  135.58 +<xsl:param name="vym.version" select="'1.6.0'"/>
  135.59 +
  135.60 +<!-- Should the VYM XML format be checked -->
  135.61 +<xsl:param name="checkvym.version" select="1"/>
  135.62 +
  135.63 +<!-- Which is the image extension? -->
  135.64 +<xsl:param name="image.extension" select="'.png'"/>
  135.65 +
  135.66 +<!-- Where are the flags? -->
  135.67 +<xsl:param name="image.flags.path" select="'flags/'"/>
  135.68 +
  135.69 +<!-- Filename of the XML document -->
  135.70 +<xsl:param name="mapname" />
  135.71 +
  135.72 +<!-- Should a footer be generated? -->
  135.73 +<xsl:param name="use.footer" select="1"/>
  135.74 +
  135.75 +<!-- How should Links generated:
  135.76 +    name : Use only the name of the branch (default)
  135.77 +    url  : Use only the URL of the branch
  135.78 +    both : Use both
  135.79 +-->
  135.80 +<xsl:param name="link.style" select="'name'"/>
  135.81 +
  135.82 +
  135.83 +
  135.84 +<!-- Debuggin on/off? -->
  135.85 +<xsl:param name="debug" select="0"/>
  135.86 +<xsl:template name="generate.footer">
  135.87 +  <xsl:if test="$use.footer">
  135.88 +      <hr/>
  135.89 +      <table class="vym-footer">
  135.90 +         <tr >
  135.91 +         <td class="vym-footerL"><xsl:value-of select="$mapname"/></td>
  135.92 +         <td class="vym-footerC"><xsl:value-of select="vymmap/@date"/> </td>
  135.93 +         <!--<td class="vym-footerC"><xsl:value-of select="date:date()"/></td>-->
  135.94 +         <td class="vym-footerR">vym <xsl:value-of select="vymmap/@version"/></td>
  135.95 +         </tr>
  135.96 +      </table>
  135.97 +  </xsl:if>
  135.98 +</xsl:template>
  135.99 +
 135.100 +
 135.101 +
 135.102 +
 135.103 +
 135.104 +<!-- ====================================================================== -->
 135.105 +<xsl:variable name="head.title">
 135.106 +   <xsl:choose>
 135.107 +      <xsl:when test="/vymmap/mapcenter/heading">
 135.108 +         <xsl:value-of select="normalize-space(/vymmap/mapcenter/heading)"/>
 135.109 +      </xsl:when>
 135.110 +      <xsl:otherwise></xsl:otherwise>
 135.111 +   </xsl:choose>
 135.112 +</xsl:variable>
 135.113 +
 135.114 +
 135.115 +<xsl:variable name="default.css.stylesheet">
 135.116 +   <xsl:text>
 135.117 +h1 {border-width: 1; border: solid; text-align: center}
 135.118 +div.imagemap { align: center; border: 0; }
 135.119 +   </xsl:text>
 135.120 +</xsl:variable>
 135.121 +
 135.122 +
 135.123 +<!-- ====================================================================== -->
 135.124 +<xsl:template name="generate.head">
 135.125 +   <head>
 135.126 +      <title><xsl:value-of select="$head.title"/></title>
 135.127 +      <xsl:if test="$use.default.css.stylesheet">
 135.128 +         <style type="text/css">
 135.129 +            <xsl:value-of select="$default.css.stylesheet"/>
 135.130 +         </style>
 135.131 +      </xsl:if>
 135.132 +      <xsl:if test="vymmap/@author!=''">
 135.133 +         <meta name="author" content="{vymmap/@author}"/>
 135.134 +      </xsl:if>
 135.135 +      <xsl:if test="vymmap/@comment!=''">
 135.136 +         <meta name="comment" content="{vymmap/@comment}"/>
 135.137 +      </xsl:if>
 135.138 +      <meta name="generator" content="vym"/>
 135.139 +      <xsl:if test="$css.stylesheet!=''">
 135.140 +         <link rel="stylesheet" id="css.stylesheet" href="{$css.stylesheet}"/>
 135.141 +      </xsl:if>
 135.142 +   </head>
 135.143 +</xsl:template>
 135.144 +
 135.145 +
 135.146 +<xsl:template name="check.vym.version">
 135.147 +   <xsl:if test="$checkvym.version">
 135.148 +      <xsl:if test="not(/vymmap/@version=$vym.version)">
 135.149 +         <xsl:message>
 135.150 +            <xsl:text>&#10;</xsl:text>
 135.151 +            <xsl:text>  WARNING:</xsl:text>
 135.152 +            <xsl:text> This stylesheet applies to VYM XML format v.</xsl:text>
 135.153 +            <xsl:value-of select="$vym.version"/>
 135.154 +            <xsl:text>.&#10;  Your XML format has v</xsl:text>
 135.155 +            <xsl:value-of select="/vymmap/@version"/>
 135.156 +            <xsl:text>.&#10;  Check your HTML output!</xsl:text>
 135.157 +            <xsl:text>&#10;&#10;</xsl:text>
 135.158 +         </xsl:message>
 135.159 +      </xsl:if>
 135.160 +   </xsl:if>
 135.161 +</xsl:template>
 135.162 +
 135.163 +
 135.164 +<!-- ====================================================================== -->
 135.165 +<xsl:template match="*">
 135.166 +   <xsl:message>
 135.167 +      <xsl:text>WARNING: Unknown tag "</xsl:text>
 135.168 +      <xsl:value-of select="local-name(.)"/>
 135.169 +      <xsl:text>": </xsl:text>
 135.170 +      <xsl:value-of select="normalize-space(.)"/>
 135.171 +      <xsl:text>&#10;</xsl:text>
 135.172 +   </xsl:message>
 135.173 +</xsl:template>
 135.174 +
 135.175 +
 135.176 +<xsl:template match="/">
 135.177 +   <xsl:call-template name="check.vym.version"/>
 135.178 +
 135.179 +   <html xmlns="&xhtmlns;">
 135.180 +      <xsl:call-template name="generate.head"/>
 135.181 +      <body>
 135.182 +         <xsl:apply-templates/>
 135.183 +         <xsl:call-template name="generate.footer"/>
 135.184 +
 135.185 +      </body>
 135.186 +   </html>
 135.187 +</xsl:template>
 135.188 +
 135.189 +
 135.190 +<xsl:template match="vymmap">
 135.191 +   <div class="vymmap">
 135.192 +      <xsl:apply-templates/>
 135.193 +   </div>
 135.194 +</xsl:template>
 135.195 +
 135.196 +
 135.197 +<xsl:template match="mapcenter">
 135.198 +   <div class="mapcenter">
 135.199 +      <xsl:apply-templates/>
 135.200 +   </div>
 135.201 +</xsl:template>
 135.202 +
 135.203 +
 135.204 +<xsl:template match="mapcenter/heading">
 135.205 +   <div class="vym-header">
 135.206 +	   <xsl:apply-templates/>
 135.207 +   </div>
 135.208 + 
 135.209 +      <xsl:if test="$use.imagemap=1">
 135.210 +         <div class="vym-imagemap">
 135.211 +            <img src="{$imagemap}"
 135.212 +               alt="Imagemap"
 135.213 +               class="imagemap"
 135.214 +               usemap="#vym_imagemap"/>
 135.215 +         </div>
 135.216 +         <map name="vym_imagemap">
 135.217 +            <xsl:apply-templates select="../branch" mode="imagemap"/>
 135.218 +         </map>
 135.219 +      </xsl:if>
 135.220 +</xsl:template>
 135.221 +
 135.222 +
 135.223 +<xsl:template match="mapcenter/branch">
 135.224 +   <hr/>
 135.225 +   <ul class="branch">
 135.226 +      <xsl:apply-templates/>
 135.227 +   </ul>
 135.228 +</xsl:template>
 135.229 +
 135.230 +
 135.231 +<xsl:template match="branch">
 135.232 +   <ul class="branch">
 135.233 +      <xsl:apply-templates/>
 135.234 +   </ul>
 135.235 +</xsl:template>
 135.236 +
 135.237 +
 135.238 +<xsl:template match="heading">
 135.239 +   <li class="heading">
 135.240 +	  <span id="{generate-id(..)}">
 135.241 +      <xsl:if test="@textColor!='' and $use.textcolor=1">
 135.242 +         <xsl:attribute name="style" >color: <xsl:value-of select="@textColor" />
 135.243 +		 </xsl:attribute>
 135.244 +      </xsl:if>
 135.245 +      <xsl:choose>
 135.246 +         <xsl:when test="../@url">
 135.247 +            <xsl:variable name="url" select="../@url"/>
 135.248 +
 135.249 +            <!-- Check, how links should be generated -->
 135.250 +            <xsl:choose>
 135.251 +               <xsl:when test="$link.style = 'name'">
 135.252 +                   <a href="{$url}">
 135.253 +						<img src="{concat($image.flags.path,'url.png')}" border="0" valign="middle" alt="URL"/>
 135.254 +						<xsl:apply-templates/>
 135.255 +					</a>
 135.256 +               </xsl:when>
 135.257 +               <xsl:when test="$link.style = 'url'">
 135.258 +					<a href="{$url}">
 135.259 +						<img src="{concat($image.flags.path,'url.png')}" border="0" valign="middle" alt="URL"/>
 135.260 +						<xsl:value-of select="$url"/>
 135.261 +					</a>
 135.262 +               </xsl:when>
 135.263 +               <xsl:when test="$link.style = 'both'">
 135.264 +                  <a href="{$url}">
 135.265 +						<img src="{concat($image.flags.path,'url.png')}" border="0" valign="middle" alt="URL"/>
 135.266 +						<xsl:apply-templates/> ( <xsl:value-of select="$url"/>)
 135.267 +					</a>
 135.268 +               </xsl:when>
 135.269 +               <xsl:otherwise>
 135.270 +                  <xsl:message>
 135.271 +                     <xsl:text>WARNING: Parameter link.style doesn't contain the correct</xsl:text>
 135.272 +                     <xsl:text> value (name|url|both)</xsl:text>
 135.273 +                     <xsl:text>&#10; was "</xsl:text>
 135.274 +                     <xsl:value-of select="$link.style"/>
 135.275 +                     <xsl:text>"</xsl:text>
 135.276 +                  </xsl:message>
 135.277 +                  <a href="{$url}"><xsl:apply-templates/></a>
 135.278 +               </xsl:otherwise>
 135.279 +            </xsl:choose>
 135.280 +
 135.281 +         </xsl:when>
 135.282 +         <xsl:otherwise>
 135.283 +            <xsl:apply-templates/>
 135.284 +         </xsl:otherwise>
 135.285 +      </xsl:choose>
 135.286 +
 135.287 +      <xsl:for-each select="following-sibling::standardflag">
 135.288 +         <xsl:apply-templates select="current()" mode="standardflag"/>
 135.289 +      </xsl:for-each>
 135.290 +      </span>
 135.291 +   </li>
 135.292 +</xsl:template>
 135.293 +
 135.294 +
 135.295 +<xsl:template match="floatimage">
 135.296 +   <xsl:variable name="filename">
 135.297 +      <xsl:choose>
 135.298 +         <xsl:when test="contains(@href,':')">
 135.299 +            <xsl:value-of select="substring-after(@href,':')"/>
 135.300 +         </xsl:when>
 135.301 +         <xsl:otherwise>
 135.302 +            <xsl:value-of select="@href"/>
 135.303 +         </xsl:otherwise>
 135.304 +      </xsl:choose>
 135.305 +   </xsl:variable>
 135.306 +   
 135.307 +  <xsl:if test="@floatExport='true'">
 135.308 +      <span><img src="{$filename}" alt="{$filename}"/></span>
 135.309 +  </xsl:if>
 135.310 +</xsl:template>
 135.311 +
 135.312 +
 135.313 +<xsl:template match="standardflag"/><!-- Do nothing in normal mode -->
 135.314 +
 135.315 +<xsl:template match="standardflag" mode="standardflag">
 135.316 +   <span class="standardflag">
 135.317 +      <xsl:element name="img">
 135.318 +         <xsl:variable name="_srcimg">
 135.319 +         <xsl:choose>
 135.320 +            <xsl:when test="$image.flags.path">
 135.321 +               <xsl:value-of select="concat($image.flags.path,
 135.322 +                  .,
 135.323 +                  $image.extension)"/>
 135.324 +            </xsl:when>
 135.325 +            <xsl:otherwise>
 135.326 +               <xsl:value-of select="concat(., $image.extension)"/>
 135.327 +            </xsl:otherwise>
 135.328 +         </xsl:choose>
 135.329 +         </xsl:variable>
 135.330 +         <xsl:attribute name="src">
 135.331 +            <xsl:value-of select="$_srcimg"/>
 135.332 +         </xsl:attribute>
 135.333 +         <xsl:attribute name="alt">
 135.334 +            <xsl:value-of select="$_srcimg"/>
 135.335 +         </xsl:attribute>
 135.336 +      </xsl:element>
 135.337 +   </span>
 135.338 +</xsl:template>
 135.339 +
 135.340 +<!-- Do nothing! -->
 135.341 +<xsl:template match="select"/>
 135.342 +<xsl:template match="setting"/>
 135.343 +
 135.344 +
 135.345 +<xsl:template match="htmlnote">
 135.346 +   <div class="vym-htmlnote" >
 135.347 +      <xsl:apply-templates select=".//body/*"/><!-- Select only body elements -->
 135.348 +   </div>
 135.349 +</xsl:template>
 135.350 +
 135.351 +<!-- Do nothing! We don't need some informational elements -->
 135.352 +<xsl:template match="htmlnote/html/*"/>
 135.353 +
 135.354 +<xsl:template match="htmlnote/html/body">
 135.355 +   <xsl:copy-of select="."/>
 135.356 +</xsl:template>
 135.357 +
 135.358 +<xsl:template match="htmlnote/html/body/*">
 135.359 +   <xsl:copy-of select="."/>
 135.360 +</xsl:template>
 135.361 +
 135.362 +
 135.363 +<!-- ====================================================================== -->
 135.364 +<xsl:template match="branch" mode="imagemap"> 
 135.365 +   <xsl:param name="node"/> 
 135.366 +   <xsl:variable name="title"> 
 135.367 +      <xsl:apply-templates mode="imagemap"/> 
 135.368 +   </xsl:variable> 
 135.369 + 
 135.370 +   <xsl:if test="$debug=1"> 
 135.371 +      <xsl:message> 
 135.372 +      branch/heading = "<xsl:value-of select="normalize-space($title)"/>" 
 135.373 +      x1, x2 = <xsl:value-of select="concat(@x1, '/', @x2)"/> 
 135.374 +      y1, y2 = <xsl:value-of select="concat(@y1, '/', @y2)"/> 
 135.375 +      </xsl:message> 
 135.376 +   </xsl:if> 
 135.377 + 
 135.378 +   <area shape="rect"> 
 135.379 +      <xsl:attribute name="href"> 
 135.380 +         <xsl:choose><!-- Fix begin (!) --> 
 135.381 +            <xsl:when test="$imagemap != ''"> 
 135.382 +               <xsl:value-of select="concat('#', generate-id(.))"/> 
 135.383 +            </xsl:when> 
 135.384 +            <xsl:when test="$imagemap and @url"> 
 135.385 +               <xsl:value-of select="@url"/> 
 135.386 +            </xsl:when> 
 135.387 +            <xsl:when test="$imagemap and @vymLink"> 
 135.388 +               <xsl:value-of select="concat( substring-before(@vymLink, 
 135.389 +'.vym'), '.html')"/> 
 135.390 +            </xsl:when> 
 135.391 +         </xsl:choose><!-- Fix end --> 
 135.392 +      </xsl:attribute> 
 135.393 +      <xsl:attribute name="alt"> 
 135.394 +         <xsl:value-of select="normalize-space($title)"/> 
 135.395 +      </xsl:attribute> 
 135.396 +      <xsl:attribute name="title"> 
 135.397 +         <xsl:value-of select="normalize-space($title)"/> 
 135.398 +      </xsl:attribute> 
 135.399 +      <xsl:attribute name="coords"> 
 135.400 +         <xsl:choose> 
 135.401 +            <xsl:when test="@x1!='' and @x2!='' and @y1!='' and @y2!=''"> 
 135.402 +               <xsl:value-of select="@x1"/> 
 135.403 +               <xsl:text>,</xsl:text> 
 135.404 +               <xsl:value-of select="@y1"/> 
 135.405 +               <xsl:text>,</xsl:text> 
 135.406 +               <xsl:value-of select="@x2"/> 
 135.407 +               <xsl:text>,</xsl:text> 
 135.408 +               <xsl:value-of select="@y2"/> 
 135.409 +            </xsl:when> 
 135.410 +            <xsl:otherwise> 
 135.411 +               <!-- 
 135.412 +               <xsl:message> 
 135.413 +                  <xsl:text>ERROR: Some coordinates in branch are 
 135.414 +missing!&#10;</xsl:text> 
 135.415 +                  <xsl:text>       See branch with </xsl:text> 
 135.416 +                  <xsl:value-of select="normalize-space($title)"/> 
 135.417 +               </xsl:message> 
 135.418 +               //--> 
 135.419 +            </xsl:otherwise> 
 135.420 +         </xsl:choose> 
 135.421 +      </xsl:attribute> 
 135.422 +   </area> 
 135.423 +   <xsl:apply-templates select="./branch" mode="imagemap"/> 
 135.424 +</xsl:template> 
 135.425 +
 135.426 +
 135.427 +
 135.428 +<xsl:template match="heading" mode="imagemap">
 135.429 +   <xsl:apply-templates mode="imagemap"/>
 135.430 +</xsl:template>
 135.431 +
 135.432 +
 135.433 +</xsl:stylesheet>
 135.434 \ No newline at end of file
   136.1 Binary file styles/wiki/answer.gif has changed
   137.1 Binary file styles/wiki/point.gif has changed
   138.1 Binary file styles/wiki/question.gif has changed
   139.1 Binary file tex/branches-flags.png has changed
   140.1 Binary file tex/branches.png has changed
   141.1 Binary file tex/color-buttons.png has changed
   142.1 Binary file tex/default-flags.png has changed
   143.1 Binary file tex/example1.png has changed
   144.1 Binary file tex/find-window.png has changed
   145.1 Binary file tex/flag-url.png has changed
   146.1 Binary file tex/flag-vymlink.png has changed
   147.1 Binary file tex/formatfixedfont.png has changed
   148.1 Binary file tex/move-buttons.png has changed
   149.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   149.2 +++ b/tex/vym.tex	Sun Jan 30 12:59:10 2005 +0000
   149.3 @@ -0,0 +1,927 @@
   149.4 +\documentclass{article}
   149.5 +\usepackage{a4}
   149.6 +\usepackage[latin1]{inputenc}
   149.7 +\usepackage{verbatim}
   149.8 +\usepackage{hyperref}
   149.9 +\usepackage{graphicx}
  149.10 +\usepackage{longtable}
  149.11 +
  149.12 +
  149.13 +%\input{udmath}
  149.14 +
  149.15 +
  149.16 +\hypersetup{bookmarks, bookmarksopen,
  149.17 +  pdftitle={VYM - a tool for visual thinking },
  149.18 +  pdfauthor={Uwe Drechsel},    
  149.19 +  pdfsubject={map},
  149.20 +  pdfkeywords={map, tool},
  149.21 +  pdfpagemode={UseOutlines},                                 
  149.22 +  bookmarksopenlevel={1},   
  149.23 +  colorlinks={true},     
  149.24 +  linkcolor={blue},
  149.25 +  urlcolor={green},
  149.26 +  citecolor={red}} 
  149.27 +
  149.28 +
  149.29 +\newcommand{\vym}{{\sc vym }}
  149.30 +\newcommand{\ra}{$\longrightarrow$}
  149.31 +\newcommand{\la}{$\longleftarrow$}
  149.32 +\newcommand{\ua}{$\uparrow$}
  149.33 +\newcommand{\da}{$\downarrow$}
  149.34 +\newcommand{\key}[1]{[#1]}
  149.35 +
  149.36 +\begin{document}
  149.37 +\title{VYM \\ -- \\View Your Mind}
  149.38 +\author{\textcopyright Uwe Drechsel  }
  149.39 +%\date{September 26, 2002}
  149.40 +
  149.41 +\maketitle
  149.42 +
  149.43 +\tableofcontents
  149.44 +
  149.45 +\newpage
  149.46 +
  149.47 +\section{Introduction}
  149.48 +\subsection{What is a \vym map?}
  149.49 +A \vym map (in short words {\em map}) is a tree like structure:
  149.50 +\begin{center}
  149.51 +	\includegraphics[width=12cm]{example1.png}
  149.52 +\end{center}
  149.53 +Such maps can be drawn by hand on paper or a flip chart and help to
  149.54 +structure your thoughs. While a tree like structure like above can be
  149.55 +drawn by hand or any drawing software \vym offers
  149.56 +much more features to work with such maps. \vym is not another drawing
  149.57 +software, but a tool to store and modify information in an intuitive
  149.58 +way. For example you can reorder parts of the map by pressing a key or
  149.59 +add various information like a complete email by a simple mouse click.
  149.60 +
  149.61 +\subsection{Why should I use maps? Time, Space and your Brain.}
  149.62 +\subsubsection*{Space}
  149.63 +A map can concentrate a very complex content on little space e.g. a
  149.64 +piece of paper. It helps to use both sides of your brain: the logical
  149.65 +side and also your creative side (e.g. by using pictures, colors and
  149.66 +keywords in a map, so called {\em anchors}).  It is a technique to
  149.67 +organize the way you think: It can help you by developing, sorting and
  149.68 +memorizing your thoughts. 
  149.69 +
  149.70 +\subsubsection*{Time}
  149.71 +Because you just use keywords and drawings, it is much faster than good
  149.72 +old fashioned notes. Your brain memorizes things by associating them to
  149.73 +other things -- a map makes use of those connections and stimulates
  149.74 +new asccociations. 
  149.75 +
  149.76 +\subsubsection*{Your Brain}
  149.77 +In 1960 the Prof. {\sc Roger Sperry} discovered that both hemispheres
  149.78 +of the human brain have different tasks (of course both of them
  149.79 +basically {\em can} do the same): The left side is specialised in 
  149.80 +\begin{itemize}
  149.81 +   \item verbal speech and writing 
  149.82 +   \item numbers
  149.83 +   \item logical thinking
  149.84 +   \item analyzing and details
  149.85 +   \item science
  149.86 +   \item linear thinking
  149.87 +   \item concept of time
  149.88 +\end{itemize}
  149.89 +while the right side of the human brain is specialised in
  149.90 +\begin{itemize}
  149.91 +    \item body language
  149.92 +    \item visual thinking, day dreams
  149.93 +    \item intuition and emotion
  149.94 +    \item overview of things
  149.95 +    \item creativity
  149.96 +    \item art, music, dancing
  149.97 +    \item non-linear thinking, connecting things
  149.98 +    \item spatial awareness
  149.99 +\end{itemize}    
 149.100 +In our science oriented society we have learned to mainly rely on our
 149.101 +left side of the brain, the "rational" one. In other cultures,
 149.102 +especially like the native americans and other "old" cultures, the right
 149.103 +side is much more important. maps are just one way to stimulate the
 149.104 +other side and make use of additional ressources we all have.
 149.105 +
 149.106 +
 149.107 +\subsection{Where could I use a map?}
 149.108 +Here are some examples, how you can use those maps
 149.109 +\begin{itemize}
 149.110 +    \item to prepare articles, papers, books, talks, \ldots
 149.111 +    \item to sort complex data
 149.112 +    \item to memorize facts, persons, vocabulary, \ldots
 149.113 +    \item to sort emails, files and bookmarks on your computer
 149.114 +    \item to moderate conferences
 149.115 +\end{itemize}
 149.116 +
 149.117 +\subsection{What you shouldn't do with a map...}
 149.118 +A map drawn by somebody shows the way the author thinks. There is
 149.119 +no right or wrong in the way it is drawn, so there is no way to critize
 149.120 +it. "It is, what it is" ({\sc F.~Lehmann}).
 149.121 +
 149.122 +%\section{Tutorials}
 149.123 +%TODO
 149.124 +
 149.125 +\section{Concept}
 149.126 +
 149.127 +%TODO may add a general introduction here...
 149.128 +
 149.129 +\vym uses two windows: an editor for the map itself and another one for
 149.130 +notes, which are part of the map. Let's call them {\em mapeditor} and
 149.131 +{\em noteeditor}: 
 149.132 +\begin{center}
 149.133 +	\includegraphics[width=8cm]{windows.png}
 149.134 +\end{center}
 149.135 +Usually you will work in the {\em mapeditor} by just adding new
 149.136 +branches, moving around and reordering them. The various ways to do this
 149.137 +will be explained in \ref{mapeditor}. You can store additional
 149.138 +information e.g. the content of a email easily in a {\em branch}: Just
 149.139 +type or copy\&paste it into the {\em noteeditor}. Working with notes is
 149.140 +explained in \ref{noteeditor}
 149.141 +
 149.142 +The map itself has always a {\em mapcenter}.  The
 149.143 +mapcenter has {\em branches} just like the trunk of a tree. Each branch
 149.144 +in turn may have branches again.
 149.145 +\begin{center}
 149.146 +	\includegraphics[width=10cm]{branches.png}
 149.147 +\end{center}
 149.148 +We will call a branch directly connected to the mapcenter a {\em
 149.149 +mainbranch}, because it determines the position of all its child
 149.150 +branches.
 149.151 +
 149.152 +The mapcenter and the branches all have a {\em heading}. This is the
 149.153 +text you see in the mapeditor. Usually it should just be one or a few
 149.154 +words, so that one can easily keep track of the whole map.
 149.155 +
 149.156 +
 149.157 +In the toolbar above the mapeditor you see various symbols.
 149.158 +\begin{center}
 149.159 +	\includegraphics[width=8cm]{default-flags.png}
 149.160 +\end{center}
 149.161 +These are called {\em flags} and can be used to mark branches in the
 149.162 +map, e.g. if something is important or questionable. 
 149.163 +There are also more flags set by \vym automatically to show additional
 149.164 +information, e.g. when a  exists for a  particular branch.
 149.165 +
 149.166 +\section{Mapeditor} \label {mapeditor}
 149.167 +\subsection{Start a new map}
 149.168 +After \vym is started two windows will open: the mapeditor and the
 149.169 +noteditor. Usually you will work in both windows, but at the moment we
 149.170 +will just need the mapeditor. 
 149.171 +
 149.172 +Select the mapcenter "New map" in the middle of the mapeditor by
 149.173 +left-clicking with the mouse. It will turn yellow to show that is
 149.174 +selected. There are two ways to add a new branch to the center:
 149.175 +\begin{itemize}
 149.176 +	\item Main menu on top of mapeditor window:
 149.177 +	Edit \ra Add new Branch
 149.178 +	\item Press \key{Ins}
 149.179 +\end{itemize}
 149.180 +A new branch will appear and you will be able to type the heading of the
 149.181 +branch. Finish adding the new branch by pressing \key{Enter}.
 149.182 +%tipp
 149.183 +Sometimes it comes handy to add a new branch above or below the current
 149.184 +one. Use \key{Ins} together with \key{Shift} or \key{Ctrl}.
 149.185 +
 149.186 +\subsection{Navigate through a map}
 149.187 +\subsubsection*{Select branches}
 149.188 +To select branches you can use the left button of your mouse or also the
 149.189 +arrow keys. Depending on the {\em orientation} of a branch type
 149.190 +\key{\la} or \key{\ra} to get nearer to the mapcenter or deeper
 149.191 +down into the branches. Within a set of branches, let's call them a 
 149.192 +{\em subtree}, you can use \key{\ua} and \key{\da} to go up and down. You can
 149.193 +also use \key{Pos1} and \key{End} to select the first and last branch.
 149.194 +
 149.195 +
 149.196 +\subsubsection*{Zoom a map}
 149.197 +While adding more and more branches the size of the map may become
 149.198 +bigger than the mapeditor window. You can use the scrollbars on the
 149.199 +right and the bottom of your mapeditor window to scroll, but it is
 149.200 +easier to just scroll using the left mouse button: Click onto the {\em
 149.201 +canvas} itself, the empty space somewhere between the branches. The
 149.202 +mouse pointer will change from an arrow to a hand, now move the visible
 149.203 +part of the map to show the desired part.
 149.204 +
 149.205 +If you select branches using the arrow keys, the map will scroll
 149.206 +to ensure that the selected branch is always visible.
 149.207 +
 149.208 +Working with huge maps, the {\em zoom}-function comes in handy: You can
 149.209 +use 
 149.210 +\begin{itemize}
 149.211 +	\item from the menu View \ra Zoom
 149.212 +	\item the toolbar buttons 
 149.213 +		\begin{center}
 149.214 +			\includegraphics[width=3cm]{zoom-buttons.png}
 149.215 +		\end{center}	
 149.216 +\end{itemize}	
 149.217 +The crossed magnifying lens resets the zoomed view to its original size.
 149.218 +
 149.219 +
 149.220 +\subsubsection*{Find Function} \label{findwindow}
 149.221 +With huge maps there is the need to have a
 149.222 +find function. Choose Edit \ra Find to open the Find Window:
 149.223 +\begin{center}
 149.224 +	\includegraphics[width=6cm]{find-window.png}
 149.225 +\end{center}	
 149.226 +The text you enter here will be searched in all the headings and also in
 149.227 +notes. Everytime you press the "Find"-button it will look for the next
 149.228 +occurence, which then will be selected automatically. If the search
 149.229 +fails, there will appear a short message "Nothing found" or a few
 149.230 +seconds in the {\em statusbar} on the bottom of the mapeditor.
 149.231 +
 149.232 +\subsubsection*{Scroll a part of the map}
 149.233 +A very big subtree of a map e.g. a branch with hundreds of childs makes
 149.234 +it very hard to keep an overview over the whole map. You can hide all
 149.235 +the childs of a branch by {\em scrolling} it -- this function is also
 149.236 +often called {\em folding}. Think of the whole subtree as painted onto a
 149.237 +big newspaper. You can scroll the paper to a small roll, leaving just
 149.238 +the headline readable.
 149.239 +
 149.240 +To scroll or unscroll a branch and its childs, press the
 149.241 +\begin{itemize}
 149.242 +	\item \key{Scroll} key or
 149.243 +	\item press the middle-mouse button or
 149.244 +	\item choose the little scroll from the toolbar.
 149.245 +\end{itemize}
 149.246 +If you select parts of a scrolled branch e.g. using the find function or
 149.247 +by using the arrow-keys, it will unscroll temporary. This is shown as a
 149.248 +scroll with a little hour glass. If the temporary unscrolled part is not
 149.249 +longer needed, it will be hidden again automatically. It is also
 149.250 +possible to unscroll all branches using "Edit\ra Unscroll all scrolled
 149.251 +branches".
 149.252 +
 149.253 +
 149.254 +
 149.255 +\subsection{Modify and move branches}
 149.256 +\subsubsection*{Modify the heading of a branch}
 149.257 +You can edit the heading by selecting the branch and then
 149.258 +\begin{itemize}
 149.259 +	\item pressing \key{Enter}
 149.260 +	\item double-clicking with left mouse.
 149.261 +\end{itemize}
 149.262 +Just type the new heading (or edit the old one) and press \key{Enter}.
 149.263 +
 149.264 +\subsubsection*{Move a branch}
 149.265 +The easiest way to move a branch is to select it with left-mouse and
 149.266 +drag it to the destination while keeping the mouse button pressed.
 149.267 +Depending on the branch  it will be
 149.268 +\begin{itemize}
 149.269 +	\item moved to the destination or
 149.270 +	\item {\em linked} to a new {\em parent} (mapcenter or branch)
 149.271 +\end{itemize}
 149.272 +If you drag the branch over another one or over the mapcenter, you will
 149.273 +notice that the  link connecting it to the old parent will be changed to
 149.274 +lead to the  new parent which is now under your mousepointer. 
 149.275 +If you release the button now, the branch will be relinked.
 149.276 +
 149.277 +If you release the button in the middle of nowhere, the result will
 149.278 +depend on the type of branch you are releasing:
 149.279 +\begin{itemize}
 149.280 +	\item A mainbranch is directly connected to the mapcenter.
 149.281 +		It will stay on its new position.
 149.282 +	\item An ordinary branch will "jump" back to its original position.	
 149.283 +\end{itemize}
 149.284 +Thus you can easily rearrange the layout of the mainbranches to avoid
 149.285 +overlapping of their subtrees.
 149.286 +There is another convenient way to move branches, especially if you want
 149.287 +to {\em reorder} a subtree: You can move a branch up or down in a
 149.288 +subtree by
 149.289 +\begin{itemize}
 149.290 +	\item pressing \key{\ua} and \key {\da}
 149.291 +	\item selecting Edit \ra Move branch
 149.292 +	\item clicking on the toolbar buttons:
 149.293 +		\begin{center}
 149.294 +			\includegraphics[width=1.5cm]{move-buttons.png}
 149.295 +		\end{center}	
 149.296 +\end{itemize}
 149.297 +%tipp
 149.298 +There is yet another way to move branches: If you press \key{Shift} or
 149.299 +\key{Ctrl} while moving with the mouse, the branch will be added above
 149.300 +or below the one the mouse pointer is over. This helps also to reorder a
 149.301 +map.
 149.302 +
 149.303 +\subsection{The right side of your brain - colors and images}
 149.304 +\subsubsection*{Change color of a heading}
 149.305 +You can also use colors to put more information into a map, e.g. use
 149.306 +red, green and more colors to prioritize tasks. Again you can
 149.307 +\begin{itemize}
 149.308 +	\item use the menu and choose e.g Format \rq Set Color
 149.309 +	\item use the toolbar
 149.310 +		\begin{center}
 149.311 +			\includegraphics[width=3cm]{color-buttons.png}
 149.312 +		\end{center}	
 149.313 +\end{itemize}
 149.314 +The first button (black in the graphic above) shows the actual color.
 149.315 +Clicking on it let's you choose another color. You can also "pick"
 149.316 +another color by selecting a branch with the desired color and using the
 149.317 +"pick color" button. Both of the buttons showing a bucket actually put
 149.318 +the current color to the selected branch. While the first one just
 149.319 +colors the heading of the selection, the last one also colors all the
 149.320 +childs of the selected branch.
 149.321 +
 149.322 +%tipp
 149.323 +A very useful function is the "copy color" using the mouse: Select the
 149.324 +branch which should get the new color, then press \key{Ctrl} and
 149.325 +simultanously click with left-mouse on another branch to copy its color
 149.326 +to the first one. Here the childs of the selection also will get the new
 149.327 +color, if you just want to color the selection itself, additionally
 149.328 +press \key{Shift}.
 149.329 +
 149.330 +\subsubsection*{Use flags}
 149.331 +\vym provides various flags. You see them in the toolbar on top of the
 149.332 +mapeditor window. (Note: Like all toolbars you can also move them to the
 149.333 +left or the right side of the window or even detach them. Just grab the
 149.334 +very left "dotted" part of the toolbar with your left-mouse button.) 
 149.335 +\begin{center}
 149.336 +	\includegraphics[width=8cm]{default-flags.png}
 149.337 +\end{center}
 149.338 +If you have a branch selected, you can set any number of flags by
 149.339 +clicking them in the toolbar. The toolbar buttons change their state and
 149.340 +always reflect the flags set in the selected branch.
 149.341 +
 149.342 +Presently \vym uses two kinds of flags: {\em System Flags} and {\em
 149.343 +Standard Flags}. The standard flags are those shown in the toolbar.
 149.344 +System flags are set by \vym to indicate e.g. that there is additional
 149.345 +information in a note (more on this in \ref{noteeditor}). Later versions
 149.346 +of \vym may have another kind of flags, which may be edited by the user.
 149.347 +
 149.348 +\subsubsection*{Images}
 149.349 +You can add a image to a branch or the mapcenter by clicking with the
 149.350 +right-mouse button. A context menu will open, choose "Add Image". A
 149.351 +dialog window lets you choose the image to load. 
 149.352 +\footnote{Supported image types are: PNG, BMP, XBM, XPM and PNM. It may
 149.353 +	also support JPEG, MNG and GIF, if specially configured during
 149.354 +	compilation (as done when \vym is part of SUSE LINUX).}
 149.355 +While an image is selected in the dialog, you can see a preview of the
 149.356 +image.	
 149.357 +
 149.358 +You can position the image anywhere you want, just drag it with left
 149.359 +mouse. To relink it to another branch, press \key{Shift} while moving
 149.360 +it. To delete it, press \key{Del}. 
 149.361 +
 149.362 +If you right-click onto an image, a context menu will open which let's
 149.363 +you first choose one of several image formats. Then a file dialog opens
 149.364 +to save the image. Hint: This is used to "export" the image, it will be
 149.365 +saved anyway in the map itself! You can also cut and
 149.366 +copy images, but it is not possible to add objects to an image\footnote{
 149.367 +	Images are regarded as "extra feature". It would make working with
 149.368 +	the map much more complex if e.g. images could be linked to images.}
 149.369 +
 149.370 +The option \lq{\bf Use for export} \rq controls the output of exports
 149.371 +e.g. to HTML: If set to no, the image won't appear in the {\em text}
 149.372 +part of the output. This is useful for large images or if images are
 149.373 +used as a kind of frame e.g. the famous cloud symbol around a part of
 149.374 +the map. Those shouldn't appear in the middle of the text.
 149.375 +
 149.376 +At the moment image support is preliminary: Images will be saved
 149.377 +together with all the other data of a map in the {\tt .vym}-file.
 149.378 +Later versions will include more functionality like resizing the images,
 149.379 +changing its z-value (put it into background) etc.
 149.380 +
 149.381 +\subsubsection*{Frames}
 149.382 +A frame can be added to a branch by clicking with the
 149.383 +right-mouse button.  A context menu will open, where you can choose the
 149.384 +frame. At the moment just a rectangle resp. "No Frame" will be offered,
 149.385 +nevertheless you can use images as frames. Have a look at the demo map
 149.386 +{\tt todo.vym} as an example, where the mapcenter is a cloud. You can
 149.387 +use an external drawing program like {\tt gimp} to create an image,
 149.388 +preferable with an transparency channel, so that you can design frames
 149.389 +which don't use a rectangular borderline, just like the cloud.
 149.390 +
 149.391 +
 149.392 +\subsection{Background design}
 149.393 +The design of the background of a map and also of the links connecting
 149.394 +various parts of the map can be changed by
 149.395 +\begin{itemize}
 149.396 +	\item Selecting Format from the menu
 149.397 +	\item Right clicking onto the canvas, which will open a context menu
 149.398 +\end{itemize}
 149.399 +
 149.400 +\subsubsection*{Background color}
 149.401 +The color is set (and also displayed) as "Set background color".
 149.402 +
 149.403 +\subsubsection*{Link color}
 149.404 +Links connecting branches can be colored in one of the following ways:
 149.405 +\begin{itemize}
 149.406 +	\item use the color of the heading of the branch the links is
 149.407 +	\item use {\em one} color for all links. The default color is blue.
 149.408 +	leading to.
 149.409 +\end{itemize}
 149.410 +The latter can be set with "Set link color". Check or uncheck the "Use
 149.411 +color of heading for link" option to choose one of the two designs for
 149.412 +your map.
 149.413 +
 149.414 +\subsubsection*{Link style}
 149.415 +\vym offers four different styles for the appearences of links:
 149.416 +\begin{itemize}
 149.417 +	\item Line
 149.418 +	\item Parabel
 149.419 +	\item Thick Line
 149.420 +	\item Thick Parabel
 149.421 +\end{itemize}
 149.422 +The "thick" styles only draw links starting at mapcenter thick, the rest
 149.423 +of the map is always painted "thin".
 149.424 +
 149.425 +
 149.426 +\subsection{Link to other documents}
 149.427 +Presently \vym supports two kind of links:
 149.428 +\begin{itemize}
 149.429 +	\item Document, which will be opened in an external webbrowser
 149.430 +	\item \vym map, which will be opened in \vym itself
 149.431 +\end{itemize}
 149.432 +
 149.433 +\subsubsection*{Webbrowser}
 149.434 +Modern Webbrowsers like {\tt konqueror} are able to display various
 149.435 +types of files, both local or in the internet. To enter the URL of
 149.436 +any document, right-click  onto a branch or use the Edit Menu
 149.437 +and choose "Edit URL". Enter the path to your document (or copy and
 149.438 +paste it from your browser). Examples for valid paths are:
 149.439 +\begin{verbatim}
 149.440 +	http://www.insilmaril.de/vym/index.html
 149.441 +	file:/usr/share/doc/packages/vym/doc/vym.pdf
 149.442 +\end{verbatim}
 149.443 +If an URL was entered, a little globe will appear in the branch. By
 149.444 +clicking on the globe in the toolbar or the context menu an external
 149.445 +browser\footnote{
 149.446 +	The browser can be changed in the Settings Menu.}
 149.447 +will be started.
 149.448 +\begin{center}
 149.449 +	\includegraphics[width=0.5cm]{flag-url.png}
 149.450 +\end{center}
 149.451 +If you want to keep bookmarks in a map, you may want to copy the heading
 149.452 +as URL: Right click onto the branch and select "Use heading for URL".
 149.453 +
 149.454 +\subsubsection*{\vym map}
 149.455 +To link to to another map right click on a branch or choose "Edit \ra
 149.456 +Enter \vym link". A file dialog opens where you can choose the map. A
 149.457 +branch with a link is marked with 
 149.458 +\begin{center}
 149.459 +	\includegraphics[width=0.5cm]{flag-vymlink.png}
 149.460 +\end{center}
 149.461 +Clicking this flag in the toolbar or in the context menu of a branch
 149.462 +will open the map in another tab (see \ref{tabs} for working with
 149.463 +multiple maps). To delete an existing link, just press the "Cancel"
 149.464 +button.
 149.465 +
 149.466 +Technical note: Internally \vym uses absolute paths, to avoid opening
 149.467 +several tabs containing the same map. When a map is saved, this path is
 149.468 +converted to a relative one (e.g. {\tt /home/user/vym.map} might become
 149.469 +{\tt ./vym.map}. This makes it fairly easy to use multiple maps on
 149.470 +different computers or export them to HTML in future.
 149.471 +
 149.472 +\subsection{Multiple maps} \label{tabs}
 149.473 +You can work on multiple maps at the same time. Each new map is opened
 149.474 +in another {\em tab}. The available tabs are shown just above the
 149.475 +mapeditor. You can use the normal cut/copy/paste functions to
 149.476 +copy data from one map to another.
 149.477 +
 149.478 +%todo
 149.479 +
 149.480 +%TODO
 149.481 +%\subsubsection{Menus}
 149.482 +%\subsubsection{Keyboard shortcuts}
 149.483 +
 149.484 +% Settings
 149.485 +% Images
 149.486 +% Copy & Paste
 149.487 +% Working with tabs (multiple maps)
 149.488 +% Exporting
 149.489 +% Scrolling
 149.490 +
 149.491 +\section{Noteeditor} \label {noteeditor}
 149.492 +If you want to save more text in a branch e.g. a complete email, a
 149.493 +cooking recipe, or the whole source code of a software project, you can
 149.494 +use the noteeditor. Since version 1.4.7 \vym supports formatted text in
 149.495 +the noteeditor.
 149.496 +
 149.497 +\subsubsection*{States}
 149.498 +Before you can type or paste text into it, you have
 149.499 +to select a branch in the mapeditor. Note that the background color
 149.500 +of the noteeditor indicates its state:
 149.501 +\begin{itemize}
 149.502 +	\item black: no branch selected
 149.503 +	\item grey: no text entered yet
 149.504 +	\item white: text is already available
 149.505 +\end{itemize}	
 149.506 +To show you in the mapeditor itself that there is a note with more
 149.507 +information for a particular branch, a little note flag will appear next
 149.508 +to the heading of the branch. See the lower branch on the right side:
 149.509 +\begin{center}
 149.510 +	\includegraphics[width=8cm]{branches-flags.png}
 149.511 +\end{center}
 149.512 +
 149.513 +\subsubsection*{Import and export notes}
 149.514 +The note is always saved automatically within the \vym file itself.
 149.515 +Nevertheless sometimes it is nice to import a note from an external file
 149.516 +or write it. Use "File\ra~Import" and "File\ra~Export" to do so. 
 149.517 +
 149.518 +\subsubsection*{Edit and print note}
 149.519 +Editing works like in any simple texteditor, including undo and redo
 149.520 +functions. You can delete the complete note by clicking the
 149.521 +trashcan. Only the note itself is printed by clicking the printer icon.
 149.522 +
 149.523 +When pasting into the editor using the X11 copy\&paste mechanism, the
 149.524 +editor will create a paragraph for each new line. Usually this is not
 149.525 +wanted, so there you can convert all paragraphs into linebreaks by using
 149.526 +Edit~\ra~Remove~Paragraphs or \key{ALT-X}.
 149.527 +
 149.528 +\subsubsection*{Fonts}
 149.529 +The noteeditor is ment to be used for simple notes, not really as full
 149.530 +featured text editor. Because of many requests \vym supports now
 149.531 +formatted text in the noteeditor\footnote{
 149.532 +	\vym uses the QRichtText format, which is basically a subset of the
 149.533 +	formatting provided in HTML.}
 149.534 +Two default fonts are supported which can be set in the Settings menu.
 149.535 +One is a fixed width font, the other has variable width. The fixed font
 149.536 +is usually used for emails, source code etc.\ while the variable font is
 149.537 +used for simple notes, where one doesn't need fixed character widths.
 149.538 +Both fonts can easily switched using the following symbol from the
 149.539 +toolbar:
 149.540 +\begin{center}
 149.541 +	\includegraphics[width=0.5cm]{formatfixedfont.png}
 149.542 +\end{center}
 149.543 +In the Settings menu both fonts can be set and also which font should be
 149.544 +used for default. 
 149.545 +
 149.546 +Additionally to the default fonts any font installed on your system can
 149.547 +be used. Please note, that the chosen font also will be used for HTML
 149.548 +exports, so you should only use fonts which are available generally.
 149.549 +
 149.550 +\subsubsection*{Colors and formatted text}
 149.551 +Colors and text attributes (e.g. italic, bold) can 
 149.552 +be set with the buttons above the text. 
 149.553 +The text itself is divided in paragraphs. For each paragraph the format
 149.554 +can be set (e.g. centered, right). A paragraph is ended when a
 149.555 +\key{Return} is entered. If you just want to begin a new line, press
 149.556 +\key{CTRL-Return}.
 149.557 +
 149.558 +\subsubsection*{Finding text}
 149.559 +The noteeditor itself has no Find function, use Find in the mapeditor,
 149.560 +which will also search all notes (see \ref{findwindow}).
 149.561 +
 149.562 +\subsubsection*{Pasting text into note editor}
 149.563 +Often you will paste text into the editor from another application e.g.
 149.564 +an email. Normally \vym will generate a new paragraph for each new line.
 149.565 +This usually is not what you want, so you can choose from the menu
 149.566 +
 149.567 +\paragraph{Edit \ra Convert Paragraphs:}
 149.568 +This turns paragraphs in selected text (or all text, if nothing is
 149.569 +selected) into linebreaks. This is especially useful for snippets of
 149.570 +source code.
 149.571 +
 149.572 +\paragraph{Edit \ra Join Lines:}
 149.573 +Tries to format text, so that empty lines are used to delimit
 149.574 +paragraphs. This is done for selected text (or all text, if nothing is
 149.575 +selected). Especially useful for text like emails, meeting minutes etc.
 149.576 +
 149.577 +\section{Hello world}
 149.578 +\vym can export its maps in various formats and can import data from
 149.579 +outside (though import is still limited at the moment).
 149.580 +
 149.581 +\subsection{Export}
 149.582 +The format in which the map will be exported can be chosen with
 149.583 +\begin{itemize}
 149.584 +	\item File \ra Export \ra {\em format}
 149.585 +\end{itemize}
 149.586 +\vym offers both HTML and ASCII export.
 149.587 +
 149.588 +\subsubsection*{Image}
 149.589 +\vym supports all image formats which are natively supported by the
 149.590 +QT~toolkit:
 149.591 +BMP, JPEG, PBM, PGM, PNG, PPN, XPM, and XBM.
 149.592 +For use in websites and for sending images by email PNG is a good
 149.593 +recommodation regarding quality and size of the image. \vym uses QTs
 149.594 +default options for compressing the images.
 149.595 +
 149.596 +\subsubsection*{ASCII}
 149.597 +Exporting an image as text is somewhat experimental at the moment. Later
 149.598 +this will probably done using stylesheets. So the output may change in
 149.599 +future versions of \vym.
 149.600 +
 149.601 +\subsubsection*{HTML}
 149.602 +Before a map is exported as HTML, it will be first written as XML into a
 149.603 +directory (see \ref{xmlexport}). Then the external program {\tt
 149.604 +xsltproc}\footnote{On SUSE Linux {\tt xsltproc} is installed by
 149.605 +default.}
 149.606 +will be called to process the XML file and generate HTML code.
 149.607 +%A script then will transform the XML
 149.608 +%version. 
 149.609 +A dialog allows to set various options:
 149.610 +\begin{itemize}
 149.611 +	\item {\bf Include image:} If set, \vym will creat an image map at
 149.612 +	the top of the HTML output. Clicking on a branch in the map will
 149.613 +	jump to the corresponding section in the output.
 149.614 +
 149.615 +	\item {\bf Colored headings:}
 149.616 +	If set to yes, \vym will color the headings in the text part  with the
 149.617 +	same colors like in the map.
 149.618 +	\item {\bf Show Warnings:}
 149.619 +	If set to yes, \vym will ask before overwriting data.
 149.620 +	\item {\bf Show output:}
 149.621 +	This is useful mainly for debugging. It will show how the processing of
 149.622 +	the XML file works by calling the external {\tt xsltproc}.
 149.623 +\end{itemize}
 149.624 +Additionally the paths to the CSS and XSL stylesheets can be set. By
 149.625 +default on SUSE~Linux they will be in {\tt /usr/share/vym/styles}.
 149.626 +
 149.627 +%\paragraph{WIKI style:} This is very useful for easy design of webpages.
 149.628 +%Here is a short overview:
 149.629 +%\begin{verbatim}
 149.630 +%Lines:
 149.631 +%	+ Big headlines start with the '+' character.
 149.632 +%	- Small headlines start with the '-' character.
 149.633 +%	  Normal text doesn't have any starting notation.
 149.634 +%	! Notes start with an exclamation.
 149.635 +%	. Indented text starts with a dot.
 149.636 +%	? Questions start with a question-mark, and
 149.637 +%	= Answers starts with the equal-sign.
 149.638 +%	* Points for a item-list
 149.639 +%	# clues
 149.640 +%	
 149.641 +%Links:
 149.642 +%	use '{...}' or '{(vym homepage) http://www.insilmaril.de/vym/}'
 149.643 +%	for external links.
 149.644 +%	
 149.645 +%Markup:
 149.646 +%	|This is bold| text, while 
 149.647 +%	|/this text is italic|, 
 149.648 +%	|*this is pre-formatted|, and 
 149.649 +%	|!this is a note|
 149.650 +%\end{verbatim}
 149.651 +%
 149.652 +%\paragraph{Show output:} This is used for debugging. \vym uses an
 149.653 +%the external script {\tt vym2html.sh} to preprocess the XML-data. Then
 149.654 +%\vym calls {\tt xsltproc} to generate the HTML page by using various
 149.655 +%{\tt .xsl} stylesheets and {\tt wireframe.css}. If you run into problems
 149.656 +%here, changing paths in {\tt $\sim$/.qt/vymrc} might help.
 149.657 +
 149.658 +\subsubsection*{XML} \label{xmlexport}
 149.659 +The map is written into a directory both as an image and as XML. The
 149.660 +directory is set in a file dialog. If the directory is not empty, you
 149.661 +will be questioned if you risk to overwrite its contents.
 149.662 +
 149.663 +It is possible to export different maps into the same directory. Each
 149.664 +file generated will have the map's name as prefix, e.g. {\tt todo.vym}
 149.665 +becomes {\tt todo.xml}, {\tt todo.png}, {\tt todo-image-1.png} and so
 149.666 +on. This is useful if e.g. for a website several combined maps have to
 149.667 +be stored in the same directory.
 149.668 +
 149.669 +\subsection{Import} 
 149.670 +At the moment \vym can read a directory structure. This is mainly for
 149.671 +testing \vym e.g. to easily create huge maps used for benchmarks (yes,
 149.672 +there is still room to optimize \vym ;-)
 149.673 +
 149.674 +Many other applications meanwhile can export their data using XML, so
 149.675 +volunteers to write import filters are welcome.
 149.676 +
 149.677 +\subsection{File format}
 149.678 +\vym maps usually have the postfix "{\tt .vym}" and represent a
 149.679 +compressed archive of data. If you want to have a
 149.680 +closer look into the data structure, just uncompress the map manually
 149.681 +using
 149.682 +\begin{verbatim}
 149.683 +	unzip vymfile.vym
 149.684 +\end{verbatim}
 149.685 +A directory named {\tt vymfile} will be created containing further
 149.686 +directories both for {\tt images} and {\tt flags}. In the {\tt vymfile}
 149.687 +directory you will find the map itself, usually named {\tt vymfile.xml}.
 149.688 +
 149.689 +This file can be loaded directly into \vym, it does not have to be
 149.690 +compressed. If you want to compress all the data yourself, use
 149.691 +\begin{verbatim}
 149.692 +	cd vymfile
 149.693 +	zip -r vymfile.vym .
 149.694 +\end{verbatim}
 149.695 +
 149.696 +
 149.697 +%TODO
 149.698 +%\subsubsection{Menus}
 149.699 +%\subsubsection{Keyboard shortcuts}
 149.700 +%Where does vym save its settings? -> ~/.qt/vymrc
 149.701 +
 149.702 +\section{History of \vym}
 149.703 +\subsection{Future}
 149.704 +There are lots of features which might find their way into \vym.
 149.705 +Together with \vym you should have received a directory with example
 149.706 +maps e.g. on SUSE~LINUX this is
 149.707 +\begin{center}
 149.708 +	{\tt /usr/share/doc/packages/vym/demos}
 149.709 +\end{center}
 149.710 +where you find the map {\tt todo.vym}. It lists quite a lot of things to
 149.711 +be done in future. If you have more ideas, contact the author at
 149.712 +{\tt vym@insilmaril.de}.
 149.713 +
 149.714 +\subsection{Past}
 149.715 +\begin{center}
 149.716 +\begin{longtable}{|lcp{8cm}l|} \hline
 149.717 +Version	&	&	Comment								& Date	\\ \hline \hline \endhead
 149.718 +	\hline \endfoot
 149.719 +1.6.0 	& -	&	Added saving of xhtml settings in map& 2004-12-14 \\ 
 149.720 +1.5.2 	& -	&	Added Import of maps with two modes: 
 149.721 +				add/replace							& 2004-12-13 \\ 
 149.722 +		& - &	Added export of part of maps		& \\
 149.723 +		& - &	Added joining of paragraphs in text editor		& \\
 149.724 +		& - &	Optimized undo: Only relevant parts are saved, which
 149.725 +				dramatically improves e.g. moving branches up/down 
 149.726 +				in most maps & \\
 149.727 +		& -	&	Bugfix: QTextEdit generates invalid XML code, which
 149.728 +				could lead to a parse error, if font name contains a \& &  \\ 
 149.729 +		& -	&	Bugfix: Wrong order of mainbranches in Export	&  \\ 
 149.730 +		& -	&	Bugfix: zip archive was not deleted before save, which
 149.731 +				could lead to much bigger files, e.g. 
 149.732 +				when working on older \vym maps or deleted images&  \\ 
 149.733 +		& -	&	Bugfix: Printing in Texteditor      &  \\ 
 149.734 +		& -	&	Bugfix: Wrong URLs in xhtml output				&  \\
 149.735 +      	& -	&	Bugfix: Segfault fixed at Cursor left/right in empty map&  \\
 149.736 +1.5.1 	& -	&	More options in xhtml export: external scripts 	& 2004-10-01 \\
 149.737 +1.5.0 	& -	&	Public release of all changes since 1.4.1      	& 2004-09-26 \\
 149.738 +      	& -	&	New function to replace paragraphs in note editor
 149.739 +				by linebreaks, this makes pasted text much nicer& \\
 149.740 +      	& -	&	New option to toggle exporting of of floatimages& \\
 149.741 +      	& -	&	z-plane of floatimages can be set (manually only)& \\
 149.742 +		& - &	Bugfix: Wrong ordering of branches, if mainbranch is
 149.743 +				exactly left of center& \\
 149.744 +1.4.7 	& -	&	New Export to HTML by Thomas Schraitle.	& 2004-09.24 \\
 149.745 +		& - &	Bugfix: vymLink&	\\
 149.746 +		& - &	Bugfix: spaces and dots in filenames	& \\
 149.747 +		& - &	Bugfix: Error message if xsltproc is not installed& \\
 149.748 +1.4.6 	& -	&	New file format: notes are saved as part of the .xml file
 149.749 +			& 2004-09-15	\\
 149.750 +		& - &	Note Editor supports Rich Text now.&\\
 149.751 +		& - &	Parser now also nows {\tt standardflag} (all letters
 149.752 +				lowercase)&\\
 149.753 +1.4.5 	& -	&	Correct handling of font size in Heading			& 2004-08-23	\\
 149.754 +1.4.4 	& -	&	Selecting with cursor now works between subtrees	& 2004-07-29	\\
 149.755 +		& - &	Bugfix: vymLink was set to temporary dir in 1.4.3	& \\
 149.756 +		& - &	Bugfix: & \\
 149.757 +1.4.3 	& -	&	Optimisation: Reduced canvas objects by only
 149.758 +				creating objects for used flags		& 2004-07-19 \\ 
 149.759 +		& - &	Better visualization of moving branch above/below target&\\		
 149.760 +		& - &	Find Window informs with dialog, if the search failed&\\
 149.761 +		& - &	System Flags are clickable now		&\\
 149.762 +		& - &	Reworked CSS and XST stylsheets (comments, indent, browser
 149.763 +				compatibility)						&\\
 149.764 +		& - &	vymLinks are shown in statusbar		&\\
 149.765 +		& - &	current directory is save			&\\
 149.766 +		& - &	Rewritten load/save to improve multimap handling and
 149.767 +				unzipped files&\\
 149.768 +		& - &	Bugfix: vymLinks don't get deleted 
 149.769 +				when Cancel is pressed				&\\		
 149.770 +      	& -	&	Bugfix: Fixed a bunch of bugs in XSL for HTML export&            \\ 
 149.771 +      	& -	&	Bugfix: More toolbar buttons disabled, if action not
 149.772 +				possible&            \\ 
 149.773 +		& - &	Bugfix: Renaming .vymfile now works&\\		
 149.774 +		& - &	Bugfix: mapChanged set when toggling flags&\\		
 149.775 +		& - &	Bugfix: CTRL-N was used twice		&\\
 149.776 +		& - &	Bugfix: Del didn't work on floatimage &\\
 149.777 +1.4.2 	& -	&	Bugfix: Float image could not be deleted& \\ 
 149.778 +1.4.1 	& -	&	Bugfix: Color of branch not saved	& 2004-05-25 \\ 
 149.779 +      	& -	&	Bugfix: wrong path at HTML export	&            \\ 
 149.780 +		& -	&	Bugfix: map is not save with special characters in path&  \\ 
 149.781 +1.4.0 	& -	&	Ask for confirmation before opening 
 149.782 +				a map in multiple editors			& 2004-05-17 \\
 149.783 +		& - &	Save state of note editor (visible/minimized)& \\
 149.784 +		& - &	Export to HTML						& \\
 149.785 +		& - &	Author and Comment is saved in map	& \\
 149.786 +		& - &	Stats are shown in Edit MapInfo		& \\
 149.787 +		& - &	Changes for OS X port (QCursor, QContextMenuEvent)	& \\
 149.788 +		& - &	Bugfix: Fonts from note editor are save now			&\\
 149.789 +		& - &	Bugfix: invisible image when parent is scrolled		&\\
 149.790 +		& - &	Bugfix: Segfault pressing "enter" for floatimage	&\\
 149.791 +		& - &	Bugfix: Images can't be outside of exported area
 149.792 +				anymore.& \\
 149.793 +		& - &	Bugfix: Filenames with blanks		& \\
 149.794 +		& - &	Bugfix: Old maplink is shown when editing maplink& \\
 149.795 +		& - &	Bugfix: always show cursor while editing heading & \\
 149.796 +1.3.5 	& -	&	Export map to dir					& 2004-04-16 \\
 149.797 +		& - &	Export to any of QTs image formats	& \\
 149.798 +		& - &	Also right side of selection is always visible now.& \\
 149.799 +1.3.4 	& -	&	Load last maps in file menu         & 2004-04-07 \\
 149.800 +		& - &	save last image path for loading	& \\
 149.801 +		& - &	Also export standard flags to dir.	& \\
 149.802 +1.3.3 	& -	&	Enabled <br> in headings as manual linebreak	& 2004-03-26 \\
 149.803 +		& -	&	Heading can be copied to URL		&\\
 149.804 +		& -	&	Bugfix: GIFs are automatically converted to PNG now&\\
 149.805 +1.3.2 	& -	&	Add and move branches above/below selection, Texteditor copy all,& 2004-03-26 \\
 149.806 +1.3.1 	& -	&	Export to directory, changed naming in .vym& 2004-03-25 \\
 149.807 +1.3.0 	& -	&	Bugfix: Check if map can be saved at all& 2004-03-23 \\
 149.808 +1.2.12	& -	&	Select image format before saving image	& 2004-03-22 \\
 149.809 +1.2.11	& -	&	Selecting mainbranches by up/down	& 2004-03-18 \\
 149.810 +		& -	&	Export ASCII (experimental)			&			\\
 149.811 +		& -	&	Each map can be saved individually at quit	&	\\
 149.812 +		& -	&	Bugfix: Opening VymLink crashes QT	&			\\
 149.813 +		& -	&	Bugfix: 50\% less objects on canvas	&			\\
 149.814 +		& -	&	Bugfix: Ignoring LANG, now always written as UTF8&\\
 149.815 +1.2.10	& -	&	Sort Mainbranches by angle to y-axis& 2004-03-16 \\
 149.816 +		& -	&	Import directory structure			&			\\
 149.817 +		& - &	Fix: Set FrameType of MapCenter while loading map &\\
 149.818 +1.2.9	& -	&	Jump to another vym map		        & 2004-03-12 \\
 149.819 +     	& -	&	Mainbranches are alwas ordered clockwise   &     \\
 149.820 +1.2.8	& -	&	Change frame types in context menu  & 2004-03-03 \\
 149.821 +1.2.7	& -	&	Copy / Paste and save Floatimages & 2004-02-25 \\
 149.822 +1.2.6	& -	&	Closing vym in KDE now asks for save, too	& 2004-02-24 \\
 149.823 +		& -	&	Context menu for branches					&  \\
 149.824 +		& -	&	Selection is saved in .vym file				&  \\
 149.825 +1.2.5	& -	&	URLs to external links can be added & 2004-02-18 \\
 149.826 +		& - &	All actions are deactived if not possible & \\
 149.827 +1.2.4	& -	&	Images: Can be loaded, saved, relinked to other parents
 149.828 +& 2004-02-16 \\
 149.829 +1.2.3	& -	&	Zoom: Reset and finer steps shrinking/enlarging	& 2004-01-27 \\
 149.830 +1.2.2	& -	&	Editing of links (style and color)	& 2004-01-27 \\
 149.831 +1.2.1	& -	&	Bugfix: LineEdit when adding branch has correct position
 149.832 +				again.								& 2004-01-27 \\
 149.833 +1.2.0	& -	&	Scrolled parts are automatically unscrolled when
 149.834 +				selected and scrolled again later.				& 2004-01-23 \\
 149.835 +		& - &	Bugfix: Save flag is updated when multiple maps are opened& \\
 149.836 +		& - &	Bugfix: Moving of branches is faster and more accurat
 149.837 +				when adding to mapcenter& \\
 149.838 +1.1.7	& -	&	Bugfix: Remember filename of note in noteeditor	& 2003-12-04 \\
 149.839 +1.1.6	& -	&	Find Text also in Notes.	& 2003-12-02 \\
 149.840 +1.1.5	& -	&	Bugfix: Correct setting and positioning when relinking branches	& 2003-11-07 \\
 149.841 +1.1.4	& -	&	Scroll mode added (folding of subtrees).		& 2003-11-03 \\
 149.842 +		& - &	Bugfix: Wrong position of linedit in zoomed view& \\
 149.843 +1.1.3	& -	&	Added clear button in find window, bugfixes    & 2003-10-09 \\ 
 149.844 +1.1.2	& -	&	Links can be colored with color of heading     & 2003-10-07 \\ 
 149.845 +1.1.1	& -	&	Improved visualization of linking to new branch& 2003-09-26 \\ 
 149.846 +1.1.0	& -	&	Find Function							& 2003-09-25 \\ 
 149.847 +		& -	&	Selection always stays in view		& \\ \hline
 149.848 +1.0.1	& -	&	Find function scrolls to result now	& 2003-09-18\\
 149.849 +     	& -	&	Bugfix: Adding branch with midmouse	&  \\
 149.850 +		& -	&	Bugfix: multiple repositioning of map, 
 149.851 +				when noteeditor was changed (speedup)	& \\
 149.852 +		& -	&	New Linestyles (still hardcoded)		&	\\ \hline
 149.853 +1.0.0	& -	&	First public stable release			& 2003-09-16 \\	 \hline	
 149.854 +0.9.0	& -	&	added quick color picker (CTRL + Left Mouse) & ?	\\ \hline
 149.855 +0.8.0	& - &	added automatic canvas resizer, removed manual resizing of
 149.856 +				canvas & \\
 149.857 +
 149.858 +	& - &	added settings option to paste text into new branch	& \\
 149.859 +	& - &	simplified code	& \\
 149.860 +	& - &	Added heart flag	& \\
 149.861 +	& - &	Choose and switch between fixed and variable width fonts& \\
 149.862 +	& - &	note editor		& \\
 149.863 +	& -	&	Fixed segfault caused by undo and a call of updateNoteFlag of
 149.864 +			note editor	& \\
 149.865 +	& - &	Added settings menu to configure autoselect \& autoedit mode	& \\
 149.866 +	& - &	autoedit \& autoselect mode	& \\
 149.867 +	& - &	Fixed ugly display problem with QT Palette (Klaas Freitag)& \\
 149.868 +	& - &	Reduced temporary directories from 4 to 1	& \\
 149.869 +	& - &	Added wordwrap in printing of notes	& \\
 149.870 +	& - &	New toolbar buttons in texteditor	& \\
 149.871 +	& - &	Set background color	& \\
 149.872 +	& - &	Fixed bug: Flags in toolbar not updated when selecting map center	& \\ \hline
 149.873 +0.7.0	& - & No more segfault, when an object is deleted while being edited & \\
 149.874 +	& - & Keep focus constant when zooming in/out & \\
 149.875 +	& - & Export as png graphic & \\
 149.876 +	& - & Keep Center of map where it is while zooming & \\
 149.877 +	& - & Added Standard Flags (Smiley, Hook, Stopsign, ...) & \\
 149.878 +	& - & MDI: Multi Document Interface enables working on several
 149.879 +		maps simultanously & \\
 149.880 +	& - & Enabled creating a new map via argument on commandline & \\
 149.881 +	& - & Changed file extension from .mmap to .vym & \\
 149.882 +	& - & noteeditor changes color, if empty or nothing is selected & \\
 149.883 +	& - & Changes in NoteEditor window are recognized by main window,
 149.884 +		too, thus preventing loosing data when quitting the program. & \\ \hline
 149.885 +0.6.0	& - &	New rendering engine: Faster, no flickering & \\ \hline
 149.886 +0.5.0	& - & Changed printing to use maximum space on paper& \\ 
 149.887 +	& - & Note editor is hidden, too, when mapeditor is minimized& \\ 
 149.888 +	& - & New (compressed) file format& \\ \hline
 149.889 +0.4.0    & - & Size of map is saved& \\ 
 149.890 +    & - & Multi Line Headings & \\ 
 149.891 +    & - & Reworked Rendering Engine: Much faster now.& \\ 
 149.892 +    & - & Reworked Undo: Much faster now.& \\ 
 149.893 +    & - & Enabled moving of map center& \\ 
 149.894 +    & - & Multi-line headings & \\ \hline
 149.895 +0.3.0    & - & Introduced Undo& \\ 
 149.896 +    & - & Fixed some bugs & \\  \hline
 149.897 +0.2.0    & - & Moving view of map improved:& \\ 
 149.898 +	& - & New handling (acrobat reader style)& \\ 
 149.899 +	& - & New mousepointer& \\ 
 149.900 +    & - & Several tools to color a map& \\ \hline
 149.901 +0.1.0 & - & Inital version, basic map layout & \\ 
 149.902 +    & - & Data is stored in XML& \\ 
 149.903 +\end{longtable}
 149.904 +\end{center}
 149.905 +
 149.906 +
 149.907 +% INDEX
 149.908 +% mapeditor
 149.909 +% noteditor
 149.910 +% branch
 149.911 +% mapcenter
 149.912 +% heading
 149.913 +% flag
 149.914 +% orientation 
 149.915 +% zoom
 149.916 +% orientation
 149.917 +% Toolbar
 149.918 +% Zoom
 149.919 +% Find
 149.920 +% statusbar
 149.921 +% link
 149.922 +% mainbranch
 149.923 +% subtree
 149.924 +% reorder
 149.925 +% scroll
 149.926 +% fold
 149.927 +
 149.928 +
 149.929 +
 149.930 +\end{document}
 149.931 \ No newline at end of file
   150.1 Binary file tex/windows.png has changed
   151.1 Binary file tex/zoom-buttons.png has changed
   152.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   152.2 +++ b/texteditor.cpp	Sun Jan 30 12:59:10 2005 +0000
   152.3 @@ -0,0 +1,921 @@
   152.4 +#include "texteditor.h"
   152.5 +
   152.6 +#include <qcanvas.h>
   152.7 +#include <qstatusbar.h>
   152.8 +#include <qmessagebox.h>
   152.9 +#include <qaction.h>
  152.10 +#include <qapplication.h>
  152.11 +#include <qpainter.h>
  152.12 +#include <qprinter.h>
  152.13 +#include <qfile.h>
  152.14 +#include <qfiledialog.h>
  152.15 +#include <qtoolbar.h>
  152.16 +#include <qpopupmenu.h>
  152.17 +#include <qmenubar.h>
  152.18 +#include <qtextedit.h>
  152.19 +#include <qaccel.h>
  152.20 +#include <qtextstream.h>
  152.21 +#include <qpaintdevicemetrics.h>
  152.22 +#include <qsettings.h>
  152.23 +#include <qfontdialog.h>
  152.24 +#include <qmessagebox.h>
  152.25 +#include <qcolordialog.h>
  152.26 +#include <qregexp.h>
  152.27 +#include <qlineedit.h>
  152.28 +#include <qsimplerichtext.h>
  152.29 +
  152.30 +#include <iostream>
  152.31 +#include <stdlib.h>
  152.32 +#include <typeinfo>
  152.33 +
  152.34 +#include "icons/fileopen.xpm"
  152.35 +#include "icons/filesave.xpm"
  152.36 +#include "icons/fileprint.xpm"
  152.37 +#include "icons/editundo.xpm"	
  152.38 +#include "icons/editredo.xpm"	
  152.39 +#include "icons/editcopy.xpm"
  152.40 +#include "icons/editcut.xpm"
  152.41 +#include "icons/editpaste.xpm"
  152.42 +#include "icons/edittrash.xpm"
  152.43 +#include "icons/formatfixedfont.xpm"
  152.44 +#include "icons/formattextbold.xpm"
  152.45 +#include "icons/formattextitalic.xpm"
  152.46 +#include "icons/formattextunder.xpm"
  152.47 +#include "icons/formattextleft.xpm"
  152.48 +#include "icons/formattextcenter.xpm"
  152.49 +#include "icons/formattextright.xpm"
  152.50 +#include "icons/formattextjustify.xpm"
  152.51 +
  152.52 +extern QCanvas* actCanvas;
  152.53 +extern int statusbarTime;
  152.54 +extern QSettings settings;
  152.55 +
  152.56 +using namespace std;
  152.57 +
  152.58 +
  152.59 +///////////////////////////////////////////////////////////////////////
  152.60 +///////////////////////////////////////////////////////////////////////
  152.61 +
  152.62 +TextEditor::TextEditor()
  152.63 +{
  152.64 +    printer = new QPrinter( QPrinter::HighResolution );
  152.65 +
  152.66 +	// Editor
  152.67 +    e = new QTextEdit( this, "editor" );
  152.68 +    e->setFocus();
  152.69 +	e->setTextFormat(RichText);		// default
  152.70 +	e->setTabStopWidth (20);		// unit is pixel
  152.71 +	e->setColor (black);
  152.72 +	connect (e, SIGNAL( textChanged() ), this, SLOT( editorChanged() ) );
  152.73 +    setCentralWidget( e );
  152.74 +    statusBar()->message( "Ready", statusbarTime);
  152.75 +	setCaption("VYM - Note Editor");
  152.76 +
  152.77 +	// Toolbars
  152.78 +	setupFileActions();
  152.79 +	setupEditActions();
  152.80 +	setupFormatActions();
  152.81 +	setupSettingsActions();
  152.82 +	
  152.83 +	// Various states
  152.84 +	emptyPaper   = QBrush(gray);
  152.85 +	filledPaper  = QBrush(white);
  152.86 +	inactivePaper= QBrush(black);
  152.87 +	setInactive();
  152.88 +
  152.89 +	// Load Settings
  152.90 +	resize (settings.readNumEntry( "/vym/noteeditor/geometry/width", 450),
  152.91 +	        settings.readNumEntry( "/vym/noteeditor/geometry/height",600));
  152.92 +	move   (settings.readNumEntry( "/vym/noteeditor/geometry/posX", 150),
  152.93 +	        settings.readNumEntry( "/vym/noteeditor/geometry/posY",  50));
  152.94 +	
  152.95 +	if (settings.readEntry( "/vym/noteeditor/showWithMain","yes") =="yes")
  152.96 +		setShowWithMain(true);
  152.97 +	else	
  152.98 +		setShowWithMain(false);
  152.99 +
 152.100 +	varFont.fromString( settings.readEntry 
 152.101 +		("/vym/noteeditor/fonts/varFont",
 152.102 +		"Nimbus Sans l,14,-1,5,48,0,0,0,0,0") 
 152.103 +	);
 152.104 +	fixedFont.fromString (settings.readEntry (
 152.105 +		"/vym/noteeditor/fonts/fixedFont",
 152.106 +		"Courier,14,-1,5,48,0,0,0,1,0") 
 152.107 +	);
 152.108 +	QString s=settings.readEntry ("/vym/noteeditor/fonts/fonthintDefault","variable");
 152.109 +	if (s == "fixed")
 152.110 +	{	
 152.111 +		actionSettingsFonthintDefault->setOn (true);
 152.112 +		e->setCurrentFont (fixedFont);
 152.113 +	} else	
 152.114 +	{
 152.115 +		actionSettingsFonthintDefault->setOn (false);
 152.116 +		e->setCurrentFont (varFont);
 152.117 +	}	
 152.118 +}
 152.119 +
 152.120 +
 152.121 +TextEditor::~TextEditor()
 152.122 +{
 152.123 +    if (printer) delete printer;
 152.124 +	// Save Settings
 152.125 +	settings.writeEntry( "/vym/noteeditor/geometry/width", width() );
 152.126 +	settings.writeEntry( "/vym/noteeditor/geometry/height", height() );
 152.127 +	settings.writeEntry( "/vym/noteeditor/geometry/posX", pos().x() );
 152.128 +	settings.writeEntry( "/vym/noteeditor/geometry/posY", pos().y() );
 152.129 +	
 152.130 +	if (showWithMain())
 152.131 +		settings.writeEntry( "/vym/noteeditor/showWithMain","yes");
 152.132 +	else	
 152.133 +		settings.writeEntry( "/vym/noteeditor/showWithMain","no");
 152.134 +
 152.135 +	QString s;
 152.136 +	if (actionSettingsFonthintDefault->isOn() )
 152.137 +		s="fixed";
 152.138 +	else	
 152.139 +		s="variable";
 152.140 +	settings.writeEntry( "/vym/noteeditor/fonts/fonthintDefault",s );
 152.141 +	settings.writeEntry ("/vym/noteeditor/fonts/varFont",
 152.142 +		varFont.toString() );
 152.143 +	settings.writeEntry ("/vym/noteeditor/fonts/fixedFont",
 152.144 +		fixedFont.toString() );
 152.145 +}
 152.146 +
 152.147 +bool TextEditor::isEmpty()
 152.148 +{
 152.149 +	if (e->text().length())
 152.150 +		return false;
 152.151 +	else
 152.152 +		return true;
 152.153 +}
 152.154 +
 152.155 +void TextEditor::setShowWithMain(bool v)
 152.156 +{
 152.157 +	showwithmain=v;
 152.158 +}
 152.159 +
 152.160 +bool TextEditor::showWithMain()
 152.161 +{
 152.162 +	return showwithmain;
 152.163 +}
 152.164 +
 152.165 +void TextEditor::setFontHint (const QString &fh)
 152.166 +{
 152.167 +	if (fh=="fixed")
 152.168 +		actionFormatUseFixedFont->setOn (true);
 152.169 +	else
 152.170 +		actionFormatUseFixedFont->setOn (false);
 152.171 +}
 152.172 +
 152.173 +
 152.174 +QString TextEditor::getFontHint()
 152.175 +{
 152.176 +	if (actionFormatUseFixedFont->isOn())
 152.177 +		return "fixed";
 152.178 +	else	
 152.179 +		return "var";
 152.180 +}
 152.181 +
 152.182 +QString TextEditor::getFontHintDefault()
 152.183 +{
 152.184 +	if (actionSettingsFonthintDefault->isOn())
 152.185 +		return "fixed";
 152.186 +	else	
 152.187 +		return "var";
 152.188 +}
 152.189 +
 152.190 +void TextEditor::setFilename(const QString &fn)
 152.191 +{
 152.192 +	if (state==filledEditor)
 152.193 +		if (fn.isEmpty() )
 152.194 +		{
 152.195 +			filename="";
 152.196 +			statusBar()->message( "No filename available for this note.", statusbarTime );
 152.197 +		}	
 152.198 +		else
 152.199 +		{
 152.200 +			filename=fn;
 152.201 +			statusBar()->message( QString( "Current filename is %1" ).arg( filename ), statusbarTime );
 152.202 +		}	
 152.203 +}
 152.204 +
 152.205 +QString TextEditor::getFilename()
 152.206 +{
 152.207 +	return filename;
 152.208 +}
 152.209 +
 152.210 +bool TextEditor::findText(const QString &t, const bool &cs)
 152.211 +{
 152.212 +	bool wo=false;	// word matches
 152.213 +	if (e->find (t, cs, wo, true, 0, 0 ))
 152.214 +		return true;
 152.215 +	else	
 152.216 +		return false;
 152.217 +}
 152.218 +
 152.219 +void TextEditor::setupFileActions()
 152.220 +{
 152.221 +    QToolBar *tb = new QToolBar( this );
 152.222 +    tb->setLabel( "File Actions" );
 152.223 +    QPopupMenu *menu = new QPopupMenu( this );
 152.224 +    menuBar()->insertItem( tr( "&File" ), menu );
 152.225 +
 152.226 +    QAction *a;
 152.227 +    a = new QAction( tr( "Import" ), QPixmap( fileopen_xpm), tr( "&Import..." ), CTRL + Key_O, this, "fileImport" );
 152.228 +    connect( a, SIGNAL( activated() ), this, SLOT( textLoad() ) );
 152.229 +	a->setEnabled(false);
 152.230 +    a->addTo( tb );
 152.231 +    a->addTo( menu );
 152.232 +	actionFileLoad=a;
 152.233 +
 152.234 +    menu->insertSeparator();
 152.235 +    a = new QAction( tr( "Export Note (HTML)" ), QPixmap( filesave_xpm ), tr( "&Export..." ), CTRL + Key_S, this, "fileSave" );
 152.236 +    connect( a, SIGNAL( activated() ), this, SLOT( textSave() ) );
 152.237 +    a->addTo( tb );
 152.238 +    a->addTo( menu );
 152.239 +	actionFileSave=a;
 152.240 +	
 152.241 +    a = new QAction( tr( "Export Note As (HTML) " ), QPixmap(), tr( "Export &As... (HTML)" ), 0, this, "exportHTML" );
 152.242 +    connect( a, SIGNAL( activated() ), this, SLOT( textSaveAs() ) );
 152.243 +    a->addTo( menu );
 152.244 +	actionFileSaveAs=a;
 152.245 +
 152.246 +    a = new QAction( tr( "Export Note As (ASCII) " ), QPixmap(), tr( "Export &As...(ASCII)" ), ALT + Key_X, this, "exportASCII" );
 152.247 +    connect( a, SIGNAL( activated() ), this, SLOT( textExportAsASCII() ) );
 152.248 +    a->addTo( menu );
 152.249 +	actionFileSaveAs=a;
 152.250 +
 152.251 +    menu->insertSeparator();
 152.252 +    a = new QAction( tr( "Print Note" ), QPixmap( fileprint_xpm ), tr( "&Print..." ), CTRL + Key_P, this, "filePrint" );
 152.253 +    connect( a, SIGNAL( activated() ), this, SLOT( textPrint() ) );
 152.254 +    a->addTo( tb );
 152.255 +    a->addTo( menu );
 152.256 +	actionFilePrint=a;
 152.257 +}
 152.258 +
 152.259 +void TextEditor::setupEditActions()
 152.260 +{
 152.261 +    QToolBar *tb = new QToolBar( this );
 152.262 +    tb->setLabel( "Edit Actions" );
 152.263 +    QPopupMenu *menu = new QPopupMenu( this );
 152.264 +    menuBar()->insertItem( tr( "&Edit" ), menu );
 152.265 +
 152.266 +    QAction *a;
 152.267 +    a = new QAction( tr( "Undo" ), QPixmap(editundo_xpm), tr( "&Undo" ), CTRL + Key_Z, this, "undoEvent" );
 152.268 +    connect( a, SIGNAL( activated() ), e, SLOT( undo() ) );
 152.269 +    a->addTo( menu );
 152.270 +    a->addTo( tb);
 152.271 +	actionEditUndo=a;
 152.272 +	
 152.273 +    a = new QAction( tr( "Redo" ), QPixmap( editredo_xpm ), tr( "&Redo" ), CTRL + Key_Y, this, "editRedo" ); 
 152.274 +    connect( a, SIGNAL( activated() ), e, SLOT( redo() ) );
 152.275 +    a->addTo( tb );
 152.276 +    a->addTo( menu );
 152.277 +	actionEditRedo=a;
 152.278 +
 152.279 +    menu->insertSeparator();
 152.280 +    a = new QAction( tr( "Select and copy all" ), QPixmap(), tr( "Select and copy &all" ), CTRL + Key_A, this, "editcopyall" ); 
 152.281 +    connect( a, SIGNAL( activated() ), this, SLOT( editCopyAll() ) );
 152.282 +    a->addTo( menu );
 152.283 +
 152.284 +    menu->insertSeparator();
 152.285 +    a = new QAction( tr( "Copy" ), QPixmap( editcopy_xpm ), tr( "&Copy" ), CTRL + Key_C, this, "editCopy" );
 152.286 +    connect( a, SIGNAL( activated() ), e, SLOT( copy() ) );
 152.287 +    a->addTo( tb );
 152.288 +    a->addTo( menu );
 152.289 +	actionEditCopy=a;
 152.290 +	
 152.291 +    a = new QAction( tr( "Cut" ), QPixmap( editcut_xpm ), tr( "Cu&t" ), CTRL + Key_X, this, "editCut" );
 152.292 +    connect( a, SIGNAL( activated() ), e, SLOT( cut() ) );
 152.293 +    a->addTo( tb );
 152.294 +    a->addTo( menu );
 152.295 +	actionEditCut=a;
 152.296 +
 152.297 +    a = new QAction( tr( "Paste" ), QPixmap( editpaste_xpm ), tr( "&Paste" ), CTRL + Key_V, this, "editPaste" );
 152.298 +    connect( a, SIGNAL( activated() ), e, SLOT( paste() ) );
 152.299 +    a->addTo( tb );
 152.300 +    a->addTo( menu );
 152.301 +	actionEditPaste=a;
 152.302 +	
 152.303 +    a = new QAction( tr( "Delete all" ), QPixmap( edittrash_xpm ), tr( "&Delete All" ), 0, this, "editDeleteAll" );
 152.304 +    connect( a, SIGNAL( activated() ), e, SLOT( clear() ) );
 152.305 +    a->addTo( tb );
 152.306 +    a->addTo( menu );
 152.307 +	actionEditDeleteAll=a;
 152.308 +
 152.309 +	a = new QAction( tr( "Convert paragraphs to linebreaks" ), QPixmap(), tr( "&Convert Paragraphs" ), ALT + Key_P, this, "editConvertPar" );
 152.310 +    connect( a, SIGNAL( activated() ), this, SLOT( textConvertPar() ) );
 152.311 +    a->addTo( menu );
 152.312 +	actionEditConvertPar=a;
 152.313 +
 152.314 +	a = new QAction( tr( "Join all lines of a paragraph" ), QPixmap(), tr( "&Join lines" ), ALT + Key_J, this, "editJoinLines" );
 152.315 +    connect( a, SIGNAL( activated() ), this, SLOT( textJoinLines() ) );
 152.316 +    a->addTo( menu );
 152.317 +	actionEditJoinLines=a;
 152.318 +}
 152.319 +
 152.320 +void TextEditor::setupFormatActions()
 152.321 +{
 152.322 +    QToolBar *tb = new QToolBar( this );
 152.323 +    tb->setLabel( "Format Actions" );
 152.324 +    QPopupMenu *menu = new QPopupMenu( this );
 152.325 +    menuBar()->insertItem( tr( "&Format" ), menu );
 152.326 +
 152.327 +    QAction *a;
 152.328 +
 152.329 +    a = new QAction( tr( "Toggle font hint for the whole text" ), QPixmap(formatfixedfont_xpm), tr( "&Font hint" ), ALT + Key_I, this, "fontHint" );
 152.330 +	a->setToggleAction (true);
 152.331 +	a->setOn (settings.readBoolEntry ("/vym/noteeditor/fonts/useFixedByDefault",false) );
 152.332 +    connect( a, SIGNAL( activated() ), this, SLOT( toggleFonthint() ) );
 152.333 +    a->addTo( menu );
 152.334 +    a->addTo( tb );
 152.335 +	actionFormatUseFixedFont=a;
 152.336 +
 152.337 +	menu->insertSeparator();
 152.338 +
 152.339 +    comboFont = new QComboBox( true, tb );
 152.340 +    QFontDatabase db;
 152.341 +    comboFont->insertStringList( db.families() );
 152.342 +    connect( comboFont, SIGNAL( activated( const QString & ) ),
 152.343 +	     this, SLOT( textFamily( const QString & ) ) );
 152.344 +    comboFont->lineEdit()->setText( QApplication::font().family() );
 152.345 +
 152.346 +    comboSize = new QComboBox( true, tb );
 152.347 +    QValueList<int> sizes = db.standardSizes();
 152.348 +    QValueList<int>::Iterator it = sizes.begin();
 152.349 +    for ( ; it != sizes.end(); ++it )
 152.350 +	comboSize->insertItem( QString::number( *it ) );
 152.351 +    connect( comboSize, SIGNAL( activated( const QString & ) ),
 152.352 +	     this, SLOT( textSize( const QString & ) ) );
 152.353 +    comboSize->lineEdit()->setText( QString::number( QApplication::font().pointSize() ) );
 152.354 +
 152.355 +    menu->insertSeparator();
 152.356 +
 152.357 +    QPixmap pix( 16, 16 );
 152.358 +    pix.fill( e->color());
 152.359 +    actionTextColor = new QAction( pix, tr( "&Color..." ), 0, this, "textColor" );
 152.360 +    connect( actionTextColor, SIGNAL( activated() ), this, SLOT( textColor() ) );
 152.361 +    actionTextColor->addTo( tb );
 152.362 +    actionTextColor->addTo( menu );
 152.363 +
 152.364 +    actionTextBold = new QAction( QPixmap (formattextbold_xpm), tr( "&Bold" ), CTRL + Key_B, this, "textBold" );
 152.365 +    connect( actionTextBold, SIGNAL( activated() ), this, SLOT( textBold() ) );
 152.366 +    actionTextBold->addTo( tb );
 152.367 +    actionTextBold->addTo( menu );
 152.368 +    actionTextBold->setToggleAction( true );
 152.369 +    actionTextItalic = new QAction( QPixmap(formattextitalic_xpm ), tr( "&Italic" ), CTRL + Key_I, this, "textItalic" );
 152.370 +    connect( actionTextItalic, SIGNAL( activated() ), this, SLOT( textItalic() ) );
 152.371 +    actionTextItalic->addTo( tb );
 152.372 +    actionTextItalic->addTo( menu );
 152.373 +    actionTextItalic->setToggleAction( true );
 152.374 +    actionTextUnderline = new QAction( QPixmap (formattextunder_xpm ), tr( "&Underline" ), CTRL + Key_U, this, "textUnderline" );
 152.375 +    connect( actionTextUnderline, SIGNAL( activated() ), this, SLOT( textUnderline() ) );
 152.376 +    actionTextUnderline->addTo( tb );
 152.377 +    actionTextUnderline->addTo( menu );
 152.378 +    actionTextUnderline->setToggleAction( true );
 152.379 +    menu->insertSeparator();
 152.380 +
 152.381 +    QActionGroup *grp = new QActionGroup( this );
 152.382 +    connect( grp, SIGNAL( selected( QAction* ) ), this, SLOT( textAlign( QAction* ) ) );
 152.383 +
 152.384 +    actionAlignLeft = new QAction( QPixmap (formattextleft_xpm ), tr( "&Left" ), CTRL + Key_L, grp, "textLeft" );
 152.385 +    actionAlignLeft->setToggleAction( true );
 152.386 +    actionAlignCenter = new QAction( QPixmap (formattextcenter_xpm ), tr( "C&enter" ), CTRL + Key_E, grp, "textCenter" );
 152.387 +    actionAlignCenter->setToggleAction( true );
 152.388 +    actionAlignRight = new QAction( QPixmap (formattextright_xpm ), tr( "&Right" ), CTRL + Key_R, grp, "textRight" );
 152.389 +    actionAlignRight->setToggleAction( true );
 152.390 +    actionAlignJustify = new QAction( QPixmap ( formattextjustify_xpm ), tr( "&Justify" ), CTRL + Key_J, grp, "textjustify" );
 152.391 +    actionAlignJustify->setToggleAction( true );
 152.392 +
 152.393 +    grp->addTo( tb );
 152.394 +    grp->addTo( menu );
 152.395 +
 152.396 +    connect( e, SIGNAL( currentFontChanged( const QFont & ) ),
 152.397 +	     this, SLOT( fontChanged( const QFont & ) ) );
 152.398 +    connect( e, SIGNAL( currentColorChanged( const QColor & ) ),
 152.399 +	     this, SLOT( colorChanged( const QColor & ) ) );
 152.400 +    connect( e, SIGNAL( currentAlignmentChanged( int ) ),
 152.401 +	     this, SLOT( alignmentChanged( int ) ) );
 152.402 +
 152.403 +}
 152.404 +
 152.405 +void TextEditor::setupSettingsActions()
 152.406 +{
 152.407 +    QPopupMenu *menu = new QPopupMenu( this );
 152.408 +    menuBar()->insertItem( tr( "&Settings" ), menu );
 152.409 +
 152.410 +    QAction *a;
 152.411 +    a = new QAction( tr( "Set fixed font" ), QPixmap(), tr( "Set &fixed font" ), 0, this, "setFixedFont" );
 152.412 +    connect( a, SIGNAL( activated() ), this, SLOT( setFixedFont() ) );
 152.413 +    a->addTo( menu );
 152.414 +	actionSettingsFixedFont=a;
 152.415 +
 152.416 +    a = new QAction( tr( "Set variable font" ), QPixmap(), tr( "Set &variable font" ), 0, this, "setvariableFont" );
 152.417 +    connect( a, SIGNAL( activated() ), this, SLOT( setVarFont() ) );
 152.418 +    a->addTo( menu );
 152.419 +	actionSettingsVarFont=a;
 152.420 +
 152.421 +    a = new QAction( tr( "Used fixed font by default" ), QPixmap(), tr( "&fixed font is default" ), 0, this, "fonthintDefault" );
 152.422 +	a->setToggleAction (true);
 152.423 +	// set state later in constructor...
 152.424 +    a->addTo( menu );
 152.425 +	actionSettingsFonthintDefault=a;
 152.426 +}
 152.427 +
 152.428 +void TextEditor::textLoad()
 152.429 +{
 152.430 +	if (state!=inactiveEditor)
 152.431 +	{
 152.432 +		if (e->length()) 
 152.433 +		{
 152.434 +			QMessageBox mb( "VYM - Note Editor",
 152.435 +				"Loading will overwrite the existing note",
 152.436 +				QMessageBox::Warning,
 152.437 +				QMessageBox::Yes | QMessageBox::Default,
 152.438 +				QMessageBox::Cancel,
 152.439 +				0 );
 152.440 +			mb.setButtonText( QMessageBox::Yes, "Load note" );
 152.441 +			switch( mb.exec() ) {
 152.442 +				case QMessageBox::Cancel:
 152.443 +					return;
 152.444 +					break;
 152.445 +			}
 152.446 +		} 
 152.447 +		// Load note
 152.448 +		QFileDialog *fd=new QFileDialog( this);
 152.449 +		fd->addFilter ("ASCII texts (*.txt)");
 152.450 +		fd->addFilter ("VYM notes (*.html)");
 152.451 +		fd->show();
 152.452 +		QString fn;
 152.453 +		if ( fd->exec() == QDialog::Accepted )
 152.454 +			fn = fd->selectedFile();
 152.455 +
 152.456 +		if ( !fn.isEmpty() )
 152.457 +		{
 152.458 +			QFile f( fn );
 152.459 +			if ( !f.open( IO_ReadOnly ) )
 152.460 +			return;
 152.461 +
 152.462 +			QTextStream ts( &f );
 152.463 +			setText( ts.read() );
 152.464 +			editorChanged();
 152.465 +		}
 152.466 +	}
 152.467 +}
 152.468 +
 152.469 +void TextEditor::closeEvent( QCloseEvent* ce )
 152.470 +{
 152.471 +    if ( !e->isModified() ) 
 152.472 +	{
 152.473 +		ce->accept();	// TextEditor can be reopened with show()
 152.474 +		return;
 152.475 +    }
 152.476 +}
 152.477 +
 152.478 +QString TextEditor::getText()
 152.479 +{
 152.480 +	return e->text();
 152.481 +}
 152.482 +
 152.483 +void TextEditor::editorChanged()
 152.484 +{
 152.485 +	// received, when QTextEdit::text() has changed
 152.486 +	EditorState	oldstate=state;
 152.487 +
 152.488 +	if (isEmpty())
 152.489 +		state=emptyEditor;
 152.490 +	else
 152.491 +		state=filledEditor;
 152.492 +
 152.493 +	if (state != oldstate)
 152.494 +	{
 152.495 +		if (state==emptyEditor)
 152.496 +			e->setPaper (emptyPaper);
 152.497 +		else
 152.498 +			e->setPaper (filledPaper);
 152.499 +	}
 152.500 +	// SLOT is LinkableMapObj, which will update systemFlag
 152.501 +	emit (textHasChanged() );
 152.502 +}
 152.503 +
 152.504 +
 152.505 +void TextEditor::setText(QString t)
 152.506 +{
 152.507 +	if ( !QStyleSheet::mightBeRichText( t ) )
 152.508 +		t = QStyleSheet::convertFromPlainText( t, QStyleSheetItem::WhiteSpaceNormal );
 152.509 +	e->setReadOnly(false);
 152.510 +	e->setText(t);
 152.511 +	editorChanged();	//not called automagically
 152.512 +
 152.513 +	enableActions();
 152.514 +}
 152.515 +
 152.516 +void TextEditor::setInactive()
 152.517 +{
 152.518 +	setText("");
 152.519 +	state=inactiveEditor;
 152.520 +	e->setPaper (inactivePaper);
 152.521 +	e->setReadOnly (true);
 152.522 +
 152.523 +	disableActions();
 152.524 +}
 152.525 +
 152.526 +void TextEditor::editCopyAll()
 152.527 +{
 152.528 +	e->selectAll();
 152.529 +	e->copy();
 152.530 +}
 152.531 +
 152.532 +void TextEditor::textSaveAs()
 152.533 +{
 152.534 +    QString fn = QFileDialog::getSaveFileName( QString::null, "VYM Note (HTML) (*.html);;All files (*)",
 152.535 +					       this,"export note dialog",tr("Export Note to single file") );
 152.536 +
 152.537 +    if ( !fn.isEmpty() ) 
 152.538 +	{
 152.539 +		QFile file (fn);
 152.540 +		if (file.exists())
 152.541 +		{
 152.542 +			QMessageBox mb( "VYM",
 152.543 +				tr("The file ") + fn + 
 152.544 +				tr(" exists already. "
 152.545 +				"Do you want to overwrite it?"),
 152.546 +			QMessageBox::Warning,
 152.547 +			QMessageBox::Yes | QMessageBox::Default,
 152.548 +			QMessageBox::Cancel | QMessageBox::Escape,
 152.549 +			QMessageBox::NoButton );
 152.550 +			mb.setButtonText( QMessageBox::Yes, tr("Overwrite") );
 152.551 +			mb.setButtonText( QMessageBox::No, tr("Cancel"));
 152.552 +			switch( mb.exec() ) {
 152.553 +				case QMessageBox::Yes:
 152.554 +					// save 
 152.555 +					filename = fn;
 152.556 +					textSave();
 152.557 +					return;
 152.558 +				case QMessageBox::Cancel:
 152.559 +					// do nothing
 152.560 +					break;
 152.561 +			}
 152.562 +		} else
 152.563 +		{
 152.564 +			filename = fn;
 152.565 +			textSave();
 152.566 +			return;
 152.567 +		}			
 152.568 +    }
 152.569 +	statusBar()->message(tr( "Couldn't export note ") + fn, statusbarTime );
 152.570 +}
 152.571 +
 152.572 +
 152.573 +void TextEditor::textSave()
 152.574 +{
 152.575 +    if ( filename.isEmpty() ) 
 152.576 +	{
 152.577 +		textSaveAs();
 152.578 +		return;
 152.579 +    }
 152.580 +
 152.581 +    QString text = e->text();
 152.582 +    QFile f( filename );
 152.583 +    if ( !f.open( IO_WriteOnly ) ) 
 152.584 +	{
 152.585 +		statusBar()->message( QString("Could not write to %1").arg(filename),
 152.586 +					  statusbarTime );
 152.587 +		return;
 152.588 +    }
 152.589 +
 152.590 +    QTextStream t( &f );
 152.591 +    t << text;
 152.592 +    f.close();
 152.593 +
 152.594 +    e->setModified( FALSE );
 152.595 +
 152.596 +    statusBar()->message( QString( "Note exported as %1" ).arg( filename ), statusbarTime );
 152.597 +}
 152.598 +
 152.599 +void TextEditor::textConvertPar()
 152.600 +{
 152.601 +	// In X11 a copy&paste generates paragraphs, 
 152.602 +	// which is not always wanted
 152.603 +	// This function replaces paragraphs by linebreaks.
 152.604 +	int parFrom, parTo, indFrom, indTo;
 152.605 +	e->getSelection (&parFrom,&indFrom,&parTo,&indTo);
 152.606 +	QString t;
 152.607 +	if (parFrom>-1)
 152.608 +		t=e->selectedText();
 152.609 +	else
 152.610 +		t=e->text();
 152.611 +
 152.612 +	QRegExp re("<p.*>");
 152.613 +	re.setMinimal(true);
 152.614 +	t.replace (re,"");
 152.615 +	t.replace ("</p>","<br />");
 152.616 +	if (parFrom>-1)
 152.617 +	{
 152.618 +		e->setCursorPosition (parFrom,indFrom);
 152.619 +		e->cut();
 152.620 +		// Tried to simply insert the changed text with
 152.621 +		// e->insert (t,(uint)(QTextEdit::RemoveSelected));
 152.622 +		// but then the html would be quoted. So I use the ugly
 152.623 +		// way: insert a marker, replace it in whole text of QTextEdit
 152.624 +		QString marker="R3PlAcEMeL4teR!";
 152.625 +		e->insert (marker);
 152.626 +		e->setText (e->text().replace(marker,t));
 152.627 +	} else
 152.628 +		e->setText(t);
 152.629 +}
 152.630 +
 152.631 +void TextEditor::textJoinLines()
 152.632 +{
 152.633 +	int parFrom, parTo, indFrom, indTo;
 152.634 +	e->getSelection (&parFrom,&indFrom,&parTo,&indTo);
 152.635 +	QString t;
 152.636 +	if (parFrom>-1)
 152.637 +		t=e->selectedText();
 152.638 +	else
 152.639 +		t=e->text();
 152.640 +	// In addition to textConvertPar it is sometimes
 152.641 +	// useful to join all lines of a paragraph
 152.642 +	QRegExp re("</p>\n+<p>(?!</p>)");
 152.643 +	re.setMinimal(true);
 152.644 +	t.replace (re," ");
 152.645 +
 152.646 +	// Above we may have introduced new " " at beginning of a
 152.647 +	// paragraph - remove it.
 152.648 +	re.setPattern("<p> ");
 152.649 +	t.replace (re,"<p>");
 152.650 +	if (parFrom>-1)
 152.651 +	{
 152.652 +		e->setCursorPosition (parFrom,indFrom);
 152.653 +		e->cut();
 152.654 +		// Tried to simply insert the changed text with
 152.655 +		// e->insert (t,(uint)(QTextEdit::RemoveSelected));
 152.656 +		// but then the html would be quoted. So I use the ugly
 152.657 +		// way: insert a marker, replace it in whole text of QTextEdit
 152.658 +		QString marker="R3PlAcEMeL4teR!";
 152.659 +		e->insert (marker);
 152.660 +		e->setText (e->text().replace(marker,t));
 152.661 +	} else
 152.662 +		e->setText(t);
 152.663 +}
 152.664 +
 152.665 +QString TextEditor::textConvertToASCII(const QString &t)
 152.666 +{
 152.667 +	QString r=t;
 152.668 +
 152.669 +	// convert all "<br*>" to "\n"
 152.670 +	QRegExp re("<br.*>");
 152.671 +	re.setMinimal(true);
 152.672 +	r.replace (re,"\n");
 152.673 +
 152.674 +	// convert all "</p>" to "\n"
 152.675 +	re.setPattern ("/p");
 152.676 +	r.replace (re,"\n");
 152.677 +	
 152.678 +	// remove all remaining tags 
 152.679 +	re.setPattern ("<.*>");
 152.680 +	r.replace (re,"");
 152.681 +
 152.682 +	// convert "&", "<" and ">"
 152.683 +	re.setPattern ("&gt;");
 152.684 +	r.replace (re,">");
 152.685 +	re.setPattern ("&lt;");
 152.686 +	r.replace (re,"<");
 152.687 +	re.setPattern ("&amp;");
 152.688 +	r.replace (re,"&");
 152.689 +	return r;
 152.690 +}
 152.691 +
 152.692 +void TextEditor::textExportAsASCII()
 152.693 +{
 152.694 +	QString text = textConvertToASCII( e->text());
 152.695 +    QString fn = QFileDialog::getSaveFileName( QString::null, "VYM Note (ASCII) (*.txt);;All files (*)",
 152.696 +					       this,"export note dialog",tr("Export Note to single file (ASCII)") );
 152.697 +	int ret=-1;
 152.698 +
 152.699 +    if ( !fn.isEmpty() ) 
 152.700 +	{
 152.701 +		QFile file (fn);
 152.702 +		if (file.exists())
 152.703 +		{
 152.704 +			QMessageBox mb( "VYM",
 152.705 +				tr("The file ") + fn + 
 152.706 +				tr(" exists already. "
 152.707 +				"Do you want to overwrite it?"),
 152.708 +			QMessageBox::Warning,
 152.709 +			QMessageBox::Yes | QMessageBox::Default,
 152.710 +			QMessageBox::Cancel | QMessageBox::Escape,
 152.711 +			QMessageBox::NoButton );
 152.712 +			mb.setButtonText( QMessageBox::Yes, tr("Overwrite") );
 152.713 +			mb.setButtonText( QMessageBox::No, tr("Cancel"));
 152.714 +			ret=mb.exec();
 152.715 +		}	
 152.716 +		if (ret==QMessageBox::Cancel)
 152.717 +			return;
 152.718 +			
 152.719 +		// save 
 152.720 +		if ( !file.open( IO_WriteOnly ) ) 
 152.721 +			statusBar()->message( QString("Could not write to %1").arg(filename),
 152.722 +						  statusbarTime );
 152.723 +		else
 152.724 +		{
 152.725 +			QTextStream t( &file );
 152.726 +			t << text;
 152.727 +			file.close();
 152.728 +
 152.729 +			statusBar()->message( QString( "Note exported as %1" ).arg( fn ), statusbarTime );
 152.730 +		}
 152.731 +    }
 152.732 +}
 152.733 +
 152.734 +
 152.735 +void TextEditor::textPrint()
 152.736 +{
 152.737 +    printer->setFullPage(TRUE);
 152.738 +    if ( printer->setup( this ) ) 
 152.739 +	{
 152.740 +		QPainter p( printer );
 152.741 +		// Check that there is a valid device to print to.
 152.742 +		if ( !p.device() ) return;
 152.743 +		QPaintDeviceMetrics metrics( p.device() );
 152.744 +		int dpiy = metrics.logicalDpiY();
 152.745 +		int margin = (int) ( (2/2.54)*dpiy ); // 2 cm margins
 152.746 +		QRect body( margin, margin, metrics.width() - 2*margin, metrics.height() - 2*margin );
 152.747 +		QFont font( e->currentFont() );
 152.748 +		font.setPointSize( 10 ); // we define 10pt to be a nice base size for printing
 152.749 +
 152.750 +		QSimpleRichText richText( e->text(), font,
 152.751 +					  e->context(),
 152.752 +					  e->styleSheet(),
 152.753 +					  e->mimeSourceFactory(),
 152.754 +					  body.height() );
 152.755 +		richText.setWidth( &p, body.width() );
 152.756 +		QRect view( body );
 152.757 +		int page = 1;
 152.758 +		do 
 152.759 +		{
 152.760 +			richText.draw( &p, body.left(), body.top(), view, colorGroup() );
 152.761 +			view.moveBy( 0, body.height() );
 152.762 +			p.translate( 0 , -body.height() );
 152.763 +			p.setFont( font );
 152.764 +			p.drawText( view.right() - p.fontMetrics().width( QString::number( page ) ),
 152.765 +				view.bottom() + p.fontMetrics().ascent() + 5, QString::number( page ) );
 152.766 +			if ( view.top()  >= richText.height() )
 152.767 +			break;
 152.768 +			printer->newPage();
 152.769 +			page++;
 152.770 +		} while (TRUE);
 152.771 +    }
 152.772 +}
 152.773 +
 152.774 +void TextEditor::textEditUndo()
 152.775 +{
 152.776 +}
 152.777 +
 152.778 +void TextEditor::toggleFonthint()
 152.779 +{
 152.780 +	setUpdatesEnabled (false);
 152.781 +	e->selectAll (true);
 152.782 +	if (!actionFormatUseFixedFont->isOn() ) 
 152.783 +		e->setCurrentFont (varFont);
 152.784 +	else	
 152.785 +		e->setCurrentFont (fixedFont);
 152.786 +	e->selectAll (false);
 152.787 +	setUpdatesEnabled (true);
 152.788 +	repaint();
 152.789 +}
 152.790 +
 152.791 +void TextEditor::setFixedFont()
 152.792 +{
 152.793 +	bool ok;
 152.794 +	QFont font =QFontDialog::getFont(
 152.795 +                    &ok, fixedFont, this );
 152.796 +    if ( ok ) 
 152.797 +        // font is set to the font the user selected
 152.798 +		fixedFont=font;
 152.799 +}
 152.800 +
 152.801 +void TextEditor::setVarFont()
 152.802 +{
 152.803 +	bool ok;
 152.804 +	QFont font =QFontDialog::getFont(
 152.805 +                    &ok, varFont, this );
 152.806 +    if ( ok ) 
 152.807 +        // font is set to the font the user selected
 152.808 +		varFont=font;
 152.809 +}
 152.810 +
 152.811 +void TextEditor::textBold()
 152.812 +{
 152.813 +    e->setBold( actionTextBold->isOn() );
 152.814 +}
 152.815 +
 152.816 +void TextEditor::textUnderline()
 152.817 +{
 152.818 +    e->setUnderline( actionTextUnderline->isOn() );
 152.819 +}
 152.820 +
 152.821 +void TextEditor::textItalic()
 152.822 +{
 152.823 +    e->setItalic( actionTextItalic->isOn() );
 152.824 +}
 152.825 +
 152.826 +void TextEditor::textFamily( const QString &f )
 152.827 +{
 152.828 +    e->setFamily( f );
 152.829 +}
 152.830 +
 152.831 +void TextEditor::textSize( const QString &p )
 152.832 +{
 152.833 +    e->setPointSize( p.toInt() );
 152.834 +}
 152.835 +
 152.836 +
 152.837 +void TextEditor::textColor()
 152.838 +{
 152.839 +    QColor col = QColorDialog::getColor( e->color(), this );
 152.840 +    if ( !col.isValid() )
 152.841 +	return;
 152.842 +    e->setColor( col );
 152.843 +    QPixmap pix( 16, 16 );
 152.844 +    pix.fill( black );
 152.845 +    actionTextColor->setIconSet( pix );
 152.846 +}
 152.847 +
 152.848 +void TextEditor::textAlign( QAction *a )
 152.849 +{
 152.850 +    if ( a == actionAlignLeft )
 152.851 +	e->setAlignment( AlignLeft );
 152.852 +    else if ( a == actionAlignCenter )
 152.853 +	e->setAlignment( AlignHCenter );
 152.854 +    else if ( a == actionAlignRight )
 152.855 +	e->setAlignment( AlignRight );
 152.856 +    else if ( a == actionAlignJustify )
 152.857 +	e->setAlignment( AlignJustify );
 152.858 +}
 152.859 +
 152.860 +void TextEditor::fontChanged( const QFont &f )
 152.861 +{
 152.862 +    comboFont->lineEdit()->setText( f.family() );
 152.863 +    comboSize->lineEdit()->setText( QString::number( f.pointSize() ) );
 152.864 +    actionTextBold->setOn( f.bold() );
 152.865 +    actionTextItalic->setOn( f.italic() );
 152.866 +    actionTextUnderline->setOn( f.underline() );
 152.867 +}
 152.868 +
 152.869 +void TextEditor::colorChanged( const QColor &c )
 152.870 +{
 152.871 +    QPixmap pix( 16, 16 );
 152.872 +    pix.fill( c );
 152.873 +    actionTextColor->setIconSet( pix );
 152.874 +}
 152.875 +
 152.876 +void TextEditor::alignmentChanged( int a )
 152.877 +{
 152.878 +    if ( ( a == AlignAuto ) || ( a & AlignLeft ))
 152.879 +	actionAlignLeft->setOn( true );
 152.880 +    else if ( ( a & AlignHCenter ) )
 152.881 +	actionAlignCenter->setOn( true );
 152.882 +    else if ( ( a & AlignRight ) )
 152.883 +	actionAlignRight->setOn( true );
 152.884 +    else if ( ( a & AlignJustify ) )
 152.885 +	actionAlignJustify->setOn( true );
 152.886 +}
 152.887 +
 152.888 +
 152.889 +
 152.890 +void TextEditor::enableActions()
 152.891 +{
 152.892 +	actionFileLoad->setEnabled(true);
 152.893 +	actionFileSave->setEnabled(true);
 152.894 +	actionFileSaveAs->setEnabled(true);
 152.895 +	actionFilePrint->setEnabled(true);
 152.896 +	actionEditUndo->setEnabled(true);
 152.897 +	actionEditRedo->setEnabled(true);
 152.898 +	actionEditCopy->setEnabled(true);
 152.899 +	actionEditCut->setEnabled(true);
 152.900 +	actionEditPaste->setEnabled(true);
 152.901 +	actionEditDeleteAll->setEnabled(true);
 152.902 +	actionEditConvertPar->setEnabled(true);
 152.903 +	actionEditJoinLines->setEnabled(true);
 152.904 +	actionFormatUseFixedFont->setEnabled(true);
 152.905 +}
 152.906 +
 152.907 +void TextEditor::disableActions()
 152.908 +{
 152.909 +	actionFileLoad->setEnabled(false);
 152.910 +	actionFileSave->setEnabled(false);
 152.911 +	actionFileSaveAs->setEnabled(false);
 152.912 +	actionFilePrint->setEnabled(false);
 152.913 +	actionEditUndo->setEnabled(false);
 152.914 +	actionEditRedo->setEnabled(false);
 152.915 +	actionEditCopy->setEnabled(false);
 152.916 +	actionEditCut->setEnabled(false);
 152.917 +	actionEditPaste->setEnabled(false);
 152.918 +	actionEditDeleteAll->setEnabled(false);
 152.919 +	actionEditConvertPar->setEnabled(false);
 152.920 +	actionEditJoinLines->setEnabled(false);
 152.921 +	actionFormatUseFixedFont->setEnabled(false);
 152.922 +}
 152.923 +
 152.924 +
   153.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   153.2 +++ b/texteditor.h	Sun Jan 30 12:59:10 2005 +0000
   153.3 @@ -0,0 +1,123 @@
   153.4 +#ifndef TEXTEDITOR_H 
   153.5 +#define TEXTEDITOR_H
   153.6 +
   153.7 +#include <qmainwindow.h>
   153.8 +#include <qtextedit.h>
   153.9 +#include <qaction.h>
  153.10 +#include <qfontdatabase.h>
  153.11 +#include <qcombobox.h>
  153.12 +
  153.13 +
  153.14 +enum EditorState {inactiveEditor,emptyEditor,filledEditor};
  153.15 +
  153.16 +class TextEditor : public QMainWindow {
  153.17 +    Q_OBJECT
  153.18 +public:
  153.19 +    TextEditor();
  153.20 +    ~TextEditor();
  153.21 +
  153.22 +	bool isEmpty();
  153.23 +	void setShowWithMain (bool);
  153.24 +	bool showWithMain ();
  153.25 +	void setFontHint(const QString&);
  153.26 +	QString getFontHint();
  153.27 +	QString getFontHintDefault();
  153.28 +	void setFilename (const QString&);
  153.29 +	QString getFilename ();
  153.30 +	bool findText(const QString &, const bool &); // find Text 
  153.31 +
  153.32 +protected:
  153.33 +	void setupFileActions();
  153.34 +	void setupEditActions();
  153.35 +	void setupFormatActions();
  153.36 +	void setupSettingsActions();
  153.37 +    void closeEvent( QCloseEvent* );
  153.38 +	
  153.39 +
  153.40 +public:
  153.41 +	QString getText();
  153.42 +
  153.43 +public slots:
  153.44 +	void editorChanged();	// received when text() changed
  153.45 +	void setText(QString);	// set Text (by MapEditor)
  153.46 +	void setInactive();		// Nothing can be entered
  153.47 +	void editCopyAll();
  153.48 +
  153.49 +signals:
  153.50 +	void textHasChanged();
  153.51 +	void fontFamilyHasChanged();
  153.52 +	void fontSizeHasChanged();
  153.53 +	
  153.54 +private slots:
  153.55 +    void textLoad();
  153.56 +    void textSaveAs();
  153.57 +    void textSave();
  153.58 +	void textConvertPar();
  153.59 +	void textJoinLines();
  153.60 +	QString textConvertToASCII(const QString &);
  153.61 +	void textExportAsASCII();
  153.62 +    void textPrint();
  153.63 +	void textEditUndo();
  153.64 +    void toggleFonthint();
  153.65 +    void setFixedFont();
  153.66 +    void setVarFont();
  153.67 +    void textBold();
  153.68 +    void textUnderline();
  153.69 +    void textItalic();
  153.70 +    void textFamily( const QString &f );
  153.71 +    void textSize( const QString &p );
  153.72 +	void textColor();
  153.73 +	void textAlign(QAction*);
  153.74 +    void fontChanged( const QFont &f );
  153.75 +    void colorChanged( const QColor &c );
  153.76 +    void alignmentChanged( int a );
  153.77 +	void enableActions();
  153.78 +	void disableActions();
  153.79 +
  153.80 +private:
  153.81 +    QPrinter *printer;
  153.82 +    QTextEdit *e;
  153.83 +	QPoint lastPos;			// save last position of window
  153.84 +    QString filename;
  153.85 +
  153.86 +	QBrush emptyPaper;		// setting the background color
  153.87 +	QBrush filledPaper;		// depending on the state
  153.88 +	QBrush inactivePaper;	// depending on the state
  153.89 +	EditorState state;
  153.90 +	bool showwithmain;		// same visibility as mainwindow?
  153.91 +
  153.92 +	QFont varFont;
  153.93 +	QFont fixedFont;
  153.94 +    QComboBox
  153.95 +	*comboFont,
  153.96 +	*comboSize;
  153.97 +	
  153.98 +	QAction *actionFileLoad,
  153.99 +	*actionFileSave,
 153.100 +	*actionFileSaveAs,
 153.101 +	*actionFilePrint,
 153.102 +	*actionEditUndo,
 153.103 +	*actionEditRedo,
 153.104 +	*actionEditCopy,
 153.105 +	*actionEditCut,
 153.106 +	*actionEditPaste,
 153.107 +	*actionEditDeleteAll,
 153.108 +	*actionEditConvertPar,
 153.109 +	*actionEditJoinLines,
 153.110 +	*actionFormatUseFixedFont,
 153.111 +	*actionSettingsVarFont,
 153.112 +	*actionSettingsFixedFont,
 153.113 +	*actionSettingsFonthintDefault,
 153.114 +    *actionTextBold,
 153.115 +	*actionTextUnderline,
 153.116 +	*actionTextItalic,
 153.117 +	*actionTextColor,
 153.118 +	*actionAlignLeft,
 153.119 +	*actionAlignCenter,
 153.120 +	*actionAlignRight,
 153.121 +	*actionAlignJustify;
 153.122 +
 153.123 +
 153.124 +};
 153.125 +
 153.126 +#endif
   154.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   154.2 +++ b/version.h	Sun Jan 30 12:59:10 2005 +0000
   154.3 @@ -0,0 +1,7 @@
   154.4 +#ifndef VERSION_H 
   154.5 +#define VERSION_H
   154.6 +
   154.7 +#define __VYM_VERSION__ "1.6.0"
   154.8 +#define __BUILD_DATE__ "January 4, 2005"
   154.9 +
  154.10 +#endif
   155.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   155.2 +++ b/vym.pro	Sun Jan 30 12:59:10 2005 +0000
   155.3 @@ -0,0 +1,81 @@
   155.4 +TARGET  = vym
   155.5 +TRANSLATIONS += vym_de.ts
   155.6 +
   155.7 +TEMPLATE	= app
   155.8 +LANGUAGE	= C++
   155.9 +
  155.10 +CONFIG	+= qt warn_on release
  155.11 +
  155.12 +DESTROOT = /usr
  155.13 +
  155.14 +target.path = $${DESTROOT}/bin
  155.15 +INSTALLS += target
  155.16 +
  155.17 +support.files = styles/ scripts/ icons/
  155.18 +support.path = $${DESTROOT}/share/vym
  155.19 +INSTALLS += support 
  155.20 +
  155.21 +doc.files = doc/*
  155.22 +doc.path = $${DESTROOT}/share/doc/packages/vym
  155.23 +INSTALLS += doc
  155.24 +
  155.25 +demo.files = demos/
  155.26 +demo.path = $${DESTROOT}/share/vym
  155.27 +INSTALLS += demo
  155.28 +
  155.29 +
  155.30 +HEADERS	+= branchobj.h \
  155.31 +	exports.h \
  155.32 +	findwindow.h \
  155.33 +	flagobj.h \
  155.34 +	flagrowobj.h \
  155.35 +	floatimageobj.h \
  155.36 +	floatobj.h \
  155.37 +	frameobj.h \
  155.38 +	headingobj.h \
  155.39 +	imageobj.h \
  155.40 +	linkablemapobj.h \
  155.41 +	mainwindow.h \
  155.42 +	mapcenterobj.h \
  155.43 +	mapeditor.h \
  155.44 +	mapobj.h \
  155.45 +	misc.h \
  155.46 +	noteobj.h \
  155.47 +	ornamentedobj.h \
  155.48 +	process.h \
  155.49 +	selection.h \
  155.50 +	texteditor.h \
  155.51 +	version.h \
  155.52 +	xml.h \
  155.53 +	settings.h \
  155.54 +	options.h
  155.55 +SOURCES	+= branchobj.cpp \
  155.56 +	exports.cpp \
  155.57 +	findwindow.cpp \
  155.58 +	flagobj.cpp \
  155.59 +	flagrowobj.cpp \
  155.60 +	floatimageobj.cpp \
  155.61 +	floatobj.cpp \
  155.62 +	frameobj.cpp \
  155.63 +	headingobj.cpp \
  155.64 +	imageobj.cpp \
  155.65 +	linkablemapobj.cpp \
  155.66 +	main.cpp \
  155.67 +	mainwindow.cpp \
  155.68 +	mapcenterobj.cpp \
  155.69 +	mapeditor.cpp \
  155.70 +	mapobj.cpp \
  155.71 +	misc.cpp \
  155.72 +	noteobj.cpp \
  155.73 +	ornamentedobj.cpp \
  155.74 +	process.cpp \
  155.75 +	selection.cpp \
  155.76 +	texteditor.cpp \
  155.77 +	xml.cpp \
  155.78 +	settings.cpp \
  155.79 +	options.cpp
  155.80 +FORMS	= exporthtmldialog.ui \
  155.81 +	exportxhtmldialog.ui \
  155.82 +	showtextdialog.ui \
  155.83 +	extrainfodialog.ui
  155.84 +
   156.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   156.2 +++ b/vym_de.ts	Sun Jan 30 12:59:10 2005 +0000
   156.3 @@ -0,0 +1,1574 @@
   156.4 +<!DOCTYPE TS><TS>
   156.5 +<context>
   156.6 +    <name>ExportHTMLDialog</name>
   156.7 +    <message>
   156.8 +        <source>Export HTML</source>
   156.9 +        <translation>Exportiere HTML</translation>
  156.10 +    </message>
  156.11 +    <message>
  156.12 +        <source>Directory:</source>
  156.13 +        <translation>Verzeichnis:</translation>
  156.14 +    </message>
  156.15 +    <message>
  156.16 +        <source>Browse</source>
  156.17 +        <translation>Durchsuchen</translation>
  156.18 +    </message>
  156.19 +    <message>
  156.20 +        <source>Options</source>
  156.21 +        <translation>Optionen</translation>
  156.22 +    </message>
  156.23 +    <message>
  156.24 +        <source>Include image of map</source>
  156.25 +        <translation>Bild der Map erzeugen</translation>
  156.26 +    </message>
  156.27 +    <message>
  156.28 +        <source>use WIKI style</source>
  156.29 +        <translation>WIKI Stil verwenden</translation>
  156.30 +    </message>
  156.31 +    <message>
  156.32 +        <source>show output</source>
  156.33 +        <translation type="obsolete">Ausgabe der Scripte anzeigen</translation>
  156.34 +    </message>
  156.35 +    <message>
  156.36 +        <source>Export</source>
  156.37 +        <translation>Exportieren</translation>
  156.38 +    </message>
  156.39 +    <message>
  156.40 +        <source>Cancel</source>
  156.41 +        <translation>Abbrechen</translation>
  156.42 +    </message>
  156.43 +    <message>
  156.44 +        <source>VYM - Export HTML to directory</source>
  156.45 +        <translation>VYM - Exportiere HTML in Verzeichnis</translation>
  156.46 +    </message>
  156.47 +    <message>
  156.48 +        <source>Critcal export error</source>
  156.49 +        <translation>Kritischer Fehler beim Exportieren</translation>
  156.50 +    </message>
  156.51 +    <message>
  156.52 +        <source>create image only</source>
  156.53 +        <translation>Nur Bild erzeugen</translation>
  156.54 +    </message>
  156.55 +    <message>
  156.56 +        <source>use heading for URLs (instead of link target)</source>
  156.57 +        <translation>Verwende Zweigbeschriftung für URL</translation>
  156.58 +    </message>
  156.59 +    <message>
  156.60 +        <source>use image of earth to mark URLs in text</source>
  156.61 +        <translation>Verwende Globus Symbol für URLs</translation>
  156.62 +    </message>
  156.63 +    <message>
  156.64 +        <source>show output of external scripts</source>
  156.65 +        <translation>Zeige Ausgabe der externen Skripte</translation>
  156.66 +    </message>
  156.67 +    <message>
  156.68 +        <source>use default CSS file</source>
  156.69 +        <translation>Default CSS Datei verwenden</translation>
  156.70 +    </message>
  156.71 +</context>
  156.72 +<context>
  156.73 +    <name>ExportXHTMLDialog</name>
  156.74 +    <message>
  156.75 +        <source>Export XHTML</source>
  156.76 +        <translation>Exportiere XHTML</translation>
  156.77 +    </message>
  156.78 +    <message>
  156.79 +        <source>Directory:</source>
  156.80 +        <translation type="obsolete">Verzeichnis:</translation>
  156.81 +    </message>
  156.82 +    <message>
  156.83 +        <source>Browse</source>
  156.84 +        <translation>Durchsuchen</translation>
  156.85 +    </message>
  156.86 +    <message>
  156.87 +        <source>Options</source>
  156.88 +        <translation>Optionen</translation>
  156.89 +    </message>
  156.90 +    <message>
  156.91 +        <source>Include image</source>
  156.92 +        <translation>Bild erzeugen</translation>
  156.93 +    </message>
  156.94 +    <message>
  156.95 +        <source>Include text</source>
  156.96 +        <translation type="obsolete">Text erzeugen</translation>
  156.97 +    </message>
  156.98 +    <message>
  156.99 +        <source>show output of external scripts</source>
 156.100 +        <translation>Zeige Ausgabe der externen Skripte</translation>
 156.101 +    </message>
 156.102 +    <message>
 156.103 +        <source>Export</source>
 156.104 +        <translation>Exportieren</translation>
 156.105 +    </message>
 156.106 +    <message>
 156.107 +        <source>Cancel</source>
 156.108 +        <translation>Abbrechen</translation>
 156.109 +    </message>
 156.110 +    <message>
 156.111 +        <source>VYM - Export HTML to directory</source>
 156.112 +        <translation>VYM - Exportiere HTML in Verzeichnis</translation>
 156.113 +    </message>
 156.114 +    <message>
 156.115 +        <source>Critical Error</source>
 156.116 +        <translation>Kritischer Fehler</translation>
 156.117 +    </message>
 156.118 +    <message>
 156.119 +        <source>Couldn&apos;t start </source>
 156.120 +        <translation>Konnte nicht starten</translation>
 156.121 +    </message>
 156.122 +    <message>
 156.123 +        <source>didn&apos;t exit normally</source>
 156.124 +        <translation>Exportiere XHTML</translation>
 156.125 +    </message>
 156.126 +    <message>
 156.127 +        <source>Export to directory:</source>
 156.128 +        <translation>Export Verzeichnis:</translation>
 156.129 +    </message>
 156.130 +    <message>
 156.131 +        <source>Colored headings in text</source>
 156.132 +        <translation>Farbige Headings im Text</translation>
 156.133 +    </message>
 156.134 +    <message>
 156.135 +        <source>showWarnings e.g. if directory is not empty</source>
 156.136 +        <translation>Warnung, falls Verzeichnis nicht leer ist</translation>
 156.137 +    </message>
 156.138 +    <message>
 156.139 +        <source>Stylesheets</source>
 156.140 +        <translation>Stylesheets</translation>
 156.141 +    </message>
 156.142 +    <message>
 156.143 +        <source>CSS:</source>
 156.144 +        <translation>CSS:</translation>
 156.145 +    </message>
 156.146 +    <message>
 156.147 +        <source>XSL:</source>
 156.148 +        <translation>XSL:</translation>
 156.149 +    </message>
 156.150 +    <message>
 156.151 +        <source>VYM - Path to CSS file</source>
 156.152 +        <translation>VYM - Pfad zu CSS Datei</translation>
 156.153 +    </message>
 156.154 +    <message>
 156.155 +        <source>VYM - Path to XSL file</source>
 156.156 +        <translation>VYM - Pfad zu XSL Datei</translation>
 156.157 +    </message>
 156.158 +    <message>
 156.159 +        <source>Warning</source>
 156.160 +        <translation>Warnung</translation>
 156.161 +    </message>
 156.162 +    <message>
 156.163 +        <source> could not be opened!</source>
 156.164 +        <translation>konnte nicht geöffnet werden!</translation>
 156.165 +    </message>
 156.166 +    <message>
 156.167 +        <source>Save settings in map</source>
 156.168 +        <translation>Einstellungen in map speichern</translation>
 156.169 +    </message>
 156.170 +    <message>
 156.171 +        <source>Scripts</source>
 156.172 +        <translation>Skripte</translation>
 156.173 +    </message>
 156.174 +    <message>
 156.175 +        <source>Before export:</source>
 156.176 +        <translation>Vor Export:</translation>
 156.177 +    </message>
 156.178 +    <message>
 156.179 +        <source>After Export:</source>
 156.180 +        <translation>Nach Export:</translation>
 156.181 +    </message>
 156.182 +    <message>
 156.183 +        <source>The settings saved in the map would like to run scripts:
 156.184 +
 156.185 +</source>
 156.186 +        <translation>Die in der Map gespeicherten Einstellungen wollen Skripte starten:
 156.187 +
 156.188 +</translation>
 156.189 +    </message>
 156.190 +    <message>
 156.191 +        <source>Please check, if you really
 156.192 +want to allow this in your system!</source>
 156.193 +        <translation>Bitte prüfen Sie, ob Sie das in Ihrem
 156.194 +System wirklich zulassen wollen!</translation>
 156.195 +    </message>
 156.196 +    <message>
 156.197 +        <source>VYM - Path to pre export script</source>
 156.198 +        <translation>VYM - Pfad für Prä-Export Skript</translation>
 156.199 +    </message>
 156.200 +    <message>
 156.201 +        <source>VYM - Path to post export script</source>
 156.202 +        <translation>VYM -Pfad für Post-Export Skript</translation>
 156.203 +    </message>
 156.204 +</context>
 156.205 +<context>
 156.206 +    <name>ExtraInfoDialog</name>
 156.207 +    <message>
 156.208 +        <source>VYM - Info</source>
 156.209 +        <translation>VYM - Info</translation>
 156.210 +    </message>
 156.211 +    <message>
 156.212 +        <source>Map:</source>
 156.213 +        <translation>Map:</translation>
 156.214 +    </message>
 156.215 +    <message>
 156.216 +        <source>Author:</source>
 156.217 +        <translation>Author:</translation>
 156.218 +    </message>
 156.219 +    <message>
 156.220 +        <source>Comment:</source>
 156.221 +        <translation>Kommentar:</translation>
 156.222 +    </message>
 156.223 +    <message>
 156.224 +        <source>Statistics:</source>
 156.225 +        <translation>Statistik:</translation>
 156.226 +    </message>
 156.227 +    <message>
 156.228 +        <source>Cancel</source>
 156.229 +        <translation>Abbrechen</translation>
 156.230 +    </message>
 156.231 +    <message>
 156.232 +        <source>Close</source>
 156.233 +        <translation>Schliessen</translation>
 156.234 +    </message>
 156.235 +</context>
 156.236 +<context>
 156.237 +    <name>FindWindow</name>
 156.238 +    <message>
 156.239 +        <source>Clear</source>
 156.240 +        <translation>Neuer Suchbegriff</translation>
 156.241 +    </message>
 156.242 +    <message>
 156.243 +        <source>Cancel</source>
 156.244 +        <translation>Abbrechen</translation>
 156.245 +    </message>
 156.246 +    <message>
 156.247 +        <source>Find</source>
 156.248 +        <translation>Suchen</translation>
 156.249 +    </message>
 156.250 +</context>
 156.251 +<context>
 156.252 +    <name>Main</name>
 156.253 +    <message>
 156.254 +        <source>&amp;File</source>
 156.255 +        <translation>&amp;Datei</translation>
 156.256 +    </message>
 156.257 +    <message>
 156.258 +        <source>New map</source>
 156.259 +        <translation>Neu</translation>
 156.260 +    </message>
 156.261 +    <message>
 156.262 +        <source>&amp;New...</source>
 156.263 +        <translation>&amp;Neu...</translation>
 156.264 +    </message>
 156.265 +    <message>
 156.266 +        <source>Open</source>
 156.267 +        <translation>Öffnen</translation>
 156.268 +    </message>
 156.269 +    <message>
 156.270 +        <source>&amp;Open...</source>
 156.271 +        <translation>&amp;Öffnen...</translation>
 156.272 +    </message>
 156.273 +    <message>
 156.274 +        <source>Save</source>
 156.275 +        <translation>Speichern</translation>
 156.276 +    </message>
 156.277 +    <message>
 156.278 +        <source>&amp;Save...</source>
 156.279 +        <translation>Speichern &amp;unter...</translation>
 156.280 +    </message>
 156.281 +    <message>
 156.282 +        <source>Save &amp;As...</source>
 156.283 +        <translation>Speichern &amp;unter...</translation>
 156.284 +    </message>
 156.285 +    <message>
 156.286 +        <source>Import directory structure (experimental)</source>
 156.287 +        <translation>Importiere Verzeichnisstruktur (experimentelle Funktion)</translation>
 156.288 +    </message>
 156.289 +    <message>
 156.290 +        <source>Import Dir</source>
 156.291 +        <translation>Importiere Verzeichnis</translation>
 156.292 +    </message>
 156.293 +    <message>
 156.294 +        <source>Export (png)</source>
 156.295 +        <translation type="obsolete">Exportiere als png-Grafik</translation>
 156.296 +    </message>
 156.297 +    <message>
 156.298 +        <source>&amp;Export (png)</source>
 156.299 +        <translation type="obsolete">&amp;Export (png)</translation>
 156.300 +    </message>
 156.301 +    <message>
 156.302 +        <source>Print</source>
 156.303 +        <translation>Drucken</translation>
 156.304 +    </message>
 156.305 +    <message>
 156.306 +        <source>&amp;Print...</source>
 156.307 +        <translation>&amp;Drucken...</translation>
 156.308 +    </message>
 156.309 +    <message>
 156.310 +        <source>Close Map</source>
 156.311 +        <translation>Schließen</translation>
 156.312 +    </message>
 156.313 +    <message>
 156.314 +        <source>&amp;Close Map</source>
 156.315 +        <translation>Schlie&amp;ßen</translation>
 156.316 +    </message>
 156.317 +    <message>
 156.318 +        <source>Exit VYM</source>
 156.319 +        <translation>Beenden</translation>
 156.320 +    </message>
 156.321 +    <message>
 156.322 +        <source>E&amp;xit VYM</source>
 156.323 +        <translation>B&amp;eenden</translation>
 156.324 +    </message>
 156.325 +    <message>
 156.326 +        <source>&amp;Edit</source>
 156.327 +        <translation>&amp;Bearbeiten</translation>
 156.328 +    </message>
 156.329 +    <message>
 156.330 +        <source>Undo</source>
 156.331 +        <translation>Rückgängig</translation>
 156.332 +    </message>
 156.333 +    <message>
 156.334 +        <source>&amp;Undo</source>
 156.335 +        <translation>&amp;Rückgängig</translation>
 156.336 +    </message>
 156.337 +    <message>
 156.338 +        <source>Copy</source>
 156.339 +        <translation>Kopieren</translation>
 156.340 +    </message>
 156.341 +    <message>
 156.342 +        <source>&amp;Copy</source>
 156.343 +        <translation>&amp;Kopieren</translation>
 156.344 +    </message>
 156.345 +    <message>
 156.346 +        <source>Cut</source>
 156.347 +        <translation>Ausschneiden</translation>
 156.348 +    </message>
 156.349 +    <message>
 156.350 +        <source>Cu&amp;t</source>
 156.351 +        <translation>&amp;Ausschneiden</translation>
 156.352 +    </message>
 156.353 +    <message>
 156.354 +        <source>Paste</source>
 156.355 +        <translation>Einfügen</translation>
 156.356 +    </message>
 156.357 +    <message>
 156.358 +        <source>&amp;Paste</source>
 156.359 +        <translation>Ein&amp;fügen</translation>
 156.360 +    </message>
 156.361 +    <message>
 156.362 +        <source>Move branch up</source>
 156.363 +        <translation>Zweig nach oben bewegen</translation>
 156.364 +    </message>
 156.365 +    <message>
 156.366 +        <source>Move up</source>
 156.367 +        <translation>Zweig nach oben</translation>
 156.368 +    </message>
 156.369 +    <message>
 156.370 +        <source>Move branch down</source>
 156.371 +        <translation>Zweig nach unten bewegen</translation>
 156.372 +    </message>
 156.373 +    <message>
 156.374 +        <source>Move down</source>
 156.375 +        <translation>Zweig nach unten</translation>
 156.376 +    </message>
 156.377 +    <message>
 156.378 +        <source>Scroll branch</source>
 156.379 +        <translation>Zweig einrollen</translation>
 156.380 +    </message>
 156.381 +    <message>
 156.382 +        <source>Unscroll all</source>
 156.383 +        <translation>Alles aufrollen</translation>
 156.384 +    </message>
 156.385 +    <message>
 156.386 +        <source>Unscroll all scrolled branches</source>
 156.387 +        <translation>Alle eingerollten Zweige aufrollen</translation>
 156.388 +    </message>
 156.389 +    <message>
 156.390 +        <source>Find</source>
 156.391 +        <translation>Finde</translation>
 156.392 +    </message>
 156.393 +    <message>
 156.394 +        <source>Open URL</source>
 156.395 +        <translation>URL öffnen</translation>
 156.396 +    </message>
 156.397 +    <message>
 156.398 +        <source>Edit URL</source>
 156.399 +        <translation>URL ändern</translation>
 156.400 +    </message>
 156.401 +    <message>
 156.402 +        <source>Use heading of selected branch as URL</source>
 156.403 +        <translation>Beschriftung dieses Zweiges auch als URL verwenden</translation>
 156.404 +    </message>
 156.405 +    <message>
 156.406 +        <source>Use heading for URL</source>
 156.407 +        <translation>Beschriftung als URL übernehmen</translation>
 156.408 +    </message>
 156.409 +    <message>
 156.410 +        <source>Jump to another vym map, if needed load it first</source>
 156.411 +        <translation>Gehe zu einer weiteren Map. (Falls nötig wird die Map vorher geöffnet.)</translation>
 156.412 +    </message>
 156.413 +    <message>
 156.414 +        <source>Jump to map</source>
 156.415 +        <translation>Gehe zu einer weiteren Map.</translation>
 156.416 +    </message>
 156.417 +    <message>
 156.418 +        <source>Edit link to another vym map</source>
 156.419 +        <translation>Bearbeite Verbindung zu einer Map</translation>
 156.420 +    </message>
 156.421 +    <message>
 156.422 +        <source>Edit map link</source>
 156.423 +        <translation type="obsolete">Bearbeite Verbindung zu einer Map</translation>
 156.424 +    </message>
 156.425 +    <message>
 156.426 +        <source>edit Heading</source>
 156.427 +        <translation>Bearbeite Zweig-Ãœberschrift</translation>
 156.428 +    </message>
 156.429 +    <message>
 156.430 +        <source>Edit heading</source>
 156.431 +        <translation>Bearbeite Zweig-Ãœberschrift</translation>
 156.432 +    </message>
 156.433 +    <message>
 156.434 +        <source>Delete Selection</source>
 156.435 +        <translation>Entfernen</translation>
 156.436 +    </message>
 156.437 +    <message>
 156.438 +        <source>Add a branch as child of selection</source>
 156.439 +        <translation>Neuer Zweig </translation>
 156.440 +    </message>
 156.441 +    <message>
 156.442 +        <source>Add branch as child</source>
 156.443 +        <translation>Neuer Zweig </translation>
 156.444 +    </message>
 156.445 +    <message>
 156.446 +        <source>Add a branch above selection</source>
 156.447 +        <translation>Neuer Zweig - oben</translation>
 156.448 +    </message>
 156.449 +    <message>
 156.450 +        <source>Add branch above</source>
 156.451 +        <translation>Neuer Zweig - oben</translation>
 156.452 +    </message>
 156.453 +    <message>
 156.454 +        <source>Add a branch below selection</source>
 156.455 +        <translation>Neuer Zweig - unten</translation>
 156.456 +    </message>
 156.457 +    <message>
 156.458 +        <source>Add branch below</source>
 156.459 +        <translation>Neuer Zweig - unten</translation>
 156.460 +    </message>
 156.461 +    <message>
 156.462 +        <source>Select upper branch</source>
 156.463 +        <translation>Zweig oben</translation>
 156.464 +    </message>
 156.465 +    <message>
 156.466 +        <source>Select lower branch</source>
 156.467 +        <translation>Zweig unten</translation>
 156.468 +    </message>
 156.469 +    <message>
 156.470 +        <source>Select left branch</source>
 156.471 +        <translation>Zweig links</translation>
 156.472 +    </message>
 156.473 +    <message>
 156.474 +        <source>Select right branch</source>
 156.475 +        <translation>Zweig rechts</translation>
 156.476 +    </message>
 156.477 +    <message>
 156.478 +        <source>Select child branch</source>
 156.479 +        <translation>Kind-Zweig</translation>
 156.480 +    </message>
 156.481 +    <message>
 156.482 +        <source>Select first branch</source>
 156.483 +        <translation>Oberster Zweig</translation>
 156.484 +    </message>
 156.485 +    <message>
 156.486 +        <source>Select last branch</source>
 156.487 +        <translation>Unterster Zweig</translation>
 156.488 +    </message>
 156.489 +    <message>
 156.490 +        <source>Add Image</source>
 156.491 +        <translation>Lade Bild</translation>
 156.492 +    </message>
 156.493 +    <message>
 156.494 +        <source>&amp;Format</source>
 156.495 +        <translation>&amp;Format</translation>
 156.496 +    </message>
 156.497 +    <message>
 156.498 +        <source>Set Color</source>
 156.499 +        <translation>Wähle Farbe</translation>
 156.500 +    </message>
 156.501 +    <message>
 156.502 +        <source>Set &amp;Color</source>
 156.503 +        <translation>Wähle &amp;Farbe</translation>
 156.504 +    </message>
 156.505 +    <message>
 156.506 +        <source>Pick color
 156.507 +Hint: You can pick a color from another branch and color using CTRL+Left Button</source>
 156.508 +        <translation>Farb übernehmen
 156.509 +Tipp: Zum Kopieren einer Farbe kann man auch CTRL+linke Maustaste nehmen.</translation>
 156.510 +    </message>
 156.511 +    <message>
 156.512 +        <source>Pic&amp;k color</source>
 156.513 +        <translation>Farbe &amp;übernehmen</translation>
 156.514 +    </message>
 156.515 +    <message>
 156.516 +        <source>Color branch</source>
 156.517 +        <translation>Zweig färben</translation>
 156.518 +    </message>
 156.519 +    <message>
 156.520 +        <source>Color &amp;branch</source>
 156.521 +        <translation>Zweig &amp;färben</translation>
 156.522 +    </message>
 156.523 +    <message>
 156.524 +        <source>Color Subtree</source>
 156.525 +        <translation>Unterbaum färben</translation>
 156.526 +    </message>
 156.527 +    <message>
 156.528 +        <source>Color sub&amp;tree</source>
 156.529 +        <translation>&amp;Unterbaum färben</translation>
 156.530 +    </message>
 156.531 +    <message>
 156.532 +        <source>Line</source>
 156.533 +        <translation>Linie</translation>
 156.534 +    </message>
 156.535 +    <message>
 156.536 +        <source>Linkstyle Line</source>
 156.537 +        <translation>Linie</translation>
 156.538 +    </message>
 156.539 +    <message>
 156.540 +        <source>Linkstyle Parabel</source>
 156.541 +        <translation>Parabel</translation>
 156.542 +    </message>
 156.543 +    <message>
 156.544 +        <source>PolyLine</source>
 156.545 +        <translation>Dicke Linie</translation>
 156.546 +    </message>
 156.547 +    <message>
 156.548 +        <source>Linkstyle Thick Line</source>
 156.549 +        <translation>Dicke Linie</translation>
 156.550 +    </message>
 156.551 +    <message>
 156.552 +        <source>PolyParabel</source>
 156.553 +        <translation>Dicke Parabel</translation>
 156.554 +    </message>
 156.555 +    <message>
 156.556 +        <source>Linkstyle Thick Parabel</source>
 156.557 +        <translation>Dicke Parabel</translation>
 156.558 +    </message>
 156.559 +    <message>
 156.560 +        <source>No Frame</source>
 156.561 +        <translation>Kein Rahmen</translation>
 156.562 +    </message>
 156.563 +    <message>
 156.564 +        <source>Rectangle</source>
 156.565 +        <translation>Rechteck</translation>
 156.566 +    </message>
 156.567 +    <message>
 156.568 +        <source>Use same color for links and headings</source>
 156.569 +        <translation>Verbindungen haben Farbe der Beschriftungen</translation>
 156.570 +    </message>
 156.571 +    <message>
 156.572 +        <source>&amp;Use color of heading for link</source>
 156.573 +        <translation>&amp;Verbindungen haben Farbe der Beschriftungen</translation>
 156.574 +    </message>
 156.575 +    <message>
 156.576 +        <source>Set Link Color</source>
 156.577 +        <translation>Farbe der Verbindungen</translation>
 156.578 +    </message>
 156.579 +    <message>
 156.580 +        <source>Set &amp;Link Color</source>
 156.581 +        <translation>&amp;Farbe der Verbindungen</translation>
 156.582 +    </message>
 156.583 +    <message>
 156.584 +        <source>Set Background Color</source>
 156.585 +        <translation>Hintergrundfarbe</translation>
 156.586 +    </message>
 156.587 +    <message>
 156.588 +        <source>Set &amp;Background Color</source>
 156.589 +        <translation>&amp;Hintergrundfarbe</translation>
 156.590 +    </message>
 156.591 +    <message>
 156.592 +        <source>&amp;View</source>
 156.593 +        <translation>&amp;Ansicht</translation>
 156.594 +    </message>
 156.595 +    <message>
 156.596 +        <source>Zoom reset</source>
 156.597 +        <translation>Keine Vergrösserung</translation>
 156.598 +    </message>
 156.599 +    <message>
 156.600 +        <source>reset Zoom</source>
 156.601 +        <translation>Keine Vergrösserung</translation>
 156.602 +    </message>
 156.603 +    <message>
 156.604 +        <source>Zoom in</source>
 156.605 +        <translation>Vergrössern</translation>
 156.606 +    </message>
 156.607 +    <message>
 156.608 +        <source>Zoom out</source>
 156.609 +        <translation>Verkleinern</translation>
 156.610 +    </message>
 156.611 +    <message>
 156.612 +        <source>Toggle Note Editor</source>
 156.613 +        <translation>Zeige Notiz Editor</translation>
 156.614 +    </message>
 156.615 +    <message>
 156.616 +        <source>&amp;Next Window</source>
 156.617 +        <translation>&amp;Nächstes Fenster</translation>
 156.618 +    </message>
 156.619 +    <message>
 156.620 +        <source>Next Window</source>
 156.621 +        <translation>Nächstes Fenster</translation>
 156.622 +    </message>
 156.623 +    <message>
 156.624 +        <source>&amp;Previous Window</source>
 156.625 +        <translation>&amp;Vorheriges Fenster</translation>
 156.626 +    </message>
 156.627 +    <message>
 156.628 +        <source>Previous Window</source>
 156.629 +        <translation>Vorheriges Fenster</translation>
 156.630 +    </message>
 156.631 +    <message>
 156.632 +        <source>&amp;Settings</source>
 156.633 +        <translation>&amp;Einstellungen</translation>
 156.634 +    </message>
 156.635 +    <message>
 156.636 +        <source>Set application to open pdf files</source>
 156.637 +        <translation>pdf-Dateien öffnen mit...</translation>
 156.638 +    </message>
 156.639 +    <message>
 156.640 +        <source>Set application to open an URL</source>
 156.641 +        <translation>URLs öffnen mit...</translation>
 156.642 +    </message>
 156.643 +    <message>
 156.644 +        <source>Edit branch after adding it</source>
 156.645 +        <translation>Zweig nach dem Einfügen neu beschriften</translation>
 156.646 +    </message>
 156.647 +    <message>
 156.648 +        <source>Select branch after adding it</source>
 156.649 +        <translation>Zweig nach dem Einfügen auswählen</translation>
 156.650 +    </message>
 156.651 +    <message>
 156.652 +        <source>Select heading before editing</source>
 156.653 +        <translation>Beschriftung vor dem editieren auswählen</translation>
 156.654 +    </message>
 156.655 +    <message>
 156.656 +        <source>Select existing heading</source>
 156.657 +        <translation>Beschriftung vor dem editieren auswählen</translation>
 156.658 +    </message>
 156.659 +    <message>
 156.660 +        <source>Enable pasting into new branch</source>
 156.661 +        <translation>Einfügen in neuen Zweig</translation>
 156.662 +    </message>
 156.663 +    <message>
 156.664 +        <source>Enable Delete key for deleting branches</source>
 156.665 +        <translation>Delete Taste zum Löschen von Zweigen verwenden</translation>
 156.666 +    </message>
 156.667 +    <message>
 156.668 +        <source>Enable Delete key</source>
 156.669 +        <translation>Delete Taste zum Löschen von Zweigen verwenden</translation>
 156.670 +    </message>
 156.671 +    <message>
 156.672 +        <source>&amp;Test</source>
 156.673 +        <translation>&amp;Test</translation>
 156.674 +    </message>
 156.675 +    <message>
 156.676 +        <source>Test Flag</source>
 156.677 +        <translation>Test Flag</translation>
 156.678 +    </message>
 156.679 +    <message>
 156.680 +        <source>test flag</source>
 156.681 +        <translation>test Flag</translation>
 156.682 +    </message>
 156.683 +    <message>
 156.684 +        <source>Count Canvas Items</source>
 156.685 +        <translation type="obsolete">Zähle Canvas Items</translation>
 156.686 +    </message>
 156.687 +    <message>
 156.688 +        <source>Count Items</source>
 156.689 +        <translation type="obsolete">Zähle Items</translation>
 156.690 +    </message>
 156.691 +    <message>
 156.692 +        <source>Show Clipboard</source>
 156.693 +        <translation>Zeige Zwischenablage</translation>
 156.694 +    </message>
 156.695 +    <message>
 156.696 +        <source>Show clipboard</source>
 156.697 +        <translation>Zeige Zwischenablage</translation>
 156.698 +    </message>
 156.699 +    <message>
 156.700 +        <source>Export to dir</source>
 156.701 +        <translation type="obsolete">Exportiere in Verzeichnis</translation>
 156.702 +    </message>
 156.703 +    <message>
 156.704 +        <source>Export to directory</source>
 156.705 +        <translation type="obsolete">Exportiere in Verzeichnis</translation>
 156.706 +    </message>
 156.707 +    <message>
 156.708 +        <source>&amp;Help</source>
 156.709 +        <translation>&amp;Hilfe</translation>
 156.710 +    </message>
 156.711 +    <message>
 156.712 +        <source>Open VYM Documentation (pdf)</source>
 156.713 +        <translation>VYM Handbuch (pdf)</translation>
 156.714 +    </message>
 156.715 +    <message>
 156.716 +        <source>Open VYM Documentation (pdf) </source>
 156.717 +        <translation>VYM Handbuch (pdf)</translation>
 156.718 +    </message>
 156.719 +    <message>
 156.720 +        <source>Information about VYM</source>
 156.721 +        <translation>Information über VYM</translation>
 156.722 +    </message>
 156.723 +    <message>
 156.724 +        <source>About VYM</source>
 156.725 +        <translation>Ãœber VYM</translation>
 156.726 +    </message>
 156.727 +    <message>
 156.728 +        <source>Information about QT toolkit</source>
 156.729 +        <translation>Informationen zum QT Toolkit</translation>
 156.730 +    </message>
 156.731 +    <message>
 156.732 +        <source>About QT</source>
 156.733 +        <translation>Ãœber QT</translation>
 156.734 +    </message>
 156.735 +    <message>
 156.736 +        <source>Save image</source>
 156.737 +        <translation>Speichere Bild</translation>
 156.738 +    </message>
 156.739 +    <message>
 156.740 +        <source>The file </source>
 156.741 +        <translation>Die Datei</translation>
 156.742 +    </message>
 156.743 +    <message>
 156.744 +        <source>
 156.745 +exists already. Do you want to</source>
 156.746 +        <translation>gibt es bereits. Wollen Sie sie</translation>
 156.747 +    </message>
 156.748 +    <message>
 156.749 +        <source>Overwrite</source>
 156.750 +        <translation>Ãœberschreiben</translation>
 156.751 +    </message>
 156.752 +    <message>
 156.753 +        <source>Cancel</source>
 156.754 +        <translation>Abbrechen</translation>
 156.755 +    </message>
 156.756 +    <message>
 156.757 +        <source>Couldn&apos;t save</source>
 156.758 +        <translation>Diese Datei konnte nicht gespeichert werden:</translation>
 156.759 +    </message>
 156.760 +    <message>
 156.761 +        <source>Saved </source>
 156.762 +        <translation type="obsolete">Datei gespeichert: </translation>
 156.763 +    </message>
 156.764 +    <message>
 156.765 +        <source>Couldn&apos;t save </source>
 156.766 +        <translation type="obsolete">Diese Datei konnte nicht gespeichert werden: </translation>
 156.767 +    </message>
 156.768 +    <message>
 156.769 +        <source>The map </source>
 156.770 +        <translation>Die Map </translation>
 156.771 +    </message>
 156.772 +    <message>
 156.773 +        <source> has been modified but not saved yet. Do you want to</source>
 156.774 +        <translation>wurde verändert aber noch nicht gespeichert. Wollen Sie</translation>
 156.775 +    </message>
 156.776 +    <message>
 156.777 +        <source>Save modified map before closing it</source>
 156.778 +        <translation>Speichern und Map schliessen</translation>
 156.779 +    </message>
 156.780 +    <message>
 156.781 +        <source>Discard changes</source>
 156.782 +        <translation>Änderungen verwerfen</translation>
 156.783 +    </message>
 156.784 +    <message>
 156.785 +        <source>This map is not saved yet. Do you want to</source>
 156.786 +        <translation>Diese Map wurde noch nicht gespeichert. Wollen Sie </translation>
 156.787 +    </message>
 156.788 +    <message>
 156.789 +        <source>Save map</source>
 156.790 +        <translation>Speichern</translation>
 156.791 +    </message>
 156.792 +    <message>
 156.793 +        <source>Critical Error</source>
 156.794 +        <translation>Kritischer Fehler</translation>
 156.795 +    </message>
 156.796 +    <message>
 156.797 +        <source>Enter path for pdf reader:</source>
 156.798 +        <translation>Pfad für pdf-Anwendung:</translation>
 156.799 +    </message>
 156.800 +    <message>
 156.801 +        <source>Enter path for application to open an URL:</source>
 156.802 +        <translation>Pfad zum Öffnen von URLs:</translation>
 156.803 +    </message>
 156.804 +    <message>
 156.805 +        <source>Save &amp;As</source>
 156.806 +        <translation>Speichern &amp;unter...</translation>
 156.807 +    </message>
 156.808 +    <message>
 156.809 +        <source>Open Recent</source>
 156.810 +        <translation>Zuletzt geöffnete Dateien</translation>
 156.811 +    </message>
 156.812 +    <message>
 156.813 +        <source>Export</source>
 156.814 +        <translation>Exportieren</translation>
 156.815 +    </message>
 156.816 +    <message>
 156.817 +        <source>Export map as image</source>
 156.818 +        <translation>als Bild</translation>
 156.819 +    </message>
 156.820 +    <message>
 156.821 +        <source>Export as ASCII (still experimental)</source>
 156.822 +        <translation>als ASCII Text (noch experimentell)</translation>
 156.823 +    </message>
 156.824 +    <message>
 156.825 +        <source>Export (ASCII)</source>
 156.826 +        <translation>als ASCII</translation>
 156.827 +    </message>
 156.828 +    <message>
 156.829 +        <source>Edit Map Info</source>
 156.830 +        <translation>Bearbeite Map Info</translation>
 156.831 +    </message>
 156.832 +    <message>
 156.833 +        <source>Export XML</source>
 156.834 +        <translation>Exportiere als XML</translation>
 156.835 +    </message>
 156.836 +    <message>
 156.837 +        <source>Export HTML</source>
 156.838 +        <translation>Exportiere als HTML</translation>
 156.839 +    </message>
 156.840 +    <message>
 156.841 +        <source>The directory </source>
 156.842 +        <translation>Das Verzeichnis</translation>
 156.843 +    </message>
 156.844 +    <message>
 156.845 +        <source> is not empty. Do you risk to overwrite its contents?</source>
 156.846 +        <translation>ist nicht leer.Riskieren sie es, das Verzeichnis zu überschreiben?</translation>
 156.847 +    </message>
 156.848 +    <message>
 156.849 +        <source>
 156.850 + is already opened.Opening the same map in multiple editors may lead 
 156.851 +to confusion when finishing working with vym.Do you want to</source>
 156.852 +        <translation>
 156.853 +ist bereits geöffnet. Die gleiche Map mehrfach in verschiedenen Ansichten zu öffnen 
 156.854 +kann beim Beenden von vym zu Problemen führen. Wollen Sie</translation>
 156.855 +    </message>
 156.856 +    <message>
 156.857 +        <source>Open anyway</source>
 156.858 +        <translation>Trotzdem öffnen</translation>
 156.859 +    </message>
 156.860 +    <message>
 156.861 +        <source>Export XML to directory</source>
 156.862 +        <translation>Exportiere XML in Verzeichnis</translation>
 156.863 +    </message>
 156.864 +    <message>
 156.865 +        <source>Critcal error</source>
 156.866 +        <translation>Kritischer Fehler</translation>
 156.867 +    </message>
 156.868 +    <message>
 156.869 +        <source>Couldn&apos;t find the documentation
 156.870 +vym.pdf in various places.</source>
 156.871 +        <translation>Konnte die Dokumentation vym.pdf
 156.872 +nirgends finden.</translation>
 156.873 +    </message>
 156.874 +    <message>
 156.875 +        <source>Couldn&apos;t find a viewer to read vym.pdf.
 156.876 +Please use Settings-&gt;</source>
 156.877 +        <translation>Konnte kein Programm zum Anzeigen von vym.pdf
 156.878 +finden. Bitte benutzen Sie Einstellungen-&gt;</translation>
 156.879 +    </message>
 156.880 +    <message>
 156.881 +        <source>The map</source>
 156.882 +        <translation>Die Map</translation>
 156.883 +    </message>
 156.884 +    <message>
 156.885 +        <source> does not exist.
 156.886 + Do you want to create a new one?</source>
 156.887 +        <translation>gibt es nicht
 156.888 +Wollen Sie eine neue anlegen?</translation>
 156.889 +    </message>
 156.890 +    <message>
 156.891 +        <source>Create</source>
 156.892 +        <translation>Anlegen</translation>
 156.893 +    </message>
 156.894 +    <message>
 156.895 +        <source>Create URL to Bugzilla</source>
 156.896 +        <translation>URL für Bugzilla anlegen</translation>
 156.897 +    </message>
 156.898 +    <message>
 156.899 +        <source>Edit vym link</source>
 156.900 +        <translation>vym Verknüpfung ändern</translation>
 156.901 +    </message>
 156.902 +    <message>
 156.903 +        <source>Delete link to another vym map</source>
 156.904 +        <translation>vym Verknüfung löschen</translation>
 156.905 +    </message>
 156.906 +    <message>
 156.907 +        <source>Delete vym link</source>
 156.908 +        <translation>vym Verknüpfung löschen</translation>
 156.909 +    </message>
 156.910 +    <message>
 156.911 +        <source>Critical Load Error</source>
 156.912 +        <translation>Kritischer Fehler beim Laden</translation>
 156.913 +    </message>
 156.914 +    <message>
 156.915 +        <source>Couldn&apos;t start unzip to decompress data.</source>
 156.916 +        <translation>Konnte unzip nicht starten, um Daten zu dekomprimieren.</translation>
 156.917 +    </message>
 156.918 +    <message>
 156.919 +        <source>unzip didn&apos;t exit normally</source>
 156.920 +        <translation>unzip wurde nicht richtig beendet</translation>
 156.921 +    </message>
 156.922 +    <message>
 156.923 +        <source>Couldn&apos;t find a map (*.xml) in .vym archive.
 156.924 +</source>
 156.925 +        <translation>Konnte keine map (*.xml) in .vym Datei finden.
 156.926 +</translation>
 156.927 +    </message>
 156.928 +    <message>
 156.929 +        <source>Critical Save Error</source>
 156.930 +        <translation>Kritischer Fehler beim Speichern</translation>
 156.931 +    </message>
 156.932 +    <message>
 156.933 +        <source>Couldn&apos;t start zip to compress data.</source>
 156.934 +        <translation>Konnte zip nicht starten, um Daten zu komprimieren.</translation>
 156.935 +    </message>
 156.936 +    <message>
 156.937 +        <source>zip didn&apos;t exit normally</source>
 156.938 +        <translation>zip wurde nicht richtig beendet</translation>
 156.939 +    </message>
 156.940 +    <message>
 156.941 +        <source>Saving the map as </source>
 156.942 +        <translation type="obsolete">Das Speichern der map als</translation>
 156.943 +    </message>
 156.944 +    <message>
 156.945 +        <source>
 156.946 +will write it uncompressed.
 156.947 +This will also write the directories for images
 156.948 +and flags and thus may overwrite files in the given directory
 156.949 +Do you want to</source>
 156.950 +        <translation type="obsolete">
 156.951 +wird die map unkomprimiert schreiben.
 156.952 +Dabei werden Verzeichnisse für die Bilder und Flags erzeugt
 156.953 +und dabei evtl. andere Daten im Verzeichnis überschrieben</translation>
 156.954 +    </message>
 156.955 +    <message>
 156.956 +        <source>Proceed</source>
 156.957 +        <translation type="obsolete">Weiter</translation>
 156.958 +    </message>
 156.959 +    <message>
 156.960 +        <source>Saved</source>
 156.961 +        <translation>Gespeichert: </translation>
 156.962 +    </message>
 156.963 +    <message>
 156.964 +        <source>VYM -Information:</source>
 156.965 +        <translation>vym-Information:</translation>
 156.966 +    </message>
 156.967 +    <message>
 156.968 +        <source>No matches found for </source>
 156.969 +        <translation>Keine Treffer gefunden für</translation>
 156.970 +    </message>
 156.971 +    <message>
 156.972 +        <source>Export XHTML</source>
 156.973 +        <translation>Exportiere XHTML</translation>
 156.974 +    </message>
 156.975 +    <message>
 156.976 +        <source>
 156.977 +did not use the compressed vym file format.
 156.978 +Writing it uncompressed will also write images 
 156.979 +and flags and thus may overwrite files in the given directory
 156.980 +
 156.981 +Do you want to write the map</source>
 156.982 +        <translation>
 156.983 +verwendet nicht das komprimierte vym Dateiformat.
 156.984 +Wenn die Map unkomprimiert geschrieben werden soll,
 156.985 +dann werden auch die Flags und Bilder im angegebenen 
 156.986 +Verzeichnis geschrieben, was evtl. bestehende Daten
 156.987 +überschreiben kann
 156.988 +
 156.989 +Wollen Sie die Map beim Schreiben</translation>
 156.990 +    </message>
 156.991 +    <message>
 156.992 +        <source>compressed (vym default)</source>
 156.993 +        <translation>komprimieren (vym default)</translation>
 156.994 +    </message>
 156.995 +    <message>
 156.996 +        <source>uncompressed</source>
 156.997 +        <translation>unkomprimiert lassen</translation>
 156.998 +    </message>
 156.999 +    <message>
156.1000 +        <source>Use for Export</source>
156.1001 +        <translation>Benutze für Export</translation>
156.1002 +    </message>
156.1003 +    <message>
156.1004 +        <source>Add map at selection</source>
156.1005 +        <translation>Map an Auswahl anhängen</translation>
156.1006 +    </message>
156.1007 +    <message>
156.1008 +        <source>Import (add)</source>
156.1009 +        <translation>Import (hinzufügen)</translation>
156.1010 +    </message>
156.1011 +    <message>
156.1012 +        <source>Replace selection with map</source>
156.1013 +        <translation>Auswahl mit Map ersetzen</translation>
156.1014 +    </message>
156.1015 +    <message>
156.1016 +        <source>Import (replace)</source>
156.1017 +        <translation>Import (ersetzen)</translation>
156.1018 +    </message>
156.1019 +    <message>
156.1020 +        <source>Save selction</source>
156.1021 +        <translation>Auswahl speichern</translation>
156.1022 +    </message>
156.1023 +    <message>
156.1024 +        <source>Save selection</source>
156.1025 +        <translation>Auswahl speichern</translation>
156.1026 +    </message>
156.1027 +    <message>
156.1028 +        <source>Load vym map</source>
156.1029 +        <translation>Lade vym Map</translation>
156.1030 +    </message>
156.1031 +    <message>
156.1032 +        <source>Import: Add vym map to selection</source>
156.1033 +        <translation>Import: Füge Map zu Auswahl hinzu</translation>
156.1034 +    </message>
156.1035 +    <message>
156.1036 +        <source>Import: Replace selection with vym map</source>
156.1037 +        <translation>Import: Ersetze Auswahl mit Map</translation>
156.1038 +    </message>
156.1039 +    <message>
156.1040 +        <source>Save Error</source>
156.1041 +        <translation>Fehler beim Speichern</translation>
156.1042 +    </message>
156.1043 +    <message>
156.1044 +        <source>
156.1045 +could not be removed before saving</source>
156.1046 +        <translation>
156.1047 +konnte vor dem Speichern nicht gelöscht werden</translation>
156.1048 +    </message>
156.1049 +</context>
156.1050 +<context>
156.1051 +    <name>MapEditor</name>
156.1052 +    <message>
156.1053 +        <source>Note</source>
156.1054 +        <translation>Notiz</translation>
156.1055 +    </message>
156.1056 +    <message>
156.1057 +        <source>WWW Document (external)</source>
156.1058 +        <translation>WWW Dokument (extern)</translation>
156.1059 +    </message>
156.1060 +    <message>
156.1061 +        <source>Link to another vym map</source>
156.1062 +        <translation>Verbindung zu einer anderen Map</translation>
156.1063 +    </message>
156.1064 +    <message>
156.1065 +        <source>subtree is scrolled</source>
156.1066 +        <translation>Teilbaum ist eingerollt</translation>
156.1067 +    </message>
156.1068 +    <message>
156.1069 +        <source>subtree is temporary scrolled</source>
156.1070 +        <translation>Teilbaum ist momentan ausgerollt</translation>
156.1071 +    </message>
156.1072 +    <message>
156.1073 +        <source>Take care!</source>
156.1074 +        <translation>Vorsicht!</translation>
156.1075 +    </message>
156.1076 +    <message>
156.1077 +        <source>Really?</source>
156.1078 +        <translation>Wirklich?</translation>
156.1079 +    </message>
156.1080 +    <message>
156.1081 +        <source>ok!</source>
156.1082 +        <translation>ok!</translation>
156.1083 +    </message>
156.1084 +    <message>
156.1085 +        <source>Not ok!</source>
156.1086 +        <translation>Nicht ok!</translation>
156.1087 +    </message>
156.1088 +    <message>
156.1089 +        <source>This won&apos;t work!</source>
156.1090 +        <translation>Das geht nicht!</translation>
156.1091 +    </message>
156.1092 +    <message>
156.1093 +        <source>Good</source>
156.1094 +        <translation>Gut</translation>
156.1095 +    </message>
156.1096 +    <message>
156.1097 +        <source>Bad</source>
156.1098 +        <translation>Schlecht</translation>
156.1099 +    </message>
156.1100 +    <message>
156.1101 +        <source>Time critical</source>
156.1102 +        <translation>Zeitkritisch</translation>
156.1103 +    </message>
156.1104 +    <message>
156.1105 +        <source>Idea!</source>
156.1106 +        <translation>Idee!</translation>
156.1107 +    </message>
156.1108 +    <message>
156.1109 +        <source>Important</source>
156.1110 +        <translation>Wichtig</translation>
156.1111 +    </message>
156.1112 +    <message>
156.1113 +        <source>Unimportant</source>
156.1114 +        <translation>Unwichtig</translation>
156.1115 +    </message>
156.1116 +    <message>
156.1117 +        <source>I like this</source>
156.1118 +        <translation>Finde ich gut</translation>
156.1119 +    </message>
156.1120 +    <message>
156.1121 +        <source>I do not like this</source>
156.1122 +        <translation>Finde ich schlecht</translation>
156.1123 +    </message>
156.1124 +    <message>
156.1125 +        <source>I just love... </source>
156.1126 +        <translation>Das liebe ich!</translation>
156.1127 +    </message>
156.1128 +    <message>
156.1129 +        <source>Critical error while loading map</source>
156.1130 +        <translation type="obsolete">Kritischer Fehler beim Laden der Map</translation>
156.1131 +    </message>
156.1132 +    <message>
156.1133 +        <source>Critical Parse Error</source>
156.1134 +        <translation>Kritischer Fehler beim Verarbeiten</translation>
156.1135 +    </message>
156.1136 +    <message>
156.1137 +        <source>Warning: Old file format</source>
156.1138 +        <translation type="obsolete">Warnung: Altes Dateiformat</translation>
156.1139 +    </message>
156.1140 +    <message>
156.1141 +        <source>&lt;h3&gt;Old file format detected&lt;/h3&gt;&lt;p&gt;The map you are just loading still uses an old uncompressed file format. Saving it later will overwrite the old format by converting it to version </source>
156.1142 +        <translation type="obsolete">&lt;h3&gt;Altes Dateiformat gefunden&lt;/h3&gt;Die gerade geladene Map verwendet ein unkomprimmiertes Format. Wird sie später gespeichert, so wird sie umgewandelt in das Format von Version</translation>
156.1143 +    </message>
156.1144 +    <message>
156.1145 +        <source>Critical Load Error</source>
156.1146 +        <translation type="obsolete">Kritischer Fehler beim Laden</translation>
156.1147 +    </message>
156.1148 +    <message>
156.1149 +        <source>Couldn&apos;t open map after uncompressing, I tried:
156.1150 +</source>
156.1151 +        <translation type="obsolete">Konnte Map nach dem Entpacken nicht öffnen:
156.1152 +</translation>
156.1153 +    </message>
156.1154 +    <message>
156.1155 +        <source>Critical Save Error</source>
156.1156 +        <translation>Kritischer Fehler beim Speichern</translation>
156.1157 +    </message>
156.1158 +    <message>
156.1159 +        <source>Couldn&apos;t write to </source>
156.1160 +        <translation>Konnte nicht speichern:</translation>
156.1161 +    </message>
156.1162 +    <message>
156.1163 +        <source>Critcal save error</source>
156.1164 +        <translation>Kritischer Fehler beim Speichern</translation>
156.1165 +    </message>
156.1166 +    <message>
156.1167 +        <source> doesn&apos;t exist</source>
156.1168 +        <translation type="obsolete">gibt es nicht</translation>
156.1169 +    </message>
156.1170 +    <message>
156.1171 +        <source>VYM - Export (ASCII)</source>
156.1172 +        <translation>VYM - Export (ASCII)</translation>
156.1173 +    </message>
156.1174 +    <message>
156.1175 +        <source>The file </source>
156.1176 +        <translation>Die Datei</translation>
156.1177 +    </message>
156.1178 +    <message>
156.1179 +        <source> exists already. Do you want to overwrite it?</source>
156.1180 +        <translation>gibt es bereits. Wollen Sie sie</translation>
156.1181 +    </message>
156.1182 +    <message>
156.1183 +        <source>Overwrite</source>
156.1184 +        <translation>Ãœberschreiben</translation>
156.1185 +    </message>
156.1186 +    <message>
156.1187 +        <source>Cancel</source>
156.1188 +        <translation>Abbrechen</translation>
156.1189 +    </message>
156.1190 +    <message>
156.1191 +        <source>Critical Export Error </source>
156.1192 +        <translation>Kritischer Fehler beim Exportieren</translation>
156.1193 +    </message>
156.1194 +    <message>
156.1195 +        <source>Couldn&apos;t create directory </source>
156.1196 +        <translation>Konnte Verzeichnis nicht anlegen</translation>
156.1197 +    </message>
156.1198 +    <message>
156.1199 +        <source>VYM - Export to directory</source>
156.1200 +        <translation type="obsolete">VYM - Export in Verzeichnis</translation>
156.1201 +    </message>
156.1202 +    <message>
156.1203 +        <source>VYM - Export to directory (still experimental)</source>
156.1204 +        <translation type="obsolete">VYM - Export in Verzeichnis</translation>
156.1205 +    </message>
156.1206 +    <message>
156.1207 +        <source>The directory </source>
156.1208 +        <translation type="obsolete">Das Verzeichnis</translation>
156.1209 +    </message>
156.1210 +    <message>
156.1211 +        <source> is not empty. Do you risk to overwrite its contents?</source>
156.1212 +        <translation type="obsolete">ist nicht leer.Riskieren sie es, das Verzeichnis zu überschreiben?</translation>
156.1213 +    </message>
156.1214 +    <message>
156.1215 +        <source>Critical Export Error</source>
156.1216 +        <translation>Kritischer Fehler beim Exportieren</translation>
156.1217 +    </message>
156.1218 +    <message>
156.1219 +        <source>Critical Error</source>
156.1220 +        <translation>Kritischer Fehler</translation>
156.1221 +    </message>
156.1222 +    <message>
156.1223 +        <source> used for undo is gone. 
156.1224 +I will create a new one, but at the moment no undo is available.
156.1225 +Maybe you want to reload your original data.
156.1226 +
156.1227 +Sorry for any inconveniences.</source>
156.1228 +        <translation>Vielleicht wollen sie die Orginaldaten erneut laden
156.1229 +Sorry für die Unannehmlichkeiten.</translation>
156.1230 +    </message>
156.1231 +    <message>
156.1232 +        <source>Enter URL:</source>
156.1233 +        <translation>Neue URL:</translation>
156.1234 +    </message>
156.1235 +    <message>
156.1236 +        <source>VYM - Link to another map</source>
156.1237 +        <translation>VYM - Verbindung zu einer anderen Map</translation>
156.1238 +    </message>
156.1239 +    <message>
156.1240 +        <source>vym map</source>
156.1241 +        <translation>vym Map</translation>
156.1242 +    </message>
156.1243 +    <message>
156.1244 +        <source>vym - load image</source>
156.1245 +        <translation>VYM - Lade Bild</translation>
156.1246 +    </message>
156.1247 +    <message>
156.1248 +        <source>Images</source>
156.1249 +        <translation>Bilder</translation>
156.1250 +    </message>
156.1251 +    <message>
156.1252 +        <source>vym - Load image</source>
156.1253 +        <translation>vym - Lade Bild</translation>
156.1254 +    </message>
156.1255 +    <message>
156.1256 +        <source>vym - save image as</source>
156.1257 +        <translation>vym - Speichere Bild als</translation>
156.1258 +    </message>
156.1259 +    <message>
156.1260 +        <source>vym - Save image as </source>
156.1261 +        <translation>vym - Speichere Bild als</translation>
156.1262 +    </message>
156.1263 +    <message>
156.1264 +        <source>Critical Import Error</source>
156.1265 +        <translation>Kritischer Fehler beim Importieren</translation>
156.1266 +    </message>
156.1267 +    <message>
156.1268 +        <source>Cannot find the directory</source>
156.1269 +        <translation>Kann das Verzeichnis nicht finden</translation>
156.1270 +    </message>
156.1271 +    <message>
156.1272 +        <source>VYM - Choose directory structur to import</source>
156.1273 +        <translation>vym - Wähle Verzeichnisstruktur für Import</translation>
156.1274 +    </message>
156.1275 +    <message>
156.1276 +        <source>Dangerous</source>
156.1277 +        <translation>Gefährlich</translation>
156.1278 +    </message>
156.1279 +    <message>
156.1280 +        <source>This will help</source>
156.1281 +        <translation>Das könnte helfen</translation>
156.1282 +    </message>
156.1283 +    <message>
156.1284 +        <source>New Map</source>
156.1285 +        <translation>Neue Map</translation>
156.1286 +    </message>
156.1287 +    <message>
156.1288 +        <source>Critical Parse Error by reading backupFile</source>
156.1289 +        <translation>Kritischer Fehler beim Parsen
156.1290 +der Sicherungskopie</translation>
156.1291 +    </message>
156.1292 +    <message>
156.1293 +        <source>MapEditor::exportXML couldn&apos;t open </source>
156.1294 +        <translation>MapEditor::exportXML konnte nicht öffnen:</translation>
156.1295 +    </message>
156.1296 +</context>
156.1297 +<context>
156.1298 +    <name>QMessageBox</name>
156.1299 +    <message>
156.1300 +        <source>Critical Error</source>
156.1301 +        <translation type="obsolete">Kritischer Fehler</translation>
156.1302 +    </message>
156.1303 +</context>
156.1304 +<context>
156.1305 +    <name>QObject</name>
156.1306 +    <message>
156.1307 +        <source>new branch</source>
156.1308 +        <translation type="obsolete">Neuer Zweig</translation>
156.1309 +    </message>
156.1310 +    <message>
156.1311 +        <source>New Map</source>
156.1312 +        <translation type="obsolete">Neue Map</translation>
156.1313 +    </message>
156.1314 +    <message>
156.1315 +        <source>This is not an image.</source>
156.1316 +        <translation>Das ist kein Bild.</translation>
156.1317 +    </message>
156.1318 +</context>
156.1319 +<context>
156.1320 +    <name>ShowTextDialog</name>
156.1321 +    <message>
156.1322 +        <source>VYM - Info</source>
156.1323 +        <translation>VYM - Info</translation>
156.1324 +    </message>
156.1325 +    <message>
156.1326 +        <source>Close</source>
156.1327 +        <translation>Schliessen</translation>
156.1328 +    </message>
156.1329 +</context>
156.1330 +<context>
156.1331 +    <name>TextEditor</name>
156.1332 +    <message>
156.1333 +        <source>&amp;File</source>
156.1334 +        <translation>&amp;Datei</translation>
156.1335 +    </message>
156.1336 +    <message>
156.1337 +        <source>Import</source>
156.1338 +        <translation>Importiere</translation>
156.1339 +    </message>
156.1340 +    <message>
156.1341 +        <source>&amp;Import...</source>
156.1342 +        <translation>&amp;Importiere</translation>
156.1343 +    </message>
156.1344 +    <message>
156.1345 +        <source>Export Note</source>
156.1346 +        <translation type="obsolete">Exportiere Notiz</translation>
156.1347 +    </message>
156.1348 +    <message>
156.1349 +        <source>&amp;Export...</source>
156.1350 +        <translation>&amp;Export</translation>
156.1351 +    </message>
156.1352 +    <message>
156.1353 +        <source>Export Note As</source>
156.1354 +        <translation type="obsolete">Exportiere Notiz unter...</translation>
156.1355 +    </message>
156.1356 +    <message>
156.1357 +        <source>Export &amp;As...</source>
156.1358 +        <translation type="obsolete">Exportiere &amp;unter...</translation>
156.1359 +    </message>
156.1360 +    <message>
156.1361 +        <source>Print Note</source>
156.1362 +        <translation>Drucke Notiz</translation>
156.1363 +    </message>
156.1364 +    <message>
156.1365 +        <source>&amp;Print...</source>
156.1366 +        <translation>&amp;Drucken</translation>
156.1367 +    </message>
156.1368 +    <message>
156.1369 +        <source>&amp;Edit</source>
156.1370 +        <translation>&amp;Bearbeiten</translation>
156.1371 +    </message>
156.1372 +    <message>
156.1373 +        <source>Undo</source>
156.1374 +        <translation>Rückgängig</translation>
156.1375 +    </message>
156.1376 +    <message>
156.1377 +        <source>&amp;Undo</source>
156.1378 +        <translation>R&amp;ückgängig</translation>
156.1379 +    </message>
156.1380 +    <message>
156.1381 +        <source>Redo</source>
156.1382 +        <translation>Wiederherstellen</translation>
156.1383 +    </message>
156.1384 +    <message>
156.1385 +        <source>&amp;Redo</source>
156.1386 +        <translation>Wieder&amp;herstellen</translation>
156.1387 +    </message>
156.1388 +    <message>
156.1389 +        <source>Select and copy all</source>
156.1390 +        <translation>Alles auswählen und kopieren</translation>
156.1391 +    </message>
156.1392 +    <message>
156.1393 +        <source>Select and copy &amp;all</source>
156.1394 +        <translation>&amp;Alles auswählen und kopieren</translation>
156.1395 +    </message>
156.1396 +    <message>
156.1397 +        <source>Copy</source>
156.1398 +        <translation>Kopieren</translation>
156.1399 +    </message>
156.1400 +    <message>
156.1401 +        <source>&amp;Copy</source>
156.1402 +        <translation>&amp;Kopieren</translation>
156.1403 +    </message>
156.1404 +    <message>
156.1405 +        <source>Cut</source>
156.1406 +        <translation>Ausschneiden</translation>
156.1407 +    </message>
156.1408 +    <message>
156.1409 +        <source>Cu&amp;t</source>
156.1410 +        <translation>&amp;Ausschneiden</translation>
156.1411 +    </message>
156.1412 +    <message>
156.1413 +        <source>Paste</source>
156.1414 +        <translation>Einfügen</translation>
156.1415 +    </message>
156.1416 +    <message>
156.1417 +        <source>&amp;Paste</source>
156.1418 +        <translation>Ein&amp;fügen</translation>
156.1419 +    </message>
156.1420 +    <message>
156.1421 +        <source>Delete all</source>
156.1422 +        <translation>Alles löschen</translation>
156.1423 +    </message>
156.1424 +    <message>
156.1425 +        <source>&amp;Delete All</source>
156.1426 +        <translation>Alles &amp;löschen</translation>
156.1427 +    </message>
156.1428 +    <message>
156.1429 +        <source>&amp;Format</source>
156.1430 +        <translation>&amp;Format</translation>
156.1431 +    </message>
156.1432 +    <message>
156.1433 +        <source>Use fixed font</source>
156.1434 +        <translation type="obsolete">Benutze fixe Zeichenbreite</translation>
156.1435 +    </message>
156.1436 +    <message>
156.1437 +        <source>&amp;Fixed font</source>
156.1438 +        <translation type="obsolete">&amp;fixe Zeichenbreite</translation>
156.1439 +    </message>
156.1440 +    <message>
156.1441 +        <source>&amp;Settings</source>
156.1442 +        <translation>&amp;Einstellungen</translation>
156.1443 +    </message>
156.1444 +    <message>
156.1445 +        <source>Set fixed font</source>
156.1446 +        <translation>Wähle Zeichensatz mit fixer Breite</translation>
156.1447 +    </message>
156.1448 +    <message>
156.1449 +        <source>Set &amp;fixed font</source>
156.1450 +        <translation>Wähle Zeichensatz mit f&amp;ixer Breite</translation>
156.1451 +    </message>
156.1452 +    <message>
156.1453 +        <source>Set variable font</source>
156.1454 +        <translation>Wähle Zeichensatz mit variabler Breite</translation>
156.1455 +    </message>
156.1456 +    <message>
156.1457 +        <source>Set &amp;variable font</source>
156.1458 +        <translation>Wähle Zeichensatz mit v&amp;ariabler Breite</translation>
156.1459 +    </message>
156.1460 +    <message>
156.1461 +        <source>Used fixed font by default</source>
156.1462 +        <translation>Verwende fixen Zeichensatz per default</translation>
156.1463 +    </message>
156.1464 +    <message>
156.1465 +        <source>&amp;fixed font is default</source>
156.1466 +        <translation>Verwende fixen Zeichensatz p&amp;er default</translation>
156.1467 +    </message>
156.1468 +    <message>
156.1469 +        <source>Export Note (HTML)</source>
156.1470 +        <translation>Exportiere Notiz (HTML)</translation>
156.1471 +    </message>
156.1472 +    <message>
156.1473 +        <source>Export Note As (HTML) </source>
156.1474 +        <translation>Exportiere Notiz als (HTML)</translation>
156.1475 +    </message>
156.1476 +    <message>
156.1477 +        <source>Export &amp;As... (HTML)</source>
156.1478 +        <translation>Exportiere Notiz &amp;als... (HTML)</translation>
156.1479 +    </message>
156.1480 +    <message>
156.1481 +        <source>Export Note As (ASCII) </source>
156.1482 +        <translation>Exportiere Notiz als (ASCII)</translation>
156.1483 +    </message>
156.1484 +    <message>
156.1485 +        <source>Export &amp;As...(ASCII)</source>
156.1486 +        <translation>Exportiere a&amp;ls (ASCII)</translation>
156.1487 +    </message>
156.1488 +    <message>
156.1489 +        <source>Use fixed width font for the whole text</source>
156.1490 +        <translation type="obsolete">Feste Zeichenbreite für den Text verwenden</translation>
156.1491 +    </message>
156.1492 +    <message>
156.1493 +        <source>&amp;Color...</source>
156.1494 +        <translation>&amp;Farbe...</translation>
156.1495 +    </message>
156.1496 +    <message>
156.1497 +        <source>&amp;Bold</source>
156.1498 +        <translation>F&amp;ett</translation>
156.1499 +    </message>
156.1500 +    <message>
156.1501 +        <source>&amp;Italic</source>
156.1502 +        <translation>K&amp;ursiv</translation>
156.1503 +    </message>
156.1504 +    <message>
156.1505 +        <source>&amp;Underline</source>
156.1506 +        <translation>&amp;Unterstrichen</translation>
156.1507 +    </message>
156.1508 +    <message>
156.1509 +        <source>&amp;Left</source>
156.1510 +        <translation>&amp;Linksbündig</translation>
156.1511 +    </message>
156.1512 +    <message>
156.1513 +        <source>C&amp;enter</source>
156.1514 +        <translation>&amp;Zentriert</translation>
156.1515 +    </message>
156.1516 +    <message>
156.1517 +        <source>&amp;Right</source>
156.1518 +        <translation>&amp;Rechtsbündig</translation>
156.1519 +    </message>
156.1520 +    <message>
156.1521 +        <source>&amp;Justify</source>
156.1522 +        <translation>&amp;Blocksatz</translation>
156.1523 +    </message>
156.1524 +    <message>
156.1525 +        <source>Export Note to single file</source>
156.1526 +        <translation>Notiz in eine einzelne Datei exportieren</translation>
156.1527 +    </message>
156.1528 +    <message>
156.1529 +        <source>The file </source>
156.1530 +        <translation>Die Datei</translation>
156.1531 +    </message>
156.1532 +    <message>
156.1533 +        <source> exists already. Do you want to overwrite it?</source>
156.1534 +        <translation>gibt es bereits. Wollen Sie sie</translation>
156.1535 +    </message>
156.1536 +    <message>
156.1537 +        <source>Overwrite</source>
156.1538 +        <translation>Ãœberschreiben</translation>
156.1539 +    </message>
156.1540 +    <message>
156.1541 +        <source>Cancel</source>
156.1542 +        <translation>Abbrechen</translation>
156.1543 +    </message>
156.1544 +    <message>
156.1545 +        <source>Couldn&apos;t export note </source>
156.1546 +        <translation>Konnte Notiz nicht exportieren</translation>
156.1547 +    </message>
156.1548 +    <message>
156.1549 +        <source>Export Note to single file (ASCII)</source>
156.1550 +        <translation>Notiz als ASCII in eine einzelne Datei ausgeben</translation>
156.1551 +    </message>
156.1552 +    <message>
156.1553 +        <source>Convert paragraphs to linebreaks</source>
156.1554 +        <translation>Absätze in Zeilenbrüche umwandeln</translation>
156.1555 +    </message>
156.1556 +    <message>
156.1557 +        <source>&amp;Convert Paragraphs</source>
156.1558 +        <translation>&amp;Absätze umwandeln</translation>
156.1559 +    </message>
156.1560 +    <message>
156.1561 +        <source>Join all lines of a paragraph</source>
156.1562 +        <translation>Alle Zeilenumbrüche eines Absatzes zu vereinen</translation>
156.1563 +    </message>
156.1564 +    <message>
156.1565 +        <source>&amp;Join lines</source>
156.1566 +        <translation>&amp;Zeilen vereinen</translation>
156.1567 +    </message>
156.1568 +    <message>
156.1569 +        <source>Toggle font hint for the whole text</source>
156.1570 +        <translation>Zeichensatz für gesamten Text umschalten</translation>
156.1571 +    </message>
156.1572 +    <message>
156.1573 +        <source>&amp;Font hint</source>
156.1574 +        <translation>Zeichensatz &amp;umschalten</translation>
156.1575 +    </message>
156.1576 +</context>
156.1577 +</TS>
   157.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   157.2 +++ b/xml.cpp	Sun Jan 30 12:59:10 2005 +0000
   157.3 @@ -0,0 +1,519 @@
   157.4 +#include "xml.h"
   157.5 +
   157.6 +#include <qmessagebox.h>
   157.7 +#include <qcolor.h>
   157.8 +#include <qstylesheet.h>
   157.9 +#include <iostream>
  157.10 +
  157.11 +#include "misc.h"
  157.12 +#include "settings.h"
  157.13 +
  157.14 +#include "version.h"
  157.15 +
  157.16 +static BranchObj *lastBranch;
  157.17 +static FloatObj *lastFloat;
  157.18 +
  157.19 +extern Settings settings;
  157.20 +
  157.21 +mapBuilderHandler::mapBuilderHandler() {}
  157.22 +
  157.23 +mapBuilderHandler::~mapBuilderHandler() {}
  157.24 +
  157.25 +QString mapBuilderHandler::errorProtocol() { return errorProt; }
  157.26 +
  157.27 +bool mapBuilderHandler::startDocument()
  157.28 +{
  157.29 +    errorProt = "";
  157.30 +    state = StateInit;
  157.31 +    laststate = StateInit;
  157.32 +    branchDepth=0;
  157.33 +	htmldata="";
  157.34 +	isVymPart=false;
  157.35 +    return true;
  157.36 +}
  157.37 +
  157.38 +
  157.39 +QString mapBuilderHandler::parseHREF(QString href)
  157.40 +{
  157.41 +	QString type=href.section(":",0,0);
  157.42 +	QString path=href.section(":",1,1);
  157.43 +	if (!tmpDir.endsWith("/"))
  157.44 +		return tmpDir + "/" + path;
  157.45 +	else	
  157.46 +		return tmpDir + path;
  157.47 +}
  157.48 +
  157.49 +bool mapBuilderHandler::startElement  ( const QString&, const QString&,
  157.50 +                    const QString& eName, const QXmlAttributes& atts ) 
  157.51 +{
  157.52 +    QColor col;
  157.53 +//	cout << "startElement <"<<eName<<">  state="<<state <<"  laststate="<<laststate<<endl;
  157.54 +    if ( state == StateInit && (eName == "vymmap")  ) 
  157.55 +	{
  157.56 +        state = StateMap;
  157.57 +		if (!atts.value( "version").isEmpty() ) 
  157.58 +		{
  157.59 +			mc->setVersion(atts.value( "version" ));
  157.60 +			if (!mc->checkVersion())
  157.61 +				QMessageBox::warning( 0, "Warning: Version Problem" ,
  157.62 +				   "<h3>Map is newer than VYM</h3>"
  157.63 +				   "<p>The map you are just trying to load was "
  157.64 +				   "saved using vym " +atts.value("version")+". "
  157.65 +				   "The version of this vym is " __VYM_VERSION__
  157.66 +				   ". If you run into problems after pressing "
  157.67 +				   "the ok-button below, updating vym should help.");
  157.68 +
  157.69 +		}
  157.70 +		if (loadMode==NewMap)
  157.71 +		{
  157.72 +			if (!atts.value( "author").isEmpty() )
  157.73 +			{
  157.74 +				mc->setAuthor(atts.value( "author" ) );
  157.75 +			}
  157.76 +			if (!atts.value( "comment").isEmpty() )
  157.77 +			{
  157.78 +				mc->setComment (atts.value( "comment" ) );
  157.79 +			}
  157.80 +			if (!atts.value( "backgroundColor").isEmpty() )
  157.81 +			{
  157.82 +				col.setNamedColor(atts.value("backgroundColor"));
  157.83 +				mc->getCanvas()->setBackgroundColor(col);
  157.84 +			}	    
  157.85 +			if (!atts.value( "linkColorHint").isEmpty() ) 
  157.86 +			{
  157.87 +				if (atts.value("linkColorHint")=="HeadingColor")
  157.88 +					me->setLinkColorHint(HeadingColor);
  157.89 +				else
  157.90 +					me->setLinkColorHint(DefaultColor);
  157.91 +			}
  157.92 +			if (!atts.value( "linkStyle").isEmpty() ) 
  157.93 +			{
  157.94 +				QString s=atts.value("linkStyle");
  157.95 +				if (s=="StyleLine")
  157.96 +					me->setLinkStyle(StyleLine);
  157.97 +				else	
  157.98 +					if (s=="StyleParabel")
  157.99 +						me->setLinkStyle(StyleParabel);
 157.100 +					else	
 157.101 +						if (s=="StylePolyLine")
 157.102 +							me->setLinkStyle(StylePolyLine);
 157.103 +						else	
 157.104 +							me->setLinkStyle(StylePolyParabel);
 157.105 +			}	
 157.106 +			if (!atts.value( "linkColor").isEmpty() ) 
 157.107 +			{
 157.108 +				col.setNamedColor(atts.value("linkColor"));
 157.109 +				me->setLinkColor(col);
 157.110 +			}	
 157.111 +		}	
 157.112 +	} else if ( eName == "select" && state == StateMap ) 
 157.113 +	{
 157.114 +		state=StateMapSelect;
 157.115 +	} else if ( eName == "setting" && state == StateMap ) 
 157.116 +	{
 157.117 +		state=StateMapSetting;
 157.118 +		if (loadMode==NewMap)
 157.119 +			readSettingAttr (atts);
 157.120 +	} else if ( eName == "mapcenter" && state == StateMap ) 
 157.121 +	{
 157.122 +		state=StateMapCenter;
 157.123 +		if (loadMode==NewMap)
 157.124 +		{	
 157.125 +			// Really use the found mapcenter as MCO in a new map
 157.126 +			lastBranch=mc;	// avoid empty pointer
 157.127 +		} else
 157.128 +		{
 157.129 +			// Treat the found mapcenter as a branch 
 157.130 +			// in an existing map
 157.131 +			LinkableMapObj* lmo=me->getSelection();
 157.132 +			if (lmo && (typeid(*lmo) == typeid(BranchObj) ) 
 157.133 +			        || (typeid(*lmo) == typeid(MapCenterObj) ) )
 157.134 +			{
 157.135 +				lastBranch=(BranchObj*)(lmo);
 157.136 +				if (loadMode==ImportAdd)
 157.137 +				{
 157.138 +					lastBranch->addBranch();
 157.139 +					lastBranch=lastBranch->getLastBranch();
 157.140 +				} else
 157.141 +					lastBranch->clear();
 157.142 +			} else
 157.143 +				return false;
 157.144 +		}
 157.145 +		readBranchAttr (atts);
 157.146 +	} else if ( (eName == "standardflag" ||eName == "standardFlag") && state == StateMapCenter) 
 157.147 +	{
 157.148 +		state=StateMapCenterStandardFlag;
 157.149 +	} else if ( eName == "heading" && state == StateMapCenter) 
 157.150 +	{
 157.151 +		state=StateMapCenterHeading;
 157.152 +		if (!atts.value( "textColor").isEmpty() ) 
 157.153 +		{
 157.154 +			col.setNamedColor(atts.value("textColor"));
 157.155 +			lastBranch->setColor(col ,false );
 157.156 +		}	    
 157.157 +	} else if ( eName == "note" && state == StateMapCenter) 
 157.158 +	{	// only for backward compatibility (<1.4.6). Use htmlnote now.
 157.159 +		state=StateMapCenterNote;
 157.160 +		if (!readNoteAttr (atts) ) return false;
 157.161 +	} else if ( eName == "htmlnote" && state == StateMapCenter) 
 157.162 +	{
 157.163 +		laststate=state;
 157.164 +		state=StateHtmlNote;
 157.165 +    } else if ( eName == "floatimage" && state == StateMapCenter ) 
 157.166 +	{
 157.167 +		state=StateMapCenterFloatImage;
 157.168 +        lastBranch->addFloatImage();
 157.169 +		lastFloat=lastBranch->getLastFloatImage();
 157.170 +		if (!readFloatImageAttr(atts)) return false;
 157.171 +	} else if ( eName == "branch" && state == StateMap) 
 157.172 +	{
 157.173 +		// This is used in vymparts, which have no mapcenter!
 157.174 +		isVymPart=true;
 157.175 +		state=StateBranch;
 157.176 +		LinkableMapObj* lmo=me->getSelection();
 157.177 +		if (lmo && (typeid(*lmo) == typeid(BranchObj) ) 
 157.178 +				|| (typeid(*lmo) == typeid(MapCenterObj) ) )
 157.179 +		{
 157.180 +			lastBranch=(BranchObj*)(lmo);
 157.181 +			if (loadMode==ImportAdd)
 157.182 +			{
 157.183 +				lastBranch->addBranch();
 157.184 +				lastBranch=lastBranch->getLastBranch();
 157.185 +			} else
 157.186 +				lastBranch->clear();
 157.187 +		} else
 157.188 +			return false;
 157.189 +		branchDepth=1;
 157.190 +		readBranchAttr (atts);
 157.191 +	} else if ( eName == "branch" && state == StateMapCenter) 
 157.192 +	{
 157.193 +		state=StateBranch;
 157.194 +		branchDepth=1;
 157.195 +		lastBranch->addBranch();
 157.196 +		lastBranch=lastBranch->getLastBranch();
 157.197 +		readBranchAttr (atts);
 157.198 +	} else if ( (eName=="standardflag" ||eName == "standardFlag") && state == StateBranch) 
 157.199 +	{
 157.200 +		state=StateBranchStandardFlag;
 157.201 +	} else if ( eName == "heading" && state == StateBranch) 
 157.202 +	{
 157.203 +		state=StateBranchHeading;
 157.204 +		if (!atts.value( "textColor").isEmpty() ) 
 157.205 +		{
 157.206 +			col.setNamedColor(atts.value("textColor"));
 157.207 +			lastBranch->setColor(col ,false );
 157.208 +		}	    
 157.209 +    } else if ( eName == "note" && state == StateBranch) 
 157.210 +	{
 157.211 +        state=StateBranchNote;
 157.212 +		if (!readNoteAttr (atts) ) return false;
 157.213 +	} else if ( eName == "htmlnote" && state == StateBranch) 
 157.214 +	{
 157.215 +		laststate=state;
 157.216 +		state=StateHtmlNote;
 157.217 +		no.clear();
 157.218 +		if (!atts.value( "fonthint").isEmpty() ) 
 157.219 +			no.setFontHint(atts.value ("fonthint") );
 157.220 +    } else if ( eName == "floatimage" && state == StateBranch ) 
 157.221 +	{
 157.222 +		state=StateBranchFloatImage;
 157.223 +        lastBranch->addFloatImage();
 157.224 +		lastFloat=lastBranch->getLastFloatImage();
 157.225 +		if (!readFloatImageAttr(atts)) return false;
 157.226 +    } else if ( eName == "branch" && state == StateBranch ) 
 157.227 +	{
 157.228 +        lastBranch->addBranch();
 157.229 +		lastBranch=lastBranch->getLastBranch();		
 157.230 +        branchDepth++;
 157.231 +		readBranchAttr (atts);
 157.232 +    } else if ( eName == "html" && state == StateHtmlNote ) 
 157.233 +	{
 157.234 +		state=StateHtml;
 157.235 +		htmldata="<"+eName;
 157.236 +		readHtmlAttr(atts);
 157.237 +		htmldata+=">";
 157.238 +    } else if ( state == StateHtml ) 
 157.239 +	{
 157.240 +		// accept all while in html mode,
 157.241 +		htmldata+="<"+eName;
 157.242 +		readHtmlAttr(atts);
 157.243 +		htmldata+=">";
 157.244 +    } else
 157.245 +        return false;   // Error
 157.246 +    return true;
 157.247 +}
 157.248 +
 157.249 +bool mapBuilderHandler::endElement  ( const QString&, const QString&, const QString &eName)
 157.250 +{
 157.251 +//	cout << "endElement </"<<eName<<">  state="<<state <<"  laststate="<<laststate<<endl;
 157.252 +    switch ( state ) 
 157.253 +	{
 157.254 +        case StateMapSelect: state=StateMap;  return true;
 157.255 +        case StateMapSetting: state=StateMap;  return true;
 157.256 +        case StateMapCenter: state=StateMap;  return true;
 157.257 +        case StateMapCenterStandardFlag: state=StateMapCenter;  return true;
 157.258 +        case StateMapCenterHeading: state=StateMapCenter;  return true;
 157.259 +        case StateMapCenterNote: state=StateMapCenter;  return true;
 157.260 +        case StateMapCenterFloatImage: state=StateMapCenter;  return true;
 157.261 +        case StateBranch: 
 157.262 +            if (branchDepth>1) 
 157.263 +			{
 157.264 +                branchDepth--;
 157.265 +                state=StateBranch;
 157.266 +            } else  
 157.267 +			{
 157.268 +                branchDepth=0;
 157.269 +				if (isVymPart)
 157.270 +					state=StateMap;
 157.271 +				else
 157.272 +					state=StateMapCenter;
 157.273 +            }   
 157.274 +			lastBranch=(BranchObj*)(lastBranch->getParObj());
 157.275 +             return true;
 157.276 +        case StateBranchStandardFlag: state=StateBranch;  return true;
 157.277 +        case StateBranchHeading: state=StateBranch;  return true;
 157.278 +        case StateBranchNote: state=StateBranch; return true;
 157.279 +        case StateBranchFloatImage: state=StateBranch;  return true;
 157.280 +        case StateHtmlNote: state=laststate; return true;
 157.281 +        case StateHtml: 
 157.282 +			htmldata+="</"+eName+">";
 157.283 +			if (eName=="html")
 157.284 +			{
 157.285 +				state=StateHtmlNote;  
 157.286 +				htmldata.replace ("<br></br>","<br />");
 157.287 +				no.setNote (htmldata);
 157.288 +				lastBranch->setNote (no);
 157.289 +				return true;
 157.290 +			}	else
 157.291 +			{
 157.292 +				return true;
 157.293 +			}	
 157.294 +        case StateMap: state=StateInit;  return true;
 157.295 +        default : 
 157.296 +			// even for HTML includes, this should never be reached
 157.297 +			return false;
 157.298 +    }   
 157.299 +}
 157.300 +
 157.301 +bool mapBuilderHandler::characters   ( const QString& ch)
 157.302 +{
 157.303 +	//cout << "characters \""<<ch<<"\"  state="<<state <<"  laststate="<<laststate<<endl;
 157.304 +
 157.305 +	QString ch_org=quotemeta (ch);
 157.306 +    QString ch_simplified=ch.simplifyWhiteSpace();
 157.307 +    if ( ch_simplified.isEmpty() ) return true;
 157.308 +
 157.309 +    switch ( state ) 
 157.310 +    {
 157.311 +        case StateInit: break;
 157.312 +        case StateMap: break; 
 157.313 +		case StateMapSelect:
 157.314 +			me->select(ch_simplified);
 157.315 +			break;
 157.316 +		case StateMapSetting:break;
 157.317 +        case StateMapCenter: break;
 157.318 +        case StateMapCenterStandardFlag: 
 157.319 +            lastBranch->activateStandardFlag(ch_simplified); 
 157.320 +            break;
 157.321 +        case StateMapCenterHeading: 
 157.322 +            lastBranch->setHeading(ch_simplified); 
 157.323 +            break;
 157.324 +        case StateMapCenterNote:
 157.325 +			lastBranch->setNote(ch_simplified);
 157.326 +			break;
 157.327 +        case StateBranch: break;
 157.328 +        case StateBranchStandardFlag: 
 157.329 +            lastBranch->activateStandardFlag(ch_simplified); 
 157.330 +            break;
 157.331 +        case StateBranchHeading: 
 157.332 +            lastBranch->setHeading(ch_simplified);
 157.333 +            break;
 157.334 +        case StateBranchNote: 
 157.335 +			lastBranch->setNote(ch_simplified);
 157.336 +			break;
 157.337 +        case StateBranchFloatImage: break;
 157.338 +        case StateHtmlNote: break;
 157.339 +        case StateHtml:
 157.340 +			htmldata+=ch_org;
 157.341 +			break;
 157.342 +        default: 
 157.343 +			return false;
 157.344 +    }
 157.345 +    return true;
 157.346 +}
 157.347 +
 157.348 +QString mapBuilderHandler::errorString() 
 157.349 +{
 157.350 +    return "the document is not in the VYM file format";
 157.351 +}
 157.352 +
 157.353 +bool mapBuilderHandler::fatalError( const QXmlParseException& exception ) 
 157.354 +{
 157.355 +    errorProt += QString( "fatal parsing error: %1 in line %2, column %3\n")
 157.356 +    .arg( exception.message() )
 157.357 +    .arg( exception.lineNumber() )
 157.358 +    .arg( exception.columnNumber() );
 157.359 +
 157.360 +    return QXmlDefaultHandler::fatalError( exception );
 157.361 +}
 157.362 +
 157.363 +void mapBuilderHandler::setMapEditor (MapEditor* e)
 157.364 +{
 157.365 +    me=e;
 157.366 +	mc=me->getMapCenter();
 157.367 +}
 157.368 +
 157.369 +void mapBuilderHandler::setTmpDir (QString tp)
 157.370 +{
 157.371 +	tmpDir=tp;
 157.372 +}
 157.373 +
 157.374 +void mapBuilderHandler::setLoadMode (const LoadMode &lm)
 157.375 +{
 157.376 +	loadMode=lm;
 157.377 +}
 157.378 +
 157.379 +bool mapBuilderHandler::readBranchAttr (const QXmlAttributes& a)
 157.380 +{
 157.381 +	bool okx,oky;
 157.382 +	int x,y;
 157.383 +	if (!a.value( "absPosX").isEmpty() && loadMode==NewMap && branchDepth<2) 
 157.384 +	{
 157.385 +		if (!a.value( "absPosY").isEmpty() ) 
 157.386 +		{
 157.387 +			x=a.value("absPosX").toInt (&okx, 10);
 157.388 +			y=a.value("absPosY").toInt (&oky, 10);
 157.389 +			if (okx && oky) 
 157.390 +				lastBranch->move(x,y);
 157.391 +			else
 157.392 +				return false;   // Couldn't read absPos
 157.393 +		}           
 157.394 +	}           
 157.395 +	if (!a.value( "scrolled").isEmpty() )
 157.396 +		lastBranch->toggleScroll();
 157.397 +	if (!a.value( "url").isEmpty() ) 
 157.398 +		lastBranch->setURL (a.value ("url"));
 157.399 +	if (!a.value( "vymLink").isEmpty() ) 
 157.400 +		lastBranch->setVymLink (a.value ("vymLink"));
 157.401 +	if (!a.value( "frameType").isEmpty() ) 
 157.402 +		lastBranch->setFrameType (a.value("frameType"));
 157.403 +	return true;	
 157.404 +}
 157.405 +
 157.406 +bool mapBuilderHandler::readNoteAttr (const QXmlAttributes& a)
 157.407 +{	// only for backward compatibility (<1.4.6). Use htmlnote now.
 157.408 +	no.clear();
 157.409 +	QString fn;
 157.410 +	if (!a.value( "href").isEmpty() ) 
 157.411 +	{
 157.412 +		// Load note
 157.413 +		fn=parseHREF(a.value ("href") );
 157.414 +		QFile file (fn);
 157.415 +		QString s;						// Reading a note
 157.416 +
 157.417 +		if ( !file.open( IO_ReadOnly) )
 157.418 +		{
 157.419 +			qWarning ("mapBuilderHandler::readNoteAttr:  Couldn't load "+fn);
 157.420 +			return false;
 157.421 +		}	
 157.422 +		QTextStream stream( &file );
 157.423 +		QString lines;
 157.424 +		while ( !stream.eof() ) {
 157.425 +			lines += stream.readLine()+"\n"; 
 157.426 +		}
 157.427 +		file.close();
 157.428 +		// Convert to richtext
 157.429 +		if ( !QStyleSheet::mightBeRichText( lines ) )
 157.430 +		{
 157.431 +			// Here we are workarounding the QT conversion method:
 157.432 +			// convertFromPlainText does not generate valid xml, needed
 157.433 +			// for the parser, but just <p> and <br> without closing tags.
 157.434 +			// So we have to add those by ourselves
 157.435 +			//lines=quotemeta (lines);
 157.436 +			lines = QStyleSheet::convertFromPlainText( lines, QStyleSheetItem::WhiteSpaceNormal );
 157.437 +			lines.replace ("<br>","<br />");
 157.438 +		}	
 157.439 +
 157.440 +		lines ="<html><head><meta name=\"qrichtext\" content=\"1\" /></head><body>"+lines + "</p></body></html>";
 157.441 +		no.setNote (lines);
 157.442 +	}		
 157.443 +	if (!a.value( "fonthint").isEmpty() ) 
 157.444 +		no.setFontHint(a.value ("fonthint") );
 157.445 +	if (state == StateMapCenterNote) 	
 157.446 +		mc->setNote(no);
 157.447 +	else
 157.448 +		lastBranch->setNote(no);
 157.449 +	return true;
 157.450 +}
 157.451 +
 157.452 +bool mapBuilderHandler::readFloatImageAttr (const QXmlAttributes& a)
 157.453 +{
 157.454 +	if (!a.value( "useOrientation").isEmpty() ) 
 157.455 +	{
 157.456 +		if (a.value ("useOrientation") =="true")
 157.457 +			lastFloat->setUseOrientation (true);
 157.458 +		else	
 157.459 +			lastFloat->setUseOrientation (false);
 157.460 +	}	
 157.461 +	if (!a.value( "href").isEmpty() )
 157.462 +	{
 157.463 +		// Load FloatImage
 157.464 +		if (!lastFloat->load (parseHREF(a.value ("href") ) ))
 157.465 +		{
 157.466 +			QMessageBox::warning( 0, "Warning: " ,
 157.467 +				"Couldn't load float image\n"+parseHREF(a.value ("href") ));
 157.468 +			lastBranch->removeFloatImage(((FloatImageObj*)(lastFloat)));
 157.469 +			lastFloat=NULL;
 157.470 +			return true;
 157.471 +		}
 157.472 +		
 157.473 +	}	
 157.474 +	if (!a.value( "floatExport").isEmpty() ) 
 157.475 +	{
 157.476 +		if (a.value ("floatExpofrt") =="true")
 157.477 +			lastFloat->setFloatExport (true);
 157.478 +		else	
 157.479 +			lastFloat->setFloatExport (false);
 157.480 +	}	
 157.481 +	if (!a.value( "zPlane").isEmpty() ) 
 157.482 +		lastFloat->setZ (a.value("zPlane").toInt ());
 157.483 +    int x,y;
 157.484 +    bool okx,oky;
 157.485 +	if (!a.value( "relPosX").isEmpty() ) 
 157.486 +	{
 157.487 +		if (!a.value( "relPosY").isEmpty() ) 
 157.488 +		{
 157.489 +			// read relPos
 157.490 +			x=a.value("relPosX").toInt (&okx, 10);
 157.491 +			y=a.value("relPosY").toInt (&oky, 10);
 157.492 +			if (okx && oky) 
 157.493 +				lastFloat->setRelPos (QPoint (x,y) );
 157.494 +			else
 157.495 +				// Couldn't read relPos
 157.496 +				return false;  
 157.497 +		}           
 157.498 +	}	
 157.499 +	return true;
 157.500 +}
 157.501 +
 157.502 +bool mapBuilderHandler::readHtmlAttr (const QXmlAttributes& a)
 157.503 +{
 157.504 +	for (int i=1; i<=a.count(); i++)
 157.505 +		htmldata+=" "+a.localName(i-1)+"=\""+a.value(i-1)+"\"";
 157.506 +	return true;
 157.507 +}
 157.508 +
 157.509 +bool mapBuilderHandler::readSettingAttr (const QXmlAttributes& a)
 157.510 +{
 157.511 +	if (!a.value( "key").isEmpty() ) 
 157.512 +	{
 157.513 +		if (!a.value( "value").isEmpty() ) 
 157.514 +			settings.setLocalEntry (me->getDestPath(), a.value ("key"), a.value ("value"));
 157.515 +		else
 157.516 +			return false;
 157.517 +		
 157.518 +	} else
 157.519 +		return false;
 157.520 +	
 157.521 +	return true;
 157.522 +}
   158.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   158.2 +++ b/xml.h	Sun Jan 30 12:59:10 2005 +0000
   158.3 @@ -0,0 +1,62 @@
   158.4 +#ifndef XLM_H
   158.5 +#define XLM_H
   158.6 +
   158.7 +
   158.8 +#include <qstring.h>
   158.9 +#include <qxml.h>
  158.10 +
  158.11 +#include "mapcenterobj.h"
  158.12 +#include "mapeditor.h"
  158.13 +
  158.14 +
  158.15 +class mapBuilderHandler  : public QXmlDefaultHandler
  158.16 +{
  158.17 +public:
  158.18 +	mapBuilderHandler();
  158.19 +	~mapBuilderHandler();
  158.20 +	QString errorProtocol();
  158.21 +	bool startDocument();
  158.22 +	QString mapBuilderHandler::parseHREF(QString);
  158.23 +	bool startElement ( const QString&, const QString&,
  158.24 +                        const QString& eName, const QXmlAttributes& atts ); 
  158.25 +	bool   endElement ( const QString&, const QString&, const QString& ); 
  158.26 +	bool characters   ( const QString&);
  158.27 +	QString errorString();
  158.28 +	bool fatalError( const QXmlParseException&);
  158.29 +	void setMapEditor (MapEditor*);
  158.30 +	void setTmpDir (QString);
  158.31 +	void setLoadMode (const LoadMode &);
  158.32 +	bool readBranchAttr (const QXmlAttributes&);
  158.33 +	bool readNoteAttr (const QXmlAttributes&);
  158.34 +	bool readFloatImageAttr (const QXmlAttributes&);
  158.35 +	bool readHtmlAttr (const QXmlAttributes&);
  158.36 +	bool readSettingAttr (const QXmlAttributes&);
  158.37 +
  158.38 +private:
  158.39 +	QString     errorProt;
  158.40 +	enum State 
  158.41 +	{ 
  158.42 +		StateInit, StateMap, StateMapSelect, 
  158.43 +		StateMapSetting,
  158.44 +		StateMapCenter, StateMapCenterStandardFlag,
  158.45 +		StateMapCenterHeading, StateMapCenterNote, 
  158.46 +		StateMapCenterFloatImage,
  158.47 +		
  158.48 +		StateBranch, StateBranchStandardFlag,
  158.49 +		StateBranchHeading, StateBranchNote, 
  158.50 +		StateBranchFloatImage, 
  158.51 +		StateHtmlNote, StateHtml 
  158.52 +	 };
  158.53 +				 
  158.54 +
  158.55 +	LoadMode loadMode;
  158.56 +	bool isVymPart;
  158.57 +	State state;			 
  158.58 +	State laststate;
  158.59 +	QString htmldata;
  158.60 +	int branchDepth; 
  158.61 +	NoteObj no;
  158.62 +	MapCenterObj* mc;
  158.63 +	MapEditor* me; QString tmpDir; 
  158.64 +}; 
  158.65 +#endif