[Mono-patches] r49518 - in trunk/mcs/class/Managed.Windows.Forms: .
System.Windows.Forms.RTF
Peter Bartok <peter at novonyx.com>
pbartok at mono-cvs.ximian.com
Mon Sep 5 21:38:50 EDT 2005
Author: pbartok
Date: 2005-09-05 21:38:50 -0400 (Mon, 05 Sep 2005)
New Revision: 49518
Added:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Charcode.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Charset.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/CharsetFlags.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/CharsetType.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/ClassDelegate.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Color.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/DestinationDelegate.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Font.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/KeyStruct.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/KeysInit.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Major.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Minor.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/README
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/RTF.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/RTFException.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/StandardCharCode.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/StandardCharName.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Style.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/StyleElement.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/StyleType.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/TextMap.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/TokenClass.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/rtf.csproj
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/rtf.csproj.user
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/test.cs
Modified:
trunk/mcs/class/Managed.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.dll.sources
Log:
* Initial check-in of RTF parser required for RichTextBox control
2005-09-04 Peter Dennis Bartok <pbartok at novell.com>
* System.Windows.Forms.dll.sources: Added System.Windows.Forms.RTF
subdirectory to build
* SWF.csproj: Updated
2005-09-04 Peter Dennis Bartok <pbartok at novell.com>
* Charcode.cs: Created; provides StandardCharCode <-> character
translation
* Charset.cs: Created; provides two standard charsets, AnsiGeneral
and AnsiSymbol
* CharsetFlags.cs: Created
* CharsetType.cs: Created
* ClassDelegate.cs: Created; allows consumer to register a callback
for RTF command classes
* Color.cs: Created; provides access to RTF-defined RGB color sets
* DestinationDelegate.cs: Created; allows consumer to register a
callback for Destination class types
* Font.cs: Created; provides access to RTF-defined font descriptions
* KeysInit.cs: Created; provides translation table from RTF keyword
to Major/Minor classes
* KeyStruct.cs: Created
* Major.cs: Created; describes available RTF command groups
* Minor.cs: Created; describes available 'arguments' for command groups
* README: Created
* RTF.cs: Created; contains main RTF parser code
* rtf.csproj: Created; provides Visual Studio project that allows to
use test this assembly via the included test.cs
to provide
* RTFException.cs: Created; provides custom RTF exception class
* StandardCharCode.cs: Created
* StandardCharName.cs: Created
* Style.cs: Created; provides access to RTF-define styles
* StyleElement.cs: Created; provides support class to allow parsing
recursive styles
* StyleType.cs: Created
* test.cs: Test code showing use of RTF class (also acts as Main for
the included Visual Studio project)
* TextMap.cs: Created; allows to create simple translation table for
converting parsed RTF document to text; table-based
* TokenClass.cs: Created; describes all available RTF command classes
Modified: trunk/mcs/class/Managed.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/ChangeLog 2005-09-05 23:57:52 UTC (rev 49517)
+++ trunk/mcs/class/Managed.Windows.Forms/ChangeLog 2005-09-06 01:38:50 UTC (rev 49518)
@@ -1,3 +1,9 @@
+2005-09-04 Peter Dennis Bartok <pbartok at novell.com>
+
+ * System.Windows.Forms.dll.sources: Added System.Windows.Forms.RTF
+ subdirectory to build
+ * SWF.csproj: Updated
+
2005-08-29 Alexander Olk <xenomorph2 at onlinehome.de>
* System.Windows.Forms.dll.sources: Added ThemeNice.cs
Added: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/ChangeLog 2005-09-05 23:57:52 UTC (rev 49517)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/ChangeLog 2005-09-06 01:38:50 UTC (rev 49518)
@@ -0,0 +1,36 @@
+2005-09-04 Peter Dennis Bartok <pbartok at novell.com>
+
+ * Charcode.cs: Created; provides StandardCharCode <-> character
+ translation
+ * Charset.cs: Created; provides two standard charsets, AnsiGeneral
+ and AnsiSymbol
+ * CharsetFlags.cs: Created
+ * CharsetType.cs: Created
+ * ClassDelegate.cs: Created; allows consumer to register a callback
+ for RTF command classes
+ * Color.cs: Created; provides access to RTF-defined RGB color sets
+ * DestinationDelegate.cs: Created; allows consumer to register a
+ callback for Destination class types
+ * Font.cs: Created; provides access to RTF-defined font descriptions
+ * KeysInit.cs: Created; provides translation table from RTF keyword
+ to Major/Minor classes
+ * KeyStruct.cs: Created
+ * Major.cs: Created; describes available RTF command groups
+ * Minor.cs: Created; describes available 'arguments' for command groups
+ * README: Created
+ * RTF.cs: Created; contains main RTF parser code
+ * rtf.csproj: Created; provides Visual Studio project that allows to
+ use test this assembly via the included test.cs
+ to provide
+ * RTFException.cs: Created; provides custom RTF exception class
+ * StandardCharCode.cs: Created
+ * StandardCharName.cs: Created
+ * Style.cs: Created; provides access to RTF-define styles
+ * StyleElement.cs: Created; provides support class to allow parsing
+ recursive styles
+ * StyleType.cs: Created
+ * test.cs: Test code showing use of RTF class (also acts as Main for
+ the included Visual Studio project)
+ * TextMap.cs: Created; allows to create simple translation table for
+ converting parsed RTF document to text; table-based
+ * TokenClass.cs: Created; describes all available RTF command classes
Added: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Charcode.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Charcode.cs 2005-09-05 23:57:52 UTC (rev 49517)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Charcode.cs 2005-09-06 01:38:50 UTC (rev 49518)
@@ -0,0 +1,405 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
+//
+// Authors:
+// Peter Bartok (pbartok at novell.com)
+//
+//
+
+// COMPLETE
+
+using System.Collections;
+
+namespace System.Windows.Forms.RTF {
+ internal class Charcode {
+ #region Local Variables
+ private StandardCharCode[] codes;
+ private Hashtable reverse;
+ private int size;
+ #endregion // Local Variables
+
+ #region Public Constructors
+ public Charcode() : this(256) {
+ }
+
+ private Charcode(int size) {
+ this.size = size;
+ this.codes = new StandardCharCode[size];
+ this.reverse = new Hashtable(size);
+
+ for (int i = 0; i < size; i++) {
+ codes[i] = StandardCharCode.nothing;
+ }
+ }
+ #endregion // Public Constructors
+
+ #region Public Instance Properties
+ public int this[StandardCharCode c] {
+ get {
+ object obj;
+
+ obj = reverse[c];
+ if (obj != null) {
+ return (int)obj;
+ }
+ for (int i = 0; i < size; i++) {
+ if (codes[i] == c) {
+ return i;
+ }
+ }
+
+ return -1;
+ }
+ }
+
+ public StandardCharCode this[int c] {
+ get {
+ if (c < 0 || c >= size) {
+ return StandardCharCode.nothing;
+ }
+
+ return codes[c];
+ }
+
+ set {
+ if (c < 0 || c >= size) {
+ return;
+ }
+
+ codes[c] = value;
+ reverse[value] = c;
+ }
+ }
+ #endregion // Public Instance Properties
+
+ #region Public Instance Methods
+ #endregion // Public Instance Methods
+
+ #region Public Static Methods
+ public static Charcode AnsiGeneric {
+ get {
+ Charcode code = new Charcode(256);
+
+ code[0x06] = StandardCharCode.formula;
+ code[0x1e] = StandardCharCode.nobrkhyphen;
+ code[0x1f] = StandardCharCode.opthyphen;
+ code[' '] = StandardCharCode.space;
+ code['!'] = StandardCharCode.exclam;
+ code['"'] = StandardCharCode.quotedbl;
+ code['#'] = StandardCharCode.numbersign;
+ code['$'] = StandardCharCode.dollar;
+ code['%'] = StandardCharCode.percent;
+ code['&'] = StandardCharCode.ampersand;
+ code['\\'] = StandardCharCode.quoteright;
+ code['('] = StandardCharCode.parenleft;
+ code[')'] = StandardCharCode.parenright;
+ code['*'] = StandardCharCode.asterisk;
+ code['+'] = StandardCharCode.plus;
+ code[','] = StandardCharCode.comma;
+ code['-'] = StandardCharCode.hyphen;
+ code['.'] = StandardCharCode.period;
+ code['/'] = StandardCharCode.slash;
+ code['0'] = StandardCharCode.zero;
+ code['1'] = StandardCharCode.one;
+ code['2'] = StandardCharCode.two;
+ code['3'] = StandardCharCode.three;
+ code['4'] = StandardCharCode.four;
+ code['5'] = StandardCharCode.five;
+ code['6'] = StandardCharCode.six;
+ code['7'] = StandardCharCode.seven;
+ code['8'] = StandardCharCode.eight;
+ code['9'] = StandardCharCode.nine;
+ code[':'] = StandardCharCode.colon;
+ code[';'] = StandardCharCode.semicolon;
+ code['<'] = StandardCharCode.less;
+ code['='] = StandardCharCode.equal;
+ code['>'] = StandardCharCode.greater;
+ code['?'] = StandardCharCode.question;
+ code['@'] = StandardCharCode.at;
+ code['A'] = StandardCharCode.A;
+ code['B'] = StandardCharCode.B;
+ code['C'] = StandardCharCode.C;
+ code['D'] = StandardCharCode.D;
+ code['E'] = StandardCharCode.E;
+ code['F'] = StandardCharCode.F;
+ code['G'] = StandardCharCode.G;
+ code['H'] = StandardCharCode.H;
+ code['I'] = StandardCharCode.I;
+ code['J'] = StandardCharCode.J;
+ code['K'] = StandardCharCode.K;
+ code['L'] = StandardCharCode.L;
+ code['M'] = StandardCharCode.M;
+ code['N'] = StandardCharCode.N;
+ code['O'] = StandardCharCode.O;
+ code['P'] = StandardCharCode.P;
+ code['Q'] = StandardCharCode.Q;
+ code['R'] = StandardCharCode.R;
+ code['S'] = StandardCharCode.S;
+ code['T'] = StandardCharCode.T;
+ code['U'] = StandardCharCode.U;
+ code['V'] = StandardCharCode.V;
+ code['W'] = StandardCharCode.W;
+ code['X'] = StandardCharCode.X;
+ code['Y'] = StandardCharCode.Y;
+ code['Z'] = StandardCharCode.Z;
+ code['['] = StandardCharCode.bracketleft;
+ code['\\'] = StandardCharCode.backslash;
+ code[']'] = StandardCharCode.bracketright;
+ code['^'] = StandardCharCode.asciicircum;
+ code['_'] = StandardCharCode.underscore;
+ code['`'] = StandardCharCode.quoteleft;
+ code['a'] = StandardCharCode.a;
+ code['b'] = StandardCharCode.b;
+ code['c'] = StandardCharCode.c;
+ code['d'] = StandardCharCode.d;
+ code['e'] = StandardCharCode.e;
+ code['f'] = StandardCharCode.f;
+ code['g'] = StandardCharCode.g;
+ code['h'] = StandardCharCode.h;
+ code['i'] = StandardCharCode.i;
+ code['j'] = StandardCharCode.j;
+ code['k'] = StandardCharCode.k;
+ code['l'] = StandardCharCode.l;
+ code['m'] = StandardCharCode.m;
+ code['n'] = StandardCharCode.n;
+ code['o'] = StandardCharCode.o;
+ code['p'] = StandardCharCode.p;
+ code['q'] = StandardCharCode.q;
+ code['r'] = StandardCharCode.r;
+ code['s'] = StandardCharCode.s;
+ code['t'] = StandardCharCode.t;
+ code['u'] = StandardCharCode.u;
+ code['v'] = StandardCharCode.v;
+ code['w'] = StandardCharCode.w;
+ code['x'] = StandardCharCode.x;
+ code['y'] = StandardCharCode.y;
+ code['z'] = StandardCharCode.z;
+ code['{'] = StandardCharCode.braceleft;
+ code['|'] = StandardCharCode.bar;
+ code['}'] = StandardCharCode.braceright;
+ code['~'] = StandardCharCode.asciitilde;
+ code[0xa0] = StandardCharCode.nobrkspace;
+ code[0xa1] = StandardCharCode.exclamdown;
+ code[0xa2] = StandardCharCode.cent;
+ code[0xa3] = StandardCharCode.sterling;
+ code[0xa4] = StandardCharCode.currency;
+ code[0xa5] = StandardCharCode.yen;
+ code[0xa6] = StandardCharCode.brokenbar;
+ code[0xa7] = StandardCharCode.section;
+ code[0xa8] = StandardCharCode.dieresis;
+ code[0xa9] = StandardCharCode.copyright;
+ code[0xaa] = StandardCharCode.ordfeminine;
+ code[0xab] = StandardCharCode.guillemotleft;
+ code[0xac] = StandardCharCode.logicalnot;
+ code[0xad] = StandardCharCode.opthyphen;
+ code[0xae] = StandardCharCode.registered;
+ code[0xaf] = StandardCharCode.macron;
+ code[0xb0] = StandardCharCode.degree;
+ code[0xb1] = StandardCharCode.plusminus;
+ code[0xb2] = StandardCharCode.twosuperior;
+ code[0xb3] = StandardCharCode.threesuperior;
+ code[0xb4] = StandardCharCode.acute;
+ code[0xb5] = StandardCharCode.mu;
+ code[0xb6] = StandardCharCode.paragraph;
+ code[0xb7] = StandardCharCode.periodcentered;
+ code[0xb8] = StandardCharCode.cedilla;
+ code[0xb9] = StandardCharCode.onesuperior;
+ code[0xba] = StandardCharCode.ordmasculine;
+ code[0xbb] = StandardCharCode.guillemotright;
+ code[0xbc] = StandardCharCode.onequarter;
+ code[0xbd] = StandardCharCode.onehalf;
+ code[0xbe] = StandardCharCode.threequarters;
+ code[0xbf] = StandardCharCode.questiondown;
+ code[0xc0] = StandardCharCode.Agrave;
+ code[0xc1] = StandardCharCode.Aacute;
+ code[0xc2] = StandardCharCode.Acircumflex;
+ code[0xc3] = StandardCharCode.Atilde;
+ code[0xc4] = StandardCharCode.Adieresis;
+ code[0xc5] = StandardCharCode.Aring;
+ code[0xc6] = StandardCharCode.AE;
+ code[0xc7] = StandardCharCode.Ccedilla;
+ code[0xc8] = StandardCharCode.Egrave;
+ code[0xc9] = StandardCharCode.Eacute;
+ code[0xca] = StandardCharCode.Ecircumflex;
+ code[0xcb] = StandardCharCode.Edieresis;
+ code[0xcc] = StandardCharCode.Igrave;
+ code[0xcd] = StandardCharCode.Iacute;
+ code[0xce] = StandardCharCode.Icircumflex;
+ code[0xcf] = StandardCharCode.Idieresis;
+ code[0xd0] = StandardCharCode.Eth;
+ code[0xd1] = StandardCharCode.Ntilde;
+ code[0xd2] = StandardCharCode.Ograve;
+ code[0xd3] = StandardCharCode.Oacute;
+ code[0xd4] = StandardCharCode.Ocircumflex;
+ code[0xd5] = StandardCharCode.Otilde;
+ code[0xd6] = StandardCharCode.Odieresis;
+ code[0xd7] = StandardCharCode.multiply;
+ code[0xd8] = StandardCharCode.Oslash;
+ code[0xd9] = StandardCharCode.Ugrave;
+ code[0xda] = StandardCharCode.Uacute;
+ code[0xdb] = StandardCharCode.Ucircumflex;
+ code[0xdc] = StandardCharCode.Udieresis;
+ code[0xdd] = StandardCharCode.Yacute;
+ code[0xde] = StandardCharCode.Thorn;
+ code[0xdf] = StandardCharCode.germandbls;
+ code[0xe0] = StandardCharCode.agrave;
+ code[0xe1] = StandardCharCode.aacute;
+ code[0xe2] = StandardCharCode.acircumflex;
+ code[0xe3] = StandardCharCode.atilde;
+ code[0xe4] = StandardCharCode.adieresis;
+ code[0xe5] = StandardCharCode.aring;
+ code[0xe6] = StandardCharCode.ae;
+ code[0xe7] = StandardCharCode.ccedilla;
+ code[0xe8] = StandardCharCode.egrave;
+ code[0xe9] = StandardCharCode.eacute;
+ code[0xea] = StandardCharCode.ecircumflex;
+ code[0xeb] = StandardCharCode.edieresis;
+ code[0xec] = StandardCharCode.igrave;
+ code[0xed] = StandardCharCode.iacute;
+ code[0xee] = StandardCharCode.icircumflex;
+ code[0xef] = StandardCharCode.idieresis;
+ code[0xf0] = StandardCharCode.eth;
+ code[0xf1] = StandardCharCode.ntilde;
+ code[0xf2] = StandardCharCode.ograve;
+ code[0xf3] = StandardCharCode.oacute;
+ code[0xf4] = StandardCharCode.ocircumflex;
+ code[0xf5] = StandardCharCode.otilde;
+ code[0xf6] = StandardCharCode.odieresis;
+ code[0xf7] = StandardCharCode.divide;
+ code[0xf8] = StandardCharCode.oslash;
+ code[0xf9] = StandardCharCode.ugrave;
+ code[0xfa] = StandardCharCode.uacute;
+ code[0xfb] = StandardCharCode.ucircumflex;
+ code[0xfc] = StandardCharCode.udieresis;
+ code[0xfd] = StandardCharCode.yacute;
+ code[0xfe] = StandardCharCode.thorn;
+ code[0xff] = StandardCharCode.ydieresis;
+
+ return code;
+ }
+ }
+
+ public static Charcode AnsiSymbol {
+ get {
+ Charcode code = new Charcode(256);
+
+ code[0x06] = StandardCharCode.formula;
+ code[0x1e] = StandardCharCode.nobrkhyphen;
+ code[0x1f] = StandardCharCode.opthyphen;
+ code[' '] = StandardCharCode.space;
+ code['!'] = StandardCharCode.exclam;
+ code['"'] = StandardCharCode.universal;
+ code['#'] = StandardCharCode.mathnumbersign;
+ code['$'] = StandardCharCode.existential;
+ code['%'] = StandardCharCode.percent;
+ code['&'] = StandardCharCode.ampersand;
+ code['\\'] = StandardCharCode.suchthat;
+ code['('] = StandardCharCode.parenleft;
+ code[')'] = StandardCharCode.parenright;
+ code['*'] = StandardCharCode.mathasterisk;
+ code['+'] = StandardCharCode.mathplus;
+ code[','] = StandardCharCode.comma;
+ code['-'] = StandardCharCode.mathminus;
+ code['.'] = StandardCharCode.period;
+ code['/'] = StandardCharCode.slash;
+ code['0'] = StandardCharCode.zero;
+ code['1'] = StandardCharCode.one;
+ code['2'] = StandardCharCode.two;
+ code['3'] = StandardCharCode.three;
+ code['4'] = StandardCharCode.four;
+ code['5'] = StandardCharCode.five;
+ code['6'] = StandardCharCode.six;
+ code['7'] = StandardCharCode.seven;
+ code['8'] = StandardCharCode.eight;
+ code['9'] = StandardCharCode.nine;
+ code[':'] = StandardCharCode.colon;
+ code[';'] = StandardCharCode.semicolon;
+ code['<'] = StandardCharCode.less;
+ code['='] = StandardCharCode.mathequal;
+ code['>'] = StandardCharCode.greater;
+ code['?'] = StandardCharCode.question;
+ code['@'] = StandardCharCode.congruent;
+ code['A'] = StandardCharCode.Alpha;
+ code['B'] = StandardCharCode.Beta;
+ code['C'] = StandardCharCode.Chi;
+ code['D'] = StandardCharCode.Delta;
+ code['E'] = StandardCharCode.Epsilon;
+ code['F'] = StandardCharCode.Phi;
+ code['G'] = StandardCharCode.Gamma;
+ code['H'] = StandardCharCode.Eta;
+ code['I'] = StandardCharCode.Iota;
+ code['K'] = StandardCharCode.Kappa;
+ code['L'] = StandardCharCode.Lambda;
+ code['M'] = StandardCharCode.Mu;
+ code['N'] = StandardCharCode.Nu;
+ code['O'] = StandardCharCode.Omicron;
+ code['P'] = StandardCharCode.Pi;
+ code['Q'] = StandardCharCode.Theta;
+ code['R'] = StandardCharCode.Rho;
+ code['S'] = StandardCharCode.Sigma;
+ code['T'] = StandardCharCode.Tau;
+ code['U'] = StandardCharCode.Upsilon;
+ code['V'] = StandardCharCode.varsigma;
+ code['W'] = StandardCharCode.Omega;
+ code['X'] = StandardCharCode.Xi;
+ code['Y'] = StandardCharCode.Psi;
+ code['Z'] = StandardCharCode.Zeta;
+ code['['] = StandardCharCode.bracketleft;
+ code['\\'] = StandardCharCode.backslash;
+ code[']'] = StandardCharCode.bracketright;
+ code['^'] = StandardCharCode.asciicircum;
+ code['_'] = StandardCharCode.underscore;
+ code['`'] = StandardCharCode.quoteleft;
+ code['a'] = StandardCharCode.alpha;
+ code['b'] = StandardCharCode.beta;
+ code['c'] = StandardCharCode.chi;
+ code['d'] = StandardCharCode.delta;
+ code['e'] = StandardCharCode.epsilon;
+ code['f'] = StandardCharCode.phi;
+ code['g'] = StandardCharCode.gamma;
+ code['h'] = StandardCharCode.eta;
+ code['i'] = StandardCharCode.iota;
+ code['k'] = StandardCharCode.kappa;
+ code['l'] = StandardCharCode.lambda;
+ code['m'] = StandardCharCode.mu;
+ code['n'] = StandardCharCode.nu;
+ code['o'] = StandardCharCode.omicron;
+ code['p'] = StandardCharCode.pi;
+ code['q'] = StandardCharCode.theta;
+ code['r'] = StandardCharCode.rho;
+ code['s'] = StandardCharCode.sigma;
+ code['t'] = StandardCharCode.tau;
+ code['u'] = StandardCharCode.upsilon;
+ code['w'] = StandardCharCode.omega;
+ code['x'] = StandardCharCode.xi;
+ code['y'] = StandardCharCode.psi;
+ code['z'] = StandardCharCode.zeta;
+ code['{'] = StandardCharCode.braceleft;
+ code['|'] = StandardCharCode.bar;
+ code['}'] = StandardCharCode.braceright;
+ code['~'] = StandardCharCode.mathtilde;
+
+ return code;
+ }
+ }
+ #endregion // Public Static Methods
+ }
+}
Property changes on: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Charcode.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Charset.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Charset.cs 2005-09-05 23:57:52 UTC (rev 49517)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Charset.cs 2005-09-06 01:38:50 UTC (rev 49518)
@@ -0,0 +1,159 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
+//
+// Authors:
+// Peter Bartok (pbartok at novell.com)
+//
+//
+
+using System;
+
+// COMPLETE
+
+namespace System.Windows.Forms.RTF {
+ internal class Charset {
+ #region Local Variables
+ private CharsetType id;
+ private CharsetFlags flags;
+ private Charcode code;
+ private string file;
+ private bool loaded;
+ #endregion // Local Variables
+
+ #region Public Constructors
+ public Charset() {
+ flags = CharsetFlags.Read | CharsetFlags.Switch;
+ id = CharsetType.General;
+ file = string.Empty;
+ loaded = false;
+ this.ReadMap();
+ }
+ #endregion // Public Constructors
+
+ #region Public Instance Properties
+ public Charcode Code {
+ get {
+ return code;
+ }
+
+ set {
+ code = value;
+ }
+ }
+
+ public CharsetFlags Flags {
+ get {
+ return flags;
+ }
+
+ set {
+ flags = value;
+ }
+ }
+
+ public CharsetType ID {
+ get {
+ return id;
+ }
+
+ set {
+ switch(value) {
+ case CharsetType.Symbol: {
+ id = CharsetType.Symbol;
+ return;
+ }
+
+ default:
+ case CharsetType.General: {
+ id = CharsetType.General;
+ return;
+ }
+ }
+ }
+ }
+
+ public string File {
+ get {
+ return file;
+ }
+
+ set {
+ if (file != value) {
+ file = value;
+ loaded = false;
+ }
+ }
+ }
+
+ public StandardCharCode this[int c] {
+ get {
+ return code[c];
+ }
+ }
+
+ #endregion // Public Instance Properties
+
+ #region Public Instance Methods
+ public bool ReadMap() {
+ switch (id) {
+ case CharsetType.General: {
+ if (file == string.Empty) {
+ code = Charcode.AnsiGeneric;
+ return true;
+ }
+ // FIXME - implement reading charmap from file...
+ return true;
+ }
+
+ case CharsetType.Symbol: {
+ if (file == string.Empty) {
+ code = Charcode.AnsiSymbol;
+ return true;
+ }
+
+ // FIXME - implement reading charmap from file...
+ return true;
+ }
+
+ default: {
+ return false;
+ }
+ }
+ }
+
+ public char StdCharCode(string name) {
+ // FIXME - finish this
+ return ' ';
+
+ }
+
+ public string StdCharName(char code) {
+ // FIXME - finish this
+ return String.Empty;
+ }
+
+ public StandardCharCode MapChar(char c) {
+ return code[c];
+
+ }
+ #endregion // Public Instance Methods
+ }
+}
Property changes on: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Charset.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/CharsetFlags.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/CharsetFlags.cs 2005-09-05 23:57:52 UTC (rev 49517)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/CharsetFlags.cs 2005-09-06 01:38:50 UTC (rev 49518)
@@ -0,0 +1,36 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
+//
+// Authors:
+// Peter Bartok (pbartok at novell.com)
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms.RTF {
+ [Flags]
+ internal enum CharsetFlags {
+ None = 0x00,
+ Read = 0x01,
+ Switch = 0x02
+ }
+}
Property changes on: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/CharsetFlags.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/CharsetType.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/CharsetType.cs 2005-09-05 23:57:52 UTC (rev 49517)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/CharsetType.cs 2005-09-06 01:38:50 UTC (rev 49518)
@@ -0,0 +1,34 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
+//
+// Authors:
+// Peter Bartok (pbartok at novell.com)
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms.RTF {
+ internal enum CharsetType {
+ General = 0,
+ Symbol = 1,
+ }
+}
Property changes on: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/CharsetType.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/ClassDelegate.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/ClassDelegate.cs 2005-09-05 23:57:52 UTC (rev 49517)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/ClassDelegate.cs 2005-09-06 01:38:50 UTC (rev 49518)
@@ -0,0 +1,49 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
+//
+// Authors:
+// Peter Bartok (pbartok at novell.com)
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms.RTF {
+ internal delegate void ClassDelegate(RTF sender);
+
+ internal class ClassCallback {
+ ClassDelegate[] callbacks;
+
+ public ClassCallback() {
+ callbacks = new ClassDelegate[Enum.GetValues(typeof(Major)).Length];
+ }
+
+ public ClassDelegate this[TokenClass c] {
+ get {
+ return callbacks[(int)c];
+ }
+
+ set {
+ callbacks[(int)c] = value;
+ }
+ }
+ }
+}
Property changes on: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/ClassDelegate.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Color.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Color.cs 2005-09-05 23:57:52 UTC (rev 49517)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Color.cs 2005-09-06 01:38:50 UTC (rev 49518)
@@ -0,0 +1,127 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
+//
+// Authors:
+// Peter Bartok (pbartok at novell.com)
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms.RTF {
+ internal class Color {
+ #region Local Variables
+ private int red;
+ private int green;
+ private int blue;
+ private int num;
+ private Color next;
+ #endregion // Local Variables
+
+ #region Constructors
+ public Color(RTF rtf) {
+ red = -1;
+ green = -1;
+ blue = -1;
+ num = -1;
+
+ lock (rtf) {
+ if (rtf.Colors == null) {
+ rtf.Colors = this;
+ } else {
+ Color c = rtf.Colors;
+ while (c.next != null)
+ c = c.next;
+ c.next = this;
+ }
+ }
+ }
+ #endregion // Constructors
+
+ #region Properties
+ public int Red {
+ get {
+ return red;
+ }
+
+ set {
+ red = value;
+ }
+ }
+
+ public int Green {
+ get {
+ return green;
+ }
+
+ set {
+ green = value;
+ }
+ }
+
+ public int Blue {
+ get {
+ return blue;
+ }
+
+ set {
+ blue = value;
+ }
+ }
+
+ public int Num {
+ get {
+ return num;
+ }
+
+ set {
+ num = value;
+ }
+ }
+ #endregion // Properties
+
+ #region Methods
+ static public Color GetColor(RTF rtf, int color_number) {
+ Color c;
+
+ lock (rtf) {
+ c = GetColor(rtf.Colors, color_number);
+ }
+ return c;
+ }
+
+ static private Color GetColor(Color start, int color_number) {
+ Color c;
+
+ if (color_number == -1) {
+ return start;
+ }
+
+ c = start;
+
+ while ((c != null) && (c.num != color_number)) {
+ c = c.next;
+ }
+ return c;
+ }
+ #endregion // Methods
+ }
+}
Property changes on: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Color.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/DestinationDelegate.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/DestinationDelegate.cs 2005-09-05 23:57:52 UTC (rev 49517)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/DestinationDelegate.cs 2005-09-06 01:38:50 UTC (rev 49518)
@@ -0,0 +1,49 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
+//
+// Authors:
+// Peter Bartok (pbartok at novell.com)
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms.RTF {
+ internal delegate void DestinationDelegate(RTF Sender);
+
+ internal class DestinationCallback {
+ DestinationDelegate[] callbacks;
+
+ public DestinationCallback() {
+ callbacks = new DestinationDelegate[Enum.GetValues(typeof(Minor)).Length];
+ }
+
+ public DestinationDelegate this[Minor c] {
+ get {
+ return callbacks[(int)c];
+ }
+
+ set {
+ callbacks[(int)c] = value;
+ }
+ }
+ }
+}
Property changes on: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/DestinationDelegate.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Font.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Font.cs 2005-09-05 23:57:52 UTC (rev 49517)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Font.cs 2005-09-06 01:38:50 UTC (rev 49518)
@@ -0,0 +1,169 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
+//
+// Authors:
+// Peter Bartok (pbartok at novell.com)
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms.RTF {
+ internal class Font {
+ #region Local Variables
+ private string name;
+ private string alt_name;
+ private int num;
+ private int family;
+ private CharsetType charset;
+ private int pitch;
+ private int type;
+ private int codepage;
+ private Font next;
+ #endregion // Local Variables
+
+ #region Constructors
+ public Font(RTF rtf) {
+ num = -1;
+
+ lock (rtf) {
+ if (rtf.Fonts == null)
+ rtf.Fonts = this;
+ else {
+ Font f = rtf.Fonts;
+ while (f.next != null)
+ f = f.next;
+ f.next = this;
+ }
+ }
+ }
+ #endregion // Constructors
+
+ #region Properties
+ public string Name {
+ get {
+ return name;
+ }
+
+ set {
+ name = value;
+ }
+ }
+
+ public string AltName {
+ get {
+ return alt_name;
+ }
+
+ set {
+ alt_name = value;
+ }
+ }
+
+ public int Num {
+ get {
+ return num;
+ }
+
+ set {
+ num = value;
+ }
+ }
+
+ public int Family {
+ get {
+ return family;
+ }
+
+ set {
+ family = value;
+ }
+ }
+
+ public CharsetType Charset {
+ get {
+ return charset;
+ }
+
+ set {
+ charset = value;
+ }
+ }
+
+
+ public int Pitch {
+ get {
+ return pitch;
+ }
+
+ set {
+ pitch = value;
+ }
+ }
+
+ public int Type {
+ get {
+ return type;
+ }
+
+ set {
+ type = value;
+ }
+ }
+
+ public int Codepage {
+ get {
+ return codepage;
+ }
+
+ set {
+ codepage = value;
+ }
+ }
+ #endregion // Properties
+
+ #region Methods
+ static public Font GetFont(RTF rtf, int font_number) {
+ Font f;
+
+ lock (rtf) {
+ f = GetFont(rtf.Fonts, font_number);
+ }
+ return f;
+ }
+
+ static public Font GetFont(Font start, int font_number) {
+ Font f;
+
+ if (font_number == -1) {
+ return start;
+ }
+
+ f = start;
+
+ while ((f != null) && (f.num != font_number)) {
+ f = f.next;
+ }
+ return f;
+ }
+ #endregion // Methods
+ }
+}
Property changes on: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Font.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/KeyStruct.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/KeyStruct.cs 2005-09-05 23:57:52 UTC (rev 49517)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/KeyStruct.cs 2005-09-06 01:38:50 UTC (rev 49518)
@@ -0,0 +1,40 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
+//
+// Authors:
+// Peter Bartok (pbartok at novell.com)
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms.RTF {
+ internal struct KeyStruct {
+ public KeyStruct(Major major, Minor minor, string symbol) {
+ Major = major;
+ Minor = minor;
+ Symbol = symbol;
+ }
+ public Major Major;
+ public Minor Minor;
+ public string Symbol;
+ }
+}
Property changes on: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/KeyStruct.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/KeysInit.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/KeysInit.cs 2005-09-05 23:57:52 UTC (rev 49517)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/KeysInit.cs 2005-09-06 01:38:50 UTC (rev 49518)
@@ -0,0 +1,719 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
+//
+// Authors:
+// Peter Bartok (pbartok at novell.com)
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms.RTF {
+ internal class KeysInit {
+ public static KeyStruct[] Init() {
+ return new KeyStruct[] {
+ new KeyStruct(Major.SpecialChar, Minor.IIntVersion, "vern"),
+ new KeyStruct(Major.SpecialChar, Minor.ICreateTime, "creatim"),
+ new KeyStruct(Major.SpecialChar, Minor.IRevisionTime, "revtim"),
+ new KeyStruct(Major.SpecialChar, Minor.IPrintTime, "printim"),
+ new KeyStruct(Major.SpecialChar, Minor.IBackupTime, "buptim"),
+ new KeyStruct(Major.SpecialChar, Minor.IEditTime, "edmins"),
+ new KeyStruct(Major.SpecialChar, Minor.IYear, "yr"),
+ new KeyStruct(Major.SpecialChar, Minor.IMonth, "mo"),
+ new KeyStruct(Major.SpecialChar, Minor.IDay, "dy"),
+ new KeyStruct(Major.SpecialChar, Minor.IHour, "hr"),
+ new KeyStruct(Major.SpecialChar, Minor.IMinute, "min"),
+ new KeyStruct(Major.SpecialChar, Minor.ISecond, "sec"),
+ new KeyStruct(Major.SpecialChar, Minor.INPages, "nofpages"),
+ new KeyStruct(Major.SpecialChar, Minor.INWords, "nofwords"),
+ new KeyStruct(Major.SpecialChar, Minor.INChars, "nofchars"),
+ new KeyStruct(Major.SpecialChar, Minor.IIntID, "id"),
+ new KeyStruct(Major.SpecialChar, Minor.CurHeadDate, "chdate"),
+ new KeyStruct(Major.SpecialChar, Minor.CurHeadDateLong, "chdpl"),
+ new KeyStruct(Major.SpecialChar, Minor.CurHeadDateAbbrev, "chdpa"),
+ new KeyStruct(Major.SpecialChar, Minor.CurHeadTime, "chtime"),
+ new KeyStruct(Major.SpecialChar, Minor.CurHeadPage, "chpgn"),
+ new KeyStruct(Major.SpecialChar, Minor.SectNum, "sectnum"),
+ new KeyStruct(Major.SpecialChar, Minor.CurFNote, "chftn"),
+ new KeyStruct(Major.SpecialChar, Minor.CurAnnotRef, "chatn"),
+ new KeyStruct(Major.SpecialChar, Minor.FNoteSep, "chftnsep"),
+ new KeyStruct(Major.SpecialChar, Minor.FNoteCont, "chftnsepc"),
+ new KeyStruct(Major.SpecialChar, Minor.Cell, "cell"),
+ new KeyStruct(Major.SpecialChar, Minor.Row, "row"),
+ new KeyStruct(Major.SpecialChar, Minor.Par, "par"),
+ new KeyStruct(Major.SpecialChar, Minor.Par, "\n"),
+ new KeyStruct(Major.SpecialChar, Minor.Par, "\r"),
+ new KeyStruct(Major.SpecialChar, Minor.Sect, "sect"),
+ new KeyStruct(Major.SpecialChar, Minor.Page, "page"),
+ new KeyStruct(Major.SpecialChar, Minor.Column, "column"),
+ new KeyStruct(Major.SpecialChar, Minor.Line, "line"),
+ new KeyStruct(Major.SpecialChar, Minor.SoftPage, "softpage"),
+ new KeyStruct(Major.SpecialChar, Minor.SoftColumn, "softcol"),
+ new KeyStruct(Major.SpecialChar, Minor.SoftLine, "softline"),
+ new KeyStruct(Major.SpecialChar, Minor.SoftLineHt, "softlheight"),
+ new KeyStruct(Major.SpecialChar, Minor.Tab, "tab"),
+ new KeyStruct(Major.SpecialChar, Minor.EmDash, "emdash"),
+ new KeyStruct(Major.SpecialChar, Minor.EnDash, "endash"),
+ new KeyStruct(Major.SpecialChar, Minor.EmSpace, "emspace"),
+ new KeyStruct(Major.SpecialChar, Minor.EnSpace, "enspace"),
+ new KeyStruct(Major.SpecialChar, Minor.Bullet, "bullet"),
+ new KeyStruct(Major.SpecialChar, Minor.LQuote, "lquote"),
+ new KeyStruct(Major.SpecialChar, Minor.RQuote, "rquote"),
+ new KeyStruct(Major.SpecialChar, Minor.LDblQuote, "ldblquote"),
+ new KeyStruct(Major.SpecialChar, Minor.RDblQuote, "rdblquote"),
+ new KeyStruct(Major.SpecialChar, Minor.Formula, "|"),
+ new KeyStruct(Major.SpecialChar, Minor.NoBrkSpace, "~"),
+ new KeyStruct(Major.SpecialChar, Minor.NoReqHyphen, "-"),
+ new KeyStruct(Major.SpecialChar, Minor.NoBrkHyphen, "_"),
+ new KeyStruct(Major.SpecialChar, Minor.OptDest, "*"),
+ new KeyStruct(Major.SpecialChar, Minor.LTRMark, "ltrmark"),
+ new KeyStruct(Major.SpecialChar, Minor.RTLMark, "rtlmark"),
+ new KeyStruct(Major.SpecialChar, Minor.NoWidthJoiner, "zwj"),
+ new KeyStruct(Major.SpecialChar, Minor.NoWidthNonJoiner, "zwnj"),
+ new KeyStruct(Major.SpecialChar, Minor.CurHeadPict, "chpict"),
+ new KeyStruct(Major.CharAttr, Minor.Plain, "plain"),
+ new KeyStruct(Major.CharAttr, Minor.Bold, "b"),
+ new KeyStruct(Major.CharAttr, Minor.AllCaps, "caps"),
+ new KeyStruct(Major.CharAttr, Minor.Deleted, "deleted"),
+ new KeyStruct(Major.CharAttr, Minor.SubScript, "dn"),
+ new KeyStruct(Major.CharAttr, Minor.SubScrShrink, "sub"),
+ new KeyStruct(Major.CharAttr, Minor.NoSuperSub, "nosupersub"),
+ new KeyStruct(Major.CharAttr, Minor.Expand, "expnd"),
+ new KeyStruct(Major.CharAttr, Minor.ExpandTwips, "expndtw"),
+ new KeyStruct(Major.CharAttr, Minor.Kerning, "kerning"),
+ new KeyStruct(Major.CharAttr, Minor.FontNum, "f"),
+ new KeyStruct(Major.CharAttr, Minor.FontSize, "fs"),
+ new KeyStruct(Major.CharAttr, Minor.Italic, "i"),
+ new KeyStruct(Major.CharAttr, Minor.Outline, "outl"),
+ new KeyStruct(Major.CharAttr, Minor.Revised, "revised"),
+ new KeyStruct(Major.CharAttr, Minor.RevAuthor, "revauth"),
+ new KeyStruct(Major.CharAttr, Minor.RevDTTM, "revdttm"),
+ new KeyStruct(Major.CharAttr, Minor.SmallCaps, "scaps"),
+ new KeyStruct(Major.CharAttr, Minor.Shadow, "shad"),
+ new KeyStruct(Major.CharAttr, Minor.StrikeThru, "strike"),
+ new KeyStruct(Major.CharAttr, Minor.Underline, "ul"),
+ new KeyStruct(Major.CharAttr, Minor.DotUnderline, "uld"),
+ new KeyStruct(Major.CharAttr, Minor.DbUnderline, "uldb"),
+ new KeyStruct(Major.CharAttr, Minor.NoUnderline, "ulnone"),
+ new KeyStruct(Major.CharAttr, Minor.WordUnderline, "ulw"),
+ new KeyStruct(Major.CharAttr, Minor.SuperScript, "up"),
+ new KeyStruct(Major.CharAttr, Minor.SuperScrShrink, "super"),
+ new KeyStruct(Major.CharAttr, Minor.Invisible, "v"),
+ new KeyStruct(Major.CharAttr, Minor.ForeColor, "cf"),
+ new KeyStruct(Major.CharAttr, Minor.BackColor, "cb"),
+ new KeyStruct(Major.CharAttr, Minor.RTLChar, "rtlch"),
+ new KeyStruct(Major.CharAttr, Minor.LTRChar, "ltrch"),
+ new KeyStruct(Major.CharAttr, Minor.CharStyleNum, "cs"),
+ new KeyStruct(Major.CharAttr, Minor.CharCharSet, "cchs"),
+ new KeyStruct(Major.CharAttr, Minor.Language, "lang"),
+ new KeyStruct(Major.CharAttr, Minor.Gray, "gray"),
+ new KeyStruct(Major.ParAttr, Minor.ParDef, "pard"),
+ new KeyStruct(Major.ParAttr, Minor.StyleNum, "s"),
+ new KeyStruct(Major.ParAttr, Minor.Hyphenate, "hyphpar"),
+ new KeyStruct(Major.ParAttr, Minor.InTable, "intbl"),
+ new KeyStruct(Major.ParAttr, Minor.Keep, "keep"),
+ new KeyStruct(Major.ParAttr, Minor.NoWidowControl, "nowidctlpar"),
+ new KeyStruct(Major.ParAttr, Minor.KeepNext, "keepn"),
+ new KeyStruct(Major.ParAttr, Minor.OutlineLevel, "level"),
+ new KeyStruct(Major.ParAttr, Minor.NoLineNum, "noline"),
+ new KeyStruct(Major.ParAttr, Minor.PBBefore, "pagebb"),
+ new KeyStruct(Major.ParAttr, Minor.SideBySide, "sbys"),
+ new KeyStruct(Major.ParAttr, Minor.QuadLeft, "ql"),
+ new KeyStruct(Major.ParAttr, Minor.QuadRight, "qr"),
+ new KeyStruct(Major.ParAttr, Minor.QuadJust, "qj"),
+ new KeyStruct(Major.ParAttr, Minor.QuadCenter, "qc"),
+ new KeyStruct(Major.ParAttr, Minor.FirstIndent, "fi"),
+ new KeyStruct(Major.ParAttr, Minor.LeftIndent, "li"),
+ new KeyStruct(Major.ParAttr, Minor.RightIndent, "ri"),
+ new KeyStruct(Major.ParAttr, Minor.SpaceBefore, "sb"),
+ new KeyStruct(Major.ParAttr, Minor.SpaceAfter, "sa"),
+ new KeyStruct(Major.ParAttr, Minor.SpaceBetween, "sl"),
+ new KeyStruct(Major.ParAttr, Minor.SpaceMultiply, "slmult"),
+ new KeyStruct(Major.ParAttr, Minor.SubDocument, "subdocument"),
+ new KeyStruct(Major.ParAttr, Minor.RTLPar, "rtlpar"),
+ new KeyStruct(Major.ParAttr, Minor.LTRPar, "ltrpar"),
+ new KeyStruct(Major.ParAttr, Minor.TabPos, "tx"),
+ new KeyStruct(Major.ParAttr, Minor.TabLeft, "tql"),
+ new KeyStruct(Major.ParAttr, Minor.TabRight, "tqr"),
+ new KeyStruct(Major.ParAttr, Minor.TabCenter, "tqc"),
+ new KeyStruct(Major.ParAttr, Minor.TabDecimal, "tqdec"),
+ new KeyStruct(Major.ParAttr, Minor.TabBar, "tb"),
+ new KeyStruct(Major.ParAttr, Minor.LeaderDot, "tldot"),
+ new KeyStruct(Major.ParAttr, Minor.LeaderHyphen, "tlhyph"),
+ new KeyStruct(Major.ParAttr, Minor.LeaderUnder, "tlul"),
+ new KeyStruct(Major.ParAttr, Minor.LeaderThick, "tlth"),
+ new KeyStruct(Major.ParAttr, Minor.LeaderEqual, "tleq"),
+ new KeyStruct(Major.ParAttr, Minor.ParLevel, "pnlvl"),
+ new KeyStruct(Major.ParAttr, Minor.ParBullet, "pnlvlblt"),
+ new KeyStruct(Major.ParAttr, Minor.ParSimple, "pnlvlbody"),
+ new KeyStruct(Major.ParAttr, Minor.ParNumCont, "pnlvlcont"),
+ new KeyStruct(Major.ParAttr, Minor.ParNumOnce, "pnnumonce"),
+ new KeyStruct(Major.ParAttr, Minor.ParNumAcross, "pnacross"),
+ new KeyStruct(Major.ParAttr, Minor.ParHangIndent, "pnhang"),
+ new KeyStruct(Major.ParAttr, Minor.ParNumRestart, "pnrestart"),
+ new KeyStruct(Major.ParAttr, Minor.ParNumCardinal, "pncard"),
+ new KeyStruct(Major.ParAttr, Minor.ParNumDecimal, "pndec"),
+ new KeyStruct(Major.ParAttr, Minor.ParNumULetter, "pnucltr"),
+ new KeyStruct(Major.ParAttr, Minor.ParNumURoman, "pnucrm"),
+ new KeyStruct(Major.ParAttr, Minor.ParNumLLetter, "pnlcltr"),
+ new KeyStruct(Major.ParAttr, Minor.ParNumLRoman, "pnlcrm"),
+ new KeyStruct(Major.ParAttr, Minor.ParNumOrdinal, "pnord"),
+ new KeyStruct(Major.ParAttr, Minor.ParNumOrdinalText, "pnordt"),
+ new KeyStruct(Major.ParAttr, Minor.ParNumBold, "pnb"),
+ new KeyStruct(Major.ParAttr, Minor.ParNumItalic, "pni"),
+ new KeyStruct(Major.ParAttr, Minor.ParNumAllCaps, "pncaps"),
+ new KeyStruct(Major.ParAttr, Minor.ParNumSmallCaps, "pnscaps"),
+ new KeyStruct(Major.ParAttr, Minor.ParNumUnder, "pnul"),
+ new KeyStruct(Major.ParAttr, Minor.ParNumDotUnder, "pnuld"),
+ new KeyStruct(Major.ParAttr, Minor.ParNumDbUnder, "pnuldb"),
+ new KeyStruct(Major.ParAttr, Minor.ParNumNoUnder, "pnulnone"),
+ new KeyStruct(Major.ParAttr, Minor.ParNumWordUnder, "pnulw"),
+ new KeyStruct(Major.ParAttr, Minor.ParNumStrikethru, "pnstrike"),
+ new KeyStruct(Major.ParAttr, Minor.ParNumForeColor, "pncf"),
+ new KeyStruct(Major.ParAttr, Minor.ParNumFont, "pnf"),
+ new KeyStruct(Major.ParAttr, Minor.ParNumFontSize, "pnfs"),
+ new KeyStruct(Major.ParAttr, Minor.ParNumIndent, "pnindent"),
+ new KeyStruct(Major.ParAttr, Minor.ParNumSpacing, "pnsp"),
+ new KeyStruct(Major.ParAttr, Minor.ParNumInclPrev, "pnprev"),
+ new KeyStruct(Major.ParAttr, Minor.ParNumCenter, "pnqc"),
+ new KeyStruct(Major.ParAttr, Minor.ParNumLeft, "pnql"),
+ new KeyStruct(Major.ParAttr, Minor.ParNumRight, "pnqr"),
+ new KeyStruct(Major.ParAttr, Minor.ParNumStartAt, "pnstart"),
+ new KeyStruct(Major.ParAttr, Minor.BorderTop, "brdrt"),
+ new KeyStruct(Major.ParAttr, Minor.BorderBottom, "brdrb"),
+ new KeyStruct(Major.ParAttr, Minor.BorderLeft, "brdrl"),
+ new KeyStruct(Major.ParAttr, Minor.BorderRight, "brdrr"),
+ new KeyStruct(Major.ParAttr, Minor.BorderBetween, "brdrbtw"),
+ new KeyStruct(Major.ParAttr, Minor.BorderBar, "brdrbar"),
+ new KeyStruct(Major.ParAttr, Minor.BorderBox, "box"),
+ new KeyStruct(Major.ParAttr, Minor.BorderSingle, "brdrs"),
+ new KeyStruct(Major.ParAttr, Minor.BorderThick, "brdrth"),
+ new KeyStruct(Major.ParAttr, Minor.BorderShadow, "brdrsh"),
+ new KeyStruct(Major.ParAttr, Minor.BorderDouble, "brdrdb"),
+ new KeyStruct(Major.ParAttr, Minor.BorderDot, "brdrdot"),
+ new KeyStruct(Major.ParAttr, Minor.BorderDot, "brdrdash"),
+ new KeyStruct(Major.ParAttr, Minor.BorderHair, "brdrhair"),
+ new KeyStruct(Major.ParAttr, Minor.BorderWidth, "brdrw"),
+ new KeyStruct(Major.ParAttr, Minor.BorderColor, "brdrcf"),
+ new KeyStruct(Major.ParAttr, Minor.BorderSpace, "brsp"),
+ new KeyStruct(Major.ParAttr, Minor.Shading, "shading"),
+ new KeyStruct(Major.ParAttr, Minor.BgPatH, "bghoriz"),
+ new KeyStruct(Major.ParAttr, Minor.BgPatV, "bgvert"),
+ new KeyStruct(Major.ParAttr, Minor.FwdDiagBgPat, "bgfdiag"),
+ new KeyStruct(Major.ParAttr, Minor.BwdDiagBgPat, "bgbdiag"),
+ new KeyStruct(Major.ParAttr, Minor.HatchBgPat, "bgcross"),
+ new KeyStruct(Major.ParAttr, Minor.DiagHatchBgPat, "bgdcross"),
+ new KeyStruct(Major.ParAttr, Minor.DarkBgPatH, "bgdkhoriz"),
+ new KeyStruct(Major.ParAttr, Minor.DarkBgPatV, "bgdkvert"),
+ new KeyStruct(Major.ParAttr, Minor.FwdDarkBgPat, "bgdkfdiag"),
+ new KeyStruct(Major.ParAttr, Minor.BwdDarkBgPat, "bgdkbdiag"),
+ new KeyStruct(Major.ParAttr, Minor.DarkHatchBgPat, "bgdkcross"),
+ new KeyStruct(Major.ParAttr, Minor.DarkDiagHatchBgPat, "bgdkdcross"),
+ new KeyStruct(Major.ParAttr, Minor.BgPatLineColor, "cfpat"),
+ new KeyStruct(Major.ParAttr, Minor.BgPatColor, "cbpat"),
+ new KeyStruct(Major.SectAttr, Minor.SectDef, "sectd"),
+ new KeyStruct(Major.SectAttr, Minor.ENoteHere, "endnhere"),
+ new KeyStruct(Major.SectAttr, Minor.PrtBinFirst, "binfsxn"),
+ new KeyStruct(Major.SectAttr, Minor.PrtBin, "binsxn"),
+ new KeyStruct(Major.SectAttr, Minor.SectStyleNum, "ds"),
+ new KeyStruct(Major.SectAttr, Minor.NoBreak, "sbknone"),
+ new KeyStruct(Major.SectAttr, Minor.ColBreak, "sbkcol"),
+ new KeyStruct(Major.SectAttr, Minor.PageBreak, "sbkpage"),
+ new KeyStruct(Major.SectAttr, Minor.EvenBreak, "sbkeven"),
+ new KeyStruct(Major.SectAttr, Minor.OddBreak, "sbkodd"),
+ new KeyStruct(Major.SectAttr, Minor.Columns, "cols"),
+ new KeyStruct(Major.SectAttr, Minor.ColumnSpace, "colsx"),
+ new KeyStruct(Major.SectAttr, Minor.ColumnNumber, "colno"),
+ new KeyStruct(Major.SectAttr, Minor.ColumnSpRight, "colsr"),
+ new KeyStruct(Major.SectAttr, Minor.ColumnWidth, "colw"),
+ new KeyStruct(Major.SectAttr, Minor.ColumnLine, "linebetcol"),
+ new KeyStruct(Major.SectAttr, Minor.LineModulus, "linemod"),
+ new KeyStruct(Major.SectAttr, Minor.LineDist, "linex"),
+ new KeyStruct(Major.SectAttr, Minor.LineStarts, "linestarts"),
+ new KeyStruct(Major.SectAttr, Minor.LineRestart, "linerestart"),
+ new KeyStruct(Major.SectAttr, Minor.LineRestartPg, "lineppage"),
+ new KeyStruct(Major.SectAttr, Minor.LineCont, "linecont"),
+ new KeyStruct(Major.SectAttr, Minor.SectPageWid, "pgwsxn"),
+ new KeyStruct(Major.SectAttr, Minor.SectPageHt, "pghsxn"),
+ new KeyStruct(Major.SectAttr, Minor.SectMarginLeft, "marglsxn"),
+ new KeyStruct(Major.SectAttr, Minor.SectMarginRight, "margrsxn"),
+ new KeyStruct(Major.SectAttr, Minor.SectMarginTop, "margtsxn"),
+ new KeyStruct(Major.SectAttr, Minor.SectMarginBottom, "margbsxn"),
+ new KeyStruct(Major.SectAttr, Minor.SectMarginGutter, "guttersxn"),
+ new KeyStruct(Major.SectAttr, Minor.SectLandscape, "lndscpsxn"),
+ new KeyStruct(Major.SectAttr, Minor.TitleSpecial, "titlepg"),
+ new KeyStruct(Major.SectAttr, Minor.HeaderY, "headery"),
+ new KeyStruct(Major.SectAttr, Minor.FooterY, "footery"),
+ new KeyStruct(Major.SectAttr, Minor.PageStarts, "pgnstarts"),
+ new KeyStruct(Major.SectAttr, Minor.PageCont, "pgncont"),
+ new KeyStruct(Major.SectAttr, Minor.PageRestart, "pgnrestart"),
+ new KeyStruct(Major.SectAttr, Minor.PageNumRight, "pgnx"),
+ new KeyStruct(Major.SectAttr, Minor.PageNumTop, "pgny"),
+ new KeyStruct(Major.SectAttr, Minor.PageDecimal, "pgndec"),
+ new KeyStruct(Major.SectAttr, Minor.PageURoman, "pgnucrm"),
+ new KeyStruct(Major.SectAttr, Minor.PageLRoman, "pgnlcrm"),
+ new KeyStruct(Major.SectAttr, Minor.PageULetter, "pgnucltr"),
+ new KeyStruct(Major.SectAttr, Minor.PageLLetter, "pgnlcltr"),
+ new KeyStruct(Major.SectAttr, Minor.PageNumHyphSep, "pgnhnsh"),
+ new KeyStruct(Major.SectAttr, Minor.PageNumSpaceSep, "pgnhnsp"),
+ new KeyStruct(Major.SectAttr, Minor.PageNumColonSep, "pgnhnsc"),
+ new KeyStruct(Major.SectAttr, Minor.PageNumEmdashSep, "pgnhnsm"),
+ new KeyStruct(Major.SectAttr, Minor.PageNumEndashSep, "pgnhnsn"),
+ new KeyStruct(Major.SectAttr, Minor.TopVAlign, "vertalt"),
+ new KeyStruct(Major.SectAttr, Minor.BottomVAlign, "vertalb"),
+ new KeyStruct(Major.SectAttr, Minor.CenterVAlign, "vertalc"),
+ new KeyStruct(Major.SectAttr, Minor.JustVAlign, "vertalj"),
+ new KeyStruct(Major.SectAttr, Minor.RTLSect, "rtlsect"),
+ new KeyStruct(Major.SectAttr, Minor.LTRSect, "ltrsect"),
+ new KeyStruct(Major.DocAttr, Minor.DefTab, "deftab"),
+ new KeyStruct(Major.DocAttr, Minor.HyphHotZone, "hyphhotz"),
+ new KeyStruct(Major.DocAttr, Minor.HyphConsecLines, "hyphconsec"),
+ new KeyStruct(Major.DocAttr, Minor.HyphCaps, "hyphcaps"),
+ new KeyStruct(Major.DocAttr, Minor.HyphAuto, "hyphauto"),
+ new KeyStruct(Major.DocAttr, Minor.LineStart, "linestart"),
+ new KeyStruct(Major.DocAttr, Minor.FracWidth, "fracwidth"),
+ new KeyStruct(Major.DocAttr, Minor.MakeBackup, "makeback"),
+ new KeyStruct(Major.DocAttr, Minor.MakeBackup, "makebackup"),
+ new KeyStruct(Major.DocAttr, Minor.RTFDefault, "defformat"),
+ new KeyStruct(Major.DocAttr, Minor.PSOverlay, "psover"),
+ new KeyStruct(Major.DocAttr, Minor.DocTemplate, "doctemp"),
+ new KeyStruct(Major.DocAttr, Minor.DefLanguage, "deflang"),
+ new KeyStruct(Major.DocAttr, Minor.FENoteType, "fet"),
+ new KeyStruct(Major.DocAttr, Minor.FNoteEndSect, "endnotes"),
+ new KeyStruct(Major.DocAttr, Minor.FNoteEndDoc, "enddoc"),
+ new KeyStruct(Major.DocAttr, Minor.FNoteText, "ftntj"),
+ new KeyStruct(Major.DocAttr, Minor.FNoteBottom, "ftnbj"),
+ new KeyStruct(Major.DocAttr, Minor.ENoteEndSect, "aendnotes"),
+ new KeyStruct(Major.DocAttr, Minor.ENoteEndDoc, "aenddoc"),
+ new KeyStruct(Major.DocAttr, Minor.ENoteText, "aftntj"),
+ new KeyStruct(Major.DocAttr, Minor.ENoteBottom, "aftnbj"),
+ new KeyStruct(Major.DocAttr, Minor.FNoteStart, "ftnstart"),
+ new KeyStruct(Major.DocAttr, Minor.ENoteStart, "aftnstart"),
+ new KeyStruct(Major.DocAttr, Minor.FNoteRestartPage, "ftnrstpg"),
+ new KeyStruct(Major.DocAttr, Minor.FNoteRestart, "ftnrestart"),
+ new KeyStruct(Major.DocAttr, Minor.FNoteRestartCont, "ftnrstcont"),
+ new KeyStruct(Major.DocAttr, Minor.ENoteRestart, "aftnrestart"),
+ new KeyStruct(Major.DocAttr, Minor.ENoteRestartCont, "aftnrstcont"),
+ new KeyStruct(Major.DocAttr, Minor.FNoteNumArabic, "ftnnar"),
+ new KeyStruct(Major.DocAttr, Minor.FNoteNumLLetter, "ftnnalc"),
+ new KeyStruct(Major.DocAttr, Minor.FNoteNumULetter, "ftnnauc"),
+ new KeyStruct(Major.DocAttr, Minor.FNoteNumLRoman, "ftnnrlc"),
+ new KeyStruct(Major.DocAttr, Minor.FNoteNumURoman, "ftnnruc"),
+ new KeyStruct(Major.DocAttr, Minor.FNoteNumChicago, "ftnnchi"),
+ new KeyStruct(Major.DocAttr, Minor.ENoteNumArabic, "aftnnar"),
+ new KeyStruct(Major.DocAttr, Minor.ENoteNumLLetter, "aftnnalc"),
+ new KeyStruct(Major.DocAttr, Minor.ENoteNumULetter, "aftnnauc"),
+ new KeyStruct(Major.DocAttr, Minor.ENoteNumLRoman, "aftnnrlc"),
+ new KeyStruct(Major.DocAttr, Minor.ENoteNumURoman, "aftnnruc"),
+ new KeyStruct(Major.DocAttr, Minor.ENoteNumChicago, "aftnnchi"),
+ new KeyStruct(Major.DocAttr, Minor.PaperWidth, "paperw"),
+ new KeyStruct(Major.DocAttr, Minor.PaperHeight, "paperh"),
+ new KeyStruct(Major.DocAttr, Minor.PaperSize, "psz"),
+ new KeyStruct(Major.DocAttr, Minor.LeftMargin, "margl"),
+ new KeyStruct(Major.DocAttr, Minor.RightMargin, "margr"),
+ new KeyStruct(Major.DocAttr, Minor.TopMargin, "margt"),
+ new KeyStruct(Major.DocAttr, Minor.BottomMargin, "margb"),
+ new KeyStruct(Major.DocAttr, Minor.FacingPage, "facingp"),
+ new KeyStruct(Major.DocAttr, Minor.GutterWid, "gutter"),
+ new KeyStruct(Major.DocAttr, Minor.MirrorMargin, "margmirror"),
+ new KeyStruct(Major.DocAttr, Minor.Landscape, "landscape"),
+ new KeyStruct(Major.DocAttr, Minor.PageStart, "pgnstart"),
+ new KeyStruct(Major.DocAttr, Minor.WidowCtrl, "widowctrl"),
+ new KeyStruct(Major.DocAttr, Minor.LinkStyles, "linkstyles"),
+ new KeyStruct(Major.DocAttr, Minor.NoAutoTabIndent, "notabind"),
+ new KeyStruct(Major.DocAttr, Minor.WrapSpaces, "wraptrsp"),
+ new KeyStruct(Major.DocAttr, Minor.PrintColorsBlack, "prcolbl"),
+ new KeyStruct(Major.DocAttr, Minor.NoExtraSpaceRL, "noextrasprl"),
+ new KeyStruct(Major.DocAttr, Minor.NoColumnBalance, "nocolbal"),
+ new KeyStruct(Major.DocAttr, Minor.CvtMailMergeQuote, "cvmme"),
+ new KeyStruct(Major.DocAttr, Minor.SuppressTopSpace, "sprstsp"),
+ new KeyStruct(Major.DocAttr, Minor.SuppressPreParSpace, "sprsspbf"),
+ new KeyStruct(Major.DocAttr, Minor.CombineTblBorders, "otblrul"),
+ new KeyStruct(Major.DocAttr, Minor.TranspMetafiles, "transmf"),
+ new KeyStruct(Major.DocAttr, Minor.SwapBorders, "swpbdr"),
+ new KeyStruct(Major.DocAttr, Minor.ShowHardBreaks, "brkfrm"),
+ new KeyStruct(Major.DocAttr, Minor.FormProtected, "formprot"),
+ new KeyStruct(Major.DocAttr, Minor.AllProtected, "allprot"),
+ new KeyStruct(Major.DocAttr, Minor.FormShading, "formshade"),
+ new KeyStruct(Major.DocAttr, Minor.FormDisplay, "formdisp"),
+ new KeyStruct(Major.DocAttr, Minor.PrintData, "printdata"),
+ new KeyStruct(Major.DocAttr, Minor.RevProtected, "revprot"),
+ new KeyStruct(Major.DocAttr, Minor.Revisions, "revisions"),
+ new KeyStruct(Major.DocAttr, Minor.RevDisplay, "revprop"),
+ new KeyStruct(Major.DocAttr, Minor.RevBar, "revbar"),
+ new KeyStruct(Major.DocAttr, Minor.AnnotProtected, "annotprot"),
+ new KeyStruct(Major.DocAttr, Minor.RTLDoc, "rtldoc"),
+ new KeyStruct(Major.DocAttr, Minor.LTRDoc, "ltrdoc"),
+ new KeyStruct(Major.StyleAttr, Minor.Additive, "additive"),
+ new KeyStruct(Major.StyleAttr, Minor.BasedOn, "sbasedon"),
+ new KeyStruct(Major.StyleAttr, Minor.Next, "snext"),
+ new KeyStruct(Major.PictAttr, Minor.MacQD, "macpict"),
+ new KeyStruct(Major.PictAttr, Minor.PMMetafile, "pmmetafile"),
+ new KeyStruct(Major.PictAttr, Minor.WinMetafile, "wmetafile"),
+ new KeyStruct(Major.PictAttr, Minor.DevIndBitmap, "dibitmap"),
+ new KeyStruct(Major.PictAttr, Minor.WinBitmap, "wbitmap"),
+ new KeyStruct(Major.PictAttr, Minor.PixelBits, "wbmbitspixel"),
+ new KeyStruct(Major.PictAttr, Minor.BitmapPlanes, "wbmplanes"),
+ new KeyStruct(Major.PictAttr, Minor.BitmapWid, "wbmwidthbytes"),
+ new KeyStruct(Major.PictAttr, Minor.PicWid, "picw"),
+ new KeyStruct(Major.PictAttr, Minor.PicHt, "pich"),
+ new KeyStruct(Major.PictAttr, Minor.PicGoalWid, "picwgoal"),
+ new KeyStruct(Major.PictAttr, Minor.PicGoalHt, "pichgoal"),
+ new KeyStruct(Major.PictAttr, Minor.PicGoalWid, "picwGoal"),
+ new KeyStruct(Major.PictAttr, Minor.PicGoalHt, "pichGoal"),
+ new KeyStruct(Major.PictAttr, Minor.PicScaleX, "picscalex"),
+ new KeyStruct(Major.PictAttr, Minor.PicScaleY, "picscaley"),
+ new KeyStruct(Major.PictAttr, Minor.PicScaled, "picscaled"),
+ new KeyStruct(Major.PictAttr, Minor.PicCropTop, "piccropt"),
+ new KeyStruct(Major.PictAttr, Minor.PicCropBottom, "piccropb"),
+ new KeyStruct(Major.PictAttr, Minor.PicCropLeft, "piccropl"),
+ new KeyStruct(Major.PictAttr, Minor.PicCropRight, "piccropr"),
+ new KeyStruct(Major.PictAttr, Minor.PicMFHasBitmap, "picbmp"),
+ new KeyStruct(Major.PictAttr, Minor.PicMFBitsPerPixel, "picbpp"),
+ new KeyStruct(Major.PictAttr, Minor.PicBinary, "bin"),
+ new KeyStruct(Major.NeXTGrAttr, Minor.NeXTGWidth, "width"),
+ new KeyStruct(Major.NeXTGrAttr, Minor.NeXTGHeight, "height"),
+ new KeyStruct(Major.Destination, Minor.FontTbl, "fonttbl"),
+ new KeyStruct(Major.Destination, Minor.FontAltName, "falt"),
+ new KeyStruct(Major.Destination, Minor.EmbeddedFont, "fonteb"),
+ new KeyStruct(Major.Destination, Minor.FontFile, "fontfile"),
+ new KeyStruct(Major.Destination, Minor.FileTbl, "filetbl"),
+ new KeyStruct(Major.Destination, Minor.FileInfo, "file"),
+ new KeyStruct(Major.Destination, Minor.ColorTbl, "colortbl"),
+ new KeyStruct(Major.Destination, Minor.StyleSheet, "stylesheet"),
+ new KeyStruct(Major.Destination, Minor.KeyCode, "keycode"),
+ new KeyStruct(Major.Destination, Minor.RevisionTbl, "revtbl"),
+ new KeyStruct(Major.Destination, Minor.Info, "info"),
+ new KeyStruct(Major.Destination, Minor.ITitle, "title"),
+ new KeyStruct(Major.Destination, Minor.ISubject, "subject"),
+ new KeyStruct(Major.Destination, Minor.IAuthor, "author"),
+ new KeyStruct(Major.Destination, Minor.IOperator, "operator"),
+ new KeyStruct(Major.Destination, Minor.IKeywords, "keywords"),
+ new KeyStruct(Major.Destination, Minor.IComment, "comment"),
+ new KeyStruct(Major.Destination, Minor.IVersion, "version"),
+ new KeyStruct(Major.Destination, Minor.IDoccomm, "doccomm"),
+ new KeyStruct(Major.Destination, Minor.IVerscomm, "verscomm"),
+ new KeyStruct(Major.Destination, Minor.NextFile, "nextfile"),
+ new KeyStruct(Major.Destination, Minor.Template, "template"),
+ new KeyStruct(Major.Destination, Minor.FNSep, "ftnsep"),
+ new KeyStruct(Major.Destination, Minor.FNContSep, "ftnsepc"),
+ new KeyStruct(Major.Destination, Minor.FNContNotice, "ftncn"),
+ new KeyStruct(Major.Destination, Minor.ENSep, "aftnsep"),
+ new KeyStruct(Major.Destination, Minor.ENContSep, "aftnsepc"),
+ new KeyStruct(Major.Destination, Minor.ENContNotice, "aftncn"),
+ new KeyStruct(Major.Destination, Minor.PageNumLevel, "pgnhn"),
+ new KeyStruct(Major.Destination, Minor.ParNumLevelStyle, "pnseclvl"),
+ new KeyStruct(Major.Destination, Minor.Header, "header"),
+ new KeyStruct(Major.Destination, Minor.Footer, "footer"),
+ new KeyStruct(Major.Destination, Minor.HeaderLeft, "headerl"),
+ new KeyStruct(Major.Destination, Minor.HeaderRight, "headerr"),
+ new KeyStruct(Major.Destination, Minor.HeaderFirst, "headerf"),
+ new KeyStruct(Major.Destination, Minor.FooterLeft, "footerl"),
+ new KeyStruct(Major.Destination, Minor.FooterRight, "footerr"),
+ new KeyStruct(Major.Destination, Minor.FooterFirst, "footerf"),
+ new KeyStruct(Major.Destination, Minor.ParNumText, "pntext"),
+ new KeyStruct(Major.Destination, Minor.ParNumbering, "pn"),
+ new KeyStruct(Major.Destination, Minor.ParNumTextAfter, "pntexta"),
+ new KeyStruct(Major.Destination, Minor.ParNumTextBefore, "pntextb"),
+ new KeyStruct(Major.Destination, Minor.BookmarkStart, "bkmkstart"),
+ new KeyStruct(Major.Destination, Minor.BookmarkEnd, "bkmkend"),
+ new KeyStruct(Major.Destination, Minor.Pict, "pict"),
+ new KeyStruct(Major.Destination, Minor.Object, "object"),
+ new KeyStruct(Major.Destination, Minor.ObjClass, "objclass"),
+ new KeyStruct(Major.Destination, Minor.ObjName, "objname"),
+ new KeyStruct(Major.ObjAttr, Minor.ObjTime, "objtime"),
+ new KeyStruct(Major.Destination, Minor.ObjData, "objdata"),
+ new KeyStruct(Major.Destination, Minor.ObjAlias, "objalias"),
+ new KeyStruct(Major.Destination, Minor.ObjSection, "objsect"),
+ new KeyStruct(Major.Destination, Minor.ObjItem, "objitem"),
+ new KeyStruct(Major.Destination, Minor.ObjTopic, "objtopic"),
+ new KeyStruct(Major.Destination, Minor.ObjResult, "result"),
+ new KeyStruct(Major.Destination, Minor.DrawObject, "do"),
+ new KeyStruct(Major.Destination, Minor.Footnote, "footnote"),
+ new KeyStruct(Major.Destination, Minor.AnnotRefStart, "atrfstart"),
+ new KeyStruct(Major.Destination, Minor.AnnotRefEnd, "atrfend"),
+ new KeyStruct(Major.Destination, Minor.AnnotID, "atnid"),
+ new KeyStruct(Major.Destination, Minor.AnnotAuthor, "atnauthor"),
+ new KeyStruct(Major.Destination, Minor.Annotation, "annotation"),
+ new KeyStruct(Major.Destination, Minor.AnnotRef, "atnref"),
+ new KeyStruct(Major.Destination, Minor.AnnotTime, "atntime"),
+ new KeyStruct(Major.Destination, Minor.AnnotIcon, "atnicn"),
+ new KeyStruct(Major.Destination, Minor.Field, "field"),
+ new KeyStruct(Major.Destination, Minor.FieldInst, "fldinst"),
+ new KeyStruct(Major.Destination, Minor.FieldResult, "fldrslt"),
+ new KeyStruct(Major.Destination, Minor.DataField, "datafield"),
+ new KeyStruct(Major.Destination, Minor.Index, "xe"),
+ new KeyStruct(Major.Destination, Minor.IndexText, "txe"),
+ new KeyStruct(Major.Destination, Minor.IndexRange, "rxe"),
+ new KeyStruct(Major.Destination, Minor.TOC, "tc"),
+ new KeyStruct(Major.Destination, Minor.NeXTGraphic, "NeXTGraphic"),
+ new KeyStruct(Major.FontFamily, Minor.FFNil, "fnil"),
+ new KeyStruct(Major.FontFamily, Minor.FFRoman, "froman"),
+ new KeyStruct(Major.FontFamily, Minor.FFSwiss, "fswiss"),
+ new KeyStruct(Major.FontFamily, Minor.FFModern, "fmodern"),
+ new KeyStruct(Major.FontFamily, Minor.FFScript, "fscript"),
+ new KeyStruct(Major.FontFamily, Minor.FFDecor, "fdecor"),
+ new KeyStruct(Major.FontFamily, Minor.FFTech, "ftech"),
+ new KeyStruct(Major.FontFamily, Minor.FFBidirectional, "fbidi"),
+ new KeyStruct(Major.FontAttr, Minor.FontCharSet, "fcharset"),
+ new KeyStruct(Major.FontAttr, Minor.FontPitch, "fprq"),
+ new KeyStruct(Major.FontAttr, Minor.FontCodePage, "cpg"),
+ new KeyStruct(Major.FontAttr, Minor.FTypeNil, "ftnil"),
+ new KeyStruct(Major.FontAttr, Minor.FTypeTrueType, "fttruetype"),
+ new KeyStruct(Major.FileAttr, Minor.FileNum, "fid"),
+ new KeyStruct(Major.FileAttr, Minor.FileRelPath, "frelative"),
+ new KeyStruct(Major.FileAttr, Minor.FileOSNum, "fosnum"),
+ new KeyStruct(Major.FileSource, Minor.SrcMacintosh, "fvalidmac"),
+ new KeyStruct(Major.FileSource, Minor.SrcDOS, "fvaliddos"),
+ new KeyStruct(Major.FileSource, Minor.SrcNTFS, "fvalidntfs"),
+ new KeyStruct(Major.FileSource, Minor.SrcHPFS, "fvalidhpfs"),
+ new KeyStruct(Major.FileSource, Minor.SrcNetwork, "fnetwork"),
+ new KeyStruct(Major.ColorName, Minor.Red, "red"),
+ new KeyStruct(Major.ColorName, Minor.Green, "green"),
+ new KeyStruct(Major.ColorName, Minor.Blue, "blue"),
+ new KeyStruct(Major.CharSet, Minor.MacCharSet, "mac"),
+ new KeyStruct(Major.CharSet, Minor.AnsiCharSet, "ansi"),
+ new KeyStruct(Major.CharSet, Minor.PcCharSet, "pc"),
+ new KeyStruct(Major.CharSet, Minor.PcaCharSet, "pca"),
+ new KeyStruct(Major.TblAttr, Minor.RowDef, "trowd"),
+ new KeyStruct(Major.TblAttr, Minor.RowGapH, "trgaph"),
+ new KeyStruct(Major.TblAttr, Minor.CellPos, "cellx"),
+ new KeyStruct(Major.TblAttr, Minor.MergeRngFirst, "clmgf"),
+ new KeyStruct(Major.TblAttr, Minor.MergePrevious, "clmrg"),
+ new KeyStruct(Major.TblAttr, Minor.RowLeft, "trql"),
+ new KeyStruct(Major.TblAttr, Minor.RowRight, "trqr"),
+ new KeyStruct(Major.TblAttr, Minor.RowCenter, "trqc"),
+ new KeyStruct(Major.TblAttr, Minor.RowLeftEdge, "trleft"),
+ new KeyStruct(Major.TblAttr, Minor.RowHt, "trrh"),
+ new KeyStruct(Major.TblAttr, Minor.RowHeader, "trhdr"),
+ new KeyStruct(Major.TblAttr, Minor.RowKeep, "trkeep"),
+ new KeyStruct(Major.TblAttr, Minor.RTLRow, "rtlrow"),
+ new KeyStruct(Major.TblAttr, Minor.LTRRow, "ltrrow"),
+ new KeyStruct(Major.TblAttr, Minor.RowBordTop, "trbrdrt"),
+ new KeyStruct(Major.TblAttr, Minor.RowBordLeft, "trbrdrl"),
+ new KeyStruct(Major.TblAttr, Minor.RowBordBottom, "trbrdrb"),
+ new KeyStruct(Major.TblAttr, Minor.RowBordRight, "trbrdrr"),
+ new KeyStruct(Major.TblAttr, Minor.RowBordHoriz, "trbrdrh"),
+ new KeyStruct(Major.TblAttr, Minor.RowBordVert, "trbrdrv"),
+ new KeyStruct(Major.TblAttr, Minor.CellBordBottom, "clbrdrb"),
+ new KeyStruct(Major.TblAttr, Minor.CellBordTop, "clbrdrt"),
+ new KeyStruct(Major.TblAttr, Minor.CellBordLeft, "clbrdrl"),
+ new KeyStruct(Major.TblAttr, Minor.CellBordRight, "clbrdrr"),
+ new KeyStruct(Major.TblAttr, Minor.CellShading, "clshdng"),
+ new KeyStruct(Major.TblAttr, Minor.CellBgPatH, "clbghoriz"),
+ new KeyStruct(Major.TblAttr, Minor.CellBgPatV, "clbgvert"),
+ new KeyStruct(Major.TblAttr, Minor.CellFwdDiagBgPat, "clbgfdiag"),
+ new KeyStruct(Major.TblAttr, Minor.CellBwdDiagBgPat, "clbgbdiag"),
+ new KeyStruct(Major.TblAttr, Minor.CellHatchBgPat, "clbgcross"),
+ new KeyStruct(Major.TblAttr, Minor.CellDiagHatchBgPat, "clbgdcross"),
+ new KeyStruct(Major.TblAttr, Minor.CellDarkBgPatH, "clbgdkhoriz"),
+ new KeyStruct(Major.TblAttr, Minor.CellDarkBgPatH, "clbgdkhor"),
+ new KeyStruct(Major.TblAttr, Minor.CellDarkBgPatV, "clbgdkvert"),
+ new KeyStruct(Major.TblAttr, Minor.CellFwdDarkBgPat, "clbgdkfdiag"),
+ new KeyStruct(Major.TblAttr, Minor.CellBwdDarkBgPat, "clbgdkbdiag"),
+ new KeyStruct(Major.TblAttr, Minor.CellDarkHatchBgPat, "clbgdkcross"),
+ new KeyStruct(Major.TblAttr, Minor.CellDarkDiagHatchBgPat, "clbgdkdcross"),
+ new KeyStruct(Major.TblAttr, Minor.CellBgPatLineColor, "clcfpat"),
+ new KeyStruct(Major.TblAttr, Minor.CellBgPatColor, "clcbpat"),
+ new KeyStruct(Major.FieldAttr, Minor.FieldDirty, "flddirty"),
+ new KeyStruct(Major.FieldAttr, Minor.FieldEdited, "fldedit"),
+ new KeyStruct(Major.FieldAttr, Minor.FieldLocked, "fldlock"),
+ new KeyStruct(Major.FieldAttr, Minor.FieldPrivate, "fldpriv"),
+ new KeyStruct(Major.FieldAttr, Minor.FieldAlt, "fldalt"),
+ new KeyStruct(Major.PosAttr, Minor.AbsWid, "absw"),
+ new KeyStruct(Major.PosAttr, Minor.AbsHt, "absh"),
+ new KeyStruct(Major.PosAttr, Minor.RPosMargH, "phmrg"),
+ new KeyStruct(Major.PosAttr, Minor.RPosPageH, "phpg"),
+ new KeyStruct(Major.PosAttr, Minor.RPosColH, "phcol"),
+ new KeyStruct(Major.PosAttr, Minor.PosX, "posx"),
+ new KeyStruct(Major.PosAttr, Minor.PosNegX, "posnegx"),
+ new KeyStruct(Major.PosAttr, Minor.PosXCenter, "posxc"),
+ new KeyStruct(Major.PosAttr, Minor.PosXInside, "posxi"),
+ new KeyStruct(Major.PosAttr, Minor.PosXOutSide, "posxo"),
+ new KeyStruct(Major.PosAttr, Minor.PosXRight, "posxr"),
+ new KeyStruct(Major.PosAttr, Minor.PosXLeft, "posxl"),
+ new KeyStruct(Major.PosAttr, Minor.RPosMargV, "pvmrg"),
+ new KeyStruct(Major.PosAttr, Minor.RPosPageV, "pvpg"),
+ new KeyStruct(Major.PosAttr, Minor.RPosParaV, "pvpara"),
+ new KeyStruct(Major.PosAttr, Minor.PosY, "posy"),
+ new KeyStruct(Major.PosAttr, Minor.PosNegY, "posnegy"),
+ new KeyStruct(Major.PosAttr, Minor.PosYInline, "posyil"),
+ new KeyStruct(Major.PosAttr, Minor.PosYTop, "posyt"),
+ new KeyStruct(Major.PosAttr, Minor.PosYCenter, "posyc"),
+ new KeyStruct(Major.PosAttr, Minor.PosYBottom, "posyb"),
+ new KeyStruct(Major.PosAttr, Minor.NoWrap, "nowrap"),
+ new KeyStruct(Major.PosAttr, Minor.DistFromTextAll, "dxfrtext"),
+ new KeyStruct(Major.PosAttr, Minor.DistFromTextX, "dfrmtxtx"),
+ new KeyStruct(Major.PosAttr, Minor.DistFromTextY, "dfrmtxty"),
+ new KeyStruct(Major.PosAttr, Minor.TextDistY, "dyfrtext"),
+ new KeyStruct(Major.PosAttr, Minor.DropCapLines, "dropcapli"),
+ new KeyStruct(Major.PosAttr, Minor.DropCapType, "dropcapt"),
+ new KeyStruct(Major.ObjAttr, Minor.ObjEmb, "objemb"),
+ new KeyStruct(Major.ObjAttr, Minor.ObjLink, "objlink"),
+ new KeyStruct(Major.ObjAttr, Minor.ObjAutoLink, "objautlink"),
+ new KeyStruct(Major.ObjAttr, Minor.ObjSubscriber, "objsub"),
+ new KeyStruct(Major.ObjAttr, Minor.ObjPublisher, "objpub"),
+ new KeyStruct(Major.ObjAttr, Minor.ObjICEmb, "objicemb"),
+ new KeyStruct(Major.ObjAttr, Minor.ObjLinkSelf, "linkself"),
+ new KeyStruct(Major.ObjAttr, Minor.ObjLock, "objupdate"),
+ new KeyStruct(Major.ObjAttr, Minor.ObjUpdate, "objlock"),
+ new KeyStruct(Major.ObjAttr, Minor.ObjHt, "objh"),
+ new KeyStruct(Major.ObjAttr, Minor.ObjWid, "objw"),
+ new KeyStruct(Major.ObjAttr, Minor.ObjSetSize, "objsetsize"),
+ new KeyStruct(Major.ObjAttr, Minor.ObjAlign, "objalign"),
+ new KeyStruct(Major.ObjAttr, Minor.ObjTransposeY, "objtransy"),
+ new KeyStruct(Major.ObjAttr, Minor.ObjCropTop, "objcropt"),
+ new KeyStruct(Major.ObjAttr, Minor.ObjCropBottom, "objcropb"),
+ new KeyStruct(Major.ObjAttr, Minor.ObjCropLeft, "objcropl"),
+ new KeyStruct(Major.ObjAttr, Minor.ObjCropRight, "objcropr"),
+ new KeyStruct(Major.ObjAttr, Minor.ObjScaleX, "objscalex"),
+ new KeyStruct(Major.ObjAttr, Minor.ObjScaleY, "objscaley"),
+ new KeyStruct(Major.ObjAttr, Minor.ObjResRTF, "rsltrtf"),
+ new KeyStruct(Major.ObjAttr, Minor.ObjResPict, "rsltpict"),
+ new KeyStruct(Major.ObjAttr, Minor.ObjResBitmap, "rsltbmp"),
+ new KeyStruct(Major.ObjAttr, Minor.ObjResText, "rslttxt"),
+ new KeyStruct(Major.ObjAttr, Minor.ObjResMerge, "rsltmerge"),
+ new KeyStruct(Major.ObjAttr, Minor.ObjBookmarkPubObj, "bkmkpub"),
+ new KeyStruct(Major.ObjAttr, Minor.ObjPubAutoUpdate, "pubauto"),
+ new KeyStruct(Major.ACharAttr, Minor.ACBold, "ab"),
+ new KeyStruct(Major.ACharAttr, Minor.ACAllCaps, "caps"),
+ new KeyStruct(Major.ACharAttr, Minor.ACForeColor, "acf"),
+ new KeyStruct(Major.ACharAttr, Minor.ACSubScript, "adn"),
+ new KeyStruct(Major.ACharAttr, Minor.ACExpand, "aexpnd"),
+ new KeyStruct(Major.ACharAttr, Minor.ACFontNum, "af"),
+ new KeyStruct(Major.ACharAttr, Minor.ACFontSize, "afs"),
+ new KeyStruct(Major.ACharAttr, Minor.ACItalic, "ai"),
+ new KeyStruct(Major.ACharAttr, Minor.ACLanguage, "alang"),
+ new KeyStruct(Major.ACharAttr, Minor.ACOutline, "aoutl"),
+ new KeyStruct(Major.ACharAttr, Minor.ACSmallCaps, "ascaps"),
+ new KeyStruct(Major.ACharAttr, Minor.ACShadow, "ashad"),
+ new KeyStruct(Major.ACharAttr, Minor.ACStrikeThru, "astrike"),
+ new KeyStruct(Major.ACharAttr, Minor.ACUnderline, "aul"),
+ new KeyStruct(Major.ACharAttr, Minor.ACDotUnderline, "auld"),
+ new KeyStruct(Major.ACharAttr, Minor.ACDbUnderline, "auldb"),
+ new KeyStruct(Major.ACharAttr, Minor.ACNoUnderline, "aulnone"),
+ new KeyStruct(Major.ACharAttr, Minor.ACWordUnderline, "aulw"),
+ new KeyStruct(Major.ACharAttr, Minor.ACSuperScript, "aup"),
+ new KeyStruct(Major.FNoteAttr, Minor.FNAlt, "ftnalt"),
+ new KeyStruct(Major.KeyCodeAttr, Minor.AltKey, "alt"),
+ new KeyStruct(Major.KeyCodeAttr, Minor.ShiftKey, "shift"),
+ new KeyStruct(Major.KeyCodeAttr, Minor.ControlKey, "ctrl"),
+ new KeyStruct(Major.KeyCodeAttr, Minor.FunctionKey, "fn"),
+ new KeyStruct(Major.BookmarkAttr, Minor.BookmarkFirstCol, "bkmkcolf"),
+ new KeyStruct(Major.BookmarkAttr, Minor.BookmarkLastCol, "bkmkcoll"),
+ new KeyStruct(Major.IndexAttr, Minor.IndexNumber, "xef"),
+ new KeyStruct(Major.IndexAttr, Minor.IndexBold, "bxe"),
+ new KeyStruct(Major.IndexAttr, Minor.IndexItalic, "ixe"),
+ new KeyStruct(Major.TOCAttr, Minor.TOCType, "tcf"),
+ new KeyStruct(Major.TOCAttr, Minor.TOCLevel, "tcl"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawLock, "dolock"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawPageRelX, "doxpage"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawColumnRelX, "dobxcolumn"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawMarginRelX, "dobxmargin"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawPageRelY, "dobypage"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawColumnRelY, "dobycolumn"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawMarginRelY, "dobymargin"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawHeight, "dobhgt"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawBeginGroup, "dpgroup"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawGroupCount, "dpcount"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawEndGroup, "dpendgroup"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawArc, "dparc"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawCallout, "dpcallout"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawEllipse, "dpellipse"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawLine, "dpline"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawPolygon, "dppolygon"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawPolyLine, "dppolyline"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawRect, "dprect"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawTextBox, "dptxbx"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawOffsetX, "dpx"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawSizeX, "dpxsize"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawOffsetY, "dpy"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawSizeY, "dpysize"),
+ new KeyStruct(Major.DrawAttr, Minor.COAngle, "dpcoa"),
+ new KeyStruct(Major.DrawAttr, Minor.COAccentBar, "dpcoaccent"),
+ new KeyStruct(Major.DrawAttr, Minor.COBestFit, "dpcobestfit"),
+ new KeyStruct(Major.DrawAttr, Minor.COBorder, "dpcoborder"),
+ new KeyStruct(Major.DrawAttr, Minor.COAttachAbsDist, "dpcodabs"),
+ new KeyStruct(Major.DrawAttr, Minor.COAttachBottom, "dpcodbottom"),
+ new KeyStruct(Major.DrawAttr, Minor.COAttachCenter, "dpcodcenter"),
+ new KeyStruct(Major.DrawAttr, Minor.COAttachTop, "dpcodtop"),
+ new KeyStruct(Major.DrawAttr, Minor.COLength, "dpcolength"),
+ new KeyStruct(Major.DrawAttr, Minor.CONegXQuadrant, "dpcominusx"),
+ new KeyStruct(Major.DrawAttr, Minor.CONegYQuadrant, "dpcominusy"),
+ new KeyStruct(Major.DrawAttr, Minor.COOffset, "dpcooffset"),
+ new KeyStruct(Major.DrawAttr, Minor.COAttachSmart, "dpcosmarta"),
+ new KeyStruct(Major.DrawAttr, Minor.CODoubleLine, "dpcotdouble"),
+ new KeyStruct(Major.DrawAttr, Minor.CORightAngle, "dpcotright"),
+ new KeyStruct(Major.DrawAttr, Minor.COSingleLine, "dpcotsingle"),
+ new KeyStruct(Major.DrawAttr, Minor.COTripleLine, "dpcottriple"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawTextBoxMargin, "dptxbxmar"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawTextBoxText, "dptxbxtext"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawRoundRect, "dproundr"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawPointX, "dpptx"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawPointY, "dppty"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawPolyCount, "dppolycount"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawArcFlipX, "dparcflipx"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawArcFlipY, "dparcflipy"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawLineBlue, "dplinecob"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawLineGreen, "dplinecog"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawLineRed, "dplinecor"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawLinePalette, "dplinepal"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawLineDashDot, "dplinedado"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawLineDashDotDot, "dplinedadodo"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawLineDash, "dplinedash"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawLineDot, "dplinedot"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawLineGray, "dplinegray"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawLineHollow, "dplinehollow"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawLineSolid, "dplinesolid"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawLineWidth, "dplinew"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawHollowEndArrow, "dpaendhol"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawEndArrowLength, "dpaendl"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawSolidEndArrow, "dpaendsol"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawEndArrowWidth, "dpaendw"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawHollowStartArrow,"dpastarthol"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawStartArrowLength,"dpastartl"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawSolidStartArrow, "dpastartsol"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawStartArrowWidth, "dpastartw"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawBgFillBlue, "dpfillbgcb"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawBgFillGreen, "dpfillbgcg"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawBgFillRed, "dpfillbgcr"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawBgFillPalette, "dpfillbgpal"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawBgFillGray, "dpfillbggray"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawFgFillBlue, "dpfillfgcb"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawFgFillGreen, "dpfillfgcg"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawFgFillRed, "dpfillfgcr"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawFgFillPalette, "dpfillfgpal"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawFgFillGray, "dpfillfggray"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawFillPatIndex, "dpfillpat"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawShadow, "dpshadow"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawShadowXOffset, "dpshadx"),
+ new KeyStruct(Major.DrawAttr, Minor.DrawShadowYOffset, "dpshady"),
+ new KeyStruct(Major.Version, Minor.Undefined, "rtf"),
+ new KeyStruct(Major.DefFont, Minor.Undefined, "deff"),
+ new KeyStruct(Major.Unicode, Minor.UnicodeCharBytes, "uc"),
+ new KeyStruct(Major.Unicode, Minor.UnicodeChar, "u"),
+ new KeyStruct(Major.Unicode, Minor.UnicodeDestination, "ud"),
+ new KeyStruct(Major.Unicode, Minor.UnicodeDualDestination, "upr"),
+ new KeyStruct(Major.Unicode, Minor.UnicodeAnsiCodepage, "ansicpg"),
+ };
+ }
+ }
+}
\ No newline at end of file
Property changes on: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/KeysInit.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Major.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Major.cs 2005-09-05 23:57:52 UTC (rev 49517)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Major.cs 2005-09-06 01:38:50 UTC (rev 49518)
@@ -0,0 +1,67 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
+//
+// Authors:
+// Peter Bartok (pbartok at novell.com)
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms.RTF {
+ internal enum Major {
+ // Group class
+ BeginGroup = 0,
+ EndGroup = 1,
+
+ // Control
+ Version = 0,
+ DefFont = 1,
+ CharSet = 2,
+
+ Destination = 3,
+ FontFamily = 4,
+ ColorName = 5,
+ SpecialChar = 6,
+ StyleAttr = 7,
+ DocAttr = 8,
+ SectAttr = 9,
+ TblAttr = 10,
+ ParAttr = 11,
+ CharAttr = 12,
+ PictAttr = 13,
+ BookmarkAttr = 14,
+ NeXTGrAttr = 15,
+ FieldAttr = 16,
+ TOCAttr = 17,
+ PosAttr = 18,
+ ObjAttr = 19,
+ FNoteAttr = 20,
+ KeyCodeAttr = 21,
+ ACharAttr = 22,
+ FontAttr = 23,
+ FileAttr = 24,
+ FileSource = 25,
+ DrawAttr = 26,
+ IndexAttr = 27,
+ Unicode = 28
+ }
+}
Property changes on: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Major.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Minor.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Minor.cs 2005-09-05 23:57:52 UTC (rev 49517)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Minor.cs 2005-09-06 01:38:50 UTC (rev 49518)
@@ -0,0 +1,765 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
+//
+// Authors:
+// Peter Bartok (pbartok at novell.com)
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+ internal enum Minor {
+ Undefined = -1,
+
+ // Major.CharSet
+ AnsiCharSet = 0,
+ MacCharSet = 1,
+ PcCharSet = 2,
+ PcaCharSet = 3,
+
+ // Major.Destination
+ FontTbl = 0,
+ FontAltName = 1,
+ EmbeddedFont = 2,
+ FontFile = 3,
+ FileTbl = 4,
+ FileInfo = 5,
+ ColorTbl = 6,
+ StyleSheet = 7,
+ KeyCode = 8,
+ RevisionTbl = 9,
+ Info = 10,
+ ITitle = 11,
+ ISubject = 12,
+ IAuthor = 13,
+ IOperator = 14,
+ IKeywords = 15,
+ IComment = 16,
+ IVersion = 17,
+ IDoccomm = 18,
+ IVerscomm = 19,
+ NextFile = 20,
+ Template = 21,
+ FNSep = 22,
+ FNContSep = 23,
+ FNContNotice = 24,
+ ENSep = 25,
+ ENContSep = 26,
+ ENContNotice = 27,
+ PageNumLevel = 28,
+ ParNumLevelStyle= 29,
+ Header = 30,
+ Footer = 31,
+ HeaderLeft = 32,
+ HeaderRight = 33,
+ HeaderFirst = 34,
+ FooterLeft = 35,
+ FooterRight = 36,
+ FooterFirst = 37,
+ ParNumText = 38,
+ ParNumbering = 39,
+ ParNumTextAfter = 40,
+ ParNumTextBefore= 41,
+ BookmarkStart = 42,
+ BookmarkEnd = 43,
+ Pict = 44,
+ Object = 45,
+ ObjClass = 46,
+ ObjName = 47,
+ ObjTime = 48,
+ ObjData = 49,
+ ObjAlias = 50,
+ ObjSection = 51,
+ ObjResult = 52,
+ ObjItem = 53,
+ ObjTopic = 54,
+ DrawObject = 55,
+ Footnote = 56,
+ AnnotRefStart = 57,
+ AnnotRefEnd = 58,
+ AnnotID = 59,
+ AnnotAuthor = 60,
+ Annotation = 61,
+ AnnotRef = 62,
+ AnnotTime = 63,
+ AnnotIcon = 64,
+ Field = 65,
+ FieldInst = 66,
+ FieldResult = 67,
+ DataField = 68,
+ Index = 69,
+ IndexText = 70,
+ IndexRange = 71,
+ TOC = 72,
+ NeXTGraphic = 73,
+ MaxDestination = 74,
+
+ // Major.FontFamily
+ FFNil = 0,
+ FFRoman = 1,
+ FFSwiss = 2,
+ FFModern = 3,
+ FFScript = 4,
+ FFDecor = 5,
+ FFTech = 6,
+ FFBidirectional = 7,
+
+ // Major.ColorName
+ Red = 0,
+ Green = 1,
+ Blue = 2,
+
+ // Major.SpecialChar
+ IIntVersion = 0,
+ ICreateTime = 1,
+ IRevisionTime = 2,
+ IPrintTime = 3,
+ IBackupTime = 4,
+ IEditTime = 5,
+ IYear = 6,
+ IMonth = 7,
+ IDay = 8,
+ IHour = 9,
+ IMinute = 10,
+ ISecond = 11,
+ INPages = 12,
+ INWords = 13,
+ INChars = 14,
+ IIntID = 15,
+ CurHeadDate = 16,
+ CurHeadDateLong = 17,
+ CurHeadDateAbbrev= 18,
+ CurHeadTime = 19,
+ CurHeadPage = 20,
+ SectNum = 21,
+ CurFNote = 22,
+ CurAnnotRef = 23,
+ FNoteSep = 24,
+ FNoteCont = 25,
+ Cell = 26,
+ Row = 27,
+ Par = 28,
+ Sect = 29,
+ Page = 30,
+ Column = 31,
+ Line = 32,
+ SoftPage = 33,
+ SoftColumn = 34,
+ SoftLine = 35,
+ SoftLineHt = 36,
+ Tab = 37,
+ EmDash = 38,
+ EnDash = 39,
+ EmSpace = 40,
+ EnSpace = 41,
+ Bullet = 42,
+ LQuote = 43,
+ RQuote = 44,
+ LDblQuote = 45,
+ RDblQuote = 46,
+ Formula = 47,
+ NoBrkSpace = 49,
+ NoReqHyphen = 50,
+ NoBrkHyphen = 51,
+ OptDest = 52,
+ LTRMark = 53,
+ RTLMark = 54,
+ NoWidthJoiner = 55,
+ NoWidthNonJoiner= 56,
+ CurHeadPict = 57,
+
+ // Major.StyleAttr
+ Additive = 0,
+ BasedOn = 1,
+ Next = 2,
+
+ // Major.DocAttr
+ DefTab = 0,
+ HyphHotZone = 1,
+ HyphConsecLines = 2,
+ HyphCaps = 3,
+ HyphAuto = 4,
+ LineStart = 5,
+ FracWidth = 6,
+ MakeBackup = 7,
+ RTFDefault = 8,
+ PSOverlay = 9,
+ DocTemplate = 10,
+ DefLanguage = 11,
+ FENoteType = 12,
+ FNoteEndSect = 13,
+ FNoteEndDoc = 14,
+ FNoteText = 15,
+ FNoteBottom = 16,
+ ENoteEndSect = 17,
+ ENoteEndDoc = 18,
+ ENoteText = 19,
+ ENoteBottom = 20,
+ FNoteStart = 21,
+ ENoteStart = 22,
+ FNoteRestartPage= 23,
+ FNoteRestart = 24,
+ FNoteRestartCont= 25,
+ ENoteRestart = 26,
+ ENoteRestartCont= 27,
+ FNoteNumArabic = 28,
+ FNoteNumLLetter = 29,
+ FNoteNumULetter = 30,
+ FNoteNumLRoman = 31,
+ FNoteNumURoman = 32,
+ FNoteNumChicago = 33,
+ ENoteNumArabic = 34,
+ ENoteNumLLetter = 35,
+ ENoteNumULetter = 36,
+ ENoteNumLRoman = 37,
+ ENoteNumURoman = 38,
+ ENoteNumChicago = 39,
+ PaperWidth = 40,
+ PaperHeight = 41,
+ PaperSize = 42,
+ LeftMargin = 43,
+ RightMargin = 44,
+ TopMargin = 45,
+ BottomMargin = 46,
+ FacingPage = 47,
+ GutterWid = 48,
+ MirrorMargin = 49,
+ Landscape = 50,
+ PageStart = 51,
+ WidowCtrl = 52,
+ LinkStyles = 53,
+ NoAutoTabIndent = 54,
+ WrapSpaces = 55,
+ PrintColorsBlack= 56,
+ NoExtraSpaceRL = 57,
+ NoColumnBalance = 58,
+ CvtMailMergeQuote= 59,
+ SuppressTopSpace= 60,
+ SuppressPreParSpace= 61,
+ CombineTblBorders= 62,
+ TranspMetafiles = 63,
+ SwapBorders = 64,
+ ShowHardBreaks = 65,
+ FormProtected = 66,
+ AllProtected = 67,
+ FormShading = 68,
+ FormDisplay = 69,
+ PrintData = 70,
+ RevProtected = 71,
+ Revisions = 72,
+ RevDisplay = 73,
+ RevBar = 74,
+ AnnotProtected = 75,
+ RTLDoc = 76,
+ LTRDoc = 77,
+
+ // Major.SectAttr
+
+ SectDef = 0,
+ ENoteHere = 1,
+ PrtBinFirst = 2,
+ PrtBin = 3,
+ SectStyleNum = 4,
+ NoBreak = 5,
+ ColBreak = 6,
+ PageBreak = 7,
+ EvenBreak = 8,
+ OddBreak = 9,
+ Columns = 10,
+ ColumnSpace = 11,
+ ColumnNumber = 12,
+ ColumnSpRight = 13,
+ ColumnWidth = 14,
+ ColumnLine = 15,
+ LineModulus = 16,
+ LineDist = 17,
+ LineStarts = 18,
+ LineRestart = 19,
+ LineRestartPg = 20,
+ LineCont = 21,
+ SectPageWid = 22,
+ SectPageHt = 23,
+ SectMarginLeft = 24,
+ SectMarginRight = 25,
+ SectMarginTop = 26,
+ SectMarginBottom= 27,
+ SectMarginGutter= 28,
+ SectLandscape = 29,
+ TitleSpecial = 30,
+ HeaderY = 31,
+ FooterY = 32,
+ PageStarts = 33,
+ PageCont = 34,
+ PageRestart = 35,
+ PageNumRight = 36,
+ PageNumTop = 37,
+ PageDecimal = 38,
+ PageURoman = 39,
+ PageLRoman = 40,
+ PageULetter = 41,
+ PageLLetter = 42,
+ PageNumHyphSep = 43,
+ PageNumSpaceSep = 44,
+ PageNumColonSep = 45,
+ PageNumEmdashSep= 46,
+ PageNumEndashSep= 47,
+ TopVAlign = 48,
+ BottomVAlign = 49,
+ CenterVAlign = 50,
+ JustVAlign = 51,
+ RTLSect = 52,
+ LTRSect = 53,
+
+ // Major.TblAttr
+ RowDef = 0,
+ RowGapH = 1,
+ CellPos = 2,
+ MergeRngFirst = 3,
+ MergePrevious = 4,
+ RowLeft = 5,
+ RowRight = 6,
+ RowCenter = 7,
+ RowLeftEdge = 8,
+ RowHt = 9,
+ RowHeader = 10,
+ RowKeep = 11,
+ RTLRow = 12,
+ LTRRow = 13,
+ RowBordTop = 14,
+ RowBordLeft = 15,
+ RowBordBottom = 16,
+ RowBordRight = 17,
+ RowBordHoriz = 18,
+ RowBordVert = 19,
+ CellBordBottom = 20,
+ CellBordTop = 21,
+ CellBordLeft = 22,
+ CellBordRight = 23,
+ CellShading = 24,
+ CellBgPatH = 25,
+ CellBgPatV = 26,
+ CellFwdDiagBgPat= 27,
+ CellBwdDiagBgPat= 28,
+ CellHatchBgPat = 29,
+ CellDiagHatchBgPat = 30,
+ CellDarkBgPatH = 31,
+ CellDarkBgPatV = 32,
+ CellFwdDarkBgPat= 33,
+ CellBwdDarkBgPat= 34,
+ CellDarkHatchBgPat = 35,
+ CellDarkDiagHatchBgPat = 36,
+ CellBgPatLineColor = 37,
+ CellBgPatColor = 38,
+
+ // Major.ParAttr
+ ParDef = 0,
+ StyleNum = 1,
+ Hyphenate = 2,
+ InTable = 3,
+ Keep = 4,
+ NoWidowControl = 5,
+ KeepNext = 6,
+ OutlineLevel = 7,
+ NoLineNum = 8,
+ PBBefore = 9,
+ SideBySide = 10,
+ QuadLeft = 11,
+ QuadRight = 12,
+ QuadJust = 13,
+ QuadCenter = 14,
+ FirstIndent = 15,
+ LeftIndent = 16,
+ RightIndent = 17,
+ SpaceBefore = 18,
+ SpaceAfter = 19,
+ SpaceBetween = 20,
+ SpaceMultiply = 21,
+ SubDocument = 22,
+ RTLPar = 23,
+ LTRPar = 24,
+ TabPos = 25,
+ TabLeft = 26,
+ TabRight = 27,
+ TabCenter = 28,
+ TabDecimal = 29,
+ TabBar = 30,
+ LeaderDot = 31,
+ LeaderHyphen = 32,
+ LeaderUnder = 33,
+ LeaderThick = 34,
+ LeaderEqual = 35,
+ ParLevel = 36,
+ ParBullet = 37,
+ ParSimple = 38,
+ ParNumCont = 39,
+ ParNumOnce = 40,
+ ParNumAcross = 41,
+ ParHangIndent = 42,
+ ParNumRestart = 43,
+ ParNumCardinal = 44,
+ ParNumDecimal = 45,
+ ParNumULetter = 46,
+ ParNumURoman = 47,
+ ParNumLLetter = 48,
+ ParNumLRoman = 49,
+ ParNumOrdinal = 50,
+ ParNumOrdinalText= 51,
+ ParNumBold = 52,
+ ParNumItalic = 53,
+ ParNumAllCaps = 54,
+ ParNumSmallCaps = 55,
+ ParNumUnder = 56,
+ ParNumDotUnder = 57,
+ ParNumDbUnder = 58,
+ ParNumNoUnder = 59,
+ ParNumWordUnder = 60,
+ ParNumStrikethru= 61,
+ ParNumForeColor = 62,
+ ParNumFont = 63,
+ ParNumFontSize = 64,
+ ParNumIndent = 65,
+ ParNumSpacing = 66,
+ ParNumInclPrev = 67,
+ ParNumCenter = 68,
+ ParNumLeft = 69,
+ ParNumRight = 70,
+ ParNumStartAt = 71,
+ BorderTop = 72,
+ BorderBottom = 73,
+ BorderLeft = 74,
+ BorderRight = 75,
+ BorderBetween = 76,
+ BorderBar = 77,
+ BorderBox = 78,
+ BorderSingle = 79,
+ BorderThick = 80,
+ BorderShadow = 81,
+ BorderDouble = 82,
+ BorderDot = 83,
+ BorderDash = 84,
+ BorderHair = 85,
+ BorderWidth = 86,
+ BorderColor = 87,
+ BorderSpace = 88,
+ Shading = 89,
+ BgPatH = 90,
+ BgPatV = 91,
+ FwdDiagBgPat = 92,
+ BwdDiagBgPat = 93,
+ HatchBgPat = 94,
+ DiagHatchBgPat = 95,
+ DarkBgPatH = 96,
+ DarkBgPatV = 97,
+ FwdDarkBgPat = 98,
+ BwdDarkBgPat = 99,
+ DarkHatchBgPat = 100,
+ DarkDiagHatchBgPat= 101,
+ BgPatLineColor = 102,
+ BgPatColor = 103,
+
+ // Major.CharAttr
+ Plain = 0,
+ Bold = 1,
+ AllCaps = 2,
+ Deleted = 3,
+ SubScript = 4,
+ SubScrShrink = 5,
+ NoSuperSub = 6,
+ Expand = 7,
+ ExpandTwips = 8,
+ Kerning = 9,
+ FontNum = 10,
+ FontSize = 11,
+ Italic = 12,
+ Outline = 13,
+ Revised = 14,
+ RevAuthor = 15,
+ RevDTTM = 16,
+ SmallCaps = 17,
+ Shadow = 18,
+ StrikeThru = 19,
+ Underline = 20,
+ DotUnderline = 21,
+ DbUnderline = 22,
+ NoUnderline = 23,
+ WordUnderline = 24,
+ SuperScript = 25,
+ SuperScrShrink = 26,
+ Invisible = 27,
+ ForeColor = 28,
+ BackColor = 29,
+ RTLChar = 30,
+ LTRChar = 31,
+ CharStyleNum = 32,
+ CharCharSet = 33,
+ Language = 34,
+ Gray = 35,
+
+ // Major.PictAttr
+ MacQD = 0,
+ PMMetafile = 1,
+ WinMetafile = 2,
+ DevIndBitmap = 3,
+ WinBitmap = 4,
+ PixelBits = 5,
+ BitmapPlanes = 6,
+ BitmapWid = 7,
+ PicWid = 8,
+ PicHt = 9,
+ PicGoalWid = 10,
+ PicGoalHt = 11,
+ PicScaleX = 12,
+ PicScaleY = 13,
+ PicScaled = 14,
+ PicCropTop = 15,
+ PicCropBottom = 16,
+ PicCropLeft = 17,
+ PicCropRight = 18,
+ PicMFHasBitmap = 19,
+ PicMFBitsPerPixel= 20,
+ PicBinary = 21,
+
+ // Major.BookmarkAttr
+ BookmarkFirstCol= 0,
+ BookmarkLastCol = 1,
+
+ // Major.NeXTGrAttr
+ NeXTGWidth = 0,
+ NeXTGHeight = 1,
+
+ // Major.FieldAttr
+ FieldDirty = 0,
+ FieldEdited = 1,
+ FieldLocked = 2,
+ FieldPrivate = 3,
+ FieldAlt = 4,
+
+ // Major.TOCAttr
+ TOCType = 0,
+ TOCLevel = 1,
+
+ // Major.PosAttr
+ AbsWid = 0,
+ AbsHt = 1,
+ RPosMargH = 2,
+ RPosPageH = 3,
+ RPosColH = 4,
+ PosX = 5,
+ PosNegX = 6,
+ PosXCenter = 7,
+ PosXInside = 8,
+ PosXOutSide = 9,
+ PosXRight = 10,
+ PosXLeft = 11,
+ RPosMargV = 12,
+ RPosPageV = 13,
+ RPosParaV = 14,
+ PosY = 15,
+ PosNegY = 16,
+ PosYInline = 17,
+ PosYTop = 18,
+ PosYCenter = 19,
+ PosYBottom = 20,
+ NoWrap = 21,
+ DistFromTextAll = 22,
+ DistFromTextX = 23,
+ DistFromTextY = 24,
+ TextDistY = 25,
+ DropCapLines = 26,
+ DropCapType = 27,
+
+ // Major.ObjAttr
+ ObjEmb = 0,
+ ObjLink = 1,
+ ObjAutoLink = 2,
+ ObjSubscriber = 3,
+ ObjPublisher = 4,
+ ObjICEmb = 5,
+ ObjLinkSelf = 6,
+ ObjLock = 7,
+ ObjUpdate = 8,
+ ObjHt = 9,
+ ObjWid = 10,
+ ObjSetSize = 11,
+ ObjAlign = 12,
+ ObjTransposeY = 13,
+ ObjCropTop = 14,
+ ObjCropBottom = 15,
+ ObjCropLeft = 16,
+ ObjCropRight = 17,
+ ObjScaleX = 18,
+ ObjScaleY = 19,
+ ObjResRTF = 20,
+ ObjResPict = 21,
+ ObjResBitmap = 22,
+ ObjResText = 23,
+ ObjResMerge = 24,
+ ObjBookmarkPubObj= 25,
+ ObjPubAutoUpdate= 26,
+
+ // Major.FNoteAttr
+ FNAlt = 0,
+
+ // Major.KeyCodeAttr
+ AltKey = 0,
+ ShiftKey = 1,
+ ControlKey = 2,
+ FunctionKey = 3,
+
+ // Major.ACharAttr
+ ACBold = 0,
+ ACAllCaps = 1,
+ ACForeColor = 2,
+ ACSubScript = 3,
+ ACExpand = 4,
+ ACFontNum = 5,
+ ACFontSize = 6,
+ ACItalic = 7,
+ ACLanguage = 8,
+ ACOutline = 9,
+ ACSmallCaps = 10,
+ ACShadow = 11,
+ ACStrikeThru = 12,
+ ACUnderline = 13,
+ ACDotUnderline = 14,
+ ACDbUnderline = 15,
+ ACNoUnderline = 16,
+ ACWordUnderline = 17,
+ ACSuperScript = 18,
+
+ // Major.FontAttr
+ FontCharSet = 0,
+ FontPitch = 1,
+ FontCodePage = 2,
+ FTypeNil = 3,
+ FTypeTrueType = 4,
+
+ // Major.FileAttr
+ FileNum = 0,
+ FileRelPath = 1,
+ FileOSNum = 2,
+
+ // Major.FileSource
+ SrcMacintosh = 0,
+ SrcDOS = 1,
+ SrcNTFS = 2,
+ SrcHPFS = 3,
+ SrcNetwork = 4,
+
+ // Major.DrawAttr
+ DrawLock = 0,
+ DrawPageRelX = 1,
+ DrawColumnRelX = 2,
+ DrawMarginRelX = 3,
+ DrawPageRelY = 4,
+ DrawColumnRelY = 5,
+ DrawMarginRelY = 6,
+ DrawHeight = 7,
+ DrawBeginGroup = 8,
+ DrawGroupCount = 9,
+ DrawEndGroup = 10,
+ DrawArc = 11,
+ DrawCallout = 12,
+ DrawEllipse = 13,
+ DrawLine = 14,
+ DrawPolygon = 15,
+ DrawPolyLine = 16,
+ DrawRect = 17,
+ DrawTextBox = 18,
+ DrawOffsetX = 19,
+ DrawSizeX = 20,
+ DrawOffsetY = 21,
+ DrawSizeY = 22,
+ COAngle = 23,
+ COAccentBar = 24,
+ COBestFit = 25,
+ COBorder = 26,
+ COAttachAbsDist = 27,
+ COAttachBottom = 28,
+ COAttachCenter = 29,
+ COAttachTop = 30,
+ COLength = 31,
+ CONegXQuadrant = 32,
+ CONegYQuadrant = 33,
+ COOffset = 34,
+ COAttachSmart = 35,
+ CODoubleLine = 36,
+ CORightAngle = 37,
+ COSingleLine = 38,
+ COTripleLine = 39,
+ DrawTextBoxMargin= 40,
+ DrawTextBoxText = 41,
+ DrawRoundRect = 42,
+ DrawPointX = 43,
+ DrawPointY = 44,
+ DrawPolyCount = 45,
+ DrawArcFlipX = 46,
+ DrawArcFlipY = 47,
+ DrawLineBlue = 48,
+ DrawLineGreen = 49,
+ DrawLineRed = 50,
+ DrawLinePalette = 51,
+ DrawLineDashDot = 52,
+ DrawLineDashDotDot= 53,
+ DrawLineDash = 54,
+ DrawLineDot = 55,
+ DrawLineGray = 56,
+ DrawLineHollow = 57,
+ DrawLineSolid = 58,
+ DrawLineWidth = 59,
+ DrawHollowEndArrow = 60,
+ DrawEndArrowLength = 61,
+ DrawSolidEndArrow = 62,
+ DrawEndArrowWidth = 63,
+ DrawHollowStartArrow = 64,
+ DrawStartArrowLength = 65,
+ DrawSolidStartArrow = 66,
+ DrawStartArrowWidth = 67,
+ DrawBgFillBlue = 68,
+ DrawBgFillGreen = 69,
+ DrawBgFillRed = 70,
+ DrawBgFillPalette = 71,
+ DrawBgFillGray = 72,
+ DrawFgFillBlue = 73,
+ DrawFgFillGreen = 74,
+ DrawFgFillRed = 75,
+ DrawFgFillPalette = 76,
+ DrawFgFillGray = 77,
+ DrawFillPatIndex = 78,
+ DrawShadow = 79,
+ DrawShadowXOffset = 80,
+ DrawShadowYOffset = 81,
+
+ // Major.IndexAttr
+ IndexNumber = 0,
+ IndexBold = 1,
+ IndexItalic = 2,
+
+ // Major.Unicode
+ UnicodeCharBytes = 0,
+ UnicodeChar = 1,
+ UnicodeDestination = 2,
+ UnicodeDualDestination = 3,
+ UnicodeAnsiCodepage = 4
+
+ }
+}
Property changes on: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Minor.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/README
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/README 2005-09-05 23:57:52 UTC (rev 49517)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/README 2005-09-06 01:38:50 UTC (rev 49518)
@@ -0,0 +1,7 @@
+This RTF parser was originally based on a C-based RTF parser written
+by Paul DuBois (dubois at primate.wisc.edu). It came with the following license:
+
+ * This software may be redistributed without restriction and used for
+ * any purpose whatsoever.
+
+and was part of the code found in the 'rewind' project.
Added: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/RTF.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/RTF.cs 2005-09-05 23:57:52 UTC (rev 49517)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/RTF.cs 2005-09-06 01:38:50 UTC (rev 49518)
@@ -0,0 +1,874 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
+//
+// Authors:
+// Peter Bartok (pbartok at novell.com)
+//
+
+// COMPLETE
+
+#undef RTF_DEBUG
+
+using System;
+using System.Collections;
+using System.IO;
+using System.Text;
+
+namespace System.Windows.Forms.RTF {
+ internal class RTF {
+ #region Local Variables
+ internal const char EOF = unchecked((char)-1);
+ internal const int NoParam = -1000000;
+
+ private TokenClass rtf_class;
+ private Major major;
+ private Minor minor;
+ private int param;
+ private int format;
+ private StringBuilder text_buffer;
+ private int line_num;
+ private int line_pos;
+
+ private char pushed_char;
+ private StringBuilder pushed_text_buffer;
+ private TokenClass pushed_class;
+ private Major pushed_major;
+ private Minor pushed_minor;
+ private int pushed_param;
+
+ private char prev_char;
+ private bool bump_line;
+
+ private Font font_list;
+ private Color color_list;
+ private Style style_list;
+
+ private Charset cur_charset;
+ private Stack charset_stack;
+
+ private Style styles;
+ private Color colors;
+ private Font fonts;
+
+ private StreamReader source;
+
+ private static Hashtable key_table;
+ private static KeyStruct[] Keys = KeysInit.Init();
+
+ private DestinationCallback destination_callbacks;
+ private ClassCallback class_callbacks;
+ #endregion // Local Variables
+
+ #region Constructors
+ static RTF() {
+ key_table = new Hashtable(Keys.Length);
+ for (int i = 0; i < Keys.Length; i++) {
+ key_table[Keys[i].Symbol] = Keys[i];
+ }
+ }
+
+ public RTF(Stream stream) {
+ source = new StreamReader(stream);
+
+ text_buffer = new StringBuilder(1024);
+ pushed_text_buffer = new StringBuilder(1024);
+
+ rtf_class = TokenClass.None;
+ pushed_class = TokenClass.None;
+ pushed_char = unchecked((char)-1);
+
+ line_num = 0;
+ line_pos = 0;
+ prev_char = unchecked((char)-1);
+ bump_line = false;
+
+ cur_charset = new Charset();
+
+ destination_callbacks = new DestinationCallback();
+ class_callbacks = new ClassCallback();
+
+ destination_callbacks[Minor.FontTbl] = new DestinationDelegate(ReadFontTbl);
+ destination_callbacks[Minor.ColorTbl] = new DestinationDelegate(ReadColorTbl);
+ destination_callbacks[Minor.StyleSheet] = new DestinationDelegate(ReadStyleSheet);
+ destination_callbacks[Minor.Info] = new DestinationDelegate(ReadInfoGroup);
+ destination_callbacks[Minor.Pict] = new DestinationDelegate(ReadPictGroup);
+ destination_callbacks[Minor.Object] = new DestinationDelegate(ReadObjGroup);
+ }
+ #endregion // Constructors
+
+ #region Properties
+ public TokenClass TokenClass {
+ get {
+ return this.rtf_class;
+ }
+
+ set {
+ this.rtf_class = value;
+ }
+ }
+
+ public Major Major {
+ get {
+ return this.major;
+ }
+
+ set {
+ this.major = value;
+ }
+ }
+
+ public Minor Minor {
+ get {
+ return this.minor;
+ }
+
+ set {
+ this.minor = value;
+ }
+ }
+
+ public int Param {
+ get {
+ return this.param;
+ }
+
+ set {
+ this.param = value;
+ }
+ }
+
+ public string Text {
+ get {
+ return this.text_buffer.ToString();
+ }
+
+ set {
+ if (value == null) {
+ this.text_buffer.Length = 0;
+ } else {
+ this.text_buffer = new StringBuilder(value);
+ }
+ }
+ }
+
+ public Color Colors {
+ get {
+ return colors;
+ }
+
+ set {
+ colors = value;
+ }
+ }
+
+ public Style Styles {
+ get {
+ return styles;
+ }
+
+ set {
+ styles = value;
+ }
+ }
+
+ public Font Fonts {
+ get {
+ return fonts;
+ }
+
+ set {
+ fonts = value;
+ }
+ }
+
+ public ClassCallback ClassCallback {
+ get {
+ return class_callbacks;
+ }
+
+ set {
+ class_callbacks = value;
+ }
+ }
+
+ public DestinationCallback DestinationCallback {
+ get {
+ return destination_callbacks;
+ }
+
+ set {
+ destination_callbacks = value;
+ }
+ }
+
+ public int LineNumber {
+ get {
+ return line_num;
+ }
+ }
+
+ public int LinePos {
+ get {
+ return line_pos;
+ }
+ }
+ #endregion // Properties
+
+ #region Methods
+ /// <summary>Read the next character from the input</summary>
+ private char GetChar() {
+ char c;
+ bool old_bump_line;
+
+ if ((c = (char)source.Read()) != EOF) {
+ this.text_buffer.Append(c);
+ }
+
+ if (this.prev_char == EOF) {
+ this.bump_line = true;
+ }
+
+ old_bump_line = bump_line;
+ bump_line = false;
+
+ if (c == '\r') {
+ bump_line = true;
+ } else if (c == '\n') {
+ bump_line = true;
+ if (this.prev_char == '\r') {
+ old_bump_line = false;
+ }
+ }
+
+ this.line_pos ++;
+ if (old_bump_line) {
+ this.line_num++;
+ this.line_pos = 1;
+ }
+
+ this.prev_char = c;
+ return c;
+ }
+
+ /// <summary>Parse the RTF stream</summary>
+ public void Read() {
+ while (GetToken() != TokenClass.EOF) {
+ RouteToken();
+ }
+ }
+
+ /// <summary>Route a token</summary>
+ public void RouteToken() {
+ if (CheckCM(TokenClass.Control, Major.Destination)) {
+ DestinationDelegate d;
+
+ d = destination_callbacks[minor];
+ if (d != null) {
+ d(this);
+ }
+ }
+
+ // Invoke class callback if there is one
+ ClassDelegate c;
+
+ c = class_callbacks[rtf_class];
+ if (c != null) {
+ c(this);
+ }
+
+ }
+
+ /// <summary>Skip to the end of the current group</summary>
+ public void SkipGroup() {
+ int level;
+
+ level = 1;
+
+ while (GetToken() != TokenClass.EOF) {
+ if (rtf_class == TokenClass.Group) {
+ if (this.major == Major.BeginGroup) {
+ level++;
+ } else if (this.major == Major.EndGroup) {
+ level--;
+ if (level < 1) {
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ /// <summary>Return the next token in the stream</summary>
+ public TokenClass GetToken() {
+ if (pushed_class != TokenClass.None) {
+ this.rtf_class = this.pushed_class;
+ this.major = this.pushed_major;
+ this.minor = this.pushed_minor;
+ this.param = this.pushed_param;
+ this.pushed_class = TokenClass.None;
+ return this.rtf_class;
+ }
+
+ GetToken2();
+
+ if (this.rtf_class == TokenClass.Text) {
+ this.minor = (Minor)this.cur_charset[(int)this.major];
+ }
+
+ if (this.cur_charset.Flags == CharsetFlags.None) {
+ return this.rtf_class;
+ }
+
+ if (((this.cur_charset.Flags & CharsetFlags.Read) != 0) && CheckCM(TokenClass.Control, Major.CharSet)) {
+ this.cur_charset.ReadMap();
+ } else if (((this.cur_charset.Flags & CharsetFlags.Switch) != 0) && CheckCMM(TokenClass.Control, Major.CharAttr, Minor.FontNum)) {
+ Font fp;
+
+ fp = Font.GetFont(this.font_list, this.param);
+
+ if (fp != null) {
+ if (fp.Name.StartsWith("Symbol")) {
+ this.cur_charset.ID = CharsetType.Symbol;
+ } else {
+ this.cur_charset.ID = CharsetType.General;
+ }
+ } else if (((this.cur_charset.Flags & CharsetFlags.Switch) != 0) && (this.rtf_class == TokenClass.Group)) {
+ switch(this.major) {
+ case Major.BeginGroup: {
+ this.charset_stack.Push(this.cur_charset);
+ break;
+ }
+
+ case Major.EndGroup: {
+ this.cur_charset = (Charset)this.charset_stack.Pop();
+ break;
+ }
+ }
+ }
+ }
+
+ return this.rtf_class;
+ }
+
+ private void GetToken2() {
+ char c;
+ int sign;
+
+ this.rtf_class = TokenClass.Unknown;
+ this.param = NoParam;
+
+ this.text_buffer.Length = 0;
+
+ if (this.pushed_char != EOF) {
+ c = this.pushed_char;
+ this.text_buffer.Append(c);
+ this.pushed_char = EOF;
+ } else if ((c = GetChar()) == EOF) {
+ this.rtf_class = TokenClass.EOF;
+ return;
+ }
+
+ if (c == '{') {
+ this.rtf_class = TokenClass.Group;
+ this.major = Major.BeginGroup;
+ return;
+ }
+
+ if (c == '}') {
+ this.rtf_class = TokenClass.Group;
+ this.major = Major.EndGroup;
+ return;
+ }
+
+ if (c != '\\') {
+ if (c != '\t') {
+ this.rtf_class = TokenClass.Text;
+ this.major = (Major)c; // FIXME - typing?
+ return;
+ } else {
+ this.rtf_class = TokenClass.Control;
+ this.major = Major.SpecialChar;
+ this.minor = Minor.Tab;
+ return;
+ }
+ }
+
+ if ((c = GetChar()) == EOF) {
+ // Not so good
+ return;
+ }
+
+ if (!Char.IsLetter(c)) {
+ if (c == '\'') {
+ char c2;
+
+ if ((c = GetChar()) == EOF) {
+ return;
+ }
+
+ if ((c2 = GetChar()) == EOF) {
+ return;
+ }
+
+ this.rtf_class = TokenClass.Text;
+ this.major = (Major)((Char)((Convert.ToByte(c.ToString(), 16) * 16 + Convert.ToByte(c2.ToString(), 16))));
+ return;
+ }
+
+ // Escaped char
+ if (c == ':' || c == '{' || c == '}' || c == '\\') {
+ this.rtf_class = TokenClass.Text;
+ this.major = (Major)c;
+ return;
+ }
+
+ Lookup(this.text_buffer.ToString());
+ return;
+ }
+
+ while (Char.IsLetter(c)) {
+ if ((c = GetChar()) == EOF) {
+ break;
+ }
+ }
+
+ if (c != EOF) {
+ this.text_buffer.Length--;
+ }
+
+ Lookup(this.text_buffer.ToString());
+
+ if (c != EOF) {
+ this.text_buffer.Append(c);
+ }
+
+ sign = 1;
+ if (c == '-') {
+ sign = -1;
+ c = GetChar();
+ }
+
+ if (c != EOF && Char.IsDigit(c)) {
+ this.param = 0;
+ while (Char.IsDigit(c)) {
+ this.param = this.param * 10 + Convert.ToByte(c) - 48;
+ if ((c = GetChar()) == EOF) {
+ break;
+ }
+ }
+ this.param *= sign;
+ }
+
+ if (c != EOF) {
+ if (c != ' ') {
+ this.pushed_char = c;
+ }
+ this.text_buffer.Length--;
+ }
+ }
+
+ public void SetToken(TokenClass cl, Major maj, Minor min, int par, string text) {
+ this.rtf_class = cl;
+ this.major = maj;
+ this.minor = min;
+ this.param = par;
+ if (par == NoParam) {
+ this.text_buffer = new StringBuilder(text);
+ } else {
+ this.text_buffer = new StringBuilder(text + par.ToString());
+ }
+ }
+
+ public void UngetToken() {
+ if (this.pushed_class != TokenClass.None) {
+ throw new RTFException(this, "Cannot unget more than one token");
+ }
+
+ if (this.rtf_class == TokenClass.None) {
+ throw new RTFException(this, "No token to unget");
+ }
+
+ this.pushed_class = this.rtf_class;
+ this.pushed_major = this.major;
+ this.pushed_minor = this.minor;
+ this.pushed_param = this.param;
+ this.pushed_text_buffer = new StringBuilder(this.text_buffer.ToString());
+ }
+
+ public TokenClass PeekToken() {
+ GetToken();
+ UngetToken();
+ return rtf_class;
+ }
+
+ public void Lookup(string token) {
+ Object obj;
+ KeyStruct key;
+
+ obj = key_table[token.Substring(1)];
+ if (obj == null) {
+ rtf_class = TokenClass.Unknown;
+ return;
+ }
+
+ key = (KeyStruct)obj;
+ this.rtf_class = TokenClass.Control;
+ this.major = key.Major;
+ this.minor = key.Minor;
+ }
+
+ public bool CheckCM(TokenClass rtf_class, Major major) {
+ if ((this.rtf_class == rtf_class) && (this.major == major)) {
+ return true;
+ }
+
+ return false;
+ }
+
+ public bool CheckCMM(TokenClass rtf_class, Major major, Minor minor) {
+ if ((this.rtf_class == rtf_class) && (this.major == major) && (this.minor == minor)) {
+ return true;
+ }
+
+ return false;
+ }
+
+ public bool CheckMM(Major major, Minor minor) {
+ if ((this.major == major) && (this.minor == minor)) {
+ return true;
+ }
+
+ return false;
+ }
+ #endregion // Methods
+
+ #region Default Delegates
+ private void ReadFontTbl(RTF rtf) {
+ int old;
+ Font font;
+
+ old = -1;
+ font = null;
+
+ while (true) {
+ rtf.GetToken();
+
+ if (rtf.CheckCM(TokenClass.Group, Major.EndGroup)) {
+ break;
+ }
+
+ if (old < 0) {
+ if (rtf.CheckCMM(TokenClass.Control, Major.CharAttr, Minor.FontNum)) {
+ old = 1;
+ } else if (rtf.CheckCM(TokenClass.Group, Major.BeginGroup)) {
+ old = 0;
+ } else {
+ throw new RTFException(rtf, "Cannot determine format");
+ }
+ }
+
+ if (old == 0) {
+ if (!rtf.CheckCM(TokenClass.Group, Major.BeginGroup)) {
+ throw new RTFException(rtf, "missing \"{\"");
+ }
+ rtf.GetToken();
+ }
+
+ font = new Font(rtf);
+
+ while ((rtf.rtf_class != TokenClass.EOF) && (!rtf.CheckCM(TokenClass.Text, (Major)';')) && (!rtf.CheckCM(TokenClass.Group, Major.EndGroup))) {
+ if (rtf.rtf_class == TokenClass.Control) {
+ switch(rtf.major) {
+ case Major.FontFamily: {
+ font.Family = (int)rtf.minor;
+ break;
+ }
+
+ case Major.CharAttr: {
+ switch(rtf.minor) {
+ case Minor.FontNum: {
+ font.Num = rtf.param;
+ break;
+ }
+
+ default: {
+ #if RTF_DEBUG
+ Console.WriteLine("Got unhandled Control.CharAttr.Minor: " + rtf.minor);
+ #endif
+ break;
+ }
+ }
+ break;
+ }
+
+ case Major.FontAttr: {
+ switch (rtf.minor) {
+ case Minor.FontCharSet: {
+ font.Charset = (CharsetType)rtf.param;
+ break;
+ }
+
+ case Minor.FontPitch: {
+ font.Pitch = rtf.param;
+ break;
+ }
+
+ case Minor.FontCodePage: {
+ font.Codepage = rtf.param;
+ break;
+ }
+
+ case Minor.FTypeNil:
+ case Minor.FTypeTrueType: {
+ font.Type = rtf.param;
+ break;
+ }
+ default: {
+ #if RTF_DEBUG
+ Console.WriteLine("Got unhandled Control.FontAttr.Minor: " + rtf.minor);
+ #endif
+ break;
+ }
+ }
+ break;
+ }
+
+ default: {
+ #if RTF_DEBUG
+ Console.WriteLine("ReadFontTbl: Unknown Control token " + rtf.major);
+ #endif
+ break;
+ }
+ }
+ } else if (rtf.CheckCM(TokenClass.Group, Major.BeginGroup)) {
+ rtf.SkipGroup();
+ } else if (rtf.rtf_class == TokenClass.Text) {
+ StringBuilder sb;
+
+ sb = new StringBuilder();
+
+ while ((rtf.rtf_class != TokenClass.EOF) && (!rtf.CheckCM(TokenClass.Text, (Major)';')) && (!rtf.CheckCM(TokenClass.Group, Major.EndGroup))) {
+ sb.Append((char)rtf.major);
+ rtf.GetToken();
+ }
+
+ if (rtf.CheckCM(TokenClass.Group, Major.EndGroup)) {
+ rtf.UngetToken();
+ }
+
+ font.Name = sb.ToString();
+ continue;
+#if RTF_DEBUG
+ } else {
+ Console.WriteLine("ReadFontTbl: Unknown token " + rtf.text_buffer);
+#endif
+ }
+
+ rtf.GetToken();
+ }
+
+ if (old == 0) {
+ rtf.GetToken();
+
+ if (!rtf.CheckCM(TokenClass.Group, Major.EndGroup)) {
+ throw new RTFException(rtf, "Missing \"}\"");
+ }
+ }
+ }
+
+ if (font == null) {
+ throw new RTFException(rtf, "No font created");
+ }
+
+ if (font.Num == -1) {
+ throw new RTFException(rtf, "Missing font number");
+ }
+
+ rtf.RouteToken();
+ }
+
+ private void ReadColorTbl(RTF rtf) {
+ Color color;
+ int num;
+
+ num = 0;
+
+ while (true) {
+ rtf.GetToken();
+
+ if (rtf.CheckCM(TokenClass.Group, Major.EndGroup)) {
+ break;
+ }
+
+ color = new Color(rtf);
+ color.Num = num++;
+
+ while (rtf.CheckCM(TokenClass.Control, Major.ColorName)) {
+ switch (rtf.minor) {
+ case Minor.Red: {
+ color.Red = rtf.param;
+ break;
+ }
+
+ case Minor.Green: {
+ color.Green = rtf.param;
+ break;
+ }
+
+ case Minor.Blue: {
+ color.Blue = rtf.param;
+ break;
+ }
+ }
+
+ rtf.GetToken();
+ }
+ if (!rtf.CheckCM(TokenClass.Text, (Major)';')) {
+ throw new RTFException(rtf, "Malformed color entry");
+ }
+ }
+ rtf.RouteToken();
+ }
+
+ private void ReadStyleSheet(RTF rtf) {
+ Style style;
+ StringBuilder sb;
+
+ sb = new StringBuilder();
+
+ while (true) {
+ rtf.GetToken();
+
+ if (rtf.CheckCM(TokenClass.Group, Major.EndGroup)) {
+ break;
+ }
+
+ style = new Style(rtf);
+
+ if (!rtf.CheckCM(TokenClass.Group, Major.BeginGroup)) {
+ throw new RTFException(rtf, "Missing \"{\"");
+ }
+
+ while (true) {
+ rtf.GetToken();
+
+ if ((rtf.rtf_class == TokenClass.EOF) || rtf.CheckCM(TokenClass.Text, (Major)';')) {
+ break;
+ }
+
+ if (rtf.rtf_class == TokenClass.Control) {
+ if (rtf.CheckMM(Major.SpecialChar, Minor.OptDest)) {
+ continue;
+ }
+ if (rtf.CheckMM(Major.ParAttr, Minor.StyleNum)) {
+ style.Num = rtf.param;
+ style.Type = StyleType.Paragraph;
+ continue;
+ }
+ if (rtf.CheckMM(Major.CharAttr, Minor.CharStyleNum)) {
+ style.Num = rtf.param;
+ style.Type = StyleType.Character;
+ continue;
+ }
+ if (rtf.CheckMM(Major.StyleAttr, Minor.SectStyleNum)) {
+ style.Num = rtf.param;
+ style.Type = StyleType.Section;
+ continue;
+ }
+ if (rtf.CheckMM(Major.StyleAttr, Minor.BasedOn)) {
+ style.BasedOn = rtf.param;
+ continue;
+ }
+ if (rtf.CheckMM(Major.StyleAttr, Minor.Additive)) {
+ style.Additive = true;
+ continue;
+ }
+ if (rtf.CheckMM(Major.StyleAttr, Minor.Next)) {
+ style.NextPar = rtf.param;
+ continue;
+ }
+
+ new StyleElement(style, rtf.rtf_class, rtf.major, rtf.minor, rtf.param, rtf.text_buffer.ToString());
+ } else if (rtf.CheckCM(TokenClass.Group, Major.BeginGroup)) {
+ // This passes over "{\*\keycode ... }, among other things
+ rtf.SkipGroup();
+ } else if (rtf.rtf_class == TokenClass.Text) {
+ while (rtf.rtf_class == TokenClass.Text) {
+ if (rtf.major == (Major)';') {
+ rtf.UngetToken();
+ break;
+ }
+
+ sb.Append((char)rtf.major);
+ rtf.GetToken();
+ }
+
+ style.Name = sb.ToString();
+#if RTF_DEBUG
+ } else {
+ Console.WriteLine("ReadStyleSheet: Ignored token " + rtf.text_buffer);
+#endif
+ }
+ }
+ rtf.GetToken();
+
+ if (!rtf.CheckCM(TokenClass.Group, Major.EndGroup)) {
+ throw new RTFException(rtf, "Missing EndGroup (\"}\"");
+ }
+
+ // Sanity checks
+ if (style.Name == null) {
+ throw new RTFException(rtf, "Style must have name");
+ }
+
+ if (style.Num < 0) {
+ if (!sb.ToString().StartsWith("Normal") && !sb.ToString().StartsWith("Standard")) {
+ throw new RTFException(rtf, "Missing style number");
+ }
+
+ style.Num = Style.NormalStyleNum;
+ }
+
+ if (style.NextPar == -1) {
+ style.NextPar = style.Num;
+ }
+ }
+
+ rtf.RouteToken();
+ }
+
+ private void ReadInfoGroup(RTF rtf) {
+ rtf.SkipGroup();
+ rtf.RouteToken();
+ }
+
+ private void ReadPictGroup(RTF rtf) {
+ rtf.SkipGroup();
+ rtf.RouteToken();
+ }
+
+ private void ReadObjGroup(RTF rtf) {
+ rtf.SkipGroup();
+ rtf.RouteToken();
+ }
+ #endregion // Default Delegates
+ }
+}
Property changes on: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/RTF.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/RTFException.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/RTFException.cs 2005-09-05 23:57:52 UTC (rev 49517)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/RTFException.cs 2005-09-06 01:38:50 UTC (rev 49518)
@@ -0,0 +1,81 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
+//
+// Authors:
+// Peter Bartok (pbartok at novell.com)
+//
+//
+
+// COMPLETE
+
+using System;
+using System.Text;
+
+namespace System.Windows.Forms.RTF {
+ internal class RTFException : ApplicationException {
+ #region Local Variables
+ private int pos;
+ private int line;
+ private TokenClass token_class;
+ private Major major;
+ private Minor minor;
+ private int param;
+ private string text;
+ private string error_message;
+ #endregion // Local Variables
+
+ #region Constructors
+ public RTFException(RTF rtf, string error_message) {
+ this.pos = rtf.LinePos;
+ this.line = rtf.LineNumber;
+ this.token_class = rtf.TokenClass;
+ this.major = rtf.Major;
+ this.minor = rtf.Minor;
+ this.param = rtf.Param;
+ this.text = rtf.Text;
+ this.error_message = error_message;
+ }
+ #endregion // Constructors
+
+ #region Properties
+ public override string Message {
+ get {
+ StringBuilder sb;
+
+ sb = new StringBuilder();
+ sb.Append(error_message);
+ sb.Append("\n");
+
+ sb.Append("RTF Stream Info: Pos:" + pos + " Line:" + line);
+ sb.Append("\n");
+
+ sb.Append("TokenClass:" + token_class + ", ");
+ sb.Append("Major:" + String.Format("{0}", (int)major) + ", ");
+ sb.Append("Minor:" + String.Format("{0}", (int)minor) + ", ");
+ sb.Append("Param:" + String.Format("{0}", param) + ", ");
+ sb.Append("Text:" + text);
+
+ return sb.ToString();
+ }
+ }
+ #endregion // Properties
+ }
+}
Property changes on: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/RTFException.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/StandardCharCode.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/StandardCharCode.cs 2005-09-05 23:57:52 UTC (rev 49517)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/StandardCharCode.cs 2005-09-06 01:38:50 UTC (rev 49518)
@@ -0,0 +1,386 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
+//
+// Authors:
+// Peter Bartok (pbartok at novell.com)
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms.RTF {
+ internal enum StandardCharCode {
+ nothing = 0,
+ space = 1,
+ exclam = 2,
+ quotedbl = 3,
+ numbersign = 4,
+ dollar = 5,
+ percent = 6,
+ ampersand = 7,
+ quoteright = 8,
+ parenleft = 9,
+ parenright = 10,
+ asterisk = 11,
+ plus = 12,
+ comma = 13,
+ hyphen = 14,
+ period = 15,
+ slash = 16,
+ zero = 17,
+ one = 18,
+ two = 19,
+ three = 20,
+ four = 21,
+ five = 22,
+ six = 23,
+ seven = 24,
+ eight = 25,
+ nine = 26,
+ colon = 27,
+ semicolon = 28,
+ less = 29,
+ equal = 30,
+ greater = 31,
+ question = 32,
+ at = 33,
+ A = 34,
+ B = 35,
+ C = 36,
+ D = 37,
+ E = 38,
+ F = 39,
+ G = 40,
+ H = 41,
+ I = 42,
+ J = 43,
+ K = 44,
+ L = 45,
+ M = 46,
+ N = 47,
+ O = 48,
+ P = 49,
+ Q = 50,
+ R = 51,
+ S = 52,
+ T = 53,
+ U = 54,
+ V = 55,
+ W = 56,
+ X = 57,
+ Y = 58,
+ Z = 59,
+ bracketleft = 60,
+ backslash = 61,
+ bracketright = 62,
+ asciicircum = 63,
+ underscore = 64,
+ quoteleft = 65,
+ a = 66,
+ b = 67,
+ c = 68,
+ d = 69,
+ e = 70,
+ f = 71,
+ g = 72,
+ h = 73,
+ i = 74,
+ j = 75,
+ k = 76,
+ l = 77,
+ m = 78,
+ n = 79,
+ o = 80,
+ p = 81,
+ q = 82,
+ r = 83,
+ s = 84,
+ t = 85,
+ u = 86,
+ v = 87,
+ w = 88,
+ x = 89,
+ y = 90,
+ z = 91,
+ braceleft = 92,
+ bar = 93,
+ braceright = 94,
+ asciitilde = 95,
+ exclamdown = 96,
+ cent = 97,
+ sterling = 98,
+ fraction = 99,
+ yen = 100,
+ florin = 101,
+ section = 102,
+ currency = 103,
+ quotedblleft = 104,
+ guillemotleft = 105,
+ guilsinglleft = 106,
+ guilsinglright = 107,
+ fi = 108,
+ fl = 109,
+ endash = 110,
+ dagger = 111,
+ daggerdbl = 112,
+ periodcentered = 113,
+ paragraph = 114,
+ bullet = 115,
+ quotesinglbase = 116,
+ quotedblbase = 117,
+ quotedblright = 118,
+ guillemotright = 119,
+ ellipsis = 120,
+ perthousand = 121,
+ questiondown = 122,
+ grave = 123,
+ acute = 124,
+ circumflex = 125,
+ tilde = 126,
+ macron = 127,
+ breve = 128,
+ dotaccent = 129,
+ dieresis = 130,
+ ring = 131,
+ cedilla = 132,
+ hungarumlaut = 133,
+ ogonek = 134,
+ caron = 135,
+ emdash = 136,
+ AE = 137,
+ ordfeminine = 138,
+ Lslash = 139,
+ Oslash = 140,
+ OE = 141,
+ ordmasculine = 142,
+ ae = 143,
+ dotlessi = 144,
+ lslash = 145,
+ oslash = 146,
+ oe = 147,
+ germandbls = 148,
+ Aacute = 149,
+ Acircumflex = 150,
+ Adieresis = 151,
+ Agrave = 152,
+ Aring = 153,
+ Atilde = 154,
+ Ccedilla = 155,
+ Eacute = 156,
+ Ecircumflex = 157,
+ Edieresis = 158,
+ Egrave = 159,
+ Eth = 160,
+ Iacute = 161,
+ Icircumflex = 162,
+ Idieresis = 163,
+ Igrave = 164,
+ Ntilde = 165,
+ Oacute = 166,
+ Ocircumflex = 167,
+ Odieresis = 168,
+ Ograve = 169,
+ Otilde = 170,
+ Scaron = 171,
+ Thorn = 172,
+ Uacute = 173,
+ Ucircumflex = 174,
+ Udieresis = 175,
+ Ugrave = 176,
+ Yacute = 177,
+ Ydieresis = 178,
+ aacute = 179,
+ acircumflex = 180,
+ adieresis = 181,
+ agrave = 182,
+ aring = 183,
+ atilde = 184,
+ brokenbar = 185,
+ ccedilla = 186,
+ copyright = 187,
+ degree = 188,
+ divide = 189,
+ eacute = 190,
+ ecircumflex = 191,
+ edieresis = 192,
+ egrave = 193,
+ eth = 194,
+ iacute = 195,
+ icircumflex = 196,
+ idieresis = 197,
+ igrave = 198,
+ logicalnot = 199,
+ minus = 200,
+ multiply = 201,
+ ntilde = 202,
+ oacute = 203,
+ ocircumflex = 204,
+ odieresis = 205,
+ ograve = 206,
+ onehalf = 207,
+ onequarter = 208,
+ onesuperior = 209,
+ otilde = 210,
+ plusminus = 211,
+ registered = 212,
+ thorn = 213,
+ threequarters = 214,
+ threesuperior = 215,
+ trademark = 216,
+ twosuperior = 217,
+ uacute = 218,
+ ucircumflex = 219,
+ udieresis = 220,
+ ugrave = 221,
+ yacute = 222,
+ ydieresis = 223,
+ Alpha = 224,
+ Beta = 225,
+ Chi = 226,
+ Delta = 227,
+ Epsilon = 228,
+ Phi = 229,
+ Gamma = 230,
+ Eta = 231,
+ Iota = 232,
+ Kappa = 233,
+ Lambda = 234,
+ Mu = 235,
+ Nu = 236,
+ Omicron = 237,
+ Pi = 238,
+ Theta = 239,
+ Rho = 240,
+ Sigma = 241,
+ Tau = 242,
+ Upsilon = 243,
+ varUpsilon = 244,
+ Omega = 245,
+ Xi = 246,
+ Psi = 247,
+ Zeta = 248,
+ alpha = 249,
+ beta = 250,
+ chi = 251,
+ delta = 252,
+ epsilon = 253,
+ phi = 254,
+ varphi = 255,
+ gamma = 256,
+ eta = 257,
+ iota = 258,
+ kappa = 259,
+ lambda = 260,
+ mu = 261,
+ nu = 262,
+ omicron = 263,
+ pi = 264,
+ varpi = 265,
+ theta = 266,
+ vartheta = 267,
+ rho = 268,
+ sigma = 269,
+ varsigma = 270,
+ tau = 271,
+ upsilon = 272,
+ omega = 273,
+ xi = 274,
+ psi = 275,
+ zeta = 276,
+ nobrkspace = 277,
+ nobrkhyphen = 278,
+ lessequal = 279,
+ greaterequal = 280,
+ infinity = 281,
+ integral = 282,
+ notequal = 283,
+ radical = 284,
+ radicalex = 285,
+ approxequal = 286,
+ apple = 287,
+ partialdiff = 288,
+ opthyphen = 289,
+ formula = 290,
+ lozenge = 291,
+ universal = 292,
+ existential = 293,
+ suchthat = 294,
+ congruent = 295,
+ therefore = 296,
+ perpendicular = 297,
+ minute = 298,
+ club = 299,
+ diamond = 300,
+ heart = 301,
+ spade = 302,
+ arrowboth = 303,
+ arrowleft = 304,
+ arrowup = 305,
+ arrowright = 306,
+ arrowdown = 307,
+ second = 308,
+ proportional = 309,
+ equivalence = 310,
+ arrowvertex = 311,
+ arrowhorizex = 312,
+ carriagereturn = 313,
+ aleph = 314,
+ Ifraktur = 315,
+ Rfraktur = 316,
+ weierstrass = 317,
+ circlemultiply = 318,
+ circleplus = 319,
+ emptyset = 320,
+ intersection = 321,
+ union = 322,
+ propersuperset = 323,
+ reflexsuperset = 324,
+ notsubset = 325,
+ propersubset = 326,
+ reflexsubset = 327,
+ element = 328,
+ notelement = 329,
+ angle = 330,
+ gradient = 331,
+ product = 332,
+ logicaland = 333,
+ logicalor = 334,
+ arrowdblboth = 335,
+ arrowdblleft = 336,
+ arrowdblup = 337,
+ arrowdblright = 338,
+ arrowdbldown = 339,
+ angleleft = 340,
+ registersans = 341,
+ copyrightsans = 342,
+ trademarksans = 343,
+ angleright = 344,
+ mathplus = 345,
+ mathminus = 346,
+ mathasterisk = 347,
+ mathnumbersign = 348,
+ dotmath = 349,
+ mathequal = 350,
+ mathtilde = 351,
+
+ MaxChar = 352
+ }
+}
Property changes on: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/StandardCharCode.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/StandardCharName.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/StandardCharName.cs 2005-09-05 23:57:52 UTC (rev 49517)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/StandardCharName.cs 2005-09-06 01:38:50 UTC (rev 49518)
@@ -0,0 +1,405 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
+//
+// Authors:
+// Peter Bartok (pbartok at novell.com)
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms.RTF {
+ internal class StandardCharName {
+ public static string[] Names = {
+ "nothing",
+ "space",
+ "exclam",
+ "quotedbl",
+ "numbersign",
+ "dollar",
+ "percent",
+ "ampersand",
+ "quoteright",
+ "parenleft",
+ "parenright",
+ "asterisk",
+ "plus",
+ "comma",
+ "hyphen",
+ "period",
+ "slash",
+ "zero",
+ "one",
+ "two",
+ "three",
+ "four",
+ "five",
+ "six",
+ "seven",
+ "eight",
+ "nine",
+ "colon",
+ "semicolon",
+ "less",
+ "equal",
+ "greater",
+ "question",
+ "at",
+ "A",
+ "B",
+ "C",
+ "D",
+ "E",
+ "F",
+ "G",
+ "H",
+ "I",
+ "J",
+ "K",
+ "L",
+ "M",
+ "N",
+ "O",
+ "P",
+ "Q",
+ "R",
+ "S",
+ "T",
+ "U",
+ "V",
+ "W",
+ "X",
+ "Y",
+ "Z",
+ "bracketleft",
+ "backslash",
+ "bracketright",
+ "asciicircum",
+ "underscore",
+ "quoteleft",
+ "a",
+ "b",
+ "c",
+ "d",
+ "e",
+ "f",
+ "g",
+ "h",
+ "i",
+ "j",
+ "k",
+ "l",
+ "m",
+ "n",
+ "o",
+ "p",
+ "q",
+ "r",
+ "s",
+ "t",
+ "u",
+ "v",
+ "w",
+ "x",
+ "y",
+ "z",
+ "braceleft",
+ "bar",
+ "braceright",
+ "asciitilde",
+ "exclamdown",
+ "cent",
+ "sterling",
+ "fraction",
+ "yen",
+ "florin",
+ "section",
+ "currency",
+ "quotedblleft",
+ "guillemotleft",
+ "guilsinglleft",
+ "guilsinglright",
+ "fi",
+ "fl",
+ "endash",
+ "dagger",
+ "daggerdbl",
+ "periodcentered",
+ "paragraph",
+ "bullet",
+ "quotesinglbase",
+ "quotedblbase",
+ "quotedblright",
+ "guillemotright",
+ "ellipsis",
+ "perthousand",
+ "questiondown",
+ "grave",
+ "acute",
+ "circumflex",
+ "tilde",
+ "macron",
+ "breve",
+ "dotaccent",
+ "dieresis",
+ "ring",
+ "cedilla",
+ "hungarumlaut",
+ "ogonek",
+ "caron",
+ "emdash",
+ "AE",
+ "ordfeminine",
+ "Lslash",
+ "Oslash",
+ "OE",
+ "ordmasculine",
+ "ae",
+ "dotlessi",
+ "lslash",
+ "oslash",
+ "oe",
+ "germandbls",
+ "Aacute",
+ "Acircumflex",
+ "Adieresis",
+ "Agrave",
+ "Aring",
+ "Atilde",
+ "Ccedilla",
+ "Eacute",
+ "Ecircumflex",
+ "Edieresis",
+ "Egrave",
+ "Eth",
+ "Iacute",
+ "Icircumflex",
+ "Idieresis",
+ "Igrave",
+ "Ntilde",
+ "Oacute",
+ "Ocircumflex",
+ "Odieresis",
+ "Ograve",
+ "Otilde",
+ "Scaron",
+ "Thorn",
+ "Uacute",
+ "Ucircumflex",
+ "Udieresis",
+ "Ugrave",
+ "Yacute",
+ "Ydieresis",
+ "aacute",
+ "acircumflex",
+ "adieresis",
+ "agrave",
+ "aring",
+ "atilde",
+ "brokenbar",
+ "ccedilla",
+ "copyright",
+ "degree",
+ "divide",
+ "eacute",
+ "ecircumflex",
+ "edieresis",
+ "egrave",
+ "eth",
+ "iacute",
+ "icircumflex",
+ "idieresis",
+ "igrave",
+ "logicalnot",
+ "minus",
+ "multiply",
+ "ntilde",
+ "oacute",
+ "ocircumflex",
+ "odieresis",
+ "ograve",
+ "onehalf",
+ "onequarter",
+ "onesuperior",
+ "otilde",
+ "plusminus",
+ "registered",
+ "thorn",
+ "threequarters",
+ "threesuperior",
+ "trademark",
+ "twosuperior",
+ "uacute",
+ "ucircumflex",
+ "udieresis",
+ "ugrave",
+ "yacute",
+ "ydieresis",
+ "Alpha",
+ "Beta",
+ "Chi",
+ "Delta",
+ "Epsilon",
+ "Phi",
+ "Gamma",
+ "Eta",
+ "Iota",
+ "Kappa",
+ "Lambda",
+ "Mu",
+ "Nu",
+ "Omicron",
+ "Pi",
+ "Theta",
+ "Rho",
+ "Sigma",
+ "Tau",
+ "Upsilon",
+ "varUpsilon",
+ "Omega",
+ "Xi",
+ "Psi",
+ "Zeta",
+ "alpha",
+ "beta",
+ "chi",
+ "delta",
+ "epsilon",
+ "phi",
+ "varphi",
+ "gamma",
+ "eta",
+ "iota",
+ "kappa",
+ "lambda",
+ "mu",
+ "nu",
+ "omicron",
+ "pi",
+ "varpi",
+ "theta",
+ "vartheta",
+ "rho",
+ "sigma",
+ "varsigma",
+ "tau",
+ "upsilon",
+ "omega",
+ "xi",
+ "psi",
+ "zeta",
+ "nobrkspace",
+ "nobrkhyphen",
+ "lessequal",
+ "greaterequal",
+ "infinity",
+ "integral",
+ "notequal",
+ "radical",
+ "radicalex",
+ "approxequal",
+ "apple",
+ "partialdiff",
+ "opthyphen",
+ "formula",
+ "lozenge",
+ "universal",
+ "existential",
+ "suchthat",
+ "congruent",
+ "therefore",
+ "perpendicular",
+ "minute",
+ "club",
+ "diamond",
+ "heart",
+ "spade",
+ "arrowboth",
+ "arrowleft",
+ "arrowup",
+ "arrowright",
+ "arrowdown",
+ "second",
+ "proportional",
+ "equivalence",
+ "arrowvertex",
+ "arrowhorizex",
+ "carriagereturn",
+ "aleph",
+ "Ifraktur",
+ "Rfraktur",
+ "weierstrass",
+ "circlemultiply",
+ "circleplus",
+ "emptyset",
+ "intersection",
+ "union",
+ "propersuperset",
+ "reflexsuperset",
+ "notsubset",
+ "propersubset",
+ "reflexsubset",
+ "element",
+ "notelement",
+ "angle",
+ "gradient",
+ "product",
+ "logicaland",
+ "logicalor",
+ "arrowdblboth",
+ "arrowdblleft",
+ "arrowdblup",
+ "arrowdblright",
+ "arrowdbldown",
+ "angleleft",
+ "registersans",
+ "copyrightsans",
+ "trademarksans",
+ "angleright",
+ "mathplus",
+ "mathminus",
+ "mathasterisk",
+ "mathnumbersign",
+ "dotmath",
+ "mathequal",
+ "mathtilde"
+ };
+
+ /// <summary>Lookup name by ID</summary>
+ public static string Name(int index) {
+ if ((index < 0) || (index >= Names.Length)) {
+ return string.Empty;
+ }
+
+ return Names[index];
+ }
+
+ /// <summary>Lookup ID by name (e.g. mathtilde)</summary>
+ public static int ID(string name) {
+ for (int i=0; i < Names.Length; i++) {
+ if (name.Equals(Names[i])) {
+ return i;
+ }
+ }
+ return 0;
+ }
+ }
+}
Property changes on: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/StandardCharName.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Style.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Style.cs 2005-09-05 23:57:52 UTC (rev 49517)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Style.cs 2005-09-06 01:38:50 UTC (rev 49518)
@@ -0,0 +1,205 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
+//
+// Authors:
+// Peter Bartok (pbartok at novell.com)
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms.RTF {
+ internal class Style {
+ #region Local Variables
+ public const int NoStyleNum = 222;
+ public const int NormalStyleNum = 0;
+
+ private string name;
+ private StyleType type;
+ private bool additive;
+ private int num;
+ private int based_on;
+ private int next_par;
+ private int se_list;
+ private bool expanding;
+ private StyleElement elements;
+ private Style next;
+ #endregion Local Variables
+
+ #region Constructors
+ public Style(RTF rtf) {
+ num = -1;
+ type = StyleType.Paragraph;
+ based_on = NoStyleNum;
+ next_par = -1;
+
+ lock (rtf) {
+ if (rtf.Styles == null) {
+ rtf.Styles = this;
+ } else {
+ Style s = rtf.Styles;
+ while (s.next != null)
+ s = s.next;
+ s.next = this;
+ }
+ }
+ }
+ #endregion // Constructors
+
+ #region Properties
+ public string Name {
+ get {
+ return name;
+ }
+
+ set {
+ name = value;
+ }
+ }
+
+ public StyleType Type {
+ get {
+ return type;
+ }
+
+ set {
+ type = value;
+ }
+ }
+
+ public bool Additive {
+ get {
+ return additive;
+ }
+
+ set {
+ additive = value;
+ }
+ }
+
+ public int BasedOn {
+ get {
+ return based_on;
+ }
+
+ set {
+ based_on = value;
+ }
+ }
+
+ public StyleElement Elements {
+ get {
+ return elements;
+ }
+
+ set {
+ elements = value;
+ }
+ }
+
+ public bool Expanding {
+ get {
+ return expanding;
+ }
+
+ set {
+ expanding = value;
+ }
+ }
+
+ public int NextPar {
+ get {
+ return next_par;
+ }
+
+ set {
+ next_par = value;
+ }
+ }
+
+ public int Num {
+ get {
+ return num;
+ }
+
+ set {
+ num = value;
+ }
+ }
+ #endregion // Properties
+
+ #region Methods
+ public void Expand(RTF rtf) {
+ StyleElement se;
+
+ if (num == -1) {
+ return;
+ }
+
+ if (expanding) {
+ throw new Exception("Recursive style expansion");
+ }
+ expanding = true;
+
+ if (num != based_on) {
+ rtf.SetToken(TokenClass.Control, Major.ParAttr, Minor.StyleNum, based_on, "\\s");
+ rtf.RouteToken();
+ }
+
+ se = elements;
+ while (se != null) {
+ rtf.TokenClass = se.TokenClass;
+ rtf.Major = se.Major;
+ rtf.Minor = se.Minor;
+ rtf.Param = se.Param;
+ rtf.Text = se.Text;
+ rtf.RouteToken();
+ }
+
+ expanding = false;
+ }
+
+ static public Style GetStyle(RTF rtf, int style_number) {
+ Style s;
+
+ lock (rtf) {
+ s = GetStyle(rtf.Styles, style_number);
+ }
+ return s;
+ }
+
+ static public Style GetStyle(Style start, int style_number) {
+ Style s;
+
+ if (style_number == -1) {
+ return start;
+ }
+
+ s = start;
+
+ while ((s != null) && (s.num != style_number)) {
+ s = s.next;
+ }
+ return s;
+ }
+ #endregion // Methods
+ }
+}
Property changes on: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/Style.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/StyleElement.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/StyleElement.cs 2005-09-05 23:57:52 UTC (rev 49517)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/StyleElement.cs 2005-09-06 01:38:50 UTC (rev 49518)
@@ -0,0 +1,116 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
+//
+// Authors:
+// Peter Bartok (pbartok at novell.com)
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms.RTF {
+ internal class StyleElement {
+ #region Local Variables
+ private TokenClass token_class;
+ private Major major;
+ private Minor minor;
+ private int param;
+ private string text;
+ private StyleElement next;
+ #endregion Local Variables
+
+ #region Constructors
+ public StyleElement(Style s, TokenClass token_class, Major major, Minor minor, int param, string text) {
+ this.token_class = token_class;
+ this.major = major;
+ this.minor = minor;
+ this.param = param;
+ this.text = text;
+
+ lock (s) {
+ if (s.Elements == null) {
+ s.Elements = this;
+ } else {
+ StyleElement se = s.Elements;
+ while (se.next != null)
+ se = se.next;
+ se.next = this;
+ }
+ }
+ }
+ #endregion // Constructors
+
+ #region Properties
+ public TokenClass TokenClass {
+ get {
+ return token_class;
+ }
+
+ set {
+ token_class = value;
+ }
+ }
+
+ public Major Major {
+ get {
+ return major;
+ }
+
+ set {
+ major = value;
+ }
+ }
+
+ public Minor Minor {
+ get {
+ return minor;
+ }
+
+ set {
+ minor = value;
+ }
+ }
+
+ public int Param {
+ get {
+ return param;
+ }
+
+ set {
+ param = value;
+ }
+ }
+
+ public string Text {
+ get {
+ return text;
+ }
+
+ set {
+ text = value;
+ }
+ }
+ #endregion // Properties
+
+ #region Methods
+ #endregion // Methods
+ }
+}
Property changes on: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/StyleElement.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/StyleType.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/StyleType.cs 2005-09-05 23:57:52 UTC (rev 49517)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/StyleType.cs 2005-09-06 01:38:50 UTC (rev 49518)
@@ -0,0 +1,35 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
+//
+// Authors:
+// Peter Bartok (pbartok at novell.com)
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms.RTF {
+ internal enum StyleType {
+ Paragraph = 0,
+ Character = 1,
+ Section = 2
+ }
+}
Property changes on: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/StyleType.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/TextMap.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/TextMap.cs 2005-09-05 23:57:52 UTC (rev 49517)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/TextMap.cs 2005-09-06 01:38:50 UTC (rev 49518)
@@ -0,0 +1,228 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
+//
+// Authors:
+// Peter Bartok (pbartok at novell.com)
+//
+//
+
+// This map is for convencience only, any app can create/use it's own
+// StdCharCode -> <text> table
+
+using System.Collections;
+
+namespace System.Windows.Forms.RTF {
+ internal class TextMap {
+ #region Local Variables
+ private string[] table;
+ #endregion // Local Variables
+
+ #region Public Constructors
+ public TextMap() {
+ table = new string[(int)StandardCharCode.MaxChar];
+
+ for (int i = 0; i < (int)StandardCharCode.MaxChar; i++) {
+ table[i] = string.Empty;
+ }
+ }
+ #endregion // Public Constructors
+
+ #region Public Instance Properties
+ internal string this[StandardCharCode c] { // FIXME - this should be public, if the whole namespace was public (ie standalone RTF parser)
+ get {
+ return table[(int)c];
+ }
+
+ set {
+ table[(int)c] = value;
+ }
+ }
+
+ public string[] Table {
+ get {
+ return table;
+ }
+ }
+ #endregion // Public Instance Properties
+
+ #region Public Static Methods
+ public static void SetupStandardTable(string[] table) {
+ table[(int)StandardCharCode.space] = " ";
+ table[(int)StandardCharCode.exclam] = "!";
+ table[(int)StandardCharCode.quotedbl] = "\"";
+ table[(int)StandardCharCode.numbersign] = "#";
+ table[(int)StandardCharCode.dollar] = "$";
+ table[(int)StandardCharCode.percent] = "%";
+ table[(int)StandardCharCode.ampersand] = "&";
+ table[(int)StandardCharCode.quoteright] = "'";
+ table[(int)StandardCharCode.parenleft] = "(";
+ table[(int)StandardCharCode.parenright] = ")";
+ table[(int)StandardCharCode.asterisk] = "*";
+ table[(int)StandardCharCode.plus] = "+";
+ table[(int)StandardCharCode.comma] = ",";
+ table[(int)StandardCharCode.hyphen] = "-";
+ table[(int)StandardCharCode.period] = ".";
+ table[(int)StandardCharCode.slash] = "/";
+ table[(int)StandardCharCode.zero] = "0";
+ table[(int)StandardCharCode.one] = "1";
+ table[(int)StandardCharCode.two] = "2";
+ table[(int)StandardCharCode.three] = "3";
+ table[(int)StandardCharCode.four] = "4";
+ table[(int)StandardCharCode.five] = "5";
+ table[(int)StandardCharCode.six] = "6";
+ table[(int)StandardCharCode.seven] = "7";
+ table[(int)StandardCharCode.eight] = "8";
+ table[(int)StandardCharCode.nine] = "9";
+ table[(int)StandardCharCode.colon] = ":";
+ table[(int)StandardCharCode.semicolon] = ";";
+ table[(int)StandardCharCode.less] = "<";
+ table[(int)StandardCharCode.equal] = "=";
+ table[(int)StandardCharCode.greater] = ">";
+ table[(int)StandardCharCode.question] = "?";
+ table[(int)StandardCharCode.at] = "@";
+ table[(int)StandardCharCode.A] = "A";
+ table[(int)StandardCharCode.B] = "B";
+ table[(int)StandardCharCode.C] = "C";
+ table[(int)StandardCharCode.D] = "D";
+ table[(int)StandardCharCode.E] = "E";
+ table[(int)StandardCharCode.F] = "F";
+ table[(int)StandardCharCode.G] = "G";
+ table[(int)StandardCharCode.H] = "H";
+ table[(int)StandardCharCode.I] = "I";
+ table[(int)StandardCharCode.J] = "J";
+ table[(int)StandardCharCode.K] = "K";
+ table[(int)StandardCharCode.L] = "L";
+ table[(int)StandardCharCode.M] = "M";
+ table[(int)StandardCharCode.N] = "N";
+ table[(int)StandardCharCode.O] = "O";
+ table[(int)StandardCharCode.P] = "P";
+ table[(int)StandardCharCode.Q] = "Q";
+ table[(int)StandardCharCode.R] = "R";
+ table[(int)StandardCharCode.S] = "S";
+ table[(int)StandardCharCode.T] = "T";
+ table[(int)StandardCharCode.U] = "U";
+ table[(int)StandardCharCode.V] = "V";
+ table[(int)StandardCharCode.W] = "W";
+ table[(int)StandardCharCode.X] = "X";
+ table[(int)StandardCharCode.Y] = "Y";
+ table[(int)StandardCharCode.Z] = "Z";
+ table[(int)StandardCharCode.bracketleft] = "[";
+ table[(int)StandardCharCode.backslash] = "\\";
+ table[(int)StandardCharCode.bracketright] = "]";
+ table[(int)StandardCharCode.asciicircum] = "^";
+ table[(int)StandardCharCode.underscore] = "_";
+ table[(int)StandardCharCode.quoteleft] = "`";
+ table[(int)StandardCharCode.a] = "a";
+ table[(int)StandardCharCode.b] = "b";
+ table[(int)StandardCharCode.c] = "c";
+ table[(int)StandardCharCode.d] = "d";
+ table[(int)StandardCharCode.e] = "e";
+ table[(int)StandardCharCode.f] = "f";
+ table[(int)StandardCharCode.g] = "g";
+ table[(int)StandardCharCode.h] = "h";
+ table[(int)StandardCharCode.i] = "i";
+ table[(int)StandardCharCode.j] = "j";
+ table[(int)StandardCharCode.k] = "k";
+ table[(int)StandardCharCode.l] = "l";
+ table[(int)StandardCharCode.m] = "m";
+ table[(int)StandardCharCode.n] = "n";
+ table[(int)StandardCharCode.o] = "o";
+ table[(int)StandardCharCode.p] = "p";
+ table[(int)StandardCharCode.q] = "q";
+ table[(int)StandardCharCode.r] = "r";
+ table[(int)StandardCharCode.s] = "s";
+ table[(int)StandardCharCode.t] = "t";
+ table[(int)StandardCharCode.u] = "u";
+ table[(int)StandardCharCode.v] = "v";
+ table[(int)StandardCharCode.w] = "w";
+ table[(int)StandardCharCode.x] = "x";
+ table[(int)StandardCharCode.y] = "y";
+ table[(int)StandardCharCode.z] = "z";
+ table[(int)StandardCharCode.braceleft] = "{";
+ table[(int)StandardCharCode.bar] = "|";
+ table[(int)StandardCharCode.braceright] = "}";
+ table[(int)StandardCharCode.asciitilde] = "~";
+ table[(int)StandardCharCode.AE] = "AE";
+ table[(int)StandardCharCode.OE] = "OE";
+ table[(int)StandardCharCode.acute] = "'";
+ table[(int)StandardCharCode.ae] = "ae";
+ table[(int)StandardCharCode.angleleft] = "<";
+ table[(int)StandardCharCode.angleright] = ">";
+ table[(int)StandardCharCode.arrowboth] = "<->";
+ table[(int)StandardCharCode.arrowdblboth] = "<=>";
+ table[(int)StandardCharCode.arrowdblleft] = "<=";
+ table[(int)StandardCharCode.arrowdblright] = "=>";
+ table[(int)StandardCharCode.arrowleft] = "<-";
+ table[(int)StandardCharCode.arrowright] = "->";
+ table[(int)StandardCharCode.bullet] = "o";
+ table[(int)StandardCharCode.cent] = "cent";
+ table[(int)StandardCharCode.circumflex] = "^";
+ table[(int)StandardCharCode.copyright] = "(c)";
+ table[(int)StandardCharCode.copyrightsans] = "(c)";
+ table[(int)StandardCharCode.degree] = "deg.";
+ table[(int)StandardCharCode.divide] = "/";
+ table[(int)StandardCharCode.dotlessi] = "i";
+ table[(int)StandardCharCode.ellipsis] = "...";
+ table[(int)StandardCharCode.emdash] = "--";
+ table[(int)StandardCharCode.endash] = "-";
+ table[(int)StandardCharCode.fi] = "fi";
+ table[(int)StandardCharCode.fl] = "fl";
+ table[(int)StandardCharCode.fraction] = "/";
+ table[(int)StandardCharCode.germandbls] = "ss";
+ table[(int)StandardCharCode.grave] = "`";
+ table[(int)StandardCharCode.greaterequal] = ">=";
+ table[(int)StandardCharCode.guillemotleft] = "<<";
+ table[(int)StandardCharCode.guillemotright] = ">>";
+ table[(int)StandardCharCode.guilsinglleft] = "<";
+ table[(int)StandardCharCode.guilsinglright] = ">";
+ table[(int)StandardCharCode.lessequal] = "<=";
+ table[(int)StandardCharCode.logicalnot] = "~";
+ table[(int)StandardCharCode.mathasterisk] = "*";
+ table[(int)StandardCharCode.mathequal] = "=";
+ table[(int)StandardCharCode.mathminus] = "-";
+ table[(int)StandardCharCode.mathnumbersign] = "#";
+ table[(int)StandardCharCode.mathplus] = "+";
+ table[(int)StandardCharCode.mathtilde] = "~";
+ table[(int)StandardCharCode.minus] = "-";
+ table[(int)StandardCharCode.mu] = "u";
+ table[(int)StandardCharCode.multiply] = "x";
+ table[(int)StandardCharCode.nobrkhyphen] = "-";
+ table[(int)StandardCharCode.nobrkspace] = "";
+ table[(int)StandardCharCode.notequal] = "!=";
+ table[(int)StandardCharCode.oe] = "oe";
+ table[(int)StandardCharCode.onehalf] = "1/2";
+ table[(int)StandardCharCode.onequarter] = "1/4";
+ table[(int)StandardCharCode.periodcentered] = ".";
+ table[(int)StandardCharCode.plusminus] = "+/-";
+ table[(int)StandardCharCode.quotedblbase] = ",,";
+ table[(int)StandardCharCode.quotedblleft] = "\"";
+ table[(int)StandardCharCode.quotedblright] = "\"";
+ table[(int)StandardCharCode.quotesinglbase] = ",";
+ table[(int)StandardCharCode.registered] = "reg.";
+ table[(int)StandardCharCode.registersans] = "reg.";
+ table[(int)StandardCharCode.threequarters] = "3/4";
+ table[(int)StandardCharCode.tilde] = "~";
+ table[(int)StandardCharCode.trademark] = "(TM)";
+ table[(int)StandardCharCode.trademarksans] = "(TM)";
+ }
+ #endregion // Public Static Methods
+ }
+}
Added: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/TokenClass.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/TokenClass.cs 2005-09-05 23:57:52 UTC (rev 49517)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/TokenClass.cs 2005-09-06 01:38:50 UTC (rev 49518)
@@ -0,0 +1,39 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
+//
+// Authors:
+// Peter Bartok (pbartok at novell.com)
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms.RTF {
+ internal enum TokenClass {
+ None = -1,
+ Unknown = 0,
+ Group = 1,
+ Text = 2,
+ Control = 3,
+ EOF = 4,
+ MaxClass = 5
+ }
+}
Property changes on: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/TokenClass.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/rtf.csproj
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/rtf.csproj 2005-09-05 23:57:52 UTC (rev 49517)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/rtf.csproj 2005-09-06 01:38:50 UTC (rev 49518)
@@ -0,0 +1,200 @@
+<VisualStudioProject>
+ <CSHARP
+ ProjectType = "Local"
+ ProductVersion = "7.10.3077"
+ SchemaVersion = "2.0"
+ ProjectGuid = "{12D60959-776E-41E9-82BE-AA5DF4BB7CAE}"
+ >
+ <Build>
+ <Settings
+ ApplicationIcon = ""
+ AssemblyKeyContainerName = ""
+ AssemblyName = "rtf"
+ AssemblyOriginatorKeyFile = ""
+ DefaultClientScript = "JScript"
+ DefaultHTMLPageLayout = "Grid"
+ DefaultTargetSchema = "IE50"
+ DelaySign = "false"
+ OutputType = "Exe"
+ PreBuildEvent = ""
+ PostBuildEvent = ""
+ RootNamespace = "rtf"
+ RunPostBuildEvent = "OnBuildSuccess"
+ StartupObject = ""
+ >
+ <Config
+ Name = "Debug"
+ AllowUnsafeBlocks = "false"
+ BaseAddress = "285212672"
+ CheckForOverflowUnderflow = "false"
+ ConfigurationOverrideFile = ""
+ DefineConstants = ""
+ DocumentationFile = ""
+ DebugSymbols = "true"
+ FileAlignment = "4096"
+ IncrementalBuild = "false"
+ NoStdLib = "false"
+ NoWarn = ""
+ Optimize = "false"
+ OutputPath = "bin\Debug\"
+ RegisterForComInterop = "false"
+ RemoveIntegerChecks = "false"
+ TreatWarningsAsErrors = "false"
+ WarningLevel = "1"
+ />
+ <Config
+ Name = "Release"
+ AllowUnsafeBlocks = "false"
+ BaseAddress = "285212672"
+ CheckForOverflowUnderflow = "false"
+ ConfigurationOverrideFile = ""
+ DefineConstants = ""
+ DocumentationFile = ""
+ DebugSymbols = "false"
+ FileAlignment = "4096"
+ IncrementalBuild = "false"
+ NoStdLib = "false"
+ NoWarn = ""
+ Optimize = "false"
+ OutputPath = "bin\Release\"
+ RegisterForComInterop = "false"
+ RemoveIntegerChecks = "false"
+ TreatWarningsAsErrors = "false"
+ WarningLevel = "1"
+ />
+ </Settings>
+ <References>
+ <Reference
+ Name = "System.Drawing"
+ AssemblyName = "System.Drawing"
+ HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Drawing.dll"
+ />
+ <Reference
+ Name = "System"
+ AssemblyName = "System"
+ HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll"
+ />
+ <Reference
+ Name = "System.Windows.Forms"
+ AssemblyName = "System.Windows.Forms"
+ HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Windows.Forms.dll"
+ />
+ </References>
+ </Build>
+ <Files>
+ <Include>
+ <File
+ RelPath = "Charcode.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "Charset.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "CharsetFlags.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "CharsetType.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "ClassDelegate.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "Color.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "DestinationDelegate.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "Font.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "KeysInit.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "KeyStruct.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "Major.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "Minor.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "RTF.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "RTFException.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "StandardCharCode.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "StandardCharName.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "Style.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "StyleElement.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "StyleType.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "test.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "TextMap.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "TokenClass.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ </Include>
+ </Files>
+ </CSHARP>
+</VisualStudioProject>
+
Added: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/rtf.csproj.user
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/rtf.csproj.user 2005-09-05 23:57:52 UTC (rev 49517)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/rtf.csproj.user 2005-09-06 01:38:50 UTC (rev 49518)
@@ -0,0 +1,48 @@
+<VisualStudioProject>
+ <CSHARP LastOpenVersion = "7.10.3077" >
+ <Build>
+ <Settings ReferencePath = "" >
+ <Config
+ Name = "Debug"
+ EnableASPDebugging = "false"
+ EnableASPXDebugging = "false"
+ EnableUnmanagedDebugging = "false"
+ EnableSQLServerDebugging = "false"
+ RemoteDebugEnabled = "false"
+ RemoteDebugMachine = ""
+ StartAction = "Project"
+ StartArguments = ""
+ StartPage = ""
+ StartProgram = ""
+ StartURL = ""
+ StartWorkingDirectory = ""
+ StartWithIE = "false"
+ />
+ <Config
+ Name = "Release"
+ EnableASPDebugging = "false"
+ EnableASPXDebugging = "false"
+ EnableUnmanagedDebugging = "false"
+ EnableSQLServerDebugging = "false"
+ RemoteDebugEnabled = "false"
+ RemoteDebugMachine = ""
+ StartAction = "Project"
+ StartArguments = ""
+ StartPage = ""
+ StartProgram = ""
+ StartURL = ""
+ StartWorkingDirectory = ""
+ StartWithIE = "false"
+ />
+ </Settings>
+ </Build>
+ <OtherProjectSettings
+ CopyProjectDestinationFolder = ""
+ CopyProjectUncPath = ""
+ CopyProjectOption = "0"
+ ProjectView = "ProjectFiles"
+ ProjectTrust = "0"
+ />
+ </CSHARP>
+</VisualStudioProject>
+
Added: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/test.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/test.cs 2005-09-05 23:57:52 UTC (rev 49517)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/test.cs 2005-09-06 01:38:50 UTC (rev 49518)
@@ -0,0 +1,286 @@
+using System;
+using System.Drawing;
+using System.Drawing.Imaging;
+using System.Drawing.Text;
+using System.Windows.Forms;
+using System.Text;
+using System.Threading;
+using System.Windows.Forms.RTF;
+using System.IO;
+
+namespace TextTestClass {
+ public class Test {
+ static Test test;
+ int skip_width;
+ int skip_count;
+ private string rtf_string = "{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Microsoft Sans Serif;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs17 testing 123testiong\\par\r\n}";
+ private string rtf_string2 = "{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fswiss\\fcharset0 Arial;}{\\f1\\fmodern\\fprq1\\fcharset0 Courier;}{\\f2\\fswiss\\fprq2\\fcharset0 Arial;}}\r\n" +
+ "{\\colortbl ;\\red255\\green0\\blue0;\\red0\\green0\\blue0;}\r\n" +
+ "{\\*\\generator Msftedit 5.41.15.1507;}\\viewkind4\\uc1\\pard\\f0\\fs20 I am in Arial 10pt\\par\r\n" +
+ "\\fs24 I am in Arial 12pt\\par\r\n" +
+ "\\f1 I am in Courier 12pt\\par\r\n" +
+ "\\cf1 I am in Courier 12pt Red\\par\r\n" +
+ "\\cf2\\f2\\fs20 I am in Arial 10pt\\par\r\n" +
+ "\\b I am in Arial 10pt Italic\\cf0\\b0\\f0\\par\r\n" +
+ "}";
+ private string rtf_string3 = "{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fswiss\\fcharset0 Arial;}{" +
+ "\\f1\\fmodern\\fprq1\\fcharset0 Courier;}{\\f2\\fswiss\\fprq2\\fcharset0 Arial;}{\\f3\\fni" +
+ "l\\fcharset0 Impact;}{\\f4\\fnil\\fcharset0 Arial Unicode MS;}{\\f5\\fnil\\fcharset136 Arial Unicode MS;}{\\f6\\fnil\\fcharset0 MS" +
+ " Shell Dlg;}}" +
+ "{\\colortbl ;\\red255\\green0\\blue0;\\red0\\green0\\blue0;}" +
+ "{\\*\\generator Msftedit 5.41.15.1507;}\\viewkind4\\uc1\\pard\\f0\\fs20 I am in Arial 1" +
+ "0pt\\par" +
+ "\\fs24 I am in Arial 12pt\\par" +
+ "\\f1 I am in Courier 12pt\\par" +
+ "\\cf1 I am in Courier 12pt Red\\par" +
+ "\\cf2\\f2\\fs20 I am in Arial 10pt\\par" +
+ "\\b I am in Arial 10pt Bold\\par" +
+ "\\i I am in Arial 10pt Bold Italic\\par" +
+ "\\ul I am in Arial 10pt Bold Italic Underline\\par" +
+ "\\ulnone\\b0\\i0\\strike I am in Arial 10pt Strikethrough\\par" +
+ "\\cf0\\strike0\\f3\\fs23 Some cyrilic character: \\u1034?\\par" +
+ "And 5 CJK characters: \\f4\\fs21\\u23854?\\u23854?\\u23854?\\u23854?\\u23854?\\f5\\fs17\\par" +
+ "Some special chars:\\par" +
+ "\\tab Tilde: ~\\par" +
+ "\\tab Questionmark:?\\par" +
+ "\\tab Yen: \\f5\\u165?\\f6\\fs17\\par" +
+ "\\tab Umlaut: \\'e4\\par" +
+ "\\f0\\fs20\\par" +
+ "}";
+
+ TextMap text;
+
+ public Test() {
+ MemoryStream stream;
+ RTF rtf;
+ byte[] buffer;
+
+ text = new TextMap();
+ TextMap.SetupStandardTable(text.Table);
+
+ buffer = new byte[rtf_string.Length];
+ for (int i = 0; i < buffer.Length; i++) {
+ buffer[i] = (byte)rtf_string[i];
+ }
+ stream = new MemoryStream(buffer);
+ rtf = new RTF(stream);
+
+ skip_width = 0;
+ skip_count = 0;
+
+ rtf.ClassCallback[TokenClass.Text] = new ClassDelegate(HandleText);
+ rtf.ClassCallback[TokenClass.Control] = new ClassDelegate(HandleControl);
+
+ rtf.Read();
+
+ stream.Close();
+ }
+
+ void HandleControl(RTF rtf) {
+ switch(rtf.Major) {
+ case Major.Unicode: {
+ switch(rtf.Minor) {
+ case Minor.UnicodeCharBytes: {
+ skip_width = rtf.Param;
+ break;
+ }
+
+ case Minor.UnicodeChar: {
+ Console.Write("[Unicode {0:X4}]", rtf.Param);
+ skip_count += skip_width;
+ break;
+ }
+ }
+ break;
+ }
+
+ case Major.Destination: {
+ Console.Write("[Got Destination control {0}]", rtf.Minor);
+ rtf.SkipGroup();
+ break;
+ }
+
+ case Major.CharAttr: {
+ switch(rtf.Minor) {
+ case Minor.ForeColor: {
+ System.Windows.Forms.RTF.Color color;
+ int num;
+
+ color = System.Windows.Forms.RTF.Color.GetColor(rtf, rtf.Param);
+ if (color != null) {
+ if (color.Red == -1 && color.Green == -1 && color.Blue == -1) {
+ Console.Write("[Default Color]");
+ } else {
+ Console.Write("[Color {0} [{1:X2}{2:X2}{3:X}]]", rtf.Param, color.Red, color.Green, color.Blue);
+ }
+ }
+ break;
+ }
+
+ case Minor.FontSize: {
+ Console.Write("[Fontsize {0}]", rtf.Param);
+ break;
+ }
+
+ case Minor.FontNum: {
+ System.Windows.Forms.RTF.Font font;
+
+ font = System.Windows.Forms.RTF.Font.GetFont(rtf, rtf.Param);
+ if (font != null) {
+ Console.Write("[Font {0} [{1}]]", rtf.Param, font.Name);
+ }
+ break;
+ }
+
+ case Minor.Plain: {
+ Console.Write("[Normal]");
+ break;
+ }
+
+ case Minor.Bold: {
+ if (rtf.Param == RTF.NoParam) {
+ Console.Write("[Bold]");
+ } else {
+ Console.Write("[NoBold]");
+ }
+ break;
+ }
+
+ case Minor.Italic: {
+ if (rtf.Param == RTF.NoParam) {
+ Console.Write("[Italic]");
+ } else {
+ Console.Write("[NoItalic]");
+ }
+ break;
+ }
+
+ case Minor.StrikeThru: {
+ if (rtf.Param == RTF.NoParam) {
+ Console.Write("[StrikeThru]");
+ } else {
+ Console.Write("[NoStrikeThru]");
+ }
+ break;
+ }
+
+ case Minor.Underline: {
+ if (rtf.Param == RTF.NoParam) {
+ Console.Write("[Underline]");
+ } else {
+ Console.Write("[NoUnderline]");
+ }
+ break;
+ }
+
+ case Minor.NoUnderline: {
+ Console.Write("[NoUnderline]");
+ break;
+ }
+ }
+ break;
+ }
+
+ case Major.SpecialChar: {
+ Console.Write("[Got SpecialChar control {0}]", rtf.Minor);
+ SpecialChar(rtf);
+ break;
+ }
+ }
+ }
+
+ void SpecialChar(RTF rtf) {
+ switch(rtf.Minor) {
+ case Minor.Page:
+ case Minor.Sect:
+ case Minor.Row:
+ case Minor.Line:
+ case Minor.Par: {
+ Console.Write("\n");
+ break;
+ }
+
+ case Minor.Cell: {
+ Console.Write(" ");
+ break;
+ }
+
+ case Minor.NoBrkSpace: {
+ Console.Write(" ");
+ break;
+ }
+
+ case Minor.Tab: {
+ Console.Write("\t");
+ break;
+ }
+
+ case Minor.NoBrkHyphen: {
+ Console.Write("-");
+ break;
+ }
+
+ case Minor.Bullet: {
+ Console.Write("*");
+ break;
+ }
+
+ case Minor.EmDash: {
+ Console.Write("");
+ break;
+ }
+
+ case Minor.EnDash: {
+ Console.Write("");
+ break;
+ }
+
+ case Minor.LQuote: {
+ Console.Write("");
+ break;
+ }
+
+ case Minor.RQuote: {
+ Console.Write("");
+ break;
+ }
+
+ case Minor.LDblQuote: {
+ Console.Write("");
+ break;
+ }
+
+ case Minor.RDblQuote: {
+ Console.Write("");
+ break;
+ }
+
+ default: {
+ rtf.SkipGroup();
+ break;
+ }
+ }
+ }
+
+
+ void HandleText(RTF rtf) {
+ if (skip_count > 0) {
+ skip_count--;
+ return;
+ }
+ if ((StandardCharCode)rtf.Minor != StandardCharCode.nothing) {
+ Console.Write("{0}", text[(StandardCharCode)rtf.Minor]);
+ } else {
+ if ((int)rtf.Major > 31 && (int)rtf.Major < 128) {
+ Console.Write("{0}", (char)rtf.Major);
+ } else {
+ Console.Write("[Literal:0x{0:X2}]", (int)rtf.Major);
+ }
+ }
+ }
+
+ public static void Main() {
+ test = new Test();
+ }
+ }
+}
Property changes on: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/test.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.dll.sources
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.dll.sources 2005-09-05 23:57:52 UTC (rev 49517)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.dll.sources 2005-09-06 01:38:50 UTC (rev 49518)
@@ -263,6 +263,7 @@
System.Windows.Forms/QueryContinueDragEventArgs.cs
System.Windows.Forms/QueryContinueDragEventHandler.cs
System.Windows.Forms/RadioButton.cs
+System.Windows.Forms/RichTextBox.cs
System.Windows.Forms/RichTextBoxFinds.cs
System.Windows.Forms/RichTextBoxScrollBars.cs
System.Windows.Forms/RichTextBoxSelectionAttribute.cs
@@ -361,3 +362,25 @@
System.Windows.Forms/XplatUIStructs.cs
System.Windows.Forms/XplatUIWin32.cs
System.Windows.Forms/XplatUIX11.cs
+System.Windows.Forms.RTF/Charcode.cs
+System.Windows.Forms.RTF/Charset.cs
+System.Windows.Forms.RTF/CharsetFlags.cs
+System.Windows.Forms.RTF/CharsetType.cs
+System.Windows.Forms.RTF/ClassDelegate.cs
+System.Windows.Forms.RTF/Color.cs
+System.Windows.Forms.RTF/DestinationDelegate.cs
+System.Windows.Forms.RTF/Font.cs
+System.Windows.Forms.RTF/KeysInit.cs
+System.Windows.Forms.RTF/KeyStruct.cs
+System.Windows.Forms.RTF/Major.cs
+System.Windows.Forms.RTF/Minor.cs
+System.Windows.Forms.RTF/RTF.cs
+System.Windows.Forms.RTF/RTFException.cs
+System.Windows.Forms.RTF/StandardCharCode.cs
+System.Windows.Forms.RTF/StandardCharName.cs
+System.Windows.Forms.RTF/Style.cs
+System.Windows.Forms.RTF/StyleElement.cs
+System.Windows.Forms.RTF/StyleType.cs
+System.Windows.Forms.RTF/TextMap.cs
+System.Windows.Forms.RTF/TokenClass.cs
+
More information about the Mono-patches
mailing list