summaryrefslogtreecommitdiff
path: root/src/Xw/Xw_IconBox.cdl
blob: bbf6d5b0496890ce788bc0d670d1dafa23b44207 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
--
-- File:	Xw_IconBox.cdl
-- Created:	2 Mars 1994
-- Author:	GG
--
---Copyright:	MatraDatavision 1991,1992,1993

class IconBox from Xw inherits Window from Xw

	---Version:

	---Purpose: This class defines a X11 IconBox
	--  Warning: The IconBox is not visible at the creation time .
	--	    To show the Icon Box use the method Show () .
	--	    In this case the Icon Box appears at the DSU position
	--	    specified given in [0,1] space .
	--	    The size of the Icon Box grows depending of the number
	--	    of the Icons loaded inside .

	---References:

uses

	NameOfColor 	from Quantity,
	GraphicDevice	from Xw,
	TypeOfVisual 	from Xw,
	Handle		from Aspect,
	WindowQuality   from Xw

raises

	WindowDefinitionError	from Aspect,
	WindowError		from Aspect

is

	Create ( Device	: GraphicDevice from Xw ;
		 Name	: CString from Standard ;
		 Xc	: Real from Standard = 0.5 ;
		 Yc	: Real from Standard = 0.5 ;
		 BackColor : NameOfColor from Quantity = Quantity_NOC_MATRAGRAY;
		 aQuality : WindowQuality from Xw = Xw_WQ_SAMEQUALITY)
	returns mutable IconBox from Xw
	---Level: Public
	---Purpose: Creates a IconBox n Preferred PseudoColor Visual
	--	    defined by his Center in DSU and connects it to the
	--	    X server at the first call depending of the GraphicDevice
	--	    connexion .
	--	    ALL Icons are loaded from the Icon File Directory Name :
	--	    "[$SYMBOL]xxxxxxx[.ifd]"
	--  Warning: Raises if the Position is out of the Screen Space
	--	    or the Icon File Directory Name don't exist
	raises WindowDefinitionError from Aspect ;

	---------------------------------------------------
	-- Category: Methods to modify the class definition
	---------------------------------------------------

	LoadIcons ( me : mutable ; Name : CString from Standard ) 
					returns Integer from Standard is static;
	---Level: Public
	---Purpose: Loads Icon Box from an Other Icon File Directory Name
	--  and returns the loaded icons number.
	--  Warning: The Icons previously loaded are NOT cleared .
	---Category: Methods to modify the class definition

	Show ( me )  is static;
	---Level: Public
	---Purpose: Shows Icon Box to the screen
	--  Warning: The Icon Box is displayed at the centered position
	--	    specified at the creation time and the size depend
	--	    of the Icon number really loaded inside .

	UnloadIcons ( me : mutable ; Name : CString from Standard ) 
					returns Integer from Standard is static;
	---Level: Public
	---Purpose: Unloads All previously loaded Icons in the IconBox
        --  and returns the unloaded icons number.
	---Category: methods to modify the class definition

	Destroy ( me : mutable) is redefined ;
	---Level: Public
	---Purpose: Destroies the IconBox
	---C++: alias ~
	---Category: Methods to modify the class definition

	AddIcon ( me : mutable ; W : Window from Xw ;
	      Name : CString from Standard;
	      aWidth : Integer from Standard = 0;
	      aHeight : Integer from Standard = 0) is static;
	---Level: Public
	---Purpose: Adds an Icon of Size aWidth,aHeight given in PIXEL
	--  to the Icon Box from a FULL Existing Window
	--  NOTE that if aWidth or aHeight is 0 the default icon size is taken.
	---Category: methods to modify the class definition

	SaveIcons ( me ) returns Integer from Standard is static;
	---Level: Public
	---Purpose:  Saves all new created Icons as iconname.xwd file in the user
	--  directory and returns the saved icons number.
	
	----------------------------
	-- Category: Inquire methods
	----------------------------

	IconNumber ( me )
	returns Integer from Standard is static;
	---Level: Public
	---Purpose: Returns the Number of Icons loaded in the Icon Box .

	IconName ( me ; Index : Integer from Standard )
	returns CString from Standard
	---Level: Public
	---Purpose: Returns the Name of the N ime Icon
	--  Warning: Raises if Index if out of range depending of the
	--	    Number of Loaded Icons .
	raises WindowError from Aspect is static;

	IconSize ( me ; Name : CString from Standard ;
			Width, Height : out Integer from Standard )
	returns Boolean from Standard is static;
	---Level: Public
	---Purpose: Returns the Pixmap Size attached to the Icon Name
	--  Warning: May return FALSE if Icon doesn't exist in the IconBox .
	---Category: Inquire methods

	IconPixmap ( me ; Name : CString from Standard )
	returns Handle from Aspect is static;
	---Level: Public
	---Purpose: Returns the Pixmap attached to the Icon Name
	--  Warning: May return 0 if Icon doesn't exist in the IconBox .
	---Category: Inquire methods

	IconPixmap ( me ; Name : CString from Standard ;
			  Width, Height : Integer from Standard )
	returns Handle from Aspect is static;
	---Level: Public
	---Purpose: Returns the Centered part of the Pixmap of required Size
	--	    attached to the Icon Name
	--  Warning: May return 0 if Icon doesn't exist in the IconBox .
	---Category: Inquire methods

fields

	MyNumberOfIcons	: Integer from Standard ;

end IconBox ;