OSDN Git Service

Add hostdepend/X86MAC64
[eos/hostdependX86LINUX64.git] / hostdepend / X86MAC64 / util / X86MAC64 / man / man3 / Ttk_UniformPadding.3
1 '\"
2 '\" Copyright (c) 2004 Joe English
3 '\"
4 '\" RCS: @(#) $Id: ttk_Geometry.3,v 1.4 2007/12/13 15:23:44 dgp Exp $
5 '\" 
6 .\" The -*- nroff -*- definitions below are for supplemental macros used
7 .\" in Tcl/Tk manual entries.
8 .\"
9 .\" .AP type name in/out ?indent?
10 .\"     Start paragraph describing an argument to a library procedure.
11 .\"     type is type of argument (int, etc.), in/out is either "in", "out",
12 .\"     or "in/out" to describe whether procedure reads or modifies arg,
13 .\"     and indent is equivalent to second arg of .IP (shouldn't ever be
14 .\"     needed;  use .AS below instead)
15 .\"
16 .\" .AS ?type? ?name?
17 .\"     Give maximum sizes of arguments for setting tab stops.  Type and
18 .\"     name are examples of largest possible arguments that will be passed
19 .\"     to .AP later.  If args are omitted, default tab stops are used.
20 .\"
21 .\" .BS
22 .\"     Start box enclosure.  From here until next .BE, everything will be
23 .\"     enclosed in one large box.
24 .\"
25 .\" .BE
26 .\"     End of box enclosure.
27 .\"
28 .\" .CS
29 .\"     Begin code excerpt.
30 .\"
31 .\" .CE
32 .\"     End code excerpt.
33 .\"
34 .\" .VS ?version? ?br?
35 .\"     Begin vertical sidebar, for use in marking newly-changed parts
36 .\"     of man pages.  The first argument is ignored and used for recording
37 .\"     the version when the .VS was added, so that the sidebars can be
38 .\"     found and removed when they reach a certain age.  If another argument
39 .\"     is present, then a line break is forced before starting the sidebar.
40 .\"
41 .\" .VE
42 .\"     End of vertical sidebar.
43 .\"
44 .\" .DS
45 .\"     Begin an indented unfilled display.
46 .\"
47 .\" .DE
48 .\"     End of indented unfilled display.
49 .\"
50 .\" .SO ?manpage?
51 .\"     Start of list of standard options for a Tk widget. The manpage
52 .\"     argument defines where to look up the standard options; if
53 .\"     omitted, defaults to "options". The options follow on successive
54 .\"     lines, in three columns separated by tabs.
55 .\"
56 .\" .SE
57 .\"     End of list of standard options for a Tk widget.
58 .\"
59 .\" .OP cmdName dbName dbClass
60 .\"     Start of description of a specific option.  cmdName gives the
61 .\"     option's name as specified in the class command, dbName gives
62 .\"     the option's name in the option database, and dbClass gives
63 .\"     the option's class in the option database.
64 .\"
65 .\" .UL arg1 arg2
66 .\"     Print arg1 underlined, then print arg2 normally.
67 .\"
68 .\" .QW arg1 ?arg2?
69 .\"     Print arg1 in quotes, then arg2 normally (for trailing punctuation).
70 .\"
71 .\" .PQ arg1 ?arg2?
72 .\"     Print an open parenthesis, arg1 in quotes, then arg2 normally
73 .\"     (for trailing punctuation) and then a closing parenthesis.
74 .\"
75 .\" RCS: @(#) $Id: man.macros,v 1.9 2008/01/29 15:32:33 dkf Exp $
76 .\"
77 .\"     # Set up traps and other miscellaneous stuff for Tcl/Tk man pages.
78 .if t .wh -1.3i ^B
79 .nr ^l \n(.l
80 .ad b
81 .\"     # Start an argument description
82 .de AP
83 .ie !"\\$4"" .TP \\$4
84 .el \{\
85 .   ie !"\\$2"" .TP \\n()Cu
86 .   el          .TP 15
87 .\}
88 .ta \\n()Au \\n()Bu
89 .ie !"\\$3"" \{\
90 \&\\$1 \\fI\\$2\\fP (\\$3)
91 .\".b
92 .\}
93 .el \{\
94 .br
95 .ie !"\\$2"" \{\
96 \&\\$1  \\fI\\$2\\fP
97 .\}
98 .el \{\
99 \&\\fI\\$1\\fP
100 .\}
101 .\}
102 ..
103 .\"     # define tabbing values for .AP
104 .de AS
105 .nr )A 10n
106 .if !"\\$1"" .nr )A \\w'\\$1'u+3n
107 .nr )B \\n()Au+15n
108 .\"
109 .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
110 .nr )C \\n()Bu+\\w'(in/out)'u+2n
111 ..
112 .AS Tcl_Interp Tcl_CreateInterp in/out
113 .\"     # BS - start boxed text
114 .\"     # ^y = starting y location
115 .\"     # ^b = 1
116 .de BS
117 .br
118 .mk ^y
119 .nr ^b 1u
120 .if n .nf
121 .if n .ti 0
122 .if n \l'\\n(.lu\(ul'
123 .if n .fi
124 ..
125 .\"     # BE - end boxed text (draw box now)
126 .de BE
127 .nf
128 .ti 0
129 .mk ^t
130 .ie n \l'\\n(^lu\(ul'
131 .el \{\
132 .\"     Draw four-sided box normally, but don't draw top of
133 .\"     box if the box started on an earlier page.
134 .ie !\\n(^b-1 \{\
135 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
136 .\}
137 .el \}\
138 \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
139 .\}
140 .\}
141 .fi
142 .br
143 .nr ^b 0
144 ..
145 .\"     # VS - start vertical sidebar
146 .\"     # ^Y = starting y location
147 .\"     # ^v = 1 (for troff;  for nroff this doesn't matter)
148 .de VS
149 .if !"\\$2"" .br
150 .mk ^Y
151 .ie n 'mc \s12\(br\s0
152 .el .nr ^v 1u
153 ..
154 .\"     # VE - end of vertical sidebar
155 .de VE
156 .ie n 'mc
157 .el \{\
158 .ev 2
159 .nf
160 .ti 0
161 .mk ^t
162 \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
163 .sp -1
164 .fi
165 .ev
166 .\}
167 .nr ^v 0
168 ..
169 .\"     # Special macro to handle page bottom:  finish off current
170 .\"     # box/sidebar if in box/sidebar mode, then invoked standard
171 .\"     # page bottom macro.
172 .de ^B
173 .ev 2
174 'ti 0
175 'nf
176 .mk ^t
177 .if \\n(^b \{\
178 .\"     Draw three-sided box if this is the box's first page,
179 .\"     draw two sides but no top otherwise.
180 .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
181 .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
182 .\}
183 .if \\n(^v \{\
184 .nr ^x \\n(^tu+1v-\\n(^Yu
185 \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
186 .\}
187 .bp
188 'fi
189 .ev
190 .if \\n(^b \{\
191 .mk ^y
192 .nr ^b 2
193 .\}
194 .if \\n(^v \{\
195 .mk ^Y
196 .\}
197 ..
198 .\"     # DS - begin display
199 .de DS
200 .RS
201 .nf
202 .sp
203 ..
204 .\"     # DE - end display
205 .de DE
206 .fi
207 .RE
208 .sp
209 ..
210 .\"     # SO - start of list of standard options
211 .de SO
212 'ie '\\$1'' .ds So \\fBoptions\\fR
213 'el .ds So \\fB\\$1\\fR
214 .SH "STANDARD OPTIONS"
215 .LP
216 .nf
217 .ta 5.5c 11c
218 .ft B
219 ..
220 .\"     # SE - end of list of standard options
221 .de SE
222 .fi
223 .ft R
224 .LP
225 See the \\*(So manual entry for details on the standard options.
226 ..
227 .\"     # OP - start of full description for a single option
228 .de OP
229 .LP
230 .nf
231 .ta 4c
232 Command-Line Name:      \\fB\\$1\\fR
233 Database Name:  \\fB\\$2\\fR
234 Database Class: \\fB\\$3\\fR
235 .fi
236 .IP
237 ..
238 .\"     # CS - begin code excerpt
239 .de CS
240 .RS
241 .nf
242 .ta .25i .5i .75i 1i
243 ..
244 .\"     # CE - end code excerpt
245 .de CE
246 .fi
247 .RE
248 ..
249 .\"     # UL - underline word
250 .de UL
251 \\$1\l'|0\(ul'\\$2
252 ..
253 .\"     # QW - apply quotation marks to word
254 .de QW
255 .ie '\\*(lq'"' ``\\$1''\\$2
256 .\"" fix emacs highlighting
257 .el \\*(lq\\$1\\*(rq\\$2
258 ..
259 .\"     # PQ - apply parens and quotation marks to word
260 .de PQ
261 .ie '\\*(lq'"' (``\\$1''\\$2)\\$3
262 .\"" fix emacs highlighting
263 .el (\\*(lq\\$1\\*(rq\\$2)\\$3
264 ..
265 .\"     # QR - quoted range
266 .de QR
267 .ie '\\*(lq'"' ``\\$1''\\-``\\$2''\\$3
268 .\"" fix emacs highlighting
269 .el \\*(lq\\$1\\*(rq\\-\\*(lq\\$2\\*(rq\\$3
270 ..
271 .\"     # MT - "empty" string
272 .de MT
273 .QW ""
274 ..
275 .TH Geometry 3 8.5 Tk "Tk Themed Widget"
276 .BS
277 .SH NAME
278 Ttk_MakeBox, Ttk_PadBox, Ttk_ExpandBox, Ttk_PackBox, Ttk_StickBox, Ttk_PlaceBox, Ttk_BoxContains, Ttk_MakePadding, Ttk_UniformPadding, Ttk_AddPadding, Ttk_RelievePadding, Ttk_GetPaddingFromObj, Ttk_GetBorderFromObj, Ttk_GetStickyFromObj \- Tk themed geometry utilities
279 .SH SYNOPSIS
280 .nf
281 \fB#include <tkTheme.h>\fR
282
283 Ttk_Box
284 \fBTtk_MakeBox\fR(int \fIx\fR, int \fIy\fR, int \fIwidth\fR, int \fIheight\fR);
285
286 Ttk_Box
287 \fBTtk_PadBox\fR(Ttk_Box \fIparcel\fR, Ttk_Padding \fIpadding\fR);
288
289 Ttk_Box
290 \fBTtk_ExpandBox\fR(Ttk_Box \fIparcel\fR, Ttk_Padding \fIpadding\fR);
291
292 Ttk_Box
293 \fBTtk_PackBox\fR(Ttk_Box *\fIcavity\fR, int \fIwidth\fR, int \fIheight\fR, Ttk_Side \fIside\fR);
294
295 Ttk_Box
296 \fBTtk_StickBox\fR(Ttk_Box \fIparcel\fR, int \fIwidth\fR, int \fIheight\fR, unsigned \fIsticky\fR);
297
298 Ttk_Box
299 \fBTtk_PlaceBox\fR(Ttk_Box *\fIcavity\fR, int \fIwidth\fR, int \fIheight\fR, Ttk_Side \fIside\fR, unsigned \fIsticky\fR);
300
301 Ttk_Box
302 \fBTtk_AnchorBox\fR(Ttk_Box \fIparcel\fR, int \fIwidth\fR, int \fIheight\fR, Tk_Anchor \fIanchor\fR);
303
304 Ttk_Padding
305 \fBTtk_MakePadding\fR(short \fIleft\fR, short \fItop\fR, short \fIright\fR, short \fIbottom\fR);
306
307 Ttk_Padding
308 \fBTtk_UniformPadding\fR(short \fIborder\fR);
309
310 Ttk_Padding
311 \fBTtk_AddPadding\fR(Ttk_Padding \fIpadding1\fR, Ttk_Padding \fIpadding2\fR;
312
313 Ttk_Padding 
314 \fBTtk_RelievePadding\fR(Ttk_Padding \fIpadding\fR, int \fIrelief\fR);
315
316 int
317 \fBTtk_BoxContains\fR(Ttk_Box \fIbox\fR, int \fIx\fR, int \fIy\fR);
318
319 int
320 \fBTtk_GetPaddingFromObj\fR(Tcl_Interp *\fIinterp\fR, Tk_Window \fItkwin\fR, Tcl_Obj *\fIobjPtr\fR, Ttk_Padding *\fIpadding_rtn\fR);
321
322 int
323 \fBTtk_GetBorderFromObj\fR(Tcl_Interp *\fIinterp\fR, Tcl_Obj *\fIobjPtr\fR, Ttk_Padding *\fIpadding_rtn\fR);
324
325 int
326 \fBTtk_GetStickyFromObj\fR(Tcl_Interp *\fIinterp\fR, Tcl_Obj *\fIobjPtr\fR, int *\fIsticky_rtn\fR);
327 .fi
328
329 .SH ARGUMENTS
330 .AP Tk_Anchor anchor in
331 One of the symbolic constants \fBTK_ANCHOR_N\fR, \fBTK_ANCHOR_NE\fR,
332 etc.  See \fITk_GetAnchorFromObj(3)\fR.
333 .AP "Ttk_Box *" cavity in/out
334 A rectangular region from which a parcel is allocated.
335 .AP short border in
336 Extra padding (in pixels) to add uniformly to each side of a region.
337 .AP short bottom in
338 Extra padding (in pixels) to add to the bottom of a region.
339 .AP Ttk_Box box in
340 .AP "Ttk_Box *" box_rtn out
341 Specifies a rectangular region.
342 .AP int height in
343 The height in pixels of a region.
344 .AP "Tcl_Interp *" interp in
345 Used to store error messages.
346 .AP int left in
347 Extra padding (in pixels) to add to the left side of a region.
348 .AP "Tcl_Obj *" objPtr in
349 String value contains a symbolic name 
350 to be converted to an enumerated value or bitmask.
351 Internal rep may be be modified to cache corresponding value.
352 .AP Ttk_Padding padding in
353 .AP "Ttk_Padding *" padding_rtn out
354 Extra padding to add on the inside of a region.
355 .AP Ttk_Box parcel in
356 A rectangular region, allocated from a cavity.
357 .AP int relief in
358 One of the standard Tk relief options 
359 (TK_RELIEF_RAISED, TK_RELIEF_SUNKEN, etc.).  
360 See \fBTk_GetReliefFromObj\fR.
361 .AP short right in
362 Extra padding (in pixles) to add to the right side of a region.
363 .AP Ttk_Side side in
364 One of \fBTTK_SIDE_LEFT\fR, \fBTTK_SIDE_TOP\fR, 
365 \fBTTK_SIDE_RIGHT\fR, or \fBTTK_SIDE_BOTTOM\fR.
366 .AP unsigned sticky in
367 A bitmask containing one or more of the bits
368 \fBTTK_STICK_W\fR (west, or left), 
369 \fBTTK_STICK_E\fR (east, or right, 
370 \fBTTK_STICK_N\fR (north, or top), and
371 \fBTTK_STICK_S\fR (south, or bottom).
372 \fBTTK_FILL_X\fR is defined as a synonym for (TTK_STICK_W|TTK_STICK_E),
373 \fBTTK_FILL_Y\fR is a synonym for (TTK_STICK_N|TTK_STICK_S),
374 and  \fBTTK_FILL_BOTH\fR and \fBTTK_STICK_ALL\fR
375 are synonyms for (TTK_FILL_X|TTK_FILL_Y).
376 See also: \fIgrid(n)\fR.
377 .AP Tk_Window tkwin in
378 Window whose screen geometry determines 
379 the conversion between absolute units and pixels.
380 .AP short top in
381 Extra padding at the top of a region.
382 .AP int width in
383 The width in pixels of a region.
384 .AP int x in
385 X coordinate of upper-left corner of region.
386 .AP int y in
387 Y coordinate of upper-left corner of region.
388 .BE
389
390 .SH "BOXES"
391 The \fBTtk_Box\fR structure represents a rectangular region of a window: 
392 .CS
393 typedef struct  {
394     int x;
395     int y;
396     int width;
397     int height;
398 } Ttk_Box;
399 .CE
400 All coordinates are relative to the window.
401 .PP
402 \fBTtk_MakeBox\fR is a convenience routine that contsructs
403 a \fBTtk_Box\fR structure representing a region \fIwidth\fR pixels
404 wide, \fIheight\fR pixels tall, at the specified \fIx, y\fR coordinates.
405 .PP
406 \fBTtk_PadBox\fR returns a new box located inside the specified \fIparcel\fR,
407 shrunken according to the left, top, right, and bottom margins 
408 specified by \fIpadding\fR.
409 .PP
410 \fBTtk_ExpandBox\fR is the inverse of \fBTtk_PadBox\fR:
411 it returns a new box surrounding the specified \fIparcel\fR,
412 expanded  according to the left, top, right, and bottom margins 
413 specified by \fIpadding\fR.
414 .PP
415 \fBTtk_PackBox\fR allocates a parcel \fIwidth\fR by \fIheight\fR
416 pixels wide on the specified \fIside\fR of the \fIcavity\fR,
417 and shrinks the \fIcavity\fR accordingly.
418 .PP
419 \fBTtk_StickBox\fR places a box with the requested \fIwidth\fR
420 and \fIheight\fR inside the \fIparcel\fR according to the 
421 \fIsticky\fR bits.
422 .PP
423 \fBTtk_PlaceBox\fR combines \fBTtk_PackBox\fR and \fBTtk_StickBox\fR:
424 it allocates a parcel on the specified \fIside\fR of the \fIcavity\fR,
425 places a box of the requested size inside the parcel according to \fIsticky\fR,
426 and shrinks the \fIcavity\fR.
427 .PP
428 \fBTtk_AnchorBox\fR places a box with the requested \fIwidth\fR
429 and \fIheight\fR inside the \fIparcel\fR according to the
430 specified \fIanchor\fR option.
431 .PP
432 \fBTtk_BoxContains\fR tests if the specified \fIx, y\fR coordinate
433 lies within the rectangular region \fIbox\fR.
434 .SH "PADDDING"
435 The \fBTtk_Padding\fR structure is used to represent 
436 borders, internal padding, and external margins:
437 .CS
438 typedef struct {
439     short left;
440     short top;
441     short right;
442     short bottom;
443 } Ttk_Padding;
444 .CE
445 .PP 
446 \fBTtk_MakePadding\fR is a convenience routine that contsructs
447 a \fBTtk_Padding\fR structure with the specified left, top, right, and bottom
448 components.  
449 .PP
450 \fBTtk_UniformPadding\fR constructs a \fBTtk_Padding\fR structure
451 with all components equal to the specified \fIborder\fR.
452 .PP
453 \fBTtk_AddPadding\fR adds two \fBTtk_Padding\fRs together
454 and returns a combined padding containing the sum of the
455 individual padding components.
456 .PP
457 \fBTtk_RelievePadding\fR 
458 adds an extra 2 pixels of padding to \fIpadding\fR
459 according to the specified \fIrelief\fR.
460 If \fIrelief\fR is \fBTK_RELIEF_SUNKEN\fR, 
461 adds two pixels at the top and left
462 so the inner region is shifted down and to the left.
463 If it is \fBTK_RELIEF_RAISED\fR, adds two pixels
464 at the bottom and right so 
465 the inner region is shifted up and to the right.
466 Otherwise, adds 1 pixel on all sides.
467 This is typically used in element geometry procedures to simulate a
468 .QW pressed-in
469 look for pushbuttons.
470 .SH "CONVERSION ROUTINES"
471 \fBTtk_GetPaddingFromObj\fR converts the string in \fIobjPtr\fR
472 to a \fBTtk_Padding\fR structure.
473 The string representation is a list of 
474 up to four length specifications 
475 .QW "\fIleft top right bottom\fR" .
476 If fewer than four elements are specified, 
477 \fIbottom\fR defaults to \fItop\fR,
478 \fIright\fR defaults to \fIleft\fR, and 
479 \fItop\fR defaults to \fIleft\fR.
480 See \fBTk_GetPixelsFromObj(3)\fR for the syntax of length specifications.
481 .PP
482 \fBTtk_GetBorderFromObj\fR is the same as \fBTtk_GetPaddingFromObj\fR
483 except that the lengths are specified as integers 
484 (i.e., resolution-dependant values like \fI3m\fR are not allowed).
485 .PP
486 \fBTtk_GetStickyFromObj\fR converts the string in \fIobjPtr\fR
487 to a \fIsticky\fR bitmask.  The string contains zero or more
488 of the characters \fBn\fR, \fBs\fR, \fBe\fR, or \fBw\fR.
489 .SH "SEE ALSO"
490 Tk_GetReliefFromObj(3), Tk_GetPixelsFromObj(3), Tk_GetAnchorFromObj(3)
491 .SH "KEYWORDS"
492 geometry, padding, margins, box, region, sticky, relief