b311480e |
1 | -- Created on: 1999-10-14 |
2 | -- Created by: VKH |
3 | -- Copyright (c) 1999 Matra Datavision |
4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
7fd59977 |
5 | -- |
b311480e |
6 | -- The content of this file is subject to the Open CASCADE Technology Public |
7 | -- License Version 6.5 (the "License"). You may not use the content of this file |
8 | -- except in compliance with the License. Please obtain a copy of the License |
9 | -- at http://www.opencascade.org and read it completely before using this file. |
10 | -- |
11 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
12 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
13 | -- |
14 | -- The Original Code and all software distributed under the License is |
15 | -- distributed on an "AS IS" basis, without warranty of any kind, and the |
16 | -- Initial Developer hereby disclaims all such warranties, including without |
17 | -- limitation, any warranties of merchantability, fitness for a particular |
18 | -- purpose or non-infringement. Please see the License for the specific terms |
19 | -- and conditions governing the rights and limitations under the License. |
20 | |
7fd59977 |
21 | -- Updated: GG IMP100701 Add the "depth" field and method |
22 | -- to the pixmap object. |
7fd59977 |
23 | |
24 | class PixMap from Xw |
25 | |
26 | ---Version: |
27 | |
28 | ---Purpose: This class defines a X11 pixmap |
29 | |
30 | ---Keywords: Bitmap, Pixmap, X11 |
31 | |
32 | inherits |
692613e5 |
33 | Transient from Standard |
7fd59977 |
34 | uses |
35 | Handle from Aspect, |
36 | Color from Quantity, |
37 | Window from Aspect, |
38 | Window from Xw |
39 | raises |
40 | PixmapDefinitionError from Aspect, |
41 | PixmapError from Aspect |
42 | is |
43 | Create ( aWindow : Window from Aspect; |
44 | aWidth, anHeight : Integer from Standard; |
45 | aDepth : Integer from Standard = 0 ) |
46 | returns mutable PixMap from Xw |
47 | raises PixmapDefinitionError from Aspect; |
48 | ---Level: Public |
49 | ---Purpose: Warning! When <aDepth> is NULL , the pixmap is created |
50 | -- with the SAME depth than the window <aWindow> |
51 | |
52 | --------------------------------------------------- |
53 | -- Category: Methods to modify the class definition |
54 | --------------------------------------------------- |
55 | |
56 | Destroy ( me : mutable ) |
57 | ---Level: Advanced |
58 | ---Purpose: Destroies the Pixmap |
59 | -- Trigger: Raises if Pixmap is not defined properly |
60 | raises PixmapError from Aspect is virtual; |
61 | |
62 | Dump ( me ; aFilename : CString from Standard; |
63 | aGammaValue: Real from Standard = 1.0 ) |
64 | returns Boolean |
65 | is virtual; |
66 | ---Level: Advanced |
67 | ---Purpose: |
68 | -- Dumps the Bitmap to an image file with |
69 | -- an optional gamma correction value |
70 | -- and returns TRUE if the dump occurs normaly. |
71 | ---Category: Methods to modify the class definition |
72 | |
73 | PixelColor ( me : in; |
74 | theX, theY : in Integer from Standard ) |
75 | returns Color from Quantity |
76 | is virtual; |
77 | ---Purpose: |
78 | -- Returns the pixel color. |
79 | |
80 | ---------------------------- |
81 | -- Category: Inquire methods |
82 | ---------------------------- |
83 | |
84 | PixmapID ( me ) returns Handle from Aspect is virtual; |
85 | ---Level: Advanced |
86 | ---Purpose: Returns the ID of the just created pixmap |
87 | ---Category: Inquire methods |
88 | |
89 | ---------------------------- |
90 | -- Category: Private methods |
91 | ---------------------------- |
92 | |
93 | PreferedDepth( me ; aWindow : Window from Aspect; |
94 | aDepth : Integer from Standard) |
95 | returns Integer from Standard is private; |
96 | |
97 | fields |
98 | myPixmap : Handle from Aspect is protected; |
99 | myWindow : Window from Xw; |
692613e5 |
100 | myWidth : Integer from Standard is protected; |
101 | myHeight : Integer from Standard is protected; |
102 | myDepth : Integer from Standard is protected; |
7fd59977 |
103 | end PixMap; |