* MainsoftWebApp20.Tomcat.vmwcsproj: converted to csproj
[mono.git] / mcs / class / System.Drawing / System.Drawing.Imaging / MetaHeader.cs
1 //
2 // System.Drawing.Imaging.MetaHeader.cs
3 //
4 // Authors:
5 //   Everaldo Canuto (everaldo.canuto@bol.com.br)
6 //   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
7 //   Dennis Hayes (dennish@raytek.com)
8 //   Sebastien Pouliot  <sebastien@ximian.com>
9 //
10 // (C) 2002 Ximian, Inc.  http://www.ximian.com
11 // Copyright (C) 2004, 2006 Novell, Inc (http://www.novell.com)
12 //
13 // Permission is hereby granted, free of charge, to any person obtaining
14 // a copy of this software and associated documentation files (the
15 // "Software"), to deal in the Software without restriction, including
16 // without limitation the rights to use, copy, modify, merge, publish,
17 // distribute, sublicense, and/or sell copies of the Software, and to
18 // permit persons to whom the Software is furnished to do so, subject to
19 // the following conditions:
20 // 
21 // The above copyright notice and this permission notice shall be
22 // included in all copies or substantial portions of the Software.
23 // 
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
28 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
29 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
30 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 //
32
33 using System.Runtime.InteropServices;
34
35 namespace System.Drawing.Imaging {
36
37         [StructLayout (LayoutKind.Sequential, Pack=2)]
38         internal struct WmfMetaHeader {
39                 // field order match: http://wvware.sourceforge.net/caolan/ora-wmf.html
40                 // for WMFHEAD structure
41                 public short file_type;
42                 public short header_size;
43                 public short version;
44                 public int file_size;
45                 public short num_of_objects;
46                 public int max_record_size;
47                 public short num_of_params;
48         }
49
50         [StructLayout (LayoutKind.Sequential)]
51         public sealed class MetaHeader {
52
53                 private WmfMetaHeader wmf;
54
55                 public MetaHeader ()
56                 {
57                 }
58
59                 internal MetaHeader (WmfMetaHeader header)
60                 {
61                         wmf.file_type = header.file_type;
62                         wmf.header_size = header.header_size;
63                         wmf.version = header.version;
64                         wmf.file_size = header.file_size;
65                         wmf.num_of_objects = header.num_of_objects;
66                         wmf.max_record_size = header.max_record_size;
67                         wmf.num_of_params = header.num_of_params;
68                 }
69
70
71                 public short HeaderSize {
72                         get { return wmf.header_size; }
73                         set { wmf.header_size = value; }
74                 }
75                 
76                 public int MaxRecord {
77                         get { return wmf.max_record_size; }
78                         set { wmf.max_record_size = value; }
79                 }
80                 
81                 public short NoObjects {
82                         get { return wmf.num_of_objects; }
83                         set { wmf.num_of_objects = value; }
84                 }
85                 
86                 public short NoParameters {
87                         get { return wmf.num_of_params; }
88                         set { wmf.num_of_params = value; }
89                 }
90                 
91                 public int Size {
92                         get { return wmf.file_size; }
93                         set { wmf.file_size = value; }
94                 }
95
96                 public short Type {
97                         get { return wmf.file_type; }
98                         set { wmf.file_type = value; }
99                 }
100
101                 public short Version {
102                         get { return wmf.version; }
103                         set { wmf.version = value; }
104                 }
105         }
106 }