From: Lars Gullik Bjønnes Date: Thu, 16 Dec 1999 06:43:25 +0000 (+0000) Subject: remove bogus backslashed from iso-8859-1, try to fix insert and encodeString, fixes... X-Git-Tag: 1.6.10~22465 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=7c6267e4b10364cc892776e0a426eb32ade6b0b4;p=features.git remove bogus backslashed from iso-8859-1, try to fix insert and encodeString, fixes in insetlatexaccent removed some unused code git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@383 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/ChangeLog b/ChangeLog index c73eef1fca..278c6ca60c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,31 @@ +1999-12-16 Lars Gullik Bjønnes + + * src/kbmap.C: commented out the use of the hash map in kb_map, + beginning of movement to a stl::container. + + * several files: removed code that was not in effect when + MOVE_TEXT was defined. + + * lib/kbd/iso8859-1.cdef: removed bogus backslashes. Backslashes + for escaping should not be used. We can discuss if the string + should be enclosed in f.ex. [] instead of "". + + * src/trans_mgr.C (insert): use the new returned value from + encodeString to get deadkeys and keymaps done correctly. + + * src/chset.C (encodeString): changed to return a pair, to tell + what to use if we know the string. + + * src/lyxscreen.h (fillArc): new function. + + * src/FontInfo.C (resize): rewritten to use more std::string like + structore, especially string::replace. + + * src/insets/insetlatexaccent.C (Draw): use fillArc for the + approp. accents. + + * configure.in (chmod +x some scripts): remove config/gcc-hack + 1999-12-15 Jean-Marc Lasgouttes * src/buffer.C (writeFile): change once again the top comment in a diff --git a/configure.in b/configure.in index d00c816513..a7162e5722 100644 --- a/configure.in +++ b/configure.in @@ -24,8 +24,7 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' ### Set the execute permissions of the various scripts correctly -for file in config/install-sh config/mkinstalldirs config/hack-gcc \ - lib/configure ; do +for file in config/install-sh config/mkinstalldirs lib/configure ; do chmod 755 ${srcdir}/${file} done diff --git a/lib/kbd/iso8859-1.cdef b/lib/kbd/iso8859-1.cdef index b064f05c7e..39225540d8 100644 --- a/lib/kbd/iso8859-1.cdef +++ b/lib/kbd/iso8859-1.cdef @@ -8,103 +8,96 @@ 161 "!`" # mirrored ! #162 Cent sign? -163 "\\pounds{}" # pound sign +163 "\pounds{}" # pound sign #164 String sign? #165 Yen sign? #166 What's this? -167 "\\S{}" # paragraph -168 "\\\"{}" # umlaut -169 "\\copyright{}" -170 "\\b{a}" # a macron -171 "\\guillemotleft{}" +167 "\S{}" # paragraph +168 "\"{}" # umlaut +169 "\copyright{}" +170 "\b{a}" # a macron +171 "\guillemotleft{}" #172 What's this? #173 horiz. line? #174 Registered? #175 horiz. line at the top? -176 "\\b{}" # circle +176 "\b{}" # circle #177 Plusminus? #178 ^2? #179 ^3? -180 "\\'{}" # acute -181 "$\\mu$" # micro +180 "\'{}" # acute +181 "$\mu$" # micro #182 Paragraph? -183 "$\\cdot$" -184 "\\c{}" # cedilla +183 "$\cdot$" +184 "\c{}" # cedilla 185 "${^1}$" -186 "\\b{o}" # o macron -187 "\\guillemotright{}" -188 "\\ensuremath{\frac14}" -189 "\\ensuremath{\frac12}" -190 "\\ensuremath{\frac34}" # "0BE +186 "\b{o}" # o macron +187 "\guillemotright{}" +188 "\ensuremath{\frac14}" +189 "\ensuremath{\frac12}" +190 "\ensuremath{\frac34}" # "0BE 191 "?`" # mirrored ? -192 "\\`{A}" -193 "\\'{A}" -194 "\\^{A}" -195 "\\~{A}" -196 "\\\"{A}" -197 "\\AA{}" # A with circle -198 "\\AE{}" # AE cat'ed together -199 "\\c{C}" # C cedilla -200 "\\`{E}" -201 "\\'{E}" -202 "\\^{E}" -203 "\\\"{E}" -204 "\\`{I}" -205 "\\'{I}" -206 "\\^{I}" -207 "\\\"{I}" -208 "\\DH{}" -209 "\\~{N}" -210 "\\`{O}" -211 "\\'{O}" -212 "\\^{O}" -213 "\\~{O}" -214 "\\\"{O}" -215 "$\\times$" -216 "\\O{}" -217 "\\`{U}" -218 "\\'{U}" -219 "\\^{U}" -220 "\\\"{U}" -221 "\\'{Y}" -222 "\\TH{}" -223 "\\ss{}" # German sharp S -224 "\\`{a}" -225 "\\'{a}" -226 "\\^{a}" -227 "\\~{a}" -228 "\\\"{a}" -229 "\\aa{}" # a with circle -230 "\\ae{}" -231 "\\c{c}" # c cedilla -232 "\\`{e}" -233 "\\'{e}" -234 "\\^{e}" -235 "\\\"{e}" -236 "\\`{\\i}" -237 "\\'{\\i}" -238 "\\^{\\i}" -239 "\\\"{\\i}" -240 "\\dh{}" -241 "\\~{n}" -242 "\\`{o}" -243 "\\'{o}" -244 "\\^{o}" -245 "\\~{o}" -246 "\\\"{o}" -247 "$\\div$" -248 "\\o{}" -249 "\\`{u}" -250 "\\'{u}" -251 "\\^{u}" -252 "\\\"{u}" -253 "\\'{y}" -254 "\\th{}" -255 "\\\"{y}" - - - - - - - +192 "\`{A}" +193 "\'{A}" +194 "\^{A}" +195 "\~{A}" +196 "\"{A}" +197 "\AA{}" # A with circle +198 "\AE{}" # AE cat'ed together +199 "\c{C}" # C cedilla +200 "\`{E}" +201 "\'{E}" +202 "\^{E}" +203 "\"{E}" +204 "\`{I}" +205 "\'{I}" +206 "\^{I}" +207 "\"{I}" +208 "\DH{}" +209 "\~{N}" +210 "\`{O}" +211 "\'{O}" +212 "\^{O}" +213 "\~{O}" +214 "\"{O}" +215 "$\times$" +216 "\O{}" +217 "\`{U}" +218 "\'{U}" +219 "\^{U}" +220 "\"{U}" +221 "\'{Y}" +222 "\TH{}" +223 "\ss{}" # German sharp S +224 "\`{a}" +225 "\'{a}" +226 "\^{a}" +227 "\~{a}" +228 "\"{a}" +229 "\aa{}" # a with circle +230 "\ae{}" +231 "\c{c}" # c cedilla +232 "\`{e}" +233 "\'{e}" +234 "\^{e}" +235 "\\"{e}" +236 "\`{\i}" +237 "\'{\i}" +238 "\^{\i}" +239 "\"{\i}" +240 "\dh{}" +241 "\~{n}" +242 "\`{o}" +243 "\'{o}" +244 "\^{o}" +245 "\~{o}" +246 "\"{o}" +247 "$\div$" +248 "\o{}" +249 "\`{u}" +250 "\'{u}" +251 "\^{u}" +252 "\"{u}" +253 "\'{y}" +254 "\th{}" +255 "\"{y}" diff --git a/po/lyx.pot b/po/lyx.pot index f0fd3cfde9..67147d6256 100644 --- a/po/lyx.pot +++ b/po/lyx.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 1999-12-15 12:31+0100\n" +"POT-Creation-Date: 1999-12-16 07:10+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -15,17 +15,17 @@ msgstr "" "Content-Transfer-Encoding: ENCODING\n" #. sgml2lyx failed -#: src/buffer.C:254 src/buffer.C:264 src/buffer.C:3685 src/bufferlist.C:520 -#: src/bufferlist.C:550 src/lyx_cb.C:537 src/lyx_cb.C:904 src/lyx_cb.C:940 +#: src/buffer.C:239 src/buffer.C:249 src/buffer.C:3588 src/bufferlist.C:519 +#: src/bufferlist.C:549 src/lyx_cb.C:520 src/lyx_cb.C:854 src/lyx_cb.C:886 #: src/lyx_sendfax_main.C:262 msgid "Error!" msgstr "" -#: src/buffer.C:255 +#: src/buffer.C:240 msgid "Specified file is unreadable: " msgstr "" -#: src/buffer.C:265 +#: src/buffer.C:250 msgid "Cannot open specified file: " msgstr "" @@ -34,287 +34,285 @@ msgstr "" #. or stop loading the file. #. I can substitute but I don't see how I can #. stop loading... ideas?? ARRae980418 -#: src/buffer.C:456 +#: src/buffer.C:427 msgid "Textclass Loading Error!" msgstr "" -#: src/buffer.C:457 +#: src/buffer.C:428 msgid "Can't load textclass " msgstr "" -#: src/buffer.C:459 +#: src/buffer.C:430 msgid "-- substituting default" msgstr "" -#: src/buffer.C:1079 +#: src/buffer.C:1050 msgid "Warning: Ignoring Old Inset" msgstr "" -#: src/buffer.C:1160 +#: src/buffer.C:1131 #, c-format msgid "Warning: need lyxformat %.2f but found %.2f\n" msgstr "" -#: src/buffer.C:1164 +#: src/buffer.C:1135 #, c-format msgid "ERROR: need lyxformat %.2f but found %.2f\n" msgstr "" -#: src/buffer.C:1182 +#: src/buffer.C:1153 msgid "Warning!" msgstr "" -#: src/buffer.C:1183 +#: src/buffer.C:1154 msgid "Reading of document is not complete" msgstr "" -#: src/buffer.C:1184 +#: src/buffer.C:1155 msgid "Maybe the document is truncated" msgstr "" #. "\\lyxformat" not found -#: src/buffer.C:1190 src/buffer.C:1197 src/buffer.C:1200 +#: src/buffer.C:1161 src/buffer.C:1168 src/buffer.C:1171 msgid "ERROR!" msgstr "" -#: src/buffer.C:1191 +#: src/buffer.C:1162 msgid "Old LyX file format found. Use LyX 0.10.x to read this!" msgstr "" -#: src/buffer.C:1197 +#: src/buffer.C:1168 msgid "Not a LyX file!" msgstr "" -#: src/buffer.C:1200 +#: src/buffer.C:1171 msgid "Unable to read file!" msgstr "" -#: src/buffer.C:1216 src/buffer.C:1219 +#: src/buffer.C:1187 src/buffer.C:1190 msgid "Error! Document is read-only: " msgstr "" -#: src/buffer.C:1229 src/buffer.C:1232 +#: src/buffer.C:1200 src/buffer.C:1203 msgid "Error! Cannot write file: " msgstr "" -#: src/buffer.C:1240 src/buffer.C:1243 +#: src/buffer.C:1211 src/buffer.C:1214 msgid "Error! Cannot open file: " msgstr "" -#: src/buffer.C:1291 +#: src/buffer.C:1260 msgid "Error: Cannot write file:" msgstr "" -#: src/buffer.C:1397 +#: src/buffer.C:1366 msgid "Error: Cannot open temporary file:" msgstr "" -#: src/buffer.C:1614 +#: src/buffer.C:1583 msgid "Error: Cannot open file: " msgstr "" -#: src/buffer.C:2187 src/buffer.C:2777 src/buffer.C:3604 src/buffer.C:3626 -#: src/paragraph.C:3577 +#: src/buffer.C:2156 src/buffer.C:2746 src/buffer.C:3507 src/buffer.C:3529 +#: src/paragraph.C:3590 msgid "LYX_ERROR:" msgstr "" -#: src/buffer.C:2187 src/buffer.C:2777 +#: src/buffer.C:2156 src/buffer.C:2746 msgid "Cannot write file" msgstr "" -#: src/buffer.C:2259 src/buffer.C:2858 +#: src/buffer.C:2228 src/buffer.C:2826 msgid "Error : Wrong depth for LatexType Command.\n" msgstr "" #. path to LaTeX file -#: src/buffer.C:3238 +#: src/buffer.C:3186 msgid "Running LaTeX..." msgstr "" -#: src/buffer.C:3255 +#: src/buffer.C:3203 msgid "LaTeX did not work!" msgstr "" -#: src/buffer.C:3256 src/buffer.C:3329 src/buffer.C:3402 +#: src/buffer.C:3204 src/buffer.C:3273 src/buffer.C:3342 msgid "Missing log file:" msgstr "" #. no errors or any other things to think about so: -#: src/buffer.C:3258 src/buffer.C:3267 src/buffer.C:3331 src/buffer.C:3340 -#: src/buffer.C:3404 src/buffer.C:3412 src/combox.C:465 +#: src/buffer.C:3206 src/buffer.C:3215 src/buffer.C:3275 src/buffer.C:3284 +#: src/buffer.C:3344 src/buffer.C:3352 src/combox.C:465 msgid "Done" msgstr "" #. path to Literate file -#: src/buffer.C:3308 +#: src/buffer.C:3252 msgid "Running Literate..." msgstr "" -#: src/buffer.C:3328 +#: src/buffer.C:3272 msgid "Literate command did not work!" msgstr "" #. path to Literate file -#: src/buffer.C:3381 +#: src/buffer.C:3321 msgid "Building Program..." msgstr "" -#: src/buffer.C:3401 +#: src/buffer.C:3341 msgid "Build did not work!" msgstr "" #. path to LaTeX file -#: src/buffer.C:3452 +#: src/buffer.C:3388 msgid "Running chktex..." msgstr "" -#: src/buffer.C:3468 +#: src/buffer.C:3404 msgid "chktex did not work!" msgstr "" -#: src/buffer.C:3469 +#: src/buffer.C:3405 msgid "Could not run with file:" msgstr "" -#: src/buffer.C:3605 src/buffer.C:3627 src/paragraph.C:3578 +#: src/buffer.C:3508 src/buffer.C:3530 src/paragraph.C:3591 msgid "Cannot open temporary file:" msgstr "" -#: src/buffer.C:3678 +#: src/buffer.C:3581 msgid "Error! Can't open temporary file:" msgstr "" -#: src/buffer.C:3686 +#: src/buffer.C:3589 msgid "Error executing *roff command on table" msgstr "" -#: src/buffer.C:3886 src/buffer.C:3938 src/lyx_cb.C:3627 src/lyx_cb.C:3705 -#: src/text.C:1847 +#: src/buffer.C:3758 src/lyx_cb.C:3268 src/text.C:1847 msgid "Impossible Operation!" msgstr "" -#: src/buffer.C:3887 src/buffer.C:3939 +#: src/buffer.C:3759 msgid "Cannot insert table/list in table." msgstr "" -#: src/buffer.C:3888 src/buffer.C:3940 src/lyx_cb.C:3629 src/lyx_cb.C:3707 -#: src/text.C:1849 src/text.C:3888 src/text.C:3896 src/text.C:3911 -#: src/text.C:3928 src/text2.C:2102 src/text2.C:2112 +#: src/buffer.C:3760 src/lyx_cb.C:3270 src/text.C:1849 src/text.C:3888 +#: src/text.C:3896 src/text.C:3911 src/text.C:3928 src/text2.C:2102 +#: src/text2.C:2112 msgid "Sorry." msgstr "" -#: src/bufferlist.C:98 src/bufferlist.C:255 src/lyxvc.C:87 src/lyxvc.C:117 +#: src/bufferlist.C:98 src/bufferlist.C:258 src/lyxvc.C:87 src/lyxvc.C:117 #: src/lyxvc.C:143 msgid "Changes in document:" msgstr "" -#: src/bufferlist.C:101 src/bufferlist.C:257 +#: src/bufferlist.C:101 src/bufferlist.C:260 msgid "Save document?" msgstr "" -#: src/bufferlist.C:117 +#: src/bufferlist.C:118 msgid "Some documents were not saved:" msgstr "" -#: src/bufferlist.C:118 +#: src/bufferlist.C:119 msgid "Exit anyway?" msgstr "" -#: src/bufferlist.C:129 +#: src/bufferlist.C:130 msgid "Saving document" msgstr "" -#: src/bufferlist.C:201 +#: src/bufferlist.C:204 msgid "Document saved as" msgstr "" -#: src/bufferlist.C:212 +#: src/bufferlist.C:215 msgid "Could not delete auto-save file!" msgstr "" -#: src/bufferlist.C:222 +#: src/bufferlist.C:225 msgid "Save failed!" msgstr "" -#: src/bufferlist.C:290 +#: src/bufferlist.C:293 msgid "No Documents Open!%t" msgstr "" -#: src/bufferlist.C:368 +#: src/bufferlist.C:363 msgid "lyx: Attempting to save document " msgstr "" -#: src/bufferlist.C:371 +#: src/bufferlist.C:366 msgid " as..." msgstr "" -#: src/bufferlist.C:395 +#: src/bufferlist.C:392 msgid " Save seems successful. Phew." msgstr "" -#: src/bufferlist.C:399 +#: src/bufferlist.C:396 msgid " Save failed! Trying..." msgstr "" -#: src/bufferlist.C:402 +#: src/bufferlist.C:399 msgid " Save failed! Bummer. Document is lost." msgstr "" -#: src/bufferlist.C:429 +#: src/bufferlist.C:428 msgid "An emergency save of this document exists!" msgstr "" -#: src/bufferlist.C:431 +#: src/bufferlist.C:430 msgid "Try to load that instead?" msgstr "" -#: src/bufferlist.C:453 +#: src/bufferlist.C:452 msgid "Autosave file is newer." msgstr "" -#: src/bufferlist.C:455 +#: src/bufferlist.C:454 msgid "Load that one instead?" msgstr "" -#: src/bufferlist.C:520 +#: src/bufferlist.C:519 msgid "Unable to open template" msgstr "" -#: src/bufferlist.C:551 +#: src/bufferlist.C:550 msgid "Could not convert file" msgstr "" -#: src/bufferlist.C:564 src/lyxfunc.C:4675 src/lyxfunc.C:4814 -#: src/lyxfunc.C:4893 +#: src/bufferlist.C:563 src/lyxfunc.C:2485 src/lyxfunc.C:2624 +#: src/lyxfunc.C:2703 msgid "Document is already open:" msgstr "" -#: src/bufferlist.C:566 +#: src/bufferlist.C:565 msgid "Do you want to reload that document?" msgstr "" -#: src/bufferlist.C:582 +#: src/bufferlist.C:581 msgid "File `" msgstr "" -#: src/bufferlist.C:583 +#: src/bufferlist.C:582 msgid "' is read-only." msgstr "" -#: src/bufferlist.C:599 +#: src/bufferlist.C:598 msgid "Cannot open specified file:" msgstr "" -#: src/bufferlist.C:601 +#: src/bufferlist.C:600 msgid "Create new document with this name?" msgstr "" -#: src/BufferView.C:323 +#: src/BufferView.C:284 msgid "Formatting document..." msgstr "" -#: src/BufferView.C:437 src/BufferView.C:441 src/BufferView.C:458 -#: src/BufferView.C:462 +#: src/BufferView.C:353 src/BufferView.C:357 msgid "No more errors" msgstr "" @@ -324,7 +322,7 @@ msgstr "" #: src/bullet_forms.C:51 src/credits_form.C:19 src/credits_form.C:59 #: src/form1.C:43 src/form1.C:117 src/form1.C:261 src/form1.C:284 -#: src/insets/insetbib.C:95 src/insets/insetbib.C:123 +#: src/insets/insetbib.C:89 src/insets/insetbib.C:117 #: src/insets/insetinclude.C:47 src/insets/insetindex.C:56 #: src/latexoptions.C:21 src/layout_forms.C:72 src/layout_forms.C:277 #: src/layout_forms.C:413 src/layout_forms.C:477 src/layout_forms.C:697 @@ -344,8 +342,8 @@ msgid "Apply|#A" msgstr "" #: src/bullet_forms.C:57 src/form1.C:120 src/form1.C:264 src/form1.C:290 -#: src/insets/insetbib.C:98 src/insets/insetbib.C:99 src/insets/insetbib.C:126 -#: src/insets/insetbib.C:127 src/insets/insetinclude.C:50 +#: src/insets/insetbib.C:92 src/insets/insetbib.C:93 src/insets/insetbib.C:120 +#: src/insets/insetbib.C:121 src/insets/insetinclude.C:50 #: src/insets/insetinclude.C:51 src/insets/insetindex.C:60 #: src/insets/insetindex.C:61 src/latexoptions.C:27 src/layout_forms.C:64 #: src/layout_forms.C:285 src/layout_forms.C:391 src/layout_forms.C:419 @@ -733,56 +731,56 @@ msgstr "" msgid "Replace All|#A#a" msgstr "" -#: src/insets/figinset.C:1085 +#: src/insets/figinset.C:1099 msgid "[render error]" msgstr "" -#: src/insets/figinset.C:1086 +#: src/insets/figinset.C:1100 msgid "[rendering ... ]" msgstr "" -#: src/insets/figinset.C:1088 +#: src/insets/figinset.C:1102 msgid "[no file]" msgstr "" -#: src/insets/figinset.C:1089 +#: src/insets/figinset.C:1103 msgid "[not displayed]" msgstr "" -#: src/insets/figinset.C:1090 +#: src/insets/figinset.C:1104 msgid "[no ghostscript]" msgstr "" -#: src/insets/figinset.C:1092 +#: src/insets/figinset.C:1106 msgid "[unknown error]" msgstr "" -#: src/insets/figinset.C:1289 +#: src/insets/figinset.C:1303 msgid "Figure" msgstr "" -#: src/insets/figinset.C:1350 src/insets/figinset.C:1483 +#: src/insets/figinset.C:1365 src/insets/figinset.C:1498 msgid "empty figure path" msgstr "" -#: src/insets/figinset.C:2137 +#: src/insets/figinset.C:2154 msgid "Clipart" msgstr "" -#: src/insets/figinset.C:2138 src/lyxfunc.C:4707 src/lyxfunc.C:4770 -#: src/lyxfunc.C:4993 +#: src/insets/figinset.C:2155 src/lyxfunc.C:2517 src/lyxfunc.C:2580 +#: src/lyxfunc.C:2803 msgid "Document" msgstr "" -#: src/insets/figinset.C:2144 src/insets/figinset.C:2147 +#: src/insets/figinset.C:2161 src/insets/figinset.C:2165 msgid "EPS Figure" msgstr "" -#: src/insets/figinset.C:2161 +#: src/insets/figinset.C:2179 msgid "Filename can't contain any of these characters:" msgstr "" -#: src/insets/figinset.C:2162 +#: src/insets/figinset.C:2182 #, no-c-format msgid "space, '#', '~', '$' or '%'." msgstr "" @@ -816,57 +814,57 @@ msgstr "" msgid "HTML type|#H" msgstr "" -#: src/LyXAction.C:114 src/insets/form_url.C:31 src/insets/inseterror.C:167 +#: src/LyXAction.C:116 src/insets/form_url.C:31 src/insets/inseterror.C:167 #: src/latexoptions.C:47 src/layout_forms.C:240 src/layout_forms.C:562 #: src/layout_forms.C:790 src/lyx.C:125 src/lyx_sendfax.C:109 src/lyxvc.C:251 #: src/mathed/math_forms.C:179 msgid "Close" msgstr "" -#: src/insets/insetbib.C:88 +#: src/insets/insetbib.C:82 msgid "Key:" msgstr "" -#: src/insets/insetbib.C:102 src/insets/insetbib.C:103 +#: src/insets/insetbib.C:96 src/insets/insetbib.C:97 msgid "Remark:|#R" msgstr "" #. InsetBibtex uses the same form, with different labels -#: src/insets/insetbib.C:120 src/insets/insetbib.C:121 -#: src/insets/insetbib.C:274 src/insets/insetbib.C:275 +#: src/insets/insetbib.C:114 src/insets/insetbib.C:115 +#: src/insets/insetbib.C:269 src/insets/insetbib.C:270 msgid "Key:|#K" msgstr "" -#: src/insets/insetbib.C:130 src/insets/insetbib.C:131 -#: src/insets/insetbib.C:276 src/insets/insetbib.C:277 +#: src/insets/insetbib.C:124 src/insets/insetbib.C:125 +#: src/insets/insetbib.C:271 src/insets/insetbib.C:272 msgid "Label:|#L" msgstr "" -#: src/insets/insetbib.C:179 +#: src/insets/insetbib.C:174 msgid "Citation" msgstr "" -#: src/insets/insetbib.C:285 +#: src/insets/insetbib.C:280 msgid "Bibliography item" msgstr "" -#: src/insets/insetbib.C:300 +#: src/insets/insetbib.C:295 msgid "BibTeX Generated References" msgstr "" -#: src/insets/insetbib.C:415 +#: src/insets/insetbib.C:410 msgid "Database:" msgstr "" -#: src/insets/insetbib.C:416 +#: src/insets/insetbib.C:411 msgid "Style: " msgstr "" -#: src/insets/insetbib.C:424 +#: src/insets/insetbib.C:419 msgid "BibTeX" msgstr "" -#: src/insets/inseterror.C:67 src/insets/inseterror.C:86 src/lyx_cb.C:4357 +#: src/insets/inseterror.C:67 src/insets/inseterror.C:86 src/lyx_cb.C:3804 msgid "Error" msgstr "" @@ -912,8 +910,8 @@ msgid "Use include|#U" msgstr "" #. launches dialog -#: src/insets/insetinclude.C:111 src/lyx_cb.C:386 src/lyxfunc.C:4655 -#: src/lyxfunc.C:4745 src/lyxfunc.C:4794 src/lyxfunc.C:4867 src/lyxfunc.C:4968 +#: src/insets/insetinclude.C:111 src/lyx_cb.C:369 src/lyxfunc.C:2465 +#: src/lyxfunc.C:2555 src/lyxfunc.C:2604 src/lyxfunc.C:2677 src/lyxfunc.C:2778 #: src/menus.C:177 src/menus.C:309 src/menus.C:310 src/menus.C:311 msgid "Documents" msgstr "" @@ -993,7 +991,7 @@ msgid "Ref: " msgstr "" #. / -#: src/insets/insettoc.h:35 src/lyxfunc.C:889 src/lyxfunc.C:2972 +#: src/insets/insettoc.h:35 src/lyxfunc.C:784 msgid "Table of Contents" msgstr "" @@ -1027,7 +1025,7 @@ msgstr "" msgid "Key Mappings" msgstr "" -#: src/kbmap.C:298 +#: src/kbmap.C:250 msgid " options: " msgstr "" @@ -1567,407 +1565,407 @@ msgstr "" msgid "Describe command" msgstr "" -#: src/LyXAction.C:95 +#: src/LyXAction.C:96 msgid "Select previous char" msgstr "" -#: src/LyXAction.C:98 +#: src/LyXAction.C:99 msgid "Insert bibtex" msgstr "" -#: src/LyXAction.C:105 +#: src/LyXAction.C:107 msgid "Build program" msgstr "" -#: src/LyXAction.C:106 +#: src/LyXAction.C:108 msgid "Autosave" msgstr "" -#: src/LyXAction.C:108 +#: src/LyXAction.C:110 msgid "Go to beginning of document" msgstr "" -#: src/LyXAction.C:110 +#: src/LyXAction.C:112 msgid "Select to beginning of document" msgstr "" -#: src/LyXAction.C:113 +#: src/LyXAction.C:115 msgid "Check TeX" msgstr "" -#: src/LyXAction.C:116 +#: src/LyXAction.C:118 msgid "Go to end of document" msgstr "" -#: src/LyXAction.C:118 +#: src/LyXAction.C:120 msgid "Select to end of document" msgstr "" -#: src/LyXAction.C:119 +#: src/LyXAction.C:121 msgid "Export to" msgstr "" -#: src/LyXAction.C:120 +#: src/LyXAction.C:122 msgid "Fax" msgstr "" -#: src/LyXAction.C:123 +#: src/LyXAction.C:125 msgid "Import document" msgstr "" -#: src/LyXAction.C:126 +#: src/LyXAction.C:128 msgid "New document" msgstr "" -#: src/LyXAction.C:128 +#: src/LyXAction.C:130 msgid "New document from template" msgstr "" -#: src/LyXAction.C:129 +#: src/LyXAction.C:131 msgid "Open" msgstr "" -#: src/LyXAction.C:131 +#: src/LyXAction.C:133 msgid "Switch to previous document" msgstr "" -#: src/LyXAction.C:132 src/lyx_cb.C:1015 src/print_form.C:72 +#: src/LyXAction.C:134 src/lyx_cb.C:953 src/print_form.C:72 msgid "Print" msgstr "" -#: src/LyXAction.C:134 +#: src/LyXAction.C:136 msgid "Revert to saved" msgstr "" -#: src/LyXAction.C:136 +#: src/LyXAction.C:138 msgid "Toggle read-only" msgstr "" -#: src/LyXAction.C:137 +#: src/LyXAction.C:139 msgid "Update DVI" msgstr "" -#: src/LyXAction.C:139 +#: src/LyXAction.C:142 msgid "Update PostScript" msgstr "" -#: src/LyXAction.C:140 +#: src/LyXAction.C:143 msgid "View DVI" msgstr "" -#: src/LyXAction.C:142 +#: src/LyXAction.C:145 msgid "View PostScript" msgstr "" -#: src/LyXAction.C:143 src/lyx_sendfax_main.C:278 +#: src/LyXAction.C:146 src/lyx_sendfax_main.C:278 msgid "Save" msgstr "" -#: src/LyXAction.C:144 +#: src/LyXAction.C:147 msgid "Save As" msgstr "" -#: src/LyXAction.C:145 src/lyxfunc.C:665 src/lyxfunc.C:2748 +#: src/LyXAction.C:149 src/lyxfunc.C:638 msgid "Cancel" msgstr "" -#: src/LyXAction.C:146 +#: src/LyXAction.C:150 msgid "Go one char back" msgstr "" -#: src/LyXAction.C:147 +#: src/LyXAction.C:152 msgid "Go one char forward" msgstr "" -#: src/LyXAction.C:149 +#: src/LyXAction.C:155 msgid "Insert citation" msgstr "" -#: src/LyXAction.C:152 +#: src/LyXAction.C:158 msgid "Execute command" msgstr "" -#: src/LyXAction.C:154 src/lyx_cb.C:2742 src/lyx_cb.C:2749 +#: src/LyXAction.C:160 src/lyx_cb.C:2493 msgid "Copy" msgstr "" -#: src/LyXAction.C:155 src/lyx_cb.C:2769 +#: src/LyXAction.C:161 src/lyx_cb.C:2506 msgid "Cut" msgstr "" -#: src/LyXAction.C:161 +#: src/LyXAction.C:167 msgid "Decrement environment depth" msgstr "" -#: src/LyXAction.C:163 +#: src/LyXAction.C:169 msgid "Increment environment depth" msgstr "" -#: src/LyXAction.C:165 +#: src/LyXAction.C:171 msgid "Change environment depth" msgstr "" -#: src/LyXAction.C:166 +#: src/LyXAction.C:172 msgid "Insert ... dots" msgstr "" -#: src/LyXAction.C:167 +#: src/LyXAction.C:173 msgid "Go down" msgstr "" -#: src/LyXAction.C:169 +#: src/LyXAction.C:175 msgid "Select next line" msgstr "" -#: src/LyXAction.C:171 +#: src/LyXAction.C:177 msgid "Choose Paragraph Environment" msgstr "" -#: src/LyXAction.C:173 +#: src/LyXAction.C:179 msgid "Insert end of sentence period" msgstr "" -#: src/LyXAction.C:174 +#: src/LyXAction.C:180 msgid "Go to next error" msgstr "" -#: src/LyXAction.C:176 +#: src/LyXAction.C:182 msgid "Remove all error boxes" msgstr "" -#: src/LyXAction.C:177 src/lyx_cb.C:2675 +#: src/LyXAction.C:183 src/lyx_cb.C:2442 msgid "Insert Figure" msgstr "" -#: src/LyXAction.C:182 src/lyxfr0.C:97 +#: src/LyXAction.C:188 src/lyxfr0.C:97 msgid "Find & Replace" msgstr "" -#: src/LyXAction.C:183 +#: src/LyXAction.C:190 msgid "Toggle bold" msgstr "" -#: src/LyXAction.C:184 +#: src/LyXAction.C:191 msgid "Toggle code style" msgstr "" -#: src/LyXAction.C:185 +#: src/LyXAction.C:192 msgid "Default font style" msgstr "" -#: src/LyXAction.C:186 +#: src/LyXAction.C:194 msgid "Toggle emphasize" msgstr "" -#: src/LyXAction.C:187 +#: src/LyXAction.C:195 msgid "Toggle user defined style" msgstr "" -#: src/LyXAction.C:188 +#: src/LyXAction.C:197 msgid "Toggle noun style" msgstr "" -#: src/LyXAction.C:189 +#: src/LyXAction.C:198 msgid "Toggle roman font style" msgstr "" -#: src/LyXAction.C:190 +#: src/LyXAction.C:200 msgid "Toggle sans font style" msgstr "" -#: src/LyXAction.C:191 +#: src/LyXAction.C:201 msgid "Set font size" msgstr "" -#: src/LyXAction.C:192 +#: src/LyXAction.C:202 msgid "Show font state" msgstr "" -#: src/LyXAction.C:194 +#: src/LyXAction.C:205 msgid "Toggle font underline" msgstr "" -#: src/LyXAction.C:195 +#: src/LyXAction.C:206 msgid "Insert Footnote" msgstr "" -#: src/LyXAction.C:196 +#: src/LyXAction.C:208 msgid "Select next char" msgstr "" -#: src/LyXAction.C:198 +#: src/LyXAction.C:211 msgid "Insert horizontal fill" msgstr "" -#: src/LyXAction.C:201 +#: src/LyXAction.C:214 msgid "Insert hyphenation point" msgstr "" -#: src/LyXAction.C:203 +#: src/LyXAction.C:216 msgid "Insert index item" msgstr "" -#: src/LyXAction.C:205 +#: src/LyXAction.C:218 msgid "Insert last index item" msgstr "" -#: src/LyXAction.C:206 +#: src/LyXAction.C:219 msgid "Insert index list" msgstr "" -#: src/LyXAction.C:207 +#: src/LyXAction.C:221 msgid "Turn off keymap" msgstr "" -#: src/LyXAction.C:209 +#: src/LyXAction.C:224 msgid "Use primary keymap" msgstr "" -#: src/LyXAction.C:211 +#: src/LyXAction.C:226 msgid "Use secondary keymap" msgstr "" -#: src/LyXAction.C:212 +#: src/LyXAction.C:227 msgid "Toggle keymap" msgstr "" -#: src/LyXAction.C:213 +#: src/LyXAction.C:229 msgid "Insert Label" msgstr "" -#: src/LyXAction.C:214 +#: src/LyXAction.C:231 msgid "View LaTeX log" msgstr "" -#: src/LyXAction.C:218 +#: src/LyXAction.C:236 msgid "Copy paragraph environment type" msgstr "" -#: src/LyXAction.C:224 +#: src/LyXAction.C:242 msgid "Paste paragraph environment type" msgstr "" -#: src/LyXAction.C:230 +#: src/LyXAction.C:249 msgid "Go to beginning of line" msgstr "" -#: src/LyXAction.C:232 +#: src/LyXAction.C:251 msgid "Select to beginning of line" msgstr "" -#: src/LyXAction.C:234 +#: src/LyXAction.C:253 msgid "Go to end of line" msgstr "" -#: src/LyXAction.C:236 +#: src/LyXAction.C:255 msgid "Select to end of line" msgstr "" -#: src/LyXAction.C:238 +#: src/LyXAction.C:257 msgid "Insert list of algorithms" msgstr "" -#: src/LyXAction.C:240 +#: src/LyXAction.C:259 msgid "Insert list of figures" msgstr "" -#: src/LyXAction.C:242 +#: src/LyXAction.C:261 msgid "Insert list of tables" msgstr "" -#: src/LyXAction.C:243 +#: src/LyXAction.C:262 msgid "Exit" msgstr "" -#: src/LyXAction.C:245 +#: src/LyXAction.C:264 msgid "Insert Margin note" msgstr "" -#: src/LyXAction.C:251 +#: src/LyXAction.C:270 msgid "Math Greek" msgstr "" -#: src/LyXAction.C:254 +#: src/LyXAction.C:273 msgid "Insert math symbol" msgstr "" -#: src/LyXAction.C:259 +#: src/LyXAction.C:278 msgid "Math mode" msgstr "" -#: src/LyXAction.C:263 src/lyx_cb.C:2817 +#: src/LyXAction.C:282 src/lyx_cb.C:2539 msgid "Melt" msgstr "" -#: src/LyXAction.C:271 +#: src/LyXAction.C:290 msgid "Go one paragraph down" msgstr "" -#: src/LyXAction.C:273 +#: src/LyXAction.C:292 msgid "Select next paragraph" msgstr "" -#: src/LyXAction.C:275 +#: src/LyXAction.C:294 msgid "Go one paragraph up" msgstr "" -#: src/LyXAction.C:277 +#: src/LyXAction.C:296 msgid "Select previous paragraph" msgstr "" -#: src/LyXAction.C:279 src/lyx_cb.C:2779 +#: src/LyXAction.C:298 src/lyx_cb.C:2516 msgid "Paste" msgstr "" -#: src/LyXAction.C:284 +#: src/LyXAction.C:303 msgid "Insert protected space" msgstr "" -#: src/LyXAction.C:285 +#: src/LyXAction.C:304 msgid "Insert quote" msgstr "" -#: src/LyXAction.C:287 +#: src/LyXAction.C:306 msgid "Reconfigure" msgstr "" -#: src/LyXAction.C:288 src/lyx_cb.C:2349 +#: src/LyXAction.C:307 src/lyx_cb.C:2191 msgid "Redo" msgstr "" -#: src/LyXAction.C:292 +#: src/LyXAction.C:311 msgid "Insert cross reference" msgstr "" -#: src/LyXAction.C:314 src/lyx_cb.C:2687 +#: src/LyXAction.C:333 src/lyx_cb.C:2454 msgid "Insert Table" msgstr "" -#: src/LyXAction.C:315 +#: src/LyXAction.C:334 msgid "Toggle TeX style" msgstr "" -#: src/LyXAction.C:317 +#: src/LyXAction.C:336 msgid "Insert table of contents" msgstr "" -#: src/LyXAction.C:319 +#: src/LyXAction.C:338 msgid "View table of contents" msgstr "" -#: src/LyXAction.C:321 +#: src/LyXAction.C:340 msgid "Toggle cursor does/doesn't follow the scrollbar" msgstr "" -#: src/LyXAction.C:325 src/lyx_cb.C:2320 +#: src/LyXAction.C:344 src/lyx_cb.C:2170 msgid "Undo" msgstr "" -#: src/LyXAction.C:333 +#: src/LyXAction.C:352 msgid "Register document under version control" msgstr "" -#: src/LyXAction.C:555 +#: src/LyXAction.C:576 msgid "No description available!" msgstr "" @@ -2023,447 +2021,459 @@ msgstr "" msgid "Go to Reference|#G" msgstr "" -#: src/lyx_cb.C:361 +#: src/lyx_cb.C:348 msgid "Save failed. Rename and try again?" msgstr "" -#: src/lyx_cb.C:363 +#: src/lyx_cb.C:350 msgid "(If not, document is not saved.)" msgstr "" -#: src/lyx_cb.C:387 src/lyxfunc.C:4656 +#: src/lyx_cb.C:370 src/lyxfunc.C:2466 msgid "Templates" msgstr "" -#: src/lyx_cb.C:392 +#: src/lyx_cb.C:375 msgid "Enter Filename to Save Document as" msgstr "" #. Cancel: Do nothing -#: src/lyx_cb.C:399 src/lyxfunc.C:4662 src/lyxfunc.C:4689 src/lyxfunc.C:4754 -#: src/lyxfunc.C:4803 src/lyxfunc.C:4828 src/lyxfunc.C:4838 src/lyxfunc.C:4883 -#: src/lyxfunc.C:4908 src/lyxfunc.C:4918 src/lyxfunc.C:4977 +#: src/lyx_cb.C:382 src/lyxfunc.C:2472 src/lyxfunc.C:2499 src/lyxfunc.C:2564 +#: src/lyxfunc.C:2613 src/lyxfunc.C:2638 src/lyxfunc.C:2648 src/lyxfunc.C:2693 +#: src/lyxfunc.C:2718 src/lyxfunc.C:2728 src/lyxfunc.C:2787 msgid "Canceled." msgstr "" -#: src/lyx_cb.C:410 +#: src/lyx_cb.C:393 msgid "Same name as document already has:" msgstr "" -#: src/lyx_cb.C:412 +#: src/lyx_cb.C:395 msgid "Save anyway?" msgstr "" -#: src/lyx_cb.C:418 +#: src/lyx_cb.C:401 msgid "Another document with same name open!" msgstr "" -#: src/lyx_cb.C:420 +#: src/lyx_cb.C:403 msgid "Replace with current document?" msgstr "" -#: src/lyx_cb.C:428 +#: src/lyx_cb.C:411 msgid "Document renamed to '" msgstr "" -#: src/lyx_cb.C:430 +#: src/lyx_cb.C:413 msgid "', but not saved..." msgstr "" -#: src/lyx_cb.C:436 +#: src/lyx_cb.C:419 msgid "Document already exists:" msgstr "" -#: src/lyx_cb.C:438 +#: src/lyx_cb.C:421 msgid "Replace file?" msgstr "" -#: src/lyx_cb.C:469 src/lyx_cb.C:499 +#: src/lyx_cb.C:452 src/lyx_cb.C:482 msgid "One error detected" msgstr "" -#: src/lyx_cb.C:470 src/lyx_cb.C:500 +#: src/lyx_cb.C:453 src/lyx_cb.C:483 msgid "You should try to fix it." msgstr "" -#: src/lyx_cb.C:473 src/lyx_cb.C:503 +#: src/lyx_cb.C:456 src/lyx_cb.C:486 msgid " errors detected." msgstr "" -#: src/lyx_cb.C:474 src/lyx_cb.C:504 +#: src/lyx_cb.C:457 src/lyx_cb.C:487 msgid "You should try to fix them." msgstr "" -#: src/lyx_cb.C:476 +#: src/lyx_cb.C:459 msgid "There were errors during the LaTeX run." msgstr "" -#: src/lyx_cb.C:489 +#: src/lyx_cb.C:472 msgid "Wrong type of document" msgstr "" -#: src/lyx_cb.C:490 +#: src/lyx_cb.C:473 msgid "The Build operation is not allowed in this document" msgstr "" -#: src/lyx_cb.C:491 src/lyx_cb.C:506 +#: src/lyx_cb.C:474 src/lyx_cb.C:489 msgid "There were errors during the Build process." msgstr "" -#: src/lyx_cb.C:517 +#: src/lyx_cb.C:500 msgid "Chktex does not work with SGML derived documents." msgstr "" -#: src/lyx_cb.C:526 +#: src/lyx_cb.C:509 msgid "No warnings found." msgstr "" -#: src/lyx_cb.C:528 +#: src/lyx_cb.C:511 msgid "One warning found." msgstr "" -#: src/lyx_cb.C:529 +#: src/lyx_cb.C:512 msgid "Use 'Edit->Go to Error' to find it." msgstr "" -#: src/lyx_cb.C:532 +#: src/lyx_cb.C:515 msgid " warnings found." msgstr "" -#: src/lyx_cb.C:533 +#: src/lyx_cb.C:516 msgid "Use 'Edit->Go to Error' to find them." msgstr "" -#: src/lyx_cb.C:535 +#: src/lyx_cb.C:518 msgid "Chktex run successfully" msgstr "" -#: src/lyx_cb.C:537 +#: src/lyx_cb.C:520 msgid "It seems chktex does not work." msgstr "" -#: src/lyx_cb.C:628 src/lyx_cb.C:631 +#: src/lyx_cb.C:606 src/lyx_cb.C:609 msgid "Executing command:" msgstr "" -#: src/lyx_cb.C:874 src/lyx_cb.C:914 src/lyx_cb.C:951 src/lyx_cb.C:982 -#: src/lyxfunc.C:4698 +#: src/lyx_cb.C:828 src/lyx_cb.C:864 src/lyx_cb.C:897 src/lyx_cb.C:924 +#: src/lyxfunc.C:2508 msgid "File already exists:" msgstr "" -#: src/lyx_cb.C:876 src/lyx_cb.C:916 src/lyx_cb.C:953 src/lyx_cb.C:984 +#: src/lyx_cb.C:830 src/lyx_cb.C:866 src/lyx_cb.C:899 src/lyx_cb.C:926 msgid "Do you want to overwrite the file?" msgstr "" -#: src/lyx_cb.C:877 src/lyx_cb.C:917 src/lyx_cb.C:954 src/lyx_cb.C:985 +#: src/lyx_cb.C:831 src/lyx_cb.C:867 src/lyx_cb.C:900 src/lyx_cb.C:927 msgid "Canceled" msgstr "" -#: src/lyx_cb.C:882 +#: src/lyx_cb.C:836 msgid "DocBook does not have a latex backend" msgstr "" -#: src/lyx_cb.C:888 +#: src/lyx_cb.C:842 msgid "Nice LaTeX file saved as" msgstr "" -#: src/lyx_cb.C:904 +#: src/lyx_cb.C:854 msgid "Document class must be linuxdoc." msgstr "" -#: src/lyx_cb.C:921 +#: src/lyx_cb.C:871 msgid "Building LinuxDoc SGML file `" msgstr "" -#: src/lyx_cb.C:926 +#: src/lyx_cb.C:876 msgid "LinuxDoc SGML file save as" msgstr "" -#: src/lyx_cb.C:941 +#: src/lyx_cb.C:887 msgid "Document class must be docbook." msgstr "" -#: src/lyx_cb.C:958 +#: src/lyx_cb.C:904 msgid "Building DocBook SGML file `" msgstr "" -#: src/lyx_cb.C:963 +#: src/lyx_cb.C:909 msgid "DocBook SGML file save as" msgstr "" -#: src/lyx_cb.C:991 +#: src/lyx_cb.C:933 msgid "Ascii file saved as" msgstr "" -#: src/lyx_cb.C:1060 +#: src/lyx_cb.C:976 +msgid "Document exported as HTML to file `" +msgstr "" + +#: src/lyx_cb.C:979 +msgid "Unable to convert to HTML the file `" +msgstr "" + +#: src/lyx_cb.C:1035 +msgid "Unknown export type: " +msgstr "" + +#: src/lyx_cb.C:1080 msgid "Autosaving current document..." msgstr "" -#: src/lyx_cb.C:1100 +#: src/lyx_cb.C:1120 msgid "Autosave Failed!" msgstr "" -#: src/lyx_cb.C:1156 +#: src/lyx_cb.C:1176 msgid "File to Insert" msgstr "" -#: src/lyx_cb.C:1166 +#: src/lyx_cb.C:1186 msgid "Error! Specified file is unreadable: " msgstr "" -#: src/lyx_cb.C:1173 +#: src/lyx_cb.C:1193 msgid "Error! Cannot open specified file: " msgstr "" -#: src/lyx_cb.C:1220 +#: src/lyx_cb.C:1231 msgid "Table Of Contents" msgstr "" -#: src/lyx_cb.C:1236 src/mathed/formula.C:1050 +#: src/lyx_cb.C:1247 src/mathed/formula.C:1050 msgid "Enter new label to insert:" msgstr "" -#: src/lyx_cb.C:1256 +#: src/lyx_cb.C:1267 msgid "Insert Reference" msgstr "" -#: src/lyx_cb.C:1291 +#: src/lyx_cb.C:1302 msgid "Inserting Footnote..." msgstr "" #. Import file -#: src/lyx_cb.C:1361 +#: src/lyx_cb.C:1366 msgid "Importing LinuxDoc SGML file `" msgstr "" #. TeX output asked -#: src/lyx_cb.C:1369 +#: src/lyx_cb.C:1374 msgid "Converting LinuxDoc SGML to TeX file..." msgstr "" #. dvi output asked -#: src/lyx_cb.C:1376 +#: src/lyx_cb.C:1381 msgid "Converting LinuxDoc SGML to dvi file..." msgstr "" -#: src/lyx_cb.C:1429 +#: src/lyx_cb.C:1434 msgid "Converting DocBook SGML to dvi file..." msgstr "" -#: src/lyx_cb.C:1567 +#: src/lyx_cb.C:1553 msgid "Character Style" msgstr "" -#: src/lyx_cb.C:1897 +#: src/lyx_cb.C:1759 msgid "Paragraph Environment" msgstr "" -#: src/lyx_cb.C:2152 +#: src/lyx_cb.C:2014 msgid "Document Layout" msgstr "" -#: src/lyx_cb.C:2191 +#: src/lyx_cb.C:2053 msgid "Quotes" msgstr "" -#: src/lyx_cb.C:2238 +#: src/lyx_cb.C:2100 msgid "LaTeX Preamble" msgstr "" -#: src/lyx_cb.C:2255 +#: src/lyx_cb.C:2117 msgid "Do you want to save the current settings" msgstr "" -#: src/lyx_cb.C:2256 +#: src/lyx_cb.C:2118 msgid "for Character, Document, Paper and Quotes" msgstr "" -#: src/lyx_cb.C:2257 +#: src/lyx_cb.C:2119 msgid "as default for new documents?" msgstr "" -#: src/lyx_cb.C:2275 src/lyx_cb.C:2295 +#: src/lyx_cb.C:2137 src/lyx_cb.C:2151 msgid "Open/Close..." msgstr "" -#: src/lyx_cb.C:2326 src/lyx_cb.C:2332 +#: src/lyx_cb.C:2175 msgid "No further undo information" msgstr "" -#: src/lyx_cb.C:2344 +#: src/lyx_cb.C:2186 msgid "Redo not yet supported in math mode" msgstr "" -#: src/lyx_cb.C:2355 src/lyx_cb.C:2361 +#: src/lyx_cb.C:2196 msgid "No further redo information" msgstr "" -#: src/lyx_cb.C:2593 src/lyx_cb.C:2613 +#: src/lyx_cb.C:2392 msgid "Font: " msgstr "" -#: src/lyx_cb.C:2597 src/lyx_cb.C:2617 +#: src/lyx_cb.C:2396 msgid ", Depth: " msgstr "" -#: src/lyx_cb.C:2653 +#: src/lyx_cb.C:2426 msgid "Inserting margin note..." msgstr "" -#: src/lyx_cb.C:2702 src/lyx_cb.C:2709 +#: src/lyx_cb.C:2468 msgid "Paragraph environment type copied" msgstr "" -#: src/lyx_cb.C:2721 src/lyx_cb.C:2725 +#: src/lyx_cb.C:2478 msgid "Paragraph environment type set" msgstr "" -#: src/lyx_cb.C:2867 +#: src/lyx_cb.C:2574 msgid "Changed environment depth (in possible range, maybe not)" msgstr "" -#: src/lyx_cb.C:3117 +#: src/lyx_cb.C:2811 msgid "Paragraph layout set" msgstr "" -#: src/lyx_cb.C:3187 +#: src/lyx_cb.C:2881 msgid "Should I set some parameters to" msgstr "" -#: src/lyx_cb.C:3189 +#: src/lyx_cb.C:2883 msgid "the defaults of this document class?" msgstr "" #. unable to load new style -#: src/lyx_cb.C:3198 src/lyx_cb.C:3326 src/lyx_cb.C:3333 +#: src/lyx_cb.C:2892 src/lyx_cb.C:3010 src/lyx_cb.C:3017 msgid "Conversion Errors!" msgstr "" -#: src/lyx_cb.C:3199 src/lyx_cb.C:3334 +#: src/lyx_cb.C:2893 src/lyx_cb.C:3018 msgid "Unable to switch to new document class." msgstr "" -#: src/lyx_cb.C:3200 src/lyx_cb.C:3335 +#: src/lyx_cb.C:2894 src/lyx_cb.C:3019 msgid "Reverting to original document class." msgstr "" -#: src/lyx_cb.C:3300 +#: src/lyx_cb.C:2994 msgid "Converting document to new document class..." msgstr "" -#: src/lyx_cb.C:3321 +#: src/lyx_cb.C:3005 msgid "One paragraph couldn't be converted" msgstr "" -#: src/lyx_cb.C:3324 +#: src/lyx_cb.C:3008 msgid " paragraphs couldn't be converted" msgstr "" -#: src/lyx_cb.C:3327 +#: src/lyx_cb.C:3011 msgid "into chosen document class" msgstr "" -#: src/lyx_cb.C:3413 +#: src/lyx_cb.C:3097 msgid "Document layout set" msgstr "" -#: src/lyx_cb.C:3465 src/lyx_cb.C:3469 src/lyx_cb.C:3499 src/lyx_cb.C:3503 +#: src/lyx_cb.C:3148 src/lyx_cb.C:3152 msgid "No more notes" msgstr "" -#: src/lyx_cb.C:3542 +#: src/lyx_cb.C:3184 msgid "Quotes type set" msgstr "" -#: src/lyx_cb.C:3606 +#: src/lyx_cb.C:3248 msgid "LaTeX preamble set" msgstr "" -#: src/lyx_cb.C:3628 src/lyx_cb.C:3706 +#: src/lyx_cb.C:3269 msgid "Cannot insert table in table." msgstr "" -#: src/lyx_cb.C:3633 src/lyx_cb.C:3711 +#: src/lyx_cb.C:3274 msgid "Inserting table..." msgstr "" -#: src/lyx_cb.C:3695 src/lyx_cb.C:3773 +#: src/lyx_cb.C:3336 msgid "Table inserted" msgstr "" -#: src/lyx_cb.C:3829 src/lyx_cb.C:3847 +#: src/lyx_cb.C:3392 src/lyx_cb.C:3410 msgid "ERROR! Unable to print!" msgstr "" -#: src/lyx_cb.C:3830 +#: src/lyx_cb.C:3393 msgid "Check 'range of pages'!" msgstr "" -#: src/lyx_cb.C:3848 +#: src/lyx_cb.C:3411 msgid "Check 'number of copies'!" msgstr "" -#: src/lyx_cb.C:3957 +#: src/lyx_cb.C:3520 msgid "Error:" msgstr "" -#: src/lyx_cb.C:3958 +#: src/lyx_cb.C:3521 msgid "Unable to print" msgstr "" -#: src/lyx_cb.C:3959 +#: src/lyx_cb.C:3522 msgid "Check that your parameters are correct" msgstr "" -#: src/lyx_cb.C:3981 src/lyx_cb.C:4050 +#: src/lyx_cb.C:3543 msgid "Inserting figure..." msgstr "" -#: src/lyx_cb.C:3986 src/lyx_cb.C:4037 src/lyx_cb.C:4055 src/lyx_cb.C:4106 +#: src/lyx_cb.C:3548 src/lyx_cb.C:3599 msgid "Figure inserted" msgstr "" -#: src/lyx_cb.C:4136 +#: src/lyx_cb.C:3629 msgid "Screen options set" msgstr "" -#: src/lyx_cb.C:4166 +#: src/lyx_cb.C:3659 msgid "LaTeX Options" msgstr "" -#: src/lyx_cb.C:4175 +#: src/lyx_cb.C:3668 msgid "Running configure..." msgstr "" -#: src/lyx_cb.C:4182 +#: src/lyx_cb.C:3675 msgid "Reloading configuration..." msgstr "" -#: src/lyx_cb.C:4184 +#: src/lyx_cb.C:3677 msgid "The system has been reconfigured." msgstr "" -#: src/lyx_cb.C:4185 +#: src/lyx_cb.C:3678 msgid "You need to restart LyX to make use of any" msgstr "" -#: src/lyx_cb.C:4186 +#: src/lyx_cb.C:3679 msgid "updated document class specifications." msgstr "" -#: src/lyx_cb.C:4358 +#: src/lyx_cb.C:3805 msgid "Couldn't find this label" msgstr "" -#: src/lyx_cb.C:4359 +#: src/lyx_cb.C:3806 msgid "in current document." msgstr "" -#: src/lyx_cb.C:4391 +#: src/lyx_cb.C:3838 msgid "*** No Document ***" msgstr "" -#: src/lyx_cb.C:4556 +#: src/lyx_cb.C:4003 msgid "*** No labels found in document ***" msgstr "" @@ -2698,254 +2708,242 @@ msgstr "" msgid "Default" msgstr "" -#: src/lyxfr1.C:157 src/lyxfr1.C:213 +#: src/lyxfr1.C:150 src/lyxfr1.C:187 msgid "Sorry!" msgstr "" -#: src/lyxfr1.C:157 src/lyxfr1.C:213 +#: src/lyxfr1.C:150 src/lyxfr1.C:187 msgid "You cannot replace a single space, nor an empty character." msgstr "" -#: src/lyxfr1.C:263 src/lyxfr1.C:328 +#: src/lyxfr1.C:217 src/lyxfr1.C:264 msgid "String not found!" msgstr "" -#: src/lyxfr1.C:266 +#: src/lyxfr1.C:220 msgid "1 string has been replaced." msgstr "" -#: src/lyxfr1.C:269 +#: src/lyxfr1.C:223 msgid " strings have been replaced." msgstr "" -#: src/lyxfr1.C:324 +#: src/lyxfr1.C:260 msgid "Found." msgstr "" -#: src/lyxfunc.C:295 +#: src/lyxfunc.C:276 msgid "Unknown sequence:" msgstr "" -#: src/lyxfunc.C:338 src/lyxfunc.C:2521 src/lyxfunc.C:4605 +#: src/lyxfunc.C:319 src/lyxfunc.C:2415 msgid "Unknown action" msgstr "" #. no -#: src/lyxfunc.C:352 +#: src/lyxfunc.C:333 msgid "Document is read-only" msgstr "" #. no -#: src/lyxfunc.C:357 +#: src/lyxfunc.C:338 msgid "Command not allowed without any document open" msgstr "" -#: src/lyxfunc.C:586 src/lyxfunc.C:2669 +#: src/lyxfunc.C:559 msgid "Text mode" msgstr "" -#: src/lyxfunc.C:837 src/lyxfunc.C:2920 -msgid "Document exported as HTML to file `" -msgstr "" - -#: src/lyxfunc.C:840 src/lyxfunc.C:2923 -msgid "Unable to convert to HTML the file `" -msgstr "" - -#: src/lyxfunc.C:846 src/lyxfunc.C:2929 -msgid "Unknown export type: " -msgstr "" - -#: src/lyxfunc.C:870 src/lyxfunc.C:2953 +#: src/lyxfunc.C:765 msgid "Unknown import type: " msgstr "" -#: src/lyxfunc.C:1199 src/lyxfunc.C:3282 +#: src/lyxfunc.C:1093 msgid "Layout " msgstr "" -#: src/lyxfunc.C:1200 src/lyxfunc.C:3283 +#: src/lyxfunc.C:1094 msgid " not known" msgstr "" -#: src/lyxfunc.C:1342 src/lyxfunc.C:3425 +#: src/lyxfunc.C:1236 msgid "No cross-reference to toggle" msgstr "" -#: src/lyxfunc.C:1693 src/lyxfunc.C:3777 +#: src/lyxfunc.C:1587 msgid "Mark removed" msgstr "" -#: src/lyxfunc.C:1698 src/lyxfunc.C:3782 +#: src/lyxfunc.C:1592 msgid "Mark set" msgstr "" -#: src/lyxfunc.C:1801 src/lyxfunc.C:3885 +#: src/lyxfunc.C:1695 msgid "Mark off" msgstr "" -#: src/lyxfunc.C:1811 src/lyxfunc.C:3895 +#: src/lyxfunc.C:1705 msgid "Mark on" msgstr "" -#: src/lyxfunc.C:2112 src/lyxfunc.C:4196 +#: src/lyxfunc.C:2006 msgid "Push-toolbar needs argument > 0" msgstr "" -#: src/lyxfunc.C:2130 src/lyxfunc.C:4214 +#: src/lyxfunc.C:2024 msgid "Usage: toolbar-add-to " msgstr "" -#: src/lyxfunc.C:2154 src/lyxfunc.C:4238 src/mathed/formula.C:874 +#: src/lyxfunc.C:2048 src/mathed/formula.C:874 msgid "Math greek mode on" msgstr "" -#: src/lyxfunc.C:2165 src/lyxfunc.C:4249 src/mathed/formula.C:885 +#: src/lyxfunc.C:2059 src/mathed/formula.C:885 msgid "Math greek keyboard on" msgstr "" -#: src/lyxfunc.C:2167 src/lyxfunc.C:4251 src/mathed/formula.C:887 +#: src/lyxfunc.C:2061 src/mathed/formula.C:887 msgid "Math greek keyboard off" msgstr "" -#: src/lyxfunc.C:2202 src/lyxfunc.C:4286 +#: src/lyxfunc.C:2096 msgid "Missing argument" msgstr "" #. / what appears in the minibuffer when opening -#: src/lyxfunc.C:2218 src/lyxfunc.C:4302 src/mathed/formula.h:73 +#: src/lyxfunc.C:2112 src/mathed/formula.h:73 msgid "Math editor mode" msgstr "" -#: src/lyxfunc.C:2225 src/lyxfunc.C:4309 +#: src/lyxfunc.C:2119 msgid "This is only allowed in math mode!" msgstr "" -#: src/lyxfunc.C:2379 src/lyxfunc.C:4463 +#: src/lyxfunc.C:2273 msgid "Opening child document " msgstr "" -#: src/lyxfunc.C:2411 src/lyxfunc.C:4495 +#: src/lyxfunc.C:2305 msgid "Unknown kind of footnote" msgstr "" -#: src/lyxfunc.C:2480 src/lyxfunc.C:4564 +#: src/lyxfunc.C:2374 msgid "Document is read only" msgstr "" -#: src/lyxfunc.C:4657 +#: src/lyxfunc.C:2467 msgid "Enter Filename for new document" msgstr "" -#: src/lyxfunc.C:4658 +#: src/lyxfunc.C:2468 msgid "newfile" msgstr "" -#: src/lyxfunc.C:4677 src/lyxfunc.C:4816 src/lyxfunc.C:4895 +#: src/lyxfunc.C:2487 src/lyxfunc.C:2626 src/lyxfunc.C:2705 msgid "" "Do you want to close that document now?\n" "('No' will just switch to the open version)" msgstr "" -#: src/lyxfunc.C:4700 +#: src/lyxfunc.C:2510 msgid "Do you want to open the document?" msgstr "" #. loads document -#: src/lyxfunc.C:4702 src/lyxfunc.C:4765 +#: src/lyxfunc.C:2512 src/lyxfunc.C:2575 msgid "Opening document" msgstr "" -#: src/lyxfunc.C:4709 src/lyxfunc.C:4772 +#: src/lyxfunc.C:2519 src/lyxfunc.C:2582 msgid "opened." msgstr "" -#: src/lyxfunc.C:4718 +#: src/lyxfunc.C:2528 msgid "Choose template" msgstr "" -#: src/lyxfunc.C:4746 src/lyxfunc.C:4795 src/lyxfunc.C:4868 src/lyxfunc.C:4969 +#: src/lyxfunc.C:2556 src/lyxfunc.C:2605 src/lyxfunc.C:2678 src/lyxfunc.C:2779 msgid "Examples" msgstr "" -#: src/lyxfunc.C:4748 +#: src/lyxfunc.C:2558 msgid "Select Document to Open" msgstr "" -#: src/lyxfunc.C:4774 +#: src/lyxfunc.C:2584 msgid "Could not open document" msgstr "" -#: src/lyxfunc.C:4797 +#: src/lyxfunc.C:2607 msgid "Select ASCII file to Import" msgstr "" -#: src/lyxfunc.C:4835 src/lyxfunc.C:4915 +#: src/lyxfunc.C:2645 src/lyxfunc.C:2725 msgid "A document by the name" msgstr "" -#: src/lyxfunc.C:4837 src/lyxfunc.C:4917 +#: src/lyxfunc.C:2647 src/lyxfunc.C:2727 msgid "already exists. Overwrite?" msgstr "" -#: src/lyxfunc.C:4843 +#: src/lyxfunc.C:2653 msgid "Importing ASCII file" msgstr "" -#: src/lyxfunc.C:4847 +#: src/lyxfunc.C:2657 msgid "ASCII file " msgstr "" -#: src/lyxfunc.C:4849 src/lyxfunc.C:4940 +#: src/lyxfunc.C:2659 src/lyxfunc.C:2750 msgid "imported." msgstr "" -#: src/lyxfunc.C:4872 +#: src/lyxfunc.C:2682 msgid "Select Noweb file to Import" msgstr "" -#: src/lyxfunc.C:4875 +#: src/lyxfunc.C:2685 msgid "Select LaTeX file to Import" msgstr "" -#: src/lyxfunc.C:4925 +#: src/lyxfunc.C:2735 msgid "Importing LaTeX file" msgstr "" -#: src/lyxfunc.C:4930 +#: src/lyxfunc.C:2740 msgid "Importing Noweb file" msgstr "" -#: src/lyxfunc.C:4938 +#: src/lyxfunc.C:2748 msgid "Noweb file " msgstr "" -#: src/lyxfunc.C:4938 +#: src/lyxfunc.C:2748 msgid "LateX file " msgstr "" -#: src/lyxfunc.C:4943 +#: src/lyxfunc.C:2753 msgid "Could not import Noweb file" msgstr "" -#: src/lyxfunc.C:4944 +#: src/lyxfunc.C:2754 msgid "Could not import LaTeX file" msgstr "" -#: src/lyxfunc.C:4971 +#: src/lyxfunc.C:2781 msgid "Select Document to Insert" msgstr "" #. Inserts document -#: src/lyxfunc.C:4989 +#: src/lyxfunc.C:2799 msgid "Inserting document" msgstr "" -#: src/lyxfunc.C:4995 +#: src/lyxfunc.C:2805 msgid "inserted." msgstr "" -#: src/lyxfunc.C:4997 +#: src/lyxfunc.C:2807 msgid "Could not insert document" msgstr "" @@ -3309,11 +3307,11 @@ msgstr "" msgid "VC History" msgstr "" -#: src/LyXView.C:379 src/minibuffer.C:218 +#: src/LyXView.C:380 src/minibuffer.C:218 msgid " (Changed)" msgstr "" -#: src/LyXView.C:381 +#: src/LyXView.C:382 msgid " (read only)" msgstr "" @@ -3668,272 +3666,272 @@ msgstr "" msgid "New...|New from template...|Open...%l|Import%m%l|Exit%l" msgstr "" -#: src/menus.C:818 src/menus.C:1139 +#: src/menus.C:818 msgid "" "Floats & Insets%t|Open/Close%x21|Melt%x22|Open All Footnotes/Margin " "Notes%x23|Close All Footnotes/Margin Notes%x24|Open All " "Figures/Tables%x25|Close All Figures/Tables%x26%l|Remove all Error Boxes%x27" msgstr "" -#: src/menus.C:827 src/menus.C:1148 +#: src/menus.C:827 msgid "EMF|Oo#o#O" msgstr "" -#: src/menus.C:828 src/menus.C:1149 +#: src/menus.C:828 msgid "EMF|Mm#m#M" msgstr "" -#: src/menus.C:829 src/menus.C:1150 +#: src/menus.C:829 msgid "EMF|Aa#a#A" msgstr "" -#: src/menus.C:830 src/menus.C:1151 +#: src/menus.C:830 msgid "EMF|Cc#c#C" msgstr "" -#: src/menus.C:831 src/menus.C:1152 +#: src/menus.C:831 msgid "EMF|Ff#f#F" msgstr "" -#: src/menus.C:832 src/menus.C:1153 +#: src/menus.C:832 msgid "EMF|Tt#t#T" msgstr "" -#: src/menus.C:833 src/menus.C:1154 +#: src/menus.C:833 msgid "EMF|Rr#r#R" msgstr "" -#: src/menus.C:841 src/menus.C:939 src/menus.C:1162 src/menus.C:1260 +#: src/menus.C:841 src/menus.C:939 msgid "Table%t" msgstr "" -#: src/menus.C:849 src/menus.C:1170 +#: src/menus.C:849 msgid "|Multicolumn%B%x44%l" msgstr "" -#: src/menus.C:851 src/menus.C:1172 +#: src/menus.C:851 msgid "|Multicolumn%b%x44%l" msgstr "" -#: src/menus.C:852 src/menus.C:1173 +#: src/menus.C:852 msgid "EMT|Mm#m#M" msgstr "" -#: src/menus.C:860 src/menus.C:1181 +#: src/menus.C:860 msgid "|Line Top%B%x36" msgstr "" -#: src/menus.C:862 src/menus.C:1183 +#: src/menus.C:862 msgid "|Line Top%b%x36" msgstr "" -#: src/menus.C:863 src/menus.C:1184 +#: src/menus.C:863 msgid "EMT|Tt#t#T" msgstr "" -#: src/menus.C:871 src/menus.C:1192 +#: src/menus.C:871 msgid "|Line Bottom%B%x37" msgstr "" -#: src/menus.C:873 src/menus.C:1194 +#: src/menus.C:873 msgid "|Line Bottom%b%x37" msgstr "" -#: src/menus.C:874 src/menus.C:1195 +#: src/menus.C:874 msgid "EMT|Bb#b#B" msgstr "" -#: src/menus.C:882 src/menus.C:1203 +#: src/menus.C:882 msgid "|Line Left%B%x38" msgstr "" -#: src/menus.C:884 src/menus.C:1205 +#: src/menus.C:884 msgid "|Line Left%b%x38" msgstr "" -#: src/menus.C:885 src/menus.C:1206 +#: src/menus.C:885 msgid "EMT|Ll#l#L" msgstr "" -#: src/menus.C:893 src/menus.C:1214 +#: src/menus.C:893 msgid "|Line Right%B%x39%l" msgstr "" -#: src/menus.C:895 src/menus.C:1216 +#: src/menus.C:895 msgid "|Line Right%b%x39%l" msgstr "" -#: src/menus.C:896 src/menus.C:1217 +#: src/menus.C:896 msgid "EMT|Rr#r#R" msgstr "" -#: src/menus.C:905 src/menus.C:1226 +#: src/menus.C:905 msgid "|Align Left%R%x40" msgstr "" -#: src/menus.C:907 src/menus.C:1228 +#: src/menus.C:907 msgid "|Align Left%r%x40" msgstr "" -#: src/menus.C:908 src/menus.C:1229 +#: src/menus.C:908 msgid "EMT|eE#e#E" msgstr "" -#: src/menus.C:911 src/menus.C:1232 +#: src/menus.C:911 msgid "|Align Right%R%x41" msgstr "" -#: src/menus.C:913 src/menus.C:1234 +#: src/menus.C:913 msgid "|Align Right%r%x41" msgstr "" -#: src/menus.C:914 src/menus.C:1235 +#: src/menus.C:914 msgid "EMT|iI#i#I" msgstr "" -#: src/menus.C:917 src/menus.C:1238 +#: src/menus.C:917 msgid "|Align Center%R%x42%l" msgstr "" -#: src/menus.C:919 src/menus.C:1240 +#: src/menus.C:919 msgid "|Align Center%r%x42%l" msgstr "" -#: src/menus.C:920 src/menus.C:1241 +#: src/menus.C:920 msgid "EMT|Cc#c#C" msgstr "" -#: src/menus.C:923 src/menus.C:1244 +#: src/menus.C:923 #, no-c-format msgid "|Append Row%x32" msgstr "" -#: src/menus.C:924 src/menus.C:1245 +#: src/menus.C:924 msgid "EMT|oO#o#O" msgstr "" -#: src/menus.C:926 src/menus.C:1247 +#: src/menus.C:926 #, no-c-format msgid "|Append Column%x33%l" msgstr "" -#: src/menus.C:927 src/menus.C:1248 +#: src/menus.C:927 msgid "EMT|uU#u#U" msgstr "" -#: src/menus.C:929 src/menus.C:1250 +#: src/menus.C:929 #, no-c-format msgid "|Delete Row%x34" msgstr "" -#: src/menus.C:930 src/menus.C:1251 +#: src/menus.C:930 msgid "EMT|wW#w#W" msgstr "" -#: src/menus.C:932 src/menus.C:1253 +#: src/menus.C:932 #, no-c-format msgid "|Delete Column%x35%l" msgstr "" -#: src/menus.C:933 src/menus.C:1254 +#: src/menus.C:933 msgid "EMT|nN#n#N" msgstr "" -#: src/menus.C:935 src/menus.C:1256 +#: src/menus.C:935 #, no-c-format msgid "|Delete Table%x43" msgstr "" -#: src/menus.C:936 src/menus.C:1257 +#: src/menus.C:936 msgid "EMT|Dd#d#D" msgstr "" -#: src/menus.C:941 src/menus.C:1262 +#: src/menus.C:941 #, no-c-format msgid "|Insert table%x31" msgstr "" -#: src/menus.C:942 src/menus.C:1263 +#: src/menus.C:942 msgid "EMT|Ii#i#I" msgstr "" -#: src/menus.C:946 src/menus.C:1267 +#: src/menus.C:946 msgid "Version Control%t" msgstr "" -#: src/menus.C:949 src/menus.C:1270 +#: src/menus.C:949 #, no-c-format msgid "|Register%d%x51" msgstr "" #. signifies that the file is not checked out -#: src/menus.C:953 src/menus.C:1274 +#: src/menus.C:953 #, no-c-format msgid "|Check In Changes%d%x52" msgstr "" -#: src/menus.C:955 src/menus.C:1276 +#: src/menus.C:955 #, no-c-format msgid "|Check Out for Edit%x53" msgstr "" #. signifies that the file is checked out -#: src/menus.C:959 src/menus.C:1280 +#: src/menus.C:959 #, no-c-format msgid "|Check In Changes%x52" msgstr "" -#: src/menus.C:961 src/menus.C:1282 +#: src/menus.C:961 #, no-c-format msgid "|Check Out for Edit%d%x53" msgstr "" -#: src/menus.C:964 src/menus.C:1285 +#: src/menus.C:964 #, no-c-format msgid "|Revert to last version%x54" msgstr "" -#: src/menus.C:966 src/menus.C:1287 +#: src/menus.C:966 #, no-c-format msgid "|Undo last check in%x55" msgstr "" -#: src/menus.C:968 src/menus.C:1289 +#: src/menus.C:968 #, no-c-format msgid "|Show History%x56" msgstr "" -#: src/menus.C:971 src/menus.C:1292 +#: src/menus.C:971 #, no-c-format msgid "|Register%x51" msgstr "" #. the shortcuts are not good. -#: src/menus.C:974 src/menus.C:1295 +#: src/menus.C:974 msgid "EMV|Rr#r#R" msgstr "" -#: src/menus.C:975 src/menus.C:1296 +#: src/menus.C:975 msgid "EMV|Ii#i#I" msgstr "" -#: src/menus.C:976 src/menus.C:1297 +#: src/menus.C:976 msgid "EMV|Oo#o#O" msgstr "" -#: src/menus.C:977 src/menus.C:1298 +#: src/menus.C:977 msgid "EMV|lL#l#l" msgstr "" -#: src/menus.C:978 src/menus.C:1299 +#: src/menus.C:978 msgid "EMV|Uu#u#U" msgstr "" -#: src/menus.C:979 src/menus.C:1300 +#: src/menus.C:979 msgid "EMV|Hh#h#H" msgstr "" -#: src/menus.C:982 src/menus.C:1303 +#: src/menus.C:982 msgid "" "Undo|Redo %l|Cut|Copy|Paste%l|Find & Replace...|Go to Error|Go to " "Note|Floats & Insets%m|Table%m|Spellchecker....|Check TeX|Table of " @@ -3941,241 +3939,241 @@ msgid "" "Selection as Lines|Paste Primary Selection as Paragraphs" msgstr "" -#: src/menus.C:1001 src/menus.C:1322 +#: src/menus.C:1001 msgid "EM|Uu#u#U" msgstr "" -#: src/menus.C:1002 src/menus.C:1323 +#: src/menus.C:1002 msgid "EM|Rr#r#R" msgstr "" -#: src/menus.C:1003 src/menus.C:1324 +#: src/menus.C:1003 msgid "EM|Cc#c#C" msgstr "" -#: src/menus.C:1004 src/menus.C:1325 +#: src/menus.C:1004 msgid "EM|oO#o#O" msgstr "" -#: src/menus.C:1005 src/menus.C:1326 +#: src/menus.C:1005 msgid "EM|Pp#p#P" msgstr "" -#: src/menus.C:1006 src/menus.C:1327 +#: src/menus.C:1006 msgid "EM|Ff#f#F" msgstr "" -#: src/menus.C:1007 src/menus.C:1328 +#: src/menus.C:1007 msgid "EM|Ee#e#E" msgstr "" -#: src/menus.C:1008 src/menus.C:1329 +#: src/menus.C:1008 msgid "EM|Nn#n#N" msgstr "" -#: src/menus.C:1009 src/menus.C:1330 +#: src/menus.C:1009 msgid "EM|Ii#i#I" msgstr "" -#: src/menus.C:1010 src/menus.C:1331 +#: src/menus.C:1010 msgid "EM|Tt#t#T" msgstr "" -#: src/menus.C:1011 src/menus.C:1332 +#: src/menus.C:1011 msgid "EM|Ss#s#S" msgstr "" -#: src/menus.C:1012 src/menus.C:1333 +#: src/menus.C:1012 msgid "EM|hH#h#H" msgstr "" -#: src/menus.C:1013 src/menus.C:1334 +#: src/menus.C:1013 msgid "EM|aA#a#A" msgstr "" -#: src/menus.C:1014 src/menus.C:1335 +#: src/menus.C:1014 msgid "EM|Vv#v#V" msgstr "" -#: src/menus.C:1015 src/menus.C:1336 +#: src/menus.C:1015 msgid "EM|wW#w#W" msgstr "" -#: src/menus.C:1016 src/menus.C:1337 +#: src/menus.C:1016 msgid "EM|Ll#l#L" msgstr "" -#: src/menus.C:1017 src/menus.C:1338 +#: src/menus.C:1017 msgid "EM|gG#g#G" msgstr "" -#: src/menus.C:1464 +#: src/menus.C:1142 msgid "" "Character...|Paragraph...|Document...|Paper...|Table...|Quotes...%l|Emphasize" " Style%b|Noun Style%b|Bold Style%b|TeX Style%b|Change Environment " "Depth|LaTeX Preamble...%l|Save layout as default" msgstr "" -#: src/menus.C:1477 +#: src/menus.C:1155 msgid "LM|Cc#c#C" msgstr "" -#: src/menus.C:1478 +#: src/menus.C:1156 msgid "LM|Pp#p#P" msgstr "" -#: src/menus.C:1479 +#: src/menus.C:1157 msgid "LM|Dd#d#D" msgstr "" -#: src/menus.C:1480 +#: src/menus.C:1158 msgid "LM|aA#a#A" msgstr "" -#: src/menus.C:1481 +#: src/menus.C:1159 msgid "LM|eE#e#E" msgstr "" -#: src/menus.C:1482 +#: src/menus.C:1160 msgid "LM|Qq#q#Q" msgstr "" -#: src/menus.C:1483 +#: src/menus.C:1161 msgid "LM|mM#m#M" msgstr "" -#: src/menus.C:1484 +#: src/menus.C:1162 msgid "LM|Nn#n#N" msgstr "" -#: src/menus.C:1485 +#: src/menus.C:1163 msgid "LM|Bb#b#B" msgstr "" -#: src/menus.C:1486 +#: src/menus.C:1164 msgid "LM|Tt#t#T" msgstr "" -#: src/menus.C:1487 +#: src/menus.C:1165 msgid "LM|vV#v#V" msgstr "" -#: src/menus.C:1488 +#: src/menus.C:1166 msgid "LM|Ll#l#L" msgstr "" -#: src/menus.C:1489 +#: src/menus.C:1167 msgid "LM|Ss#s#S" msgstr "" -#: src/menus.C:1563 +#: src/menus.C:1232 msgid "Import ASCII file%t|As Lines%x41|As Paragraphs%x42" msgstr "" -#: src/menus.C:1567 +#: src/menus.C:1236 msgid "IMA|Ll#l#L" msgstr "" -#: src/menus.C:1568 +#: src/menus.C:1237 msgid "IMA|Pp#p#P" msgstr "" -#: src/menus.C:1571 +#: src/menus.C:1240 msgid "" "Lists & TOC%t|Table of Contents%x21|List of Figures%x22|List of " "Tables%x23|List of Algorithms%x24|Index List%x25|BibTeX Reference%x26" msgstr "" -#: src/menus.C:1579 +#: src/menus.C:1248 msgid "IMT|Cc#c#C" msgstr "" -#: src/menus.C:1580 +#: src/menus.C:1249 msgid "IMT|Ff#f#F" msgstr "" -#: src/menus.C:1581 +#: src/menus.C:1250 msgid "IMT|Tt#t#T" msgstr "" -#: src/menus.C:1582 +#: src/menus.C:1251 msgid "IMT|Aa#a#A" msgstr "" -#: src/menus.C:1583 +#: src/menus.C:1252 msgid "IMT|Ii#i#I" msgstr "" -#: src/menus.C:1584 +#: src/menus.C:1253 msgid "IMT|Bb#b#B" msgstr "" -#: src/menus.C:1587 +#: src/menus.C:1256 msgid "" "Floats%t|Figure Float%x71|Table Float%x72|Wide Figure Float%x73|Wide Table " "Float%l%x74|Algorithm Float%x75" msgstr "" -#: src/menus.C:1594 +#: src/menus.C:1263 msgid "IMF|gG#g#G" msgstr "" -#: src/menus.C:1595 +#: src/menus.C:1264 msgid "IMF|Tt#t#T" msgstr "" -#: src/menus.C:1596 +#: src/menus.C:1265 msgid "IMF|Ww#w#W" msgstr "" -#: src/menus.C:1597 +#: src/menus.C:1266 msgid "IMF|iI#i#I" msgstr "" -#: src/menus.C:1598 +#: src/menus.C:1267 msgid "IMF|Aa#a#A" msgstr "" -#: src/menus.C:1601 +#: src/menus.C:1270 msgid "" "Special Character%t|HFill%x31|Hyphenation Point%x32|Protected " "Blank%x33|Linebreak%x34|Ellipsis (...)%x35|End of sentence " "period%x36|Ordinary Quote (\")%x37|Menu Separator %x38" msgstr "" -#: src/menus.C:1611 +#: src/menus.C:1280 msgid "IMS|Hh#h#H" msgstr "" -#: src/menus.C:1612 +#: src/menus.C:1281 msgid "IMS|Pp#p#P" msgstr "" -#: src/menus.C:1613 +#: src/menus.C:1282 msgid "IMS|Bb#b#B" msgstr "" -#: src/menus.C:1614 +#: src/menus.C:1283 msgid "IMS|Ll#l#L" msgstr "" -#: src/menus.C:1615 +#: src/menus.C:1284 msgid "IMS|iI#i#I" msgstr "" -#: src/menus.C:1616 +#: src/menus.C:1285 msgid "IMS|Ee#e#E" msgstr "" -#: src/menus.C:1617 +#: src/menus.C:1286 msgid "IMS|Qq#q#Q" msgstr "" -#: src/menus.C:1618 +#: src/menus.C:1287 msgid "IMS|Mm#m#M" msgstr "" -#: src/menus.C:1621 +#: src/menus.C:1290 msgid "" "Figure...|Table...%l|Include File...|Import ASCII File%m|Insert LyX " "File...%l|Footnote|Margin Note|Floats%m%l|Lists & TOC%m%l|Special " @@ -4183,213 +4181,213 @@ msgid "" "Reference...|Index entry...|Index entry of last word" msgstr "" -#: src/menus.C:1642 +#: src/menus.C:1311 msgid "IM|gG#g#G" msgstr "" -#: src/menus.C:1643 +#: src/menus.C:1312 msgid "IM|bB#b#B" msgstr "" -#: src/menus.C:1644 +#: src/menus.C:1313 msgid "IM|cC#c#C" msgstr "" -#: src/menus.C:1645 +#: src/menus.C:1314 msgid "IM|Aa#a#A" msgstr "" -#: src/menus.C:1646 +#: src/menus.C:1315 msgid "IM|Xx#x#X" msgstr "" -#: src/menus.C:1647 +#: src/menus.C:1316 msgid "IM|Ff#f#F" msgstr "" -#: src/menus.C:1648 +#: src/menus.C:1317 msgid "IM|Mm#m#M" msgstr "" -#: src/menus.C:1649 +#: src/menus.C:1318 msgid "IM|oO#o#O" msgstr "" -#: src/menus.C:1650 +#: src/menus.C:1319 msgid "IM|Tt#t#T" msgstr "" -#: src/menus.C:1651 +#: src/menus.C:1320 msgid "IM|Ss#s#S" msgstr "" -#: src/menus.C:1652 +#: src/menus.C:1321 msgid "IM|Nn#n#N" msgstr "" -#: src/menus.C:1653 +#: src/menus.C:1322 msgid "IM|Ll#l#L" msgstr "" -#: src/menus.C:1654 +#: src/menus.C:1323 msgid "IM|rR#r#R" msgstr "" -#: src/menus.C:1655 +#: src/menus.C:1324 msgid "IM|iI#i#I" msgstr "" -#: src/menus.C:1656 +#: src/menus.C:1325 msgid "IM|dD#d#D" msgstr "" -#: src/menus.C:1657 +#: src/menus.C:1326 msgid "IM|wW#w#W" msgstr "" -#: src/menus.C:1659 +#: src/menus.C:1328 msgid "|URL..." msgstr "" -#: src/menus.C:1660 +#: src/menus.C:1329 msgid "IM|Uu#u#U" msgstr "" -#: src/menus.C:1766 +#: src/menus.C:1435 msgid "" "Fraction|Square root|Exponent|Index|Sum|Integral%l|Math mode|Display%l|Math " "Panel..." msgstr "" -#: src/menus.C:1776 +#: src/menus.C:1445 msgid "MM|Ff#f#F" msgstr "" -#: src/menus.C:1777 +#: src/menus.C:1446 msgid "MM|Ss#s#S" msgstr "" -#: src/menus.C:1778 +#: src/menus.C:1447 msgid "MM|Ee#e#E" msgstr "" -#: src/menus.C:1779 +#: src/menus.C:1448 msgid "MM|xX#x#X" msgstr "" -#: src/menus.C:1780 +#: src/menus.C:1449 msgid "MM|uU#u#U" msgstr "" -#: src/menus.C:1781 +#: src/menus.C:1450 msgid "MM|Ii#i#I" msgstr "" -#: src/menus.C:1782 +#: src/menus.C:1451 msgid "MM|Mm#m#M" msgstr "" -#: src/menus.C:1783 +#: src/menus.C:1452 msgid "MM|Dd#d#D" msgstr "" -#: src/menus.C:1784 +#: src/menus.C:1453 msgid "MM|Pp#p#P" msgstr "" -#: src/menus.C:1850 +#: src/menus.C:1519 msgid "" "Screen Fonts...|Spellchecker Options...|Keyboard...|LaTeX...%l|Reconfigure" msgstr "" -#: src/menus.C:1856 +#: src/menus.C:1525 msgid "OM|Ff#f#F" msgstr "" -#: src/menus.C:1857 +#: src/menus.C:1526 msgid "OM|Ss#s#S" msgstr "" -#: src/menus.C:1858 +#: src/menus.C:1527 msgid "OM|Kk#k#K" msgstr "" -#: src/menus.C:1859 +#: src/menus.C:1528 msgid "OM|Ll#l#L" msgstr "" -#: src/menus.C:1860 +#: src/menus.C:1529 msgid "OM|Rr#r#R" msgstr "" -#: src/menus.C:1929 +#: src/menus.C:1598 msgid "" "Introduction|Tutorial|User's Guide|Extended Features|Customization|Reference " "Manual|Known Bugs|LaTeX Configuration%l|Copyright and " "Warranty...|Credits...|Version..." msgstr "" -#: src/menus.C:1941 +#: src/menus.C:1610 msgid "HM|Ii#I#i" msgstr "" -#: src/menus.C:1942 +#: src/menus.C:1611 msgid "HM|Tt#T#t" msgstr "" -#: src/menus.C:1943 +#: src/menus.C:1612 msgid "HM|Uu#U#u" msgstr "" -#: src/menus.C:1944 +#: src/menus.C:1613 msgid "HM|xX#x#X" msgstr "" -#: src/menus.C:1945 +#: src/menus.C:1614 msgid "HM|Cc#C#c" msgstr "" -#: src/menus.C:1946 +#: src/menus.C:1615 msgid "HM|Rr#R#r" msgstr "" -#: src/menus.C:1947 +#: src/menus.C:1616 msgid "HM|Kk#K#k" msgstr "" -#: src/menus.C:1948 +#: src/menus.C:1617 msgid "HM|Ll#L#l" msgstr "" -#: src/menus.C:1949 +#: src/menus.C:1618 msgid "HM|oO#o#O" msgstr "" -#: src/menus.C:1950 +#: src/menus.C:1619 msgid "HM|eE#e#E" msgstr "" -#: src/menus.C:1951 +#: src/menus.C:1620 msgid "HM|Vv#v#V" msgstr "" -#: src/menus.C:1974 +#: src/menus.C:1643 msgid "LyX Version " msgstr "" -#: src/menus.C:1975 +#: src/menus.C:1644 msgid " of " msgstr "" -#: src/menus.C:1976 +#: src/menus.C:1645 msgid "Library directory: " msgstr "" -#: src/menus.C:1978 +#: src/menus.C:1647 msgid "User directory: " msgstr "" -#: src/menus.C:1990 +#: src/menus.C:1659 msgid "Opening help file" msgstr "" @@ -4418,8 +4416,8 @@ msgstr "" msgid "Paper layout set" msgstr "" -#: src/PaperLayout.C:269 src/ParagraphExtra.C:309 src/TableLayout.C:500 -#: src/TableLayout.C:686 +#: src/PaperLayout.C:269 src/ParagraphExtra.C:297 src/TableLayout.C:298 +#: src/TableLayout.C:470 msgid "Warning: Invalid Length (valid example: 10mm)" msgstr "" @@ -4427,19 +4425,19 @@ msgstr "" msgid "Senseless with this layout!" msgstr "" -#: src/ParagraphExtra.C:147 +#: src/ParagraphExtra.C:143 msgid "Document is read-only. No changes to layout permitted." msgstr "" -#: src/ParagraphExtra.C:166 +#: src/ParagraphExtra.C:162 msgid "ParagraphExtra Layout" msgstr "" -#: src/ParagraphExtra.C:213 +#: src/ParagraphExtra.C:201 msgid "ParagraphExtra layout set" msgstr "" -#: src/ParagraphExtra.C:319 +#: src/ParagraphExtra.C:307 msgid "Warning: Invalid percent value (0-100)" msgstr "" @@ -4697,19 +4695,19 @@ msgstr "" msgid "Error: Dir already popped: " msgstr "" -#: src/TableLayout.C:416 +#: src/TableLayout.C:234 msgid "Table Extra Form" msgstr "" -#: src/TableLayout.C:436 +#: src/TableLayout.C:254 msgid "Table Layout" msgstr "" -#: src/TableLayout.C:460 src/TableLayout.C:479 +#: src/TableLayout.C:277 msgid "Warning: Wrong Cursor position, updated window" msgstr "" -#: src/TableLayout.C:535 +#: src/TableLayout.C:333 msgid "Confirm: press Delete-Button again" msgstr "" diff --git a/src/BufferView.C b/src/BufferView.C index 5c913c7c7f..02da89151f 100644 --- a/src/BufferView.C +++ b/src/BufferView.C @@ -65,9 +65,7 @@ BufferView::BufferView(LyXView * o, int xpos, int ypos, : owner_(o) { buffer_ = 0; -#ifdef MOVE_TEXT text = 0; -#endif screen = 0; work_area = 0; figinset_canvas = 0; @@ -87,9 +85,7 @@ BufferView::BufferView(LyXView * o, int xpos, int ypos, BufferView::~BufferView() { -#ifdef MOVE_TEXT delete text; -#endif } @@ -99,10 +95,8 @@ void BufferView::buffer(Buffer * b) if (buffer_) { buffer_->InsetSleep(); buffer_->delUser(this); -#ifdef MOVE_TEXT delete text; text = 0; -#endif } // Set current buffer @@ -111,6 +105,7 @@ void BufferView::buffer(Buffer * b) if (bufferlist.getState() == BufferList::CLOSING) return; // Nuke old image + // screen is always deleted when the buffer is changed. if (screen) delete screen; screen = 0; @@ -125,21 +120,12 @@ void BufferView::buffer(Buffer * b) buffer_->addUser(this); owner_->getMenus()->showMenus(); // If we don't have a text object for this, we make one -#ifdef MOVE_TEXT if (text == 0) resizeCurrentBuffer(); else { updateScreen(); updateScrollbar(); } -#else - if (buffer_->text == 0) - resizeCurrentBuffer(); - else { - updateScreen(); - updateScrollbar(); - } -#endif screen->first = screen->TopCursorVisible(); redraw(); updateAllVisibleBufferRelatedPopups(); @@ -162,21 +148,12 @@ void BufferView::updateScreen() // Regenerate the screen. if (screen) delete screen; -#ifdef MOVE_TEXT screen = new LyXScreen(FL_ObjWin(work_area), work_area->w, work_area->h, work_area->x, work_area->y, text); -#else - screen = new LyXScreen(FL_ObjWin(work_area), - work_area->w, - work_area->h, - work_area->x, - work_area->y, - buffer_->text); -#endif } @@ -232,13 +209,8 @@ void BufferView::updateScrollbar() long cbth = 0; long cbsf = 0; -#ifdef MOVE_TEXT if (text) cbth = text->height; -#else - if (buffer_->text) - cbth = buffer_->text->height; -#endif if (screen) cbsf = screen->first; @@ -257,7 +229,7 @@ void BufferView::updateScrollbar() return; } - long maximum_height = work_area->h * 3/4 + cbth; + long maximum_height = work_area->h * 3 / 4 + cbth; long value = cbsf; // set the scrollbar @@ -268,11 +240,7 @@ void BufferView::updateScrollbar() fl_set_slider_bounds(scrollbar, 0, maximum_height - work_area->h); #if FL_REVISION > 85 -#ifdef MOVE_TEXT double lineh = text->DefaultHeight(); -#else - double lineh = buffer_->text->DefaultHeight(); -#endif fl_set_slider_increment(scrollbar, work_area->h-lineh, lineh); #endif if (maxfloat > 0){ @@ -291,17 +259,10 @@ void BufferView::updateScrollbar() void BufferView::redoCurrentBuffer() { lyxerr[Debug::INFO] << "BufferView::redoCurrentBuffer" << endl; -#ifdef MOVE_TEXT if (buffer_ && text) { resize(); owner_->updateLayoutChoice(); } -#else - if (buffer_ && buffer_->text) { - resize(); - owner_->updateLayoutChoice(); - } -#endif } @@ -322,7 +283,6 @@ int BufferView::resizeCurrentBuffer() owner_->getMiniBuffer()->Set(_("Formatting document...")); -#ifdef MOVE_TEXT if (text) { par = text->cursor.par; pos = text->cursor.pos; @@ -335,31 +295,13 @@ int BufferView::resizeCurrentBuffer() delete text; } text = new LyXText(work_area->w, buffer_); -#else - if (buffer_->text) { - par = buffer_->text->cursor.par; - pos = buffer_->text->cursor.pos; - selstartpar = buffer_->text->sel_start_cursor.par; - selstartpos = buffer_->text->sel_start_cursor.pos; - selendpar = buffer_->text->sel_end_cursor.par; - selendpos = buffer_->text->sel_end_cursor.pos; - selection = buffer_->text->selection; - mark_set = buffer_->text->mark_set; - delete buffer_->text; - } - buffer_->text = new LyXText(work_area->w, buffer_); -#endif updateScreen(); -#ifdef MOVE_TEXT if (par) { text->selection = true; - /* at this point just - * to avoid the Delete- - * Empty-Paragraph - * Mechanism when - * setting the cursor */ + /* at this point just to avoid the Delete-Empty-Paragraph + * Mechanism when setting the cursor */ text->mark_set = mark_set; if (selection) { text->SetCursor(selstartpar, selstartpos); @@ -368,33 +310,11 @@ int BufferView::resizeCurrentBuffer() text->SetSelection(); text->SetCursor(par, pos); } else { - text->SetCursor(par, pos); + text->SetCursor(par, pos); text->sel_cursor = text->cursor; text->selection = false; } } -#else - if (par) { - buffer_->text->selection = true; - /* at this point just - * to avoid the Delete- - * Empty-Paragraph - * Mechanism when - * setting the cursor */ - buffer_->text->mark_set = mark_set; - if (selection) { - buffer_->text->SetCursor(selstartpar, selstartpos); - buffer_->text->sel_cursor = buffer_->text->cursor; - buffer_->text->SetCursor(selendpar, selendpos); - buffer_->text->SetSelection(); - buffer_->text->SetCursor(par, pos); - } else { - buffer_->text->SetCursor(par, pos); - buffer_->text->sel_cursor = buffer_->text->cursor; - buffer_->text->selection = false; - } - } -#endif screen->first = screen->TopCursorVisible(); /* this will scroll the * screen such that the * cursor becomes @@ -418,14 +338,9 @@ void BufferView::gotoError() screen->HideCursor(); BeforeChange(); -#ifdef MOVE_TEXT update(-2); -#else - buffer_->update(-2); -#endif LyXCursor tmp; -#ifdef MOVE_TEXT if (!text->GotoNextError()) { if (text->cursor.pos || text->cursor.par != text->FirstParagraph()) { @@ -434,7 +349,8 @@ void BufferView::gotoError() text->cursor.pos = 0; if (!text->GotoNextError()) { text->cursor = tmp; - owner_->getMiniBuffer()->Set(_("No more errors")); + owner_->getMiniBuffer() + ->Set(_("No more errors")); LyXBell(); } } else { @@ -444,29 +360,6 @@ void BufferView::gotoError() } update(0); text->sel_cursor = text->cursor; -#else - if (!buffer_->text->GotoNextError()) { - if (buffer_->text->cursor.pos - || buffer_->text->cursor.par != - buffer_->text->FirstParagraph()) { - tmp = buffer_->text->cursor; - buffer_->text->cursor.par = - buffer_->text->FirstParagraph(); - buffer_->text->cursor.pos = 0; - if (!buffer_->text->GotoNextError()) { - buffer_->text->cursor = tmp; - owner_->getMiniBuffer()->Set(_("No more errors")); - LyXBell(); - } - } else { - owner_->getMiniBuffer()->Set(_("No more errors")); - LyXBell(); - } - } - buffer_->update(0); - buffer_->text->sel_cursor = - buffer_->text->cursor; -#endif } @@ -514,9 +407,9 @@ void BufferView::create_view(int xpos, int ypos, int width, int height) // a hack for the figinsets (Matthias) // This one first, then it will probably be invisible. (Lgb) ::figinset_canvas = figinset_canvas = obj = - fl_add_canvas(FL_NORMAL_CANVAS, - xpos + 1, - ypos + 1, 1, 1, ""); + fl_add_canvas(FL_NORMAL_CANVAS, + xpos + 1, + ypos + 1, 1, 1, ""); fl_set_object_boxtype(obj, FL_NO_BOX); fl_set_object_resize(obj, FL_RESIZE_ALL); fl_set_object_gravity(obj, NorthWestGravity, NorthWestGravity); @@ -536,7 +429,7 @@ void BufferView::create_view(int xpos, int ypos, int width, int height) C_BufferView_work_area_handler); obj->wantkey = FL_KEY_TAB; obj->u_vdata = this; /* This is how we pass the BufferView - to the work_area_handler. */ + to the work_area_handler. */ fl_set_object_boxtype(obj, FL_DOWN_BOX); fl_set_object_resize(obj, FL_RESIZE_ALL); fl_set_object_gravity(obj, NorthWestGravity, SouthEastGravity); @@ -661,7 +554,8 @@ void waitForX() } static XEvent ev; XChangeProperty(fl_display, w, a, a, 8, - PropModeAppend, reinterpret_cast(""), 0); + PropModeAppend, + reinterpret_cast(""), 0); XWindowEvent(fl_display, w, PropertyChangeMask, &ev); #endif XSync(fl_get_display(), 0); @@ -686,11 +580,7 @@ void BufferView::ScrollCB(FL_OBJECT * ob, long) view->screen->Draw(view->current_scrollbar_value); if (cursor_follows_scrollbar) { -#ifdef MOVE_TEXT LyXText * vbt = view->text; -#else - LyXText * vbt = view->buffer_->text; -#endif int height = vbt->DefaultHeight(); if (vbt->cursor.y < view->screen->first + height) { @@ -737,29 +627,18 @@ void BufferView::DownCB(FL_OBJECT * ob, long) int BufferView::ScrollUp(long time) { if (buffer_ == 0) return 0; - if (!screen) - return 0; + if (!screen) return 0; - double value= fl_get_slider_value(scrollbar); + double value = fl_get_slider_value(scrollbar); - if (value == 0) - return 0; + if (value == 0) return 0; -#ifdef MOVE_TEXT float add_value = (text->DefaultHeight() + float(time) * float(time) * 0.125); if (add_value > work_area->h) add_value = float(work_area->h - text->DefaultHeight()); -#else - float add_value = (buffer_->text->DefaultHeight() - + float(time) * float(time) * 0.125); - - if (add_value > work_area->h) - add_value = float(work_area->h - - buffer_->text->DefaultHeight()); -#endif value -= add_value; @@ -776,31 +655,20 @@ int BufferView::ScrollUp(long time) int BufferView::ScrollDown(long time) { if (buffer_ == 0) return 0; - if (!screen) - return 0; + if (!screen) return 0; double value= fl_get_slider_value(scrollbar); double min, max; fl_get_slider_bounds(scrollbar, &min, &max); - if (value == max) - return 0; + if (value == max) return 0; -#ifdef MOVE_TEXT float add_value = (text->DefaultHeight() + float(time) * float(time) * 0.125); if (add_value > work_area->h) add_value = float(work_area->h - text->DefaultHeight()); -#else - float add_value = (buffer_->text->DefaultHeight() - + float(time) * float(time) * 0.125); - - if (add_value > work_area->h) - add_value = float(work_area->h - - buffer_->text->DefaultHeight()); -#endif value += add_value; @@ -817,17 +685,14 @@ int BufferView::ScrollDown(long time) void BufferView::ScrollUpOnePage(long /*time*/) { if (buffer_ == 0) return; - if (!screen) - return; + if (!screen) return; long y = screen->first; if (!y) return; -#ifdef MOVE_TEXT + Row * row = text->GetRowNearY(y); -#else - Row * row = buffer_->text->GetRowNearY(y); -#endif + y = y - work_area->h + row->height; fl_set_slider_value(scrollbar, y); @@ -839,26 +704,18 @@ void BufferView::ScrollUpOnePage(long /*time*/) void BufferView::ScrollDownOnePage(long /*time*/) { if (buffer_ == 0) return; - if (!screen) - return; + if (!screen) return; double min, max; fl_get_slider_bounds(scrollbar, &min, &max); long y = screen->first; -#ifdef MOVE_TEXT if (y > text->height - work_area->h) return; y += work_area->h; text->GetRowNearY(y); -#else - if (y > buffer_->text->height - work_area->h) - return; - - y += work_area->h; - buffer_->text->GetRowNearY(y); -#endif + fl_set_slider_value(scrollbar, y); ScrollCB(scrollbar, 0); @@ -867,7 +724,7 @@ void BufferView::ScrollDownOnePage(long /*time*/) int BufferView::work_area_handler(FL_OBJECT * ob, int event, FL_Coord, FL_Coord , - int /*key*/, void *xev) + int /*key*/, void * xev) { static int x_old = -1; static int y_old = -1; @@ -899,8 +756,9 @@ int BufferView::work_area_handler(FL_OBJECT * ob, int event, view->WorkAreaMotionNotify(ob, 0, 0, 0, ev, 0); } break; - // Done by the raw callback: - // case FL_KEYBOARD: WorkAreaKeyPress(ob, 0, 0, 0, ev, 0); break; + // Done by the raw callback: + // case FL_KEYBOARD: + // WorkAreaKeyPress(ob, 0, 0, 0, ev, 0); break; case FL_FOCUS: if (!view->owner_->getMiniBuffer()->shows_no_match) view->owner_->getMiniBuffer()->Init(); @@ -934,19 +792,11 @@ int BufferView::work_area_handler(FL_OBJECT * ob, int event, if (view->screen && ev->xbutton.button == 1) { view->screen->HideCursor(); view->screen->ToggleSelection(); -#ifdef MOVE_TEXT view->text->SelectWord(); -#else - view->buffer_->text->SelectWord(); -#endif view->screen->ToggleSelection(false); /* This will fit the cursor on the screen * if necessary */ -#ifdef MOVE_TEXT view->update(0); -#else - view->buffer_->update(0); -#endif } } break; @@ -955,26 +805,14 @@ int BufferView::work_area_handler(FL_OBJECT * ob, int event, if (view->buffer_ && view->screen && ev->xbutton.button == 1) { view->screen->HideCursor(); view->screen->ToggleSelection(); -#ifdef MOVE_TEXT view->text->CursorHome(); view->text->sel_cursor = view->text->cursor; view->text->CursorEnd(); view->text->SetSelection(); -#else - view->buffer_->text->CursorHome(); - view->buffer_->text->sel_cursor = - view->buffer_->text->cursor; - view->buffer_->text->CursorEnd(); - view->buffer_->text->SetSelection(); -#endif view->screen->ToggleSelection(false); /* This will fit the cursor on the screen * if necessary */ -#ifdef MOVE_TEXT view->update(0); -#else - view->buffer_->update(0); -#endif } break; case FL_OTHER: @@ -988,7 +826,7 @@ int BufferView::work_area_handler(FL_OBJECT * ob, int event, int BufferView::WorkAreaMotionNotify(FL_OBJECT *ob, Window, int /*w*/, int /*h*/, - XEvent *ev, void */*d*/) + XEvent * ev, void */*d*/) { if (buffer_ == 0) return 0; @@ -996,11 +834,7 @@ int BufferView::WorkAreaMotionNotify(FL_OBJECT *ob, Window, // Check for inset locking if (buffer_->the_locking_inset) { -#ifdef MOVE_TEXT LyXCursor cursor = text->cursor; -#else - LyXCursor cursor = buffer_->text->cursor; -#endif buffer_->the_locking_inset-> InsetMotionNotify(ev->xbutton.x - ob->x - cursor.x, ev->xbutton.y - ob->y - @@ -1018,7 +852,6 @@ int BufferView::WorkAreaMotionNotify(FL_OBJECT *ob, Window, if (selection_possible) { screen->HideCursor(); -#ifdef MOVE_TEXT text->SetCursorFromCoordinates(ev->xbutton.x - ob->x, ev->xbutton.y - ob->y + screen->first); @@ -1027,17 +860,6 @@ int BufferView::WorkAreaMotionNotify(FL_OBJECT *ob, Window, update(-3); // Maybe an empty line was deleted text->SetSelection(); -#else - buffer_->text-> - SetCursorFromCoordinates(ev->xbutton.x - ob->x, - ev->xbutton.y - ob->y + - screen->first); - - if (!buffer_->text->selection) - buffer_->update(-3); // Maybe an empty line was deleted - - buffer_->text->SetSelection(); -#endif screen->ToggleToggle(); if (screen->FitCursor()) updateScrollbar(); @@ -1049,10 +871,10 @@ int BufferView::WorkAreaMotionNotify(FL_OBJECT *ob, Window, extern int bibitemMaxWidth(LyXFont const &); -#ifdef MOVE_TEXT // Single-click on work area -int BufferView::WorkAreaButtonPress(FL_OBJECT *ob, Window, - int /*w*/, int /*h*/, XEvent *ev, void */*d*/) +int BufferView::WorkAreaButtonPress(FL_OBJECT * ob, Window, + int /*w*/, int /*h*/, + XEvent * ev, void */*d*/) { last_click_x = -1; last_click_y = -1; @@ -1075,307 +897,151 @@ int BufferView::WorkAreaButtonPress(FL_OBJECT *ob, Window, { - if (buffer_->the_locking_inset) { - // We are in inset locking mode + if (buffer_->the_locking_inset) { + // We are in inset locking mode - /* Check whether the inset was hit. If not reset mode, - otherwise give the event to the inset */ - if (inset_hit != 0) { - buffer_->the_locking_inset-> - InsetButtonPress(inset_x, inset_y, button); - return 0; - } else { - UnlockInset(buffer_->the_locking_inset); + /* Check whether the inset was hit. If not reset mode, + otherwise give the event to the inset */ + if (inset_hit != 0) { + buffer_->the_locking_inset-> + InsetButtonPress(inset_x, inset_y, + button); + return 0; + } else { + UnlockInset(buffer_->the_locking_inset); + } } - } - selection_possible = true; - screen->HideCursor(); + selection_possible = true; + screen->HideCursor(); - // Right button mouse click on a table - if (button == 3 && - (text->cursor.par->table || - text->MouseHitInTable(x, y + screen->first))) { - // Set the cursor to the press-position - text->SetCursorFromCoordinates(x, y + screen->first); - bool doit = true; + // Right button mouse click on a table + if (button == 3 && + (text->cursor.par->table || + text->MouseHitInTable(x, y + screen->first))) { + // Set the cursor to the press-position + text->SetCursorFromCoordinates(x, y + screen->first); + bool doit = true; - // Only show the table popup if the hit is in the table, too - if (!text->HitInTable(text->cursor.row, x)) - doit = false; + // Only show the table popup if the hit is in + // the table, too + if (!text->HitInTable(text->cursor.row, x)) + doit = false; - // Hit above or below the table? - if (doit) { - if (!text->selection) { - screen->ToggleSelection(); - text->ClearSelection(); - text->FullRebreak(); - screen->Update(); - updateScrollbar(); + // Hit above or below the table? + if (doit) { + if (!text->selection) { + screen->ToggleSelection(); + text->ClearSelection(); + text->FullRebreak(); + screen->Update(); + updateScrollbar(); + } + // Popup table popup when on a table. + // This is obviously temporary, since we + // should be able to popup various + // context-sensitive-menus with the + // the right mouse. So this should be done more + // general in the future. Matthias. + selection_possible = false; + owner_->getLyXFunc() + ->Dispatch(LFUN_LAYOUT_TABLE, + "true"); + return 0; } - // Popup table popup when on a table. - // This is obviously temporary, since we should be - // able to - // popup various context-sensitive-menus with the - // the right mouse. So this should be done more - // general in the future. Matthias. - selection_possible = false; - owner_->getLyXFunc()->Dispatch(LFUN_LAYOUT_TABLE, - "true"); - return 0; } - } - - int screen_first = screen->first; - // Middle button press pastes if we have a selection - bool paste_internally = false; - if (button == 2 // && !buffer_->the_locking_inset - && text->selection) { - owner_->getLyXFunc()->Dispatch(LFUN_COPY); - paste_internally = true; - } - - // Clear the selection - screen->ToggleSelection(); - text->ClearSelection(); - text->FullRebreak(); - screen->Update(); - updateScrollbar(); - - // Single left click in math inset? - if (inset_hit != 0 && inset_hit->Editable() == 2) { - // Highly editable inset, like math - selection_possible = false; - owner_->updateLayoutChoice(); - owner_->getMiniBuffer()->Set(inset_hit->EditMessage()); - inset_hit->Edit(inset_x, inset_y); - return 0; - } - - // Right click on a footnote flag opens float menu - if (button == 3) { - selection_possible = false; - return 0; - } + int screen_first = screen->first; - text->SetCursorFromCoordinates(x, y + screen_first); - text->FinishUndo(); - text->sel_cursor = text->cursor; - text->cursor.x_fix = text->cursor.x; + // Middle button press pastes if we have a selection + bool paste_internally = false; + if (button == 2 // && !buffer_->the_locking_inset + && text->selection) { + owner_->getLyXFunc()->Dispatch(LFUN_COPY); + paste_internally = true; + } - owner_->updateLayoutChoice(); - if (screen->FitCursor()){ + // Clear the selection + screen->ToggleSelection(); + text->ClearSelection(); + text->FullRebreak(); + screen->Update(); updateScrollbar(); - selection_possible = false; - } - - // Insert primary selection with middle mouse - // if there is a local selection in the current buffer, insert this - if (button == 2) { // && !buffer_->the_locking_inset){ - if (paste_internally) - owner_->getLyXFunc()->Dispatch(LFUN_PASTE); - else - owner_->getLyXFunc()->Dispatch(LFUN_PASTESELECTION, - "paragraph"); - selection_possible = false; - return 0; - } - } - goto out; - wheel: { - // I am not quite sure if this is the correct place to put this, - // but it will not cause any harm. - // Patch from Mark Huang (markman@mit.edu) to make LyX recognise - // button 4 and 5. This enables LyX use use the scrollwhell on - // certain mice for something useful. (Lgb) - // Added wheel acceleration detection code. (Rvdk) - static Time lastTime = 0; - int diff = ev->xbutton.time - lastTime; - int scroll = int(1.0 + (4.0/(abs(diff)+1.0))*200.0); - switch (button) { - case 4: - ScrollUp(scroll); - break; - case 5: - ScrollDown(scroll); - break; - } - lastTime = ev->xbutton.time; - return 0; - } - out: - last_click_x = x; - last_click_y = y; - - return 0; -} -#else -// Single-click on work area -int BufferView::WorkAreaButtonPress(FL_OBJECT *ob, Window, - int /*w*/, int /*h*/, XEvent *ev, void */*d*/) -{ - last_click_x = -1; - last_click_y = -1; - - if (buffer_ == 0) return 0; - if (!screen) return 0; - - int const x = ev->xbutton.x - ob->x; - int const y = ev->xbutton.y - ob->y; - // If we hit an inset, we have the inset coordinates in these - // and inset_hit points to the inset. If we do not hit an - // inset, inset_hit is 0, and inset_x == x, inset_y == y. - int inset_x = x; - int inset_y = y; - Inset * inset_hit = checkInsetHit(inset_x, inset_y); - - // ok ok, this is a hack. - int button = ev->xbutton.button; - if (button == 4 || button == 5) goto wheel; - - { - if (buffer_->the_locking_inset) { - // We are in inset locking mode - - /* Check whether the inset was hit. If not reset mode, - otherwise give the event to the inset */ - if (inset_hit != 0) { - buffer_->the_locking_inset-> - InsetButtonPress(inset_x, inset_y, button); + // Single left click in math inset? + if (inset_hit != 0 && inset_hit->Editable() == 2) { + // Highly editable inset, like math + selection_possible = false; + owner_->updateLayoutChoice(); + owner_->getMiniBuffer()->Set(inset_hit->EditMessage()); + inset_hit->Edit(inset_x, inset_y); return 0; - } else { - UnlockInset(buffer_->the_locking_inset); - } - } - - selection_possible = true; - screen->HideCursor(); - - // Right button mouse click on a table - if (button == 3 && - (buffer_->text->cursor.par->table || - buffer_->text->MouseHitInTable(x, y+screen->first))) { - // Set the cursor to the press-position - buffer_->text->SetCursorFromCoordinates(x, y + screen->first); - bool doit = true; - - // Only show the table popup if the hit is in the table, too - if (!buffer_->text->HitInTable(buffer_->text->cursor.row, x)) - doit = false; - - // Hit above or below the table? - if (doit) { - if (!buffer_->text->selection) { - screen->ToggleSelection(); - buffer_->text->ClearSelection(); - buffer_->text->FullRebreak(); - screen->Update(); - updateScrollbar(); - } - // Popup table popup when on a table. - // This is obviously temporary, since we should be - // able to - // popup various context-sensitive-menus with the - // the right mouse. So this should be done more - // general in the future. Matthias. + } + + // Right click on a footnote flag opens float menu + if (button == 3) { selection_possible = false; - owner_->getLyXFunc()->Dispatch(LFUN_LAYOUT_TABLE, - "true"); return 0; } - } - int screen_first = screen->first; - - // Middle button press pastes if we have a selection - bool paste_internally = false; - if (button == 2 // && !buffer_->the_locking_inset - && buffer_->text->selection) { - owner_->getLyXFunc()->Dispatch(LFUN_COPY); - paste_internally = true; - } + text->SetCursorFromCoordinates(x, y + screen_first); + text->FinishUndo(); + text->sel_cursor = text->cursor; + text->cursor.x_fix = text->cursor.x; - // Clear the selection - screen->ToggleSelection(); - buffer_->text->ClearSelection(); - buffer_->text->FullRebreak(); - screen->Update(); - updateScrollbar(); - - // Single left click in math inset? - if (inset_hit != 0 && inset_hit->Editable() == 2) { - // Highly editable inset, like math - selection_possible = false; owner_->updateLayoutChoice(); - owner_->getMiniBuffer()->Set(inset_hit->EditMessage()); - inset_hit->Edit(inset_x, inset_y); - return 0; - } - - // Right click on a footnote flag opens float menu - if (button == 3) { - selection_possible = false; - return 0; - } - - buffer_->text->SetCursorFromCoordinates(x, y + screen_first); - buffer_->text->FinishUndo(); - buffer_->text->sel_cursor = buffer_->text->cursor; - buffer_->text->cursor.x_fix = buffer_->text->cursor.x; - - owner_->updateLayoutChoice(); - if (screen->FitCursor()){ - updateScrollbar(); - selection_possible = false; - } + if (screen->FitCursor()){ + updateScrollbar(); + selection_possible = false; + } - // Insert primary selection with middle mouse - // if there is a local selection in the current buffer, insert this - if (button == 2) { // && !buffer_->the_locking_inset){ - if (paste_internally) - owner_->getLyXFunc()->Dispatch(LFUN_PASTE); - else - owner_->getLyXFunc()->Dispatch(LFUN_PASTESELECTION, - "paragraph"); - selection_possible = false; - return 0; - } + // Insert primary selection with middle mouse + // if there is a local selection in the current buffer, + // insert this + if (button == 2) { // && !buffer_->the_locking_inset){ + if (paste_internally) + owner_->getLyXFunc()->Dispatch(LFUN_PASTE); + else + owner_->getLyXFunc()->Dispatch(LFUN_PASTESELECTION, + "paragraph"); + selection_possible = false; + return 0; + } } goto out; - wheel: { - // I am not quite sure if this is the correct place to put this, - // but it will not cause any harm. - // Patch from Mark Huang (markman@mit.edu) to make LyX recognise - // button 4 and 5. This enables LyX use use the scrollwhell on - // certain mice for something useful. (Lgb) - // Added wheel acceleration detection code. (Rvdk) - static Time lastTime = 0; - int diff = ev->xbutton.time - lastTime; - int scroll = int(1.0 + (4.0/(abs(diff)+1.0))*200.0); - switch (button) { - case 4: - ScrollUp(scroll); - break; - case 5: - ScrollDown(scroll); - break; - } - lastTime = ev->xbutton.time; - return 0; + wheel: + { + // I am not quite sure if this is the correct place to put + // this, but it will not cause any harm. + // Patch from Mark Huang (markman@mit.edu) to make LyX + // recognise button 4 and 5. This enables LyX use use + // the scrollwhell on certain mice for something useful. (Lgb) + // Added wheel acceleration detection code. (Rvdk) + static Time lastTime = 0; + int diff = ev->xbutton.time - lastTime; + int scroll = int(1.0 + (4.0 / (abs(diff) + 1.0)) * 200.0); + switch (button) { + case 4: + ScrollUp(scroll); + break; + case 5: + ScrollDown(scroll); + break; + } + lastTime = ev->xbutton.time; + return 0; } - out: + out: last_click_x = x; last_click_y = y; return 0; } -#endif -#ifdef MOVE_TEXT + int BufferView::WorkAreaButtonRelease(FL_OBJECT * ob, Window , - int /*w*/, int /*h*/, XEvent * ev, void * /*d*/) + int /*w*/, int /*h*/, + XEvent * ev, void * /*d*/) { if (buffer_ == 0 || screen == 0) return 0; @@ -1511,7 +1177,7 @@ int BufferView::WorkAreaButtonRelease(FL_OBJECT * ob, Window , text->cursor.row->baseline && y + screen_first < text->cursor.y - text->cursor.row->baseline - + font.maxAscent()*1.2 + font.maxDescent()*1.2) { + + font.maxAscent() * 1.2 + font.maxDescent() * 1.2) { ToggleFloat(); selection_possible = false; return 0; @@ -1520,175 +1186,21 @@ int BufferView::WorkAreaButtonRelease(FL_OBJECT * ob, Window , // Maybe we want to edit a bibitem ale970302 if (text->cursor.par->bibkey && x < 20 + - bibitemMaxWidth(textclasslist.TextClass(buffer_-> - params.textclass).defaultfont())) { + bibitemMaxWidth(textclasslist + .TextClass(buffer_-> + params.textclass).defaultfont())) { text->cursor.par->bibkey->Edit(0, 0); } return 0; } -#else -int BufferView::WorkAreaButtonRelease(FL_OBJECT *ob, Window , - int /*w*/, int /*h*/, XEvent *ev, void */*d*/) -{ - if (buffer_ == 0 || screen == 0) return 0; - int const x = ev->xbutton.x - ob->x; - int const y = ev->xbutton.y - ob->y; - - // If we hit an inset, we have the inset coordinates in these - // and inset_hit points to the inset. If we do not hit an - // inset, inset_hit is 0, and inset_x == x, inset_y == y. - int inset_x = x; - int inset_y = y; - Inset * inset_hit = checkInsetHit(inset_x, inset_y); - - if (buffer_->the_locking_inset) { - // We are in inset locking mode. - - /* LyX does a kind of work-area grabbing for insets. - Only a ButtonPress Event outside the inset will - force a InsetUnlock. */ - buffer_->the_locking_inset-> - InsetButtonRelease(inset_x, inset_y, - ev->xbutton.button); - return 0; - } - - selection_possible = false; - if (buffer_->text->cursor.par->table) { - int cell = buffer_->text-> - NumberOfCell(buffer_->text->cursor.par, - buffer_->text->cursor.pos); - if (buffer_->text->cursor.par->table->IsContRow(cell) && - buffer_->text->cursor.par->table-> - CellHasContRow(buffer_->text->cursor.par->table-> - GetCellAbove(cell))<0) { - buffer_->text->CursorUp(); - } - } - - if (ev->xbutton.button >= 2) - return 0; - - // Make sure that the press was not far from the release - if ((abs(last_click_x - x) >= 5) || - (abs(last_click_y - y) >= 5)) { - return 0; - } - - // Did we hit an editable inset? - if (inset_hit != 0) { - // Inset like error, notes and figures - selection_possible = false; -#ifdef WITH_WARNINGS -#warning fix this proper in 0.13 -#endif - // Following a ref shouldn't issue - // a push on the undo-stack - // anylonger, now that we have - // keybindings for following - // references and returning from - // references. IMHO though, it - // should be the inset's own business - // to push or not push on the undo - // stack. They don't *have* to - // alter the document... - // (Joacim) - // ...or maybe the SetCursorParUndo() - // below isn't necessary at all anylonger? - if (inset_hit->LyxCode() == Inset::REF_CODE) { - buffer_->text->SetCursorParUndo(); - } - - owner_->getMiniBuffer()->Set(inset_hit->EditMessage()); - inset_hit->Edit(inset_x, inset_y); - return 0; - } - - // check whether we want to open a float - if (buffer_->text) { - bool hit = false; - char c = ' '; - if (buffer_->text->cursor.pos < - buffer_->text->cursor.par->Last()) { - c = buffer_->text->cursor.par-> - GetChar(buffer_->text->cursor.pos); - } - if (c == LyXParagraph::META_FOOTNOTE - || c == LyXParagraph::META_MARGIN - || c == LyXParagraph::META_FIG - || c == LyXParagraph::META_TAB - || c == LyXParagraph::META_WIDE_FIG - || c == LyXParagraph::META_WIDE_TAB - || c == LyXParagraph::META_ALGORITHM){ - hit = true; - } else if (buffer_->text->cursor.pos - 1 >= 0) { - c = buffer_->text->cursor.par-> - GetChar(buffer_->text->cursor.pos - 1); - if (c == LyXParagraph::META_FOOTNOTE - || c == LyXParagraph::META_MARGIN - || c == LyXParagraph::META_FIG - || c == LyXParagraph::META_TAB - || c == LyXParagraph::META_WIDE_FIG - || c == LyXParagraph::META_WIDE_TAB - || c == LyXParagraph::META_ALGORITHM){ - // We are one step too far to the right - buffer_->text->CursorLeft(); - hit = true; - } - } - if (hit == true) { - ToggleFloat(); - selection_possible = false; - return 0; - } - } - - // Do we want to close a float? (click on the float-label) - if (buffer_->text->cursor.row->par->footnoteflag == - LyXParagraph::OPEN_FOOTNOTE - && buffer_->text->cursor.pos == 0 - && buffer_->text->cursor.row->previous && - buffer_->text->cursor.row->previous->par-> - footnoteflag != LyXParagraph::OPEN_FOOTNOTE){ - LyXFont font (LyXFont::ALL_SANE); - font.setSize(LyXFont::SIZE_SMALL); - - int box_x = 20; // LYX_PAPER_MARGIN; - box_x += font.textWidth("Mwide-figM", 10); - - int screen_first = screen->first; - - if (x < box_x - && y + screen_first > buffer_->text->cursor.y - - buffer_->text->cursor.row->baseline - && y + screen_first < buffer_->text->cursor.y - - buffer_->text->cursor.row->baseline - + font.maxAscent()*1.2 + font.maxDescent()*1.2) { - ToggleFloat(); - selection_possible = false; - return 0; - } - } - - // Maybe we want to edit a bibitem ale970302 - if (buffer_->text->cursor.par->bibkey && x < 20 + - bibitemMaxWidth(textclasslist.TextClass(buffer_-> - params.textclass).defaultfont())) { - buffer_->text->cursor.par->bibkey->Edit(0, 0); - } - - return 0; -} -#endif /* * Returns an inset if inset was hit. 0 otherwise. * If hit, the coordinates are changed relative to the inset. * Otherwise coordinates are not changed, and false is returned. */ -#ifdef MOVE_TEXT Inset * BufferView::checkInsetHit(int & x, int & y) { if (!getScreen()) @@ -1729,48 +1241,7 @@ Inset * BufferView::checkInsetHit(int & x, int & y) } return 0; } -#else -Inset * BufferView::checkInsetHit(int & x, int & y) -{ - if (!getScreen()) - return 0; - - int y_tmp = y + getScreen()->first; - - LyXCursor cursor = buffer_->text->cursor; - if (cursor.pos < cursor.par->Last() - && cursor.par->GetChar(cursor.pos) == LyXParagraph::META_INSET - && cursor.par->GetInset(cursor.pos) - && cursor.par->GetInset(cursor.pos)->Editable()) { - // Check whether the inset really was hit - Inset * tmpinset = cursor.par->GetInset(cursor.pos); - LyXFont font = buffer_->text->GetFont(cursor.par, cursor.pos); - if (x > cursor.x - && x < cursor.x + tmpinset->Width(font) - && y_tmp > cursor.y - tmpinset->Ascent(font) - && y_tmp < cursor.y + tmpinset->Descent(font)) { - x = x - cursor.x; - // The origin of an inset is on the baseline - y = y_tmp - (cursor.y); - return tmpinset; - } - } else if (cursor.pos - 1 >= 0 - && cursor.par->GetChar(cursor.pos - 1) == LyXParagraph::META_INSET - && cursor.par->GetInset(cursor.pos - 1) - && cursor.par->GetInset(cursor.pos - 1)->Editable()) { - buffer_->text->CursorLeft(); - Inset * result = checkInsetHit(x, y); - if (result == 0) { - buffer_->text->CursorRight(); - return 0; - } else { - return result; - } - } - return 0; -} -#endif int BufferView::workAreaExpose() { @@ -1827,7 +1298,7 @@ int BufferView::workAreaExpose() // Callback for cursor timer void BufferView::CursorToggleCB(FL_OBJECT * ob, long) { - BufferView *view = static_cast(ob->u_vdata); + BufferView * view = static_cast(ob->u_vdata); /* quite a nice place for asyncron Inset updating, isn't it? */ // actually no! This is run even if no buffer exist... so (Lgb) @@ -1864,12 +1335,12 @@ void BufferView::CursorToggleCB(FL_OBJECT * ob, long) // these comments posted to lyx@via { - int status = 1; - int pid = waitpid(static_cast(0), &status, WNOHANG); - if (pid == -1) // error find out what is wrong - ; // ignore it for now. - else if (pid > 0) - sigchldhandler(pid, &status); + int status = 1; + int pid = waitpid(static_cast(0), &status, WNOHANG); + if (pid == -1) // error find out what is wrong + ; // ignore it for now. + else if (pid > 0) + sigchldhandler(pid, &status); } if (InsetUpdateList) UpdateInsetUpdateList(); @@ -1900,7 +1371,7 @@ void BufferView::CursorToggleCB(FL_OBJECT * ob, long) Window tmpwin; int tmp; XGetInputFocus(fl_display, &tmpwin, &tmp); - if (lyxerr.debugging()) { + if (lyxerr.debugging(Debug::INFO)) { lyxerr << "tmpwin: " << tmpwin << "\nwindow: " << view->owner_->getForm()->window << "\nwork_area_focus: " << view->work_area_focus @@ -1927,7 +1398,8 @@ void BufferView::CursorToggleCB(FL_OBJECT * ob, long) int BufferView::WorkAreaSelectionNotify(FL_OBJECT *, Window win, - int /*w*/, int /*h*/, XEvent *event, void */*d*/) + int /*w*/, int /*h*/, + XEvent * event, void */*d*/) { if (buffer_ == 0) return 0; if (event->type != SelectionNotify) @@ -1984,37 +1456,22 @@ int BufferView::WorkAreaSelectionNotify(FL_OBJECT *, Window win, } XFlush(fl_display); - if (uc){ -#ifdef MOVE_TEXT + if (uc) { if (!ascii_type) { text->InsertStringA(reinterpret_cast(uc)); } else { text->InsertStringB(reinterpret_cast(uc)); } -#else - if (!ascii_type) { - buffer_->text-> - InsertStringA(reinterpret_cast(uc)); - } else { - buffer_->text-> - InsertStringB(reinterpret_cast(uc)); - } -#endif free(uc); uc = 0; } -#ifdef MOVE_TEXT update(1); -#else - buffer_->update(1); -#endif } return 0; } -#ifdef MOVE_TEXT void BufferView::cursorPrevious() { if (!text->cursor.row->previous) return; @@ -2052,74 +1509,20 @@ void BufferView::cursorNext() getScreen()->Draw(text->cursor.y - text->cursor.row->baseline); } -#else -void BufferView::cursorPrevious() -{ - if (!buffer()->text->cursor.row->previous) return; - - long y = getScreen()->first; - Row * cursorrow = buffer()->text->cursor.row; - buffer()->text-> - SetCursorFromCoordinates(buffer()->text-> - cursor.x_fix, - y); - buffer()->text->FinishUndo(); - // this is to allow jumping over large insets - if ((cursorrow == buffer()->text->cursor.row)) - buffer()->text->CursorUp(); - - if (buffer()->text->cursor.row->height < work_area->h) - getScreen()->Draw(buffer()->text->cursor.y - - buffer()->text->cursor.row->baseline - + buffer()->text->cursor.row->height - - work_area->h +1 ); -} -void BufferView::cursorNext() -{ - if (!buffer()->text->cursor.row->next) return; - - long y = getScreen()->first; - buffer()->text->GetRowNearY(y); - Row * cursorrow = buffer()->text->cursor.row; - buffer()->text-> - SetCursorFromCoordinates(buffer()->text-> - cursor.x_fix, - y + work_area->h); - buffer()->text->FinishUndo(); - /* this is to allow jumping over large insets */ - if ((cursorrow == buffer()->text->cursor.row)) - buffer()->text->CursorDown(); - - if (buffer()->text->cursor.row->height < work_area->h) - getScreen()->Draw(buffer()->text->cursor.y - - buffer()->text->cursor.row->baseline); -} -#endif - bool BufferView::available() const { -#ifdef MOVE_TEXT if (buffer_ && text) return true; -#else - if (buffer_ && buffer_->text) return true; -#endif return false; } void BufferView::savePosition() { -#ifdef MOVE_TEXT backstack.push(buffer()->fileName(), - text->cursor.x, - text->cursor.y); -#else - backstack.push(buffer()->getFileName(), - buffer()->text->cursor.x, - buffer()->text->cursor.y); -#endif + text->cursor.x, + text->cursor.y); } @@ -2131,20 +1534,15 @@ void BufferView::restorePosition() string fname = backstack.pop(&x, &y); BeforeChange(); - Buffer * b = (bufferlist.exists(fname)) ? bufferlist.getBuffer(fname): + Buffer * b = bufferlist.exists(fname) ? + bufferlist.getBuffer(fname) : bufferlist.loadLyXFile(fname); // don't ask, just load it buffer(b); -#ifdef MOVE_TEXT text->SetCursorFromCoordinates(x, y); update(0); -#else - buffer()->text->SetCursorFromCoordinates(x, y); - buffer()->update(0); -#endif } -#ifdef MOVE_TEXT // candidate for move to BufferView void BufferView::update(signed char f) { @@ -2172,4 +1570,3 @@ void BufferView::update(signed char f) } } } -#endif diff --git a/src/BufferView.h b/src/BufferView.h index e89b6b2cfe..45e4cce06b 100644 --- a/src/BufferView.h +++ b/src/BufferView.h @@ -20,7 +20,6 @@ #include "BackStack.h" #include "lyxtext.h" -#define MOVE_TEXT 1 class LyXView; class Buffer; @@ -48,10 +47,8 @@ public: void fitCursor(); /// void update(); -#ifdef MOVE_TEXT /// void update(signed char f); -#endif /// void updateScrollbar(); /// @@ -70,20 +67,18 @@ public: LyXView * owner() const { return owner_; } /// LyXScreen * getScreen() - { - fl_set_timer(timer_cursor, 0.4); - return screen; - } + { + fl_set_timer(timer_cursor, 0.4); + return screen; + } /// void savePosition(); /// void restorePosition(); -#ifdef MOVE_TEXT /** This holds the mapping between buffer paragraphs and screen rows. This should be private...but not yet. (Lgb) */ LyXText * text; -#endif private: /// Update pixmap of screen void updateScreen(); diff --git a/src/FontInfo.C b/src/FontInfo.C index f9a10c2a9a..95f44c8f2e 100644 --- a/src/FontInfo.C +++ b/src/FontInfo.C @@ -4,7 +4,7 @@ * * LyX, The Document Processor * - * Copyright (C) 1997 Asger Alstrup + * Copyright 1997 Asger Alstrup * and the LyX Team. * * ====================================================== */ @@ -67,32 +67,30 @@ string FontInfo::getFontname(int size) return strings[closestind]; } + /// Build newly sized font string -string FontInfo::resize(string const & font, int size) const { +string FontInfo::resize(string const & font, int size) const +{ + string ret(font); // Find the position of the size spec -#ifdef WITH_WARNINGS -#warning rewrite to use std::string constructs -#endif - int cut = 0, before = 0, after = 0; - for (string::size_type i = 0; i < font.length(); ++i) { - if (font[i] == '-') { + int cut = 0; + string::iterator before = 0; + string::iterator after = 0; + for (string::iterator sit = ret.begin(); + sit != ret.end(); ++sit) + if ((*sit) == '-') { ++cut; - if (cut == 7) { - before = i; - } else if (cut == 8) { - after = i; + if (cut == 7) before = sit + 1; + else if (cut == 8) { + after = sit; break; } } - } - - string head = font; - head.erase(before + 1, string::npos); - string tail = font; - tail.erase(0, after); - return head + tostr(size) + tail; + ret.replace(before, after, tostr(size)); + return ret; } + /// Set new pattern void FontInfo::setPattern(string const & pat) { @@ -101,6 +99,7 @@ void FontInfo::setPattern(string const & pat) pattern = pat; } + /// Query font in X11 void FontInfo::query() { @@ -108,7 +107,8 @@ void FontInfo::query() return; if (pattern.empty()) { - lyxerr << "Can not use empty font name for font query." << endl; + lyxerr << "Can not use empty font name for font query." + << endl; queried = true; return; } @@ -141,6 +141,7 @@ void FontInfo::query() queried = true; } + /// Release allocated stuff void FontInfo::release() { diff --git a/src/LyXAction.C b/src/LyXAction.C index bea0dab4a4..9f2dbf5756 100644 --- a/src/LyXAction.C +++ b/src/LyXAction.C @@ -19,7 +19,7 @@ #include "gettext.h" #include "support/lstrings.h" - /* +/* NAMING RULES FOR USER-COMMANDS Here's the set of rules to apply when a new command name is introduced: @@ -71,281 +71,300 @@ void LyXAction::init() if (init) return; lfun_item items[] = { - { LFUN_ACUTE, "accent-acute", "", Noop }, - { LFUN_BREVE, "accent-breve", "", Noop }, - { LFUN_CARON, "accent-caron", "", Noop }, - { LFUN_CEDILLA, "accent-cedilla", "", Noop }, - { LFUN_CIRCLE, "accent-circle", "", Noop }, - { LFUN_CIRCUMFLEX, "accent-circumflex", "", Noop }, - { LFUN_DOT, "accent-dot", "", Noop }, - { LFUN_GRAVE, "accent-grave", "", Noop }, - { LFUN_HUNG_UMLAUT, "accent-hungarian-umlaut", "", Noop }, - { LFUN_MACRON, "accent-macron", "", Noop }, - { LFUN_OGONEK, "accent-ogonek", "", Noop }, - { LFUN_SPECIAL_CARON, "accent-special-caron", "", Noop }, - { LFUN_TIE, "accent-tie", "", Noop }, - { LFUN_TILDE, "accent-tilde", "", Noop }, - { LFUN_UMLAUT, "accent-umlaut", "", Noop }, - { LFUN_UNDERBAR, "accent-underbar", "", Noop }, - { LFUN_UNDERDOT, "accent-underdot", "", Noop }, - { LFUN_VECTOR, "accent-vector", "", Noop }, - { LFUN_APPENDIX, "appendix", N_("Insert appendix"), Noop }, - { LFUN_APROPOS, "apropos", N_("Describe command"), NoBuffer|ReadOnly }, - { LFUN_LEFTSEL, "backward-select", - N_("Select previous char"), ReadOnly }, - { LFUN_BIBDB_ADD, "bibtex-database-add", "", Noop }, - { LFUN_BIBDB_DEL, "bibtex-database-del", "", Noop }, - { LFUN_INSERT_BIBTEX, "bibtex-insert", N_("Insert bibtex"), Noop }, - { LFUN_BIBTEX_STYLE, "bibtex-style", "", Noop }, - { LFUN_BREAKLINE, "break-line", "", Noop }, - { LFUN_BREAKPARAGRAPH, "break-paragraph", "", Noop }, - { LFUN_BREAKPARAGRAPHKEEPLAYOUT, "break-paragraph-keep-layout", - "", Noop }, - { LFUN_BREAKPARAGRAPH_SKIP, "break-paragraph-skip", "", Noop }, - { LFUN_BUILDPROG, "build-program", _("Build program"), Noop }, - { LFUN_AUTOSAVE, "buffer-auto-save", N_("Autosave"), Noop }, - { LFUN_BEGINNINGBUF, "buffer-begin", - N_("Go to beginning of document"), ReadOnly }, - { LFUN_BEGINNINGBUFSEL, "buffer-begin-select", - N_("Select to beginning of document"), ReadOnly }, - { LFUN_CHILDINSERT, "buffer-child-insert", "", Noop }, - { LFUN_CHILDOPEN, "buffer-child-open", "", ReadOnly }, - { LFUN_RUNCHKTEX, "buffer-chktex", N_("Check TeX"), ReadOnly }, - { LFUN_CLOSEBUFFER, "buffer-close", N_("Close"), ReadOnly }, - { LFUN_ENDBUF, "buffer-end", - N_("Go to end of document"), ReadOnly }, - { LFUN_ENDBUFSEL, "buffer-end-select", - N_("Select to end of document"), ReadOnly }, - { LFUN_EXPORT, "buffer-export", N_("Export to"), ReadOnly }, - { LFUN_FAX, "buffer-fax", N_("Fax"), ReadOnly }, - { LFUN_INSERTFOOTNOTE, "buffer-float-insert", "", Noop }, - { LFUN_IMPORT, "buffer-import", - N_("Import document"), NoBuffer }, - { LFUN_BUFFERBULLETSSELECT, "buffer-itemize-bullets-select", - "", Noop }, - { LFUN_MENUNEW, "buffer-new", N_("New document") , NoBuffer }, - { LFUN_MENUNEWTMPLT,"buffer-new-template", - N_("New document from template"), NoBuffer }, - { LFUN_MENUOPEN, "buffer-open", N_("Open"), NoBuffer }, - { LFUN_PREVBUFFER, "buffer-previous", - N_("Switch to previous document"), ReadOnly }, - { LFUN_MENUPRINT, "buffer-print", N_("Print"), ReadOnly }, - { LFUN_MENURELOAD, "buffer-reload", - N_("Revert to saved"), ReadOnly }, - { LFUN_READ_ONLY_TOGGLE, "buffer-toggle-read-only", - N_("Toggle read-only"), ReadOnly }, - { LFUN_RUNLATEX, "buffer-typeset", N_("Update DVI"), ReadOnly }, - { LFUN_RUNDVIPS, "buffer-typeset-ps", - N_("Update PostScript"), ReadOnly }, - { LFUN_PREVIEW, "buffer-view", N_("View DVI") , ReadOnly }, - { LFUN_PREVIEWPS, "buffer-view-ps", - N_("View PostScript") , ReadOnly }, - { LFUN_MENUWRITE, "buffer-write", N_("Save"), ReadOnly }, - { LFUN_MENUWRITEAS, "buffer-write-as", N_("Save As"), ReadOnly }, - { LFUN_CANCEL, "cancel", N_("Cancel"), NoBuffer }, - { LFUN_LEFT, "char-backward", N_("Go one char back"), ReadOnly }, - { LFUN_RIGHT, "char-forward", N_("Go one char forward"), ReadOnly }, - { LFUN_INSERT_CITATION, "citation-insert", - N_("Insert citation"), Noop }, - { LFUN_EXEC_COMMAND, "command-execute", "", NoBuffer }, - { LFUN_PREFIX, "command-prefix", - N_("Execute command"), NoBuffer }, - { LFUN_SEQUENCE, "command-sequence", "", Noop }, - { LFUN_COPY, "copy", N_("Copy"), ReadOnly }, - { LFUN_CUT, "cut", N_("Cut"), Noop }, - { LFUN_BACKSPACE, "delete-backward", "", Noop }, - { LFUN_BACKSPACE_SKIP, "delete-backward-skip", "", Noop }, - { LFUN_DELETE, "delete-forward", "", Noop }, - { LFUN_DELETE_SKIP, "delete-forward-skip", "", Noop }, - { LFUN_DEPTH_MIN, "depth-decrement", - N_("Decrement environment depth"), Noop }, - { LFUN_DEPTH_PLUS, "depth-increment", - N_("Increment environment depth"), Noop }, - { LFUN_DEPTH, "depth-next", - N_("Change environment depth"), Noop }, - { LFUN_LDOTS, "dots-insert", N_("Insert ... dots"), Noop }, - { LFUN_DOWN, "down", N_("Go down"), ReadOnly }, - { LFUN_DOWNSEL, "down-select", - N_("Select next line"), ReadOnly }, - { LFUN_DROP_LAYOUTS_CHOICE, "drop-layouts-choice", - N_("Choose Paragraph Environment"), ReadOnly }, - { LFUN_END_OF_SENTENCE, "end-of-sentence-period-insert", - N_("Insert end of sentence period"), Noop }, - { LFUN_GOTOERROR, "error-next", N_("Go to next error"), Noop }, - { LFUN_REMOVEERRORS, "error-remove-all", - N_("Remove all error boxes"), ReadOnly }, - { LFUN_FIGURE, "figure-insert", N_("Insert Figure"), Noop }, - { LFUN_FILE_INSERT, "file-insert", "", Noop }, - { LFUN_FILE_INSERT_ASCII, "file-insert-ascii", "", Noop }, - { LFUN_FILE_NEW, "file-new", "", NoBuffer }, - { LFUN_FILE_OPEN, "file-open", "", NoBuffer }, - { LFUN_MENUSEARCH, "find-replace", N_("Find & Replace") , Noop }, - { LFUN_BOLD, "font-bold", N_("Toggle bold"), Noop }, - { LFUN_CODE, "font-code", N_("Toggle code style"), Noop }, - { LFUN_DEFAULT, "font-default", N_("Default font style"), Noop }, - { LFUN_EMPH, "font-emph", N_("Toggle emphasize"), Noop }, - { LFUN_FREE, "font-free", N_("Toggle user defined style"), Noop }, - { LFUN_NOUN, "font-noun", N_("Toggle noun style"), Noop }, - { LFUN_ROMAN, "font-roman", N_("Toggle roman font style"), Noop }, - { LFUN_SANS, "font-sans", N_("Toggle sans font style"), Noop }, - { LFUN_FONT_SIZE, "font-size", N_("Set font size"), Noop }, - { LFUN_FONT_STATE, "font-state", N_("Show font state"), ReadOnly }, - { LFUN_UNDERLINE, "font-underline", - N_("Toggle font underline"), Noop }, - { LFUN_FOOTMELT, "footnote-insert", N_("Insert Footnote"), Noop }, - { LFUN_RIGHTSEL, "forward-select", N_("Select next char"), ReadOnly }, - { LFUN_HFILL, "hfill-insert", - N_("Insert horizontal fill"), Noop }, - { LFUN_HTMLURL, "html-insert", "", Noop }, - { LFUN_HYPHENATION, "hyphenation-point-insert", - N_("Insert hyphenation point"), Noop }, - { LFUN_INDEX_INSERT, "index-insert", - N_("Insert index item"), Noop }, - { LFUN_INDEX_INSERT_LAST, "index-insert-last", - N_("Insert last index item"), Noop }, - { LFUN_INDEX_PRINT, "index-print", N_("Insert index list"), Noop }, - { LFUN_KMAP_OFF, "keymap-off", N_("Turn off keymap"), ReadOnly }, - { LFUN_KMAP_PRIM, "keymap-primary", - N_("Use primary keymap"), ReadOnly }, - { LFUN_KMAP_SEC, "keymap-secondary", - N_("Use secondary keymap"), ReadOnly }, - { LFUN_KMAP_TOGGLE, "keymap-toggle", N_("Toggle keymap"), ReadOnly }, - { LFUN_INSERT_LABEL, "label-insert", N_("Insert Label"), Noop }, - { LFUN_LATEX_LOG, "latex-view-log", N_("View LaTeX log"), ReadOnly }, - { LFUN_LAYOUT, "layout", "", Noop }, - { LFUN_LAYOUT_CHARACTER, "layout-character", "", Noop }, - { LFUN_LAYOUT_COPY, "layout-copy", - N_("Copy paragraph environment type"), Noop }, - { LFUN_LAYOUT_DOCUMENT, "layout-document", "", ReadOnly }, - { LFUN_LAYOUTNO, "layout-number", "", Noop }, // internal only - { LFUN_LAYOUT_PARAGRAPH, "layout-paragraph", "", ReadOnly }, - { LFUN_LAYOUT_PAPER, "layout-paper", "", ReadOnly }, - { LFUN_LAYOUT_PASTE, "layout-paste", - N_("Paste paragraph environment type"), Noop }, - { LFUN_LAYOUT_PREAMBLE, "layout-preamble", "", ReadOnly }, - { LFUN_LAYOUT_QUOTES, "layout-quotes", "", ReadOnly }, - { LFUN_LAYOUT_SAVE_DEFAULT, "layout-save-default", "", ReadOnly }, - { LFUN_LAYOUT_TABLE, "layout-table", "", Noop }, - { LFUN_HOME, "line-begin", - N_("Go to beginning of line"), ReadOnly }, - { LFUN_HOMESEL, "line-begin-select", - N_("Select to beginning of line"), ReadOnly }, - { LFUN_DELETE_LINE_FORWARD, "line-delete-forward", "", Noop }, - { LFUN_END, "line-end", N_("Go to end of line"), ReadOnly }, - { LFUN_ENDSEL, "line-end-select", - N_("Select to end of line"), ReadOnly }, - { LFUN_LOA_INSERT, "loa-insert", - N_("Insert list of algorithms"), Noop }, - { LFUN_LOF_INSERT, "lof-insert", - N_("Insert list of figures"), Noop }, - { LFUN_LOT_INSERT, "lot-insert", - N_("Insert list of tables"), Noop }, - { LFUN_QUIT, "lyx-quit", N_("Exit"), NoBuffer }, - { LFUN_MARGINMELT, "marginpar-insert", - N_("Insert Margin note"), Noop }, - { LFUN_MARK_OFF, "mark-off", "", ReadOnly }, - { LFUN_MARK_ON, "mark-on", "", ReadOnly }, - { LFUN_SETMARK, "mark-toggle", "", ReadOnly }, - { LFUN_MATH_DELIM, "math-delim", "", Noop }, - { LFUN_MATH_DISPLAY, "math-display", "", Noop }, - { LFUN_GREEK, "math-greek", N_("Math Greek"), Noop }, - { LFUN_GREEK_TOGGLE, "math-greek-toggle", "", Noop }, - { LFUN_INSERT_MATH, "math-insert", - N_("Insert math symbol"), Noop }, - { LFUN_MATH_LIMITS, "math-limits", "", Noop }, - { LFUN_MATH_MACRO, "math-macro", "", Noop }, - { LFUN_MATH_MACROARG, "math-macro-arg", "", Noop }, - { LFUN_INSERT_MATRIX, "math-matrix", "", Noop }, - { LFUN_MATH_MODE, "math-mode", N_("Math mode"), Noop }, - { LFUN_MATH_NONUMBER, "math-nonumber", "", Noop }, - { LFUN_MATH_NUMBER, "math-number", "", Noop }, - { LFUN_MATH_SIZE, "math-size", "", Noop }, - { LFUN_MELT, "melt", N_("Melt"), Noop }, - { LFUN_MENU_OPEN_BY_NAME, "menu-open", "", NoBuffer }, - { LFUN_MENU_SEPARATOR, "menu-separator-insert", "", Noop }, - { LFUN_META_FAKE, "meta-prefix", "", NoBuffer }, - { LFUN_INSERT_NOTE, "note-insert", "", Noop }, - { LFUN_GOTONOTE, "note-next", "", ReadOnly }, - { LFUN_OPENSTUFF, "open-stuff", "", ReadOnly }, - { LFUN_DOWN_PARAGRAPH, "paragraph-down", - N_("Go one paragraph down"), ReadOnly }, - { LFUN_DOWN_PARAGRAPHSEL, "paragraph-down-select", - N_("Select next paragraph"), ReadOnly }, - { LFUN_UP_PARAGRAPH, "paragraph-up", - N_("Go one paragraph up"), ReadOnly }, - { LFUN_UP_PARAGRAPHSEL, "paragraph-up-select", - N_("Select previous paragraph"), ReadOnly }, - { LFUN_PARENTINSERT, "parent-insert", "", Noop }, - { LFUN_PASTE, "paste", N_("Paste") , Noop }, - { LFUN_SAVEPREFERENCES, "preferences-save", - "Save Preferences", NoBuffer }, - { LFUN_PASTESELECTION, "primary-selection-paste", "", Noop }, - { LFUN_PROTECTEDSPACE, "protected-space-insert", - N_("Insert protected space"), Noop }, - { LFUN_QUOTE, "quote-insert", N_("Insert quote"), Noop }, - { LFUN_RECONFIGURE, "reconfigure", - N_("Reconfigure"), NoBuffer }, - { LFUN_REDO, "redo", N_("Redo"), Noop }, - { LFUN_REFBACK, "reference-back", "", ReadOnly }, - { LFUN_REFGOTO, "reference-goto", "", ReadOnly }, - { LFUN_INSERT_REF, "reference-insert", - N_("Insert cross reference"), Noop }, - { LFUN_REFTOGGLE, "reference-toggle", "", Noop }, - { LFUN_NEXT, "screen-down", "", ReadOnly }, - { LFUN_NEXTSEL, "screen-down-select", "", ReadOnly }, - { LFUN_CENTER, "screen-recenter", "", ReadOnly }, - { LFUN_PRIOR, "screen-up", "", ReadOnly }, - { LFUN_PRIORSEL, "screen-up-select", "", ReadOnly }, - { LFUN_SELFINSERT, "self-insert", "", Noop }, - { LFUN_CHARATCURSOR, "server-char-after", "", ReadOnly }, - { LFUN_GETFONT, "server-get-font", "", ReadOnly }, - { LFUN_GETLATEX, "server-get-latex", "", ReadOnly }, - { LFUN_GETLAYOUT, "server-get-layout", "", ReadOnly }, - { LFUN_GETNAME, "server-get-name", "", ReadOnly }, - { LFUN_GETTIP, "server-get-tip", "", ReadOnly }, - { LFUN_GETXY, "server-get-xy", "", ReadOnly }, - { LFUN_GOTOFILEROW, "server-goto-file-row", "", Noop }, - { LFUN_NOTIFY, "server-notify", "", ReadOnly }, - { LFUN_SETXY, "server-set-xy", "", ReadOnly }, - { LFUN_SPELLCHECK, "spellchecker", "", Noop }, - { LFUN_INSERT_MATH, "symbol-insert", "", Noop }, - { LFUN_TAB, "tab-forward", "", Noop }, - { LFUN_TABINSERT, "tab-insert", "", Noop }, - { LFUN_TABLE, "table-insert", N_("Insert Table"), Noop }, - { LFUN_TEX, "tex-mode", N_("Toggle TeX style"), Noop }, - { LFUN_TOC_INSERT, "toc-insert", - N_("Insert table of contents"), Noop }, - { LFUN_TOCVIEW, "toc-view", - N_("View table of contents"), ReadOnly }, - { LFUN_TOGGLECURSORFOLLOW, "toggle-cursor-follows-scrollbar", - N_("Toggle cursor does/doesn't follow the scrollbar"), - ReadOnly }, - { LFUN_ADD_TO_TOOLBAR, "toolbar-add-to", "", NoBuffer }, - { LFUN_PUSH_TOOLBAR, "toolbar-push", "", NoBuffer }, - { LFUN_UNDO, "undo", N_("Undo"), Noop }, - { LFUN_UP, "up", "", ReadOnly }, - { LFUN_UPSEL, "up-select", "", ReadOnly }, - { LFUN_URL, "url-insert", "", Noop }, - { LFUN_VC_CHECKIN, "vc-check-in", "", ReadOnly }, - { LFUN_VC_CHECKOUT, "vc-check-out", "", ReadOnly }, - { LFUN_VC_HISTORY, "vc-history", "", ReadOnly }, - { LFUN_VC_REGISTER, "vc-register", - N_("Register document under version control"), ReadOnly }, - { LFUN_VC_REVERT, "vc-revert", "", ReadOnly }, - { LFUN_VC_UNDO, "vc-undo-last", "", ReadOnly }, - { LFUN_WORDLEFT, "word-backward", "", ReadOnly }, - { LFUN_WORDLEFTSEL, "word-backward-select", "", ReadOnly }, - { LFUN_CAPITALIZE_WORD, "word-capitalize", "", Noop }, - { LFUN_DELETE_WORD_BACKWARD, "word-delete-backward", - "", Noop }, - { LFUN_DELETE_WORD_FORWARD, "word-delete-forward", "", Noop }, - { LFUN_WORDFINDBACKWARD, "word-find-backward", "", ReadOnly }, - { LFUN_WORDFINDFORWARD, "word-find-forward", "", ReadOnly }, - { LFUN_WORDRIGHT, "word-forward", "", ReadOnly }, - { LFUN_WORDRIGHTSEL, "word-forward-select", "", ReadOnly }, - { LFUN_LOWCASE_WORD, "word-lowcase", "", Noop }, - { LFUN_UPCASE_WORD, "word-upcase", "", Noop }, - { LFUN_NOACTION, "", "", Noop } + { LFUN_ACUTE, "accent-acute", "", Noop }, + { LFUN_BREVE, "accent-breve", "", Noop }, + { LFUN_CARON, "accent-caron", "", Noop }, + { LFUN_CEDILLA, "accent-cedilla", "", Noop }, + { LFUN_CIRCLE, "accent-circle", "", Noop }, + { LFUN_CIRCUMFLEX, "accent-circumflex", "", Noop }, + { LFUN_DOT, "accent-dot", "", Noop }, + { LFUN_GRAVE, "accent-grave", "", Noop }, + { LFUN_HUNG_UMLAUT, "accent-hungarian-umlaut", "", Noop }, + { LFUN_MACRON, "accent-macron", "", Noop }, + { LFUN_OGONEK, "accent-ogonek", "", Noop }, + { LFUN_SPECIAL_CARON, "accent-special-caron", "", Noop }, + { LFUN_TIE, "accent-tie", "", Noop }, + { LFUN_TILDE, "accent-tilde", "", Noop }, + { LFUN_UMLAUT, "accent-umlaut", "", Noop }, + { LFUN_UNDERBAR, "accent-underbar", "", Noop }, + { LFUN_UNDERDOT, "accent-underdot", "", Noop }, + { LFUN_VECTOR, "accent-vector", "", Noop }, + { LFUN_APPENDIX, "appendix", N_("Insert appendix"), Noop }, + { LFUN_APROPOS, "apropos", N_("Describe command"), + NoBuffer|ReadOnly }, + { LFUN_LEFTSEL, "backward-select", + N_("Select previous char"), ReadOnly }, + { LFUN_BIBDB_ADD, "bibtex-database-add", "", Noop }, + { LFUN_BIBDB_DEL, "bibtex-database-del", "", Noop }, + { LFUN_INSERT_BIBTEX, "bibtex-insert", N_("Insert bibtex"), + Noop }, + { LFUN_BIBTEX_STYLE, "bibtex-style", "", Noop }, + { LFUN_BREAKLINE, "break-line", "", Noop }, + { LFUN_BREAKPARAGRAPH, "break-paragraph", "", Noop }, + { LFUN_BREAKPARAGRAPHKEEPLAYOUT, "break-paragraph-keep-layout", + "", Noop }, + { LFUN_BREAKPARAGRAPH_SKIP, "break-paragraph-skip", "", Noop }, + { LFUN_BUILDPROG, "build-program", _("Build program"), Noop }, + { LFUN_AUTOSAVE, "buffer-auto-save", N_("Autosave"), Noop }, + { LFUN_BEGINNINGBUF, "buffer-begin", + N_("Go to beginning of document"), ReadOnly }, + { LFUN_BEGINNINGBUFSEL, "buffer-begin-select", + N_("Select to beginning of document"), ReadOnly }, + { LFUN_CHILDINSERT, "buffer-child-insert", "", Noop }, + { LFUN_CHILDOPEN, "buffer-child-open", "", ReadOnly }, + { LFUN_RUNCHKTEX, "buffer-chktex", N_("Check TeX"), ReadOnly }, + { LFUN_CLOSEBUFFER, "buffer-close", N_("Close"), ReadOnly }, + { LFUN_ENDBUF, "buffer-end", + N_("Go to end of document"), ReadOnly }, + { LFUN_ENDBUFSEL, "buffer-end-select", + N_("Select to end of document"), ReadOnly }, + { LFUN_EXPORT, "buffer-export", N_("Export to"), ReadOnly }, + { LFUN_FAX, "buffer-fax", N_("Fax"), ReadOnly }, + { LFUN_INSERTFOOTNOTE, "buffer-float-insert", "", Noop }, + { LFUN_IMPORT, "buffer-import", + N_("Import document"), NoBuffer }, + { LFUN_BUFFERBULLETSSELECT, "buffer-itemize-bullets-select", + "", Noop }, + { LFUN_MENUNEW, "buffer-new", N_("New document") , NoBuffer }, + { LFUN_MENUNEWTMPLT,"buffer-new-template", + N_("New document from template"), NoBuffer }, + { LFUN_MENUOPEN, "buffer-open", N_("Open"), NoBuffer }, + { LFUN_PREVBUFFER, "buffer-previous", + N_("Switch to previous document"), ReadOnly }, + { LFUN_MENUPRINT, "buffer-print", N_("Print"), ReadOnly }, + { LFUN_MENURELOAD, "buffer-reload", + N_("Revert to saved"), ReadOnly }, + { LFUN_READ_ONLY_TOGGLE, "buffer-toggle-read-only", + N_("Toggle read-only"), ReadOnly }, + { LFUN_RUNLATEX, "buffer-typeset", N_("Update DVI"), + ReadOnly }, + { LFUN_RUNDVIPS, "buffer-typeset-ps", + N_("Update PostScript"), ReadOnly }, + { LFUN_PREVIEW, "buffer-view", N_("View DVI") , ReadOnly }, + { LFUN_PREVIEWPS, "buffer-view-ps", + N_("View PostScript") , ReadOnly }, + { LFUN_MENUWRITE, "buffer-write", N_("Save"), ReadOnly }, + { LFUN_MENUWRITEAS, "buffer-write-as", N_("Save As"), + ReadOnly }, + { LFUN_CANCEL, "cancel", N_("Cancel"), NoBuffer }, + { LFUN_LEFT, "char-backward", N_("Go one char back"), + ReadOnly }, + { LFUN_RIGHT, "char-forward", N_("Go one char forward"), + ReadOnly }, + { LFUN_INSERT_CITATION, "citation-insert", + N_("Insert citation"), Noop }, + { LFUN_EXEC_COMMAND, "command-execute", "", NoBuffer }, + { LFUN_PREFIX, "command-prefix", + N_("Execute command"), NoBuffer }, + { LFUN_SEQUENCE, "command-sequence", "", Noop }, + { LFUN_COPY, "copy", N_("Copy"), ReadOnly }, + { LFUN_CUT, "cut", N_("Cut"), Noop }, + { LFUN_BACKSPACE, "delete-backward", "", Noop }, + { LFUN_BACKSPACE_SKIP, "delete-backward-skip", "", Noop }, + { LFUN_DELETE, "delete-forward", "", Noop }, + { LFUN_DELETE_SKIP, "delete-forward-skip", "", Noop }, + { LFUN_DEPTH_MIN, "depth-decrement", + N_("Decrement environment depth"), Noop }, + { LFUN_DEPTH_PLUS, "depth-increment", + N_("Increment environment depth"), Noop }, + { LFUN_DEPTH, "depth-next", + N_("Change environment depth"), Noop }, + { LFUN_LDOTS, "dots-insert", N_("Insert ... dots"), Noop }, + { LFUN_DOWN, "down", N_("Go down"), ReadOnly }, + { LFUN_DOWNSEL, "down-select", + N_("Select next line"), ReadOnly }, + { LFUN_DROP_LAYOUTS_CHOICE, "drop-layouts-choice", + N_("Choose Paragraph Environment"), ReadOnly }, + { LFUN_END_OF_SENTENCE, "end-of-sentence-period-insert", + N_("Insert end of sentence period"), Noop }, + { LFUN_GOTOERROR, "error-next", N_("Go to next error"), Noop }, + { LFUN_REMOVEERRORS, "error-remove-all", + N_("Remove all error boxes"), ReadOnly }, + { LFUN_FIGURE, "figure-insert", N_("Insert Figure"), Noop }, + { LFUN_FILE_INSERT, "file-insert", "", Noop }, + { LFUN_FILE_INSERT_ASCII, "file-insert-ascii", "", Noop }, + { LFUN_FILE_NEW, "file-new", "", NoBuffer }, + { LFUN_FILE_OPEN, "file-open", "", NoBuffer }, + { LFUN_MENUSEARCH, "find-replace", N_("Find & Replace"), + Noop }, + { LFUN_BOLD, "font-bold", N_("Toggle bold"), Noop }, + { LFUN_CODE, "font-code", N_("Toggle code style"), Noop }, + { LFUN_DEFAULT, "font-default", N_("Default font style"), + Noop }, + { LFUN_EMPH, "font-emph", N_("Toggle emphasize"), Noop }, + { LFUN_FREE, "font-free", N_("Toggle user defined style"), + Noop }, + { LFUN_NOUN, "font-noun", N_("Toggle noun style"), Noop }, + { LFUN_ROMAN, "font-roman", N_("Toggle roman font style"), + Noop }, + { LFUN_SANS, "font-sans", N_("Toggle sans font style"), Noop }, + { LFUN_FONT_SIZE, "font-size", N_("Set font size"), Noop }, + { LFUN_FONT_STATE, "font-state", N_("Show font state"), + ReadOnly }, + { LFUN_UNDERLINE, "font-underline", + N_("Toggle font underline"), Noop }, + { LFUN_FOOTMELT, "footnote-insert", N_("Insert Footnote"), + Noop }, + { LFUN_RIGHTSEL, "forward-select", N_("Select next char"), + ReadOnly }, + { LFUN_HFILL, "hfill-insert", + N_("Insert horizontal fill"), Noop }, + { LFUN_HTMLURL, "html-insert", "", Noop }, + { LFUN_HYPHENATION, "hyphenation-point-insert", + N_("Insert hyphenation point"), Noop }, + { LFUN_INDEX_INSERT, "index-insert", + N_("Insert index item"), Noop }, + { LFUN_INDEX_INSERT_LAST, "index-insert-last", + N_("Insert last index item"), Noop }, + { LFUN_INDEX_PRINT, "index-print", N_("Insert index list"), + Noop }, + { LFUN_KMAP_OFF, "keymap-off", N_("Turn off keymap"), + ReadOnly }, + { LFUN_KMAP_PRIM, "keymap-primary", + N_("Use primary keymap"), ReadOnly }, + { LFUN_KMAP_SEC, "keymap-secondary", + N_("Use secondary keymap"), ReadOnly }, + { LFUN_KMAP_TOGGLE, "keymap-toggle", N_("Toggle keymap"), + ReadOnly }, + { LFUN_INSERT_LABEL, "label-insert", N_("Insert Label"), + Noop }, + { LFUN_LATEX_LOG, "latex-view-log", N_("View LaTeX log"), + ReadOnly }, + { LFUN_LAYOUT, "layout", "", Noop }, + { LFUN_LAYOUT_CHARACTER, "layout-character", "", Noop }, + { LFUN_LAYOUT_COPY, "layout-copy", + N_("Copy paragraph environment type"), Noop }, + { LFUN_LAYOUT_DOCUMENT, "layout-document", "", ReadOnly }, + { LFUN_LAYOUTNO, "layout-number", "", Noop }, // internal only + { LFUN_LAYOUT_PARAGRAPH, "layout-paragraph", "", ReadOnly }, + { LFUN_LAYOUT_PAPER, "layout-paper", "", ReadOnly }, + { LFUN_LAYOUT_PASTE, "layout-paste", + N_("Paste paragraph environment type"), Noop }, + { LFUN_LAYOUT_PREAMBLE, "layout-preamble", "", ReadOnly }, + { LFUN_LAYOUT_QUOTES, "layout-quotes", "", ReadOnly }, + { LFUN_LAYOUT_SAVE_DEFAULT, "layout-save-default", "", + ReadOnly }, + { LFUN_LAYOUT_TABLE, "layout-table", "", Noop }, + { LFUN_HOME, "line-begin", + N_("Go to beginning of line"), ReadOnly }, + { LFUN_HOMESEL, "line-begin-select", + N_("Select to beginning of line"), ReadOnly }, + { LFUN_DELETE_LINE_FORWARD, "line-delete-forward", "", Noop }, + { LFUN_END, "line-end", N_("Go to end of line"), ReadOnly }, + { LFUN_ENDSEL, "line-end-select", + N_("Select to end of line"), ReadOnly }, + { LFUN_LOA_INSERT, "loa-insert", + N_("Insert list of algorithms"), Noop }, + { LFUN_LOF_INSERT, "lof-insert", + N_("Insert list of figures"), Noop }, + { LFUN_LOT_INSERT, "lot-insert", + N_("Insert list of tables"), Noop }, + { LFUN_QUIT, "lyx-quit", N_("Exit"), NoBuffer }, + { LFUN_MARGINMELT, "marginpar-insert", + N_("Insert Margin note"), Noop }, + { LFUN_MARK_OFF, "mark-off", "", ReadOnly }, + { LFUN_MARK_ON, "mark-on", "", ReadOnly }, + { LFUN_SETMARK, "mark-toggle", "", ReadOnly }, + { LFUN_MATH_DELIM, "math-delim", "", Noop }, + { LFUN_MATH_DISPLAY, "math-display", "", Noop }, + { LFUN_GREEK, "math-greek", N_("Math Greek"), Noop }, + { LFUN_GREEK_TOGGLE, "math-greek-toggle", "", Noop }, + { LFUN_INSERT_MATH, "math-insert", + N_("Insert math symbol"), Noop }, + { LFUN_MATH_LIMITS, "math-limits", "", Noop }, + { LFUN_MATH_MACRO, "math-macro", "", Noop }, + { LFUN_MATH_MACROARG, "math-macro-arg", "", Noop }, + { LFUN_INSERT_MATRIX, "math-matrix", "", Noop }, + { LFUN_MATH_MODE, "math-mode", N_("Math mode"), Noop }, + { LFUN_MATH_NONUMBER, "math-nonumber", "", Noop }, + { LFUN_MATH_NUMBER, "math-number", "", Noop }, + { LFUN_MATH_SIZE, "math-size", "", Noop }, + { LFUN_MELT, "melt", N_("Melt"), Noop }, + { LFUN_MENU_OPEN_BY_NAME, "menu-open", "", NoBuffer }, + { LFUN_MENU_SEPARATOR, "menu-separator-insert", "", Noop }, + { LFUN_META_FAKE, "meta-prefix", "", NoBuffer }, + { LFUN_INSERT_NOTE, "note-insert", "", Noop }, + { LFUN_GOTONOTE, "note-next", "", ReadOnly }, + { LFUN_OPENSTUFF, "open-stuff", "", ReadOnly }, + { LFUN_DOWN_PARAGRAPH, "paragraph-down", + N_("Go one paragraph down"), ReadOnly }, + { LFUN_DOWN_PARAGRAPHSEL, "paragraph-down-select", + N_("Select next paragraph"), ReadOnly }, + { LFUN_UP_PARAGRAPH, "paragraph-up", + N_("Go one paragraph up"), ReadOnly }, + { LFUN_UP_PARAGRAPHSEL, "paragraph-up-select", + N_("Select previous paragraph"), ReadOnly }, + { LFUN_PARENTINSERT, "parent-insert", "", Noop }, + { LFUN_PASTE, "paste", N_("Paste") , Noop }, + { LFUN_SAVEPREFERENCES, "preferences-save", + "Save Preferences", NoBuffer }, + { LFUN_PASTESELECTION, "primary-selection-paste", "", Noop }, + { LFUN_PROTECTEDSPACE, "protected-space-insert", + N_("Insert protected space"), Noop }, + { LFUN_QUOTE, "quote-insert", N_("Insert quote"), Noop }, + { LFUN_RECONFIGURE, "reconfigure", + N_("Reconfigure"), NoBuffer }, + { LFUN_REDO, "redo", N_("Redo"), Noop }, + { LFUN_REFBACK, "reference-back", "", ReadOnly }, + { LFUN_REFGOTO, "reference-goto", "", ReadOnly }, + { LFUN_INSERT_REF, "reference-insert", + N_("Insert cross reference"), Noop }, + { LFUN_REFTOGGLE, "reference-toggle", "", Noop }, + { LFUN_NEXT, "screen-down", "", ReadOnly }, + { LFUN_NEXTSEL, "screen-down-select", "", ReadOnly }, + { LFUN_CENTER, "screen-recenter", "", ReadOnly }, + { LFUN_PRIOR, "screen-up", "", ReadOnly }, + { LFUN_PRIORSEL, "screen-up-select", "", ReadOnly }, + { LFUN_SELFINSERT, "self-insert", "", Noop }, + { LFUN_CHARATCURSOR, "server-char-after", "", ReadOnly }, + { LFUN_GETFONT, "server-get-font", "", ReadOnly }, + { LFUN_GETLATEX, "server-get-latex", "", ReadOnly }, + { LFUN_GETLAYOUT, "server-get-layout", "", ReadOnly }, + { LFUN_GETNAME, "server-get-name", "", ReadOnly }, + { LFUN_GETTIP, "server-get-tip", "", ReadOnly }, + { LFUN_GETXY, "server-get-xy", "", ReadOnly }, + { LFUN_GOTOFILEROW, "server-goto-file-row", "", Noop }, + { LFUN_NOTIFY, "server-notify", "", ReadOnly }, + { LFUN_SETXY, "server-set-xy", "", ReadOnly }, + { LFUN_SPELLCHECK, "spellchecker", "", Noop }, + { LFUN_INSERT_MATH, "symbol-insert", "", Noop }, + { LFUN_TAB, "tab-forward", "", Noop }, + { LFUN_TABINSERT, "tab-insert", "", Noop }, + { LFUN_TABLE, "table-insert", N_("Insert Table"), Noop }, + { LFUN_TEX, "tex-mode", N_("Toggle TeX style"), Noop }, + { LFUN_TOC_INSERT, "toc-insert", + N_("Insert table of contents"), Noop }, + { LFUN_TOCVIEW, "toc-view", + N_("View table of contents"), ReadOnly }, + { LFUN_TOGGLECURSORFOLLOW, "toggle-cursor-follows-scrollbar", + N_("Toggle cursor does/doesn't follow the scrollbar"), + ReadOnly }, + { LFUN_ADD_TO_TOOLBAR, "toolbar-add-to", "", NoBuffer }, + { LFUN_PUSH_TOOLBAR, "toolbar-push", "", NoBuffer }, + { LFUN_UNDO, "undo", N_("Undo"), Noop }, + { LFUN_UP, "up", "", ReadOnly }, + { LFUN_UPSEL, "up-select", "", ReadOnly }, + { LFUN_URL, "url-insert", "", Noop }, + { LFUN_VC_CHECKIN, "vc-check-in", "", ReadOnly }, + { LFUN_VC_CHECKOUT, "vc-check-out", "", ReadOnly }, + { LFUN_VC_HISTORY, "vc-history", "", ReadOnly }, + { LFUN_VC_REGISTER, "vc-register", + N_("Register document under version control"), ReadOnly }, + { LFUN_VC_REVERT, "vc-revert", "", ReadOnly }, + { LFUN_VC_UNDO, "vc-undo-last", "", ReadOnly }, + { LFUN_WORDLEFT, "word-backward", "", ReadOnly }, + { LFUN_WORDLEFTSEL, "word-backward-select", "", ReadOnly }, + { LFUN_CAPITALIZE_WORD, "word-capitalize", "", Noop }, + { LFUN_DELETE_WORD_BACKWARD, "word-delete-backward", + "", Noop }, + { LFUN_DELETE_WORD_FORWARD, "word-delete-forward", "", Noop }, + { LFUN_WORDFINDBACKWARD, "word-find-backward", "", ReadOnly }, + { LFUN_WORDFINDFORWARD, "word-find-forward", "", ReadOnly }, + { LFUN_WORDRIGHT, "word-forward", "", ReadOnly }, + { LFUN_WORDRIGHTSEL, "word-forward-select", "", ReadOnly }, + { LFUN_LOWCASE_WORD, "word-lowcase", "", Noop }, + { LFUN_UPCASE_WORD, "word-upcase", "", Noop }, + { LFUN_NOACTION, "", "", Noop } }; int i = 0; @@ -376,7 +395,8 @@ int LyXAction::searchActionArg(kb_action action, string const & arg) const if (pit == lyx_arg_map.end()) { // the action does not have any pseudoactions lyxerr[Debug::ACTION] << "Action " << action - << " does not have any pseudo actions.\n"; + << " does not have any pseudo actions." + << endl; return LFUN_UNKNOWN_ACTION; } @@ -387,14 +407,14 @@ int LyXAction::searchActionArg(kb_action action, string const & arg) const lyxerr[Debug::ACTION] << "Action " << action << "does not have any pseudoactions with arg " - << arg << '\n'; + << arg << endl; return LFUN_UNKNOWN_ACTION; } // pseudo action exist lyxerr[Debug::ACTION] << "Pseudoaction exist[" - << action << '|' - << arg << "] = " << (*aci).second << '\n'; + << action << '|' + << arg << "] = " << (*aci).second << endl; return (*aci).second; } @@ -423,8 +443,8 @@ int LyXAction::getPseudoAction(kb_action action, string const & arg) const (*ami).second[arg] = pseudo_counter; lyxerr[Debug::ACTION] << "Creating new pseudoaction " - << pseudo_counter << " for [" << action - << '|' << arg << "]\n"; + << pseudo_counter << " for [" << action + << '|' << arg << "]\n"; return pseudo_counter; } @@ -438,8 +458,8 @@ kb_action LyXAction::retrieveActionArg(int pseudo, string & arg) const if (pit != lyx_pseudo_map.end()) { lyxerr[Debug::ACTION] << "Found the pseudoaction: [" - << (*pit).second.action << '|' - << (*pit).second.arg << '\n'; + << (*pit).second.action << '|' + << (*pit).second.arg << '\n'; arg = (*pit).second.arg; return (*pit).second.action; } else { @@ -509,17 +529,18 @@ int LyXAction::getApproxFunc(string const & func) const string LyXAction::getApproxFuncName(string const & func) const { - int f = getApproxFunc(func); - // This will return empty string if f isn't an action. - return getActionName(f); + int f = getApproxFunc(func); + // This will return empty string if f isn't an action. + return getActionName(f); } string LyXAction::getActionName(int action) const { - info_map::const_iterator iit = lyx_info_map.find(static_cast(action)); + info_map::const_iterator iit = + lyx_info_map.find(static_cast(action)); - return iit != lyx_info_map.end() ? (*iit).second.name : string(); + return iit != lyx_info_map.end() ? (*iit).second.name : string(); } @@ -565,15 +586,15 @@ string LyXAction::helpText(int pseudoaction) const bool LyXAction::funcHasFlag(kb_action action, LyXAction::func_attrib flag) const { - info_map::const_iterator ici = lyx_info_map.find(action); - - if (ici != lyx_info_map.end()) { - return (*ici).second.attrib & flag; - } else { - // it really should exist, but... - lyxerr << "No info about kb_action: " << action << '\n'; - return false; - } + info_map::const_iterator ici = lyx_info_map.find(action); + + if (ici != lyx_info_map.end()) { + return (*ici).second.attrib & flag; + } else { + // it really should exist, but... + lyxerr << "No info about kb_action: " << action << '\n'; + return false; + } } diff --git a/src/LyXView.C b/src/LyXView.C index 04d99bcc58..1c94b4c2f3 100644 --- a/src/LyXView.C +++ b/src/LyXView.C @@ -33,10 +33,10 @@ extern FD_form_document * fd_form_document; FD_form_main * fd_form_main; /* a pointer to the one in LyXView - should be removed as soon as possible */ + should be removed as soon as possible */ MiniBuffer * minibuffer;/* a pointer to the one in LyXView - should be removed as soon as possible */ + should be removed as soon as possible */ extern void AutoSave(); extern char updatetimer; @@ -68,6 +68,7 @@ LyXView::~LyXView() delete intl; } + /// Redraw the main form. void LyXView::redraw() { lyxerr[Debug::INFO] << "LyXView::redraw()" << endl; @@ -86,23 +87,21 @@ void LyXView::UpdateTimerCB(FL_OBJECT * ob, long) return; view->view()->getScreen()->HideCursor(); -#ifdef MOVE_TEXT view->view()->update(-2); -#else - view->buffer()->update(-2); -#endif + /* This update can happen, even when the work area has lost * the focus. So suppress the cursor in that case */ updatetimer = 0; } + // Wrapper for the above -extern "C" void C_LyXView_UpdateTimerCB(FL_OBJECT * ob, long data) { +extern "C" void C_LyXView_UpdateTimerCB(FL_OBJECT * ob, long data) +{ LyXView::UpdateTimerCB(ob, data); } - // Callback for autosave timer void LyXView::AutosaveTimerCB(FL_OBJECT *, long) { @@ -110,8 +109,10 @@ void LyXView::AutosaveTimerCB(FL_OBJECT *, long) AutoSave(); } + // Wrapper for the above -extern "C" void C_LyXView_AutosaveTimerCB(FL_OBJECT * ob, long data) { +extern "C" void C_LyXView_AutosaveTimerCB(FL_OBJECT * ob, long data) +{ LyXView::AutosaveTimerCB(ob, data); } @@ -133,7 +134,8 @@ int LyXView::atCloseMainFormCB(FL_FORM *, void *) // Wrapper for the above -extern "C" int C_LyXView_atCloseMainFormCB(FL_FORM * form, void * p) { +extern "C" int C_LyXView_atCloseMainFormCB(FL_FORM * form, void * p) +{ return LyXView::atCloseMainFormCB(form, p); } @@ -209,10 +211,9 @@ FD_form_main * LyXView::create_form_form_main(int width, int height) // minibuffer = new MiniBuffer(this, air, height-(25+air), - width-(2*air), 25); + width-(2*air), 25); ::minibuffer = minibuffer; // to be removed later - // // TIMERS // @@ -253,6 +254,7 @@ FD_form_main * LyXView::create_form_form_main(int width, int height) return fdui; } + extern "C" int C_LyXView_KeyPressMask_raw_callback(FL_FORM * fl, void * xev); void LyXView::init() @@ -300,7 +302,7 @@ void LyXView::updateLayoutChoice() toolbar->combox->clear(); for (int i = 0; textclasslist.NameOfLayout(buffer()-> - params.textclass, i) != "@@end@@"; + params.textclass, i) != "@@end@@"; i++) { LyXLayout const & layout = textclasslist. Style(buffer()->params.textclass, i); @@ -315,11 +317,7 @@ void LyXView::updateLayoutChoice() // we need to do this. toolbar->combox->Redraw(); -#ifdef MOVE_TEXT char layout = bufferview->text->cursor.par->GetLayout(); -#else - char layout = buffer()->text->cursor.par->GetLayout(); -#endif if (layout != current_layout){ toolbar->combox->select(layout + 1); @@ -331,10 +329,10 @@ void LyXView::updateLayoutChoice() void LyXView::UpdateDocumentClassChoice() { // update the document class display in the document form - int i; if (fd_form_document) { fl_clear_choice(fd_form_document->choice_class); - for (i = 0; textclasslist.DescOfClass (i)!= "@@end@@"; i++) { + for (int i = 0; + textclasslist.DescOfClass(i) != "@@end@@"; ++i) { fl_addto_choice(fd_form_document->choice_class, textclasslist.DescOfClass(i).c_str()); } @@ -344,7 +342,7 @@ void LyXView::UpdateDocumentClassChoice() // This is necessary, since FL_FREE-Objects doesn't get all keypress events // as FL_KEYBOARD events :-( Matthias 280596 -int LyXView::KeyPressMask_raw_callback(FL_FORM *fl, void *xev) +int LyXView::KeyPressMask_raw_callback(FL_FORM * fl, void * xev) { LyXView * view = static_cast(fl->u_vdata); int retval = 0; // 0 means XForms should have a look at this event @@ -360,14 +358,17 @@ int LyXView::KeyPressMask_raw_callback(FL_FORM *fl, void *xev) return retval; } + // wrapper for the above extern "C" int C_LyXView_KeyPressMask_raw_callback(FL_FORM * fl, void * xev) { return LyXView::KeyPressMask_raw_callback(fl, xev); } + // Updates the title of the window with the filename of the current document -void LyXView::updateWindowTitle() { +void LyXView::updateWindowTitle() +{ static string last_title = "LyX"; string title = "LyX"; diff --git a/src/Makefile.am b/src/Makefile.am index 636f672111..58c6fd83a7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -50,7 +50,6 @@ lyx_SOURCES = \ bibforms.h \ bmtable.C \ bmtable.h \ - broken_const.h \ broken_headers.h \ buffer.C \ buffer.h \ diff --git a/src/ParagraphExtra.C b/src/ParagraphExtra.C index 68556bd83c..72c322b393 100644 --- a/src/ParagraphExtra.C +++ b/src/ParagraphExtra.C @@ -73,254 +73,242 @@ inline void EnableParagraphExtra () bool UpdateParagraphExtra() { - bool update = false; - if (current_view->getScreen() && current_view->available()) { - update = true; -#ifdef MOVE_TEXT - LyXParagraph * par = current_view->text->cursor.par; -#else - LyXParagraph * par = current_view->buffer()->text->cursor.par; -#endif + bool update = false; + if (current_view->getScreen() && current_view->available()) { + update = true; + LyXParagraph * par = current_view->text->cursor.par; - EnableParagraphExtra(); + EnableParagraphExtra(); - fl_activate_object(fd_form_paragraph_extra->input_pextra_width); - fl_activate_object(fd_form_paragraph_extra->input_pextra_widthp); - fl_set_input(fd_form_paragraph_extra->input_pextra_width, - par->pextra_width.c_str()); - fl_set_input(fd_form_paragraph_extra->input_pextra_widthp, - par->pextra_widthp.c_str()); - switch(par->pextra_alignment) { - case LyXParagraph::MINIPAGE_ALIGN_TOP: - fl_set_button(fd_form_paragraph_extra->radio_pextra_top, 1); - break; - case LyXParagraph::MINIPAGE_ALIGN_MIDDLE: - fl_set_button(fd_form_paragraph_extra->radio_pextra_middle, 1); - break; - case LyXParagraph::MINIPAGE_ALIGN_BOTTOM: - fl_set_button(fd_form_paragraph_extra->radio_pextra_bottom, 1); - break; - } - fl_set_button(fd_form_paragraph_extra->radio_pextra_hfill, - par->pextra_hfill); - fl_set_button(fd_form_paragraph_extra->radio_pextra_startmp, - par->pextra_start_minipage); - CheckInputWidth(); - if (par->pextra_type == LyXParagraph::PEXTRA_INDENT) { - fl_set_button(fd_form_paragraph_extra->radio_pextra_indent, 1); - fl_set_button(fd_form_paragraph_extra->radio_pextra_minipage, 0); - fl_set_button(fd_form_paragraph_extra->radio_pextra_floatflt, 0); - fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_top); - fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_middle); - fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_bottom); - } else if (par->pextra_type == LyXParagraph::PEXTRA_MINIPAGE) { - fl_set_button(fd_form_paragraph_extra->radio_pextra_indent, 0); - fl_set_button(fd_form_paragraph_extra->radio_pextra_minipage, 1); - fl_set_button(fd_form_paragraph_extra->radio_pextra_floatflt, 0); - fl_activate_object(fd_form_paragraph_extra->radio_pextra_top); - fl_activate_object(fd_form_paragraph_extra->radio_pextra_middle); - fl_activate_object(fd_form_paragraph_extra->radio_pextra_bottom); - } else if (par->pextra_type == LyXParagraph::PEXTRA_FLOATFLT) { - fl_set_button(fd_form_paragraph_extra->radio_pextra_indent, 0); - fl_set_button(fd_form_paragraph_extra->radio_pextra_minipage, 0); - fl_set_button(fd_form_paragraph_extra->radio_pextra_floatflt, 1); - fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_top); - fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_middle); - fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_bottom); - } else { - fl_set_button(fd_form_paragraph_extra->radio_pextra_indent, 0); - fl_set_button(fd_form_paragraph_extra->radio_pextra_minipage, 0); - fl_deactivate_object(fd_form_paragraph_extra->input_pextra_width); - fl_deactivate_object(fd_form_paragraph_extra->input_pextra_widthp); - fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_top); - fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_middle); - fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_bottom); - } - if (par->pextra_type == LyXParagraph::PEXTRA_NONE) - ActivateParagraphExtraButtons(); - } - fl_hide_object(fd_form_paragraph_extra->text_warning); + fl_activate_object(fd_form_paragraph_extra->input_pextra_width); + fl_activate_object(fd_form_paragraph_extra->input_pextra_widthp); + fl_set_input(fd_form_paragraph_extra->input_pextra_width, + par->pextra_width.c_str()); + fl_set_input(fd_form_paragraph_extra->input_pextra_widthp, + par->pextra_widthp.c_str()); + switch(par->pextra_alignment) { + case LyXParagraph::MINIPAGE_ALIGN_TOP: + fl_set_button(fd_form_paragraph_extra->radio_pextra_top, 1); + break; + case LyXParagraph::MINIPAGE_ALIGN_MIDDLE: + fl_set_button(fd_form_paragraph_extra->radio_pextra_middle, 1); + break; + case LyXParagraph::MINIPAGE_ALIGN_BOTTOM: + fl_set_button(fd_form_paragraph_extra->radio_pextra_bottom, 1); + break; + } + fl_set_button(fd_form_paragraph_extra->radio_pextra_hfill, + par->pextra_hfill); + fl_set_button(fd_form_paragraph_extra->radio_pextra_startmp, + par->pextra_start_minipage); + CheckInputWidth(); + if (par->pextra_type == LyXParagraph::PEXTRA_INDENT) { + fl_set_button(fd_form_paragraph_extra->radio_pextra_indent, 1); + fl_set_button(fd_form_paragraph_extra->radio_pextra_minipage, 0); + fl_set_button(fd_form_paragraph_extra->radio_pextra_floatflt, 0); + fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_top); + fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_middle); + fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_bottom); + } else if (par->pextra_type == LyXParagraph::PEXTRA_MINIPAGE) { + fl_set_button(fd_form_paragraph_extra->radio_pextra_indent, 0); + fl_set_button(fd_form_paragraph_extra->radio_pextra_minipage, 1); + fl_set_button(fd_form_paragraph_extra->radio_pextra_floatflt, 0); + fl_activate_object(fd_form_paragraph_extra->radio_pextra_top); + fl_activate_object(fd_form_paragraph_extra->radio_pextra_middle); + fl_activate_object(fd_form_paragraph_extra->radio_pextra_bottom); + } else if (par->pextra_type == LyXParagraph::PEXTRA_FLOATFLT) { + fl_set_button(fd_form_paragraph_extra->radio_pextra_indent, 0); + fl_set_button(fd_form_paragraph_extra->radio_pextra_minipage, 0); + fl_set_button(fd_form_paragraph_extra->radio_pextra_floatflt, 1); + fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_top); + fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_middle); + fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_bottom); + } else { + fl_set_button(fd_form_paragraph_extra->radio_pextra_indent, 0); + fl_set_button(fd_form_paragraph_extra->radio_pextra_minipage, 0); + fl_deactivate_object(fd_form_paragraph_extra->input_pextra_width); + fl_deactivate_object(fd_form_paragraph_extra->input_pextra_widthp); + fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_top); + fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_middle); + fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_bottom); + } + if (par->pextra_type == LyXParagraph::PEXTRA_NONE) + ActivateParagraphExtraButtons(); + } + fl_hide_object(fd_form_paragraph_extra->text_warning); - if (current_view->buffer()->isReadonly()) { - DisableParagraphExtra(); - fl_set_object_label(fd_form_paragraph_extra->text_warning, - _("Document is read-only. " - "No changes to layout permitted.")); - fl_show_object(fd_form_paragraph_extra->text_warning); - } - if (!update && fd_form_paragraph_extra->form_paragraph_extra->visible) { - fl_hide_form(fd_form_paragraph_extra->form_paragraph_extra); - } - return update; + if (current_view->buffer()->isReadonly()) { + DisableParagraphExtra(); + fl_set_object_label(fd_form_paragraph_extra->text_warning, + _("Document is read-only. " + "No changes to layout permitted.")); + fl_show_object(fd_form_paragraph_extra->text_warning); + } + if (!update && fd_form_paragraph_extra->form_paragraph_extra->visible) { + fl_hide_form(fd_form_paragraph_extra->form_paragraph_extra); + } + return update; } void ParagraphExtraOpen(FL_OBJECT *, long) { - if (UpdateParagraphExtra()) { - if (fd_form_paragraph_extra->form_paragraph_extra->visible) { - fl_raise_form(fd_form_paragraph_extra->form_paragraph_extra); - } else { - fl_show_form(fd_form_paragraph_extra->form_paragraph_extra, - FL_PLACE_MOUSE, FL_FULLBORDER, - _("ParagraphExtra Layout")); - } - } + if (UpdateParagraphExtra()) { + if (fd_form_paragraph_extra->form_paragraph_extra->visible) { + fl_raise_form(fd_form_paragraph_extra->form_paragraph_extra); + } else { + fl_show_form(fd_form_paragraph_extra->form_paragraph_extra, + FL_PLACE_MOUSE, FL_FULLBORDER, + _("ParagraphExtra Layout")); + } + } } void ParagraphExtraApplyCB(FL_OBJECT *, long) { - if (current_view->getScreen() && current_view->available()) { - FD_form_paragraph_extra const * fd = fd_form_paragraph_extra; - char const * width = fl_get_input(fd->input_pextra_width); - char const * widthp = fl_get_input(fd->input_pextra_widthp); -#ifdef MOVE_TEXT - LyXText * text = current_view->text; -#else - LyXText * text = current_view->buffer()->text; -#endif - int type = LyXParagraph::PEXTRA_NONE; - LyXParagraph::MINIPAGE_ALIGNMENT alignment = - LyXParagraph::MINIPAGE_ALIGN_TOP; - bool - hfill = false, - start_minipage = false; + if (current_view->getScreen() && current_view->available()) { + FD_form_paragraph_extra const * fd = fd_form_paragraph_extra; + char const * width = fl_get_input(fd->input_pextra_width); + char const * widthp = fl_get_input(fd->input_pextra_widthp); + LyXText * text = current_view->text; + int type = LyXParagraph::PEXTRA_NONE; + LyXParagraph::MINIPAGE_ALIGNMENT alignment = + LyXParagraph::MINIPAGE_ALIGN_TOP; + bool + hfill = false, + start_minipage = false; - if (fl_get_button(fd_form_paragraph_extra->radio_pextra_indent)) { - type = LyXParagraph::PEXTRA_INDENT; - } else if (fl_get_button(fd_form_paragraph_extra->radio_pextra_minipage)) { - type = LyXParagraph::PEXTRA_MINIPAGE; - hfill = fl_get_button(fd_form_paragraph_extra->radio_pextra_hfill); - start_minipage = - fl_get_button(fd_form_paragraph_extra->radio_pextra_startmp); - if (fl_get_button(fd_form_paragraph_extra->radio_pextra_top)) - alignment = LyXParagraph::MINIPAGE_ALIGN_TOP; - else if (fl_get_button(fd_form_paragraph_extra->radio_pextra_middle)) - alignment = LyXParagraph::MINIPAGE_ALIGN_MIDDLE; - else if (fl_get_button(fd_form_paragraph_extra->radio_pextra_bottom)) - alignment = LyXParagraph::MINIPAGE_ALIGN_BOTTOM; - } else if (fl_get_button(fd_form_paragraph_extra->radio_pextra_floatflt)) { - type = LyXParagraph::PEXTRA_FLOATFLT; - } - text->SetParagraphExtraOpt(type, width, widthp, alignment, hfill, - start_minipage); -#ifdef MOVE_TEXT - current_view->update(1); -#else - current_view->buffer()->update(1); -#endif - minibuffer->Set(_("ParagraphExtra layout set")); - } - return; + if (fl_get_button(fd_form_paragraph_extra->radio_pextra_indent)) { + type = LyXParagraph::PEXTRA_INDENT; + } else if (fl_get_button(fd_form_paragraph_extra->radio_pextra_minipage)) { + type = LyXParagraph::PEXTRA_MINIPAGE; + hfill = fl_get_button(fd_form_paragraph_extra->radio_pextra_hfill); + start_minipage = + fl_get_button(fd_form_paragraph_extra->radio_pextra_startmp); + if (fl_get_button(fd_form_paragraph_extra->radio_pextra_top)) + alignment = LyXParagraph::MINIPAGE_ALIGN_TOP; + else if (fl_get_button(fd_form_paragraph_extra->radio_pextra_middle)) + alignment = LyXParagraph::MINIPAGE_ALIGN_MIDDLE; + else if (fl_get_button(fd_form_paragraph_extra->radio_pextra_bottom)) + alignment = LyXParagraph::MINIPAGE_ALIGN_BOTTOM; + } else if (fl_get_button(fd_form_paragraph_extra->radio_pextra_floatflt)) { + type = LyXParagraph::PEXTRA_FLOATFLT; + } + text->SetParagraphExtraOpt(type, width, widthp, alignment, hfill, + start_minipage); + current_view->update(1); + minibuffer->Set(_("ParagraphExtra layout set")); + } + return; } void ParagraphExtraCancelCB(FL_OBJECT *, long) { - fl_hide_form(fd_form_paragraph_extra->form_paragraph_extra); + fl_hide_form(fd_form_paragraph_extra->form_paragraph_extra); } void ParagraphExtraOKCB(FL_OBJECT * ob, long data) { - ParagraphExtraCancelCB(ob, data); - ParagraphExtraApplyCB(ob, data); + ParagraphExtraCancelCB(ob, data); + ParagraphExtraApplyCB(ob, data); } void CheckPExtraOptCB(FL_OBJECT * ob, long) { - ActivateParagraphExtraButtons(); - CheckInputWidth(); - if (ob == fd_form_paragraph_extra->radio_pextra_indent) { - int n = fl_get_button(fd_form_paragraph_extra->radio_pextra_indent); - if (n) { - fl_set_button(fd_form_paragraph_extra->radio_pextra_minipage, 0); - fl_set_button(fd_form_paragraph_extra->radio_pextra_floatflt, 0); - fl_activate_object(fd_form_paragraph_extra->input_pextra_width); - fl_activate_object(fd_form_paragraph_extra->input_pextra_widthp); - fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_top); - fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_middle); - fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_bottom); - } else { - fl_deactivate_object(fd_form_paragraph_extra->input_pextra_width); - fl_deactivate_object(fd_form_paragraph_extra->input_pextra_widthp); - ActivateParagraphExtraButtons(); - } - } else if (ob == fd_form_paragraph_extra->radio_pextra_minipage) { - int n = fl_get_button(fd_form_paragraph_extra->radio_pextra_minipage); - if (n) { - fl_set_button(fd_form_paragraph_extra->radio_pextra_indent, 0); - fl_set_button(fd_form_paragraph_extra->radio_pextra_floatflt, 0); - fl_activate_object(fd_form_paragraph_extra->input_pextra_width); - fl_activate_object(fd_form_paragraph_extra->input_pextra_widthp); - fl_activate_object(fd_form_paragraph_extra->radio_pextra_top); - fl_activate_object(fd_form_paragraph_extra->radio_pextra_middle); - fl_activate_object(fd_form_paragraph_extra->radio_pextra_bottom); - } else { - fl_deactivate_object(fd_form_paragraph_extra->input_pextra_width); - fl_deactivate_object(fd_form_paragraph_extra->input_pextra_widthp); - fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_top); - fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_middle); - fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_bottom); - ActivateParagraphExtraButtons(); - } - } else if (ob == fd_form_paragraph_extra->radio_pextra_floatflt) { - int n = fl_get_button(fd_form_paragraph_extra->radio_pextra_floatflt); - if (n) { - fl_set_button(fd_form_paragraph_extra->radio_pextra_indent, 0); - fl_set_button(fd_form_paragraph_extra->radio_pextra_minipage, 0); - fl_activate_object(fd_form_paragraph_extra->input_pextra_width); - fl_activate_object(fd_form_paragraph_extra->input_pextra_widthp); - fl_activate_object(fd_form_paragraph_extra->radio_pextra_top); - fl_activate_object(fd_form_paragraph_extra->radio_pextra_middle); - fl_activate_object(fd_form_paragraph_extra->radio_pextra_bottom); - } else { - fl_deactivate_object(fd_form_paragraph_extra->input_pextra_width); - fl_deactivate_object(fd_form_paragraph_extra->input_pextra_widthp); - fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_top); - fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_middle); - fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_bottom); - ActivateParagraphExtraButtons(); - } - } - return; + ActivateParagraphExtraButtons(); + CheckInputWidth(); + if (ob == fd_form_paragraph_extra->radio_pextra_indent) { + int n = fl_get_button(fd_form_paragraph_extra->radio_pextra_indent); + if (n) { + fl_set_button(fd_form_paragraph_extra->radio_pextra_minipage, 0); + fl_set_button(fd_form_paragraph_extra->radio_pextra_floatflt, 0); + fl_activate_object(fd_form_paragraph_extra->input_pextra_width); + fl_activate_object(fd_form_paragraph_extra->input_pextra_widthp); + fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_top); + fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_middle); + fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_bottom); + } else { + fl_deactivate_object(fd_form_paragraph_extra->input_pextra_width); + fl_deactivate_object(fd_form_paragraph_extra->input_pextra_widthp); + ActivateParagraphExtraButtons(); + } + } else if (ob == fd_form_paragraph_extra->radio_pextra_minipage) { + int n = fl_get_button(fd_form_paragraph_extra->radio_pextra_minipage); + if (n) { + fl_set_button(fd_form_paragraph_extra->radio_pextra_indent, 0); + fl_set_button(fd_form_paragraph_extra->radio_pextra_floatflt, 0); + fl_activate_object(fd_form_paragraph_extra->input_pextra_width); + fl_activate_object(fd_form_paragraph_extra->input_pextra_widthp); + fl_activate_object(fd_form_paragraph_extra->radio_pextra_top); + fl_activate_object(fd_form_paragraph_extra->radio_pextra_middle); + fl_activate_object(fd_form_paragraph_extra->radio_pextra_bottom); + } else { + fl_deactivate_object(fd_form_paragraph_extra->input_pextra_width); + fl_deactivate_object(fd_form_paragraph_extra->input_pextra_widthp); + fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_top); + fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_middle); + fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_bottom); + ActivateParagraphExtraButtons(); + } + } else if (ob == fd_form_paragraph_extra->radio_pextra_floatflt) { + int n = fl_get_button(fd_form_paragraph_extra->radio_pextra_floatflt); + if (n) { + fl_set_button(fd_form_paragraph_extra->radio_pextra_indent, 0); + fl_set_button(fd_form_paragraph_extra->radio_pextra_minipage, 0); + fl_activate_object(fd_form_paragraph_extra->input_pextra_width); + fl_activate_object(fd_form_paragraph_extra->input_pextra_widthp); + fl_activate_object(fd_form_paragraph_extra->radio_pextra_top); + fl_activate_object(fd_form_paragraph_extra->radio_pextra_middle); + fl_activate_object(fd_form_paragraph_extra->radio_pextra_bottom); + } else { + fl_deactivate_object(fd_form_paragraph_extra->input_pextra_width); + fl_deactivate_object(fd_form_paragraph_extra->input_pextra_widthp); + fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_top); + fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_middle); + fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_bottom); + ActivateParagraphExtraButtons(); + } + } + return; } static bool CheckInputWidth() { - string s1 = fl_get_input(fd_form_paragraph_extra->input_pextra_width); - string s2 = fl_get_input(fd_form_paragraph_extra->input_pextra_widthp); - if (s1.empty() && s2.empty()) { - fl_activate_object(fd_form_paragraph_extra->input_pextra_width); - fl_activate_object(fd_form_paragraph_extra->input_pextra_widthp); - fl_hide_object(fd_form_paragraph_extra->text_warning); - DeactivateParagraphExtraButtons(); - return false; - } - if (!s1.empty()) { // LyXLength parameter - fl_activate_object(fd_form_paragraph_extra->input_pextra_width); - fl_deactivate_object(fd_form_paragraph_extra->input_pextra_widthp); - if (!isValidLength(s1)) { - DeactivateParagraphExtraButtons(); - fl_set_object_label(fd_form_paragraph_extra->text_warning, - _("Warning: Invalid Length (valid example: 10mm)")); - fl_show_object(fd_form_paragraph_extra->text_warning); - return false; - } - } else { // !s2.empty() % parameter - fl_deactivate_object(fd_form_paragraph_extra->input_pextra_width); - fl_activate_object(fd_form_paragraph_extra->input_pextra_widthp); - if ((atoi(s2.c_str()) < 0 ) || (atoi(s2.c_str()) > 100)) { - DeactivateParagraphExtraButtons(); - fl_set_object_label(fd_form_paragraph_extra->text_warning, - _("Warning: Invalid percent value (0-100)")); - fl_show_object(fd_form_paragraph_extra->text_warning); - return false; - } - } - fl_hide_object(fd_form_paragraph_extra->text_warning); - return true; + string s1 = fl_get_input(fd_form_paragraph_extra->input_pextra_width); + string s2 = fl_get_input(fd_form_paragraph_extra->input_pextra_widthp); + if (s1.empty() && s2.empty()) { + fl_activate_object(fd_form_paragraph_extra->input_pextra_width); + fl_activate_object(fd_form_paragraph_extra->input_pextra_widthp); + fl_hide_object(fd_form_paragraph_extra->text_warning); + DeactivateParagraphExtraButtons(); + return false; + } + if (!s1.empty()) { // LyXLength parameter + fl_activate_object(fd_form_paragraph_extra->input_pextra_width); + fl_deactivate_object(fd_form_paragraph_extra->input_pextra_widthp); + if (!isValidLength(s1)) { + DeactivateParagraphExtraButtons(); + fl_set_object_label(fd_form_paragraph_extra->text_warning, + _("Warning: Invalid Length (valid example: 10mm)")); + fl_show_object(fd_form_paragraph_extra->text_warning); + return false; + } + } else { // !s2.empty() % parameter + fl_deactivate_object(fd_form_paragraph_extra->input_pextra_width); + fl_activate_object(fd_form_paragraph_extra->input_pextra_widthp); + if ((atoi(s2.c_str()) < 0 ) || (atoi(s2.c_str()) > 100)) { + DeactivateParagraphExtraButtons(); + fl_set_object_label(fd_form_paragraph_extra->text_warning, + _("Warning: Invalid percent value (0-100)")); + fl_show_object(fd_form_paragraph_extra->text_warning); + return false; + } + } + fl_hide_object(fd_form_paragraph_extra->text_warning); + return true; } diff --git a/src/TableLayout.C b/src/TableLayout.C index a0ff8eb436..e73655bf0a 100644 --- a/src/TableLayout.C +++ b/src/TableLayout.C @@ -28,15 +28,16 @@ static int Confirmed = false; static int ActCell; // hack to keep the cursor from jumping to the end of the text in the Extra -// form input fields during editing. The values in LyXTable itself is changed in -// real-time, but we have no callbacks for the input fields, so I simply -// store and restore the cursor position for now. (too much of a hazzle to -// do it proper; we'll trash all this code in 1.1 anyway) +// form input fields during editing. The values in LyXTable itself is +// changed in real-time, but we have no callbacks for the input fields, +// so I simply store and restore the cursor position for now. +// (too much of a hazzle to do it proper; we'll trash all this code +// in 1.1 anyway) static int extra_col_cursor_x; // need no y's, one-line input fields static int extra_multicol_cursor_x; // Joacim -#ifdef MOVE_TEXT + bool UpdateLayoutTable(int flag) { bool update = true; @@ -219,190 +220,7 @@ bool UpdateLayoutTable(int flag) } return update; } -#else -bool UpdateLayoutTable(int flag) -{ - bool update = true; - if (!current_view->getScreen() || !current_view->available()) - update = false; - - if (update && current_view->buffer()->text->cursor.par->table) { - char buf[12]; - string pwidth, special; - - LyXTable * table = current_view->buffer()->text->cursor.par->table; - int cell = current_view->buffer()->text-> - NumberOfCell(current_view->buffer()->text->cursor.par, - current_view->buffer()->text->cursor.pos); - ActCell = cell; - int column = table->column_of_cell(cell)+1; - fl_set_object_label(fd_form_table_options->text_warning, ""); - Confirmed = false; - fl_activate_object(fd_form_table_extra->input_special_alignment); - fl_activate_object(fd_form_table_extra->input_special_multialign); - fl_activate_object(fd_form_table_options->input_column_width); - sprintf(buf, "%d", column); - fl_set_input(fd_form_table_options->input_table_column, buf); - fl_deactivate_object(fd_form_table_options->input_table_column); - int row = table->row_of_cell(cell)+1; - sprintf(buf, "%d", row); - fl_set_input(fd_form_table_options->input_table_row, buf); - fl_deactivate_object(fd_form_table_options->input_table_row); - if (table->IsMultiColumn(cell)) - fl_set_button(fd_form_table_options->radio_multicolumn, 1); - else - fl_set_button(fd_form_table_options->radio_multicolumn, 0); - if (table->RotateCell(cell)) - fl_set_button(fd_form_table_options->radio_rotate_cell, 1); - else - fl_set_button(fd_form_table_options->radio_rotate_cell, 0); - if (table->TopLine(cell)) - fl_set_button(fd_form_table_options->radio_border_top, 1); - else - fl_set_button(fd_form_table_options->radio_border_top, 0); - if (table->BottomLine(cell)) - fl_set_button(fd_form_table_options->radio_border_bottom, 1); - else - fl_set_button(fd_form_table_options->radio_border_bottom, 0); - if (table->LeftLine(cell)) - fl_set_button(fd_form_table_options->radio_border_left, 1); - else - fl_set_button(fd_form_table_options->radio_border_left, 0); - if (table->RightLine(cell)) - fl_set_button(fd_form_table_options->radio_border_right, 1); - else - fl_set_button(fd_form_table_options->radio_border_right, 0); - int align = table->GetAlignment(cell); - fl_set_button(fd_form_table_options->radio_align_left, 0); - fl_set_button(fd_form_table_options->radio_align_right, 0); - fl_set_button(fd_form_table_options->radio_align_center, 0); - special = table->GetAlignSpecial(cell, LyXTable::SET_SPECIAL_COLUMN); - if (flag) - { - fl_set_input(fd_form_table_extra->input_special_alignment, - special.c_str()); - fl_set_input_cursorpos(fd_form_table_extra->input_special_alignment, - extra_col_cursor_x, 0); // restore the cursor - } - if (current_view->buffer()->isReadonly()) - fl_deactivate_object(fd_form_table_extra->input_special_alignment); - special = table->GetAlignSpecial(cell, LyXTable::SET_SPECIAL_MULTI); - if (flag) - { - fl_set_input(fd_form_table_extra->input_special_multialign, - special.c_str()); - fl_set_input_cursorpos(fd_form_table_extra->input_special_multialign, - extra_multicol_cursor_x, 0); // restore the cursor - } - if (current_view->buffer()->isReadonly()) - fl_deactivate_object(fd_form_table_extra->input_special_multialign); - pwidth = table->GetPWidth(cell); - if (flag) - fl_set_input(fd_form_table_options->input_column_width, pwidth.c_str()); - if (current_view->buffer()->isReadonly()) - fl_deactivate_object(fd_form_table_options->input_column_width); - if (!pwidth.empty()) { - fl_activate_object(fd_form_table_options->radio_linebreak_cell); - fl_set_object_lcol(fd_form_table_options->radio_linebreak_cell, - FL_BLACK); - fl_set_button(fd_form_table_options->radio_linebreak_cell, - table->Linebreaks(table->FirstVirtualCell(cell))); - } else { - fl_deactivate_object(fd_form_table_options->radio_linebreak_cell); - fl_set_object_lcol(fd_form_table_options->radio_linebreak_cell, - FL_INACTIVE); - fl_set_button(fd_form_table_options->radio_linebreak_cell, 0); - } - if ((!pwidth.empty() && !table->IsMultiColumn(cell)) || - (align == LYX_ALIGN_LEFT)) - fl_set_button(fd_form_table_options->radio_align_left, 1); - else if (align == LYX_ALIGN_RIGHT) - fl_set_button(fd_form_table_options->radio_align_right, 1); - else - fl_set_button(fd_form_table_options->radio_align_center, 1); - if (!pwidth.empty() && !table->IsMultiColumn(cell)) { - fl_deactivate_object(fd_form_table_options->radio_align_left); - fl_deactivate_object(fd_form_table_options->radio_align_right); - fl_deactivate_object(fd_form_table_options->radio_align_center); - fl_set_object_lcol(fd_form_table_options->radio_align_left, - FL_INACTIVE); - fl_set_object_lcol(fd_form_table_options->radio_align_right, - FL_INACTIVE); - fl_set_object_lcol(fd_form_table_options->radio_align_center, - FL_INACTIVE); - } else { - fl_activate_object(fd_form_table_options->radio_align_left); - fl_activate_object(fd_form_table_options->radio_align_right); - fl_activate_object(fd_form_table_options->radio_align_center); - fl_set_object_lcol(fd_form_table_options->radio_align_left, - FL_BLACK); - fl_set_object_lcol(fd_form_table_options->radio_align_right, - FL_BLACK); - fl_set_object_lcol(fd_form_table_options->radio_align_center, - FL_BLACK); - } - fl_set_button(fd_form_table_options->radio_longtable, table->IsLongTable()); - if (table->IsLongTable()) { - fl_activate_object(fd_form_table_options->radio_lt_firsthead); - fl_activate_object(fd_form_table_options->radio_lt_head); - fl_activate_object(fd_form_table_options->radio_lt_foot); - fl_activate_object(fd_form_table_options->radio_lt_lastfoot); - fl_activate_object(fd_form_table_options->radio_lt_newpage); - fl_set_object_lcol(fd_form_table_options->radio_lt_firsthead, - FL_BLACK); - fl_set_object_lcol(fd_form_table_options->radio_lt_head, - FL_BLACK); - fl_set_object_lcol(fd_form_table_options->radio_lt_foot, - FL_BLACK); - fl_set_object_lcol(fd_form_table_options->radio_lt_lastfoot, - FL_BLACK); - fl_set_object_lcol(fd_form_table_options->radio_lt_newpage, - FL_BLACK); - fl_set_button(fd_form_table_options->radio_lt_firsthead, - table->RowOfLTFirstHead(cell)); - fl_set_button(fd_form_table_options->radio_lt_head, - table->RowOfLTHead(cell)); - fl_set_button(fd_form_table_options->radio_lt_foot, - table->RowOfLTFoot(cell)); - fl_set_button(fd_form_table_options->radio_lt_lastfoot, - table->RowOfLTLastFoot(cell)); - fl_set_button(fd_form_table_options->radio_lt_newpage, - table->LTNewPage(cell)); - } else { - fl_deactivate_object(fd_form_table_options->radio_lt_firsthead); - fl_deactivate_object(fd_form_table_options->radio_lt_head); - fl_deactivate_object(fd_form_table_options->radio_lt_foot); - fl_deactivate_object(fd_form_table_options->radio_lt_lastfoot); - fl_deactivate_object(fd_form_table_options->radio_lt_newpage); - fl_set_button(fd_form_table_options->radio_lt_firsthead, 0); - fl_set_button(fd_form_table_options->radio_lt_head, 0); - fl_set_button(fd_form_table_options->radio_lt_foot, 0); - fl_set_button(fd_form_table_options->radio_lt_lastfoot, 0); - fl_set_button(fd_form_table_options->radio_lt_newpage, 0); - fl_set_object_lcol(fd_form_table_options->radio_lt_firsthead, - FL_INACTIVE); - fl_set_object_lcol(fd_form_table_options->radio_lt_head, - FL_INACTIVE); - fl_set_object_lcol(fd_form_table_options->radio_lt_foot, - FL_INACTIVE); - fl_set_object_lcol(fd_form_table_options->radio_lt_lastfoot, - FL_INACTIVE); - fl_set_object_lcol(fd_form_table_options->radio_lt_newpage, - FL_INACTIVE); - } - fl_set_button(fd_form_table_options->radio_rotate_table, - table->RotateTable()); - fl_set_focus_object(fd_form_table_options->form_table_options, - fd_form_table_options->button_table_delete); - } else if (fd_form_table_options->form_table_options->visible) { - fl_set_focus_object(fd_form_table_options->form_table_options, - fd_form_table_options->button_table_delete); - fl_hide_form(fd_form_table_options->form_table_options); - } - return update; -} -#endif void OpenLayoutTableExtra() { @@ -445,7 +263,6 @@ void TableOptionsCB(FL_OBJECT * ob, long) int s, num = 0; string special, str; -#ifdef MOVE_TEXT if (!current_view->available() || !(table = current_view->text->cursor.par->table)) { MenuLayoutTable(0); @@ -463,26 +280,7 @@ void TableOptionsCB(FL_OBJECT * ob, long) extra_multicol_cursor_x = 0; return; } -#else - if (!current_view->available() - || - !(table = current_view->buffer()->text->cursor.par->table)) { - MenuLayoutTable(0); - return; - } - int cell = current_view->buffer()->text-> - NumberOfCell(current_view->buffer()->text->cursor.par, - current_view->buffer()->text->cursor.pos); - if (ActCell != cell) { - MenuLayoutTable(0); - fl_set_object_label(fd_form_table_options->text_warning, - _("Warning: Wrong Cursor position, updated window")); - fl_show_object(fd_form_table_options->text_warning); - extra_col_cursor_x = 0; // would rather place it at the end, but... - extra_multicol_cursor_x = 0; - return; - } -#endif + // No point in processing directives that you can't do anything with // anyhow, so exit now if the buffer is read-only. if (current_view->buffer()->isReadonly()) { @@ -622,9 +420,8 @@ void TableOptionsCB(FL_OBJECT * ob, long) num = LyXTable::SET_SPECIAL_MULTI; } else return; - if (current_view->available()){ + if (current_view->available()) { current_view->getScreen()->HideCursor(); -#ifdef MOVE_TEXT if (!current_view->text->selection){ BeforeChange(); current_view->update(-2); @@ -635,18 +432,6 @@ void TableOptionsCB(FL_OBJECT * ob, long) else current_view->text->TableFeatures(num); current_view->update(1); -#else - if (!current_view->buffer()->text->selection){ - BeforeChange(); - current_view->buffer()->update(-2); - } - if ((num == LyXTable::SET_SPECIAL_COLUMN) || - (num == LyXTable::SET_SPECIAL_MULTI)) - current_view->buffer()->text->TableFeatures(num, special); - else - current_view->buffer()->text->TableFeatures(num); - current_view->buffer()->update(1); -#endif } if (num == LyXTable::DELETE_TABLE) { fl_set_focus_object(fd_form_table_options->form_table_options, @@ -657,6 +442,7 @@ void TableOptionsCB(FL_OBJECT * ob, long) return; } + void TableOptCloseCB(FL_OBJECT *, long) { fl_set_focus_object(fd_form_table_options->form_table_options, @@ -673,37 +459,26 @@ void TableSpeCloseCB(FL_OBJECT *, long) return; } -void SetPWidthCB(FL_OBJECT *ob, long) +void SetPWidthCB(FL_OBJECT * ob, long) { fl_set_object_label(fd_form_table_options->text_warning, ""); Confirmed = false; if (ob == fd_form_table_options->input_column_width) { - string - str; - str = fl_get_input(ob); + string str = fl_get_input(ob); if (!str.empty() && !isValidLength(str)) { fl_set_object_label(fd_form_table_options->text_warning, - _("Warning: Invalid Length (valid example: 10mm)")); + _("Warning: Invalid Length (valid example: 10mm)")); fl_show_object(fd_form_table_options->text_warning); return; } if (current_view->available()){ current_view->getScreen()->HideCursor(); -#ifdef MOVE_TEXT - if (!current_view->text->selection){ + if (!current_view->text->selection) { BeforeChange(); current_view->update(-2); } current_view->text->TableFeatures(LyXTable::SET_PWIDTH, str); current_view->update(1); -#else - if (!current_view->buffer()->text->selection){ - BeforeChange(); - current_view->buffer()->update(-2); - } - current_view->buffer()->text->TableFeatures(LyXTable::SET_PWIDTH, str); - current_view->buffer()->update(1); -#endif } MenuLayoutTable(0); // update for alignment } diff --git a/src/buffer.C b/src/buffer.C index 155949a566..7f0986cf43 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -122,9 +122,6 @@ Buffer::Buffer(string const & file, LyXRC * lyxrc, bool ronly) filename = file; filepath = OnlyPath(file); paragraph = 0; -#ifndef MOVE_TEXT - text = 0; -#endif the_locking_inset = 0; lyx_clean = true; bak_clean = true; @@ -164,9 +161,6 @@ Buffer::~Buffer() par = tmppar; } paragraph = 0; -#ifndef MOVE_TEXT - delete text; -#endif } @@ -217,11 +211,7 @@ void Buffer::InsetUnlock() if (the_locking_inset) { if (!inset_slept) the_locking_inset->InsetUnlock(); the_locking_inset = 0; -#ifdef MOVE_TEXT users->text->FinishUndo(); -#else - text->FinishUndo(); -#endif inset_slept = false; } } @@ -268,7 +258,6 @@ bool Buffer::insertLyXFile(string const & filen) bool res = true; -#ifdef MOVE_TEXT if (c == '#') { lyxerr.debug() << "Will insert file with header" << endl; res = readFile(lex, users->text->cursor.par); @@ -276,15 +265,7 @@ bool Buffer::insertLyXFile(string const & filen) lyxerr.debug() << "Will insert file without header" << endl; res = readLyXformat2(lex, users->text->cursor.par); } -#else - if (c == '#') { - lyxerr.debug() << "Will insert file with header" << endl; - res = readFile(lex, text->cursor.par); - } else { - lyxerr.debug() << "Will insert file without header" << endl; - res = readLyXformat2(lex, text->cursor.par); - } -#endif + resize(); return res; } @@ -319,13 +300,8 @@ bool Buffer::readLyXformat2(LyXLex & lex, LyXParagraph * par) if(!par) { par = new LyXParagraph; } else { -#ifdef MOVE_TEXT users->text->BreakParagraph(); return_par = users->text->FirstParagraph(); -#else - text->BreakParagraph(); - return_par = text->FirstParagraph(); -#endif pos = 0; markDirty(); // We don't want to adopt the parameters from the @@ -3160,13 +3136,9 @@ void Buffer::SimpleDocBookOnePar(string & file, string & extra, // candidate for move to BufferView bool Buffer::removeAutoInsets() { - LyXParagraph *par = paragraph; + LyXParagraph * par = paragraph; -#ifdef MOVE_TEXT LyXCursor cursor = users->text->cursor; -#else - LyXCursor cursor = text->cursor; -#endif LyXCursor tmpcursor = cursor; cursor.par = tmpcursor.par->ParFromPos(tmpcursor.pos); cursor.pos = tmpcursor.par->PositionInParFromPos(tmpcursor.pos); @@ -3176,19 +3148,11 @@ bool Buffer::removeAutoInsets() if (par->AutoDeleteInsets()){ a = true; if (par->footnoteflag != LyXParagraph::CLOSED_FOOTNOTE){ -#ifdef MOVE_TEXT /* this is possible now, since SetCursor takes care about footnotes */ users->text->SetCursorIntern(par, 0); users->text->RedoParagraphs(users->text->cursor, users->text->cursor.par->Next()); users->text->FullRebreak(); -#else - /* this is possible now, since SetCursor takes - care about footnotes */ - text->SetCursorIntern(par, 0); - text->RedoParagraphs(text->cursor, text->cursor.par->Next()); - text->FullRebreak(); -#endif } } par = par->next; @@ -3196,11 +3160,7 @@ bool Buffer::removeAutoInsets() /* avoid forbidden cursor positions caused by error removing */ if (cursor.pos > cursor.par->Last()) cursor.pos = cursor.par->Last(); -#ifdef MOVE_TEXT users->text->SetCursorIntern(cursor.par, cursor.pos); -#else - text->SetCursorIntern(cursor.par, cursor.pos); -#endif return a; } @@ -3208,11 +3168,7 @@ bool Buffer::removeAutoInsets() int Buffer::runLaTeX() { -#ifdef MOVE_TEXT if (!users->text) return 0; -#else - if (!text) return 0; -#endif ProhibitInput(); @@ -3275,11 +3231,7 @@ int Buffer::runLaTeX() int Buffer::runLiterate() { -#ifdef MOVE_TEXT if (!users->text) return 0; -#else - if (!text) return 0; -#endif ProhibitInput(); @@ -3348,11 +3300,7 @@ int Buffer::runLiterate() int Buffer::buildProgram() { -#ifdef MOVE_TEXT if (!users->text) return 0; -#else - if (!text) return 0; -#endif ProhibitInput(); @@ -3423,11 +3371,7 @@ int Buffer::buildProgram() // Other flags: -wall -v0 -x int Buffer::runChktex() { -#ifdef MOVE_TEXT if (!users->text) return 0; -#else - if (!text) return 0; -#endif ProhibitInput(); @@ -3483,13 +3427,8 @@ extern void AllFloats(char, char); // candidate for move to BufferView void Buffer::insertErrors(TeXErrors & terr) { -#ifdef MOVE_TEXT // Save the cursor position LyXCursor cursor = users->text->cursor; -#else - // Save the cursor position - LyXCursor cursor = text->cursor; -#endif // This is drastic, but it's the only fix, I could find. (Asger) AllFloats(1, 0); @@ -3511,41 +3450,23 @@ void Buffer::insertErrors(TeXErrors & terr) LyXParagraph * texrowpar = 0; -#ifdef MOVE_TEXT if (tmpid == -1) { texrowpar = users->text->FirstParagraph(); tmppos = 0; } else { texrowpar = users->text->GetParFromID(tmpid); } -#else - if (tmpid == -1) { - texrowpar = text->FirstParagraph(); - tmppos = 0; - } else { - texrowpar = text->GetParFromID(tmpid); - } -#endif if (texrowpar == 0) continue; InsetError * new_inset = new InsetError(msgtxt); -#ifdef MOVE_TEXT users->text->SetCursorIntern(texrowpar, tmppos); users->text->InsertInset(new_inset); users->text->FullRebreak(); } // Restore the cursor position users->text->SetCursorIntern(cursor.par, cursor.pos); -#else - text->SetCursorIntern(texrowpar, tmppos); - text->InsertInset(new_inset); - text->FullRebreak(); - } - // Restore the cursor position - text->SetCursorIntern(cursor.par, cursor.pos); -#endif } @@ -3559,7 +3480,6 @@ void Buffer::setCursorFromRow (int row) LyXParagraph * texrowpar; -#ifdef MOVE_TEXT if (tmpid == -1) { texrowpar = users->text->FirstParagraph(); tmppos = 0; @@ -3567,15 +3487,6 @@ void Buffer::setCursorFromRow (int row) texrowpar = users->text->GetParFromID(tmpid); } users->text->SetCursor(texrowpar, tmppos); -#else - if (tmpid == -1) { - texrowpar = text->FirstParagraph(); - tmppos = 0; - } else { - texrowpar = text->GetParFromID(tmpid); - } - text->SetCursor(texrowpar, tmppos); -#endif } @@ -3726,37 +3637,6 @@ void Buffer::markDviDirty() } -#ifndef MOVE_TEXT -// candidate for move to BufferView -void Buffer::update(signed char f) -{ - if (!users) return; - - users->owner()->updateLayoutChoice(); - if (!text->selection && f > -3) - text->sel_cursor = text->cursor; - - FreeUpdateTimer(); - text->FullRebreak(); - - users->update(); - - if (f != 3 && f != -3) { - users->fitCursor(); - users->updateScrollbar(); - } - - if (f == 1 || f == -1) { - if (isLyxClean()) { - markDirty(); - users->owner()->getMiniBuffer()->setTimer(4); - } else { - markDirty(); - } - } -} -#endif - void Buffer::validate(LaTeXFeatures & features) { LyXParagraph * par = paragraph; @@ -3868,7 +3748,7 @@ void Buffer::setOldPaperStuff() } #endif -#ifdef MOVE_TEXT + // candidate for move to BufferView void Buffer::insertInset(Inset * inset, string const & lout, bool no_table) @@ -3921,79 +3801,18 @@ void Buffer::insertInset(Inset * inset, string const & lout, users->text->UnFreezeUndo(); } -#else -void Buffer::insertInset(Inset * inset, string const & lout, - bool no_table) -{ - // check for table/list in tables - if (no_table && text->cursor.par->table){ - WriteAlert(_("Impossible Operation!"), - _("Cannot insert table/list in table."), - _("Sorry.")); - return; - } - // not quite sure if we want this... - text->SetCursorParUndo(); - text->FreezeUndo(); - - BeforeChange(); - if (!lout.empty()) { - update(-2); - text->BreakParagraph(); - update(-1); - - if (text->cursor.par->Last()) { - text->CursorLeft(); - - text->BreakParagraph(); - update(-1); - } - - int lay = textclasslist.NumberOfLayout(params.textclass, - lout).second; - if (lay == -1) // layout not found - // use default layout "Standard" (0) - lay = 0; - - text->SetLayout(lay); - - text->SetParagraph(0, 0, - 0, 0, - VSpace(VSpace::NONE), VSpace(VSpace::NONE), - LYX_ALIGN_LAYOUT, - string(), - 0); - update(-1); - - text->current_font.setLatex(LyXFont::OFF); - } - - text->InsertInset(inset); - update(-1); - text->UnFreezeUndo(); -} -#endif // Open and lock an updatable inset // candidate for move to BufferView void Buffer::open_new_inset(UpdatableInset * new_inset) { -#ifdef MOVE_TEXT BeforeChange(); users->text->FinishUndo(); insertInset(new_inset); users->text->CursorLeft(); users->update(1); new_inset->Edit(0, 0); -#else - BeforeChange(); - text->FinishUndo(); - insertInset(new_inset); - text->CursorLeft(); - update(1); - new_inset->Edit(0, 0); -#endif } @@ -4129,19 +3948,11 @@ bool Buffer::gotoLabel(string const & label) while ((inset = par->ReturnNextInsetPointer(pos))){ for (int i = 0; i < inset->GetNumberOfLabels(); i++) { if (label == inset->getLabel(i)) { -#ifdef MOVE_TEXT BeforeChange(); users->text->SetCursor(par, pos); users->text->sel_cursor = users->text->cursor; users->update(0); return true; -#else - BeforeChange(); - text->SetCursor(par, pos); - text->sel_cursor = text->cursor; - update(0); - return true; -#endif } } pos++; diff --git a/src/buffer.h b/src/buffer.h index 870d697cdc..d27e1222c1 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -1,6 +1,6 @@ // -*- C++ -*- /* This file is part of -* ====================================================== + * ====================================================== * * LyX, The Document Processor * Copyright (C) 1995 Matthias Ettrich @@ -34,7 +34,6 @@ #include "lyxtext.h" #include "support/filetools.h" -#define MOVE_TEXT 1 class LyXRC; class TeXErrors; @@ -73,16 +72,16 @@ public: //@{ /** save the buffer's parameters as user default - This function saves a file user_lyxdir/templates/defaults.lyx - which parameters are those of the current buffer. This file - is used as a default template when creating a new - file. Returns true on success. - */ + This function saves a file user_lyxdir/templates/defaults.lyx + which parameters are those of the current buffer. This file + is used as a default template when creating a new + file. Returns true on success. + */ bool saveParamsAsDefaults(); /** high-level interface to buffer functionality - This function parses a command string and executes it - */ + This function parses a command string and executes it + */ void Dispatch(const string & command); /// Maybe we know the function already by number... @@ -90,17 +89,11 @@ public: /// should be changed to work for a list. void resize() - { - if (users) { - users->resize(); + { + if (users) { + users->resize(); + } } -#ifndef MOVE_TEXT - else if (text) { - delete text; - text = 0; - } -#endif - } /// Update window titles of all users void updateTitles(); @@ -109,26 +102,21 @@ public: void resetAutosaveTimers(); /** Adds the BufferView to the users list. - Later this func will insert the BufferView into a real list, - not just setting a pointer. - */ + Later this func will insert the BufferView into a real list, + not just setting a pointer. + */ void addUser(BufferView * u) { users = u; } /** Removes the BufferView from the users list. - Since we only can have one at the moment, we just reset it. - */ + Since we only can have one at the moment, we just reset it. + */ void delUser(BufferView *){ users = 0; } -#ifndef MOVE_TEXT - /// - void update(signed char f); -#endif - /// void redraw() { - users->redraw(); - users->fitCursor(); - users->updateScrollbar(); + users->redraw(); + users->fitCursor(); + users->updateScrollbar(); } /// Open and lock an updatable inset @@ -263,16 +251,16 @@ public: /// Set buffer read-only flag void setReadonly(bool flag = true) - { - if (read_only != flag) { - read_only = flag; - updateTitles(); - updateAllVisibleBufferRelatedPopups(); + { + if (read_only != flag) { + read_only = flag; + updateTitles(); + updateAllVisibleBufferRelatedPopups(); + } + if (read_only) { + WarnReadonly(); + } } - if (read_only) { - WarnReadonly(); - } - } /// returns true if the buffer contains a LaTeX document bool isLatex() const; @@ -294,19 +282,19 @@ public: #endif /** Validate a buffer for LaTeX. - This validates the buffer, and returns a struct for use by - makeLaTeX and others. Its main use is to figure out what commands - and packages need to be included in the LaTeX file. It (should) - also check that the needed constructs are there (i.e. that the \refs - points to coresponding \labels). It should perhaps inset "error" - insets to help the user correct obvious mistakes. - */ + This validates the buffer, and returns a struct for use by + makeLaTeX and others. Its main use is to figure out what commands + and packages need to be included in the LaTeX file. It (should) + also check that the needed constructs are there (i.e. that the \refs + points to coresponding \labels). It should perhaps inset "error" + insets to help the user correct obvious mistakes. + */ void validate(LaTeXFeatures &); //the correct parameters to be - //included later + //included later /** Insert an inset into the buffer - Insert inset into buffer, placing it in a layout of lout, - if no_table make sure that it doesn't end up in a table. */ + Insert inset into buffer, placing it in a layout of lout, + if no_table make sure that it doesn't end up in a table. */ void insertInset(Inset *, string const & lout = string(), bool no_table = false); @@ -326,7 +314,7 @@ public: bool removeAutoInsets(); /** This will clearly have to change later. Later we can have more - than one user per buffer. */ + than one user per buffer. */ BufferView * getUser() const { return users; } //@} @@ -344,12 +332,6 @@ public: */ LyXParagraph * paragraph; -#ifndef MOVE_TEXT - /** This holds the mapping between buffer paragraphs and screen rows. - Should be moved to BufferView. (Asger) - */ - LyXText * text; -#endif /// per view not per buffer? UpdatableInset * the_locking_inset; @@ -453,12 +435,12 @@ private: float format; /** A list of views using this buffer. - Why not keep a list of the BufferViews that use this buffer? + Why not keep a list of the BufferViews that use this buffer? - At least then we don't have to do a lot of magic like: - buffer->lyx_gui->bufferview->updateLayoutChoice. Just ask each - of the buffers in the list of users to do a updateLayoutChoice. - */ + At least then we don't have to do a lot of magic like: + buffer->lyx_gui->bufferview->updateLayoutChoice. Just ask each + of the buffers in the list of users to do a updateLayoutChoice. + */ BufferView * users; /// Used when typesetting to place errorboxes. @@ -469,28 +451,28 @@ private: inline void Buffer::InsetSleep() { - if (the_locking_inset && !inset_slept) { - the_locking_inset->GetCursorPos(slx, sly); - the_locking_inset->InsetUnlock(); - inset_slept = true; - } + if (the_locking_inset && !inset_slept) { + the_locking_inset->GetCursorPos(slx, sly); + the_locking_inset->InsetUnlock(); + inset_slept = true; + } } inline void Buffer::InsetWakeup() { - if (the_locking_inset && inset_slept) { - the_locking_inset->Edit(slx, sly); - inset_slept = false; - } + if (the_locking_inset && inset_slept) { + the_locking_inset->Edit(slx, sly); + inset_slept = false; + } } inline void Buffer::setParentName(string const & name) { - params.parentname = name; + params.parentname = name; } #endif diff --git a/src/bufferlist.C b/src/bufferlist.C index cb0ca68637..7532c2ac84 100644 --- a/src/bufferlist.C +++ b/src/bufferlist.C @@ -58,8 +58,8 @@ void BufferStorage::release(Buffer * buf) Buffer * BufferStorage::newBuffer(string const & s, - LyXRC * lyxrc, - bool ronly) + LyXRC * lyxrc, + bool ronly) { Buffer * tmpbuf = new Buffer(s, lyxrc, ronly); tmpbuf->params.useClassDefaults(); @@ -104,7 +104,8 @@ bool BufferList::QwriteAll() break; case 2: // No askMoreConfirmation = true; - unsaved += MakeDisplayPath((*it)->fileName(), 50); + unsaved += MakeDisplayPath((*it)->fileName(), + 50); unsaved += "\n"; break; case 3: // Cancel @@ -152,7 +153,7 @@ bool BufferList::write(Buffer * buf, bool makeBackup) chmod("LyXVC3.lyx", 0100644) = 0 lseek(0, 0, SEEK_CUR) = 46440 _exit(0) - */ + */ // Should proabaly have some more error checking here. // Should be cleaned up in 0.13, at least a bit. @@ -178,7 +179,8 @@ bool BufferList::write(Buffer * buf, bool makeBackup) c_read = fread(cbuf, 1, blksize, fin); if (c_read != 0) c_write = - fwrite(cbuf, 1, c_read, fout); + fwrite(cbuf, 1, + c_read, fout); } while (c_read); fin.close(); fout.close(); @@ -189,7 +191,8 @@ bool BufferList::write(Buffer * buf, bool makeBackup) } delete [] cbuf; } else { - lyxerr << "LyX was not able to make backupcopy. Beware." << endl; + lyxerr << "LyX was not able to make " + "backupcopy. Beware." << endl; } delete[] times; } @@ -253,8 +256,8 @@ bool BufferList::close(Buffer * buf) if (buf->paragraph && !buf->isLyxClean() && !quitting) { ProhibitInput(); switch(AskConfirmation(_("Changes in document:"), - MakeDisplayPath(buf->fileName(), 50), - _("Save document?"))){ + MakeDisplayPath(buf->fileName(), 50), + _("Save document?"))){ case 1: // Yes if (write(buf)) { lastfiles->newFile(buf->fileName()); @@ -309,19 +312,12 @@ void BufferList::updateInset(Inset * inset, bool mark_dirty) { for (BufferStorage::iterator it = bstore.begin(); it != bstore.end(); ++it) { -#ifdef MOVE_TEXT - if ((*it)->getUser() && (*it)->getUser()->text->UpdateInset(inset)) { + if ((*it)->getUser() + && (*it)->getUser()->text->UpdateInset(inset)) { if (mark_dirty) (*it)->markDirty(); break; } -#else - if ((*it)->text && (*it)->text->UpdateInset(inset)) { - if (mark_dirty) - (*it)->markDirty(); - break; - } -#endif } } @@ -352,7 +348,6 @@ void BufferList::updateIncludedTeXfiles(string const & mastertmpdir) (*it)->makeLaTeXFile(writefile, mastertmpdir, false, true); (*it)->markDepClean(mastertmpdir); - } } } @@ -366,7 +361,7 @@ void BufferList::emergencyWriteAll() bool madeit = false; lyxerr <<_("lyx: Attempting to save" - " document ") + " document ") << (*it)->fileName() << _(" as...") << endl; @@ -382,7 +377,9 @@ void BufferList::emergencyWriteAll() } else if (i == 1) { s = AddName(GetEnvPath("HOME"), (*it)->fileName()); - } else { // MakeAbsPath to prepend the current drive letter on OS/2 + } else { + // MakeAbsPath to prepend the current + // drive letter on OS/2 s = AddName(MakeAbsPath("/tmp/"), (*it)->fileName()); } @@ -399,7 +396,9 @@ void BufferList::emergencyWriteAll() lyxerr << _(" Save failed! Trying...") << endl; } else { - lyxerr << _(" Save failed! Bummer. Document is lost.") << endl; + lyxerr << _(" Save failed! Bummer. " + "Document is lost.") + << endl; } } } @@ -599,10 +598,10 @@ Buffer * BufferList::loadLyXFile(string const & filename, bool tolastfiles) if (AskQuestion(_("Cannot open specified file:"), MakeDisplayPath(s, 50), _("Create new document with this name?"))) - { - // Find a free buffer - b = newFile(s, string()); - } + { + // Find a free buffer + b = newFile(s, string()); + } break; } diff --git a/src/chset.C b/src/chset.C index 60c935e41f..66cfb09b1b 100644 --- a/src/chset.C +++ b/src/chset.C @@ -35,6 +35,10 @@ bool CharacterSet::loadFile(string const & fname) string str; int n; string line; + // Ok, I'll be the first to admit that this is probably not + // the fastest way to parse the cdef files, but I though it + // was a bit neat. Anyway it is wrong to use the lyxlex parse + // without the use of a keyword table. LRegex reg("^([12][0-9][0-9])[ \t]+\"([^ ]+)\".*"); while(getline(ifs, line)) { if (reg.exact_match(line)) { @@ -53,11 +57,20 @@ bool CharacterSet::loadFile(string const & fname) } -bool CharacterSet::encodeString(string & str) const +pair CharacterSet::encodeString(string & str) const { + lyxerr[Debug::KBMAP] << "Checking if we know [" << str << "]" << endl; + bool ret = false; + int val = 0; Cdef::const_iterator cit = map_.find(str); - if (cit != map_.end()) return true; - return false; + if (cit != map_.end()) { + ret = true; + val = (*cit).second; + } + lyxerr[Debug::KBMAP] << " " + << (ret ? "yes we" : "no we don't") + << " know [" << str << "]" << endl; + return make_pair(ret, val); } diff --git a/src/chset.h b/src/chset.h index 30df042b0c..b6256c26a3 100644 --- a/src/chset.h +++ b/src/chset.h @@ -19,7 +19,7 @@ public: /// string const & getName() const; /// - bool encodeString(string &) const; + pair encodeString(string &) const; private: /// string name_; diff --git a/src/insets/figinset.C b/src/insets/figinset.C index aa2a7f51d9..18db37def6 100644 --- a/src/insets/figinset.C +++ b/src/insets/figinset.C @@ -77,8 +77,8 @@ void PutInsetIntoInsetUpdateList(Inset * inset); extern void ProhibitInput(); extern void AllowInput(); -#define DEG2PI 57.295779513 -#define figallocchunk 32 +static float const DEG2PI = 57.295779513; +static int const figallocchunk = 32; static int figinsref = 0; /* number of figures */ static int figarrsize = 0; /* current max number of figures */ @@ -97,7 +97,7 @@ struct pidwait { pidwait * next; /* next */ }; -#define MAXGS 3 /* maximum 3 gs's at a time */ +static int const MAXGS = 3; /* maximum 3 gs's at a time */ static Figref ** figures; /* all the figures */ static figdata ** bitmaps; /* all the bitmaps */ @@ -141,7 +141,7 @@ void addpidwait(int pid) extern "C" int GhostscriptMsg(FL_OBJECT *, Window, int, int, - XEvent * ev, void *) + XEvent * ev, void *) { char tmp[128]; @@ -153,6 +153,7 @@ extern "C" int GhostscriptMsg(FL_OBJECT *, Window, int, int, } // just kill gs, that way it will work for sure + // This loop looks like S**T so it probably is... for (int i = 0; i < bmpinsref; ++i) if ((long)bitmaps[i]->bitmap == (long)e->data.l[1]) { // found the one @@ -160,7 +161,8 @@ extern "C" int GhostscriptMsg(FL_OBJECT *, Window, int, int, p->gsdone = true; // first update p->bitmap, if necessary - if (p->bitmap != None && p->flags > (1|8) && gs_color && p->wid) { + if (p->bitmap != None + && p->flags > (1|8) && gs_color && p->wid) { // query current colormap and re-render // the pixmap with proper colors //XColor * cmap; @@ -172,8 +174,10 @@ extern "C" int GhostscriptMsg(FL_OBJECT *, Window, int, int, Display * tmpdisp; GC gc = getGC(gc_copy); - XGetWindowAttributes(fl_display, fl_get_canvas_id( - figinset_canvas), &wa); + XGetWindowAttributes(fl_display, + fl_get_canvas_id( + figinset_canvas), + &wa); XFlush(fl_display); if (lyxerr.debugging()) { lyxerr << "Starting image translation " @@ -217,36 +221,39 @@ extern "C" int GhostscriptMsg(FL_OBJECT *, Window, int, int, { // query current colormap //cmap = (XColor *) malloc(gs_allcolors*sizeof(XColor)); - XColor * cmap = new XColor[gs_allcolors]; - for (i = 0; i < gs_allcolors; ++i) cmap[i].pixel = i; - XQueryColors(tmpdisp, color_map, cmap, gs_allcolors); - XFlush(tmpdisp); - wid1 = p->wid - 1; + XColor * cmap = new XColor[gs_allcolors]; + for (i = 0; i < gs_allcolors; ++i) cmap[i].pixel = i; + XQueryColors(tmpdisp, color_map, cmap, gs_allcolors); + XFlush(tmpdisp); + wid1 = p->wid - 1; // now we process all the image - for (y = 0; y < p->hgh; ++y) { - for (int x = 0; x < wid; ++x) { - XColor * pc = cmap + - XGetPixel(im, x, y); - XFlush(tmpdisp); - XPutPixel(im, x, y, - gs_pixels[((pc->red+6553)* - spc1/65535)*spc2+((pc->green+6553)* - spc1/65535)*gs_spc+((pc->blue+6553)* - spc1/65535)]); - XFlush(tmpdisp); + for (y = 0; y < p->hgh; ++y) { + for (int x = 0; x < wid; ++x) { + XColor * pc = cmap + + XGetPixel(im, x, y); + XFlush(tmpdisp); + XPutPixel(im, x, y, + gs_pixels[((pc->red+6553)* + spc1/65535)*spc2+((pc->green+6553)* + spc1/65535)*gs_spc+((pc->blue+6553)* + spc1/65535)]); + XFlush(tmpdisp); + } } - } // This must be correct. - delete [] cmap; - if (lyxerr.debugging()) { - lyxerr << "Putting image back" << endl; - } - XPutImage(tmpdisp, p->bitmap, gc, im, 0, 0, - 0, 0, p->wid, p->hgh); - XDestroyImage(im); - if (lyxerr.debugging()) { - lyxerr << "Done translation" << endl; - } + delete [] cmap; + if (lyxerr.debugging()) { + lyxerr << "Putting image back" + << endl; + } + XPutImage(tmpdisp, p->bitmap, + gc, im, 0, 0, + 0, 0, p->wid, p->hgh); + XDestroyImage(im); + if (lyxerr.debugging()) { + lyxerr << "Done translation" + << endl; + } } noim: if (lyxerr.debugging()) { @@ -284,9 +291,6 @@ extern "C" int GhostscriptMsg(FL_OBJECT *, Window, int, int, static void AllocColors(int num) // allocate color cube numxnumxnum, if possible { - XColor xcol; - int i; - if (lyxerr.debugging()) { lyxerr << "Allocating color cube " << num << 'x' << num << 'x' << num << endl; @@ -298,10 +302,11 @@ static void AllocColors(int num) return; } if (num > 5) num = 5; - for (i = 0; i < num*num*num; ++i) { - xcol.red = 65535*(i/(num*num))/(num-1); - xcol.green = 65535*((i/num) % num)/(num-1); - xcol.blue = 65535*(i % num)/(num-1); + XColor xcol; + for (int i = 0; i < num * num * num; ++i) { + xcol.red = 65535 * (i / (num * num)) / (num - 1); + xcol.green = 65535 * ((i / num) % num) / (num - 1); + xcol.blue = 65535 * (i % num) / (num - 1); xcol.flags = DoRed | DoGreen | DoBlue; if (!XAllocColor(fl_display, color_map, &xcol)) { if (i) XFreeColors(fl_display, color_map, @@ -310,7 +315,7 @@ static void AllocColors(int num) lyxerr << "Cannot allocate color cube " << num << endl;; } - AllocColors(num-1); + AllocColors(num - 1); return; } gs_pixels[i] = xcol.pixel; @@ -318,18 +323,16 @@ static void AllocColors(int num) gs_color = true; gs_gray = false; gs_spc = num; - gs_num_pixels = num*num*num; + gs_num_pixels = num * num * num; } -static void AllocGrays(int num) // allocate grayscale ramp +static +void AllocGrays(int num) { - XColor xcol; - int i; - if (lyxerr.debugging()) { - lyxerr << "Allocating grayscale ramp " + lyxerr << "Allocating grayscale colormap " << num << endl; } @@ -339,8 +342,9 @@ static void AllocGrays(int num) return; } if (num > 128) num = 128; - for (i = 0; i < num; ++i) { - xcol.red = xcol.green = xcol.blue = 65535*i/(num-1); + XColor xcol; + for (int i = 0; i < num; ++i) { + xcol.red = xcol.green = xcol.blue = 65535 * i / (num - 1); xcol.flags = DoRed | DoGreen | DoBlue; if (!XAllocColor(fl_display, color_map, &xcol)) { if (i) XFreeColors(fl_display, color_map, @@ -349,7 +353,7 @@ static void AllocGrays(int num) lyxerr << "Cannot allocate grayscale " << num << endl; } - AllocGrays(num/2); + AllocGrays(num / 2); return; } gs_pixels[i] = xcol.pixel; @@ -362,16 +366,16 @@ static void AllocGrays(int num) void InitFigures() { - unsigned int i, j, k; - Visual *vi; - bmparrsize = figarrsize = figallocchunk; - figures = static_cast(malloc(sizeof(Figref*)*figallocchunk)); - bitmaps = static_cast(malloc(sizeof(figdata*)*figallocchunk)); + figures = static_cast + (malloc(sizeof(Figref*) * figallocchunk)); + bitmaps = static_cast + (malloc(sizeof(figdata*) * figallocchunk)); - for (i = 0; i < 256; ++i) { + unsigned int k; + for (unsigned int i = 0; i < 256; ++i) { k = 0; - for (j = 0; j < 8; ++j) + for (unsigned int j = 0; j < 8; ++j) if (i & (1 << (7-j))) k |= 1 << j; bittable[i] = char(~k); } @@ -386,16 +390,16 @@ void InitFigures() // first get visual gs_color = false; - vi = DefaultVisual(fl_display, DefaultScreen(fl_display)); + Visual * vi = DefaultVisual(fl_display, DefaultScreen(fl_display)); if (lyxerr.debugging()) { printf("Visual ID: %ld, class: %d, bprgb: %d, mapsz: %d\n", vi->visualid, vi->c_class, vi->bits_per_rgb, vi->map_entries); } color_visual = ( (vi->c_class == StaticColor) || - (vi->c_class == PseudoColor) || - (vi->c_class == TrueColor) || - (vi->c_class == DirectColor) ); + (vi->c_class == PseudoColor) || + (vi->c_class == TrueColor) || + (vi->c_class == DirectColor) ); if ((vi->c_class & 1) == 0) return; // now allocate colors if (vi->c_class == GrayScale) { @@ -404,7 +408,7 @@ void InitFigures() } else { // allocate normal color int i = 5; - while (i*i*i*2 > vi->map_entries) --i; + while (i * i * i * 2 > vi->map_entries) --i; AllocColors(i); } gs_allcolors = vi->map_entries; @@ -432,7 +436,7 @@ void DoneFigures() } -int FindBmpIndex(figdata *tmpdata) +int FindBmpIndex(figdata * tmpdata) { int i = 0; while (i < bmpinsref) { @@ -456,7 +460,7 @@ static void chpixmap(Pixmap, int, int) } -static void freefigdata(figdata *tmpdata) +static void freefigdata(figdata * tmpdata) { tmpdata->ref--; if (tmpdata->ref) return; @@ -478,7 +482,7 @@ static void freefigdata(figdata *tmpdata) int i = FindBmpIndex(tmpdata); --bmpinsref; while (i < bmpinsref) { - bitmaps[i] = bitmaps[i+1]; + bitmaps[i] = bitmaps[i + 1]; ++i; } } @@ -557,7 +561,8 @@ static void runqueue() // now set up ghostview property on a window sprintf(tbuf, "0 0 0 0 %d %d 72 72 0 0 0 0", p->data->wid, p->data->hgh); -//#warning BUG seems that the only bug here might be the hardcoded dpi.. Bummer! + // #warning BUG seems that the only bug here + // might be the hardcoded dpi.. Bummer! if (lyxerr.debugging()) { lyxerr << "Will set GHOSTVIEW property to [" @@ -566,35 +571,37 @@ static void runqueue() // wait until property is deleted if executing multiple // ghostscripts for (;;) { - // grab server to prevent other child interfering - // with setting GHOSTVIEW property + // grab server to prevent other child + // interfering with setting GHOSTVIEW property if (lyxerr.debugging()) { - lyxerr << "Grabbing the server" << endl; + lyxerr << "Grabbing the server" + << endl; } XGrabServer(tempdisp); - prop = XListProperties(tempdisp, fl_get_canvas_id( + prop = XListProperties(tempdisp, + fl_get_canvas_id( figinset_canvas), &nprop); if (!prop) break; bool err = true; for (i = 0; i < nprop; ++i) { - char * p = XGetAtomName(tempdisp, prop[i]); + char * p = XGetAtomName(tempdisp, + prop[i]); if (strcmp(p, "GHOSTVIEW") == 0) { err = false; break; } XFree(p); } - XFree(reinterpret_cast(prop)); /* jc: */ + XFree(reinterpret_cast(prop)); // jc: if (err) break; // release the server XUngrabServer(tempdisp); XFlush(tempdisp); - // ok, property found, we must wait until ghostscript - // deletes it + // ok, property found, we must wait until + // ghostscript deletes it if (lyxerr.debugging()) { - lyxerr << "Releasing the server" << endl; - lyxerr << "[" + lyxerr << "Releasing the server\n[" << getpid() << "] GHOSTVIEW property" " found. Waiting." << endl; @@ -644,7 +651,8 @@ static void runqueue() XChangeProperty(tempdisp, fl_get_canvas_id(figinset_canvas), - XInternAtom(tempdisp, "GHOSTVIEW_COLORS", false), + XInternAtom(tempdisp, + "GHOSTVIEW_COLORS", false), XInternAtom(tempdisp, "STRING", false), 8, PropModeReplace, reinterpret_cast(tbuf), @@ -658,9 +666,10 @@ static void runqueue() // set up environment while (environ[ne]) ++ne; - env = static_cast(malloc(sizeof(char*)*(ne+2))); + env = static_cast + (malloc(sizeof(char*) * (ne + 2))); env[0] = tbuf2; - memcpy(&env[1], environ, sizeof(char*)*(ne+1)); + memcpy(&env[1], environ, sizeof(char*) * (ne + 1)); environ = env; // now make gs command @@ -676,8 +685,9 @@ static void runqueue() sprintf(tbuf, "%s/~lyxgs%d.ps", system_tempdir.c_str(), int(getpid())); if (lyxerr.debugging()) { - printf("starting gs %s %s, pid: %d\n", tbuf, - p->data->fname.c_str(), int(getpid())); + lyxerr << "starting gs " << tbuf << " " + << p->data->fname + << ", pid: " << getpid() << endl; } int err = execlp(lyxrc->ps_command.c_str(), @@ -710,14 +720,14 @@ static void runqueue() } -static void addwait(int psx, int psy, int pswid, int pshgh, figdata *data) +static void addwait(int psx, int psy, int pswid, int pshgh, figdata * data) { // recompute the stuff and put in the queue queue * p = new queue; p->ofsx = psx; p->ofsy = psy; - p->rx = (float(data->raw_wid) * 72.0)/pswid; - p->ry = (float(data->raw_hgh) * 72.0)/pshgh; + p->rx = (float(data->raw_wid) * 72.0) / pswid; + p->ry = (float(data->raw_hgh) * 72.0) / pshgh; p->data = data; p->next = 0; @@ -758,8 +768,10 @@ static figdata * getfigdata(int wid, int hgh, string const & fname, if (bmpinsref > bmparrsize) { // allocate more space bmparrsize += figallocchunk; - figdata ** tmp = static_cast(malloc(sizeof(figdata*)*bmparrsize)); - memcpy(tmp, bitmaps, sizeof(figdata*)*(bmparrsize-figallocchunk)); + figdata ** tmp = static_cast + (malloc(sizeof(figdata*) * bmparrsize)); + memcpy(tmp, bitmaps, + sizeof(figdata*) * (bmparrsize - figallocchunk)); free(bitmaps); bitmaps = tmp; } @@ -804,13 +816,13 @@ static figdata * getfigdata(int wid, int hgh, string const & fname, } -static void getbitmap(figdata *p) +static void getbitmap(figdata * p) { p->gspid = -1; } -static void makeupdatelist(figdata *p) +static void makeupdatelist(figdata * p) { for (int i = 0; i < figinsref; ++i) if (figures[i]->data == p) { @@ -933,8 +945,10 @@ static void RegisterFigure(InsetFig *fi) if (figinsref > figarrsize) { // allocate more space figarrsize += figallocchunk; - Figref **tmp = static_cast(malloc(sizeof(Figref*)*figarrsize)); - memcpy(tmp, figures, sizeof(Figref*)*(figarrsize-figallocchunk)); + Figref ** tmp = static_cast + (malloc(sizeof(Figref*)*figarrsize)); + memcpy(tmp, figures, + sizeof(Figref*)*(figarrsize-figallocchunk)); free(figures); figures = tmp; } @@ -1082,12 +1096,12 @@ void InsetFig::Draw(LyXFont font, LyXScreen & scr, int baseline, float & x) int(x), baseline - hgh - 1, wid+1, hgh+1); if (figure && figure->data) { - if (figure->data->broken) msg = _("[render error]"); - else if (figure->data->reading) msg = _("[rendering ... ]"); + if (figure->data->broken) msg = _("[render error]"); + else if (figure->data->reading) msg = _("[rendering ... ]"); } else - if (fname.empty()) msg = _("[no file]"); - else if ((flags & 3) == 0) msg = _("[not displayed]"); - else if (lyxrc->ps_command.empty()) msg = _("[no ghostscript]"); + if (fname.empty()) msg = _("[no file]"); + else if ((flags & 3) == 0) msg = _("[not displayed]"); + else if (lyxrc->ps_command.empty()) msg = _("[no ghostscript]"); if (!msg) msg = _("[unknown error]"); @@ -1095,8 +1109,8 @@ void InsetFig::Draw(LyXFont font, LyXScreen & scr, int baseline, float & x) font.setSize (LyXFont::SIZE_FOOTNOTE); string justname = OnlyFilename (fname); font.drawString(justname, pm, - baseline - font.maxAscent() - 4, - int(x) + 8); + baseline - font.maxAscent() - 4, + int(x) + 8); font.setSize (LyXFont::SIZE_TINY); font.drawText (msg, strlen(msg), pm, baseline - 4, @@ -1112,9 +1126,9 @@ void InsetFig::Write(ostream & os) Regenerate(); os << "Figure size " << wid << " " << hgh << "\n"; if (!fname.empty()) { - string buf1 = OnlyPath(owner->fileName()); - string fname2 = MakeRelPath(fname, buf1); - os << "file " << fname2 << "\n"; + string buf1 = OnlyPath(owner->fileName()); + string fname2 = MakeRelPath(fname, buf1); + os << "file " << fname2 << "\n"; } if (!subcaption.empty()) os << "subcaption " << subcaption << "\n"; @@ -1234,7 +1248,7 @@ int InsetFig::Linuxdoc(string &/*file*/) int InsetFig::DocBook(string & file) { - string figurename= fname; + string figurename = fname; if(suffixIs(figurename, ".eps")) figurename.erase(fname.length() - 5); @@ -1320,7 +1334,8 @@ Inset * InsetFig::Clone() const tmp->pshgh = pshgh; tmp->fname = fname; if (!fname.empty() && (flags & 3) && !lyxrc->ps_command.empty()) { - // do not display if there is "do not display" chosen (Matthias 260696) + // do not display if there is + // "do not display" chosen (Matthias 260696) tmp->figure->data = getfigdata(wid, hgh, fname, psx, psy, pswid, pshgh, raw_wid, raw_hgh, angle, flags & (3|8)); @@ -1453,7 +1468,7 @@ void InsetFig::Regenerate() if (subfigure) { if (!subcaption.empty()) cmdbuf = "\\subfigure[" + subcaption + - "]{" + cmdbuf + "}"; + "]{" + cmdbuf + "}"; else cmdbuf = "\\subfigure{" + cmdbuf + "}"; } @@ -1584,7 +1599,7 @@ void InsetFig::TempRegenerate() if (!recmd.empty()) cmdbuf += '}'; if (psubfigure && !tsubcap.empty()) { cmdbuf = string("\\subfigure{") + tsubcap - + string("}{") + cmdbuf + "}"; + + string("}{") + cmdbuf + "}"; } } @@ -1646,7 +1661,8 @@ void InsetFig::Recompute() // compiler warnings. break; } - if (htype && !wtype && frame_hgh) newx = newy*frame_wid/frame_hgh; + if (htype && !wtype && frame_hgh) + newx = newy*frame_wid/frame_hgh; } else { newx = wid; newy = hgh; @@ -1682,7 +1698,8 @@ void InsetFig::Recompute() figdata * pf = figure->data; // get new data - if (!fname.empty() && (flags & 3) && !lyxrc->ps_command.empty()) { + if (!fname.empty() && (flags & 3) + && !lyxrc->ps_command.empty()) { // do not display if there is "do not display" // chosen (Matthias 260696) figure->data = getfigdata(wid, hgh, fname, @@ -1779,7 +1796,7 @@ void InsetFig::CallbackFig(long arg) char const * p; if (lyxerr.debugging()) { - printf("Figure callback, arg %ld\n", arg); + lyxerr << "Figure callback, arg " << arg << endl; } switch (arg) { @@ -2123,15 +2140,15 @@ void InsetFig::BrowseFile() buf = MakeAbsPath(p, buf2); buf = OnlyPath(buf); } else { - buf = OnlyPath(owner->fileName().c_str()); + buf = OnlyPath(owner->fileName().c_str()); } // Does user clipart directory exist? string bufclip = AddName (user_lyxdir, "clipart"); FileInfo fileInfo(bufclip); if (!(fileInfo.isOK() && fileInfo.isDir())) - // No - bail out to system clipart directory - bufclip = AddName (system_lyxdir, "clipart"); + // No - bail out to system clipart directory + bufclip = AddName (system_lyxdir, "clipart"); fileDlg.SetButton(0, _("Clipart"), bufclip); @@ -2141,7 +2158,8 @@ void InsetFig::BrowseFile() do { ProhibitInput(); if (once) { - p = fileDlg.Select(_("EPS Figure"), current_figure_path, + p = fileDlg.Select(_("EPS Figure"), + current_figure_path, "*ps", string()); } else { p = fileDlg.Select(_("EPS Figure"), buf, @@ -2157,11 +2175,13 @@ void InsetFig::BrowseFile() if (contains(p, "#") || contains(p, "~") || contains(p, "$") || contains(p, "%") || contains(p, " ")) - { - WriteAlert(_("Filename can't contain any of these characters:"), // xgettext:no-c-format - _("space, '#', '~', '$' or '%'.")); - error = true; - } + { + WriteAlert(_("Filename can't contain any " + "of these characters:"), + // xgettext:no-c-format + _("space, '#', '~', '$' or '%'.")); + error = true; + } } while (error); if (form) fl_set_input(form->EpsFile, buf.c_str()); diff --git a/src/insets/insetbib.C b/src/insets/insetbib.C index d20d627ec4..19f9100170 100644 --- a/src/insets/insetbib.C +++ b/src/insets/insetbib.C @@ -1,4 +1,3 @@ - #include #include @@ -28,7 +27,7 @@ FD_citation_form * citation_form = 0; FD_bibitem_form * bibitem_form = 0; static Combox * bibcombox = 0; -extern void UpdateInset(Inset* inset, bool mark_dirty = true); +extern void UpdateInset(Inset * inset, bool mark_dirty = true); void BibitemUpdate(Combox *); FD_citation_form * create_form_citation_form(void); FD_bibitem_form * create_form_bibitem_form(void); @@ -56,18 +55,13 @@ extern "C" void bibitem_cb(FL_OBJECT *, long data) case 3: // OK, bibitem { if(!current_view->buffer()->isReadonly()) { - InsetCommand *inset = static_cast(bibitem_form->bibitem_form->u_vdata); + InsetCommand * inset = static_cast(bibitem_form->bibitem_form->u_vdata); inset->setContents(fl_get_input(bibitem_form->key)); inset->setOptions(fl_get_input(bibitem_form->label)); fl_hide_form(bibitem_form->bibitem_form); // Does look like a hack? It is! (but will change at 0.13) -#ifdef MOVE_TEXT current_view->text->RedoParagraph(); current_view->update(1); -#else - current_view->buffer()->text->RedoParagraph(); - current_view->buffer()->update(1); -#endif break; } // fall through to Cancel on RO-mode } @@ -81,27 +75,27 @@ extern "C" void bibitem_cb(FL_OBJECT *, long data) FD_citation_form * create_form_citation_form(void) { FL_OBJECT * obj; - FD_citation_form *fdui = (FD_citation_form *) fl_calloc(1, sizeof(FD_citation_form)); + FD_citation_form * fdui = (FD_citation_form *) fl_calloc(1, sizeof(FD_citation_form)); fdui->citation_form = fl_bgn_form(FL_NO_BOX, 220, 130); obj = fl_add_box(FL_UP_BOX, 0, 0, 220, 130, ""); fdui->key = obj = fl_add_text(FL_NORMAL_TEXT, 20, 10, 60, 30, _("Key:")); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_lalign(obj, FL_ALIGN_RIGHT); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_lalign(obj, FL_ALIGN_RIGHT); bibcombox = new Combox(FL_COMBOX_INPUT); bibcombox->add(80, 10, 130, 30, 120); obj = fl_add_button(FL_RETURN_BUTTON, 20, 90, 90, 30, _("OK")); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, bibitem_cb, 1); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_callback(obj, bibitem_cb, 1); obj = fl_add_button(FL_NORMAL_BUTTON, 120, 90, 90, 30, idex(_("Cancel|^["))); - fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, bibitem_cb, 0); + fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_callback(obj, bibitem_cb, 0); fdui->label = obj = fl_add_input(FL_NORMAL_INPUT, 80, 50, 130, 30, idex(_("Remark:|#R"))); - fl_set_input_shortcut(obj, scex(_("Remark:|#R")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_input_shortcut(obj, scex(_("Remark:|#R")), 1); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_end_form(); //fdui->citation_form->fdui = fdui; @@ -113,23 +107,23 @@ FD_citation_form * create_form_citation_form(void) FD_bibitem_form * create_form_bibitem_form(void) { FL_OBJECT * obj; - FD_bibitem_form *fdui = (FD_bibitem_form *) fl_calloc(1, sizeof(FD_bibitem_form)); + FD_bibitem_form * fdui = (FD_bibitem_form *) fl_calloc(1, sizeof(FD_bibitem_form)); fdui->bibitem_form = fl_bgn_form(FL_NO_BOX, 220, 130); obj = fl_add_box(FL_UP_BOX, 0, 0, 220, 130, ""); fdui->key = obj = fl_add_input(FL_NORMAL_INPUT, 80, 10, 130, 30, idex(_("Key:|#K"))); - fl_set_input_shortcut(obj, scex(_("Key:|#K")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_input_shortcut(obj, scex(_("Key:|#K")), 1); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); obj = fl_add_button(FL_RETURN_BUTTON, 20, 90, 90, 30, _("OK")); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, bibitem_cb, 3); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_callback(obj, bibitem_cb, 3); obj = fl_add_button(FL_NORMAL_BUTTON, 120, 90, 90, 30, idex(_("Cancel|^["))); - fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, bibitem_cb, 2); + fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_callback(obj, bibitem_cb, 2); fdui->label = obj = fl_add_input(FL_NORMAL_INPUT, 80, 50, 130, 30, idex(_("Label:|#L"))); - fl_set_input_shortcut(obj, scex(_("Label:|#L")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_input_shortcut(obj, scex(_("Label:|#L")), 1); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_end_form(); //fdui->bibitem_form->fdui = fdui; @@ -175,7 +169,8 @@ void InsetCitation::Edit(int, int) if (citation_form->citation_form->visible) { fl_raise_form(citation_form->citation_form); } else { - fl_show_form(citation_form->citation_form, FL_PLACE_MOUSE, FL_FULLBORDER, + fl_show_form(citation_form->citation_form, + FL_PLACE_MOUSE, FL_FULLBORDER, _("Citation")); } } @@ -215,7 +210,7 @@ InsetBibKey::~InsetBibKey() { if(bibitem_form && bibitem_form->bibitem_form && bibitem_form->bibitem_form->visible) - fl_hide_form(bibitem_form->bibitem_form); + fl_hide_form(bibitem_form->bibitem_form); } void InsetBibKey::setCounter(int c) @@ -484,7 +479,7 @@ int bibitemMaxWidth(LyXFont const & font) while (par) { if (par->bibkey) { int wx = par->bibkey->Width(font); - if (wx>w) w = wx; + if (wx > w) w = wx; } par = par->next; } @@ -504,7 +499,7 @@ string bibitemWidthest() while (par) { if (par->bibkey) { int wx = par->bibkey->Width(font); - if (wx>w) { + if (wx > w) { w = wx; bkey = par->bibkey; } diff --git a/src/insets/insetlatexaccent.C b/src/insets/insetlatexaccent.C index 8b018478a1..53df124be1 100644 --- a/src/insets/insetlatexaccent.C +++ b/src/insets/insetlatexaccent.C @@ -24,7 +24,7 @@ extern LyXRC * lyxrc; /* LatexAccent. Proper handling of accented characters */ /* This part is done by Ivan Schreter, schreter@ccsun.tuke.sk */ -/* Later modified by Lars G. Bjonnes, larsbj@ifi.uio.no */ +/* Later modified by Lars G. Bjønnes, larsbj@lyx.org */ InsetLatexAccent::InsetLatexAccent() { @@ -33,13 +33,13 @@ InsetLatexAccent::InsetLatexAccent() InsetLatexAccent::InsetLatexAccent(InsetLatexAccent const & other) - : Inset(), contents(other.contents), - candisp(other.candisp), - modtype(other.modtype), - remdot(other.remdot), - plusasc(other.plusasc), - plusdesc(other.plusdesc), - ic(other.ic) + : Inset(), contents(other.contents), + candisp(other.candisp), + modtype(other.modtype), + remdot(other.remdot), + plusasc(other.plusasc), + plusdesc(other.plusdesc), + ic(other.ic) {} @@ -199,7 +199,7 @@ void InsetLatexAccent::checkContents() // special clause for \i{}, \j{} \l{} and \L{} if ((modtype == DOT_LESS_I || modtype == DOT_LESS_J - || modtype == lSLASH || modtype == LSLASH) + || modtype == lSLASH || modtype == LSLASH) && contents[3] == '}' ) { switch (modtype) { case DOT_LESS_I: ic = 'i'; break; @@ -218,7 +218,7 @@ void InsetLatexAccent::checkContents() << ", bot: " << plusdesc << ", dot: " << remdot << ", mod: " << modtype << endl; - // Special case for space + // Special case for space } else if (contents[3] == '}') { ic = ' '; } else { @@ -235,15 +235,16 @@ void InsetLatexAccent::checkContents() else return; } else if ( (ic == 'i'|| ic == 'j') && contents[4] == '}') { - // Do a rewrite: \{i} --> \{\i} - string temp = contents; - temp.erase(3, string::npos); - temp += '\\'; - temp += char(ic); - for(string::size_type j = 4; j < contents.length(); ++j) + // Do a rewrite: \{i} --> \{\i} + string temp = contents; + temp.erase(3, string::npos); + temp += '\\'; + temp += char(ic); + for(string::size_type j = 4; + j < contents.length(); ++j) temp+= contents[j]; - contents= temp; - ++i; + contents= temp; + ++i; remdot = true; } @@ -320,9 +321,9 @@ int InsetLatexAccent::Rbearing(LyXFont const & font) const bool InsetLatexAccent::DisplayISO8859_9(LyXFont font, - LyXScreen & scr, - int baseline, - float & x) + LyXScreen & scr, + int baseline, + float & x) { unsigned char tmpic = ic; @@ -337,8 +338,8 @@ bool InsetLatexAccent::DisplayISO8859_9(LyXFont font, } case BREVE: { if (ic == 'g') tmpic = 0xf0; - if (ic == 'G') tmpic = 0xd0; - break; + if (ic == 'G') tmpic = 0xd0; + break; } case UMLAUT: { @@ -476,7 +477,7 @@ void InsetLatexAccent::Draw(LyXFont font, case UNDERDOT: // underdot case DOT: // dot { - scr.drawArc(pgc, int(x2), y + (hg / 2.0), + scr.fillArc(pgc, int(x2), y + (hg / 2.0), 1, 1, 0, 360*64); break; } @@ -541,9 +542,9 @@ void InsetLatexAccent::Draw(LyXFont font, { float tmpadd = y; tmpadd += (remdot) ? - asc/3.0 : - asc/5.0; // if (remdot) -> i or j - float rad = ((hg * 4.0) / 8.0); + asc / 3.0 : + asc / 5.0; // if (remdot) -> i or j + float rad = hg / 2.0; if (rad <= 1.0) { scr.drawPoint(pgc, int(x2 - ((4.0 * hg) / 7.0)), @@ -552,12 +553,15 @@ void InsetLatexAccent::Draw(LyXFont font, int(x2 + ((4.0 * hg) / 7.0)), tmpadd); } else { - scr.drawArc(pgc, int(x2 - ((2.0 * hg) / 4.0)), + rad += .5; // this ensures that f.ex. 1.5 will + // not be rounded down to .5 and then + // converted to int = 0 + scr.fillArc(pgc, int(x2 - ((2.0 * hg) / 4.0)), tmpadd, - rad - 1, rad - 1, 0, 360*64); - scr.drawArc(pgc, int(x2 + ((2.0 * hg) / 4.0)), + rad, rad, 0, 360*64); + scr.fillArc(pgc, int(x2 + ((2.0 * hg) / 4.0)), tmpadd, - rad - 1, rad - 1, 0, 360*64); + rad, rad, 0, 360*64); } break; } diff --git a/src/intl.C b/src/intl.C index f59e997cba..eebc879f39 100644 --- a/src/intl.C +++ b/src/intl.C @@ -37,8 +37,8 @@ extern "C" void C_Intl_DispatchCallback(FL_OBJECT * ob, long code); Intl::Intl() : prim_lang(lyxrc->primary_kbmap), - sec_lang(lyxrc->secondary_kbmap), - trans(new TransManager) + sec_lang(lyxrc->secondary_kbmap), + trans(new TransManager) { keymapon = lyxrc->use_kbmap; chsetcode = 0; diff --git a/src/kbmap.C b/src/kbmap.C index 4b04792a8d..ca24e92654 100644 --- a/src/kbmap.C +++ b/src/kbmap.C @@ -39,31 +39,17 @@ enum { ModsMask = ShiftMask | ControlMask | Mod1Mask}; maxlen - length of string (including '\0') Returns : length of printed string if ok, 0 otherwise. \* ---F------------------------------------------------------------------- */ - static -int printKeysym( KeySym key, unsigned int mod, char *buf, int maxlen ) +void printKeysym( KeySym key, unsigned int mod, string & buf) { mod &= ModsMask; - // calc required length; - int len = 0; - if ( mod & ShiftMask ) len += 2; - if ( mod & ControlMask ) len += 2; - if ( mod & Mod1Mask ) len += 2; + char * s = XKeysymToString(key); - char * s = XKeysymToString( key ); - if ( s ) len += strlen( s ); - if ( len < maxlen ) { - if ( mod & ShiftMask ) { - *buf++ = 'S'; *buf++ = '-'; } - if ( mod & ControlMask ) { - *buf++ = 'C'; *buf++ = '-'; } - if ( mod & Mod1Mask ) { - *buf++ = 'M'; *buf++ = '-'; } - if ( s ) strcpy( buf, s ); - return len; - } else - return 0; + if (mod & ShiftMask) buf += "S-"; + if (mod & ControlMask) buf += "C-"; + if (mod & Mod1Mask) buf += "M-"; + if (s) buf += s; } @@ -78,41 +64,23 @@ int printKeysym( KeySym key, unsigned int mod, char *buf, int maxlen ) \* ---F------------------------------------------------------------------- */ static -int printKeyTab( kb_key * tabPt, char *buf, int maxLen ) +void printKeyTab( kb_key * tabPt, string & buf) { - int len, doneLen = 0; unsigned int ksym, mod; /* -------> Print each of the slots into buf. */ for( ; (tabPt->code & 0xffff) != NoSymbol; ++tabPt) { - if ( maxLen <= 0 ) break; - ksym = tabPt->code; mod = tabPt->mod & 0xffff; - len = printKeysym( ksym, mod, buf, maxLen ); - if ( len <= 0 ) break; - buf += len; - maxLen -= len; - doneLen += len; - - /* -------> Add space when possible. */ - if ( maxLen > 0 ) { - *buf++ = ' '; - *buf = '\0'; - maxLen--; - doneLen++; - } + printKeysym(ksym, mod, buf); + buf += ' '; } - return doneLen; } - // === kb_sequence methods ================================================ - - /* ---F+------------------------------------------------------------------ *\ Function : kb_sequence::addkey Called by : [user] @@ -123,12 +91,13 @@ int printKeyTab( kb_key * tabPt, char *buf, int maxLen ) Returns : action or -1 if error (no map defined or key not found) \* ---F------------------------------------------------------------------- */ -int kb_sequence::addkey(KeySym key, unsigned int mod, unsigned int nmod /*= 0*/) +int kb_sequence::addkey(KeySym key, + unsigned int mod, unsigned int nmod /*= 0*/) { if(length < 0) length = 0; if(length + 1 >= size) { - unsigned int * nseq = new unsigned int[size+KB_PREALLOC]; + unsigned int * nseq = new unsigned int[size + KB_PREALLOC]; size += KB_PREALLOC; memcpy(nseq, sequence, length * sizeof(unsigned int)); if(sequence != staticseq) delete sequence; @@ -209,7 +178,7 @@ int kb_sequence::parse(char const * s) } } else { int j = 0; - for(j = i; s[j] && (s[j])>' '; ++j) + for(j = i; s[j] && s[j] > ' '; ++j) tbuf[j-i] = s[j]; // (!!!check bounds :-) tbuf[j-i] = '\0'; @@ -242,11 +211,10 @@ int kb_sequence::parse(char const * s) Returns : 0, if ok, -1 if string too long \* ---F------------------------------------------------------------------- */ -int kb_sequence::print(char * buf, int maxlen, bool when_defined) const +int kb_sequence::print(string & buf, bool when_defined) const { KeySym key; unsigned int mod; - int len; int l = length; if ( l < 0 && !when_defined ) l = -l; @@ -254,21 +222,12 @@ int kb_sequence::print(char * buf, int maxlen, bool when_defined) const key = sequence[i]; mod = modifiers[i] & 0xffff; - len = printKeysym( key, mod, buf, maxlen ); // RVDK_PATCH_5 - buf += len; - maxlen -= len; - - if ( len == 0 ) { - *buf = '\0'; - return -1; - } + printKeysym(key, mod, buf); // RVDK_PATCH_5 - if(i+11) { // append a blank - *buf++ = ' '; - maxlen--; + if(i + 1 < l) { // append a blank + buf += ' '; } } - *buf = '\0'; return 0; } @@ -283,24 +242,13 @@ int kb_sequence::print(char * buf, int maxlen, bool when_defined) const Returns : 0, if ok, -1 if string too long \* ---F------------------------------------------------------------------- */ -int kb_sequence::printOptions(char * buf, int maxlen) const +int kb_sequence::printOptions(string & buf) const { - print(buf, maxlen, true); - int len = strlen(buf); - maxlen -= len; - buf += len; + print(buf, true); - if ( maxlen < 20 || !curmap ) return -1; -#ifdef WITH_WARNINGS -#warning reimplement kb_sequence using string -#endif - char s[20]; - strcpy(s, _(" options: ")); - strcpy( buf, s); - buf += strlen(s); - maxlen -= strlen(s); - - curmap->print(buf, maxlen); + if (!curmap) return -1; + buf += _(" options: "); + curmap->print(buf); return 0; } @@ -402,7 +350,10 @@ int kb_keymap::bind(char const * seq, int action) int kb_keymap::lookup(KeySym key, unsigned int mod, kb_sequence * seq) { - unsigned int hashval, ksym, msk1, msk0; +#ifndef NO_HASH + unsigned int hashval; +#endif + unsigned int ksym, msk1, msk0; kb_key * tab; //suppress modifier bits we do not handle @@ -415,6 +366,7 @@ int kb_keymap::lookup(KeySym key, unsigned int mod, kb_sequence * seq) return -1; } +#ifndef NO_HASH if(size < 0) { // --- if hash table --- hashval = ((key&0xff) ^ ((key>>8)&0xff)) % KB_HASHSIZE; tab = htable[hashval]; @@ -424,6 +376,7 @@ int kb_keymap::lookup(KeySym key, unsigned int mod, kb_sequence * seq) return -1; } } else // --- else: linear list --- +#endif tab = table; // --- now search the list of keys --- @@ -436,11 +389,11 @@ int kb_keymap::lookup(KeySym key, unsigned int mod, kb_sequence * seq) if(ksym == key && (mod & ~msk0) == msk1) { // match found: if(tab->table) { - // this is a prefix key - set new map + // this is a prefix key - set new map seq->curmap = tab->table; return 0; } else { - // final key - reset map + // final key - reset map seq->curmap = seq->stdmap; seq->delseq(); return tab->action; // ... and return action @@ -464,31 +417,22 @@ int kb_keymap::lookup(KeySym key, unsigned int mod, kb_sequence * seq) Returns : updated maxLen. \* ---F------------------------------------------------------------------- */ -int kb_keymap::print(char * buf, int maxLen) const +void kb_keymap::print(string & buf) const { - /* -----> Return when running out of string space or when keymap has no table. - Else, place a terminating newline in case no other output is generated. */ - - if ( maxLen <= 3 || !buf ) return maxLen; - if ( !table ) return maxLen; - *buf = '\0'; + // Return when keymap has no table. + if (!table) return; - /* -------> Hash table. Process each of its slots recursively and return. */ - if ( size < 0 ) { - for ( int ix = 0; (ix < KB_HASHSIZE) && (maxLen > 1); ++ix ) { + // Process each of its slots recursively and return. +#ifndef NO_HASH + if ( size < 0 ) { // Hash table + for ( int ix = 0; ix < KB_HASHSIZE; ++ix ) { if ( htable[ix] ) { - int len = printKeyTab( htable[ix], buf, maxLen ); - maxLen -= len; - buf += len; + printKeyTab(htable[ix], buf); } } - } else { - /* -------> Normal table. */ - int len = printKeyTab( table, buf, maxLen ); - maxLen -= len; - buf += len; - } - return maxLen; + } else // Normal table +#endif + printKeyTab(table, buf); } @@ -502,13 +446,13 @@ int kb_keymap::print(char * buf, int maxLen) const Returns : 0 if ok. \* ---F------------------------------------------------------------------- */ -int kb_keymap::defkey(kb_sequence *seq, int action, int idx /*= 0*/) +int kb_keymap::defkey(kb_sequence * seq, int action, int idx /*= 0*/) { unsigned int code = seq->sequence[idx]; if(code == NoSymbol) return -1; unsigned int modmsk = seq->modifiers[idx]; - kb_key *tab, **ptab; + kb_key * tab, ** ptab; // --- get list------------------------------------------------------ if(!table) { // If we don't have any yet, make an empty one @@ -517,10 +461,11 @@ int kb_keymap::defkey(kb_sequence *seq, int action, int idx /*= 0*/) tab = table; ptab = &table; size = KB_PREALLOC; - } else if(size<0) { +#ifndef NO_HASH + } else if(size < 0) { // Hash table. - int hashval = (code&0xffff); - hashval = ((hashval&0xff) ^ ((hashval>>8)&0xff)) % KB_HASHSIZE; + int hashval = code & 0xffff; + hashval = ((hashval & 0xff) ^ ((hashval >> 8) & 0xff)) % KB_HASHSIZE; tab = htable[hashval]; ptab = htable+hashval; if(!tab) { @@ -528,6 +473,7 @@ int kb_keymap::defkey(kb_sequence *seq, int action, int idx /*= 0*/) tab[0].code = NoSymbol; *ptab = tab; } +#endif } else { tab = table; ptab = &table; @@ -540,8 +486,8 @@ int kb_keymap::defkey(kb_sequence *seq, int action, int idx /*= 0*/) for(t = tab, tsize = 1; t->code != NoSymbol; ++t, ++tsize) { if(code == t->code && modmsk == t->mod) { // -- overwrite binding --- if(idx+1 == seq->length) { - char buf[20]; buf[0] = 0; - seq->print(buf, 20, true); + string buf; + seq->print(buf, true); lyxerr[Debug::KEY] << "Warning: New binding for '" << buf @@ -555,28 +501,28 @@ int kb_keymap::defkey(kb_sequence *seq, int action, int idx /*= 0*/) t->action = action; return 0; } else if (!t->table) { - char buf[20]; buf[0] = 0; - seq->print(buf, 20, true); + string buf; + seq->print(buf, true); lyxerr << "Error: New binding for '" << buf << "' is overriding old binding..." << endl; return -1; } else - return t->table->defkey(seq, action, idx+1); + return t->table->defkey(seq, action, idx + 1); } } // --- extend list if necessary ------------------------------------- if(tsize % KB_PREALLOC == 0) { - kb_key * nt = new kb_key[tsize+KB_PREALLOC]; + kb_key * nt = new kb_key[tsize + KB_PREALLOC]; // Set to 0 as table is used uninitialised later (thornley) nt[tsize].table = 0; memcpy(nt, tab, tsize * sizeof(kb_key)); *ptab = nt; delete[] tab; tab = nt; - if(size>= 0) size = tsize + KB_PREALLOC; + if(size >= 0) size = tsize + KB_PREALLOC; } // --- add action --------------------------------------------------- @@ -588,6 +534,7 @@ int kb_keymap::defkey(kb_sequence *seq, int action, int idx /*= 0*/) // --- convert list to hash table if necessary ---------------------- +#ifndef NO_HASH if(size >= 0 && tsize >= 32) { kb_key * oldtab = tab; kb_key ** nht = new kb_key*[KB_HASHSIZE]; @@ -630,7 +577,7 @@ int kb_keymap::defkey(kb_sequence *seq, int action, int idx /*= 0*/) } delete[] oldtab; } - +#endif // --- define rest of sequence -------------------------------------- if(idx+1 == seq->length) { @@ -656,6 +603,7 @@ int kb_keymap::defkey(kb_sequence *seq, int action, int idx /*= 0*/) kb_keymap::~kb_keymap() { if(!table) return; +#ifndef NO_HASH if(size < 0) { for(int i = 0; i < KB_HASHSIZE; ++i) { if(htable[i]) { @@ -668,25 +616,32 @@ kb_keymap::~kb_keymap() } delete htable; } else { +#endif for(kb_key * t = table; t->code != NoSymbol; ++t) if(t->table) delete t->table; delete table; +#ifndef NO_HASH } +#endif } -string keyname(kb_key k) { - char buf[100]; - printKeysym(k.code, k.mod, buf, 100); + +string keyname(kb_key k) +{ + string buf; + printKeysym(k.code, k.mod, buf); return buf; } + // Finds a key for a keyaction, if possible -string kb_keymap::findbinding(int act) const { +string kb_keymap::findbinding(int act) const +{ string res; - if (!table) - return res; + if (!table) return res; +#ifndef NO_HASH if (size < 0) { for(int i = 0; i < KB_HASHSIZE; ++i) { if(htable[i]) { @@ -707,6 +662,7 @@ string kb_keymap::findbinding(int act) const { } } } else { +#endif for(kb_key * t = table; t->code != NoSymbol; ++t) { if(t->table) { string suffix = t->table->findbinding(act); @@ -720,7 +676,9 @@ string kb_keymap::findbinding(int act) const { res += "[" + keyname(*t) + "] "; } } +#ifndef NO_HASH } +#endif return res; } diff --git a/src/kbmap.h b/src/kbmap.h index d61f539695..3cb9a69f29 100644 --- a/src/kbmap.h +++ b/src/kbmap.h @@ -17,10 +17,13 @@ #include "LString.h" +#define NO_HASH 1 + #define KB_PREALLOC 16 +#ifndef NO_HASH #define KB_HASHSIZE 128 // yes, yes - I know. 128 is not exactly prime :-) // ... but we are dealing with ASCII chars mostly. - +#endif class kb_keymap; class kb_sequence; @@ -53,11 +56,11 @@ public: /// Bind a key-sequence to an action /** Returns 0 on success. Otherwise, position in string where - error occured. */ + error occured. */ int bind(char const * seq, int action); - + /// - int print(char * buf, int maxlen) const; + void print(string & buf) const; /// Look up a key in the keymap int lookup(KeySym key, unsigned mod, kb_sequence * seq); @@ -69,18 +72,21 @@ private: int defkey(kb_sequence * seq, int action, int idx = 0); /// Size of the table (<0: hashtab) - int size; + int size; /// Holds the defined keys /** Both kinds of tables ends with NoSymbol */ +#ifndef NO_HASH union { +#endif /// Table for linear array kb_key * table; - +#ifndef NO_HASH /// Hash table holding key lists kb_key ** htable; }; +#endif }; @@ -101,23 +107,23 @@ public: /// ~kb_sequence() - { - if (sequence != staticseq) { - delete sequence; - delete modifiers; + { + if (sequence != staticseq) { + delete sequence; + delete modifiers; + } } - } /// Add a key to the key sequence and look it up in the curmap /** Add a key to the key sequence and look it up in the curmap - if the latter is defined. */ + if the latter is defined. */ int addkey(KeySym key, unsigned mod, unsigned nmod = 0); - + /// - int print(char * buf, int maxlen, bool when_defined = false) const; //RVDK_PATCH_5 + int print(string & buf, bool when_defined = false) const; /// - int printOptions(char * buf, int maxlen) const; + int printOptions(string & buf) const; /// Make length negative to mark the sequence as deleted void delseq(); diff --git a/src/layout.h b/src/layout.h index 69c358a416..ad4c598b4c 100644 --- a/src/layout.h +++ b/src/layout.h @@ -82,6 +82,8 @@ enum LyXAlignment { /// LYX_ALIGN_SPECIAL = 32 }; + + inline void operator|=(LyXAlignment & la1, LyXAlignment la2) { la1 = static_cast(la1 | la2); } @@ -187,7 +189,9 @@ public: string const & labelstring() const { return labelstring_; } string const & preamble() const { return preamble_; } string const & latexparam() const { return latexparam_; } - string const & labelstring_appendix() const { return labelstring_appendix_; } + string const & labelstring_appendix() const { + return labelstring_appendix_; + } /** Default font for this layout/environment. The main font for this kind of environment. If an attribute has LyXFont::INHERITED_*, it means that the value is specified by @@ -290,7 +294,7 @@ public: } /// bool isCommand() const { - return latextype == LATEX_COMMAND; + return latextype == LATEX_COMMAND; } /// bool isEnvironment() const { @@ -475,12 +479,14 @@ private: bool loaded; }; + /// inline void operator|=(LyXTextClass::Provides & p1, LyXTextClass::Provides p2) { p1 = static_cast(p1 | p2); } + /// inline ostream & operator<<(ostream & os, LyXTextClass::PageSides p) { @@ -495,6 +501,7 @@ inline ostream & operator<<(ostream & os, LyXTextClass::PageSides p) return os; } + /// class LyXTextClassList { public: diff --git a/src/lyx_cb.C b/src/lyx_cb.C index 72f6bc6a48..be0845da30 100644 --- a/src/lyx_cb.C +++ b/src/lyx_cb.C @@ -296,11 +296,7 @@ void SetUpdateTimer(float time) void BeforeChange() { current_view->getScreen()->ToggleSelection(); -#ifdef MOVE_TEXT current_view->text->ClearSelection(); -#else - current_view->buffer()->text->ClearSelection(); -#endif FreeUpdateTimer(); } @@ -310,27 +306,17 @@ void SmallUpdate(signed char f) { current_view->getScreen()->SmallUpdate(); if (current_view->getScreen()->TopCursorVisible() - != current_view->getScreen()->first){ -#ifdef MOVE_TEXT + != current_view->getScreen()->first) { current_view->update(f); -#else - current_view->buffer()->update(f); -#endif return; } current_view->fitCursor(); current_view->updateScrollbar(); -#ifdef MOVE_TEXT if (!current_view->text->selection) current_view->text->sel_cursor = current_view->text->cursor; -#else - if (!current_view->buffer()->text->selection) - current_view->buffer()->text->sel_cursor = - current_view->buffer()->text->cursor; -#endif if (f == 1 || f == -1) { if (current_view->buffer()->isLyxClean()) { @@ -360,8 +346,8 @@ void MenuWrite(Buffer * buf) string fname = buf->fileName(); string s = MakeAbsPath(fname); if (AskQuestion(_("Save failed. Rename and try again?"), - MakeDisplayPath(s, 50), - _("(If not, document is not saved.)"))) { + MakeDisplayPath(s, 50), + _("(If not, document is not saved.)"))) { MenuWriteAs(buf); } } else { @@ -373,11 +359,7 @@ void MenuWrite(Buffer * buf) // should be moved to BufferView.C void MenuWriteAs(Buffer * buffer) { -#ifdef MOVE_TEXT if (!current_view->text) return; -#else - if (!buffer->text) return; -#endif string fname = buffer->fileName(); string oldname = fname; @@ -543,13 +525,8 @@ int MenuRunChktex(Buffer * buffer) int MakeDVIOutput(Buffer * buffer) { -#ifdef MOVE_TEXT if (!(current_view->text)) return 1; -#else - if (!(buffer->text)) - return 1; -#endif int ret = 0; @@ -631,7 +608,7 @@ bool RunScript(Buffer * buffer, bool wait, } else { minibuffer->Set(_("Executing command:"), cmd); result = one.startscript(wait ? Systemcalls::Wait - : Systemcalls::DontWait, cmd); + : Systemcalls::DontWait, cmd); } return (result == 0); } @@ -640,13 +617,8 @@ bool RunScript(Buffer * buffer, bool wait, // Returns false if we fail bool MenuRunDvips(Buffer * buffer, bool wait = false) { -#ifdef MOVE_TEXT if (!current_view->text) return false; -#else - if (!buffer->text) - return false; -#endif ProhibitInput(); @@ -657,7 +629,7 @@ bool MenuRunDvips(Buffer * buffer, bool wait = false) } // Generate postscript file string psname = ChangeExtension (buffer->fileName(), - ".ps_tmp", true); + ".ps_tmp", true); string paper; @@ -731,13 +703,8 @@ bool MenuRunDvips(Buffer * buffer, bool wait = false) // Returns false if we fail bool MenuPreviewPS(Buffer * buffer) { -#ifdef MOVE_TEXT if (!current_view->text) return false; -#else - if (!buffer->text) - return false; -#endif // Generate postscript file if (!MenuRunDvips(buffer, true)) { @@ -747,7 +714,7 @@ bool MenuPreviewPS(Buffer * buffer) // Start postscript viewer ProhibitInput(); string ps = ChangeExtension (buffer->fileName(), - ".ps_tmp", true); + ".ps_tmp", true); // push directorypath, if necessary string path = OnlyPath(buffer->fileName()); if (lyxrc->use_tempdir || (IsDirWriteable(path) < 1)){ @@ -762,13 +729,8 @@ bool MenuPreviewPS(Buffer * buffer) void MenuFax(Buffer * buffer) { -#ifdef MOVE_TEXT if (!current_view->text) return; -#else - if (!buffer->text) - return; -#endif // Generate postscript file if (!MenuRunDvips(buffer, true)) { @@ -794,13 +756,9 @@ void MenuFax(Buffer * buffer) // Returns false if we fail bool MenuPreview(Buffer * buffer) { -#ifdef MOVE_TEXT if (!current_view->text) return false; -#else - if (!buffer->text) - return false; -#endif + string paper; char real_papersize = buffer->params.papersize; @@ -859,13 +817,8 @@ bool MenuPreview(Buffer * buffer) void MenuMakeLaTeX(Buffer * buffer) { -#ifdef MOVE_TEXT if (!current_view->text) return; -#else - if (!buffer->text) - return; -#endif // Get LaTeX-Filename string s = buffer->getLatexName(); @@ -877,7 +830,7 @@ void MenuMakeLaTeX(Buffer * buffer) _("Do you want to overwrite the file?"))) { minibuffer->Set(_("Canceled")); return; - } + } if (buffer->isDocBook()) minibuffer->Set(_("DocBook does not have a latex backend")); @@ -895,11 +848,7 @@ void MenuMakeLaTeX(Buffer * buffer) void MenuMakeLinuxDoc(Buffer * buffer) { -#ifdef MOVE_TEXT if (!current_view->text) return; -#else - if (!buffer->text) return; -#endif if (!buffer->isLinuxDoc()) { WriteAlert(_("Error!"), _("Document class must be linuxdoc.")); @@ -931,11 +880,7 @@ void MenuMakeLinuxDoc(Buffer * buffer) void MenuMakeDocBook(Buffer * buffer) { -#ifdef MOVE_TEXT if (!current_view->text) return; -#else - if (!buffer->text) return; -#endif if (!buffer->isDocBook()) { WriteAlert(_("Error!"), @@ -968,11 +913,7 @@ void MenuMakeDocBook(Buffer * buffer) void MenuMakeAscii(Buffer * buffer) { -#ifdef MOVE_TEXT if (!current_view->text) return; -#else - if (!buffer->text) return; -#endif /* get LaTeX-Filename */ string s = ChangeExtension (buffer->fileName(), @@ -995,16 +936,12 @@ void MenuMakeAscii(Buffer * buffer) void MenuPrint(Buffer * buffer) { -#ifdef MOVE_TEXT if (!current_view->text) return; -#else - if (!buffer->text) - return; -#endif + string input_file = ChangeExtension(buffer->fileName(), - lyxrc->print_file_extension, - true); + lyxrc->print_file_extension, + true); fl_set_input(fd_form_print->input_file, input_file.c_str()); if (fd_form_print->form_print->visible) { @@ -1050,7 +987,7 @@ void MenuExport(Buffer * buffer, string const & extyp) { // latex if (extyp == "latex") { - // make sure that this buffer is not linuxdoc + // make sure that this buffer is not linuxdoc MenuMakeLaTeX(buffer); } // linuxdoc @@ -1060,16 +997,16 @@ void MenuExport(Buffer * buffer, string const & extyp) } // docbook else if (extyp == "docbook") { - // make sure that this buffer is not latex or linuxdoc + // make sure that this buffer is not latex or linuxdoc MenuMakeDocBook(buffer); } // dvi else if (extyp == "dvi") { - // Run LaTeX as "Update dvi..." Bernhard. - // We want the dvi in the current directory. This - // is achieved by temporarily disabling use of - // temp directory. As a side-effect, we get - // *.log and *.aux files also. (Asger) + // Run LaTeX as "Update dvi..." Bernhard. + // We want the dvi in the current directory. This + // is achieved by temporarily disabling use of + // temp directory. As a side-effect, we get + // *.log and *.aux files also. (Asger) bool flag = lyxrc->use_tempdir; lyxrc->use_tempdir = false; MenuRunLaTeX(buffer); @@ -1077,7 +1014,7 @@ void MenuExport(Buffer * buffer, string const & extyp) } // postscript else if (extyp == "postscript") { - // Start Print-dialog. Not as good as dvi... Bernhard. + // Start Print-dialog. Not as good as dvi... Bernhard. MenuPrint(buffer); // Since the MenuPrint is a pop-up, we can't use // the same trick as above. (Asger) @@ -1272,21 +1209,12 @@ void InsertAsciiFile(string const & f, bool asParagraph) // clear the selection BeforeChange(); -#ifdef MOVE_TEXT if (!asParagraph) current_view->text->InsertStringA(tmppar->text); else current_view->text->InsertStringB(tmppar->text); delete tmppar; current_view->update(1); -#else - if (!asParagraph) - current_view->buffer()->text->InsertStringA(tmppar->text); - else - current_view->buffer()->text->InsertStringB(tmppar->text); - delete tmppar; - current_view->buffer()->update(1); -#endif } @@ -1373,15 +1301,9 @@ extern "C" void FootCB(FL_OBJECT *, long) minibuffer->Set(_("Inserting Footnote...")); current_view->getScreen()->HideCursor(); -#ifdef MOVE_TEXT current_view->update(-2); current_view->text->InsertFootnoteEnvironment(LyXParagraph::FOOTNOTE); current_view->update(1); -#else - current_view->buffer()->update(-2); - current_view->buffer()->text->InsertFootnoteEnvironment(LyXParagraph::FOOTNOTE); - current_view->buffer()->update(1); -#endif } @@ -1390,7 +1312,7 @@ void LayoutsCB(int sel, void *) { string tmp = tostr(sel); current_view->owner()->getLyXFunc()->Dispatch(LFUN_LAYOUTNO, - tmp.c_str()); + tmp.c_str()); } @@ -1534,11 +1456,7 @@ void AllFloats(char flag, char figmar) if (!current_view->available()) return; -#ifdef MOVE_TEXT LyXCursor cursor = current_view->text->cursor; -#else - LyXCursor cursor = current_view->buffer()->text->cursor; -#endif if (!flag && cursor.par->footnoteflag != LyXParagraph::NO_FOOTNOTE && ((figmar @@ -1577,17 +1495,11 @@ void AllFloats(char flag, char figmar) if (par->previous && par->previous->footnoteflag != LyXParagraph::CLOSED_FOOTNOTE){ /* should be */ -#ifdef MOVE_TEXT current_view->text ->SetCursorIntern(par ->previous, 0); current_view->text->OpenFootnote(); -#else - current_view->buffer()->text->SetCursorIntern(par->previous, - 0); - current_view->buffer()->text->OpenFootnote(); -#endif } } } @@ -1614,24 +1526,15 @@ void AllFloats(char flag, char figmar) par->footnotekind != LyXParagraph::ALGORITHM ) ) - ){ -#ifdef MOVE_TEXT + ) { current_view->text->SetCursorIntern(par, 0); current_view->text->CloseFootnote(); -#else - current_view->buffer()->text->SetCursorIntern(par, 0); - current_view->buffer()->text->CloseFootnote(); -#endif } } par = par->next; } -#ifdef MOVE_TEXT current_view->text->SetCursorIntern(cursor.par, cursor.pos); -#else - current_view->buffer()->text->SetCursorIntern(cursor.par, cursor.pos); -#endif current_view->redraw(); current_view->fitCursor(); current_view->updateScrollbar(); @@ -1721,7 +1624,6 @@ inline void EnableParagraphLayout () } -#ifdef MOVE_TEXT bool UpdateLayoutParagraph() { if (!current_view->getScreen() || !current_view->available()) { @@ -1742,7 +1644,7 @@ bool UpdateLayoutParagraph() int align = current_view->text->cursor.par->GetAlign(); if (align == LYX_ALIGN_LAYOUT) align = textclasslist.Style(buf->params.textclass, - current_view->text->cursor.par->GetLayout()).align; + current_view->text->cursor.par->GetLayout()).align; switch (align) { case LYX_ALIGN_RIGHT: @@ -1844,130 +1746,7 @@ bool UpdateLayoutParagraph() } return true; } -#else -bool UpdateLayoutParagraph() -{ - if (!current_view->getScreen() || !current_view->available()) { - if (fd_form_paragraph->form_paragraph->visible) - fl_hide_form(fd_form_paragraph->form_paragraph); - return false; - } - - Buffer * buf = current_view->buffer(); - - fl_set_input(fd_form_paragraph->input_labelwidth, - buf->text->cursor.par->GetLabelWidthString().c_str()); - fl_set_button(fd_form_paragraph->radio_align_right, 0); - fl_set_button(fd_form_paragraph->radio_align_left, 0); - fl_set_button(fd_form_paragraph->radio_align_center, 0); - fl_set_button(fd_form_paragraph->radio_align_block, 0); - - int align = buf->text->cursor.par->GetAlign(); - if (align == LYX_ALIGN_LAYOUT) - align = textclasslist.Style(buf->params.textclass, - buf->text->cursor.par->GetLayout()).align; - - switch (align) { - case LYX_ALIGN_RIGHT: - fl_set_button(fd_form_paragraph->radio_align_right, 1); - break; - case LYX_ALIGN_LEFT: - fl_set_button(fd_form_paragraph->radio_align_left, 1); - break; - case LYX_ALIGN_CENTER: - fl_set_button(fd_form_paragraph->radio_align_center, 1); - break; - default: - fl_set_button(fd_form_paragraph->radio_align_block, 1); - break; - } - - fl_set_button(fd_form_paragraph->check_lines_top, - buf->text->cursor.par->FirstPhysicalPar()->line_top); - fl_set_button(fd_form_paragraph->check_lines_bottom, - buf->text->cursor.par->FirstPhysicalPar()->line_bottom); - fl_set_button(fd_form_paragraph->check_pagebreaks_top, - buf->text->cursor.par->FirstPhysicalPar()->pagebreak_top); - fl_set_button(fd_form_paragraph->check_pagebreaks_bottom, - buf->text->cursor.par->FirstPhysicalPar()->pagebreak_bottom); - fl_set_button(fd_form_paragraph->check_noindent, - buf->text->cursor.par->FirstPhysicalPar()->noindent); - fl_set_input (fd_form_paragraph->input_space_above, ""); - - switch (buf->text->cursor.par->FirstPhysicalPar()->added_space_top.kind()) { - case VSpace::NONE: - fl_set_choice (fd_form_paragraph->choice_space_above, 1); - break; - case VSpace::DEFSKIP: - fl_set_choice (fd_form_paragraph->choice_space_above, 2); - break; - case VSpace::SMALLSKIP: - fl_set_choice (fd_form_paragraph->choice_space_above, 3); - break; - case VSpace::MEDSKIP: - fl_set_choice (fd_form_paragraph->choice_space_above, 4); - break; - case VSpace::BIGSKIP: - fl_set_choice (fd_form_paragraph->choice_space_above, 5); - break; - case VSpace::VFILL: - fl_set_choice (fd_form_paragraph->choice_space_above, 6); - break; - case VSpace::LENGTH: - fl_set_choice (fd_form_paragraph->choice_space_above, 7); - fl_set_input (fd_form_paragraph->input_space_above, - buf->text->cursor.par->FirstPhysicalPar()->added_space_top.length().asString().c_str()); - break; - } - fl_set_button (fd_form_paragraph->check_space_above, - buf->text->cursor.par->FirstPhysicalPar()->added_space_top.keep()); - fl_set_input (fd_form_paragraph->input_space_below, ""); - switch (buf->text->cursor.par->FirstPhysicalPar()->added_space_bottom.kind()) { - case VSpace::NONE: - fl_set_choice (fd_form_paragraph->choice_space_below, - 1); - break; - case VSpace::DEFSKIP: - fl_set_choice (fd_form_paragraph->choice_space_below, - 2); - break; - case VSpace::SMALLSKIP: - fl_set_choice (fd_form_paragraph->choice_space_below, - 3); - break; - case VSpace::MEDSKIP: - fl_set_choice (fd_form_paragraph->choice_space_below, - 4); - break; - case VSpace::BIGSKIP: - fl_set_choice (fd_form_paragraph->choice_space_below, - 5); - break; - case VSpace::VFILL: - fl_set_choice (fd_form_paragraph->choice_space_below, - 6); - break; - case VSpace::LENGTH: - fl_set_choice (fd_form_paragraph->choice_space_below, - 7); - fl_set_input (fd_form_paragraph->input_space_below, - buf->text->cursor.par->FirstPhysicalPar()->added_space_bottom.length().asString().c_str()); - break; - } - fl_set_button (fd_form_paragraph->check_space_below, - buf->text->cursor.par->FirstPhysicalPar()->added_space_bottom.keep()); - fl_set_button(fd_form_paragraph->check_noindent, - buf->text->cursor.par->FirstPhysicalPar()->noindent); - - if (current_view->buffer()->isReadonly()) { - DisableParagraphLayout(); - } else { - EnableParagraphLayout(); - } - return true; -} -#endif void MenuLayoutParagraph() { @@ -2248,7 +2027,7 @@ bool UpdateLayoutQuotes() if (update) { fl_set_choice(fd_form_quotes->choice_quotes_language, - current_view->buffer()->params.quotes_language + 1); + current_view->buffer()->params.quotes_language + 1); fl_set_button(fd_form_quotes->radio_single, 0); fl_set_button(fd_form_quotes->radio_double, 0); @@ -2281,25 +2060,25 @@ bool UpdateLayoutPreamble() { bool update = true; if (!current_view->getScreen() || ! current_view->available()) - update = false; + update = false; if (update) { fl_set_input(fd_form_preamble->input_preamble, - current_view->buffer()->params.preamble.c_str()); + current_view->buffer()->params.preamble.c_str()); if (current_view->buffer()->isReadonly()) { - fl_deactivate_object(fd_form_preamble->input_preamble); - fl_deactivate_object(fd_form_preamble->button_ok); - fl_deactivate_object(fd_form_preamble->button_apply); - fl_set_object_lcol(fd_form_preamble->button_ok, FL_INACTIVE); - fl_set_object_lcol(fd_form_preamble->button_apply, FL_INACTIVE); + fl_deactivate_object(fd_form_preamble->input_preamble); + fl_deactivate_object(fd_form_preamble->button_ok); + fl_deactivate_object(fd_form_preamble->button_apply); + fl_set_object_lcol(fd_form_preamble->button_ok, FL_INACTIVE); + fl_set_object_lcol(fd_form_preamble->button_apply, FL_INACTIVE); } else { - fl_activate_object(fd_form_preamble->input_preamble); - fl_activate_object(fd_form_preamble->button_ok); - fl_activate_object(fd_form_preamble->button_apply); - fl_set_object_lcol(fd_form_preamble->button_ok, FL_BLACK); - fl_set_object_lcol(fd_form_preamble->button_apply, FL_BLACK); + fl_activate_object(fd_form_preamble->input_preamble); + fl_activate_object(fd_form_preamble->button_ok); + fl_activate_object(fd_form_preamble->button_apply); + fl_set_object_lcol(fd_form_preamble->button_ok, FL_BLACK); + fl_set_object_lcol(fd_form_preamble->button_apply, FL_BLACK); } } else if (fd_form_preamble->form_preamble->visible) { fl_hide_form(fd_form_preamble->form_preamble); @@ -2333,7 +2112,7 @@ void MenuLayoutPreamble() void MenuLayoutSave() { if (!current_view->getScreen() || ! current_view->available()) - return; + return; if (AskQuestion(_("Do you want to save the current settings"), _("for Character, Document, Paper and Quotes"), @@ -2358,15 +2137,9 @@ void OpenStuff() minibuffer->Set(_("Open/Close...")); current_view->getScreen()->HideCursor(); BeforeChange(); -#ifdef MOVE_TEXT current_view->update(-2); current_view->text->OpenStuff(); current_view->update(0); -#else - current_view->buffer()->update(-2); - current_view->buffer()->text->OpenStuff(); - current_view->buffer()->update(0); -#endif } } @@ -2378,15 +2151,9 @@ void ToggleFloat() minibuffer->Set(_("Open/Close...")); current_view->getScreen()->HideCursor(); BeforeChange(); -#ifdef MOVE_TEXT current_view->update(-2); current_view->text->ToggleFootnote(); current_view->update(0); -#else - current_view->buffer()->update(-2); - current_view->buffer()->text->ToggleFootnote(); - current_view->buffer()->update(0); -#endif } } @@ -2395,27 +2162,19 @@ void ToggleFloat() void MenuUndo() { /* if (current_view->buffer()->the_locking_inset) { - minibuffer->Set(_("Undo not yet supported in math mode")); - return; + minibuffer->Set(_("Undo not yet supported in math mode")); + return; }*/ if (current_view->available()) { minibuffer->Set(_("Undo")); current_view->getScreen()->HideCursor(); BeforeChange(); -#ifdef MOVE_TEXT current_view->update(-2); if (!current_view->text->TextUndo()) minibuffer->Set(_("No further undo information")); else current_view->update(-1); -#else - current_view->buffer()->update(-2); - if (!current_view->buffer()->text->TextUndo()) - minibuffer->Set(_("No further undo information")); - else - current_view->buffer()->update(-1); -#endif } } @@ -2432,19 +2191,11 @@ void MenuRedo() minibuffer->Set(_("Redo")); current_view->getScreen()->HideCursor(); BeforeChange(); -#ifdef MOVE_TEXT current_view->update(-2); if (!current_view->text->TextRedo()) minibuffer->Set(_("No further redo information")); else current_view->update(-1); -#else - current_view->buffer()->update(-2); - if (!current_view->buffer()->text->TextRedo()) - minibuffer->Set(_("No further redo information")); - else - current_view->buffer()->update(-1); -#endif } } @@ -2454,11 +2205,7 @@ void HyphenationPoint() { if (current_view->available()) { current_view->getScreen()->HideCursor(); -#ifdef MOVE_TEXT current_view->update(-2); -#else - current_view->buffer()->update(-2); -#endif InsetSpecialChar * new_inset = new InsetSpecialChar(InsetSpecialChar::HYPHENATION); current_view->buffer()->insertInset(new_inset); @@ -2471,11 +2218,7 @@ void Ldots() { if (current_view->available()) { current_view->getScreen()->HideCursor(); -#ifdef MOVE_TEXT current_view->update(-2); -#else - current_view->buffer()->update(-2); -#endif InsetSpecialChar * new_inset = new InsetSpecialChar(InsetSpecialChar::LDOTS); current_view->buffer()->insertInset(new_inset); @@ -2486,13 +2229,9 @@ void Ldots() // candidate for move to BufferView void EndOfSentenceDot() { - if (current_view->available()) { + if (current_view->available()) { current_view->getScreen()->HideCursor(); -#ifdef MOVE_TEXT current_view->update(-2); -#else - current_view->buffer()->update(-2); -#endif InsetSpecialChar * new_inset = new InsetSpecialChar(InsetSpecialChar::END_OF_SENTENCE); current_view->buffer()->insertInset(new_inset); @@ -2503,13 +2242,9 @@ void EndOfSentenceDot() // candidate for move to BufferView void MenuSeparator() { - if (current_view->available()) { + if (current_view->available()) { current_view->getScreen()->HideCursor(); -#ifdef MOVE_TEXT current_view->update(-2); -#else - current_view->buffer()->update(-2); -#endif InsetSpecialChar * new_inset = new InsetSpecialChar(InsetSpecialChar::MENU_SEPARATOR); current_view->buffer()->insertInset(new_inset); @@ -2520,17 +2255,11 @@ void MenuSeparator() // candidate for move to BufferView void Newline() { - if (current_view->available()) { + if (current_view->available()) { current_view->getScreen()->HideCursor(); -#ifdef MOVE_TEXT current_view->update(-2); current_view->text->InsertChar(LyXParagraph::META_NEWLINE); current_view->update(-1); -#else - current_view->buffer()->update(-2); - current_view->buffer()->text->InsertChar(LyXParagraph::META_NEWLINE); - current_view->buffer()->update(-1); -#endif } } @@ -2538,17 +2267,11 @@ void Newline() // candidate for move to BufferView void ProtectedBlank() { - if (current_view->available()) { + if (current_view->available()) { current_view->getScreen()->HideCursor(); -#ifdef MOVE_TEXT current_view->update(-2); current_view->text->InsertChar(LyXParagraph::META_PROTECTED_SEPARATOR); current_view->update(-1); -#else - current_view->buffer()->update(-2); - current_view->buffer()->text->InsertChar(LyXParagraph::META_PROTECTED_SEPARATOR); - current_view->buffer()->update(-1); -#endif } } @@ -2556,17 +2279,11 @@ void ProtectedBlank() // candidate for move to BufferView void HFill() { - if (current_view->available()) { + if (current_view->available()) { current_view->getScreen()->HideCursor(); -#ifdef MOVE_TEXT current_view->update(-2); current_view->text->InsertChar(LyXParagraph::META_HFILL); current_view->update(-1); -#else - current_view->buffer()->update(-2); - current_view->buffer()->text->InsertChar(LyXParagraph::META_HFILL); - current_view->buffer()->update(-1); -#endif } } @@ -2661,7 +2378,6 @@ void StyleResetCB() * future perhaps we could try to implement a callback to the button-bar. * That is, `light' the bold button when the font is currently bold, etc. */ -#ifdef MOVE_TEXT string CurrentState() { string state; @@ -2671,7 +2387,7 @@ string CurrentState() Buffer * buffer = current_view->buffer(); LyXFont font = current_view->text->real_current_font; LyXFont defaultfont = textclasslist.TextClass(buffer-> - params.textclass).defaultfont(); + params.textclass).defaultfont(); font.reduce(defaultfont); state = _("Font: ") + font.stateText(); @@ -2681,27 +2397,7 @@ string CurrentState() } return state; } -#else -string CurrentState() -{ - string state; - if (current_view->available()) { - // I think we should only show changes from the default - // font. (Asger) - Buffer * buffer = current_view->buffer(); - LyXFont font = buffer->text->real_current_font; - LyXFont defaultfont = textclasslist.TextClass(buffer-> - params.textclass).defaultfont(); - font.reduce(defaultfont); - state = _("Font: ") + font.stateText(); - int depth = buffer->text->GetDepth(); - if (depth>0) - state += string(_(", Depth: ")) + tostr(depth); - } - return state; -} -#endif // candidate for move to BufferView /* -------> Does the actual toggle job of the XxxCB() calls above. @@ -2712,15 +2408,9 @@ void ToggleAndShow(LyXFont const & font) { if (current_view->available()) { current_view->getScreen()->HideCursor(); -#ifdef MOVE_TEXT current_view->update(-2); current_view->text->ToggleFree(font, toggleall); current_view->update(1); -#else - current_view->buffer()->update(-2); - current_view->buffer()->text->ToggleFree(font, toggleall); - current_view->buffer()->update(1); -#endif } // removed since it overrides the ToggleFree Message about the style // Since Styles are more "High Level" than raw fonts I think the user @@ -2735,15 +2425,9 @@ extern "C" void MarginCB(FL_OBJECT *, long) if (current_view->available()) { minibuffer->Set(_("Inserting margin note...")); current_view->getScreen()->HideCursor(); -#ifdef MOVE_TEXT current_view->update(-2); current_view->text->InsertFootnoteEnvironment(LyXParagraph::MARGIN); current_view->update(1); -#else - current_view->buffer()->update(-2); - current_view->buffer()->text->InsertFootnoteEnvironment(LyXParagraph::MARGIN); - current_view->buffer()->update(1); -#endif } } @@ -2776,21 +2460,12 @@ extern "C" void TableCB(FL_OBJECT *, long) void CopyEnvironmentCB() { if (current_view->available()) { -#ifdef MOVE_TEXT current_view->text->copyEnvironmentType(); /* clear the selection, even if mark_set */ current_view->getScreen()->ToggleSelection(); current_view->text->ClearSelection(); current_view->update(-2); minibuffer->Set(_("Paragraph environment type copied")); -#else - current_view->buffer()->text->copyEnvironmentType(); - /* clear the selection, even if mark_set */ - current_view->getScreen()->ToggleSelection(); - current_view->buffer()->text->ClearSelection(); - current_view->buffer()->update(-2); - minibuffer->Set(_("Paragraph environment type copied")); -#endif } } @@ -2799,15 +2474,9 @@ void CopyEnvironmentCB() void PasteEnvironmentCB() { if (current_view->available()) { -#ifdef MOVE_TEXT current_view->text->pasteEnvironmentType(); minibuffer->Set(_("Paragraph environment type set")); current_view->update(1); -#else - current_view->buffer()->text->pasteEnvironmentType(); - minibuffer->Set(_("Paragraph environment type set")); - current_view->buffer()->update(1); -#endif } } @@ -2816,21 +2485,12 @@ void PasteEnvironmentCB() void CopyCB() { if (current_view->available()) { -#ifdef MOVE_TEXT current_view->text->CopySelection(); /* clear the selection, even if mark_set */ current_view->getScreen()->ToggleSelection(); current_view->text->ClearSelection(); current_view->update(-2); minibuffer->Set(_("Copy")); -#else - current_view->buffer()->text->CopySelection(); - /* clear the selection, even if mark_set */ - current_view->getScreen()->ToggleSelection(); - current_view->buffer()->text->ClearSelection(); - current_view->buffer()->update(-2); - minibuffer->Set(_("Copy")); -#endif } } @@ -2840,15 +2500,9 @@ void CutCB() { if (current_view->available()) { current_view->getScreen()->HideCursor(); -#ifdef MOVE_TEXT current_view->update(-2); current_view->text->CutSelection(); current_view->update(1); -#else - current_view->buffer()->update(-2); - current_view->buffer()->text->CutSelection(); - current_view->buffer()->update(1); -#endif minibuffer->Set(_("Cut")); } } @@ -2862,7 +2516,6 @@ void PasteCB() minibuffer->Set(_("Paste")); current_view->getScreen()->HideCursor(); /* clear the selection */ -#ifdef MOVE_TEXT current_view->getScreen()->ToggleSelection(); current_view->text->ClearSelection(); current_view->update(-2); @@ -2875,20 +2528,6 @@ void PasteCB() current_view->getScreen()->ToggleSelection(); current_view->text->ClearSelection(); current_view->update(-2); -#else - current_view->getScreen()->ToggleSelection(); - current_view->buffer()->text->ClearSelection(); - current_view->buffer()->update(-2); - - /* paste */ - current_view->buffer()->text->PasteSelection(); - current_view->buffer()->update(1); - - /* clear the selection */ - current_view->getScreen()->ToggleSelection(); - current_view->buffer()->text->ClearSelection(); - current_view->buffer()->update(-2); -#endif } @@ -2900,15 +2539,9 @@ extern "C" void MeltCB(FL_OBJECT *, long) minibuffer->Set(_("Melt")); current_view->getScreen()->HideCursor(); BeforeChange(); -#ifdef MOVE_TEXT current_view->update(-2); current_view->text->MeltFootnoteEnvironment(); current_view->update(1); -#else - current_view->buffer()->update(-2); - current_view->buffer()->text->MeltFootnoteEnvironment(); - current_view->buffer()->update(1); -#endif } @@ -2932,21 +2565,12 @@ extern "C" void DepthCB(FL_OBJECT * ob, long decInc) if (current_view->available()) { current_view->getScreen()->HideCursor(); -#ifdef MOVE_TEXT current_view->update(-2); if (button == 1) current_view->text->IncDepth(); else current_view->text->DecDepth(); current_view->update(1); -#else - current_view->buffer()->update(-2); - if (button == 1) - current_view->buffer()->text->IncDepth(); - else - current_view->buffer()->text->DecDepth(); - current_view->buffer()->update(1); -#endif minibuffer->Set(_("Changed environment depth" " (in possible range, maybe not)")); } @@ -3149,7 +2773,7 @@ extern "C" void ParagraphApplyCB(FL_OBJECT *, long) case 7: space_top = VSpace(LyXGlueLength (fl_get_input (fd_form_paragraph->input_space_above))); break; } if (fl_get_button (fd_form_paragraph->check_space_above)) - space_top.setKeep (true); + space_top.setKeep (true); switch (fl_get_choice (fd_form_paragraph->choice_space_below)) { case 1: space_bottom = VSpace(VSpace::NONE); break; case 2: space_bottom = VSpace(VSpace::DEFSKIP); break; @@ -3160,7 +2784,7 @@ extern "C" void ParagraphApplyCB(FL_OBJECT *, long) case 7: space_bottom = VSpace(LyXGlueLength (fl_get_input (fd_form_paragraph->input_space_below))); break; } if (fl_get_button (fd_form_paragraph->check_space_below)) - space_bottom.setKeep (true); + space_bottom.setKeep (true); if (fl_get_button(fd_form_paragraph->radio_align_left)) align = LYX_ALIGN_LEFT; @@ -3174,7 +2798,6 @@ extern "C" void ParagraphApplyCB(FL_OBJECT *, long) labelwidthstring = fl_get_input(fd_form_paragraph->input_labelwidth); noindent = fl_get_button(fd_form_paragraph->check_noindent); -#ifdef MOVE_TEXT current_view->text->SetParagraph(line_top, line_bottom, pagebreak_top, @@ -3185,18 +2808,6 @@ extern "C" void ParagraphApplyCB(FL_OBJECT *, long) labelwidthstring, noindent); current_view->update(1); -#else - current_view->buffer()->text->SetParagraph(line_top, - line_bottom, - pagebreak_top, - pagebreak_bottom, - space_top, - space_bottom, - align, - labelwidthstring, - noindent); - current_view->buffer()->update(1); -#endif minibuffer->Set(_("Paragraph layout set")); } @@ -3381,24 +2992,14 @@ extern "C" void DocumentApplyCB(FL_OBJECT *, long) // successfully loaded redo = true; minibuffer->Set(_("Converting document to new document class...")); -#ifdef MOVE_TEXT int ret = current_view->text-> SwitchLayoutsBetweenClasses(current_view->buffer()-> params.textclass, new_class, current_view->buffer()-> paragraph); -#else - int ret = current_view->buffer()-> - text-> - SwitchLayoutsBetweenClasses(current_view->buffer()-> - params.textclass, - new_class, - current_view->buffer()-> - paragraph); -#endif - if (ret){ + if (ret) { string s; if (ret == 1) s = _("One paragraph couldn't be converted"); @@ -3523,7 +3124,6 @@ extern "C" void DocumentBulletsCB(FL_OBJECT *, long) // candidate for move to BufferView -#ifdef MOVE_TEXT void GotoNote() { if (!current_view->getScreen()) @@ -3557,41 +3157,7 @@ void GotoNote() current_view->text->sel_cursor = current_view->text->cursor; } -#else -void GotoNote() -{ - if (!current_view->getScreen()) - return; - - current_view->getScreen()->HideCursor(); - BeforeChange(); - current_view->buffer()->update(-2); - LyXCursor tmp; - - if (!current_view->buffer()->text->GotoNextNote()) { - if (current_view->buffer()->text->cursor.pos - || current_view->buffer()->text->cursor.par != - current_view->buffer()->text->FirstParagraph()) - { - tmp = current_view->buffer()->text->cursor; - current_view->buffer()->text->cursor.par = - current_view->buffer()->text->FirstParagraph(); - current_view->buffer()->text->cursor.pos = 0; - if (!current_view->buffer()->text->GotoNextNote()) { - current_view->buffer()->text->cursor = tmp; - minibuffer->Set(_("No more notes")); - LyXBell(); - } - } else { - minibuffer->Set(_("No more notes")); - LyXBell(); - } - } - current_view->buffer()->update(0); - current_view->buffer()->text->sel_cursor = - current_view->buffer()->text->cursor; -} -#endif + // candidate for move to BufferView void InsertCorrectQuote() @@ -3599,17 +3165,10 @@ void InsertCorrectQuote() Buffer * cbuffer = current_view->buffer(); char c; -#ifdef MOVE_TEXT if (current_view->text->cursor.pos ) c = current_view->text->cursor.par->GetChar(current_view->text->cursor.pos - 1); else c = ' '; -#else - if (cbuffer->text->cursor.pos ) - c = cbuffer->text->cursor.par->GetChar(cbuffer->text->cursor.pos - 1); - else - c = ' '; -#endif cbuffer->insertInset(new InsetQuotes(c, cbuffer->params)); } @@ -3699,7 +3258,6 @@ extern "C" void PreambleOKCB(FL_OBJECT * ob, long data) /* callbacks for form form_table */ -#ifdef MOVE_TEXT extern "C" void TableApplyCB(FL_OBJECT *, long) { if (!current_view->getScreen()) @@ -3777,85 +3335,7 @@ extern "C" void TableApplyCB(FL_OBJECT *, long) current_view->update(1); minibuffer->Set(_("Table inserted")); } -#else -extern "C" void TableApplyCB(FL_OBJECT *, long) -{ - if (!current_view->getScreen()) - return; - - // check for tables in tables - if (current_view->buffer()->text->cursor.par->table){ - WriteAlert(_("Impossible Operation!"), - _("Cannot insert table in table."), - _("Sorry.")); - return; - } - - minibuffer->Set(_("Inserting table...")); - - int ysize = int(fl_get_slider_value(fd_form_table->slider_columns) + 0.5); - int xsize = int(fl_get_slider_value(fd_form_table->slider_rows) + 0.5); - - - current_view->getScreen()->HideCursor(); - BeforeChange(); - current_view->buffer()->update(-2); - - current_view->buffer()->text->SetCursorParUndo(); - current_view->buffer()->text->FreezeUndo(); - current_view->buffer()->text->BreakParagraph(); - current_view->buffer()->update(-1); - - if (current_view->buffer()->text->cursor.par->Last()) { - current_view->buffer()->text->CursorLeft(); - - current_view->buffer()->text->BreakParagraph(); - current_view->buffer()->update(-1); - } - - current_view->buffer()->text->current_font.setLatex(LyXFont::OFF); - //if (!fl_get_button(fd_form_table->check_latex)){ - // insert the new wysiwy table - current_view->buffer()->text->SetLayout(0); // standard layout - if (current_view->buffer()->text->cursor.par->footnoteflag == - LyXParagraph::NO_FOOTNOTE) { - current_view->buffer()-> - text->SetParagraph(0, 0, - 0, 0, - VSpace (0.3 * current_view->buffer()-> - params.spacing.getValue(), - LyXLength::CM), - VSpace (0.3 * current_view->buffer()-> - params.spacing.getValue(), - LyXLength::CM), - LYX_ALIGN_CENTER, - string(), - 0); - } - else - current_view->buffer()-> - text->SetParagraph(0, 0, - 0, 0, - VSpace(VSpace::NONE), - VSpace(VSpace::NONE), - LYX_ALIGN_CENTER, - string(), - 0); - - current_view->buffer()->text->cursor.par->table = - new LyXTable(xsize, ysize); - - for (int i = 0; i < xsize * ysize - 1; ++i) - current_view->buffer()->text->cursor.par->InsertChar(0, LyXParagraph::META_NEWLINE); - current_view->buffer()->text->RedoParagraph(); - - current_view->buffer()->text->UnFreezeUndo(); - - current_view->buffer()->update(1); - minibuffer->Set(_("Table inserted")); -} -#endif extern "C" void TableCancelCB(FL_OBJECT *, long) { @@ -3910,7 +3390,7 @@ extern "C" void PrintApplyCB(FL_OBJECT *, long) piece = frontStrip(piece) ; if ( !stringOnlyContains (piece, "0123456789-") ) { WriteAlert(_("ERROR! Unable to print!"), - _("Check 'range of pages'!")); + _("Check 'range of pages'!")); return; } if (piece.find('-') == string::npos) { // not found @@ -3928,7 +3408,7 @@ extern "C" void PrintApplyCB(FL_OBJECT *, long) if (!copies.empty()) { // a number of copies was given if ( !stringOnlyContains (copies, "0123456789") ) { WriteAlert(_("ERROR! Unable to print!"), - _("Check 'number of copies'!")); + _("Check 'number of copies'!")); return; } if (fl_get_button(fd_form_print->do_unsorted)) @@ -4011,7 +3491,7 @@ extern "C" void PrintApplyCB(FL_OBJECT *, long) } if (fl_get_button(fd_form_print->radio_file)) command += lyxrc->print_to_file - + QuoteName(MakeAbsPath(ps_file, path)); + + QuoteName(MakeAbsPath(ps_file, path)); else if (!lyxrc->print_spool_command.empty()) command += lyxrc->print_to_file + QuoteName(ps_file); @@ -4028,7 +3508,7 @@ extern "C" void PrintApplyCB(FL_OBJECT *, long) string command2 = lyxrc->print_spool_command + ' '; if (!printer.empty()) command2 += lyxrc->print_spool_printerprefix - + printer; + + printer; // First run dvips and, if succesful, then spool command if ((result = RunScript(buffer, true, command))) { result = RunScript(buffer, false, command2, ps_file); @@ -4051,7 +3531,6 @@ extern "C" void PrintOKCB(FL_OBJECT * ob, long data) /* callbacks for form form_figure */ -#ifdef MOVE_TEXT extern "C" void FigureApplyCB(FL_OBJECT *, long) { if (!current_view->available()) @@ -4104,12 +3583,12 @@ extern "C" void FigureApplyCB(FL_OBJECT *, long) LYX_ALIGN_CENTER, string(), 0); } else current_view->text->SetParagraph(0, 0, - 0, 0, - VSpace(VSpace::NONE), - VSpace(VSpace::NONE), - LYX_ALIGN_CENTER, - string(), - 0); + 0, 0, + VSpace(VSpace::NONE), + VSpace(VSpace::NONE), + LYX_ALIGN_CENTER, + string(), + 0); current_view->update(-1); @@ -4120,77 +3599,8 @@ extern "C" void FigureApplyCB(FL_OBJECT *, long) minibuffer->Set(_("Figure inserted")); current_view->text->UnFreezeUndo(); } -#else -extern "C" void FigureApplyCB(FL_OBJECT *, long) -{ - if (!current_view->available()) - return; - Buffer * buffer = current_view->buffer(); - if(buffer->isReadonly()) // paranoia - return; - - minibuffer->Set(_("Inserting figure...")); - if (fl_get_button(fd_form_figure->radio_inline) - || buffer->text->cursor.par->table) { - InsetFig * new_inset = new InsetFig(100, 20, buffer); - buffer->insertInset(new_inset); - minibuffer->Set(_("Figure inserted")); - new_inset->Edit(0, 0); - return; - } - - current_view->getScreen()->HideCursor(); - buffer->update(-2); - BeforeChange(); - - buffer->text->SetCursorParUndo(); - buffer->text->FreezeUndo(); - buffer->text->BreakParagraph(); - buffer->update(-1); - - if (buffer->text->cursor.par->Last()) { - buffer->text->CursorLeft(); - - buffer->text->BreakParagraph(); - buffer->update(-1); - } - - // The standard layout should always be numer 0; - buffer->text->SetLayout(0); - - if (buffer->text->cursor.par->footnoteflag == - LyXParagraph::NO_FOOTNOTE) { - buffer->text-> - SetParagraph(0, 0, - 0, 0, - VSpace (0.3 * buffer->params.spacing.getValue(), - LyXLength::CM), - VSpace (0.3 * - buffer->params.spacing.getValue(), - LyXLength::CM), - LYX_ALIGN_CENTER, string(), 0); - } else - buffer->text->SetParagraph(0, 0, - 0, 0, - VSpace(VSpace::NONE), - VSpace(VSpace::NONE), - LYX_ALIGN_CENTER, - string(), - 0); - - buffer->update(-1); - - Inset * new_inset = new InsetFig(100, 100, buffer); - buffer->insertInset(new_inset); - new_inset->Edit(0, 0); - buffer->update(0); - minibuffer->Set(_("Figure inserted")); - buffer->text->UnFreezeUndo(); -} -#endif - extern "C" void FigureCancelCB(FL_OBJECT *, long) { fl_hide_form(fd_form_figure->form_figure); @@ -4260,7 +3670,7 @@ void Reconfigure() // Run configure in user lyx directory Path p(user_lyxdir); Systemcalls one(Systemcalls::System, - AddName(system_lyxdir, "configure")); + AddName(system_lyxdir, "configure")); p.pop(); minibuffer->Set(_("Reloading configuration...")); lyxrc->read(LibFileSearch(string(), "lyxrc.defaults")); @@ -4279,11 +3689,7 @@ char * NextWord(float & value) return 0; } -#ifdef MOVE_TEXT char * string = current_view->text->SelectNextWord(value); -#else - char * string = current_view->buffer()->text->SelectNextWord(value); -#endif return string; } @@ -4297,15 +3703,9 @@ void SelectLastWord() current_view->getScreen()->HideCursor(); BeforeChange(); -#ifdef MOVE_TEXT current_view->text->SelectSelectedWord(); current_view->getScreen()->ToggleSelection(false); current_view->update(0); -#else - current_view->buffer()->text->SelectSelectedWord(); - current_view->getScreen()->ToggleSelection(false); - current_view->buffer()->update(0); -#endif } @@ -4317,15 +3717,9 @@ void EndOfSpellCheck() current_view->getScreen()->HideCursor(); BeforeChange(); -#ifdef MOVE_TEXT current_view->text->SelectSelectedWord(); current_view->text->ClearSelection(); current_view->update(0); -#else - current_view->buffer()->text->SelectSelectedWord(); - current_view->buffer()->text->ClearSelection(); - current_view->buffer()->update(0); -#endif } @@ -4336,7 +3730,6 @@ void ReplaceWord(string const & replacestring) return; current_view->getScreen()->HideCursor(); -#ifdef MOVE_TEXT current_view->update(-2); /* clear the selection (if there is any) */ @@ -4355,27 +3748,6 @@ void ReplaceWord(string const & replacestring) current_view->text->CursorLeftIntern(); } current_view->update(1); -#else - current_view->buffer()->update(-2); - - /* clear the selection (if there is any) */ - current_view->getScreen()->ToggleSelection(false); - - current_view->buffer()->update(-2); - - /* clear the selection (if there is any) */ - current_view->getScreen()->ToggleSelection(false); - current_view->buffer()->text-> - ReplaceSelectionWithString(replacestring.c_str()); - - current_view->buffer()->text->SetSelectionOverString(replacestring.c_str()); - - // Go back so that replacement string is also spellchecked - for (string::size_type i = 0; i < replacestring.length() + 1; ++i) { - current_view->buffer()->text->CursorLeftIntern(); - } - current_view->buffer()->update(1); -#endif } // End of spellchecker stuff @@ -4422,19 +3794,11 @@ extern "C" void TocSelectCB(FL_OBJECT * ob, long) } if (par) { -#ifdef MOVE_TEXT BeforeChange(); current_view->text->SetCursor(par, 0); current_view->text->sel_cursor = current_view->text->cursor; current_view->update(0); -#else - BeforeChange(); - current_view->buffer()->text->SetCursor(par, 0); - current_view->buffer()->text->sel_cursor = - current_view->buffer()->text->cursor; - current_view->buffer()->update(0); -#endif } else { WriteAlert(_("Error"), @@ -4489,7 +3853,7 @@ extern "C" void TocUpdateCB(FL_OBJECT *, long) while (par) { labeltype = textclasslist.Style(current_view->buffer()->params.textclass, - par->GetLayout()).labeltype; + par->GetLayout()).labeltype; if (labeltype >= LABEL_COUNTER_CHAPTER && labeltype <= LABEL_COUNTER_CHAPTER + @@ -4500,7 +3864,7 @@ extern "C" void TocUpdateCB(FL_OBJECT *, long) for (pos = 0; pos < (labeltype - textclasslist.TextClass(current_view->buffer()-> - params.textclass).maxcounter()) * 4 + 2; + params.textclass).maxcounter()) * 4 + 2; pos++) line[pos] = ' '; @@ -4602,7 +3966,7 @@ extern "C" void RefUpdateCB(FL_OBJECT *, long) // Get the current line, in order to restore it later char const * const btmp = fl_get_browser_line(brow, - fl_get_browser(brow)); + fl_get_browser(brow)); string currentstr = btmp ? btmp : ""; fl_clear_browser(brow); @@ -4672,7 +4036,6 @@ void UpdateInset(Inset * inset, bool mark_dirty) /* very first check for locking insets*/ if (current_view->buffer()->the_locking_inset == inset){ -#ifdef MOVE_TEXT if (current_view->text->UpdateInset(inset)){ current_view->update(); if (mark_dirty){ @@ -4683,24 +4046,11 @@ void UpdateInset(Inset * inset, bool mark_dirty) current_view->updateScrollbar(); return; } -#else - if (current_view->buffer()->text->UpdateInset(inset)){ - current_view->update(); - if (mark_dirty){ - if (current_view->buffer()->isLyxClean()) - minibuffer->setTimer(4); - current_view->buffer()->markDirty(); - } - current_view->updateScrollbar(); - return; - } -#endif } /* first check the current buffer */ if (current_view->available()){ current_view->getScreen()->HideCursor(); -#ifdef MOVE_TEXT current_view->update(-3); if (current_view->text->UpdateInset(inset)){ if (mark_dirty) @@ -4709,16 +4059,6 @@ void UpdateInset(Inset * inset, bool mark_dirty) current_view->update(3); return; } -#else - current_view->buffer()->update(-3); - if (current_view->buffer()->text->UpdateInset(inset)){ - if (mark_dirty) - current_view->buffer()->update(1); - else - current_view->buffer()->update(3); - return; - } -#endif } // check all buffers @@ -4745,11 +4085,7 @@ void ShowLockedInsetCursor(long x, long y, int asc, int desc) { if (current_view->buffer()->the_locking_inset && current_view->getScreen()){ -#ifdef MOVE_TEXT y += current_view->text->cursor.y; -#else - y += current_view->buffer()->text->cursor.y; -#endif current_view->getScreen()->ShowManualCursor(x, y, asc, desc); } @@ -4761,11 +4097,7 @@ void HideLockedInsetCursor(long x, long y, int asc, int desc) { if (current_view->buffer()->the_locking_inset && current_view->getScreen()){ -#ifdef MOVE_TEXT y += current_view->text->cursor.y; -#else - y += current_view->buffer()->text->cursor.y; -#endif current_view->getScreen()->HideManualCursor(x, y, asc, desc); } @@ -4777,11 +4109,7 @@ void FitLockedInsetCursor(long x, long y, int asc, int desc) { if (current_view->buffer()->the_locking_inset && current_view->getScreen()){ -#ifdef MOVE_TEXT y += current_view->text->cursor.y; -#else - y += current_view->buffer()->text->cursor.y; -#endif if (current_view->getScreen()->FitManualCursor(x, y, asc, desc)) current_view->updateScrollbar(); } @@ -4795,11 +4123,7 @@ int UnlockInset(UpdatableInset * inset) current_view->buffer()->the_locking_inset == inset){ inset->InsetUnlock(); current_view->buffer()->the_locking_inset = 0; -#ifdef MOVE_TEXT current_view->text->FinishUndo(); -#else - current_view->buffer()->text->FinishUndo(); -#endif return 0; } return bufferlist.unlockInset(inset); @@ -4813,19 +4137,11 @@ void LockedInsetStoreUndo(Undo::undo_kind kind) return; // shouldn't happen if (kind == Undo::EDIT) // in this case insets would not be stored! kind = Undo::FINISH; -#ifdef MOVE_TEXT current_view->text->SetUndo(kind, - current_view->text->cursor.par-> - ParFromPos(current_view->text->cursor.pos)->previous, - current_view->text->cursor.par-> - ParFromPos(current_view->text->cursor.pos)->next); -#else - current_view->buffer()->text->SetUndo(kind, - current_view->buffer()->text->cursor.par-> - ParFromPos(current_view->buffer()->text->cursor.pos)->previous, - current_view->buffer()->text->cursor.par-> - ParFromPos(current_view->buffer()->text->cursor.pos)->next); -#endif + current_view->text->cursor.par-> + ParFromPos(current_view->text->cursor.pos)->previous, + current_view->text->cursor.par-> + ParFromPos(current_view->text->cursor.pos)->next); } @@ -4867,6 +4183,6 @@ void UpdateInsetUpdateList() // code is indented in the right way!!! void addNewlineAndDepth(string & file, int const depth) { - file += '\n'; - file.append(depth, ' '); + file += '\n'; + file.append(depth, ' '); } diff --git a/src/lyxdraw.C b/src/lyxdraw.C index 9385f7482c..ae05fe6447 100644 --- a/src/lyxdraw.C +++ b/src/lyxdraw.C @@ -63,12 +63,13 @@ bool setForegroundColor(char const * const color, XGCValues & val) if (!mono_video) { if (XParseColor(fl_display, color_map, color, &xcol) && XAllocColor(fl_display, color_map, &xcol)) - { - val.foreground = xcol.pixel; - } else { - lyxerr << "LyX: Couldn't get color " << color << endl; - return false; - } + { + val.foreground = xcol.pixel; + } else { + lyxerr << "LyX: Couldn't get color " + << color << endl; + return false; + } } return true; } @@ -79,14 +80,14 @@ void do_reverse_video(XGCValues &val) { if (reverse_video) { val.foreground= WhitePixel(fl_display, - DefaultScreen(fl_display)); + DefaultScreen(fl_display)); val.background= BlackPixel(fl_display, - DefaultScreen(fl_display)); + DefaultScreen(fl_display)); } else { val.foreground= BlackPixel(fl_display, - DefaultScreen(fl_display)); + DefaultScreen(fl_display)); val.background= WhitePixel(fl_display, - DefaultScreen(fl_display)); + DefaultScreen(fl_display)); } } @@ -145,17 +146,22 @@ GC GetLatexGC() XGCValues val; if (reverse_video ^ mono_video) { - val.foreground= WhitePixel(fl_display, DefaultScreen(fl_display)); - val.background= BlackPixel(fl_display, DefaultScreen(fl_display)); + val.foreground= WhitePixel(fl_display, + DefaultScreen(fl_display)); + val.background= BlackPixel(fl_display, + DefaultScreen(fl_display)); } else { - val.foreground= BlackPixel(fl_display, DefaultScreen(fl_display)); - val.background= WhitePixel(fl_display, DefaultScreen(fl_display)); + val.foreground= BlackPixel(fl_display, + DefaultScreen(fl_display)); + val.background= WhitePixel(fl_display, + DefaultScreen(fl_display)); } val.function= GXcopy; val.graphics_exposures = false; setForegroundColor(latex_color, val); latex_gc = XCreateGC(fl_display, fl_root, GCBackground - | GCForeground | GCFunction | GCGraphicsExposures, + | GCForeground | GCFunction + | GCGraphicsExposures, &val); XFlush(fl_display); @@ -216,14 +222,14 @@ GC GetClearGC() if (reverse_video) { val.foreground= BlackPixel(fl_display, - DefaultScreen(fl_display)); + DefaultScreen(fl_display)); val.background= WhitePixel(fl_display, - DefaultScreen(fl_display)); + DefaultScreen(fl_display)); } else { val.background= BlackPixel(fl_display, - DefaultScreen(fl_display)); + DefaultScreen(fl_display)); val.foreground= WhitePixel(fl_display, - DefaultScreen(fl_display)); + DefaultScreen(fl_display)); } val.function = GXcopy; val.graphics_exposures = false; @@ -233,7 +239,8 @@ GC GetClearGC() background_pixels = val.foreground; clear_gc = XCreateGC(fl_display, fl_root, GCBackground - | GCForeground | GCFunction | GCGraphicsExposures, + | GCForeground | GCFunction + | GCGraphicsExposures, &val); XFlush(fl_display); @@ -276,7 +283,8 @@ GC GetThickLineGC() val.line_width = 2; val.line_style = LineSolid; thick_line_gc = XCreateGC(fl_display, fl_root, GCBackground - | GCForeground | GCFunction | GCGraphicsExposures + | GCForeground | GCFunction + | GCGraphicsExposures | GCLineWidth | GCLineStyle , &val); XFlush(fl_display); @@ -339,7 +347,7 @@ GC GetSelectGC() val.function= GXinvert; select_gc = XCreateGC(fl_display, fl_root, GCFunction | GCGraphicsExposures | GCPlaneMask - | GCLineWidth | GCLineStyle , &val); + | GCLineWidth | GCLineStyle , &val); XFlush(fl_display); return select_gc; @@ -355,14 +363,14 @@ GC GetSelectionGC() if (!reverse_video) { val.foreground= BlackPixel(fl_display, - DefaultScreen(fl_display)); + DefaultScreen(fl_display)); val.background= WhitePixel(fl_display, - DefaultScreen(fl_display)); + DefaultScreen(fl_display)); } else { val.background= BlackPixel(fl_display, - DefaultScreen(fl_display)); + DefaultScreen(fl_display)); val.foreground= WhitePixel(fl_display, - DefaultScreen(fl_display)); + DefaultScreen(fl_display)); } val.function= GXcopy; @@ -389,9 +397,11 @@ GC GetLightedGC() if (lighted_gc) return lighted_gc; XGCValues val; if (reverse_video) { - val.background= BlackPixel(fl_display, DefaultScreen(fl_display)); + val.background= BlackPixel(fl_display, + DefaultScreen(fl_display)); } else { - val.background= WhitePixel(fl_display, DefaultScreen(fl_display)); + val.background= WhitePixel(fl_display, + DefaultScreen(fl_display)); } val.foreground= val.background; val.function= GXcopy; @@ -400,7 +410,8 @@ GC GetLightedGC() val.line_width = 0; setForegroundColor(lighted_color, val); lighted_gc = XCreateGC(fl_display, fl_root, GCBackground - | GCForeground | GCFunction | GCGraphicsExposures + | GCForeground | GCFunction + | GCGraphicsExposures | GCLineWidth | GCLineStyle , &val); XFlush(fl_display); diff --git a/src/lyxfont.h b/src/lyxfont.h index f495367466..668cdde652 100644 --- a/src/lyxfont.h +++ b/src/lyxfont.h @@ -4,7 +4,7 @@ * * LyX, The Document Processor * - * Copyright (C) 1995 Matthias Ettrich + * Copyright 1995 Matthias Ettrich * * ====================================================== */ @@ -24,7 +24,7 @@ // for us, since we use these names below. But of course this is due // to some old compilers. Than is broken when it comes to C++ scoping. #include "gettext.h" // so that we are sure tht it won't be included - // later. +// later. #ifdef ON #undef ON #endif @@ -39,11 +39,11 @@ class LyXLex; class LyXFont { public: /** The value INHERIT_* means that the font attribute is - inherited from the layout. In the case of layout fonts, the - attribute is inherited from the default font. - The value IGNORE_* is used with LyXFont::update() when the - attribute should not be changed. - */ + inherited from the layout. In the case of layout fonts, the + attribute is inherited from the default font. + The value IGNORE_* is used with LyXFont::update() when the + attribute should not be changed. + */ enum FONT_FAMILY { /// ROMAN_FAMILY, // fontstruct rely on this to be 0 @@ -272,7 +272,7 @@ public: string latexSize() const; /** Updates font settings according to request. If an - attribute is IGNORE, the attribute is left as it is. */ + attribute is IGNORE, the attribute is left as it is. */ /* * When toggleall = true, all properties that matches the font in use * will have the effect that the properties is reset to the @@ -284,7 +284,7 @@ public: void update(LyXFont const & newfont, bool toggleall = false); /** Reduce font to fall back to template where possible. - Equal fields are reduced to INHERIT */ + Equal fields are reduced to INHERIT */ void reduce(LyXFont const & tmplt); /// Realize font from a template (INHERIT are realized) @@ -307,7 +307,7 @@ public: int latexWriteStartChanges(string &, LyXFont const & base) const; /** Writes tha tail of the LaTeX needed to chagne to this font. - Returns number of chars written. Base is the font state we want + Returns number of chars written. Base is the font state we want to achieve. */ int latexWriteEndChanges(string &, LyXFont const & base) const; @@ -374,15 +374,15 @@ private: typedef unsigned int ui32; /** Representation: bit table - Layout of bit table: - 11 1111 111 122 222 222 2233 - Bit 012 34 567 8901 2345 678 901 234 567 8901 - FFF SS SSS SSSS CCCC EEE UUU NNN LLL - aaa ee hhh iiii oooo mmm nnn ooo aaa - mmm rr aaa zzzz llll ppp ddd uuu ttt - - Some might think this is a dirty representation, but it gives - us at least 25% speed-up, so why not? + Layout of bit table: + 11 1111 111 122 222 222 2233 + Bit 012 34 567 8901 2345 678 901 234 567 8901 + FFF SS SSS SSSS CCCC EEE UUU NNN LLL + aaa ee hhh iiii oooo mmm nnn ooo aaa + mmm rr aaa zzzz llll ppp ddd uuu ttt + + Some might think this is a dirty representation, but it gives + us at least 25% speed-up, so why not? */ ui32 bits; @@ -437,25 +437,25 @@ private: /// All inherit font enum{ inherit = ui32(INHERIT_FAMILY) << Fam_Pos - | ui32(INHERIT_SERIES) << Ser_Pos - | ui32(INHERIT_SHAPE) << Sha_Pos - | ui32(INHERIT_SIZE) << Siz_Pos - | ui32(INHERIT_COLOR) << Col_Pos - | ui32(INHERIT) << Emp_Pos - | ui32(INHERIT) << Und_Pos - | ui32(INHERIT) << Nou_Pos - | ui32(INHERIT) << Lat_Pos}; + | ui32(INHERIT_SERIES) << Ser_Pos + | ui32(INHERIT_SHAPE) << Sha_Pos + | ui32(INHERIT_SIZE) << Siz_Pos + | ui32(INHERIT_COLOR) << Col_Pos + | ui32(INHERIT) << Emp_Pos + | ui32(INHERIT) << Und_Pos + | ui32(INHERIT) << Nou_Pos + | ui32(INHERIT) << Lat_Pos}; /// All ignore font enum{ ignore = ui32(IGNORE_FAMILY) << Fam_Pos - | ui32(IGNORE_SERIES) << Ser_Pos - | ui32(IGNORE_SHAPE) << Sha_Pos - | ui32(IGNORE_SIZE) << Siz_Pos - | ui32(IGNORE_COLOR) << Col_Pos - | ui32(IGNORE) << Emp_Pos - | ui32(IGNORE) << Und_Pos - | ui32(IGNORE) << Nou_Pos - | ui32(IGNORE) << Lat_Pos}; + | ui32(IGNORE_SERIES) << Ser_Pos + | ui32(IGNORE_SHAPE) << Sha_Pos + | ui32(IGNORE_SIZE) << Siz_Pos + | ui32(IGNORE_COLOR) << Col_Pos + | ui32(IGNORE) << Emp_Pos + | ui32(IGNORE) << Und_Pos + | ui32(IGNORE) << Nou_Pos + | ui32(IGNORE) << Lat_Pos}; /// Updates a misc setting according to request LyXFont::FONT_MISC_STATE setMisc(LyXFont::FONT_MISC_STATE newfont, @@ -507,8 +507,8 @@ inline LyXFont & LyXFont::operator=(LyXFont const & x) } - // You don't have to understand the stuff below :-) - // It works, and it's bloody fast. (Asger) +// You don't have to understand the stuff below :-) +// It works, and it's bloody fast. (Asger) inline LyXFont::FONT_FAMILY LyXFont::family() const { return LyXFont::FONT_FAMILY((bits >> Fam_Pos) & Fam_Mask); diff --git a/src/lyxfr1.C b/src/lyxfr1.C index ea73c58e69..eaeae2856b 100644 --- a/src/lyxfr1.C +++ b/src/lyxfr1.C @@ -35,8 +35,8 @@ #include "support/lstrings.h" #include "support/textutils.h" -extern BufferView *current_view; // called too many times in this file... -extern MiniBuffer *minibuffer; +extern BufferView * current_view; // called too many times in this file... +extern MiniBuffer * minibuffer; // Maximum length copied from the current selection to the search string const int LYXSEARCH_MAXLEN = 128; @@ -46,15 +46,15 @@ const int LYXSEARCH_MAXLEN = 128; // If nothing selected, select the word at the cursor. // Returns the current selection // Note: this function should be in LyXText! -string const GetSelectionOrWordAtCursor(LyXText *lt); +string const GetSelectionOrWordAtCursor(LyXText * lt); // Returns the current selection. If nothing is selected or if the selection // spans 2 paragraphs, an empty string is returned. -string const GetCurrentSelectionAsString(LyXText *lt); +string const GetCurrentSelectionAsString(LyXText * lt); // This is a copy of SetSelectionOverString from text.C // It does the same, but uses only the length as a parameter -void SetSelectionOverLenChars(LyXText *lt, int len); +void SetSelectionOverLenChars(LyXText * lt, int len); //------------------------------------------------------------- @@ -64,9 +64,9 @@ void SetSelectionOverLenChars(LyXText *lt, int len); // spans 2 paragraphs, an empty string is returned. string const GetCurrentSelectionAsString(LyXText * lt) { - char sz[LYXSEARCH_MAXLEN]; - + char sz[LYXSEARCH_MAXLEN]; sz[0] = 0; + LyXParagraph * par = lt->cursor.par; if (lt->selection && (lt->sel_cursor.par == par)) { // (selected) and (begin/end in same paragraph) @@ -77,15 +77,15 @@ string const GetCurrentSelectionAsString(LyXText * lt) int i = 0; bool fPrevIsSpace = false; char ch; - while ((i < LYXSEARCH_MAXLEN-2) && - (pos < par->Last()) && (pos < endpos)) { + while ((i < LYXSEARCH_MAXLEN - 2) && + (pos < par->Last()) && (pos < endpos)) { ch = par->GetChar(pos); //HB??: Maybe (ch <= ' ') if ((ch == ' ') || (ch <= LyXParagraph::META_INSET)) { // consecutive spaces --> 1 space char if (fPrevIsSpace) { - pos++; // Next text pos + ++pos; // Next text pos continue; // same search pos } sz[i] = ' '; @@ -94,8 +94,8 @@ string const GetCurrentSelectionAsString(LyXText * lt) sz[i] = ch; fPrevIsSpace = false; } - pos++; - i++; + ++pos; + ++i; } sz[i] = 0; } @@ -105,7 +105,7 @@ string const GetCurrentSelectionAsString(LyXText * lt) // If nothing selected, select the word at the cursor. // Returns the current selection -string const GetSelectionOrWordAtCursor(LyXText *lt) +string const GetSelectionOrWordAtCursor(LyXText * lt) { lt->SelectWordWhenUnderCursor(); return GetCurrentSelectionAsString(lt); @@ -114,11 +114,10 @@ string const GetSelectionOrWordAtCursor(LyXText *lt) // This is a copy of SetSelectionOverString from text.C // It does the same, but uses only the length as a parameter -void SetSelectionOverLenChars(LyXText *lt, int len) +void SetSelectionOverLenChars(LyXText * lt, int len) { lt->sel_cursor = lt->cursor; - int i; - for (i= 0; i < len; i++) + for (int i = 0; i < len; ++i) lt->CursorRight(); lt->SetSelection(); } @@ -131,23 +130,17 @@ void LyXFindReplace1::StartSearch() LyXFindReplace0::StartSearch(); SetReplaceEnabled(!current_view->buffer()->isReadonly()); searchForward = true; -#ifdef MOVE_TEXT if (lsSearch.empty()) SetSearchString(GetSelectionOrWordAtCursor(current_view->text)); -#else - if (lsSearch.empty()) - SetSearchString(GetSelectionOrWordAtCursor(current_view->buffer()->text)); -#endif } -// TODO?: the user can insert multiple spaces with this routine (1999-01-11, dnaber) +// TODO?: the user can insert multiple spaces with this +// routine (1999-01-11, dnaber) void LyXFindReplace1::SearchReplaceCB() { - if (!current_view->getScreen()) - return; - if (current_view->buffer()->isReadonly()) - return; + if (!current_view->getScreen()) return; + if (current_view->buffer()->isReadonly()) return; // CutSelection cannot cut a single space, so we have to stop // in order to avoid endless loop :-( @@ -162,7 +155,6 @@ void LyXFindReplace1::SearchReplaceCB() string const replacestring = ReplaceString(); current_view->getScreen()->HideCursor(); -#ifdef MOVE_TEXT current_view->update(-2); LyXText * ltCur = current_view->text; @@ -175,20 +167,6 @@ void LyXFindReplace1::SearchReplaceCB() SetSelectionOverString(replacestring.c_str()); current_view->update(1); } -#else - current_view->buffer()->update(-2); - - LyXText * ltCur = current_view->buffer()->text; - if (ltCur->selection) { - // clear the selection (if there is any) - current_view->getScreen()->ToggleSelection(false); - current_view->buffer()->text-> - ReplaceSelectionWithString(replacestring.c_str()); - current_view->buffer()->text-> - SetSelectionOverString(replacestring.c_str()); - current_view->buffer()->update(1); - } -#endif // jump to next match: SearchCB( searchForward ); @@ -198,12 +176,8 @@ void LyXFindReplace1::SearchReplaceCB() // replaces all occurences of a string (1999-01-15, dnaber@mini.gt.owl.de) void LyXFindReplace1::SearchReplaceAllCB() { - LyXText * ltCur; - - if (!current_view->getScreen()) - return; - if (current_view->buffer()->isReadonly()) - return; + if (!current_view->getScreen()) return; + if (current_view->buffer()->isReadonly()) return; // CutSelection cannot cut a single space, so we have to stop // in order to avoid endless loop :-( @@ -212,19 +186,19 @@ void LyXFindReplace1::SearchReplaceAllCB() && SearchString()[0] == ' ') ) { WriteAlert(_("Sorry!"), _("You cannot replace a single space, " "nor an empty character.")); - return; - } + return; + } string const replacestring = ReplaceString(); current_view->getScreen()->HideCursor(); -#ifdef MOVE_TEXT // start at top current_view->text->ClearSelection(); current_view->text->CursorTop(); int replace_count = 0; + LyXText * ltCur; do { ltCur = current_view->text; if (ltCur->selection) { @@ -238,26 +212,6 @@ void LyXFindReplace1::SearchReplaceAllCB() ++replace_count; } } while( SearchCB(true) ); -#else - // start at top - current_view->buffer()->text->ClearSelection(); - current_view->buffer()->text->CursorTop(); - - int replace_count = 0; - do { - ltCur = current_view->buffer()->text; - if (ltCur->selection) { - current_view->buffer()->update(-2); - current_view->getScreen()->ToggleSelection(false); - current_view->buffer()->text-> - ReplaceSelectionWithString(replacestring.c_str()); - current_view->buffer()->text-> - SetSelectionOverString(replacestring.c_str()); - current_view->buffer()->update(1); - replace_count++; - } - } while( SearchCB(true) ); -#endif if( replace_count == 0 ) { LyXBell(); minibuffer->Set(_("String not found!")); @@ -275,33 +229,25 @@ void LyXFindReplace1::SearchReplaceAllCB() bool LyXFindReplace1::SearchCB(bool fForward) { - LyXText * ltCur; - bool result; - // store search direction searchForward = fForward; if (!current_view->getScreen()) - return(false); + return false; current_view->getScreen()->HideCursor(); -#ifdef MOVE_TEXT current_view->update(-2); - ltCur = current_view->text; -#else - current_view->buffer()->update(-2); - ltCur = current_view->buffer()->text; -#endif + LyXText * ltCur = current_view->text; if (ltCur->selection) ltCur->cursor = fForward ? ltCur->sel_end_cursor : - ltCur->sel_start_cursor; + ltCur->sel_start_cursor; ReInitFromForm(); iLenSelected = SearchString().length(); + bool result; if (!ValidSearchData() || (fForward ? SearchForward(ltCur) : SearchBackward(ltCur))) { -#ifdef MOVE_TEXT current_view->update(-2); // clear the selection (if there is any) @@ -310,16 +256,6 @@ bool LyXFindReplace1::SearchCB(bool fForward) // set the new selection SetSelectionOverLenChars(current_view->text, iLenSelected); -#else - current_view->buffer()->update(-2); - - // clear the selection (if there is any) - current_view->getScreen()->ToggleSelection(); - current_view->buffer()->text->ClearSelection(); - - // set the new selection - SetSelectionOverLenChars(current_view->buffer()->text, iLenSelected); -#endif current_view->getScreen()->ToggleSelection(false); minibuffer->Set(_("Found.")); result = true; @@ -332,7 +268,7 @@ bool LyXFindReplace1::SearchCB(bool fForward) if (current_view->getWorkArea()->focus) current_view->getScreen()->ShowCursor(); - return(result); + return result; } @@ -345,8 +281,8 @@ bool LyXFindReplace1::SearchForward(LyXText * lt) LyXParagraph::size_type pos = lt->cursor.pos; while (par && !IsSearchStringInText(par, pos)) { - if (posLast()-1) - pos++; + if (pos < par->Last() - 1) + ++pos; else { pos = 0; par = par->Next(); @@ -363,21 +299,21 @@ bool LyXFindReplace1::SearchForward(LyXText * lt) // if the string can be found: return true and set the cursor to // the new position // (was: LyXText::SearchBackward(char const* string) in text2.C ) -bool LyXFindReplace1::SearchBackward(LyXText *lt) +bool LyXFindReplace1::SearchBackward(LyXText * lt) { - LyXParagraph *par = lt->cursor.par; + LyXParagraph * par = lt->cursor.par; int pos = lt->cursor.pos; do { - if (pos>0) - pos--; + if (pos > 0) + --pos; else { // We skip empty paragraphs (Asger) do { par = par->Previous(); if (par) - pos = par->Last()-1; - } while (par && pos<0); + pos = par->Last() - 1; + } while (par && pos < 0); } } while (par && !IsSearchStringInText(par, pos)); @@ -408,12 +344,10 @@ int LyXFindReplace1::CompareChars(char chSearch, char chText) bool LyXFindReplace1::IsSearchStringInText(LyXParagraph * par, LyXParagraph::size_type pos) { - char chSrch = 0; - char chText; - - if (!par) - return false; + if (!par) return false; + char chSrch = 0; + char chText; bool fPrevIsSpace = false; int iText = 0; string::size_type iSrch = 0; @@ -423,7 +357,7 @@ bool LyXFindReplace1::IsSearchStringInText(LyXParagraph * par, chText = par->GetChar(pos+iText); if (chText == ' ') { if (fPrevIsSpace) { - iText++; // next Text pos + ++iText; // next Text pos continue; // same search pos } fPrevIsSpace = true; @@ -440,7 +374,7 @@ bool LyXFindReplace1::IsSearchStringInText(LyXParagraph * par, return false; if (!MatchWord() - || ((pos <= 0 || !IsLetterCharOrDigit(par->GetChar(pos-1))) + || ((pos <= 0 || !IsLetterCharOrDigit(par->GetChar(pos - 1))) && (pos + iText >= par->Last() || !IsLetterCharOrDigit(par->GetChar(pos + iText))))) { iLenSelected = iText; diff --git a/src/lyxfunc.C b/src/lyxfunc.C index f44b4ec0f9..526963a560 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -69,7 +69,7 @@ extern bool cursor_follows_scrollbar; extern void InsertAsciiFile(string const &, bool); -extern void math_insert_symbol(char const*); +extern void math_insert_symbol(char const *); extern Bool math_insert_greek(char const); // why "Bool"? extern BufferList bufferlist; extern LyXServer * lyxserver; @@ -80,13 +80,13 @@ extern bool selection_possible; extern kb_keymap * toplevel_keymap; extern void BeforeChange(); -extern void MenuWrite(Buffer*); -extern void MenuWriteAs(Buffer*); -extern int MenuRunLaTeX(Buffer*); -extern int MenuBuildProg(Buffer*); -extern int MenuRunChktex(Buffer*); +extern void MenuWrite(Buffer *); +extern void MenuWriteAs(Buffer *); +extern int MenuRunLaTeX(Buffer *); +extern int MenuBuildProg(Buffer *); +extern int MenuRunChktex(Buffer *); extern bool MenuRunDvips(Buffer *, bool); -extern void MenuPrint(Buffer*); +extern void MenuPrint(Buffer *); extern void MenuSendto(); extern void QuitLyX(); extern void MenuFax(Buffer *); @@ -112,10 +112,10 @@ extern void HFill(); extern void MenuUndo(); extern void MenuRedo(); extern void SmallUpdate(signed char); -extern void SetUpdateTimer(float timer= 0.3); +extern void SetUpdateTimer(float timer = 0.3); extern void FreeUpdateTimer(); -extern bool MenuPreview(Buffer*); -extern bool MenuPreviewPS(Buffer*); +extern bool MenuPreview(Buffer *); +extern bool MenuPreviewPS(Buffer *); extern void MenuInsertLabel(char const *); extern void MenuInsertRef(); extern void MenuLayoutCharacter(); @@ -147,7 +147,7 @@ bool LyXFunc::show_sc = true; LyXFunc::LyXFunc(LyXView * o) - :owner(o) + : owner(o) { meta_fake_bit = 0; lyx_dead_action = LFUN_NOACTION; @@ -164,7 +164,6 @@ LyXFunc::LyXFunc(LyXView * o) inline void LyXFunc::moveCursorUpdate(bool selecting) { -#ifdef MOVE_TEXT if (selecting || owner->view()->text->mark_set) { owner->view()->text->SetSelection(); owner->view()->getScreen()->ToggleToggle(); @@ -173,16 +172,7 @@ void LyXFunc::moveCursorUpdate(bool selecting) owner->view()->update(-2); // this IS necessary // (Matthias) } -#else - if (selecting || owner->buffer()->text->mark_set) { - owner->buffer()->text->SetSelection(); - owner->view()->getScreen()->ToggleToggle(); - owner->buffer()->update(0); - } else { - owner->buffer()->update(-2); // this IS necessary - // (Matthias) - } -#endif + owner->view()->getScreen()->ShowCursor(); /* ---> Everytime the cursor is moved, show the current font state. */ @@ -195,13 +185,11 @@ int LyXFunc::processKeyEvent(XEvent * ev) { char s_r[10]; s_r[9] = '\0'; - int num_bytes; - int action; string argument; XKeyEvent * keyevent = &ev->xkey; KeySym keysym_return; - num_bytes = LyXLookupString(ev, s_r, 10, &keysym_return); + int num_bytes = LyXLookupString(ev, s_r, 10, &keysym_return); if (lyxerr.debugging(Debug::KEY)) { lyxerr << "KeySym is " @@ -225,11 +213,7 @@ int LyXFunc::processKeyEvent(XEvent * ev) owner->buffer()->the_locking_inset && keysym_return == XK_Escape) { UnlockInset(owner->buffer()->the_locking_inset); -#ifdef MOVE_TEXT owner->view()->text->CursorRight(); -#else - owner->buffer()->text->CursorRight(); -#endif return 0; } @@ -245,9 +229,9 @@ int LyXFunc::processKeyEvent(XEvent * ev) // cancel and meta-fake keys. RVDK_PATCH_5 cancel_meta_seq.reset(); - action = cancel_meta_seq.addkey(keysym_return, keyevent->state - &(ShiftMask|ControlMask - |Mod1Mask)); + int action = cancel_meta_seq.addkey(keysym_return, keyevent->state + &(ShiftMask|ControlMask + |Mod1Mask)); // When not cancel or meta-fake, do the normal lookup. // Note how the meta_fake Mod1 bit is OR-ed in and reset afterwards. @@ -266,8 +250,8 @@ int LyXFunc::processKeyEvent(XEvent * ev) if (action == 0) action = LFUN_PREFIX; if (lyxerr.debugging(Debug::KEY)) { - char buf[100]; - keyseq.print(buf, 100); + string buf; + keyseq.print(buf); lyxerr << "Key [" << action << "][" << buf << "][" @@ -278,17 +262,17 @@ int LyXFunc::processKeyEvent(XEvent * ev) // why not return already here if action == -1 and // num_bytes == 0? (Lgb) - if(keyseq.length>1 || keyseq.length<-1){ - char buf[100]; - keyseq.print(buf, 100); + if(keyseq.length > 1 || keyseq.length < -1){ + string buf; + keyseq.print(buf); owner->getMiniBuffer()->Set(buf); } if (action == -1) { - if (keyseq.length<-1) { // unknown key sequence... - char buf[100]; + if (keyseq.length < -1) { // unknown key sequence... + string buf; LyXBell(); - keyseq.print(buf, 100); + keyseq.print(buf); owner->getMiniBuffer()->Set(_("Unknown sequence:"), buf); return 0; } @@ -363,64 +347,56 @@ LyXFunc::func_status LyXFunc::getStatus(int ac) const static bool noLaTeX = lyxrc->latex_command == "none"; bool disable = false; switch (action) { - case LFUN_PREVIEW: - disable = noLaTeX || lyxrc->view_dvi_command == "none"; - break; - case LFUN_PREVIEWPS: - disable = noLaTeX || lyxrc->view_ps_command == "none"; - break; - case LFUN_RUNLATEX: - case LFUN_RUNDVIPS: - disable = noLaTeX; - break; - case LFUN_MENUPRINT: - disable = noLaTeX || lyxrc->print_command == "none"; - break; - case LFUN_FAX: - disable = noLaTeX || lyxrc->fax_command == "none"; - break; - case LFUN_IMPORT: - if (argument == "latex") - disable = lyxrc->relyx_command == "none"; - break; - case LFUN_EXPORT: - if (argument == "dvi" || argument == "postscript") - disable = noLaTeX; - if (argument == "html") - disable = lyxrc->html_command == "none"; - break; - case LFUN_UNDO: - disable = buf->undostack.empty(); - break; - case LFUN_REDO: - disable = buf->redostack.empty(); - break; - case LFUN_SPELLCHECK: - disable = lyxrc->isp_command == "none"; - break; - case LFUN_RUNCHKTEX: - disable = lyxrc->chktex_command == "none"; - break; - case LFUN_LAYOUT_TABLE: -#ifdef MOVE_TEXT - disable = ! owner->view()->text->cursor.par->table; -#else - disable = ! buf->text->cursor.par->table; -#endif - break; - default: - break; + case LFUN_PREVIEW: + disable = noLaTeX || lyxrc->view_dvi_command == "none"; + break; + case LFUN_PREVIEWPS: + disable = noLaTeX || lyxrc->view_ps_command == "none"; + break; + case LFUN_RUNLATEX: + case LFUN_RUNDVIPS: + disable = noLaTeX; + break; + case LFUN_MENUPRINT: + disable = noLaTeX || lyxrc->print_command == "none"; + break; + case LFUN_FAX: + disable = noLaTeX || lyxrc->fax_command == "none"; + break; + case LFUN_IMPORT: + if (argument == "latex") + disable = lyxrc->relyx_command == "none"; + break; + case LFUN_EXPORT: + if (argument == "dvi" || argument == "postscript") + disable = noLaTeX; + if (argument == "html") + disable = lyxrc->html_command == "none"; + break; + case LFUN_UNDO: + disable = buf->undostack.empty(); + break; + case LFUN_REDO: + disable = buf->redostack.empty(); + break; + case LFUN_SPELLCHECK: + disable = lyxrc->isp_command == "none"; + break; + case LFUN_RUNCHKTEX: + disable = lyxrc->chktex_command == "none"; + break; + case LFUN_LAYOUT_TABLE: + disable = ! owner->view()->text->cursor.par->table; + break; + default: + break; } if (disable) flag |= LyXFunc::Disabled; if (buf) { func_status box = LyXFunc::ToggleOff; -#ifdef MOVE_TEXT LyXFont font = owner->view()->text->real_current_font; -#else - LyXFont font = buf->text->real_current_font; -#endif switch (action) { case LFUN_EMPH: if (font.emph() == LyXFont::ON) @@ -445,7 +421,6 @@ LyXFunc::func_status LyXFunc::getStatus(int ac) const flag |= box; } - return flag; } @@ -460,9 +435,8 @@ string LyXFunc::Dispatch(string const & s) } -#ifdef MOVE_TEXT string LyXFunc::Dispatch(int ac, - char const * do_not_use_this_arg) + char const * do_not_use_this_arg) { string argument; kb_action action; @@ -549,8 +523,10 @@ string LyXFunc::Dispatch(int ac, if (owner->view()->available() && owner->buffer()->the_locking_inset) { if (action > 1 - || (action == LFUN_UNKNOWN_ACTION && keyseq.length>= -1)) { - if (action == LFUN_UNKNOWN_ACTION && argument.empty()) { + || (action == LFUN_UNKNOWN_ACTION + && keyseq.length >= -1)) { + if (action == LFUN_UNKNOWN_ACTION + && argument.empty()) { argument = keyseq.getiso(); } // Undo/Redo pre 0.13 is a bit tricky for insets. @@ -642,8 +618,8 @@ string LyXFunc::Dispatch(int ac, && owner->view()->getScreen()) { owner->view()->update(-2); } - char buf[100]; - keyseq.print(buf, 100, true); + string buf; + keyseq.print(buf, true); owner->getMiniBuffer()->Set(buf, string(), string(), 1); } break; @@ -665,8 +641,8 @@ string LyXFunc::Dispatch(int ac, case LFUN_META_FAKE: // RVDK_PATCH_5 { meta_fake_bit = Mod1Mask; - char buf[100]; - keyseq.print(buf, 98, true); + string buf; + keyseq.print(buf, true); string res = string("M-") + buf; setMessage(buf); // RVDK_PATCH_5 } @@ -687,7 +663,7 @@ string LyXFunc::Dispatch(int ac, owner->view()->getWorkArea()->h / 2) { owner->view()->getScreen()-> Draw(owner->view()->text->cursor.y - - owner->view()->getWorkArea()->h/2); + owner->view()->getWorkArea()->h / 2); } else { // <= owner->view()->getScreen()-> Draw(0); @@ -703,7 +679,7 @@ string LyXFunc::Dispatch(int ac, } break; - // --- Menus ----------------------------------------------- + // --- Menus ----------------------------------------------- case LFUN_MENUNEW: MenuNew(false); break; @@ -782,7 +758,7 @@ string LyXFunc::Dispatch(int ac, doImportASCII(false); } else if (imtyp == "asciiparagraph") { doImportASCII(true); - // noweb + // noweb } else if (imtyp == "noweb") { doImportLaTeX(true); } else { @@ -967,10 +943,10 @@ string LyXFunc::Dispatch(int ac, && !owner->view()->text->selection && owner->view()->text->cursor.par->footnoteflag != LyXParagraph::NO_FOOTNOTE) - { // only melt footnotes with FOOTMELT, not margins etc - if(owner->view()->text->cursor.par->footnotekind == LyXParagraph::FOOTNOTE) - MeltCB(ob, 0); - } + { // only melt footnotes with FOOTMELT, not margins etc + if(owner->view()->text->cursor.par->footnotekind == LyXParagraph::FOOTNOTE) + MeltCB(ob, 0); + } else FootCB(ob, 0); break; @@ -1067,11 +1043,10 @@ string LyXFunc::Dispatch(int ac, if (tmpbuf) owner->view()->buffer(tmpbuf); } - break; + break; case LFUN_FILE_OPEN: - owner->view()->buffer( - bufferlist.loadLyXFile(argument)); + owner->view()->buffer(bufferlist.loadLyXFile(argument)); break; case LFUN_LATEX_LOG: @@ -1093,9 +1068,9 @@ string LyXFunc::Dispatch(int ac, // Pretend we got the name instead. Dispatch(int(LFUN_LAYOUT), textclasslist.NameOfLayout(owner->view()-> - text->parameters-> - textclass, - sel).c_str()); + text->parameters-> + textclass, + sel).c_str()); return string(); } @@ -1108,10 +1083,10 @@ string LyXFunc::Dispatch(int ac, // and current buffer's textclass (number). */ int layoutno = textclasslist.NumberOfLayout(owner-> - view()-> - text->parameters-> - textclass, - argument).second; + view()-> + text->parameters-> + textclass, + argument).second; // see if we found the layout number: if (layoutno == -1) { @@ -1861,7 +1836,7 @@ string LyXFunc::Dispatch(int ac, case LFUN_CHARATCURSOR: { LyXParagraph::size_type pos = - owner->view()->text->cursor.pos; + owner->view()->text->cursor.pos; if(pos < owner->view()->text->cursor.par->size()) dispatch_buffer = owner->view()->text-> cursor.par->text[pos]; @@ -1872,7 +1847,7 @@ string LyXFunc::Dispatch(int ac, case LFUN_GETXY: dispatch_buffer = - tostr(owner->view()->text->cursor.x) + ' ' + tostr(owner->view()->text->cursor.x) + ' ' + tostr(owner->view()->text->cursor.y); break; @@ -1892,7 +1867,7 @@ string LyXFunc::Dispatch(int ac, case LFUN_GETFONT: { - LyXFont *font = &(owner->view()->text->current_font); + LyXFont * font = &(owner->view()->text->current_font); if(font->shape() == LyXFont::ITALIC_SHAPE) dispatch_buffer = 'E'; else if(font->shape() == LyXFont::SMALLCAPS_SHAPE) @@ -1905,7 +1880,7 @@ string LyXFunc::Dispatch(int ac, case LFUN_GETLATEX: { - LyXFont *font = &(owner->view()->text->current_font); + LyXFont * font = &(owner->view()->text->current_font); if(font->latex() == LyXFont::ON) dispatch_buffer = 'L'; else @@ -1922,8 +1897,8 @@ string LyXFunc::Dispatch(int ac, case LFUN_NOTIFY: { - char buf[100]; - keyseq.print(buf, 100); + string buf; + keyseq.print(buf); dispatch_buffer = buf; lyxserver->notifyClient(dispatch_buffer); } @@ -1993,10 +1968,10 @@ string LyXFunc::Dispatch(int ac, { char c; - if (keyseq.length == -1 && keyseq.getiso()!= 0) - c= keyseq.getiso(); + if (keyseq.length == -1 && keyseq.getiso() != 0) + c = keyseq.getiso(); else - c= 0; + c = 0; owner->getIntl()->getTrans()-> deadkey(c, get_accent(action).accent, @@ -2005,7 +1980,7 @@ string LyXFunc::Dispatch(int ac, // Need to reset, in case the minibuffer calls these // actions keyseq.reset(); - keyseq.length= 0; + keyseq.length = 0; // copied verbatim from do_accent_char SmallUpdate(1); @@ -2058,7 +2033,7 @@ string LyXFunc::Dispatch(int ac, #if 0 case LFUN_INSERT_INSET_LATEX: { - Inset *new_inset = new InsetLatex(argument); + Inset * new_inset = new InsetLatex(argument); owner->buffer()->insertInset(new_inset); } break; @@ -2079,7 +2054,7 @@ string LyXFunc::Dispatch(int ac, // Greek keyboard case LFUN_GREEK_TOGGLE: { - greek_kb_flag = (greek_kb_flag) ? 0: 2; + greek_kb_flag = greek_kb_flag ? 0 : 2; if (greek_kb_flag) { setMessage(N_("Math greek keyboard on")); } else { @@ -2118,12 +2093,12 @@ string LyXFunc::Dispatch(int ac, if (owner->view()->available()) { string s(argument); if (s.empty()) - setErrorMessage(N_("Missing argument")); + setErrorMessage(N_("Missing argument")); else { - string s1 = token(s, ' ', 1); - int na = s1.empty() ? 0: atoi(s1.c_str()); - owner->buffer()-> - open_new_inset(new InsetFormulaMacro(token(s, ' ', 0), na)); + string s1 = token(s, ' ', 1); + int na = s1.empty() ? 0: atoi(s1.c_str()); + owner->buffer()-> + open_new_inset(new InsetFormulaMacro(token(s, ' ', 0), na)); } } } @@ -2222,7 +2197,7 @@ string LyXFunc::Dispatch(int ac, case LFUN_INDEX_INSERT_LAST: { // Can't do that at the beginning of a paragraph. - if (owner->view()->text->cursor.pos - 1 <0) + if (owner->view()->text->cursor.pos - 1 < 0) break; InsetIndex * new_inset = new InsetIndex(); @@ -2231,37 +2206,37 @@ string LyXFunc::Dispatch(int ac, new_inset->setContents(lsarg); owner->buffer()->insertInset(new_inset); } else { - //reh 98/09/21 - //get the current word for an argument - LyXParagraph::size_type lastpos = - owner->view()->text->cursor.pos - 1; - // Get the current word. note that this must be done - // before inserting the inset, or the inset will - // break the word - string curstring(owner->view() - ->text->cursor.par->GetWord(lastpos)); - - //make the new inset and write the current word into it - InsetIndex * new_inset = new InsetIndex(); - - new_inset->setContents(curstring); - - //don't edit it if the call was to INSERT_LAST - if(action!= LFUN_INDEX_INSERT_LAST) { - new_inset->Edit(0, 0); - } else { - //it looks blank on the screen unless - //we do something. put it here. - - // move the cursor to the returned value of lastpos - // but only for the auto-insert - owner->view()->text->cursor.pos= lastpos; - } - - //put the new inset into the buffer. - // there should be some way of knowing the user - //cancelled & avoiding this, but i don't know how - owner->buffer()->insertInset(new_inset); + //reh 98/09/21 + //get the current word for an argument + LyXParagraph::size_type lastpos = + owner->view()->text->cursor.pos - 1; + // Get the current word. note that this must be done + // before inserting the inset, or the inset will + // break the word + string curstring(owner->view() + ->text->cursor.par->GetWord(lastpos)); + + //make the new inset and write the current word into it + InsetIndex * new_inset = new InsetIndex(); + + new_inset->setContents(curstring); + + //don't edit it if the call was to INSERT_LAST + if(action != LFUN_INDEX_INSERT_LAST) { + new_inset->Edit(0, 0); + } else { + //it looks blank on the screen unless + //we do something. put it here. + + // move the cursor to the returned value of lastpos + // but only for the auto-insert + owner->view()->text->cursor.pos = lastpos; + } + + //put the new inset into the buffer. + // there should be some way of knowing the user + //cancelled & avoiding this, but i don't know how + owner->buffer()->insertInset(new_inset); } } break; @@ -2299,9 +2274,9 @@ string LyXFunc::Dispatch(int ac, MakeDisplayPath(filename) + "..."); owner->view()->savePosition(); if (bufferlist.exists(filename)) - owner->view()->buffer(bufferlist.getBuffer(filename)); + owner->view()->buffer(bufferlist.getBuffer(filename)); else - owner->view()->buffer(bufferlist.loadLyXFile(filename)); + owner->view()->buffer(bufferlist.loadLyXFile(filename)); } break; @@ -2465,2199 +2440,115 @@ string LyXFunc::Dispatch(int ac, return res; } -#else -string LyXFunc::Dispatch(int ac, - char const * do_not_use_this_arg) -{ - string argument; - kb_action action; - - FL_OBJECT * ob = 0; // This will disapear soon - - // we have not done anything wrong yet. - errorstat = false; - dispatch_buffer.clear(); - - // if action is a pseudo-action, we need the real action - if (lyxaction.isPseudoAction(ac)) { - string tmparg; - action = static_cast - (lyxaction.retrieveActionArg(ac, tmparg)); - if (!tmparg.empty()) - argument = tmparg; - } else { - action = static_cast(ac); - if (do_not_use_this_arg) - argument = do_not_use_this_arg; // except here - } - - selection_possible = false; - - if (owner->view()->available() - && owner->view()->getScreen()) - owner->view()->getScreen()->HideCursor(); - - // We cannot use this function here - if (getStatus(action) & Disabled) - goto exit_with_message; - commandshortcut.clear(); - - if (lyxrc->display_shortcuts && show_sc) { - if (action != LFUN_SELFINSERT) { - // Put name of command and list of shortcuts - // for it in minibuffer - string comname = lyxaction.getActionName(action); - int pseudoaction = action; - bool argsadded = false; +void LyXFunc::setupLocalKeymap() +{ + keyseq.stdmap = keyseq.curmap = toplevel_keymap; + cancel_meta_seq.stdmap = cancel_meta_seq.curmap = toplevel_keymap; +} - if (!argument.empty()) { - // If we have the command with argument, - // this is better - pseudoaction = - lyxaction.searchActionArg(action, - argument.c_str()); - if (pseudoaction == -1) { - pseudoaction = action; - } else { - comname += " " + argument; - argsadded = true; - } - } +void LyXFunc::MenuNew(bool fromTemplate) +{ + string fname, initpath = lyxrc->document_path; + LyXFileDlg fileDlg; - string shortcuts = toplevel_keymap->findbinding(pseudoaction); + if (owner->view()->available()) { + string trypath = owner->buffer()->filepath; + // If directory is writeable, use this as default. + if (IsDirWriteable(trypath) == 1) + initpath = trypath; + } - if (!shortcuts.empty()) { - comname += ": " + shortcuts; - } else if (!argsadded) { - comname += " " + argument; - } + ProhibitInput(); + fileDlg.SetButton(0, _("Documents"), lyxrc->document_path); + fileDlg.SetButton(1, _("Templates"), lyxrc->template_path); + fname = fileDlg.Select(_("Enter Filename for new document"), + initpath, "*.lyx", _("newfile")); + AllowInput(); + + if (fname.empty()) { + owner->getMiniBuffer()->Set(_("Canceled.")); + lyxerr.debug() << "New Document Cancelled." << endl; + return; + } + + // get absolute path of file and make sure the filename ends + // with .lyx + string s = MakeAbsPath(fname); + if (!IsLyXFilename(s)) + s += ".lyx"; - if (!comname.empty()) { - comname = strip(comname); - commandshortcut = "(" + comname + ')'; - owner->getMiniBuffer()->Set(commandshortcut); - // Here we could even add a small pause, - // to annoy the user and make him learn - // the shortcuts. - // No! That will just annoy, not teach - // anything. The user will read the messages - // if they are interested. (Asger) + // Check if the document already is open + if (bufferlist.exists(s)){ + switch(AskConfirmation(_("Document is already open:"), + MakeDisplayPath(s, 50), + _("Do you want to close that document now?\n" + "('No' will just switch to the open version)"))) + { + case 1: // Yes: close the document + if (!bufferlist.close(bufferlist.getBuffer(s))) + // If close is canceled, we cancel here too. + return; + break; + case 2: // No: switch to the open document + owner->view()->buffer(bufferlist.getBuffer(s)); + return; + case 3: // Cancel: Do nothing + owner->getMiniBuffer()->Set(_("Canceled.")); + return; } + } + + // Check whether the file already exists + if (IsLyXFilename(s)) { + FileInfo fi(s); + if (fi.readable() && + AskQuestion(_("File already exists:"), + MakeDisplayPath(s, 50), + _("Do you want to open the document?"))) { + // loads document + owner->getMiniBuffer()->Set(_("Opening document"), + MakeDisplayPath(s), "..."); + XFlush(fl_display); + owner->view()->buffer( + bufferlist.loadLyXFile(s)); + owner->getMiniBuffer()->Set(_("Document"), + MakeDisplayPath(s), + _("opened.")); + return; } - } + } - // If in math mode pass the control to - // the math inset [asierra060396] - if (owner->view()->available() && - owner->buffer()->the_locking_inset) { - if (action > 1 - || (action == LFUN_UNKNOWN_ACTION && keyseq.length>= -1)) { - if (action == LFUN_UNKNOWN_ACTION && argument.empty()) { - argument = keyseq.getiso(); - } - // Undo/Redo pre 0.13 is a bit tricky for insets. - if (action == LFUN_UNDO) { - int slx, sly; - UpdatableInset * inset = - owner->buffer()->the_locking_inset; - inset->GetCursorPos(slx, sly); - UnlockInset(inset); - MenuUndo(); - inset = static_cast(owner->buffer()->text->cursor.par->GetInset(owner->buffer()->text->cursor.pos)); - if (inset) - inset->Edit(slx, sly); - return string(); - } else - if (action == LFUN_REDO) { - int slx, sly; - UpdatableInset * inset = owner->buffer()->the_locking_inset; - inset->GetCursorPos(slx, sly); - UnlockInset(inset); - MenuRedo(); - inset = static_cast(owner->buffer()->text->cursor.par->GetInset(owner->buffer()->text->cursor.pos)); - if (inset) - inset->Edit(slx, sly); - return string(); - } else - if (owner->buffer()->the_locking_inset->LocalDispatch(action, argument.c_str())) - return string(); - else { - setMessage(N_("Text mode")); - if (action == LFUN_RIGHT || action == -1) - owner->buffer()->text->CursorRight(); - if (action == LFUN_LEFT || action == LFUN_RIGHT) - return string(); - } - } + // The template stuff + string templname; + if (fromTemplate) { + ProhibitInput(); + fname = fileDlg.Select(_("Choose template"), + lyxrc->template_path, + "*.lyx"); + templname = fname; + AllowInput(); } + + // find a free buffer + lyxerr.debug() << "Find a free buffer." << endl; + owner->view()->buffer(bufferlist.newFile(s, templname)); +} - switch(action) { - // --- Misc ------------------------------------------- - case LFUN_WORDFINDFORWARD : - case LFUN_WORDFINDBACKWARD : { - static string last_search; - string searched_string; - - if (!argument.empty()) { - last_search = argument; - searched_string = argument; - } else { - searched_string = last_search; - } - LyXText * ltCur = owner->view()->buffer()->text ; - - if (!searched_string.empty() && - ((action == LFUN_WORDFINDBACKWARD) ? - ltCur->SearchBackward(searched_string.c_str()) : - ltCur->SearchForward(searched_string.c_str()))) { - - // ??? What is that ??? - owner->view()->buffer()->update(-2); - - // ??? Needed ??? - // clear the selection (if there is any) - owner->view()->getScreen()->ToggleSelection(); - owner->view()->buffer()->text->ClearSelection(); - - // Move cursor so that successive C-s 's will not stand in place. - if( action == LFUN_WORDFINDFORWARD ) - owner->buffer()->text->CursorRightOneWord(); - owner->buffer()->text->FinishUndo(); - moveCursorUpdate(false); - - // ??? Needed ??? - // set the new selection - // SetSelectionOverLenChars(owner->view()->currentBuffer()->text, iLenSelected); - owner->view()->getScreen()->ToggleSelection(false); - } else - LyXBell(); - - // REMOVED : if (owner->view()->getWorkArea()->focus) - owner->view()->getScreen()->ShowCursor(); - } - break; - - case LFUN_PREFIX: - { - if (owner->view()->available() - && owner->view()->getScreen()) { - owner->buffer()->update(-2); - } - char buf[100]; - keyseq.print(buf, 100, true); - owner->getMiniBuffer()->Set(buf, string(), string(), 1); - } - break; - - // --- Misc ------------------------------------------- - case LFUN_EXEC_COMMAND: - owner->getMiniBuffer()->ExecCommand(); - break; - - case LFUN_CANCEL: // RVDK_PATCH_5 - keyseq.reset(); - meta_fake_bit = 0; - if(owner->view()->available()) - // cancel any selection - Dispatch(LFUN_MARK_OFF, 0); - setMessage(N_("Cancel")); - break; - - case LFUN_META_FAKE: // RVDK_PATCH_5 - { - meta_fake_bit = Mod1Mask; - char buf[100]; - keyseq.print(buf, 98, true); - string res = string("M-") + buf; - setMessage(buf); // RVDK_PATCH_5 - } - break; - - case LFUN_READ_ONLY_TOGGLE: - if (owner->buffer()->lyxvc.inUse()) { - owner->buffer()->lyxvc.toggleReadOnly(); - } else { - owner->buffer()->setReadonly( - !owner->buffer()->isReadonly()); - } - break; - - case LFUN_CENTER: // this is center and redraw. - BeforeChange(); - if (owner->buffer()->text->cursor.y > - owner->view()->getWorkArea()->h / 2) { - owner->view()->getScreen()-> - Draw(owner->buffer()->text->cursor.y - - owner->view()->getWorkArea()->h/2); - } else { // <= - owner->view()->getScreen()-> - Draw(0); - } - owner->buffer()->update(0); - owner->view()->redraw(); - break; - - case LFUN_APPENDIX: - if (owner->view()->available()) { - owner->buffer()->text->toggleAppendix(); - owner->buffer()->update(1); - } - break; - - // --- Menus ----------------------------------------------- - case LFUN_MENUNEW: - MenuNew(false); - break; - - case LFUN_MENUNEWTMPLT: - MenuNew(true); - break; - - case LFUN_MENUOPEN: - MenuOpen(); - break; - - case LFUN_CLOSEBUFFER: - CloseBuffer(); - break; - - case LFUN_MENUWRITE: - MenuWrite(owner->buffer()); - break; - - case LFUN_MENUWRITEAS: - MenuWriteAs(owner->buffer()); - break; - - case LFUN_MENURELOAD: - reloadBuffer(); - break; - - case LFUN_PREVIEW: - MenuPreview(owner->buffer()); - break; - - case LFUN_PREVIEWPS: - MenuPreviewPS(owner->buffer()); - break; - - case LFUN_RUNLATEX: - MenuRunLaTeX(owner->buffer()); - break; - - case LFUN_BUILDPROG: - MenuBuildProg(owner->buffer()); - break; - - case LFUN_RUNCHKTEX: - MenuRunChktex(owner->buffer()); - break; - - case LFUN_RUNDVIPS: - MenuRunDvips(owner->buffer(), false); - break; - - case LFUN_MENUPRINT: - MenuPrint(owner->buffer()); - break; - - case LFUN_FAX: - MenuFax(owner->buffer()); - break; - - case LFUN_EXPORT: - { - //needs argument as string - string extyp = argument; - - // latex - if (extyp == "latex") { - // make sure that this buffer is not linuxdoc - MenuMakeLaTeX(owner->buffer()); - } - // linuxdoc - else if (extyp == "linuxdoc") { - // make sure that this buffer is not latex - MenuMakeLinuxDoc(owner->buffer()); - } - // docbook - else if (extyp == "docbook") { - // make sure that this buffer is not latex or linuxdoc - MenuMakeDocBook(owner->buffer()); - } - // dvi - else if (extyp == "dvi") { - // Run LaTeX as "Update dvi..." Bernhard. - // We want the dvi in the current directory. This - // is achieved by temporarily disabling use of - // temp directory. As a side-effect, we get - // *.log and *.aux files also. (Asger) - bool flag = lyxrc->use_tempdir; - lyxrc->use_tempdir = false; - MenuRunLaTeX(owner->buffer()); - lyxrc->use_tempdir = flag; - } - // postscript - else if (extyp == "postscript") { - // Start Print-dialog. Not as good as dvi... Bernhard. - MenuPrint(owner->buffer()); - // Since the MenuPrint is a pop-up, we can't use - // the same trick as above. (Asger) - // MISSING: Move of ps-file :-( - } - // ascii - else if (extyp == "ascii") { - MenuMakeAscii(owner->buffer()); - } - else if (extyp == "custom") { - MenuSendto(); - break; - } - // HTML - else if (extyp == "html" && lyxrc->html_command != "none") { - // First, create LaTeX file - MenuMakeLaTeX(owner->buffer()); - - // And now, run the converter - string file = owner->buffer()->getFileName(); - Path path(OnlyPath(file)); - // the tex file name has to be correct for - // latex, but the html file name can be - // anything. - string result = ChangeExtension(file, ".html", false); - string infile = owner->buffer()->getLatexName(); - string tmp = lyxrc->html_command; - tmp = subst(tmp, "$$FName", infile); - tmp = subst(tmp, "$$OutName", result); - Systemcalls one; - int res = one.startscript(Systemcalls::System, tmp); - if (res == 0) { - setMessage(N_("Document exported as HTML to file `") - + MakeDisplayPath(result) +'\''); - } else { - setErrorMessage(N_("Unable to convert to HTML the file `") - + MakeDisplayPath(infile) - + '\''); - } - } - else { - setErrorMessage(N_("Unknown export type: ") - + extyp); - } - } - break; - - case LFUN_IMPORT: - { - //needs argument as string - string imtyp = argument; - - // latex - if (imtyp == "latex") { - doImportLaTeX(false); - } - // ascii - else if (imtyp == "ascii") { - doImportASCII(false); - } else if (imtyp == "asciiparagraph") { - doImportASCII(true); - // noweb - } else if (imtyp == "noweb") { - doImportLaTeX(true); - } else { - setErrorMessage(string(N_("Unknown import type: ")) - + imtyp); - } - break; - } - - case LFUN_QUIT: - QuitLyX(); - break; - - case LFUN_TOCVIEW: - TocUpdateCB(ob, 0); - if (fd_form_toc->form_toc->visible) { - fl_raise_form(fd_form_toc->form_toc); - } else { - static int ow = -1, oh; - fl_show_form(fd_form_toc->form_toc, - FL_PLACE_MOUSE | - FL_FREE_SIZE, FL_FULLBORDER, - _("Table of Contents")); - if (ow < 0) { - ow = fd_form_toc->form_toc->w; - oh = fd_form_toc->form_toc->h; - } - fl_set_form_minsize(fd_form_toc->form_toc, ow, oh); - } - break; - - case LFUN_TOC_INSERT: - { - Inset * new_inset = new InsetTOC(owner->buffer()); - owner->buffer()->insertInset(new_inset, "Standard", true); - break; - } - - case LFUN_LOF_INSERT: - { - Inset * new_inset = new InsetLOF(owner->buffer()); - owner->buffer()->insertInset(new_inset, "Standard", true); - break; - } - - case LFUN_LOA_INSERT: - { - Inset * new_inset = new InsetLOA(owner->buffer()); - owner->buffer()->insertInset(new_inset, "Standard", true); - break; - } - - case LFUN_LOT_INSERT: - { - Inset * new_inset = new InsetLOT(owner->buffer()); - owner->buffer()->insertInset(new_inset, "Standard", true); - break; - } - - case LFUN_TABLE: - TableCB(ob, 0); - break; - - case LFUN_FIGURE: - FigureCB(ob, 0); - break; - - case LFUN_AUTOSAVE: - AutoSave(); - break; - - case LFUN_UNDO: - MenuUndo(); - break; - - case LFUN_REDO: - MenuRedo(); - break; - - case LFUN_MENUSEARCH: - MenuSearch(); - break; - - case LFUN_PASTE: - PasteCB(); - break; - - case LFUN_PASTESELECTION: - { - bool asPara = false; - if (argument == "paragraph") asPara = true; - MenuPasteSelection(asPara); - break; - } - - case LFUN_CUT: - CutCB(); - break; - - case LFUN_COPY: - CopyCB(); - break; - - case LFUN_LAYOUT_COPY: - CopyEnvironmentCB(); - break; - - case LFUN_LAYOUT_PASTE: - PasteEnvironmentCB(); - break; - - case LFUN_GOTOERROR: - owner->view()->gotoError(); - break; - - case LFUN_REMOVEERRORS: - if (owner->buffer()->removeAutoInsets()) { - owner->view()->redraw(); - owner->view()->fitCursor(); - owner->view()->updateScrollbar(); - } - break; - - case LFUN_GOTONOTE: - GotoNote(); - break; - - case LFUN_OPENSTUFF: - OpenStuff(); - break; - - case LFUN_HYPHENATION: - HyphenationPoint(); - break; - - case LFUN_LDOTS: - Ldots(); - break; - - case LFUN_END_OF_SENTENCE: - EndOfSentenceDot(); - break; - - case LFUN_MENU_SEPARATOR: - MenuSeparator(); - break; - - case LFUN_HFILL: - HFill(); - break; - - case LFUN_DEPTH: - DepthCB(ob, 0); - break; - - case LFUN_DEPTH_MIN: - DepthCB(ob, -1); - break; - - case LFUN_DEPTH_PLUS: - DepthCB(ob, 1); - break; - - case LFUN_FREE: - FreeCB(); - break; - - case LFUN_TEX: - TexCB(); - break; - - case LFUN_MELT: - MeltCB(ob, 0); - break; - - case LFUN_RECONFIGURE: - Reconfigure(); - break; - - case LFUN_FOOTMELT: - if (owner->view()->available() - && !owner->buffer()->text->selection - && owner->buffer()->text->cursor.par->footnoteflag - != LyXParagraph::NO_FOOTNOTE) - { // only melt footnotes with FOOTMELT, not margins etc - if(owner->buffer()->text->cursor.par->footnotekind == LyXParagraph::FOOTNOTE) - MeltCB(ob, 0); - } - else - FootCB(ob, 0); - break; - - case LFUN_MARGINMELT: - if (owner->view()->available() - && !owner->buffer()->text->selection - && owner->buffer()->text->cursor.par->footnoteflag - != LyXParagraph::NO_FOOTNOTE) { - // only melt margins - if(owner->buffer()->text->cursor.par->footnotekind == LyXParagraph::MARGIN) - MeltCB(ob, 0); - } - else - MarginCB(ob, 0); - break; - - // --- version control ------------------------------- - case LFUN_VC_REGISTER: - { - if (!owner->buffer()->lyxvc.inUse()) - owner->buffer()->lyxvc.registrer(); - } - break; - - case LFUN_VC_CHECKIN: - { - if (owner->buffer()->lyxvc.inUse() - && !owner->buffer()->isReadonly()) - owner->buffer()->lyxvc.checkIn(); - } - break; - - case LFUN_VC_CHECKOUT: - { - if (owner->buffer()->lyxvc.inUse() - && owner->buffer()->isReadonly()) - owner->buffer()->lyxvc.checkOut(); - } - break; - - case LFUN_VC_REVERT: - { - owner->buffer()->lyxvc.revert(); - } - break; - - case LFUN_VC_UNDO: - { - owner->buffer()->lyxvc.undoLast(); - } - break; - - case LFUN_VC_HISTORY: - { - owner->buffer()->lyxvc.showLog(); - break; - } - - // --- buffers ---------------------------------------- - case LFUN_PREVBUFFER: -#ifdef WITH_WARNINGS -#warning fix this please -#endif - // it is the LyXView or the BufferView that should - // remember the previous buffer, not bufferlist. -// if (owner->view()->available()){ -// BeforeChange(); -// owner->buffer()->update(-2); -// } -// owner->view()->setBuffer(bufferlist.prev()); - -// owner->view()-> -// resizeCurrentBufferPseudoExpose(); - break; - - case LFUN_FILE_INSERT: - { - MenuInsertLyXFile(argument); - } - break; - - case LFUN_FILE_INSERT_ASCII: - { - bool asPara = (argument == "paragraph"); - InsertAsciiFile(string(), asPara); - } - break; - - case LFUN_FILE_NEW: - { - // servercmd: argument must be :