PageRenderTime 61ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/libreoffice-3.6.0.2/binfilter/bf_svtools/source/filter.vcl/filter/svt_sgvmain.cxx

#
C++ | 1089 lines | 798 code | 74 blank | 217 comment | 111 complexity | d8fe0e6235882d37513329483865cb4e MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, LGPL-2.1, AGPL-1.0, BSD-3-Clause-No-Nuclear-License-2014, GPL-3.0, LGPL-3.0
  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  2. /*************************************************************************
  3. *
  4. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  5. *
  6. * Copyright 2000, 2010 Oracle and/or its affiliates.
  7. *
  8. * OpenOffice.org - a multi-platform office productivity suite
  9. *
  10. * This file is part of OpenOffice.org.
  11. *
  12. * OpenOffice.org is free software: you can redistribute it and/or modify
  13. * it under the terms of the GNU Lesser General Public License version 3
  14. * only, as published by the Free Software Foundation.
  15. *
  16. * OpenOffice.org is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU Lesser General Public License version 3 for more details
  20. * (a copy is included in the LICENSE file that accompanied this code).
  21. *
  22. * You should have received a copy of the GNU Lesser General Public License
  23. * version 3 along with OpenOffice.org. If not, see
  24. * <http://www.openoffice.org/license.html>
  25. * for a copy of the LGPLv3 License.
  26. *
  27. ************************************************************************/
  28. #include <osl/endian.h>
  29. #include <vcl/graph.hxx>
  30. #include <tools/poly.hxx>
  31. #include <bf_svtools/filter.hxx>
  32. #include "sgffilt.hxx"
  33. #include "sgfbram.hxx"
  34. #include "sgvmain.hxx"
  35. #include "sgvspln.hxx"
  36. #include <unotools/ucbstreamhelper.hxx>
  37. namespace binfilter
  38. {
  39. #define SWAPPOINT(p) { \
  40. p.x=SWAPSHORT(p.x); \
  41. p.y=SWAPSHORT(p.y); }
  42. #define SWAPPAGE(p) { \
  43. p.Next =SWAPLONG (p.Next ); \
  44. p.nList =SWAPLONG (p.nList ); \
  45. p.ListEnd=SWAPLONG (p.ListEnd); \
  46. p.Paper.Size.x=SWAPSHORT(p.Paper.Size.x); \
  47. p.Paper.Size.y=SWAPSHORT(p.Paper.Size.y); \
  48. p.Paper.RandL =SWAPSHORT(p.Paper.RandL ); \
  49. p.Paper.RandR =SWAPSHORT(p.Paper.RandR ); \
  50. p.Paper.RandO =SWAPSHORT(p.Paper.RandO ); \
  51. p.Paper.RandU =SWAPSHORT(p.Paper.RandU ); \
  52. SWAPPOINT(p.U); \
  53. UINT16 iTemp; \
  54. for (iTemp=0;iTemp<20;iTemp++) { \
  55. rPage.HlpLnH[iTemp]=SWAPSHORT(rPage.HlpLnH[iTemp]); \
  56. rPage.HlpLnV[iTemp]=SWAPSHORT(rPage.HlpLnV[iTemp]); }}
  57. #define SWAPOBJK(o) { \
  58. o.Last =SWAPLONG (o.Last ); \
  59. o.Next =SWAPLONG (o.Next ); \
  60. o.MemSize =SWAPSHORT(o.MemSize ); \
  61. SWAPPOINT(o.ObjMin); \
  62. SWAPPOINT(o.ObjMax); }
  63. #define SWAPLINE(l) { \
  64. l.LMSize=SWAPSHORT(l.LMSize); \
  65. l.LDicke=SWAPSHORT(l.LDicke); }
  66. #define SWAPAREA(a) { \
  67. a.FDummy2=SWAPSHORT(a.FDummy2); \
  68. a.FMuster=SWAPSHORT(a.FMuster); }
  69. #define SWAPTEXT(t) { \
  70. SWAPLINE(t.L); \
  71. SWAPAREA(t.F); \
  72. t.FontLo =SWAPSHORT(t.FontLo ); \
  73. t.FontHi =SWAPSHORT(t.FontHi ); \
  74. t.Grad =SWAPSHORT(t.Grad ); \
  75. t.Breite =SWAPSHORT(t.Breite ); \
  76. t.Schnitt=SWAPSHORT(t.Schnitt); \
  77. t.LnFeed =SWAPSHORT(t.LnFeed ); \
  78. t.Slant =SWAPSHORT(t.Slant ); \
  79. SWAPLINE(t.ShdL); \
  80. SWAPAREA(t.ShdF); \
  81. SWAPPOINT(t.ShdVers); \
  82. SWAPAREA(t.BackF); }
  83. ////////////////////////////////////////////////////////////////////////////////////////////////////
  84. //
  85. // Einschraenkungen:
  86. //
  87. // - Flaechenmuster werden den unter StarView verfuegbaren Mustern angenaehert.
  88. // - Linienenden werden unter StarView immer rund dargestellt und gehen ueber
  89. // den Endpunkt der Linie hinaus.
  90. // - Linienmuster werden den unter StarView verfuegbaren Mustern angenaehert.
  91. // Transparent/Opak wird zur Zeit noch nicht beruecksichtigt.
  92. // - Keine gedrehten Ellipsen
  93. //
  94. //
  95. //
  96. //
  97. ////////////////////////////////////////////////////////////////////////////////////////////////////
  98. #if defined( WIN ) && defined( MSC )
  99. #pragma code_seg( "svtools", "AUTO_CODE" )
  100. #endif
  101. ////////////////////////////////////////////////////////////////////////////////////////////////////
  102. // Fuer Fontuebersetzung ///////////////////////////////////////////////////////////////////////////
  103. ////////////////////////////////////////////////////////////////////////////////////////////////////
  104. SgfFontLst* pSgfFonts = 0;
  105. #if defined( WIN ) && defined( MSC )
  106. #pragma code_seg( "SVTOOLS_FILTER3", "SVTOOLS_CODE" )
  107. static void AntiMscBug() {}
  108. #endif
  109. ////////////////////////////////////////////////////////////////////////////////////////////////////
  110. // Fuer Kreisunterarten, Text und gedrehte Rechtecke ///////////////////////////////////////////////
  111. ////////////////////////////////////////////////////////////////////////////////////////////////////
  112. void RotatePoint(PointType& P, INT16 cx, INT16 cy, double sn, double cs)
  113. {
  114. INT16 dx,dy;
  115. double x1,y1;
  116. dx=P.x-cx;
  117. dy=P.y-cy;
  118. x1=dx*cs-dy*sn;
  119. y1=dy*cs+dx*sn;
  120. P.x=cx+INT16(x1);
  121. P.y=cy+INT16(y1);
  122. }
  123. void RotatePoint(Point& P, INT16 cx, INT16 cy, double sn, double cs)
  124. {
  125. INT16 dx,dy;
  126. double x1,y1;
  127. dx=(INT16)(P.X()-cx);
  128. dy=(INT16)(P.Y()-cy);
  129. x1=dx*cs-dy*sn;
  130. y1=dy*cs+dx*sn;
  131. P=Point(cx+INT16(x1),cy+INT16(y1));
  132. }
  133. INT16 iMulDiv(INT16 a, INT16 Mul, INT16 Div)
  134. {
  135. INT32 Temp;
  136. Temp=INT32(a)*INT32(Mul)/INT32(Div);
  137. return INT16(Temp);
  138. }
  139. UINT16 MulDiv(UINT16 a, UINT16 Mul, UINT16 Div)
  140. {
  141. UINT32 Temp;
  142. Temp=UINT32(a)*UINT32(Mul)/UINT32(Div);
  143. return UINT16(Temp);
  144. }
  145. ////////////////////////////////////////////////////////////////////////////////////////////////////
  146. // SgfFilterSDrw ///////////////////////////////////////////////////////////////////////////////////
  147. ////////////////////////////////////////////////////////////////////////////////////////////////////
  148. SvStream& operator>>(SvStream& rIStream, DtHdType& rDtHd)
  149. {
  150. rIStream.Read((char*)&rDtHd.Reserved[0],DtHdSize);
  151. return rIStream;
  152. }
  153. void DtHdOverSeek(SvStream& rInp)
  154. {
  155. ULONG FPos=rInp.Tell();
  156. FPos+=(ULONG)DtHdSize;
  157. rInp.Seek(FPos);
  158. // rInp.seekg(rInp.tellg()+(ULONG)DtHdSize);
  159. }
  160. SvStream& operator>>(SvStream& rIStream, PageType& rPage)
  161. {
  162. rIStream.Read((char*)&rPage.Next,PageSize);
  163. #if defined OSL_BIGENDIAN
  164. SWAPPAGE(rPage);
  165. #endif
  166. return rIStream;
  167. }
  168. void ObjkOverSeek(SvStream& rInp, ObjkType& rObjk)
  169. {
  170. ULONG Siz;
  171. Siz=(ULONG)rObjk.MemSize+rObjk.Last; // ObjSize+ObjAnhSize
  172. rInp.Seek(rInp.Tell()+Siz);
  173. }
  174. SvStream& operator>>(SvStream& rInp, ObjkType& rObjk)
  175. { // Die Fileposition im Stream bleibt unveraendert!
  176. ULONG nPos;
  177. nPos=rInp.Tell();
  178. rInp.Read((char*)&rObjk.Last,ObjkSize);
  179. #if defined OSL_BIGENDIAN
  180. SWAPOBJK(rObjk);
  181. #endif
  182. #ifdef InArbeit
  183. ULONG nPos1=rInp.Tell();
  184. if(nPos == nPos1) InfoBox( NULL, "tellg funkt nich" ).Execute();
  185. #endif
  186. rInp.Seek(nPos);
  187. #ifdef InArbeit
  188. if (rInp.Tell() != nPos) InfoBox( NULL, "seekg funkt nich" ).Execute();
  189. #endif
  190. return rInp;
  191. }
  192. SvStream& operator>>(SvStream& rInp, StrkType& rStrk)
  193. {
  194. rInp.Read((char*)&rStrk.Last,StrkSize);
  195. #if defined OSL_BIGENDIAN
  196. SWAPOBJK (rStrk);
  197. SWAPLINE (rStrk.L);
  198. SWAPPOINT(rStrk.Pos1);
  199. SWAPPOINT(rStrk.Pos2);
  200. #endif
  201. return rInp;
  202. }
  203. SvStream& operator>>(SvStream& rInp, RectType& rRect)
  204. {
  205. rInp.Read((char*)&rRect.Last,RectSize);
  206. #if defined OSL_BIGENDIAN
  207. SWAPOBJK (rRect);
  208. SWAPLINE (rRect.L);
  209. SWAPAREA (rRect.F);
  210. SWAPPOINT(rRect.Pos1);
  211. SWAPPOINT(rRect.Pos2);
  212. rRect.Radius =SWAPSHORT(rRect.Radius );
  213. rRect.DrehWink=SWAPSHORT(rRect.DrehWink);
  214. rRect.Slant =SWAPSHORT(rRect.Slant );
  215. #endif
  216. return rInp;
  217. }
  218. SvStream& operator>>(SvStream& rInp, PolyType& rPoly)
  219. {
  220. rInp.Read((char*)&rPoly.Last,PolySize);
  221. #if defined OSL_BIGENDIAN
  222. SWAPOBJK (rPoly);
  223. SWAPLINE (rPoly.L);
  224. SWAPAREA (rPoly.F);
  225. // rPoly.EckP=SWAPLONG(rPoly.EckP);
  226. #endif
  227. return rInp;
  228. }
  229. SvStream& operator>>(SvStream& rInp, SplnType& rSpln)
  230. {
  231. rInp.Read((char*)&rSpln.Last,SplnSize);
  232. #if defined OSL_BIGENDIAN
  233. SWAPOBJK (rSpln);
  234. SWAPLINE (rSpln.L);
  235. SWAPAREA (rSpln.F);
  236. // rSpln.EckP=SWAPLONG(rSpln.EckP);
  237. #endif
  238. return rInp;
  239. }
  240. SvStream& operator>>(SvStream& rInp, CircType& rCirc)
  241. {
  242. rInp.Read((char*)&rCirc.Last,CircSize);
  243. #if defined OSL_BIGENDIAN
  244. SWAPOBJK (rCirc);
  245. SWAPLINE (rCirc.L);
  246. SWAPAREA (rCirc.F);
  247. SWAPPOINT(rCirc.Radius);
  248. SWAPPOINT(rCirc.Center);
  249. rCirc.DrehWink =SWAPSHORT(rCirc.DrehWink );
  250. rCirc.StartWink=SWAPSHORT(rCirc.StartWink);
  251. rCirc.RelWink =SWAPSHORT(rCirc.RelWink );
  252. #endif
  253. return rInp;
  254. }
  255. SvStream& operator>>(SvStream& rInp, TextType& rText)
  256. {
  257. rInp.Read((char*)&rText.Last,TextSize);
  258. #if defined OSL_BIGENDIAN
  259. SWAPOBJK (rText);
  260. SWAPTEXT (rText.T);
  261. SWAPPOINT(rText.Pos1);
  262. SWAPPOINT(rText.Pos2);
  263. rText.TopOfs =SWAPSHORT(rText.TopOfs );
  264. rText.DrehWink=SWAPSHORT(rText.DrehWink);
  265. rText.BoxSlant=SWAPSHORT(rText.BoxSlant);
  266. rText.BufSize =SWAPSHORT(rText.BufSize );
  267. //rText.Buf =SWAPLONG (rText.Buf );
  268. //rText.Ext =SWAPLONG (rText.Ext );
  269. SWAPPOINT(rText.FitSize);
  270. rText.FitBreit=SWAPSHORT(rText.FitBreit);
  271. #endif
  272. rText.Buffer=NULL;
  273. return rInp;
  274. }
  275. SvStream& operator>>(SvStream& rInp, BmapType& rBmap)
  276. {
  277. rInp.Read((char*)&rBmap.Last,BmapSize);
  278. #if defined OSL_BIGENDIAN
  279. SWAPOBJK (rBmap);
  280. SWAPAREA (rBmap.F);
  281. SWAPPOINT(rBmap.Pos1);
  282. SWAPPOINT(rBmap.Pos2);
  283. rBmap.DrehWink=SWAPSHORT(rBmap.DrehWink);
  284. rBmap.Slant =SWAPSHORT(rBmap.Slant );
  285. SWAPPOINT(rBmap.PixSize);
  286. #endif
  287. return rInp;
  288. }
  289. SvStream& operator>>(SvStream& rInp, GrupType& rGrup)
  290. {
  291. rInp.Read((char*)&rGrup.Last,GrupSize);
  292. #if defined OSL_BIGENDIAN
  293. SWAPOBJK (rGrup);
  294. rGrup.SbLo =SWAPSHORT(rGrup.SbLo );
  295. rGrup.SbHi =SWAPSHORT(rGrup.SbHi );
  296. rGrup.UpLo =SWAPSHORT(rGrup.UpLo );
  297. rGrup.UpHi =SWAPSHORT(rGrup.UpHi );
  298. rGrup.ChartSize=SWAPSHORT(rGrup.ChartSize);
  299. rGrup.ChartPtr =SWAPLONG (rGrup.ChartPtr );
  300. #endif
  301. return rInp;
  302. }
  303. /*************************************************************************
  304. |*
  305. |* Sgv2SvFarbe()
  306. |*
  307. *************************************************************************/
  308. Color Sgv2SvFarbe(BYTE nFrb1, BYTE nFrb2, BYTE nInts)
  309. {
  310. UINT16 r1=0,g1=0,b1=0,r2=0,g2=0,b2=0;
  311. BYTE nInt2=100-nInts;
  312. switch(nFrb1 & 0x07) {
  313. case 0: r1=0xFF; g1=0xFF; b1=0xFF; break;
  314. case 1: r1=0xFF; g1=0xFF; break;
  315. case 2: g1=0xFF; b1=0xFF; break;
  316. case 3: g1=0xFF; break;
  317. case 4: r1=0xFF; b1=0xFF; break;
  318. case 5: r1=0xFF; break;
  319. case 6: b1=0xFF; break;
  320. case 7: break;
  321. }
  322. switch(nFrb2 & 0x07) {
  323. case 0: r2=0xFF; g2=0xFF; b2=0xFF; break;
  324. case 1: r2=0xFF; g2=0xFF; break;
  325. case 2: g2=0xFF; b2=0xFF; break;
  326. case 3: g2=0xFF; break;
  327. case 4: r2=0xFF; b2=0xFF; break;
  328. case 5: r2=0xFF; break;
  329. case 6: b2=0xFF; break;
  330. case 7: break;
  331. }
  332. r1=(UINT16)((UINT32)r1*nInts/100+(UINT32)r2*nInt2/100);
  333. g1=(UINT16)((UINT32)g1*nInts/100+(UINT32)g2*nInt2/100);
  334. b1=(UINT16)((UINT32)b1*nInts/100+(UINT32)b2*nInt2/100);
  335. Color aColor( (sal_uInt8)r1, (sal_uInt8)g1, (sal_uInt8)b1 );
  336. return aColor;
  337. }
  338. void SetLine(ObjLineType& rLine, OutputDevice& rOut)
  339. {
  340. /* !!!
  341. PenStyle aStyle=PEN_SOLID;
  342. switch(rLine.LMuster & 0x07) {
  343. case 0: aStyle=PEN_NULL; break;
  344. case 1: aStyle=PEN_SOLID; break;
  345. case 2: aStyle=PEN_DOT; break; // . . . . . . . . . . . . . .
  346. case 3: aStyle=PEN_DASH; break; // __ __ __ __ __ __ __ __ __
  347. case 4: aStyle=PEN_DASH; break; // ___ ___ ___ ___ ___ ___ ___
  348. case 5: aStyle=PEN_DASHDOT; break; // __ . __ . __ . __ . __ . __
  349. case 6: aStyle=PEN_DASHDOT; break; // __ _ __ _ __ _ __ _ __ _ __
  350. case 7: aStyle=PEN_DASHDOT; break; // ___ _ _ ___ _ _ ___ _ _ ___
  351. }
  352. Pen aPen(Sgv2SvFarbe(rLine.LFarbe,rLine.LBFarbe,rLine.LIntens),rLine.LDicke,aStyle);
  353. SetPen(aPen,rOut);
  354. */
  355. if( 0 == ( rLine.LMuster & 0x07 ) )
  356. rOut.SetLineColor();
  357. else
  358. rOut.SetLineColor( Sgv2SvFarbe(rLine.LFarbe,rLine.LBFarbe,rLine.LIntens) );
  359. }
  360. void SetArea(ObjAreaType& rArea, OutputDevice& rOut)
  361. {
  362. /*
  363. BrushStyle aStyle=BRUSH_SOLID;
  364. switch(rArea.FMuster & 0x00FF) {
  365. case 0: aStyle=BRUSH_NULL; break;
  366. case 1: aStyle=BRUSH_SOLID; break;
  367. case 2: case 4: case 6: case 8:
  368. case 10: case 12: case 14: case 16:
  369. case 43: case 45: aStyle=BRUSH_VERT; break;
  370. case 3: case 5: case 7: case 9:
  371. case 11: case 13: case 15: case 17:
  372. case 42: case 44: aStyle=BRUSH_HORZ; break;
  373. case 18: case 20: case 22: case 24:
  374. case 26: case 28: case 30: case 32:
  375. case 46: case 48: aStyle=BRUSH_UPDIAG; break;
  376. case 19: case 21: case 23: case 25:
  377. case 27: case 29: case 31: case 33:
  378. case 47: case 49: aStyle=BRUSH_DOWNDIAG; break;
  379. case 34: case 35: case 36: case 37: aStyle=BRUSH_CROSS; break;
  380. case 38: case 39: case 40: case 41: aStyle=BRUSH_DIAGCROSS; break;
  381. default: aStyle=BRUSH_DIAGCROSS; break;
  382. }
  383. Brush aBrush(Sgv2SvFarbe(rArea.FFarbe,rArea.FBFarbe,rArea.FIntens),aStyle);
  384. aBrush.SetTransparent((rArea.FMuster & 0x80) !=0L);
  385. SetBrush(aBrush,rOut);
  386. */
  387. if( 0 == ( rArea.FMuster & 0x00FF ) )
  388. rOut.SetFillColor();
  389. else
  390. rOut.SetFillColor( Sgv2SvFarbe( rArea.FFarbe,rArea.FBFarbe,rArea.FIntens ) );
  391. }
  392. /*************************************************************************
  393. |*
  394. |* ObjkType::DrawObjekt()
  395. |*
  396. *************************************************************************/
  397. void ObjkType::Draw(OutputDevice&)
  398. {
  399. // ShowSDObjk(*this);
  400. }
  401. void Obj0Type::Draw(OutputDevice&) {}
  402. /*************************************************************************
  403. |*
  404. |* StrkType::DrawObjekt()
  405. |*
  406. *************************************************************************/
  407. void StrkType::Draw(OutputDevice& rOut)
  408. {
  409. SetLine(L,rOut);
  410. rOut.DrawLine(Point(Pos1.x,Pos1.y),Point(Pos2.x,Pos2.y)); // !!!
  411. }
  412. /*************************************************************************
  413. |*
  414. |* RectType::DrawObjekt()
  415. |*
  416. *************************************************************************/
  417. void SgfAreaColorIntens(UINT16 Muster, BYTE Col1, BYTE Col2, BYTE Int, OutputDevice& rOut)
  418. {
  419. ObjAreaType F;
  420. F.FMuster=Muster;
  421. F.FFarbe=Col2;
  422. F.FBFarbe=Col1;
  423. F.FIntens=Int;
  424. SetArea(F,rOut);
  425. }
  426. void DrawSlideRect(INT16 x1, INT16 y1, INT16 x2, INT16 y2, ObjAreaType& F, OutputDevice& rOut)
  427. {
  428. INT16 i,i0,b,b0;
  429. INT16 Int1,Int2;
  430. INT16 Col1,Col2;
  431. // ClipMerk: HgdClipRec;
  432. INT16 cx,cy;
  433. INT16 MaxR;
  434. INT32 dx,dy;
  435. rOut.SetLineColor();
  436. if (x1>x2) { i=x1; x1=x2; x2=i; }
  437. if (y1>y2) { i=y1; y1=y2; y2=i; }
  438. Col1=F.FBFarbe & 0x87; Col2=F.FFarbe & 0x87;
  439. Int1=100-F.FIntens; Int2=F.FIntens;
  440. if (Int1==Int2) {
  441. SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut);
  442. rOut.DrawRect(Rectangle(x1,y1,x2,y2));
  443. } else {
  444. b0=Int1;
  445. switch (F.FBFarbe & 0x38) {
  446. case 0x08: { // vertikal
  447. i0=y1;
  448. i=y1;
  449. while (i<=y2) {
  450. b=Int1+INT16((INT32)(Int2-Int1)*(INT32)(i-y1) /(INT32)(y2-y1+1));
  451. if (b!=b0) {
  452. SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut);
  453. rOut.DrawRect(Rectangle(x1,i0,x2,i-1));
  454. i0=i; b0=b;
  455. }
  456. i++;
  457. }
  458. SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut);
  459. rOut.DrawRect(Rectangle(x1,i0,x2,y2));
  460. } break;
  461. case 0x28: { // horizontal
  462. i0=x1;
  463. i=x1;
  464. while (i<=x2) {
  465. b=Int1+INT16((INT32)(Int2-Int1)*(INT32)(i-x1) /(INT32)(x2-x1+1));
  466. if (b!=b0) {
  467. SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut);
  468. rOut.DrawRect(Rectangle(i0,y1,i-1,y2));
  469. i0=i; b0=b;
  470. }
  471. i++;
  472. }
  473. SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut);
  474. rOut.DrawRect(Rectangle(i0,y1,x2,y2));
  475. } break;
  476. case 0x18: case 0x38: { // Kreis
  477. Region ClipMerk=rOut.GetClipRegion();
  478. double a;
  479. rOut.SetClipRegion(Region(Rectangle(x1,y1,x2,y2)));
  480. cx=(x1+x2) /2;
  481. cy=(y1+y2) /2;
  482. dx=x2-x1+1;
  483. dy=y2-y1+1;
  484. a=sqrt((double)(dx*dx+dy*dy));
  485. MaxR=INT16(a) /2 +1;
  486. b0=Int2;
  487. i0=MaxR; if (MaxR<1) MaxR=1;
  488. i=MaxR;
  489. while (i>=0) {
  490. b=Int1+INT16((INT32(Int2-Int1)*INT32(i)) /INT32(MaxR));
  491. if (b!=b0) {
  492. SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut);
  493. //if (i0>200 || (Col1 & $80)!=0 || (Col2 & $80)!=0) {
  494. // then begin { Fallunterscheidung fuer etwas bessere Performance }
  495. // s2:=i0-i+2;
  496. // SetPenSize(s2);
  497. // s2:=s2 div 2;
  498. // Circle(cx,cy,i0-s2,i0-s2);{}
  499. // else
  500. rOut.DrawEllipse(Rectangle(cx-i0,cy-i0,cx+i0,cy+i0));
  501. i0=i; b0=b;
  502. }
  503. i--;
  504. }
  505. SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int1,rOut);
  506. rOut.DrawEllipse(Rectangle(cx-i0,cy-i0,cx+i0,cy+i0));
  507. rOut.SetClipRegion(ClipMerk);
  508. } break; // Kreis
  509. }
  510. }
  511. }
  512. void RectType::Draw(OutputDevice& rOut)
  513. {
  514. if (L.LMuster!=0) L.LMuster=1; // keine Linienmuster hier, nur an oder aus
  515. SetArea(F,rOut);
  516. if (DrehWink==0) {
  517. if ((F.FBFarbe & 0x38)==0 || Radius!=0) {
  518. SetLine(L,rOut);
  519. rOut.DrawRect(Rectangle(Pos1.x,Pos1.y,Pos2.x,Pos2.y),Radius,Radius);
  520. } else {
  521. DrawSlideRect(Pos1.x,Pos1.y,Pos2.x,Pos2.y,F,rOut);
  522. if (L.LMuster!=0) {
  523. SetLine(L,rOut);
  524. rOut.SetFillColor();
  525. rOut.DrawRect(Rectangle(Pos1.x,Pos1.y,Pos2.x,Pos2.y));
  526. }
  527. }
  528. } else {
  529. Point aPts[4];
  530. USHORT i;
  531. double sn,cs;
  532. sn=sin(double(DrehWink)*3.14159265359/18000);
  533. cs=cos(double(DrehWink)*3.14159265359/18000);
  534. aPts[0]=Point(Pos1.x,Pos1.y);
  535. aPts[1]=Point(Pos2.x,Pos1.y);
  536. aPts[2]=Point(Pos2.x,Pos2.y);
  537. aPts[3]=Point(Pos1.x,Pos2.y);
  538. for (i=0;i<4;i++) {
  539. RotatePoint(aPts[i],Pos1.x,Pos1.y,sn,cs);
  540. }
  541. SetLine(L,rOut);
  542. Polygon aPoly(4,aPts);
  543. rOut.DrawPolygon(aPoly);
  544. }
  545. }
  546. /*************************************************************************
  547. |*
  548. |* PolyType::Draw()
  549. |*
  550. *************************************************************************/
  551. void PolyType::Draw(OutputDevice& rOut)
  552. {
  553. if ((Flags & PolyClosBit) !=0) SetArea(F,rOut);
  554. SetLine(L,rOut);
  555. Polygon aPoly(nPoints);
  556. USHORT i;
  557. for(i=0;i<nPoints;i++) aPoly.SetPoint(Point(EckP[i].x,EckP[i].y),i);
  558. if ((Flags & PolyClosBit) !=0) {
  559. rOut.DrawPolygon(aPoly);
  560. } else {
  561. rOut.DrawPolyLine(aPoly);
  562. }
  563. }
  564. /*************************************************************************
  565. |*
  566. |* SplnType::Draw()
  567. |*
  568. *************************************************************************/
  569. void SplnType::Draw(OutputDevice& rOut)
  570. {
  571. if ((Flags & PolyClosBit) !=0) SetArea(F,rOut);
  572. SetLine(L,rOut);
  573. Polygon aPoly(0);
  574. Polygon aSpln(nPoints);
  575. USHORT i;
  576. for(i=0;i<nPoints;i++) aSpln.SetPoint(Point(EckP[i].x,EckP[i].y),i);
  577. if ((Flags & PolyClosBit) !=0) {
  578. Spline2Poly(aSpln,TRUE,aPoly);
  579. if (aPoly.GetSize()>0) rOut.DrawPolygon(aPoly);
  580. } else {
  581. Spline2Poly(aSpln,FALSE,aPoly);
  582. if (aPoly.GetSize()>0) rOut.DrawPolyLine(aPoly);
  583. }
  584. }
  585. /*************************************************************************
  586. |*
  587. |* CircType::Draw()
  588. |*
  589. *************************************************************************/
  590. void DrawSlideCirc(INT16 cx, INT16 cy, INT16 rx, INT16 ry, ObjAreaType& F, OutputDevice& rOut)
  591. {
  592. INT16 x1=cx-rx;
  593. INT16 y1=cy-ry;
  594. INT16 x2=cx+rx;
  595. INT16 y2=cy+ry;
  596. INT16 i,i0,b,b0;
  597. INT16 Int1,Int2;
  598. INT16 Col1,Col2;
  599. rOut.SetLineColor();
  600. Col1=F.FBFarbe & 0x87; Col2=F.FFarbe & 0x87;
  601. Int1=100-F.FIntens; Int2=F.FIntens;
  602. if (Int1==Int2) {
  603. SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut);
  604. rOut.DrawEllipse(Rectangle(x1,y1,x2,y2));
  605. } else {
  606. b0=Int1;
  607. switch (F.FBFarbe & 0x38) {
  608. case 0x08: { // vertikal
  609. Region ClipMerk=rOut.GetClipRegion();
  610. i0=y1;
  611. i=y1;
  612. while (i<=y2) {
  613. b=Int1+INT16((INT32)(Int2-Int1)*(INT32)(i-y1) /(INT32)(y2-y1+1));
  614. if (b!=b0) {
  615. SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut);
  616. rOut.SetClipRegion(Rectangle(x1,i0,x2,i-1));
  617. rOut.DrawEllipse(Rectangle(x1,y1,x2,y2));
  618. i0=i; b0=b;
  619. }
  620. i++;
  621. }
  622. SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut);
  623. rOut.SetClipRegion(Rectangle(x1,i0,x2,y2));
  624. rOut.DrawEllipse(Rectangle(x1,y1,x2,y2));
  625. rOut.SetClipRegion(ClipMerk);
  626. } break;
  627. case 0x28: { // horizontal
  628. Region ClipMerk=rOut.GetClipRegion();
  629. i0=x1;
  630. i=x1;
  631. while (i<=x2) {
  632. b=Int1+INT16((INT32)(Int2-Int1)*(INT32)(i-x1) /(INT32)(x2-x1+1));
  633. if (b!=b0) {
  634. SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut);
  635. rOut.SetClipRegion(Rectangle(i0,y1,i-1,y2));
  636. rOut.DrawEllipse(Rectangle(x1,y1,x2,y2));
  637. i0=i; b0=b;
  638. }
  639. i++;
  640. }
  641. SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut);
  642. rOut.SetClipRegion(Rectangle(i0,y1,x2,y2));
  643. rOut.DrawEllipse(Rectangle(x1,y1,x2,y2));
  644. rOut.SetClipRegion(ClipMerk);
  645. } break;
  646. case 0x18: case 0x38: { // Kreis
  647. INT16 MaxR;
  648. if (rx<1) rx=1;
  649. if (ry<1) ry=1;
  650. MaxR=rx;
  651. b0=Int2;
  652. i0=MaxR; if (MaxR<1) MaxR=1;
  653. i=MaxR;
  654. while (i>=0) {
  655. b=Int1+INT16((INT32(Int2-Int1)*INT32(i)) /INT32(MaxR));
  656. if (b!=b0) {
  657. INT32 temp=INT32(i0)*INT32(ry)/INT32(rx);
  658. INT16 j0=INT16(temp);
  659. SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut);
  660. rOut.DrawEllipse(Rectangle(cx-i0,cy-j0,cx+i0,cy+j0));
  661. i0=i; b0=b;
  662. }
  663. i--;
  664. }
  665. SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int1,rOut);
  666. rOut.DrawEllipse(Rectangle(cx-i0,cy-i0,cx+i0,cy+i0));
  667. } break; // Kreis
  668. }
  669. }
  670. }
  671. void CircType::Draw(OutputDevice& rOut)
  672. {
  673. Rectangle aRect(Center.x-Radius.x,Center.y-Radius.y,Center.x+Radius.x,Center.y+Radius.y);
  674. if (L.LMuster!=0) L.LMuster=1; // keine Linienmuster hier, nur an oder aus
  675. SetArea(F,rOut);
  676. if ((Flags & 0x03)==CircFull) {
  677. if ((F.FBFarbe & 0x38)==0) {
  678. SetLine(L,rOut);
  679. rOut.DrawEllipse(aRect);
  680. } else {
  681. DrawSlideCirc(Center.x,Center.y,Radius.x,Radius.y,F,rOut);
  682. if (L.LMuster!=0) {
  683. SetLine(L,rOut);
  684. rOut.SetFillColor();
  685. rOut.DrawEllipse(aRect);
  686. }
  687. }
  688. } else {
  689. PointType a,b;
  690. Point aStrt,aEnde;
  691. double sn,cs;
  692. a.x=Center.x+Radius.x; a.y=Center.y; b=a;
  693. sn=sin(double(StartWink)*3.14159265359/18000);
  694. cs=cos(double(StartWink)*3.14159265359/18000);
  695. RotatePoint(a,Center.x,Center.y,sn,cs);
  696. sn=sin(double(StartWink+RelWink)*3.14159265359/18000);
  697. cs=cos(double(StartWink+RelWink)*3.14159265359/18000);
  698. RotatePoint(b,Center.x,Center.y,sn,cs);
  699. if (Radius.x!=Radius.y) {
  700. if (Radius.x<1) Radius.x=1;
  701. if (Radius.y<1) Radius.y=1;
  702. a.y = a.y - Center.y;
  703. b.y = b.y - Center.y;
  704. a.y=iMulDiv(a.y,Radius.y,Radius.x);
  705. b.y=iMulDiv(b.y,Radius.y,Radius.x);
  706. a.y = a.y + Center.y;
  707. b.y = b.y + Center.y;
  708. }
  709. aStrt=Point(a.x,a.y);
  710. aEnde=Point(b.x,b.y);
  711. SetLine(L,rOut);
  712. switch (Flags & 0x03) {
  713. case CircArc : rOut.DrawArc(aRect,aEnde,aStrt); break;
  714. case CircSect:
  715. case CircAbsn: rOut.DrawPie(aRect,aEnde,aStrt); break;
  716. }
  717. }
  718. }
  719. /*************************************************************************
  720. |*
  721. |* BmapType::Draw()
  722. |*
  723. *************************************************************************/
  724. void BmapType::Draw(OutputDevice& rOut)
  725. {
  726. //ifstream aInp;
  727. unsigned char nSgfTyp;
  728. USHORT nVersion;
  729. String aStr(
  730. reinterpret_cast< char const * >(&Filename[ 1 ]),
  731. (xub_StrLen)Filename[ 0 ], RTL_TEXTENCODING_UTF8 );
  732. INetURLObject aFNam( aStr );
  733. SvStream* pInp = ::utl::UcbStreamHelper::CreateStream( aFNam.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ );
  734. if ( pInp )
  735. {
  736. nSgfTyp=CheckSgfTyp( *pInp,nVersion);
  737. switch(nSgfTyp) {
  738. case SGF_BITIMAGE: {
  739. GraphicFilter aFlt;
  740. Graphic aGrf;
  741. aFlt.ImportGraphic(aGrf,aFNam);
  742. aGrf.Draw(&rOut,Point(Pos1.x,Pos1.y),Size(Pos2.x-Pos1.x,Pos2.y-Pos1.y));
  743. } break;
  744. case SGF_SIMPVECT: {
  745. GDIMetaFile aMtf;
  746. SgfVectXofs=Pos1.x;
  747. SgfVectYofs=Pos1.y;
  748. SgfVectXmul=Pos2.x-Pos1.x;
  749. SgfVectYmul=Pos2.y-Pos1.y;
  750. SgfVectXdiv=0;
  751. SgfVectYdiv=0;
  752. SgfVectScal=TRUE;
  753. SgfVectFilter(*pInp,aMtf);
  754. SgfVectXofs=0;
  755. SgfVectYofs=0;
  756. SgfVectXmul=0;
  757. SgfVectYmul=0;
  758. SgfVectXdiv=0;
  759. SgfVectYdiv=0;
  760. SgfVectScal=FALSE;
  761. aMtf.Play(&rOut);
  762. } break;
  763. }
  764. delete pInp;
  765. }
  766. }
  767. /*************************************************************************
  768. |*
  769. |* GrupType::...
  770. |*
  771. *************************************************************************/
  772. UINT32 GrupType::GetSubPtr()
  773. {
  774. return UINT32(SbLo)+0x00010000*UINT32(SbHi);
  775. }
  776. /*************************************************************************
  777. |*
  778. |* DrawObjkList()
  779. |*
  780. *************************************************************************/
  781. void DrawObjkList( SvStream& rInp, OutputDevice& rOut )
  782. {
  783. ObjkType aObjk;
  784. USHORT nGrpCnt=0;
  785. BOOL bEnde=FALSE;
  786. do {
  787. rInp>>aObjk;
  788. if (!rInp.GetError()) {
  789. switch(aObjk.Art) {
  790. case ObjStrk: { StrkType aStrk; rInp>>aStrk; if (!rInp.GetError()) aStrk.Draw(rOut); } break;
  791. case ObjRect: { RectType aRect; rInp>>aRect; if (!rInp.GetError()) aRect.Draw(rOut); } break;
  792. case ObjCirc: { CircType aCirc; rInp>>aCirc; if (!rInp.GetError()) aCirc.Draw(rOut); } break;
  793. case ObjText: {
  794. TextType aText;
  795. rInp>>aText;
  796. if (!rInp.GetError()) {
  797. aText.Buffer=new UCHAR[aText.BufSize+1]; // Ein mehr fuer LookAhead bei CK-Trennung
  798. rInp.Read((char* )aText.Buffer,aText.BufSize);
  799. if (!rInp.GetError()) aText.Draw(rOut);
  800. delete[] aText.Buffer;
  801. }
  802. } break;
  803. case ObjBmap: {
  804. BmapType aBmap;
  805. rInp>>aBmap;
  806. if (!rInp.GetError()) {
  807. aBmap.Draw(rOut);
  808. }
  809. } break;
  810. case ObjPoly: {
  811. PolyType aPoly;
  812. rInp>>aPoly;
  813. if (!rInp.GetError()) {
  814. aPoly.EckP=new PointType[aPoly.nPoints];
  815. rInp.Read((char*)aPoly.EckP,4*aPoly.nPoints);
  816. #if defined OSL_BIGENDIAN
  817. for(short i=0;i<aPoly.nPoints;i++) SWAPPOINT(aPoly.EckP[i]);
  818. #endif
  819. if (!rInp.GetError()) aPoly.Draw(rOut);
  820. delete[] aPoly.EckP;
  821. }
  822. } break;
  823. case ObjSpln: {
  824. SplnType aSpln;
  825. rInp>>aSpln;
  826. if (!rInp.GetError()) {
  827. aSpln.EckP=new PointType[aSpln.nPoints];
  828. rInp.Read((char*)aSpln.EckP,4*aSpln.nPoints);
  829. #if defined OSL_BIGENDIAN
  830. for(short i=0;i<aSpln.nPoints;i++) SWAPPOINT(aSpln.EckP[i]);
  831. #endif
  832. if (!rInp.GetError()) aSpln.Draw(rOut);
  833. delete[] aSpln.EckP;
  834. }
  835. } break;
  836. case ObjGrup: {
  837. GrupType aGrup;
  838. rInp>>aGrup;
  839. if (!rInp.GetError()) {
  840. rInp.Seek(rInp.Tell()+aGrup.Last); // Obj-Anhaengsel
  841. if(aGrup.GetSubPtr()!=0L) nGrpCnt++;// DrawObjkList(rInp,rOut );
  842. }
  843. } break;
  844. default: {
  845. aObjk.Draw(rOut); // Objektbezeichnung auf 2. Screen
  846. ObjkOverSeek(rInp,aObjk); // zum naechsten Objekt
  847. }
  848. }
  849. } // if rInp
  850. if (!rInp.GetError()) {
  851. if (aObjk.Next==0L) {
  852. if (nGrpCnt==0) bEnde=TRUE;
  853. else nGrpCnt--;
  854. }
  855. } else {
  856. bEnde=TRUE; // Lesefehler
  857. }
  858. } while (!bEnde);
  859. }
  860. /*************************************************************************
  861. |*
  862. |* SkipObjkList()
  863. |*
  864. *************************************************************************/
  865. void SkipObjkList(SvStream& rInp)
  866. {
  867. ObjkType aObjk;
  868. do
  869. {
  870. rInp>>aObjk;
  871. if(aObjk.Art==ObjGrup) {
  872. GrupType aGrup;
  873. rInp>>aGrup;
  874. rInp.Seek(rInp.Tell()+aGrup.Last); // Obj-Anhaengsel
  875. if(aGrup.GetSubPtr()!=0L) SkipObjkList(rInp);
  876. } else {
  877. ObjkOverSeek(rInp,aObjk); // zum naechsten Objekt
  878. }
  879. } while (aObjk.Next!=0L && !rInp.GetError());
  880. }
  881. /*************************************************************************
  882. |*
  883. |* SgfFilterSDrw()
  884. |*
  885. *************************************************************************/
  886. BOOL SgfFilterSDrw( SvStream& rInp, SgfHeader&, SgfEntry&, GDIMetaFile& rMtf )
  887. {
  888. BOOL bRet = FALSE;
  889. PageType aPage;
  890. VirtualDevice aOutDev;
  891. OutputDevice* pOutDev;
  892. ULONG nStdPos;
  893. ULONG nZchPos;
  894. USHORT Num;
  895. pOutDev=&aOutDev;
  896. DtHdOverSeek(rInp); // DataHeader weglesen
  897. nStdPos=rInp.Tell();
  898. do { // Standardseiten weglesen
  899. rInp>>aPage;
  900. if (aPage.nList!=0) SkipObjkList(rInp);
  901. } while (aPage.Next!=0L && !rInp.GetError());
  902. // ShowMsg("Zeichnungseite(n)\n");
  903. nZchPos=rInp.Tell();
  904. rInp>>aPage;
  905. rMtf.Record(pOutDev);
  906. Num=aPage.StdPg;
  907. if (Num!=0) {
  908. rInp.Seek(nStdPos);
  909. while(Num>1 && aPage.Next!=0L && !rInp.GetError()) { // Standardseite suchen
  910. rInp>>aPage;
  911. if (aPage.nList!=0) SkipObjkList(rInp);
  912. Num--;
  913. }
  914. rInp>>aPage;
  915. if(Num==1 && aPage.nList!=0L) DrawObjkList( rInp,*pOutDev );
  916. rInp.Seek(nZchPos);
  917. nZchPos=rInp.Tell();
  918. rInp>>aPage;
  919. }
  920. if (aPage.nList!=0L) DrawObjkList(rInp,*pOutDev );
  921. rMtf.Stop();
  922. rMtf.WindStart();
  923. MapMode aMap(MAP_10TH_MM,Point(),Fraction(1,4),Fraction(1,4));
  924. rMtf.SetPrefMapMode(aMap);
  925. rMtf.SetPrefSize(Size((INT16)aPage.Paper.Size.x,(INT16)aPage.Paper.Size.y));
  926. bRet=TRUE;
  927. return bRet;
  928. }
  929. /*************************************************************************
  930. |*
  931. |* SgfSDrwFilter()
  932. |*
  933. *************************************************************************/
  934. BOOL SgfSDrwFilter(SvStream& rInp, GDIMetaFile& rMtf, INetURLObject aIniPath )
  935. {
  936. #if OSL_DEBUG_LEVEL > 1 // Recordgroessen checken. Neuer Compiler hat vielleichte anderes Alignment!
  937. if (sizeof(ObjTextType)!=ObjTextTypeSize) return FALSE;
  938. #endif
  939. ULONG nFileStart; // Offset des SgfHeaders. Im allgemeinen 0.
  940. SgfHeader aHead;
  941. SgfEntry aEntr;
  942. ULONG nNext;
  943. BOOL bRdFlag=FALSE; // Grafikentry gelesen ?
  944. BOOL bRet=FALSE; // Returncode
  945. aIniPath.Append( String::CreateFromAscii( "sgf.ini", 7 ) );
  946. // aIniPath.ToAbs();
  947. pSgfFonts = new SgfFontLst;
  948. pSgfFonts->AssignFN( aIniPath.GetMainURL( INetURLObject::NO_DECODE ) );
  949. nFileStart=rInp.Tell();
  950. rInp>>aHead;
  951. if (aHead.ChkMagic() && aHead.Typ==SgfStarDraw && aHead.Version==SGV_VERSION) {
  952. nNext=aHead.GetOffset();
  953. while (nNext && !bRdFlag && !rInp.GetError()) {
  954. rInp.Seek(nFileStart+nNext);
  955. rInp>>aEntr;
  956. nNext=aEntr.GetOffset();
  957. if (aEntr.Typ==aHead.Typ) {
  958. bRet=SgfFilterSDrw( rInp,aHead,aEntr,rMtf );
  959. }
  960. } // while(nNext)
  961. if (bRdFlag) {
  962. if (!rInp.GetError()) bRet=TRUE; // Scheinbar Ok
  963. }
  964. }
  965. delete pSgfFonts;
  966. return(bRet);
  967. }
  968. /*
  969. Bitmap Dither(BYTE Intens)
  970. {
  971. Bitmap aBmp;
  972. BmpInfoHeader Info;
  973. const dmatrix: array[0..7,0..7] of byte =
  974. (( 0, 48, 12, 60, 3, 51, 15, 63 ),
  975. ( 32, 16, 44, 28, 35, 19, 47, 31 ),
  976. ( 8, 56, 4, 52, 11, 59, 7, 55 ),
  977. ( 40, 24, 36, 20, 43, 27, 39, 23 ),
  978. ( 2, 50, 14, 62, 1, 49, 13, 61 ),
  979. ( 34, 18, 46, 30, 33, 17, 45, 29 ),
  980. ( 10, 58, 6, 54, 9, 57, 5, 53 ),
  981. ( 42, 26, 38, 22, 41, 25, 37, 21 ));
  982. cmatrix: array[0..7,0..7] of byte;
  983. dmatrixn,dmatrixi: array[0..7] of byte;
  984. procedure SetColorIntens(col0,col1,bal: integer);
  985. var cmatrix0: array[0..63] of byte absolute cmatrix;
  986. dmatrix0: array[0..63] of byte absolute dmatrix;
  987. n,i: integer;
  988. b,bit: byte;
  989. begin
  990. if col0=col1 then bal:=0;
  991. if bal<=32 then
  992. begin
  993. plotcolor0:=col0 and $1F; plotcolor1:=col1 and $1F;
  994. plotbal:=bal;
  995. end
  996. else
  997. begin
  998. plotcolor0:=col1 and $1F; plotcolor1:=col0 and $1F;
  999. plotbal:=64-bal;
  1000. end;
  1001. for n:=0 to 63 do
  1002. if plotbal<=dmatrix0[n] then cmatrix0[n]:=col0 else cmatrix0[n]:=col1;
  1003. end;
  1004. */
  1005. #if defined( WIN ) && defined( MSC )
  1006. #pragma code_seg( "svtools", "AUTO_CODE" )
  1007. #endif
  1008. }
  1009. /* vim:set shiftwidth=4 softtabstop=4 expandtab: */