0023024: Update headers of OCCT files
[occt.git] / src / AlienImage / AlienImage_X11XWDFileHeader.cxx
CommitLineData
b311480e 1// Copyright (c) 1995-1999 Matra Datavision
2// Copyright (c) 1999-2012 OPEN CASCADE SAS
3//
4// The content of this file is subject to the Open CASCADE Technology Public
5// License Version 6.5 (the "License"). You may not use the content of this file
6// except in compliance with the License. Please obtain a copy of the License
7// at http://www.opencascade.org and read it completely before using this file.
8//
9// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
10// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
11//
12// The Original Code and all software distributed under the License is
13// distributed on an "AS IS" basis, without warranty of any kind, and the
14// Initial Developer hereby disclaims all such warranties, including without
15// limitation, any warranties of merchantability, fitness for a particular
16// purpose or non-infringement. Please see the License for the specific terms
17// and conditions governing the rights and limitations under the License.
18
7fd59977 19#ifndef WNT
20# include <X11/Xlib.h>
21#endif // WNT
22#include <AlienImage_X11XWDFileHeader.hxx>
23
24const Handle(Standard_Type)& STANDARD_TYPE(AlienImage_X11XWDFileHeader)
25{
26 static Handle(Standard_Type) _atype =
27 new Standard_Type ("AlienImage_X11XWDFileHeader", sizeof (AlienImage_X11XWDFileHeader));
28 return _atype;
29}
30
31Standard_Boolean operator == (
32 const AlienImage_X11XWDFileHeader& AnObject,
33 const AlienImage_X11XWDFileHeader& AnotherObject)
34
35{ Standard_Boolean _result = Standard_True;
36
37 _result = _result && (AnObject.header_size==
38 AnotherObject.header_size) ;
39 _result = _result && (AnObject.file_version==
40 AnotherObject.file_version) ;
41 _result = _result && (AnObject.pixmap_format==
42 AnotherObject.pixmap_format) ;
43 _result = _result && (AnObject.pixmap_depth==
44 AnotherObject.pixmap_depth) ;
45 _result = _result && (AnObject.pixmap_width==
46 AnotherObject.pixmap_width) ;
47 _result = _result && (AnObject.pixmap_height==
48 AnotherObject.pixmap_height) ;
49 _result = _result && (AnObject.xoffset==
50 AnotherObject.xoffset) ;
51 _result = _result && (AnObject.byte_order==
52 AnotherObject.byte_order) ;
53 _result = _result && (AnObject.bitmap_unit==
54 AnotherObject.bitmap_unit) ;
55 _result = _result && (AnObject.bitmap_bit_order==
56 AnotherObject.bitmap_bit_order) ;
57 _result = _result && (AnObject.bitmap_pad==
58 AnotherObject.bitmap_pad) ;
59 _result = _result && (AnObject.bits_per_pixel==
60 AnotherObject.bits_per_pixel) ;
61 _result = _result && (AnObject.bytes_per_line==
62 AnotherObject.bytes_per_line) ;
63 _result = _result && (AnObject.visual_class==
64 AnotherObject.visual_class) ;
65 _result = _result && (AnObject.red_mask==
66 AnotherObject.red_mask) ;
67 _result = _result && (AnObject.green_mask==
68 AnotherObject.green_mask) ;
69 _result = _result && (AnObject.blue_mask==
70 AnotherObject.blue_mask) ;
71 _result = _result && (AnObject.bits_per_rgb==
72 AnotherObject.bits_per_rgb) ;
73 _result = _result && (AnObject.colormap_entries==
74 AnotherObject.colormap_entries) ;
75 _result = _result && (AnObject.ncolors==
76 AnotherObject.ncolors) ;
77 _result = _result && (AnObject.window_width==
78 AnotherObject.window_width) ;
79 _result = _result && (AnObject.window_height==
80 AnotherObject.window_height) ;
81 _result = _result && (AnObject.window_x==
82 AnotherObject.window_x) ;
83 _result = _result && (AnObject.window_y==
84 AnotherObject.window_y) ;
85 _result = _result && (AnObject.window_bdrwidth==
86 AnotherObject.window_bdrwidth) ;
87
88 return _result;
89}
90
91//============================================================================
92//==== ShallowDump : Writes a CString value.
93//============================================================================
94void ShallowDump (
95 const AlienImage_X11XWDFileHeader& AnObject,Standard_OStream& s) {
96 s << "AlienImage_X11XWDFileHeader" << "\n";
97 s << "\theader_size\t:" << AnObject.header_size << "\n" ;
98 s << "\tfile_version\t:" << AnObject.file_version << "\n" ;
99 s << "\tpixmap_format\t:" ; switch( AnObject.pixmap_format ) {
100 case XYBitmap :
101 s << "XYBitmap" ; break ;
102 case XYPixmap :
103 s << "XYPixmap" ; break ;
104 case ZPixmap :
105 s << "ZPixmap" ; break ;
106 default :
107 s << AnObject.pixmap_format ; break ;
108 } ; s << "\n" ;
109 s << "\tpixmap_depth\t:" << AnObject.pixmap_depth << "\n" ;
110 s << "\tpixmap_width\t:" << AnObject.pixmap_width << "\n" ;
111 s << "\tpixmap_height\t:" << AnObject.pixmap_height << "\n" ;
112 s << "\txoffset\t:" << AnObject.xoffset << "\n" ;
113 s << "\tbyte_order\t:" ;
114 if ( AnObject.byte_order == LSBFirst ) s << "LSBFirst" ;
115 else s << "MSBFirst" ;
116 s << "\n" ;
117 s << "\tbitmap_unit\t:" << AnObject.bitmap_unit << "\n" ;
118 s << "\tbitmap_bit_order\t:" ;
119 if ( AnObject.bitmap_bit_order == LSBFirst ) s << "LSBFirst" ;
120 else s << "MSBFirst" ;
121 s << "\n" ;
122 s << "\tbitmap_pad\t:" << AnObject.bitmap_pad << "\n" ;
123 s << "\tbits_per_pixel\t:" << AnObject.bits_per_pixel << "\n" ;
124 s << "\tbytes_per_line\t:" << AnObject.bytes_per_line << "\n" ;
125 s << "\tvisual_class\t:" ; switch( AnObject.visual_class ) {
126 case StaticGray : s << "StaticGray" ; break ;
127 case GrayScale : s << "GrayScale" ; break ;
128 case StaticColor : s << "StaticColor" ; break ;
129 case PseudoColor : s << "PseudoColor" ; break ;
130 case TrueColor : s << "TrueColor" ; break ;
131 case DirectColor : s << "DirectColor" ; break ;
132 default : s << AnObject.visual_class ; break ;
133 } ; s << "\n" ;
134 s << "\tred_mask\t:" << AnObject.red_mask << "\n" ;
135 s << "\tgreen_mask\t:" << AnObject.green_mask << "\n" ;
136 s << "\tblue_mask\t:" << AnObject.blue_mask << "\n" ;
137 s << "\tbits_per_rgb\t:" << AnObject.bits_per_rgb << "\n" ;
138 s << "\tcolormap_entries\t:" << AnObject.colormap_entries << "\n" ;
139 s << "\tncolors\t:" << AnObject.ncolors << "\n" ;
140 s << "\twindow_width\t:" << AnObject.window_width << "\n" ;
141 s << "\twindow_height\t:" << AnObject.window_height << "\n" ;
142 s << "\twindow_x\t:" << AnObject.window_x << "\n" ;
143 s << "\twindow_y\t:" << AnObject.window_y << "\n" ;
144 s << "\twindow_bdrwidth\t:" << AnObject.window_bdrwidth << "\n" << flush ;
145}
146
147ostream& operator << ( ostream& s, const AlienImage_X11XWDFileHeader& h )
148
149{ ::ShallowDump( h, s ) ;
150 return( s ) ;
151}
152