1 {
2 File: HIToolbox/HIView.h
3
4 Contains: HIView routines
5
6 Version: HIToolbox-624~3
7
8 Copyright: � 2001-2008 by Apple Computer, Inc., all rights reserved.
9
10 Bugs?: For bug reports, consult the following page on
11 the World Wide Web:
12
13 http://bugs.freepascal.org
14
15 }
16 { File: HIView.p(.pas) }
17 { }
18 { Contains: CodeWarrior Pascal( GPC) translation of Apple's Mac OS X 10.3 HIView.h }
19 { Translation compatible with make-gpc-interfaces.pl generated MWPInterfaces }
20 { (GPCPInterfaces). For the 10.2 available APIs, the CodeWarrior Pascal translation }
21 { is linkable with Mac OS X 10.2.x or higher CFM CarbonLib and the GPC translation is }
22 { linkable with Mac OS X 10.2.x or higher Mach-O Carbon.framework. For the 10.3 }
23 { available APIs, the CodeWarrior Pascal translation is only selectively linkable with }
24 { Mac OS X 10.3.x or higher CFM CarbonLib and the GPC translation is linkable with Mac }
25 { OS X 10.3.x or higher Mach-O Carbon.framework. }
26 { }
27 { Version: 1.1 }
28 { }
29 { Pascal Translation: Gale Paeper, <gpaeper@empirenet.com>, 2004 }
30 { }
31 { Copyright: Subject to the constraints of Apple's original rights, you're free to use this }
32 { translation as you deem fit. }
33 { }
34 { Bugs?: This is an AS IS translation with no express guarentees of any kind. }
35 { If you do find a bug, please help out the Macintosh Pascal programming community by }
36 { reporting your bug finding and possible fix to either personal e-mail to Gale Paeper }
37 { or a posting to the MacPascal mailing list. }
38 {
39 Change History (most recent first ):
40
41 <4> 4/8/04 GRP Completed new additions from HIView.h, version HIToolbox-145.33~1.
42 <3> ?/?/04 PNL Added most new additions from HIView.h, version HIToolbox-145.33~1.
43 <2> 10/02/04 GRP Added support for GPC as well as CodeWarrior Pascal.
44 <1> 9/8/03 GRP First Pascal translation of HIView.h, version HIToolbox-123.6~10.
45 }
46 { Translation assisted by: }
47 {This file was processed by Dan's Source Converter}
48 {version 1.3 (this version modified by Ingemar Ragnemalm)}
49 { Pascal Translation Updated: Peter N Lewis, <peter@stairways.com.au>, August 2005 }
50 { Pascal Translation Updated: Jonas Maebe, <jonas@freepascal.org>, October 2009 }
51 { Pascal Translation Updated: Gorazd Krosl, <gorazd_1957@yahoo.ca>, October 2009 }
52 { Pascal Translation Updated: Jonas Maebe, <jonas@freepascal.org>, October 2012 }
53 {
54 Modified for use with Free Pascal
55 Version 308
56 Please report any bugs to <gpc@microbizz.nl>
57 }
58
59 {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
60 {$mode macpas}
61 {$modeswitch cblocks}
62 {$packenum 1}
63 {$macro on}
64 {$inline on}
65 {$calling mwpascal}
66
67 unit HIView;
68 interface
69 {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
70 {$setc GAP_INTERFACES_VERSION := $0308}
71
72 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
73 {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
74 {$endc}
75
76 {$ifc defined CPUPOWERPC and defined CPUI386}
77 {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
78 {$endc}
79 {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
80 {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
81 {$endc}
82
83 {$ifc not defined __ppc__ and defined CPUPOWERPC32}
84 {$setc __ppc__ := 1}
85 {$elsec}
86 {$setc __ppc__ := 0}
87 {$endc}
88 {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
89 {$setc __ppc64__ := 1}
90 {$elsec}
91 {$setc __ppc64__ := 0}
92 {$endc}
93 {$ifc not defined __i386__ and defined CPUI386}
94 {$setc __i386__ := 1}
95 {$elsec}
96 {$setc __i386__ := 0}
97 {$endc}
98 {$ifc not defined __x86_64__ and defined CPUX86_64}
99 {$setc __x86_64__ := 1}
100 {$elsec}
101 {$setc __x86_64__ := 0}
102 {$endc}
103 {$ifc not defined __arm__ and defined CPUARM}
104 {$setc __arm__ := 1}
105 {$elsec}
106 {$setc __arm__ := 0}
107 {$endc}
108 {$ifc not defined __arm64__ and defined CPUAARCH64}
109 {$setc __arm64__ := 1}
110 {$elsec}
111 {$setc __arm64__ := 0}
112 {$endc}
113
114 {$ifc defined cpu64}
115 {$setc __LP64__ := 1}
116 {$elsec}
117 {$setc __LP64__ := 0}
118 {$endc}
119
120
121 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
122 {$error Conflicting definitions for __ppc__ and __i386__}
123 {$endc}
124
125 {$ifc defined __ppc__ and __ppc__}
126 {$setc TARGET_CPU_PPC := TRUE}
127 {$setc TARGET_CPU_PPC64 := FALSE}
128 {$setc TARGET_CPU_X86 := FALSE}
129 {$setc TARGET_CPU_X86_64 := FALSE}
130 {$setc TARGET_CPU_ARM := FALSE}
131 {$setc TARGET_CPU_ARM64 := FALSE}
132 {$setc TARGET_OS_MAC := TRUE}
133 {$setc TARGET_OS_IPHONE := FALSE}
134 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
135 {$setc TARGET_OS_EMBEDDED := FALSE}
136 {$elifc defined __ppc64__ and __ppc64__}
137 {$setc TARGET_CPU_PPC := FALSE}
138 {$setc TARGET_CPU_PPC64 := TRUE}
139 {$setc TARGET_CPU_X86 := FALSE}
140 {$setc TARGET_CPU_X86_64 := FALSE}
141 {$setc TARGET_CPU_ARM := FALSE}
142 {$setc TARGET_CPU_ARM64 := FALSE}
143 {$setc TARGET_OS_MAC := TRUE}
144 {$setc TARGET_OS_IPHONE := FALSE}
145 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
146 {$setc TARGET_OS_EMBEDDED := FALSE}
147 {$elifc defined __i386__ and __i386__}
148 {$setc TARGET_CPU_PPC := FALSE}
149 {$setc TARGET_CPU_PPC64 := FALSE}
150 {$setc TARGET_CPU_X86 := TRUE}
151 {$setc TARGET_CPU_X86_64 := FALSE}
152 {$setc TARGET_CPU_ARM := FALSE}
153 {$setc TARGET_CPU_ARM64 := FALSE}
154 {$ifc defined iphonesim}
155 {$setc TARGET_OS_MAC := FALSE}
156 {$setc TARGET_OS_IPHONE := TRUE}
157 {$setc TARGET_IPHONE_SIMULATOR := TRUE}
158 {$elsec}
159 {$setc TARGET_OS_MAC := TRUE}
160 {$setc TARGET_OS_IPHONE := FALSE}
161 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
162 {$endc}
163 {$setc TARGET_OS_EMBEDDED := FALSE}
164 {$elifc defined __x86_64__ and __x86_64__}
165 {$setc TARGET_CPU_PPC := FALSE}
166 {$setc TARGET_CPU_PPC64 := FALSE}
167 {$setc TARGET_CPU_X86 := FALSE}
168 {$setc TARGET_CPU_X86_64 := TRUE}
169 {$setc TARGET_CPU_ARM := FALSE}
170 {$setc TARGET_CPU_ARM64 := FALSE}
171 {$ifc defined iphonesim}
172 {$setc TARGET_OS_MAC := FALSE}
173 {$setc TARGET_OS_IPHONE := TRUE}
174 {$setc TARGET_IPHONE_SIMULATOR := TRUE}
175 {$elsec}
176 {$setc TARGET_OS_MAC := TRUE}
177 {$setc TARGET_OS_IPHONE := FALSE}
178 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
179 {$endc}
180 {$setc TARGET_OS_EMBEDDED := FALSE}
181 {$elifc defined __arm__ and __arm__}
182 {$setc TARGET_CPU_PPC := FALSE}
183 {$setc TARGET_CPU_PPC64 := FALSE}
184 {$setc TARGET_CPU_X86 := FALSE}
185 {$setc TARGET_CPU_X86_64 := FALSE}
186 {$setc TARGET_CPU_ARM := TRUE}
187 {$setc TARGET_CPU_ARM64 := FALSE}
188 {$setc TARGET_OS_MAC := FALSE}
189 {$setc TARGET_OS_IPHONE := TRUE}
190 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
191 {$setc TARGET_OS_EMBEDDED := TRUE}
192 {$elifc defined __arm64__ and __arm64__}
193 {$setc TARGET_CPU_PPC := FALSE}
194 {$setc TARGET_CPU_PPC64 := FALSE}
195 {$setc TARGET_CPU_X86 := FALSE}
196 {$setc TARGET_CPU_X86_64 := FALSE}
197 {$setc TARGET_CPU_ARM := FALSE}
198 {$setc TARGET_CPU_ARM64 := TRUE}
199 {$ifc defined ios}
200 {$setc TARGET_OS_MAC := FALSE}
201 {$setc TARGET_OS_IPHONE := TRUE}
202 {$setc TARGET_OS_EMBEDDED := TRUE}
203 {$elsec}
204 {$setc TARGET_OS_MAC := TRUE}
205 {$setc TARGET_OS_IPHONE := FALSE}
206 {$setc TARGET_OS_EMBEDDED := FALSE}
207 {$endc}
208 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
209 {$elsec}
210 {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
211 {$endc}
212
213 {$ifc defined __LP64__ and __LP64__ }
214 {$setc TARGET_CPU_64 := TRUE}
215 {$elsec}
216 {$setc TARGET_CPU_64 := FALSE}
217 {$endc}
218
219 {$ifc defined FPC_BIG_ENDIAN}
220 {$setc TARGET_RT_BIG_ENDIAN := TRUE}
221 {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
222 {$elifc defined FPC_LITTLE_ENDIAN}
223 {$setc TARGET_RT_BIG_ENDIAN := FALSE}
224 {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
225 {$elsec}
226 {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
227 {$endc}
228 {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
229 {$setc CALL_NOT_IN_CARBON := FALSE}
230 {$setc OLDROUTINENAMES := FALSE}
231 {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
232 {$setc OPAQUE_UPP_TYPES := TRUE}
233 {$setc OTCARBONAPPLICATION := TRUE}
234 {$setc OTKERNEL := FALSE}
235 {$setc PM_USE_SESSION_APIS := TRUE}
236 {$setc TARGET_API_MAC_CARBON := TRUE}
237 {$setc TARGET_API_MAC_OS8 := FALSE}
238 {$setc TARGET_API_MAC_OSX := TRUE}
239 {$setc TARGET_CARBON := TRUE}
240 {$setc TARGET_CPU_68K := FALSE}
241 {$setc TARGET_CPU_MIPS := FALSE}
242 {$setc TARGET_CPU_SPARC := FALSE}
243 {$setc TARGET_OS_UNIX := FALSE}
244 {$setc TARGET_OS_WIN32 := FALSE}
245 {$setc TARGET_RT_MAC_68881 := FALSE}
246 {$setc TARGET_RT_MAC_CFM := FALSE}
247 {$setc TARGET_RT_MAC_MACHO := TRUE}
248 {$setc TYPED_FUNCTION_POINTERS := TRUE}
249 {$setc TYPE_BOOL := FALSE}
250 {$setc TYPE_EXTENDED := FALSE}
251 {$setc TYPE_LONGLONG := TRUE}
252 uses MacTypes,CFArray,CFBase,CGBase,CGContext,CGImage,CarbonEventsCore,Drag,Events,QuickdrawTypes,Menus,Appearance,Controls,CarbonEvents,HIGeometry,HIObject,IconsCore,Icons,HIShape,HITheme,CTFont;
253 {$endc} {not MACOSALLINCLUDE}
254
255
256 {$ifc TARGET_OS_MAC}
257
258 {$ALIGN MAC68K}
259
260 type
261 HIViewID = ControlID;
262
263 {
264 * Discussion:
265 * HIViewZOrderOp
266 }
267 const
268 {
269 * Indicates we wish to order a view above another view.
270 }
271 kHIViewZOrderAbove = 1;
272
273 {
274 * Indicates we wish to order a view below another view.
275 }
276 kHIViewZOrderBelow = 2;
277
278 type
279 HIViewZOrderOp = UInt32;
280
281 {
282 * HIViewFrameMetrics
283 *
284 * Summary:
285 * Describes the offsets from the structure to the content area of a
286 * view; for example, the top metric is the difference between the
287 * vertical coordinate of the top edge of the view�s structure
288 * region and the vertical coordinate of the top edge of the view�s
289 * content region. This structure is returned by a view in response
290 * to a kEventControlGetFrameMetrics event.
291 }
292 type
293 HIViewFrameMetrics = record
294 {
295 * Height of the top of the structure area.
296 }
297 top: CGFloat;
298
299 {
300 * Width of the left of the structure area.
301 }
302 left: CGFloat;
303
304 {
305 * Height of the bottom of the structure area.
306 }
307 bottom: CGFloat;
308
309 {
310 * Width of the right of the structure area.
311 }
312 right: CGFloat;
313 end;
314 {==============================================================================}
315 { ATTRIBUTES }
316 {==============================================================================}
317
318 {
319 * Summary:
320 * View attributes are generally determined by clients of the view;
321 * the view itself should observe the attributes and behave
322 * accordingly.
323 *
324 * Discussion:
325 * View Attributes
326 }
327 const
328 {
329 * When set, the view will send the command it generates to the user
330 * focus and propagate as it would naturally from there. The default
331 * is to send the command to itself and then to its parent and so
332 * forth.
333 }
334 kHIViewAttributeSendCommandToUserFocus = 1 shl 0;
335
336 {
337 * Indicates that a text editing view should behave appropriately for
338 * editing fields in a dialog; specifically, the view should ignore
339 * the Return, Enter, Escape, and Tab keys, and allow them to be
340 * processed by other participants in the event flow. Available on
341 * Mac OS X 10.3 and later.
342 }
343 kHIViewAttributeIsFieldEditor = 1 shl 1;
344
345 {
346 * Legacy synonym for kHIViewAttributeSendCommandToUserFocus. Please
347 * use it instead.
348 }
349 kHIViewSendCommandToUserFocus = kHIViewAttributeSendCommandToUserFocus;
350
351
352 {
353 * HIView features
354 *
355 * Summary:
356 * View feature flags are generally determined by the view itself,
357 * and are not typically changed by clients of the view.
358 *
359 * Historical note: This list is similar to the list of Control
360 * Feature Bits in Controls.h. This list is shorter because some of
361 * the Control Manager constants were introduced to enable the
362 * Control Manager to tell whether a CDEF supported a new CDEF
363 * message. This capability is not required by the HIView Manager,
364 * because an HIView that doesn't support a particular Carbon event
365 * will simply ignore it.
366 }
367 const
368 {
369 * This view supports using the ghosting protocol when live tracking
370 * is not enabled.
371 }
372 kHIViewFeatureSupportsGhosting = 1 shl 0;
373
374 {
375 * This view allows subviews to be embedded within it.
376 }
377 kHIViewFeatureAllowsSubviews = 1 shl 1;
378
379 {
380 * If this view is clicked, the keyboard focus should be set to this
381 * view automatically. This is primarily used for edit text views.
382 }
383 kHIViewFeatureGetsFocusOnClick = 1 shl 8;
384
385 {
386 * This view supports the live feedback protocol. Necessary to
387 * implement live scroll bar tracking. Clients of a view should never
388 * disable this.
389 }
390 kHIViewFeatureSupportsLiveFeedback = 1 shl 10;
391
392 {
393 * This view can be put into a radio group. Radio buttons and bevel
394 * buttons report this behavior.
395 }
396 kHIViewFeatureSupportsRadioBehavior = 1 shl 11;
397
398 {
399 * This view supports the auto-toggle protocol and should at the very
400 * least auto- toggle from off to on and back. The view can support a
401 * carbon event for more advanced auto-toggling of its value. The tab
402 * view supports this, for example, so that when a tab is clicked its
403 * value changes automatically.
404 }
405 kHIViewFeatureAutoToggles = 1 shl 14;
406
407 {
408 * This is merely informational. Turning it off would not necessarily
409 * disable any timer a view might be using, but it could obey this
410 * bit if it so desired.
411 }
412 kHIViewFeatureIdlesWithTimer = 1 shl 23;
413
414 {
415 * This tells the Control Manager that the up button part increases
416 * the value of the view instead of decreasing it. For example, the
417 * Little Arrows (Spinner) view increase its value when the up button
418 * is pressed. Scroll bars, on the other hand, decrease the value
419 * when their up buttons are pressed.
420 }
421 kHIViewFeatureInvertsUpDownValueMeaning = 1 shl 24;
422
423 {
424 * This is an optimization for determining a view's opaque region.
425 * When set, the view system just uses the view's structure region,
426 * and can usually avoid having to call the view at all.
427 }
428 kHIViewFeatureIsOpaque = 1 shl 25;
429
430 {
431 * This is an optimization for determining what gets invalidated when
432 * views are dirtied. For example, on a metal window, the content
433 * view is actually fully transparent, so invalidating it doesn't
434 * really help things. By telling the Control Manager that the view
435 * is transparent and does not do any drawing, we can avoid trying to
436 * invalidate it and instead invalidate views behind it.
437 }
438 kHIViewFeatureDoesNotDraw = 1 shl 27;
439
440 {
441 * Indicates to the Control Manager that this view doesn't use the
442 * special part codes for indicator, inactive, and disabled.
443 * Available in Mac OS X 10.3 and later.
444 }
445 kHIViewFeatureDoesNotUseSpecialParts = 1 shl 28;
446
447 {
448 * This is an optimization for determining the clickable region of a
449 * window (used for metal windows, for example, when doing async
450 * window dragging). The presence of this bit tells us not to bother
451 * asking the view for the clickable region. A view like the visual
452 * separator would set this bit. It's typically used in conjunction
453 * with the kHIViewFeatureDoesNotDraw bit.
454 }
455 kHIViewFeatureIgnoresClicks = 1 shl 29;
456
457
458 {
459 * HIView valid feature sets
460 *
461 * Summary:
462 * These are sets of features that are available on the version of
463 * Mac OS X corresponding to that named in the constant.
464 }
465 const
466 kHIViewValidFeaturesForPanther = $3B804D03;
467
468
469 {
470 * HIView feature synonyms
471 *
472 * Summary:
473 * Legacy synonyms for HIView feature bit names. Please use the
474 * newer names.
475 }
476 const
477 kHIViewSupportsGhosting = kHIViewFeatureSupportsGhosting;
478 kHIViewAllowsSubviews = kHIViewFeatureAllowsSubviews;
479 kHIViewGetsFocusOnClick = kHIViewFeatureGetsFocusOnClick;
480 kHIViewSupportsLiveFeedback = kHIViewFeatureSupportsLiveFeedback;
481 kHIViewSupportsRadioBehavior = kHIViewFeatureSupportsRadioBehavior;
482 kHIViewAutoToggles = kHIViewFeatureAutoToggles;
483 kHIViewIdlesWithTimer = kHIViewFeatureIdlesWithTimer;
484 kHIViewInvertsUpDownValueMeaning = kHIViewFeatureInvertsUpDownValueMeaning;
485 kHIViewIsOpaque = kHIViewFeatureIsOpaque;
486 kHIViewDoesNotDraw = kHIViewFeatureDoesNotDraw;
487 kHIViewDoesNotUseSpecialParts = kHIViewFeatureDoesNotUseSpecialParts;
488 kHIViewIgnoresClicks = kHIViewFeatureIgnoresClicks;
489
490
491 type
492 HIViewFeatures = UInt64;
493 {==============================================================================}
494 { VIEW PART CODES }
495 {==============================================================================}
496 type
497 HIViewPartCode = ControlPartCode;
498 HIViewPartCodePtr = ^HIViewPartCode;
499
500 {
501 * HIViewPartCodes
502 *
503 }
504 const
505 kHIViewNoPart = 0;
506 kHIViewIndicatorPart = 129;
507 kHIViewDisabledPart = 254;
508 kHIViewInactivePart = 255;
509
510 {
511 * Use this constant when not referring to a specific part, but
512 * rather the entire view.
513 }
514 kHIViewEntireView = kHIViewNoPart;
515
516
517 {
518 * HIView meta-parts
519 *
520 * Summary:
521 * A meta-part is a part used in a call to the HIViewCopyShape API.
522 * These parts might be defined by a view, but should not be
523 * returned from calls such as HIViewGetPartHit. They define a
524 * region of a view.
525 *
526 * Along with these parts, you can also pass in normal part codes to
527 * get the regions of those parts. Not all views fully support this
528 * feature.
529 }
530 const
531 {
532 * The entire area that the view will draw into. When a composited
533 * view is drawn, the HIView Manager clips the view's drawing to the
534 * structure area. This area may extend beyond the bounds of the view
535 * (for example, if the view draws a focus ring outside of its
536 * bounds). You may return a superset of the drawn area if this is
537 * computationally easier to construct. This area is used to
538 * determine the area of a window that should be invalidated and
539 * redrawn when a view is invalidated. It is not necessary for a view
540 * to return a shape that precisely describes the structure area; for
541 * example, a view whose structure is an oval may simply return the
542 * oval's bounding rectangle. The default handler for the
543 * kEventControlGetPartRegion event will return the view's bounds
544 * when this part is requested.
545 }
546 kHIViewStructureMetaPart = -1;
547
548 {
549 * The area of the view in which embedded views should be positioned.
550 * This part is only defined for views that can contain other views
551 * (for example, the group box). This area is largely informational
552 * and is not used by the HIView Manager itself. The default handler
553 * for the kEventControlGetPartRegion event will return
554 * errInvalidPartCode when this part is requested.
555 }
556 kHIViewContentMetaPart = -2;
557
558 {
559 * The area of the view that, when drawn, is filled with opaque
560 * pixels. You may also return a subset of the opaque area if this is
561 * computationally easier to construct. If a view is contained in a
562 * composited window, the HIView Manager will use this area to
563 * optimize drawing of other views that intersect this area; views
564 * that are entirely contained within the opaque area, and that are
565 * z-ordered underneath this view, will not be drawn at all, since
566 * any drawing would be completely overwritten by this view. The
567 * default handler for the kEventControlGetPartRegion event will
568 * return an empty area when this part is requested. This meta-part
569 * is available in Mac OS X 10.2 or later.
570 }
571 kHIViewOpaqueMetaPart = -3;
572
573 {
574 * The area of the view that causes a mouse event to be captured by
575 * that view. If a mouse event falls inside the view bounds but
576 * outside of this area, then the Control Manager will allow the
577 * event to pass through the view to the next view behind it in
578 * z-order. This area is used to determine which parts of a window
579 * should allow async window dragging when clicked (the draggable
580 * area is computed by subtracting the clickable areas of views in
581 * the window from the window's total area). You can also customize
582 * the clickable area of a view if you want the view to have an
583 * effectively transparent area (for example, a view that draws
584 * multiple tabs might want clicks in the space between the tabs to
585 * fall through to the next view rather than be captured by the
586 * tab-drawing view). The default handler for the
587 * kEventControlGetPartRegion event will return the view's bounds
588 * when this part is requested. This meta-part is available in Mac OS
589 * X 10.3 or later.
590 }
591 kHIViewClickableMetaPart = -4;
592
593
594 {
595 * HIView Focus Parts
596 *
597 }
598 const
599 {
600 * Tells view to clear its focus
601 }
602 kHIViewFocusNoPart = kHIViewNoPart;
603
604 {
605 * Tells view to focus on the next part
606 }
607 kHIViewFocusNextPart = -1;
608
609 {
610 * Tells view to focus on the previous part
611 }
612 kHIViewFocusPrevPart = -2;
613
614 {==============================================================================}
615 { CONTENT }
616 {==============================================================================}
617 type
618 HIViewImageContentType = ControlContentType;
619 HIViewImageContentInfo = ControlImageContentInfo;
620 HIViewContentType = SInt16;
621
622 {
623 * HIViewContentTypes
624 *
625 * Summary:
626 * HIView image content types.
627 }
628 const
629 {
630 * The view has no content other than text.
631 }
632 kHIViewContentTextOnly = 0;
633
634 {
635 * The view has no content.
636 }
637 kHIViewContentNone = 0;
638
639 {
640 * The view's content is an IconSuiteRef. The icon suite handle
641 * should be placed in HIViewContentInfo.u.iconSuite.
642 }
643 kHIViewContentIconSuiteRef = 129;
644
645 {
646 * The view's content is an IconRef. The IconRef should be placed in
647 * HIViewContentInfo.u.iconRef.
648 }
649 kHIViewContentIconRef = 132;
650
651 {
652 * The view's content is a CGImageRef. The CGImageRef should be
653 * placed in HIViewContentInfo.u.imageRef. Available in Mac OS X 10.4
654 * and later.
655 }
656 kHIViewContentCGImageRef = 134;
657
658 {
659 * The view's content is an image file in the main bundle's Resources
660 * directory. The CFStringRef of the full name of the image file
661 * should be placed in HIViewContentInfo.u.imageResource. Available
662 * in Mac OS X 10.5 and later.
663 }
664 kHIViewContentImageResource = 135;
665
666 {
667 * The view's content is an image file at an arbitrary location. The
668 * CFURLRef identifying the image file should be placed in
669 * HIViewContentInfo.u.imageFile. Available in Mac OS X 10.5 and
670 * later.
671 }
672 kHIViewContentImageFile = 136;
673
674 {
675 * The view's content is an IconRef, specified by an icon type and
676 * creator. The type and creator should be placed in
677 * HIViewContentInfo.u.iconTypeAndCreator. Available in Mac OS X 10.5
678 * and later.
679 }
680 kHIViewContentIconTypeAndCreator = 137;
681
682 {
683 * The view's content is a Note, Caution, or Stop icon, specified by
684 * the corresponding icon type (kAlertNoteIcon, kAlertCautionIcon, or
685 * kAlertStopIcon). When the icon is drawn, it may be modified to
686 * correspond to the current Mac OS X user interface guidelines. The
687 * type should be placed in
688 * HIViewContentInfo.u.iconTypeAndCreator.type. The creator field of
689 * the iconTypeAndCreator field is ignored in this case. Available in
690 * Mac OS X 10.5 and later.
691 }
692 kHIViewContentAlertIconType = 138;
693
694 {
695 * The view's content is a reference to an NSImage. The NSImage*
696 * should be placed in HIViewContentInfo.u.nsImage. Available in Mac
697 * OS X 10.5 and later.
698 }
699 kHIViewContentNSImage = 139;
700
701
702 {
703 * HITypeAndCreator
704 *
705 * Summary:
706 * A type/creator pair used to identify an IconRef.
707 }
708 type
709 HITypeAndCreator = record
710 {
711 * The icon type.
712 }
713 typ: OSType;
714
715 {
716 * The icon creator.
717 }
718 creator: OSType;
719 end;
720
721 {
722 * HIViewContentInfo
723 *
724 * Summary:
725 * Defines the image content of a view.
726 *
727 * Discussion:
728 * This structure is the HIView equivalent of the
729 * ControlImageContentInfo structure. On Mac OS X 10.5 and later,
730 * you should use this structure with the HIViewSetImageContent and
731 * HIViewCopyImageContent APIs to set or retrieve the image content
732 * of a view.
733 *
734 * Prior to Mac OS X 10.5, you may pass this structure to
735 * GetControlData and SetControlData with the kControlContentTag
736 * constant. Note, however, that the size of this structure as
737 * declared in the Mac OS X 10.5 headers is different (and larger)
738 * than the size of this structure as declared in the Mac OS X 10.4
739 * headers, and the Mac OS X 10.5 version is larger than the size of
740 * the ControlImageContentInfo structure. The view implementations
741 * prior to Mac OS X 10.5 only support Get/SetControlData requests
742 * if the specified data size matches the size of
743 * ControlImageContentInfo. Therefore, if you need to use
744 * Get/SetControlData with this structure prior to Mac OS X 10.5,
745 * you should pass sizeof(ControlImageContentInfo) rather than
746 * sizeof(HIViewContentInfo) as the size of the incoming/outgoing
747 * data buffer.
748 }
749 type
750 HIViewContentInfo = record
751 {
752 * The type of content referenced in the content union.
753 }
754 contentType: HIViewContentType;
755 case SInt16 of
756 {$ifc not TARGET_CPU_64}
757 0: (
758 iconSuite: IconSuiteRef;
759 );
760 {$endc} {not TARGET_CPU_64}
761 1: (
762 iconRef: IconRef_fix;
763 );
764 2: (
765 imagiconTypeAndCreatoreRef: HITypeAndCreator;
766 );
767 3: (
768 imageRef: CGImageRef;
769 );
770 4: (
771 imageResource: CFStringRef;
772 );
773 5: (
774 imageFile: CFURLRef;
775 );
776 end;
777 type
778 HIViewContentInfoPtr = ^HIViewContentInfo;
779 {==============================================================================}
780 { ERROR CODES }
781 {==============================================================================}
782
783 {
784 * Discussion:
785 * View/Control Error Codes
786 }
787 const
788 {
789 * This value will be returned from an HIView API or a Control
790 * Manager API when an action that is only supported on a compositing
791 * window is attempted on a non-compositing window. This doesn't
792 * necessarily mean that the API is only callable for compositing
793 * windows; sometimes the legality of the action is based on other
794 * parameters of the API. See HIViewAddSubview for one particular use
795 * of this error code.
796 }
797 errNeedsCompositedWindow = -30598;
798
799 {==============================================================================}
800 { HIOBJECT SUPPORT }
801 { Setting Initial Bounds }
802 { When creating a view using HIObjectCreate, you can set the initial bounds }
803 { automatically by passing in an initialization event into HIObjectCreate }
804 { with a kEventParamBounds parameter as typeHIRect or typeQDRectangle. }
805 {==============================================================================}
806 { The HIObject class ID for the HIView class. }
807 {$ifc USE_CFSTR_CONSTANT_MACROS}
808 {$definec kHIViewClassID CFSTRP('com.apple.hiview')}
809 {$endc}
810 {==============================================================================}
811 { EMBEDDING }
812 {==============================================================================}
813 {$ifc not TARGET_CPU_64}
814 {
815 * HIViewGetRoot()
816 *
817 * Discussion:
818 * Returns the root view for a window.
819 *
820 * Mac OS X threading:
821 * Not thread safe
822 *
823 * Parameters:
824 *
825 * inWindow:
826 * The window to get the root for.
827 *
828 * Result:
829 * The root view for the window, or NULL if an invalid window is
830 * passed.
831 *
832 * Availability:
833 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
834 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
835 * Non-Carbon CFM: not available
836 }
HIViewGetRootnull837 function HIViewGetRoot( inWindow: WindowRef ): HIViewRef; external name '_HIViewGetRoot';
838 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
839
840
841 {
842 * HIViewAddSubview()
843 *
844 * Discussion:
845 * Adds a subview to the given parent. The new subview is added to
846 * the front of the list of subviews (i.e., it is made topmost).
847 *
848 * The subview being added is not retained by the new parent view.
849 * Do not release the view after adding it, or it will cease to
850 * exist. All views in a window will be released automatically when
851 * the window is destroyed.
852 *
853 * Note that you should not use this API to transfer a window's
854 * content view from one window to another. A window's content view
855 * should always be left in its original window.
856 *
857 * Mac OS X threading:
858 * Not thread safe
859 *
860 * Parameters:
861 *
862 * inParent:
863 * The view which will receive the new subview.
864 *
865 * inNewChild:
866 * The subview being added.
867 *
868 * Result:
869 * An operating system result code.
870 * errNeedsCompositedWindow will be returned when you try to embed
871 * into the content view in a non-compositing window; you can only
872 * embed into the content view in compositing windows.
873 *
874 * Availability:
875 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
876 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
877 * Non-Carbon CFM: not available
878 }
HIViewAddSubviewnull879 function HIViewAddSubview( inParent: HIViewRef; inNewChild: HIViewRef ): OSStatus; external name '_HIViewAddSubview';
880 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
881
882
883 {
884 * HIViewRemoveFromSuperview()
885 *
886 * Discussion:
887 * Removes a view from its parent.
888 * The subview being removed from the parent is not released and
889 * still exists.
890 *
891 * Mac OS X threading:
892 * Not thread safe
893 *
894 * Parameters:
895 *
896 * inView:
897 * The view to remove.
898 *
899 * Result:
900 * An operating system result code.
901 *
902 * Availability:
903 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
904 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
905 * Non-Carbon CFM: not available
906 }
HIViewRemoveFromSuperviewnull907 function HIViewRemoveFromSuperview( inView: HIViewRef ): OSStatus; external name '_HIViewRemoveFromSuperview';
908 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
909
910
911 {
912 * HIViewGetSuperview()
913 *
914 * Discussion:
915 * Returns a view's parent view.
916 *
917 * Mac OS X threading:
918 * Not thread safe
919 *
920 * Parameters:
921 *
922 * inView:
923 * The view whose parent you are interested in getting.
924 *
925 * Result:
926 * An HIView reference, or NULL if this view has no parent or is
927 * invalid.
928 *
929 * Availability:
930 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
931 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
932 * Non-Carbon CFM: not available
933 }
HIViewGetSuperviewnull934 function HIViewGetSuperview( inView: HIViewRef ): HIViewRef; external name '_HIViewGetSuperview';
935 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
936
937
938 {
939 * HIViewGetFirstSubview()
940 *
941 * Discussion:
942 * Returns the first subview of a container. The first subview is
943 * the topmost subview in z-order.
944 *
945 * Mac OS X threading:
946 * Not thread safe
947 *
948 * Parameters:
949 *
950 * inView:
951 * The view whose subview you are fetching.
952 *
953 * Result:
954 * An HIView reference, or NULL if this view has no subviews or is
955 * invalid.
956 *
957 * Availability:
958 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
959 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
960 * Non-Carbon CFM: not available
961 }
HIViewGetFirstSubviewnull962 function HIViewGetFirstSubview( inView: HIViewRef ): HIViewRef; external name '_HIViewGetFirstSubview';
963 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
964
965
966 {
967 * HIViewGetLastSubview()
968 *
969 * Discussion:
970 * Returns the last subview of a container. The last subview is the
971 * bottommost subview in z-order.
972 *
973 * Mac OS X threading:
974 * Not thread safe
975 *
976 * Parameters:
977 *
978 * inView:
979 * The view whose subview you are fetching.
980 *
981 * Result:
982 * An HIView reference, or NULL if this view has no subviews or is
983 * invalid.
984 *
985 * Availability:
986 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
987 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
988 * Non-Carbon CFM: not available
989 }
HIViewGetLastSubviewnull990 function HIViewGetLastSubview( inView: HIViewRef ): HIViewRef; external name '_HIViewGetLastSubview';
991 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
992
993
994 {
995 * HIViewGetNextView()
996 *
997 * Discussion:
998 * Returns the next view after the one given, in z-order.
999 *
1000 * Mac OS X threading:
1001 * Not thread safe
1002 *
1003 * Parameters:
1004 *
1005 * inView:
1006 * The view to use as reference.
1007 *
1008 * Result:
1009 * An HIView reference, or NULL if this view has no view behind it
1010 * or is invalid.
1011 *
1012 * Availability:
1013 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
1014 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
1015 * Non-Carbon CFM: not available
1016 }
HIViewGetNextViewnull1017 function HIViewGetNextView( inView: HIViewRef ): HIViewRef; external name '_HIViewGetNextView';
1018 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
1019
1020
1021 {
1022 * HIViewGetPreviousView()
1023 *
1024 * Discussion:
1025 * Returns the previous view before the one given, in z-order.
1026 *
1027 * Mac OS X threading:
1028 * Not thread safe
1029 *
1030 * Parameters:
1031 *
1032 * inView:
1033 * The view to use as reference.
1034 *
1035 * Result:
1036 * An HIView reference, or NULL if this view has no view in front of
1037 * it or is invalid.
1038 *
1039 * Availability:
1040 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
1041 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
1042 * Non-Carbon CFM: not available
1043 }
HIViewGetPreviousViewnull1044 function HIViewGetPreviousView( inView: HIViewRef ): HIViewRef; external name '_HIViewGetPreviousView';
1045 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
1046
1047
1048 {
1049 * HIViewCountSubviews()
1050 *
1051 * Summary:
1052 * Counts the number of subviews embedded in a view.
1053 *
1054 * Mac OS X threading:
1055 * Not thread safe
1056 *
1057 * Parameters:
1058 *
1059 * inView:
1060 * The view for which to count subviews.
1061 *
1062 * outSubviewCount:
1063 *
1064 * Result:
1065 * The number of subviews of the specified view.
1066 *
1067 * Availability:
1068 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
1069 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
1070 * Non-Carbon CFM: not available
1071 }
HIViewCountSubviewsnull1072 function HIViewCountSubviews( inView: HIViewRef ): CFIndex; external name '_HIViewCountSubviews';
1073 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1074
1075
1076 {
1077 * HIViewGetIndexedSubview()
1078 *
1079 * Summary:
1080 * Get the Nth subview of a view.
1081 *
1082 * Discussion:
1083 * Instead of calling HIViewGetIndexedSubview repeatedly, it may be
1084 * more efficient to iterate through the subviews of a view with
1085 * calls HIViewGetFirstSubview and HIViewGetNextView.
1086 *
1087 * Mac OS X threading:
1088 * Not thread safe
1089 *
1090 * Parameters:
1091 *
1092 * inView:
1093 * The view whose indexed sub-view is being requested.
1094 *
1095 * inSubviewIndex:
1096 * The index of the subview to get.
1097 *
1098 * outSubview:
1099 * An HIViewRef to be filled with the indexed subview.
1100 *
1101 * Result:
1102 * A result code indicating success or failure.
1103 *
1104 * Availability:
1105 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
1106 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
1107 * Non-Carbon CFM: not available
1108 }
HIViewGetIndexedSubviewnull1109 function HIViewGetIndexedSubview( inView: HIViewRef; inSubviewIndex: CFIndex; var outSubview: HIViewRef ): OSStatus; external name '_HIViewGetIndexedSubview';
1110 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1111
1112
1113 {
1114 * HIViewSetZOrder()
1115 *
1116 * Discussion:
1117 * Allows you to change the front-to-back ordering of sibling views.
1118 *
1119 * Mac OS X threading:
1120 * Not thread safe
1121 *
1122 * Parameters:
1123 *
1124 * inView:
1125 * The view whose Z-order you wish to change.
1126 *
1127 * inOp:
1128 * Indicates to order inView above or below inOther.
1129 *
1130 * inOther:
1131 * Another optional view to use as a reference. You can pass NULL
1132 * to mean an absolute position. For example, passing
1133 * kHIViewZOrderAbove and NULL will move a view to the front of
1134 * all of its siblings. Likewise, passing kHIViewZOrderBelow and
1135 * NULL will move it to the back.
1136 *
1137 * Result:
1138 * An operating system result code.
1139 *
1140 * Availability:
1141 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
1142 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
1143 * Non-Carbon CFM: not available
1144 }
HIViewSetZOrdernull1145 function HIViewSetZOrder( inView: HIViewRef; inOp: HIViewZOrderOp; inOther: HIViewRef { can be NULL } ): OSStatus; external name '_HIViewSetZOrder';
1146 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
1147
1148
1149 {==============================================================================}
1150 { STATE and VALUES }
1151 {==============================================================================}
1152 {$endc} {not TARGET_CPU_64}
1153
1154
1155 {
1156 * HIViewKind
1157 }
1158 type
1159 HIViewKind = record
1160 {
1161 * The signature of the view. Apple reserves all signatures made up
1162 * of only lowercase characters.
1163 }
1164 signature: OSType;
1165
1166 {
1167 * The kind of the view. Apple reserves all kinds made up of only
1168 * lowercase characters.
1169 }
1170 kind: OSType;
1171 end;
1172
1173 {
1174 * View signature kind
1175 *
1176 }
1177 const
1178 {
1179 * The signature of all HIToolbox views.
1180 }
1181 kHIViewKindSignatureApple = FourCharCode('appl');
1182
1183 {$ifc not TARGET_CPU_64}
1184 {
1185 * HIViewSetVisible()
1186 *
1187 * Discussion:
1188 * Hides or shows a view. Marks the area the view will occupy or
1189 * used to occupy as needing to be redrawn later.
1190 *
1191 * Mac OS X threading:
1192 * Not thread safe
1193 *
1194 * Parameters:
1195 *
1196 * inView:
1197 * The view to hide or show.
1198 *
1199 * inVisible:
1200 * A boolean value which indicates whether you wish to hide the
1201 * view (false) or show the view (true).
1202 *
1203 * Result:
1204 * An operating system result code.
1205 *
1206 * Availability:
1207 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
1208 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
1209 * Non-Carbon CFM: not available
1210 }
HIViewSetVisiblenull1211 function HIViewSetVisible( inView: HIViewRef; inVisible: Boolean ): OSStatus; external name '_HIViewSetVisible';
1212 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
1213
1214
1215 {
1216 * HIViewIsVisible()
1217 *
1218 * Summary:
1219 * Returns whether a view is visible.
1220 *
1221 * Discussion:
1222 * Note that HIViewIsVisible returns a view's effective visibility,
1223 * which is determined both by the view's own visibility and the
1224 * visibility of its parent views. If a parent view is invisible,
1225 * then this view is considered to be invisible also.
1226 *
1227 * Latent visibility can be determined with HIViewIsLatentlyVisible.
1228 *
1229 * Mac OS X threading:
1230 * Not thread safe
1231 *
1232 * Parameters:
1233 *
1234 * inView:
1235 * The view whose visibility you wish to determine.
1236 *
1237 * Result:
1238 * A boolean value indicating whether the view is visible (true) or
1239 * hidden (false).
1240 *
1241 * Availability:
1242 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
1243 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
1244 * Non-Carbon CFM: not available
1245 }
HIViewIsVisiblenull1246 function HIViewIsVisible( inView: HIViewRef ): Boolean; external name '_HIViewIsVisible';
1247 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
1248
1249
1250 {
1251 * HIViewIsLatentlyVisible()
1252 *
1253 * Summary:
1254 * Returns whether or not a view is latently visible.
1255 *
1256 * Discussion:
1257 * The view's visibility is also affected by the visibility of its
1258 * parents; if any parent view is invisible, this view is considered
1259 * invisible as well. HIViewIsLatentlyVisible returns whether a view
1260 * is latently visible, even if its parents are invisible.
1261 *
1262 * Mac OS X threading:
1263 * Not thread safe
1264 *
1265 * Parameters:
1266 *
1267 * inView:
1268 * The view whose latent visibility is to be checked.
1269 *
1270 * Result:
1271 * True if the view is latently visible, otherwise false.
1272 *
1273 * Availability:
1274 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
1275 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
1276 * Non-Carbon CFM: not available
1277 }
HIViewIsLatentlyVisiblenull1278 function HIViewIsLatentlyVisible( inView: HIViewRef ): Boolean; external name '_HIViewIsLatentlyVisible';
1279 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1280
1281
1282 {
1283 * HIViewSetHilite()
1284 *
1285 * Summary:
1286 * Changes the highlighting of a view.
1287 *
1288 * Mac OS X threading:
1289 * Not thread safe
1290 *
1291 * Parameters:
1292 *
1293 * inView:
1294 * The view on which to set the highlight.
1295 *
1296 * inHilitePart:
1297 * An HIViewPartCode indicating the part of the view to highlight.
1298 *
1299 * Result:
1300 * A result code indicating success or failure.
1301 *
1302 * Availability:
1303 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
1304 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
1305 * Non-Carbon CFM: not available
1306 }
HIViewSetHilitenull1307 function HIViewSetHilite( inView: HIViewRef; inHilitePart: HIViewPartCode ): OSStatus; external name '_HIViewSetHilite';
1308 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1309
1310
1311 {
1312 * HIViewIsActive()
1313 *
1314 * Summary:
1315 * Returns whether or not a view is active.
1316 *
1317 * Discussion:
1318 * The view's active state is also affected by the active state of
1319 * its parents; if any parent view is inactive, this view is
1320 * considered inactive as well. HIViewIsActive can optionally check
1321 * to see if a view is latently active, even if its parents are
1322 * inactive.
1323 *
1324 * Mac OS X threading:
1325 * Not thread safe
1326 *
1327 * Parameters:
1328 *
1329 * inView:
1330 * The view whose active state is to be checked.
1331 *
1332 * outIsLatentActive:
1333 * A pointer to a Boolean to be filled in with the latent active
1334 * state of the view. The Boolean is set to true if the view is
1335 * latently active, otherwise false. Can be NULL.
1336 *
1337 * Result:
1338 * True if the view is active, otherwise false.
1339 *
1340 * Availability:
1341 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
1342 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
1343 * Non-Carbon CFM: not available
1344 }
HIViewIsActivenull1345 function HIViewIsActive( inView: HIViewRef; outIsLatentActive: BooleanPtr { can be NULL } ): Boolean; external name '_HIViewIsActive';
1346 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1347
1348
1349 {
1350 * HIViewSetActivated()
1351 *
1352 * Summary:
1353 * Sets whether or not a view is active or inactive. If any children
1354 * of the view have a latent active state, they will be adjusted
1355 * accordingly.
1356 *
1357 * Mac OS X threading:
1358 * Not thread safe
1359 *
1360 * Parameters:
1361 *
1362 * inView:
1363 * The view to activate or deactivate.
1364 *
1365 * inSetActivated:
1366 * True if setting the view to active, false if setting the view
1367 * to inactive.
1368 *
1369 * Result:
1370 * A result code indicating success or failure.
1371 *
1372 * Availability:
1373 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
1374 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
1375 * Non-Carbon CFM: not available
1376 }
HIViewSetActivatednull1377 function HIViewSetActivated( inView: HIViewRef; inSetActivated: Boolean ): OSStatus; external name '_HIViewSetActivated';
1378 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1379
1380
1381 {
1382 * HIViewIsEnabled()
1383 *
1384 * Summary:
1385 * Tests whether or not a view is enabled.
1386 *
1387 * Discussion:
1388 * The view's enabled state is also affected by the enabled state of
1389 * its parents; if any parent view is disabled, this view is
1390 * considered disabled as well. HIViewIsEnabled can optionally check
1391 * to see if a view is latently enabled, even if its parents are
1392 * disabled.
1393 *
1394 * Mac OS X threading:
1395 * Not thread safe
1396 *
1397 * Parameters:
1398 *
1399 * inView:
1400 * The view to test.
1401 *
1402 * outIsLatentEnabled:
1403 * A pointer to a Boolean to be filled in with the latent enabled
1404 * state of the view. The Boolean is set to true if the view is
1405 * latently enabled, otherwise false. Can be NULL.
1406 *
1407 * Result:
1408 * True if the view is enabled, otherwise false.
1409 *
1410 * Availability:
1411 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
1412 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
1413 * Non-Carbon CFM: not available
1414 }
HIViewIsEnablednull1415 function HIViewIsEnabled( inView: HIViewRef; outIsLatentEnabled: BooleanPtr { can be NULL } ): Boolean; external name '_HIViewIsEnabled';
1416 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1417
1418
1419 {
1420 * HIViewSetEnabled()
1421 *
1422 * Summary:
1423 * Sets whether or not a view (and any subviews) are enabled or
1424 * disabled.
1425 *
1426 * Mac OS X threading:
1427 * Not thread safe
1428 *
1429 * Parameters:
1430 *
1431 * inView:
1432 * The view to enable or disable.
1433 *
1434 * inSetEnabled:
1435 * True if setting the view to enabled, false if setting the view
1436 * to disabled.
1437 *
1438 * Result:
1439 * A result code indicating success or failure.
1440 *
1441 * Availability:
1442 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
1443 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
1444 * Non-Carbon CFM: not available
1445 }
HIViewSetEnablednull1446 function HIViewSetEnabled( inView: HIViewRef; inSetEnabled: Boolean ): OSStatus; external name '_HIViewSetEnabled';
1447 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1448
1449
1450 {
1451 * HIViewIsCompositingEnabled()
1452 *
1453 * Summary:
1454 * Returns whether a view is being used in a compositing hierarchy.
1455 *
1456 * Discussion:
1457 * A view that supports both compositing mode and non-compositing
1458 * mode can use this routine to determine which mode it is currently
1459 * running in. Looking for a window's kWindowCompositingAttribute is
1460 * not sufficient, since some windows with that attribute have some
1461 * of its views in non-compositing mode and vice-versa.
1462 *
1463 * Mac OS X threading:
1464 * Not thread safe
1465 *
1466 * Parameters:
1467 *
1468 * inView:
1469 * The view whose compositing state you wish to determine.
1470 *
1471 * Result:
1472 * A boolean value indicating whether the view is in compositing
1473 * mode (true) or non-compositing mode (false).
1474 *
1475 * Availability:
1476 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
1477 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
1478 * Non-Carbon CFM: not available
1479 }
HIViewIsCompositingEnablednull1480 function HIViewIsCompositingEnabled( inView: HIViewRef ): Boolean; external name '_HIViewIsCompositingEnabled';
1481 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1482
1483
1484 {
1485 * HIViewSetText()
1486 *
1487 * Summary:
1488 * Sets the text of a view to the specified string.
1489 *
1490 * Discussion:
1491 * The "text" of the view is the text that will be displayed when
1492 * drawing the view. This API first attempts to set the view's text
1493 * (generally successful on views that handle the
1494 * kControlEditTextCFStringTag SetControlData tag). If the attempt
1495 * is unsuccessful, the view's title is set instead.
1496 *
1497 * Mac OS X threading:
1498 * Not thread safe
1499 *
1500 * Parameters:
1501 *
1502 * inView:
1503 * The view whose text is being set.
1504 *
1505 * inText:
1506 * The text to set for the view. The string is copied by the view,
1507 * and may be released by the caller afterwards.
1508 *
1509 * Result:
1510 * A result code indicating success or failure.
1511 *
1512 * Availability:
1513 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
1514 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
1515 * Non-Carbon CFM: not available
1516 }
HIViewSetTextnull1517 function HIViewSetText( inView: HIViewRef; inText: CFStringRef ): OSStatus; external name '_HIViewSetText';
1518 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1519
1520
1521 {
1522 * HIViewCopyText()
1523 *
1524 * Summary:
1525 * Makes a copy of the view's text as a CFString.
1526 *
1527 * Discussion:
1528 * The "text" of the view is the text that will be displayed when
1529 * drawing the view. This API first attempts to get the view's text
1530 * (generally successful on views that handle the
1531 * kControlEditTextCFStringTag GetControlData tag). If the attempt
1532 * is unsuccessful, the view's title is copied instead.
1533 *
1534 * Mac OS X threading:
1535 * Not thread safe
1536 *
1537 * Parameters:
1538 *
1539 * inView:
1540 * The view for which to get the text.
1541 *
1542 * Result:
1543 * A CFStringRef containing a copy of the view's text. The caller of
1544 * HIViewCopyText is responsible for releasing the returned text.
1545 *
1546 * Availability:
1547 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
1548 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
1549 * Non-Carbon CFM: not available
1550 }
HIViewCopyTextnull1551 function HIViewCopyText( inView: HIViewRef ): CFStringRef; external name '_HIViewCopyText';
1552 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1553
1554
1555 {
1556 * HIViewGetValue()
1557 *
1558 * Summary:
1559 * Gets a view's value.
1560 *
1561 * Mac OS X threading:
1562 * Not thread safe
1563 *
1564 * Parameters:
1565 *
1566 * inView:
1567 * The view for which to get the value.
1568 *
1569 * Result:
1570 * The view's value.
1571 *
1572 * Availability:
1573 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
1574 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
1575 * Non-Carbon CFM: not available
1576 }
HIViewGetValuenull1577 function HIViewGetValue( inView: HIViewRef ): SInt32; external name '_HIViewGetValue';
1578 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1579
1580
1581 {
1582 * HIViewSetValue()
1583 *
1584 * Summary:
1585 * Sets a view's value.
1586 *
1587 * Mac OS X threading:
1588 * Not thread safe
1589 *
1590 * Parameters:
1591 *
1592 * inView:
1593 * The view whose value is to be set.
1594 *
1595 * inValue:
1596 * The new value.
1597 *
1598 * Result:
1599 * A result code indicating success or failure.
1600 *
1601 * Availability:
1602 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
1603 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
1604 * Non-Carbon CFM: not available
1605 }
HIViewSetValuenull1606 function HIViewSetValue( inView: HIViewRef; inValue: SInt32 ): OSStatus; external name '_HIViewSetValue';
1607 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1608
1609
1610 {
1611 * HIViewGetMinimum()
1612 *
1613 * Summary:
1614 * Gets a view's minimum value.
1615 *
1616 * Mac OS X threading:
1617 * Not thread safe
1618 *
1619 * Parameters:
1620 *
1621 * inView:
1622 * The view for which to get the minimum value.
1623 *
1624 * Result:
1625 * The view's minimum value.
1626 *
1627 * Availability:
1628 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
1629 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
1630 * Non-Carbon CFM: not available
1631 }
HIViewGetMinimumnull1632 function HIViewGetMinimum( inView: HIViewRef ): SInt32; external name '_HIViewGetMinimum';
1633 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1634
1635
1636 {
1637 * HIViewSetMinimum()
1638 *
1639 * Summary:
1640 * Sets a view's minimum value.
1641 *
1642 * Mac OS X threading:
1643 * Not thread safe
1644 *
1645 * Parameters:
1646 *
1647 * inView:
1648 * The view whose minimum value is to be set.
1649 *
1650 * inMinimum:
1651 * The new minimum value.
1652 *
1653 * Result:
1654 * A result code indicating success or failure.
1655 *
1656 * Availability:
1657 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
1658 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
1659 * Non-Carbon CFM: not available
1660 }
HIViewSetMinimumnull1661 function HIViewSetMinimum( inView: HIViewRef; inMinimum: SInt32 ): OSStatus; external name '_HIViewSetMinimum';
1662 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1663
1664
1665 {
1666 * HIViewGetMaximum()
1667 *
1668 * Summary:
1669 * Gets a view's maximum value.
1670 *
1671 * Mac OS X threading:
1672 * Not thread safe
1673 *
1674 * Parameters:
1675 *
1676 * inView:
1677 * The view for which to get the maximum value.
1678 *
1679 * Result:
1680 * The view's maximum value.
1681 *
1682 * Availability:
1683 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
1684 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
1685 * Non-Carbon CFM: not available
1686 }
HIViewGetMaximumnull1687 function HIViewGetMaximum( inView: HIViewRef ): SInt32; external name '_HIViewGetMaximum';
1688 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1689
1690
1691 {
1692 * HIViewSetMaximum()
1693 *
1694 * Summary:
1695 * Sets a view's maximum value.
1696 *
1697 * Mac OS X threading:
1698 * Not thread safe
1699 *
1700 * Parameters:
1701 *
1702 * inView:
1703 * The view whose maximum value is to be set.
1704 *
1705 * inMaximum:
1706 * The new maximum value.
1707 *
1708 * Result:
1709 * A result code indicating success or failure.
1710 *
1711 * Availability:
1712 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
1713 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
1714 * Non-Carbon CFM: not available
1715 }
HIViewSetMaximumnull1716 function HIViewSetMaximum( inView: HIViewRef; inMaximum: SInt32 ): OSStatus; external name '_HIViewSetMaximum';
1717 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1718
1719
1720 {
1721 * HIViewGetViewSize()
1722 *
1723 * Summary:
1724 * Gets a view's view size.
1725 *
1726 * Discussion:
1727 * The view size is the size of the content to which a view's
1728 * display is proportioned. Most commonly used to set the
1729 * proportional size of a scroll bar's thumb indicator.
1730 *
1731 * Mac OS X threading:
1732 * Not thread safe
1733 *
1734 * Parameters:
1735 *
1736 * inView:
1737 * The view for which to get the view size.
1738 *
1739 * Result:
1740 * The view size.
1741 *
1742 * Availability:
1743 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
1744 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
1745 * Non-Carbon CFM: not available
1746 }
HIViewGetViewSizenull1747 function HIViewGetViewSize( inView: HIViewRef ): SInt32; external name '_HIViewGetViewSize';
1748 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1749
1750
1751 {
1752 * HIViewSetViewSize()
1753 *
1754 * Summary:
1755 * Sets a view's view size.
1756 *
1757 * Discussion:
1758 * The view size is the size of the content to which a view's
1759 * display is proportioned. Most commonly used to set the
1760 * proportional size of a scroll bar's thumb indicator.
1761 *
1762 * Mac OS X threading:
1763 * Not thread safe
1764 *
1765 * Parameters:
1766 *
1767 * inView:
1768 * The view whose view size is to be set.
1769 *
1770 * inViewSize:
1771 * The new view size.
1772 *
1773 * Result:
1774 * A result code indicating success or failure.
1775 *
1776 * Availability:
1777 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
1778 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
1779 * Non-Carbon CFM: not available
1780 }
HIViewSetViewSizenull1781 function HIViewSetViewSize( inView: HIViewRef; inViewSize: SInt32 ): OSStatus; external name '_HIViewSetViewSize';
1782 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1783
1784
1785 {
1786 * HIViewIsValid()
1787 *
1788 * Summary:
1789 * HIViewIsValid tests to see if the passed in view is a view that
1790 * HIToolbox knows about. It does not sanity check the data in the
1791 * view.
1792 *
1793 * Mac OS X threading:
1794 * Not thread safe
1795 *
1796 * Parameters:
1797 *
1798 * inView:
1799 * The view to test for validity.
1800 *
1801 * Result:
1802 * True if the view is a valid view, otherwise, false.
1803 *
1804 * Availability:
1805 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
1806 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
1807 * Non-Carbon CFM: not available
1808 }
HIViewIsValidnull1809 function HIViewIsValid( inView: HIViewRef ): Boolean; external name '_HIViewIsValid';
1810 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1811
1812
1813 {
1814 * HIViewSetID()
1815 *
1816 * Summary:
1817 * Sets the HIViewID of a view.
1818 *
1819 * Mac OS X threading:
1820 * Not thread safe
1821 *
1822 * Parameters:
1823 *
1824 * inView:
1825 * The view for which to set the ID.
1826 *
1827 * inID:
1828 * The ID to set on the view.
1829 *
1830 * Result:
1831 * A result code indicating success or failure.
1832 *
1833 * Availability:
1834 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
1835 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
1836 * Non-Carbon CFM: not available
1837 }
HIViewSetIDnull1838 function HIViewSetID( inView: HIViewRef; inID: HIViewID ): OSStatus; external name '_HIViewSetID';
1839 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1840
1841
1842 {
1843 * HIViewGetID()
1844 *
1845 * Summary:
1846 * Gets the HIViewID of a view.
1847 *
1848 * Mac OS X threading:
1849 * Not thread safe
1850 *
1851 * Parameters:
1852 *
1853 * inView:
1854 * The view for which to get the ID.
1855 *
1856 * outID:
1857 * A pointer to an HIViewID to be filled with the view's ID.
1858 *
1859 * Result:
1860 * A result code indicating success or failure.
1861 *
1862 * Availability:
1863 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
1864 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
1865 * Non-Carbon CFM: not available
1866 }
HIViewGetIDnull1867 function HIViewGetID( inView: HIViewRef; var outID: HIViewID ): OSStatus; external name '_HIViewGetID';
1868 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1869
1870
1871 {
1872 * HIViewSetCommandID()
1873 *
1874 * Summary:
1875 * Sets the command ID of a view.
1876 *
1877 * Mac OS X threading:
1878 * Not thread safe
1879 *
1880 * Parameters:
1881 *
1882 * inView:
1883 * The view for which to set the command ID.
1884 *
1885 * inCommandID:
1886 * The command ID to set on the view.
1887 *
1888 * Result:
1889 * A result code indicating success or failure.
1890 *
1891 * Availability:
1892 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
1893 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
1894 * Non-Carbon CFM: not available
1895 }
HIViewSetCommandIDnull1896 function HIViewSetCommandID( inView: HIViewRef; inCommandID: UInt32 ): OSStatus; external name '_HIViewSetCommandID';
1897 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1898
1899
1900 {
1901 * HIViewGetCommandID()
1902 *
1903 * Summary:
1904 * Gets the command ID of a view.
1905 *
1906 * Mac OS X threading:
1907 * Not thread safe
1908 *
1909 * Parameters:
1910 *
1911 * inView:
1912 * The view for which to get the command ID.
1913 *
1914 * outCommandID:
1915 * A pointer to a UInt32 to fill with the view's command id.
1916 *
1917 * Result:
1918 * A result code indicating success or failure.
1919 *
1920 * Availability:
1921 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
1922 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
1923 * Non-Carbon CFM: not available
1924 }
HIViewGetCommandIDnull1925 function HIViewGetCommandID( inView: HIViewRef; var outCommandID: UInt32 ): OSStatus; external name '_HIViewGetCommandID';
1926 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1927
1928
1929 {
1930 * HIViewGetKind()
1931 *
1932 * Summary:
1933 * Returns the kind of the given view.
1934 *
1935 * Mac OS X threading:
1936 * Not thread safe
1937 *
1938 * Parameters:
1939 *
1940 * inView:
1941 * The view whose kind to get.
1942 *
1943 * outViewKind:
1944 * On successful exit, this will contain the view signature and
1945 * kind. See ControlDefinitions.h or HIView.h for the kinds of
1946 * each system view.
1947 *
1948 * Availability:
1949 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
1950 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
1951 * Non-Carbon CFM: not available
1952 }
HIViewGetKindnull1953 function HIViewGetKind( inView: HIViewRef; var outViewKind: HIViewKind ): OSStatus; external name '_HIViewGetKind';
1954 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1955
1956
1957 {==============================================================================}
1958 { POSITIONING }
1959 {==============================================================================}
1960 {
1961 * HIViewGetBounds()
1962 *
1963 * Discussion:
1964 * Returns the local bounds of a view. The local bounds are the
1965 * coordinate system that is completely view-relative. A view's top
1966 * left coordinate starts out at 0, 0. Most operations are done in
1967 * these local coordinates. Moving a view is done via the frame
1968 * instead.
1969 *
1970 * Mac OS X threading:
1971 * Not thread safe
1972 *
1973 * Parameters:
1974 *
1975 * inView:
1976 * The view whose bounds you wish to determine.
1977 *
1978 * outRect:
1979 * The local bounds of the view.
1980 *
1981 * Result:
1982 * An operating system result code.
1983 *
1984 * Availability:
1985 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
1986 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
1987 * Non-Carbon CFM: not available
1988 }
HIViewGetBoundsnull1989 function HIViewGetBounds( inView: HIViewRef; var outRect: HIRect ): OSStatus; external name '_HIViewGetBounds';
1990 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
1991
1992
1993 {
1994 * HIViewGetFrame()
1995 *
1996 * Discussion:
1997 * Returns the frame of a view. The frame is the bounds of a view
1998 * relative to its parent's local coordinate system.
1999 *
2000 * Mac OS X threading:
2001 * Not thread safe
2002 *
2003 * Parameters:
2004 *
2005 * inView:
2006 * The view whose frame you wish to determine.
2007 *
2008 * outRect:
2009 * The frame of the view.
2010 *
2011 * Result:
2012 * An operating system result code.
2013 *
2014 * Availability:
2015 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
2016 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
2017 * Non-Carbon CFM: not available
2018 }
HIViewGetFramenull2019 function HIViewGetFrame( inView: HIViewRef; var outRect: HIRect ): OSStatus; external name '_HIViewGetFrame';
2020 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
2021
2022
2023 {
2024 * HIViewSetFrame()
2025 *
2026 * Discussion:
2027 * Sets the frame of a view. This effectively moves the view within
2028 * its parent. It also marks the view (and anything that was exposed
2029 * behind it) to be redrawn.
2030 *
2031 * Mac OS X threading:
2032 * Not thread safe
2033 *
2034 * Parameters:
2035 *
2036 * inView:
2037 * The view whose frame you wish to change.
2038 *
2039 * inRect:
2040 * The new frame of the view.
2041 *
2042 * Result:
2043 * An operating system result code.
2044 *
2045 * Availability:
2046 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
2047 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
2048 * Non-Carbon CFM: not available
2049 }
HIViewSetFramenull2050 function HIViewSetFrame( inView: HIViewRef; const (*var*) inRect: HIRect ): OSStatus; external name '_HIViewSetFrame';
2051 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
2052
2053
2054 {
2055 * HIViewMoveBy()
2056 *
2057 * Discussion:
2058 * Moves a view by a certain distance, relative to its current
2059 * location. This affects a view's frame, but not its bounds.
2060 *
2061 * Mac OS X threading:
2062 * Not thread safe
2063 *
2064 * Parameters:
2065 *
2066 * inView:
2067 * The view you wish to move.
2068 *
2069 * inDX:
2070 * The horizontal distance to move the view. Negative values move
2071 * the view to the left, positive values to the right.
2072 *
2073 * inDY:
2074 * The vertical distance to move the view. Negative values move
2075 * the view upward, positive values downward.
2076 *
2077 * Result:
2078 * An operating system result code.
2079 *
2080 * Availability:
2081 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
2082 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
2083 * Non-Carbon CFM: not available
2084 }
HIViewMoveBynull2085 function HIViewMoveBy( inView: HIViewRef; inDX: CGFloat; inDY: CGFloat ): OSStatus; external name '_HIViewMoveBy';
2086 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
2087
2088
2089 {
2090 * HIViewPlaceInSuperviewAt()
2091 *
2092 * Discussion:
2093 * Places a view at an absolute location within its parent. This
2094 * affects the view's frame, but not its bounds.
2095 *
2096 * Mac OS X threading:
2097 * Not thread safe
2098 *
2099 * Parameters:
2100 *
2101 * inView:
2102 * The view you wish to position.
2103 *
2104 * inX:
2105 * The absolute horizontal coordinate at which to position the
2106 * view.
2107 *
2108 * inY:
2109 * The absolute vertical coordinate at which to position the view.
2110 *
2111 * Result:
2112 * An operating system result code.
2113 *
2114 * Availability:
2115 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
2116 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
2117 * Non-Carbon CFM: not available
2118 }
HIViewPlaceInSuperviewAtnull2119 function HIViewPlaceInSuperviewAt( inView: HIViewRef; inX: CGFloat; inY: CGFloat ): OSStatus; external name '_HIViewPlaceInSuperviewAt';
2120 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
2121
2122
2123 {
2124 * HIViewReshapeStructure()
2125 *
2126 * Discussion:
2127 * This is for use by custom views. If a view decides that its
2128 * structure will change shape, it should call this. This tells the
2129 * Toolbox to recalc things and invalidate as appropriate. You might
2130 * use this when gaining/losing a focus ring, for example.
2131 *
2132 * Mac OS X threading:
2133 * Not thread safe
2134 *
2135 * Parameters:
2136 *
2137 * inView:
2138 * The view to reshape and invalidate.
2139 *
2140 * Result:
2141 * An operating system result code.
2142 *
2143 * Availability:
2144 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
2145 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
2146 * Non-Carbon CFM: not available
2147 }
HIViewReshapeStructurenull2148 function HIViewReshapeStructure( inView: HIViewRef ): OSStatus; external name '_HIViewReshapeStructure';
2149 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
2150
2151
2152 {
2153 * HIViewRegionChanged()
2154 *
2155 * Discussion:
2156 * Allows a view to tell the view system that a region of itself has
2157 * changed. The view system might choose to react in some way. For
2158 * example, if a view's clickable region has changed, this can be
2159 * called to tell the Toolbox to resync the region it uses for async
2160 * window dragging, if enabled. Likewise, if a view's opaque region
2161 * changes, we can adjust the window's opaque shape as well. When
2162 * views are moved, resizes, this stuff is taken care of for you. So
2163 * this only need be called when there's a change in your view that
2164 * occurs outside of those times.
2165 *
2166 * Mac OS X threading:
2167 * Not thread safe
2168 *
2169 * Parameters:
2170 *
2171 * inView:
2172 * The view to deal with.
2173 *
2174 * inRegionCode:
2175 * The region that was changed. This can only be the structure
2176 * opaque, and clickable regions at present.
2177 *
2178 * Result:
2179 * An operating system status code.
2180 *
2181 * Availability:
2182 * Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
2183 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
2184 * Non-Carbon CFM: not available
2185 }
HIViewRegionChangednull2186 function HIViewRegionChanged( inView: HIViewRef; inRegionCode: HIViewPartCode ): OSStatus; external name '_HIViewRegionChanged';
2187 (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
2188
2189
2190 {
2191 * HIViewCopyShape()
2192 *
2193 * Summary:
2194 * Copies the shape of a part of a view. See the discussion on
2195 * meta-parts in this header for more information
2196 *
2197 * Mac OS X threading:
2198 * Not thread safe
2199 *
2200 * Parameters:
2201 *
2202 * inView:
2203 * The view for which to copy the shape.
2204 *
2205 * inPart:
2206 * The part of the view whose shape is to be copied.
2207 *
2208 * outShape:
2209 * On exit, contains a newly created shape. The caller of
2210 * HIViewCopyShape is responsible for releasing the copied shape.
2211 *
2212 * Result:
2213 * A result code indicating success or failure.
2214 *
2215 * Availability:
2216 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
2217 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
2218 * Non-Carbon CFM: not available
2219 }
HIViewCopyShapenull2220 function HIViewCopyShape( inView: HIViewRef; inPart: HIViewPartCode; var outShape: HIShapeRef ): OSStatus; external name '_HIViewCopyShape';
2221 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
2222
2223
2224 {
2225 * HIViewGetOptimalBounds()
2226 *
2227 * Summary:
2228 * Obtain a view's optimal size and/or text placement.
2229 *
2230 * Mac OS X threading:
2231 * Not thread safe
2232 *
2233 * Parameters:
2234 *
2235 * inView:
2236 * The view to examine.
2237 *
2238 * outBounds:
2239 * A pointer to an HIRect to be filled with the view's optimal
2240 * bounds. Can be NULL.
2241 *
2242 * outBaseLineOffset:
2243 * A pointer to a float to be filled with the view's optimal text
2244 * placement. Can be NULL.
2245 *
2246 * Result:
2247 * A result code indicating success or failure.
2248 *
2249 * Availability:
2250 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
2251 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
2252 * Non-Carbon CFM: not available
2253 }
HIViewGetOptimalBoundsnull2254 function HIViewGetOptimalBounds( inView: HIViewRef; outBounds: HIRectPtr { can be NULL }; outBaseLineOffset: CGFloatPtr { can be NULL } ): OSStatus; external name '_HIViewGetOptimalBounds';
2255 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
2256
2257
2258 {==============================================================================}
2259 { TEXT AND FONT SUPPORT }
2260 {==============================================================================}
2261 {
2262 * HIViewSetTextFont()
2263 *
2264 * Summary:
2265 * Set the font that the control will use. NULL will specify the
2266 * default value.
2267 *
2268 * Mac OS X threading:
2269 * Not thread safe
2270 *
2271 * Parameters:
2272 *
2273 * inView:
2274 * The view whose font is to be modified.
2275 *
2276 * inPart:
2277 * The part whose font is to be modified.
2278 *
2279 * inFont:
2280 * The font that the view should use to draw its text. The font
2281 * will be retained by the view. If NULL, the view will revert to
2282 * the default font.
2283 *
2284 * Result:
2285 * An operating system status code.
2286 *
2287 * Availability:
2288 * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
2289 * CarbonLib: not available
2290 * Non-Carbon CFM: not available
2291 }
HIViewSetTextFontnull2292 function HIViewSetTextFont( inView: HIViewRef; inPart: HIViewPartCode; inFont: CTFontRef { can be NULL } ): OSStatus; external name '_HIViewSetTextFont';
2293 (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
2294
2295
2296 {
2297 * HIViewSetTextHorizontalFlush()
2298 *
2299 * Summary:
2300 * Set the horizontal flushness of the view's text.
2301 *
2302 * Mac OS X threading:
2303 * Not thread safe
2304 *
2305 * Parameters:
2306 *
2307 * inView:
2308 * The view whose flushness is to be modified.
2309 *
2310 * inPart:
2311 * The part whose flushness is to be modified.
2312 *
2313 * inHFlush:
2314 * The horizontal flush that the view's text will be drawn with.
2315 * kHIThemeTextHorizontalFlushDefault will revert to the default
2316 * flush for the view.
2317 *
2318 * Result:
2319 * An operating system status code.
2320 *
2321 * Availability:
2322 * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
2323 * CarbonLib: not available
2324 * Non-Carbon CFM: not available
2325 }
HIViewSetTextHorizontalFlushnull2326 function HIViewSetTextHorizontalFlush( inView: HIViewRef; inPart: HIViewPartCode; inHFlush: HIThemeTextHorizontalFlush ): OSStatus; external name '_HIViewSetTextHorizontalFlush';
2327 (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
2328
2329
2330 {
2331 * HIViewSetTextVerticalFlush()
2332 *
2333 * Summary:
2334 * Set the vertical flushness of the view's text.
2335 *
2336 * Mac OS X threading:
2337 * Not thread safe
2338 *
2339 * Parameters:
2340 *
2341 * inView:
2342 * The view whose flushness is to be modified.
2343 *
2344 * inPart:
2345 * The part whose flushness is to be modified.
2346 *
2347 * inVFlush:
2348 * The vertical flush that the view's text will be drawn with.
2349 * kHIThemeTextVerticalFlushDefault will revert to the default
2350 * flush for the view.
2351 *
2352 * Result:
2353 * An operating system status code.
2354 *
2355 * Availability:
2356 * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
2357 * CarbonLib: not available
2358 * Non-Carbon CFM: not available
2359 }
HIViewSetTextVerticalFlushnull2360 function HIViewSetTextVerticalFlush( inView: HIViewRef; inPart: HIViewPartCode; inVFlush: HIThemeTextVerticalFlush ): OSStatus; external name '_HIViewSetTextVerticalFlush';
2361 (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
2362
2363
2364 {
2365 * HIViewSetTextTruncation()
2366 *
2367 * Summary:
2368 * Sets how the view's text will truncate.
2369 *
2370 * Mac OS X threading:
2371 * Not thread safe
2372 *
2373 * Parameters:
2374 *
2375 * inView:
2376 * The view whose truncation is to be modified.
2377 *
2378 * inPart:
2379 * The part whose truncation is to be modified.
2380 *
2381 * inTrunc:
2382 * How the view's text will be truncated if it doesn't fit within
2383 * the available label space. kHIThemeTextTruncationDefault will
2384 * revert to the default truncation for the view.
2385 *
2386 * Result:
2387 * An operating system status code.
2388 *
2389 * Availability:
2390 * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
2391 * CarbonLib: not available
2392 * Non-Carbon CFM: not available
2393 }
HIViewSetTextTruncationnull2394 function HIViewSetTextTruncation( inView: HIViewRef; inPart: HIViewPartCode; inTrunc: HIThemeTextTruncation ): OSStatus; external name '_HIViewSetTextTruncation';
2395 (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
2396
2397
2398 {
2399 * HIViewGetThemeTextInfo()
2400 *
2401 * Summary:
2402 * Gets the HIThemeTextInfo structure that is used to draw the
2403 * view's text.
2404 *
2405 * Discussion:
2406 * This function returns the HIThemeTextInfo structure that will be
2407 * used for drawing the view's text. All of the fields will be
2408 * concrete values, they will not contain constants of the form
2409 * HIThemeTextFooDefault. You will be unable to determine if the
2410 * view is using the default values using this API. This API is
2411 * useful if you need to draw a text item using the same font and
2412 * attributes that the view's text is drawing with.
2413 *
2414 * Mac OS X threading:
2415 * Not thread safe
2416 *
2417 * Parameters:
2418 *
2419 * inView:
2420 * The view whose text information is to be queried.
2421 *
2422 * inPart:
2423 * The part whose text information is to be queried.
2424 *
2425 * inVersion:
2426 * The version of the HIThemeTextInfo structure that is being
2427 * passed in. This is important for future compatibility with
2428 * different versions of the HIThemeTextInfo structure. Currently
2429 * this must be version 1.
2430 *
2431 * outTextInfo:
2432 * A pointer to an HIThemeTextInfo structure whose version is
2433 * given in the inVersion parameter.
2434 *
2435 * Result:
2436 * An operating system status code.
2437 *
2438 * Availability:
2439 * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
2440 * CarbonLib: not available
2441 * Non-Carbon CFM: not available
2442 }
HIViewGetThemeTextInfonull2443 function HIViewGetThemeTextInfo( inView: HIViewRef; inPart: HIViewPartCode; inVersion: UInt32; var outTextInfo: HIThemeTextInfo ): OSStatus; external name '_HIViewGetThemeTextInfo';
2444 (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
2445
2446
2447 {==============================================================================}
2448 { HIT TESTING/EVENT HANDLING }
2449 {==============================================================================}
2450 {
2451 * HIViewGetViewForMouseEvent()
2452 *
2453 * Discussion:
2454 * Returns the appropriate view to handle a mouse event. This is a
2455 * little higher-level than HIViewGetSubviewHit. This routine will
2456 * find the deepest view that should handle the mouse event, but
2457 * along the way, it sends Carbon Events to each view asking it to
2458 * return the appropriate subview. This allows parent views to catch
2459 * clicks on their subviews. This is the recommended function to use
2460 * before processing mouse events. Using one of the more primitive
2461 * functions may result in an undefined behavior. In general we
2462 * recommend the use of the Standard Window Handler instead of
2463 * calling this function yourself.
2464 *
2465 * Mac OS X threading:
2466 * Not thread safe
2467 *
2468 * Parameters:
2469 *
2470 * inView:
2471 * The view to start from. You should pass the window's root view.
2472 *
2473 * inEvent:
2474 * The mouse event in question.
2475 *
2476 * outView:
2477 * The view that the mouse event should be sent to.
2478 *
2479 * Result:
2480 * An operating system result code.
2481 *
2482 * Availability:
2483 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
2484 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
2485 * Non-Carbon CFM: not available
2486 }
HIViewGetViewForMouseEventnull2487 function HIViewGetViewForMouseEvent( inView: HIViewRef; inEvent: EventRef; var outView: HIViewRef ): OSStatus; external name '_HIViewGetViewForMouseEvent';
2488 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
2489
2490
2491 {
2492 * HIViewClick()
2493 *
2494 * Discussion:
2495 * After a successful call to HIViewGetViewForMouseEvent for a mouse
2496 * down event, you should call this function to have the view handle
2497 * the click. In general we recommend the use of the Standard Window
2498 * Handler instead of calling this function yourself.
2499 *
2500 * Mac OS X threading:
2501 * Not thread safe
2502 *
2503 * Parameters:
2504 *
2505 * inView:
2506 * The view to handle the event.
2507 *
2508 * inEvent:
2509 * The mouse event to handle.
2510 *
2511 * Result:
2512 * An operating system result code.
2513 *
2514 * Availability:
2515 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
2516 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
2517 * Non-Carbon CFM: not available
2518 }
HIViewClicknull2519 function HIViewClick( inView: HIViewRef; inEvent: EventRef ): OSStatus; external name '_HIViewClick';
2520 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
2521
2522
2523 {
2524 * HIViewSimulateClick()
2525 *
2526 * Discussion:
2527 * This function is used to simulate a mouse click on a given view.
2528 * It sends a kEventControlSimulateHit event to the specified view,
2529 * and also sends kEventControlHit and (if the Hit event is not
2530 * handled) kEventCommandProcess events.
2531 *
2532 * Note that not all windows will respond to the events that are
2533 * sent by this API. A fully Carbon-event-based window most likely
2534 * will respond exactly as if the user had really clicked in the
2535 * view. A window that is handled using classic EventRecord-based
2536 * APIs (WaitNextEvent or ModalDialog) will typically not respond at
2537 * all; to simulate a click in such a window, you may need to post a
2538 * mouse-down/mouse-up pair, or use a Dialog Manager event filter
2539 * proc to simulate a hit in a dialog item.
2540 *
2541 * Mac OS X threading:
2542 * Not thread safe
2543 *
2544 * Parameters:
2545 *
2546 * inView:
2547 * The view to test the part hit.
2548 *
2549 * inPartToClick:
2550 * The part the view should consider to be clicked.
2551 *
2552 * inModifiers:
2553 * The modifiers the view can consider for its click action.
2554 *
2555 * outPartClicked:
2556 * The part that was hit, can be kHIViewNoPart if no action
2557 * occurred. May be NULL if you don't need the part code returned.
2558 *
2559 * Result:
2560 * An operating system result code.
2561 *
2562 * Availability:
2563 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
2564 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
2565 * Non-Carbon CFM: not available
2566 }
HIViewSimulateClicknull2567 function HIViewSimulateClick( inView: HIViewRef; inPartToClick: HIViewPartCode; inModifiers: UInt32; outPartClicked: HIViewPartCodePtr { can be NULL } ): OSStatus; external name '_HIViewSimulateClick';
2568 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
2569
2570
2571 {
2572 * HIViewGetPartHit()
2573 *
2574 * Discussion:
2575 * Given a view, and a view-relative point, this function returns
2576 * the part code hit as determined by the view.
2577 *
2578 * Mac OS X threading:
2579 * Not thread safe
2580 *
2581 * Parameters:
2582 *
2583 * inView:
2584 * The view to test the part hit.
2585 *
2586 * inPoint:
2587 * The view-relative point to use.
2588 *
2589 * outPart:
2590 * The part hit by inPoint.
2591 *
2592 * Result:
2593 * An operating system result code.
2594 *
2595 * Availability:
2596 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
2597 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
2598 * Non-Carbon CFM: not available
2599 }
HIViewGetPartHitnull2600 function HIViewGetPartHit( inView: HIViewRef; const (*var*) inPoint: HIPoint; var outPart: HIViewPartCode ): OSStatus; external name '_HIViewGetPartHit';
2601 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
2602
2603
2604 {
2605 * HIViewGetSubviewHit()
2606 *
2607 * Discussion:
2608 * Returns the child of the given view hit by the point passed in.
2609 * This is more primitive than using HIViewGetViewForMouseEvent, and
2610 * should be used only in non-event-handling cases.
2611 *
2612 * Mac OS X threading:
2613 * Not thread safe
2614 *
2615 * Parameters:
2616 *
2617 * inView:
2618 * The view you wish to start from.
2619 *
2620 * inPoint:
2621 * The mouse coordinate to use. This is passed in the local
2622 * coordinate system of inView.
2623 *
2624 * inDeep:
2625 * Pass true to find the deepest child hit, false to go only one
2626 * level deep (just check direct children of inView).
2627 *
2628 * outView:
2629 * The view hit by inPoint, or NULL if no subview was hit.
2630 *
2631 * Result:
2632 * An operating system result code.
2633 *
2634 * Availability:
2635 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
2636 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
2637 * Non-Carbon CFM: not available
2638 }
HIViewGetSubviewHitnull2639 function HIViewGetSubviewHit( inView: HIViewRef; const (*var*) inPoint: HIPoint; inDeep: Boolean; var outView: HIViewRef ): OSStatus; external name '_HIViewGetSubviewHit';
2640 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
2641
2642
2643 {
2644 * HIViewTrackMouseLocation()
2645 *
2646 * Summary:
2647 * An HIView-based version of TrackMouseLocationWithOptions.
2648 *
2649 * Discussion:
2650 * This routine is similar to TrackMouseLocationWithOptions
2651 * described in CarbonEvents.i. Please read the notes on that
2652 * function as well. HIViewTrackMouseLocation optionally returns the
2653 * EventRef that ended the tracking loop, and the caller may extend
2654 * the list of events that end the loop.
2655 *
2656 * Mac OS X threading:
2657 * Not thread safe
2658 *
2659 * Parameters:
2660 *
2661 * inView:
2662 * The HIViewRef in whose coordinate space to return the mouse
2663 * position.
2664 *
2665 * inOptions:
2666 * Pass kTrackMouseLocationOptionDontConsumeMouseUp to indicate
2667 * that the toolbox should leave mouse-up events in the queue.
2668 * Pass kTrackMouseLocationOptionIncludeScrollWheel to indicate
2669 * that the tracking loop should terminate when a
2670 * kEventMouseWheelMoved or kEventMouseScroll event is received.
2671 *
2672 * inTimeout:
2673 * The amount of time to wait for an event. If no events arrive
2674 * within this time, kMouseTrackingTimedOut is returned in
2675 * outResult. Pass kEventDurationForever to wait indefinitely for
2676 * the next event.
2677 *
2678 * inClientEventCount:
2679 * Number of caller-supplied EventTypeSpecs in the
2680 * inClientEventList parameter. Pass 0 if you do not want any
2681 * custom event types to end the tracking loop.
2682 *
2683 * inClientEventList:
2684 * Array of caller-supplied EventTypeSpecs that the caller wants
2685 * to end the tracking loop. Pass NULL if you do not want any
2686 * custom event types to end the tracking loop.
2687 *
2688 * outWhere:
2689 * On exit, this parameter receives the mouse location from the
2690 * last mouse event that caused this function to exit. If a
2691 * timeout or key modifiers changed event caused this function to
2692 * exit, the current mouse position at the time is returned. The
2693 * mouse position will be returned in the coordinate space of the
2694 * specifed HIView.
2695 *
2696 * outModifiers:
2697 * On exit, this parameter receives the most recent state of the
2698 * keyboard modifiers. If a timeout caused this function to exit,
2699 * the current keyboard modifiers at the time are returned. You
2700 * may pass NULL if you don't need this information.
2701 *
2702 * outEvent:
2703 * On exit, this parameter receives the EventRef that caused the
2704 * function to exit. You may pass NULL if you don't need this
2705 * information. The event will be NULL for mouse-tracking results
2706 * that don't involve events, such as the timeout expiring. If the
2707 * event is not NULL, you must release the event when you're done
2708 * with it.
2709 *
2710 * outResult:
2711 * On exit, this parameter receives a value representing what kind
2712 * of event was received that cause the function to exit, such as
2713 * kMouseTrackingMouseUp. If a caller-supplied EventTypeSpec ended
2714 * the loop, kMouseTrackingClientEvent is returned.
2715 *
2716 * Availability:
2717 * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
2718 * CarbonLib: not available
2719 * Non-Carbon CFM: not available
2720 }
HIViewTrackMouseLocationnull2721 function HIViewTrackMouseLocation( inView: HIViewRef; inOptions: OptionBits; inTimeout: EventTimeout; inClientEventCount: ItemCount; inClientEventList: EventTypeSpecPtr { can be NULL }; var outWhere: HIPoint; outModifiers: UInt32Ptr { can be NULL }; outEvent: EventRefPtr { can be NULL }; var outResult: MouseTrackingResult ): OSStatus; external name '_HIViewTrackMouseLocation';
2722 (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
2723
2724
2725 {
2726 * HIViewTrackMouseShape()
2727 *
2728 * Summary:
2729 * An HIView-based version of TrackMouseRegion.
2730 *
2731 * Discussion:
2732 * This routine is similar to TrackMouseRegion described in
2733 * CarbonEvents.i. Please read the notes on that function as well.
2734 * HIViewTrackMouseShape optionally returns the EventRef that ended
2735 * the tracking loop, and the caller may extend the list of events
2736 * that end the loop.
2737 *
2738 * Mac OS X threading:
2739 * Not thread safe
2740 *
2741 * Parameters:
2742 *
2743 * inView:
2744 * The HIViewRef in whose coordinate space to return the mouse
2745 * position.
2746 *
2747 * inShape:
2748 * The shape to observe. This shape should be in the coordinates
2749 * of the view specified in the inView parameter.
2750 *
2751 * ioWasInShape:
2752 * On entry, this parameter should be set to true if the mouse is
2753 * currently inside the shape passed in inShape, or false if the
2754 * mouse is currently outside the shape. On exit, this parameter
2755 * is updated to reflect the current reality; e.g., if the
2756 * outResult parameter returns kMouseTrackingMouseExited,
2757 * ioWasInShape will be set to false when this function exits.
2758 * Because it is updated from within, you should only need to set
2759 * this yourself before the first call to this function in your
2760 * tracking loop. Typically, you should set this value to false
2761 * initially, and HIViewTrackMouseShape will return immediately
2762 * with kMouseTrackingMouseEntered if your guess was wrong.
2763 *
2764 * inOptions:
2765 * Pass kTrackMouseLocationOptionDontConsumeMouseUp to indicate
2766 * that the toolbox should leave mouse-up events in the queue.
2767 * Pass kTrackMouseLocationOptionIncludeScrollWheel to indicate
2768 * that the tracking loop should terminate when a
2769 * kEventMouseWheelMoved or kEventMouseScroll event is received.
2770 *
2771 * inTimeout:
2772 * The amount of time to wait for an event. If no events arrive
2773 * within this time, kMouseTrackingTimedOut is returned in
2774 * outResult. Pass kEventDurationForever to wait indefinitely for
2775 * the next event.
2776 *
2777 * inClientEventCount:
2778 * Number of caller-supplied EventTypeSpecs in the
2779 * inClientEventList parameter. Pass 0 if you do not want any
2780 * custom event types to end the tracking loop.
2781 *
2782 * inClientEventList:
2783 * Array of caller-supplied EventTypeSpecs that the caller wants
2784 * to end the tracking loop. Pass NULL if you do not want any
2785 * custom event types to end the tracking loop.
2786 *
2787 * outModifiers:
2788 * On exit, this parameter receives the most recent state of the
2789 * keyboard modifiers. If a timeout caused this function to exit,
2790 * the current keyboard modifiers at the time are returned. You
2791 * may pass NULL if you don't need this information.
2792 *
2793 * outEvent:
2794 * On exit, this parameter receives the EventRef that caused the
2795 * function to exit. You may pass NULL if you don't need this
2796 * information. The event will be NULL for mouse-tracking results
2797 * that don't involve events, such as the timeout expiring. If the
2798 * event is not NULL, you must release the event when you're done
2799 * with it.
2800 *
2801 * outResult:
2802 * On exit, this parameter receives a value representing what kind
2803 * of event was received that cause the function to exit, such as
2804 * kMouseTrackingMouseUp. If a caller-supplied EventTypeSpec ended
2805 * the loop, kMouseTrackingClientEvent is returned.
2806 *
2807 * Availability:
2808 * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
2809 * CarbonLib: not available
2810 * Non-Carbon CFM: not available
2811 }
HIViewTrackMouseShapenull2812 function HIViewTrackMouseShape( inView: HIViewRef; inShape: HIShapeRef; var ioWasInShape: Boolean; inOptions: OptionBits; inTimeout: EventTimeout; inClientEventCount: ItemCount; inClientEventList: EventTypeSpecPtr { can be NULL }; outModifiers: UInt32Ptr { can be NULL }; outEvent: EventRefPtr { can be NULL }; var outResult: MouseTrackingResult ): OSStatus; external name '_HIViewTrackMouseShape';
2813 (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
2814
2815
2816 {==============================================================================}
2817 { HIView-based tracking areas }
2818 {==============================================================================}
2819 {$endc} {not TARGET_CPU_64}
2820
2821 type
2822 HIViewTrackingAreaRef = ^OpaqueHIViewTrackingAreaRef; { an opaque type }
2823 OpaqueHIViewTrackingAreaRef = record end;
2824 HIViewTrackingAreaRefPtr = ^HIViewTrackingAreaRef;
2825 const
2826 kEventParamHIViewTrackingArea = FourCharCode('ctra'); { typeHIViewTrackingAreaRef}
2827 typeHIViewTrackingAreaRef = FourCharCode('ctra');
2828
2829 {
2830 * kEventClassControl / kEventControlTrackingAreaEntered
2831 *
2832 * Summary:
2833 * The mouse has entered a tracking area owned by your control.
2834 *
2835 * Discussion:
2836 * If you have installed a mouse tracking area in your view, you
2837 * will receive this event when the mouse enters that area. The
2838 * tracking area reference is sent with the event. This event is
2839 * sent only to the view, and is not propagated past it.
2840 *
2841 * Mac OS X threading:
2842 * Not thread safe
2843 *
2844 * Parameters:
2845 *
2846 * --> kEventParamDirectObject (in, typeControlRef)
2847 * The control that owns the tracking area and is receiving
2848 * the event. This parameter is available on Mac OS X 10.5 and
2849 * later.
2850 *
2851 * --> kEventParamHIViewTrackingArea (in, typeHIViewTrackingAreaRef)
2852 * The tracking area that was entered.
2853 *
2854 * --> kEventParamKeyModifiers (in, typeUInt32)
2855 * The keyboard modifiers that were in effect when the mouse
2856 * entered.
2857 *
2858 * --> kEventParamMouseLocation (in, typeHIPoint)
2859 * The location of the mouse in view coordinates.
2860 *
2861 * Availability:
2862 * Mac OS X: in version 10.4 and later in Carbon.framework
2863 * CarbonLib: not available
2864 }
2865 const
2866 kEventControlTrackingAreaEntered = 23;
2867
2868 {
2869 * kEventClassControl / kEventControlTrackingAreaExited
2870 *
2871 * Summary:
2872 * The mouse has exited a tracking area owned by your control.
2873 *
2874 * Discussion:
2875 * If you have installed a mouse tracking area in your view, you
2876 * will receive this event when the mouse leaves that area. The
2877 * tracking area reference is sent with the event. This event is
2878 * sent only to the view, and is not propagated past it.
2879 *
2880 * Mac OS X threading:
2881 * Not thread safe
2882 *
2883 * Parameters:
2884 *
2885 * --> kEventParamDirectObject (in, typeControlRef)
2886 * The control that owns the tracking area and is receiving
2887 * the event. This parameter is available on Mac OS X 10.5 and
2888 * later.
2889 *
2890 * --> kEventParamHIViewTrackingArea (in, typeHIViewTrackingAreaRef)
2891 * The tracking area that was entered.
2892 *
2893 * --> kEventParamKeyModifiers (in, typeUInt32)
2894 * The keyboard modifiers that were in effect when the mouse
2895 * left.
2896 *
2897 * --> kEventParamMouseLocation (in, typeHIPoint)
2898 * The location of the mouse in view coordinates. This point
2899 * may or may not lie on the boundary of the mouse region. It
2900 * is merely where the mouse was relative to the view when the
2901 * exit event was generated.
2902 *
2903 * Availability:
2904 * Mac OS X: in version 10.4 and later in Carbon.framework
2905 * CarbonLib: not available
2906 }
2907 const
2908 kEventControlTrackingAreaExited = 24;
2909
2910
2911 type
2912 HIViewTrackingAreaID = UInt64;
2913 HIViewTrackingAreaIDPtr = ^HIViewTrackingAreaID;
2914 {$ifc not TARGET_CPU_64}
2915 {
2916 * HIViewNewTrackingArea()
2917 *
2918 * Summary:
2919 * Creates a new tracking area for a view.
2920 *
2921 * Mac OS X threading:
2922 * Not thread safe
2923 *
2924 * Parameters:
2925 *
2926 * inView:
2927 * The view to create a tracking area for.
2928 *
2929 * inShape:
2930 * The shape to use. Pass NULL to indicate the entire structure
2931 * region of the view is to be used.
2932 *
2933 * inID:
2934 * An identifier for this tracking area. This value is completely
2935 * up to the view to define. Pass zero if you don't care.
2936 *
2937 * outRef:
2938 * A reference to the newly created tracking area. This reference
2939 * is NOT refcounted. The tracking area will be automatically
2940 * destroyed when the view is destroyed; you do not need to
2941 * destroy the tracking area yourself unless you want to remove it
2942 * from the view before the view is destroyed. This parameter can
2943 * be NULL in Mac OS X 10.5 or later if you don't need this
2944 * information.
2945 *
2946 * Result:
2947 * An operating system status code.
2948 *
2949 * Availability:
2950 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
2951 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
2952 * Non-Carbon CFM: not available
2953 }
HIViewNewTrackingAreanull2954 function HIViewNewTrackingArea( inView: HIViewRef; inShape: HIShapeRef { can be NULL }; inID: HIViewTrackingAreaID; outRef: HIViewTrackingAreaRefPtr { can be NULL } ): OSStatus; external name '_HIViewNewTrackingArea';
2955 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
2956
2957
2958 {
2959 * HIViewChangeTrackingArea()
2960 *
2961 * Summary:
2962 * Alters the shape of an existing tracking area.
2963 *
2964 * Mac OS X threading:
2965 * Not thread safe
2966 *
2967 * Parameters:
2968 *
2969 * inArea:
2970 * The area to change.
2971 *
2972 * inShape:
2973 * The shape to use. Pass NULL to indicate the entire structure
2974 * region of the view is to be used.
2975 *
2976 * Result:
2977 * An operating system status code.
2978 *
2979 * Availability:
2980 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
2981 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
2982 * Non-Carbon CFM: not available
2983 }
HIViewChangeTrackingAreanull2984 function HIViewChangeTrackingArea( inArea: HIViewTrackingAreaRef; inShape: HIShapeRef ): OSStatus; external name '_HIViewChangeTrackingArea';
2985 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
2986
2987
2988 {
2989 * HIViewGetTrackingAreaID()
2990 *
2991 * Summary:
2992 * Retrieves the HIViewTrackingAreaID of an existing tracking area.
2993 * This value was set upon creation of the HIViewTrackingArea.
2994 *
2995 * Mac OS X threading:
2996 * Not thread safe
2997 *
2998 * Parameters:
2999 *
3000 * inArea:
3001 * The area whose HIViewTrackingAreaID to retrieve.
3002 *
3003 * outID:
3004 * The HIViewTrackingAreaID for this tracking area.
3005 *
3006 * Result:
3007 * An operating system status code.
3008 *
3009 * Availability:
3010 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
3011 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
3012 * Non-Carbon CFM: not available
3013 }
HIViewGetTrackingAreaIDnull3014 function HIViewGetTrackingAreaID( inArea: HIViewTrackingAreaRef; var outID: HIViewTrackingAreaID ): OSStatus; external name '_HIViewGetTrackingAreaID';
3015 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
3016
3017
3018 {
3019 * HIViewDisposeTrackingArea()
3020 *
3021 * Summary:
3022 * Disposes an existing tracking area. The reference is considered
3023 * to be invalid after calling this function. Note that all tracking
3024 * areas attached to a view are automatically destroyed when the
3025 * view is destroyed.
3026 *
3027 * Mac OS X threading:
3028 * Not thread safe
3029 *
3030 * Parameters:
3031 *
3032 * inArea:
3033 * The area to dispose.
3034 *
3035 * Result:
3036 * An operating system status code.
3037 *
3038 * Availability:
3039 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
3040 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
3041 * Non-Carbon CFM: not available
3042 }
HIViewDisposeTrackingAreanull3043 function HIViewDisposeTrackingArea( inArea: HIViewTrackingAreaRef ): OSStatus; external name '_HIViewDisposeTrackingArea';
3044 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
3045
3046
3047 {==============================================================================}
3048 { DISPLAY }
3049 {==============================================================================}
3050 {
3051 * HIViewGetNeedsDisplay()
3052 *
3053 * Discussion:
3054 * Returns true if the view passed in or any subview of it requires
3055 * redrawing (i.e. part of it has been invalidated).
3056 *
3057 * Mac OS X threading:
3058 * Not thread safe
3059 *
3060 * Parameters:
3061 *
3062 * inView:
3063 * The view to inspect.
3064 *
3065 * Result:
3066 * A boolean result code.
3067 *
3068 * Availability:
3069 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
3070 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
3071 * Non-Carbon CFM: not available
3072 }
HIViewGetNeedsDisplaynull3073 function HIViewGetNeedsDisplay( inView: HIViewRef ): Boolean; external name '_HIViewGetNeedsDisplay';
3074 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
3075
3076
3077 {
3078 * HIViewSetNeedsDisplay()
3079 *
3080 * Discussion:
3081 * Marks a view as needing to be completely redrawn, or completely
3082 * valid. If the view is not visible, or is obscured completely by
3083 * other views, no action is taken.
3084 *
3085 * Note that this API does not affect the state of subviews of this
3086 * view. If you need to modify subview state, you should use either
3087 * HIViewSetSubviewsNeedDisplayInShape on Mac OS X 10.5 and later,
3088 * or iterate over subviews with HIViewGetFirstSubview and
3089 * HIViewGetNextView.
3090 *
3091 * Mac OS X threading:
3092 * Not thread safe
3093 *
3094 * Parameters:
3095 *
3096 * inView:
3097 * The view to mark dirty.
3098 *
3099 * inNeedsDisplay:
3100 * A boolean which indicates whether inView needs to be redrawn or
3101 * not.
3102 *
3103 * Result:
3104 * An operating system result code.
3105 *
3106 * Availability:
3107 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
3108 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
3109 * Non-Carbon CFM: not available
3110 }
HIViewSetNeedsDisplaynull3111 function HIViewSetNeedsDisplay( inView: HIViewRef; inNeedsDisplay: Boolean ): OSStatus; external name '_HIViewSetNeedsDisplay';
3112 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
3113
3114
3115 {
3116 * HIViewSetNeedsDisplayInRect()
3117 *
3118 * Discussion:
3119 * Marks a portion of a view as needing to be redrawn, or valid. If
3120 * the view is not visible, or is obscured completely by other
3121 * views, no action is taken. The rectangle passed is effectively
3122 * intersected with the view's visible region. It should be in
3123 * view-relative coordinates.
3124 *
3125 * Note that this API does not affect the state of subviews of this
3126 * view. If you need to modify subview state, you should use either
3127 * HIViewSetSubviewsNeedDisplayInShape on Mac OS X 10.5 and later,
3128 * or iterate over subviews with HIViewGetFirstSubview and
3129 * HIViewGetNextView.
3130 *
3131 * Mac OS X threading:
3132 * Not thread safe
3133 *
3134 * Parameters:
3135 *
3136 * inView:
3137 * The view to mark dirty.
3138 *
3139 * inRect:
3140 * The rectangle encompassing the area to mark dirty or clean.
3141 *
3142 * inNeedsDisplay:
3143 * A boolean which indicates whether or not inRect should be added
3144 * to the invalid region or removed from it.
3145 *
3146 * Result:
3147 * An operating system result code.
3148 *
3149 * Availability:
3150 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
3151 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
3152 * Non-Carbon CFM: not available
3153 }
HIViewSetNeedsDisplayInRectnull3154 function HIViewSetNeedsDisplayInRect( inView: HIViewRef; const (*var*) inRect: HIRect; inNeedsDisplay: Boolean ): OSStatus; external name '_HIViewSetNeedsDisplayInRect';
3155 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
3156
3157
3158 {
3159 * HIViewSetNeedsDisplayInShape()
3160 *
3161 * Discussion:
3162 * Marks a portion of a view as needing to be redrawn, or valid. If
3163 * the view is not visible, or is obscured completely by other
3164 * views, no action is taken. The shape passed is effectively
3165 * intersected with the view's visible region. It should be in
3166 * view-relative coordinates.
3167 *
3168 * Note that this API does not affect the state of subviews of this
3169 * view. If you need to modify subview state, you should use either
3170 * HIViewSetSubviewsNeedDisplayInShape on Mac OS X 10.5 and later,
3171 * or iterate over subviews with HIViewGetFirstSubview and
3172 * HIViewGetNextView.
3173 *
3174 * Mac OS X threading:
3175 * Not thread safe
3176 *
3177 * Parameters:
3178 *
3179 * inView:
3180 * The view to mark dirty.
3181 *
3182 * inArea:
3183 * The area to mark dirty or clean, in the coordinate system of
3184 * the view. This parameter may be NULL in Mac OS X 10.5 and later
3185 * to indicate that the entire view should be affected.
3186 *
3187 * inNeedsDisplay:
3188 * A boolean which indicates whether or not inArea should be added
3189 * to the invalid region or removed from it.
3190 *
3191 * Result:
3192 * An operating system result code.
3193 *
3194 * Availability:
3195 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
3196 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
3197 * Non-Carbon CFM: not available
3198 }
HIViewSetNeedsDisplayInShapenull3199 function HIViewSetNeedsDisplayInShape( inView: HIViewRef; inArea: HIShapeRef; inNeedsDisplay: Boolean ): OSStatus; external name '_HIViewSetNeedsDisplayInShape';
3200 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
3201
3202
3203 {
3204 * HIViewSetNeedsDisplayInRegion()
3205 *
3206 * Discussion:
3207 * Marks a portion of a view as needing to be redrawn, or valid. If
3208 * the view is not visible, or is obscured completely by other
3209 * views, no action is taken. The region passed is effectively
3210 * intersected with the view's visible region. It should be in
3211 * view-relative coordinates.
3212 *
3213 * Note that this API does not affect the state of subviews of this
3214 * view. If you need to modify subview state, you should use either
3215 * HIViewSetSubviewsNeedDisplayInShape on Mac OS X 10.5 and later,
3216 * or iterate over subviews with HIViewGetFirstSubview and
3217 * HIViewGetNextView.
3218 *
3219 * Mac OS X threading:
3220 * Not thread safe
3221 *
3222 * Parameters:
3223 *
3224 * inView:
3225 * The view to mark dirty.
3226 *
3227 * inRgn:
3228 * The region to mark dirty or clean.
3229 *
3230 * inNeedsDisplay:
3231 * A boolean which indicates whether or not inRgn should be added
3232 * to the invalid region or removed from it.
3233 *
3234 * Result:
3235 * An operating system result code.
3236 *
3237 * Availability:
3238 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
3239 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
3240 * Non-Carbon CFM: not available
3241 }
HIViewSetNeedsDisplayInRegionnull3242 function HIViewSetNeedsDisplayInRegion( inView: HIViewRef; inRgn: RgnHandle; inNeedsDisplay: Boolean ): OSStatus; external name '_HIViewSetNeedsDisplayInRegion';
3243 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
3244
3245
3246 {
3247 * HIViewSetSubviewsNeedDisplayInShape()
3248 *
3249 * Summary:
3250 * Validates or invalidates a portion of a view and all of its
3251 * subviews.
3252 *
3253 * Discussion:
3254 * Marks a portion of a view as needing to be redrawn, or valid, and
3255 * then does the same for each subview of the view. If the view or a
3256 * subview is not visible, or is obscured completely by other views,
3257 * no action is taken for that view. The shape passed is effectively
3258 * intersected with each view's visible region. The shape should be
3259 * in view-relative coordinates.
3260 *
3261 * Note! It is very rare that an application truly needs to
3262 * invalidate a view and all of its subviews. Normally, when a view
3263 * is invalidated, its subviews will be automatically redrawn by the
3264 * HIView Manager after the parent view is redrawn, so it is not
3265 * necessary to explicitly invalidate the subviews. (The only
3266 * exception occurs when the parent view uses
3267 * kHIViewFeatureDoesNotDraw; in that case, invalidating the parent
3268 * view does nothing, and subviews are not invalidated or redrawn.)
3269 * In most cases, if you think you need to use this API, you should
3270 * probably consider whether all of the subviews need to redraw, or
3271 * just some of them, and explicitly invalidate only those subviews
3272 * that need to redraw. That will give you better performance than
3273 * invalidating and redrawing every subview.
3274 *
3275 * Mac OS X threading:
3276 * Not thread safe
3277 *
3278 * Parameters:
3279 *
3280 * inView:
3281 * The view to mark dirty.
3282 *
3283 * inArea:
3284 * The area to mark dirty or clean, in the coordinate system of
3285 * the view. This parameter may be NULL to indicate that the
3286 * entire view should be affected.
3287 *
3288 * inNeedsDisplay:
3289 * A boolean which indicates whether or not inArea should be added
3290 * to the invalid region or removed from it.
3291 *
3292 * Result:
3293 * An operating system result code.
3294 *
3295 * Availability:
3296 * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
3297 * CarbonLib: not available
3298 * Non-Carbon CFM: not available
3299 }
HIViewSetSubviewsNeedDisplayInShapenull3300 function HIViewSetSubviewsNeedDisplayInShape( inView: HIViewRef; inArea: HIShapeRef; inNeedsDisplay: Boolean ): OSStatus; external name '_HIViewSetSubviewsNeedDisplayInShape';
3301 (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
3302
3303
3304 {
3305 * HIViewRender()
3306 *
3307 * Discussion:
3308 * Renders the invalid portions of a view (as marked with
3309 * HIViewSetNeedsDisplay[InRegion]) immediately. Normally, these
3310 * areas are redrawn at event loop time, but there might be
3311 * situations where you need an immediate draw. Use this sparingly,
3312 * as it does cause a fully composited draw for the area of the
3313 * view; that is, all other views that intersect the area of the
3314 * specified view will also be drawn. Calling this for several views
3315 * at a particular level of a hierarchy can be costly. We highly
3316 * recommend that you only pass the root view of a window to this
3317 * API. The behavior of this API when passed a non-root view was
3318 * poorly defined in Mac OS X 10.3 and has changed in Mac OS X 10.4.
3319 * In 10.3, calling this API on a non-root view would entirely
3320 * validate all of the views in the window that intersect the
3321 * specified view, including portions that did not intersect the
3322 * specified view and so were not actually drawn. In 10.4, calling
3323 * this API on a non-root view will only validate those portions of
3324 * each view that intersect the specified view.
3325 *
3326 * Mac OS X threading:
3327 * Not thread safe
3328 *
3329 * Parameters:
3330 *
3331 * inView:
3332 * The view to draw.
3333 *
3334 * Result:
3335 * An operating system result code.
3336 *
3337 * Availability:
3338 * Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
3339 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
3340 * Non-Carbon CFM: not available
3341 }
HIViewRendernull3342 function HIViewRender( inView: HIViewRef ): OSStatus; external name '_HIViewRender';
3343 (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
3344
3345
3346 {
3347 * HIViewGetSizeConstraints()
3348 *
3349 * Discussion:
3350 * Return the minimum and maximum size for a view. A view must
3351 * respond to this protocol to get meaningful results. These sizes
3352 * can be used to help autoposition subviews, for example.
3353 *
3354 * Mac OS X threading:
3355 * Not thread safe
3356 *
3357 * Parameters:
3358 *
3359 * inView:
3360 * The view to inspect.
3361 *
3362 * outMinSize:
3363 * The minimum size the view can be. May be NULL if you don't need
3364 * this information.
3365 *
3366 * outMaxSize:
3367 * The maximum size the view can be. May be NULL if you don't need
3368 * this information.
3369 *
3370 * Result:
3371 * An operating system result code.
3372 *
3373 * Availability:
3374 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
3375 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
3376 * Non-Carbon CFM: not available
3377 }
HIViewGetSizeConstraintsnull3378 function HIViewGetSizeConstraints( inView: HIViewRef; outMinSize: HISizePtr { can be NULL }; outMaxSize: HISizePtr { can be NULL } ): OSStatus; external name '_HIViewGetSizeConstraints';
3379 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
3380
3381
3382 {==============================================================================}
3383 { COORDINATE SYSTEM CONVERSION }
3384 {==============================================================================}
3385 {
3386 * HIViewConvertPoint()
3387 *
3388 * Discussion:
3389 * Converts a point from one view to another. Both views must have a
3390 * common ancestor, i.e. they must both be in the same window.
3391 *
3392 * Mac OS X threading:
3393 * Not thread safe
3394 *
3395 * Parameters:
3396 *
3397 * ioPoint:
3398 * The point to convert.
3399 *
3400 * inSourceView:
3401 * The view whose coordinate system ioPoint is starting out in.
3402 * You can pass NULL to indicate that ioPoint is a window-relative
3403 * point.
3404 *
3405 * inDestView:
3406 * The view whose coordinate system ioPoint should end up in. You
3407 * can pass NULL to indicate that ioPoint is a window-relative
3408 * point.
3409 *
3410 * Result:
3411 * An operating system result code.
3412 *
3413 * Availability:
3414 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
3415 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
3416 * Non-Carbon CFM: not available
3417 }
HIViewConvertPointnull3418 function HIViewConvertPoint( var ioPoint: HIPoint; inSourceView: HIViewRef; inDestView: HIViewRef ): OSStatus; external name '_HIViewConvertPoint';
3419 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
3420
3421
3422 {
3423 * HIViewConvertRect()
3424 *
3425 * Discussion:
3426 * Converts a rectangle from one view to another. Both views must
3427 * have a common ancestor, i.e. they must both be in the same window.
3428 *
3429 * Mac OS X threading:
3430 * Not thread safe
3431 *
3432 * Parameters:
3433 *
3434 * ioRect:
3435 * The rectangle to convert.
3436 *
3437 * inSourceView:
3438 * The view whose coordinate system ioRect is starting out in. You
3439 * can pass NULL to indicate that ioRect is a window-relative
3440 * rectangle.
3441 *
3442 * inDestView:
3443 * The view whose coordinate system ioRect should end up in. You
3444 * can pass NULL to indicate that ioRect is a window-relative
3445 * rectangle.
3446 *
3447 * Result:
3448 * An operating system result code.
3449 *
3450 * Availability:
3451 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
3452 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
3453 * Non-Carbon CFM: not available
3454 }
HIViewConvertRectnull3455 function HIViewConvertRect( var ioRect: HIRect; inSourceView: HIViewRef; inDestView: HIViewRef ): OSStatus; external name '_HIViewConvertRect';
3456 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
3457
3458
3459 {
3460 * HIViewConvertRegion()
3461 *
3462 * Discussion:
3463 * Converts a region from one view to another. Both views must have
3464 * a common ancestor, i.e. they must both be in the same window.
3465 *
3466 * Mac OS X threading:
3467 * Not thread safe
3468 *
3469 * Parameters:
3470 *
3471 * ioRgn:
3472 * The region to convert.
3473 *
3474 * inSourceView:
3475 * The view whose coordinate system ioRgn is starting out in. You
3476 * can pass NULL to indicate that ioRgn is a window-relative
3477 * region.
3478 *
3479 * inDestView:
3480 * The view whose coordinate system ioRgn should end up in. You
3481 * can pass NULL to indicate that ioRgn is a window-relative
3482 * region.
3483 *
3484 * Result:
3485 * An operating system result code.
3486 *
3487 * Availability:
3488 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
3489 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
3490 * Non-Carbon CFM: not available
3491 }
HIViewConvertRegionnull3492 function HIViewConvertRegion( ioRgn: RgnHandle; inSourceView: HIViewRef; inDestView: HIViewRef ): OSStatus; external name '_HIViewConvertRegion';
3493 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
3494
3495
3496 {
3497 * HIViewSetDrawingEnabled()
3498 *
3499 * Discussion:
3500 * Turns view drawing on or off. You can use this to ensure that no
3501 * drawing events are sent to the view. Even Draw1Control will not
3502 * draw! HIViewSetNeedsDisplay is also rendered useless when drawing
3503 * is off.
3504 *
3505 * Mac OS X threading:
3506 * Not thread safe
3507 *
3508 * Parameters:
3509 *
3510 * inView:
3511 * The view to enable or disable drawing for.
3512 *
3513 * inEnabled:
3514 * A boolean value indicating whether drawing should be on (true)
3515 * or off (false).
3516 *
3517 * Result:
3518 * An operating system result code.
3519 *
3520 * Availability:
3521 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
3522 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
3523 * Non-Carbon CFM: not available
3524 }
HIViewSetDrawingEnablednull3525 function HIViewSetDrawingEnabled( inView: HIViewRef; inEnabled: Boolean ): OSStatus; external name '_HIViewSetDrawingEnabled';
3526 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
3527
3528
3529 {
3530 * HIViewIsDrawingEnabled()
3531 *
3532 * Discussion:
3533 * Determines if drawing is currently enabled for a view.
3534 *
3535 * Mac OS X threading:
3536 * Not thread safe
3537 *
3538 * Parameters:
3539 *
3540 * inView:
3541 * The view to get the drawing state for.
3542 *
3543 * Result:
3544 * A boolean value indicating whether drawing is on (true) or off
3545 * (false).
3546 *
3547 * Availability:
3548 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
3549 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
3550 * Non-Carbon CFM: not available
3551 }
HIViewIsDrawingEnablednull3552 function HIViewIsDrawingEnabled( inView: HIViewRef ): Boolean; external name '_HIViewIsDrawingEnabled';
3553 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
3554
3555
3556 {
3557 * HIViewScrollRect()
3558 *
3559 * Discussion:
3560 * Scrolls a view's contents, or a portion thereof. A view's
3561 * contents are the pixels that it or any of its descendent views
3562 * has drawn into. This will actually blit the contents of the view
3563 * as appropriate to scroll, and then invalidate those portions
3564 * which need to be redrawn. Be warned that this is a raw bit
3565 * scroll. Anything that might overlap the target view will get
3566 * thrashed as well.
3567 *
3568 * Mac OS X threading:
3569 * Not thread safe
3570 *
3571 * Parameters:
3572 *
3573 * inView:
3574 * The view to scroll. The bits drawn by the view's descendent
3575 * views will also be scrolled.
3576 *
3577 * inRect:
3578 * The rect to scroll. Pass NULL to mean the entire view. The rect
3579 * passed cannot be bigger than the view's bounds. It must be in
3580 * the local coordinate system of the view.
3581 *
3582 * inDX:
3583 * The horizontal distance to scroll. Positive values shift to the
3584 * right, negative values shift to the left.
3585 *
3586 * inDY:
3587 * The vertical distance to scroll. Positive values shift
3588 * downward, negative values shift upward.
3589 *
3590 * Result:
3591 * An operating system result code.
3592 *
3593 * Availability:
3594 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
3595 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
3596 * Non-Carbon CFM: not available
3597 }
HIViewScrollRectnull3598 function HIViewScrollRect( inView: HIViewRef; {const} inRect: HIRectPtr { can be NULL }; inDX: CGFloat; inDY: CGFloat ): OSStatus; external name '_HIViewScrollRect';
3599 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
3600
3601
3602 {
3603 * HIViewSetBoundsOrigin()
3604 *
3605 * Discussion:
3606 * This API sets the origin of the view. This effectively also moves
3607 * all subviews of a view as well. This call will NOT invalidate the
3608 * view. This is because you might want to move the contents with
3609 * HIViewScrollRect instead of redrawing the complete content.
3610 *
3611 * Mac OS X threading:
3612 * Not thread safe
3613 *
3614 * Parameters:
3615 *
3616 * inView:
3617 * The view whose origin you wish to adjust.
3618 *
3619 * inX:
3620 * The X coordinate.
3621 *
3622 * inY:
3623 * The Y coordinate.
3624 *
3625 * Result:
3626 * An operating system result code.
3627 *
3628 * Availability:
3629 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
3630 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
3631 * Non-Carbon CFM: not available
3632 }
HIViewSetBoundsOriginnull3633 function HIViewSetBoundsOrigin( inView: HIViewRef; inX: CGFloat; inY: CGFloat ): OSStatus; external name '_HIViewSetBoundsOrigin';
3634 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
3635
3636
3637 {==============================================================================}
3638 { KEYBOARD FOCUS }
3639 {==============================================================================}
3640 {$endc} {not TARGET_CPU_64}
3641
3642
3643 {
3644 * Summary:
3645 * Option bits for use with HIViewAdvanceFocusWithOptions and
3646 * HIViewSetFocus.
3647 }
3648 const
3649 {
3650 * Explicitly requests "focus on everything" mode. All controls will
3651 * be considered focusable, regardless of the user's current
3652 * preferences. If this option is not specified, then setting or
3653 * advancing focus will obey the user's current preferences for
3654 * focusing traditionally or focusing on any control.
3655 }
3656 kHIViewFocusOnAnyControl = 1 shl 0;
3657
3658 {
3659 * Explicitly requests "traditional focus" mode. Only traditionally
3660 * focusable controls (text and lists) will be considered focusable,
3661 * regardless of the user's current preference. If this option is not
3662 * specified, then setting or advancing focus will obey the user's
3663 * current preferences for focusing traditionally or focusing on any
3664 * control.
3665 }
3666 kHIViewFocusTraditionally = 1 shl 1;
3667
3668 {
3669 * If advancing the focus would wrap around to the beginning or end
3670 * of the focus root, then errCouldntSetFocus is returned. If this
3671 * option is not specified, then advancing (or reversing) the focus
3672 * will wrap around to the first (or last) focusable child of the
3673 * focus root. This option is only valid for the
3674 * HIViewAdvanceFocusWithOptions API.
3675 }
3676 kHIViewFocusWithoutWrapping = 1 shl 2;
3677
3678 {$ifc not TARGET_CPU_64}
3679 {
3680 * HIViewAdvanceFocus()
3681 *
3682 * Discussion:
3683 * Advances the focus to the next most appropriate view. Unless
3684 * overridden in some fashion (either by overriding certain carbon
3685 * events or using the HIViewSetNextFocus API), the Toolbox will use
3686 * a spacially determinant method of focusing, attempting to focus
3687 * left to right, top to bottom in a window, taking groups of views
3688 * into account.
3689 *
3690 * Mac OS X threading:
3691 * Not thread safe
3692 *
3693 * Parameters:
3694 *
3695 * inRootForFocus:
3696 * The subtree to manipulate. The focus will never leave
3697 * inRootToFocus. Typically you would pass the content of the
3698 * window, or the root. If focused on the toolbar, for example,
3699 * the focus is limited to the toolbar only. In this case, the
3700 * Toolbox passes the toolbar view in as the focus root for
3701 * example.
3702 *
3703 * inModifiers:
3704 * The EventModifiers of the keyboard event that ultimately caused
3705 * the call to HIViewAdvanceFocus. These modifiers are used to
3706 * determine the focus direction as well as other alternate
3707 * focusing behaviors.
3708 *
3709 * Result:
3710 * An operating system result code.
3711 *
3712 * Availability:
3713 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
3714 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
3715 * Non-Carbon CFM: not available
3716 }
HIViewAdvanceFocusnull3717 function HIViewAdvanceFocus( inRootForFocus: HIViewRef; inModifiers: EventModifiers ): OSStatus; external name '_HIViewAdvanceFocus';
3718 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
3719
3720
3721 {
3722 * HIViewAdvanceFocusWithOptions()
3723 *
3724 * Summary:
3725 * Changes the focus in a window to the next or previous view.
3726 *
3727 * Discussion:
3728 * This API has the same default behavior as HIViewAdvanceFocus, but
3729 * the options parameter allows you to control some aspects of the
3730 * focus behavior.
3731 *
3732 * Mac OS X threading:
3733 * Not thread safe
3734 *
3735 * Parameters:
3736 *
3737 * inRootForFocus:
3738 * The root of the view hierarchy in which focusing will occur.
3739 * Typically, this will be the content view of a window, but you
3740 * may pass in other subviews as well to further constrain the
3741 * focus.
3742 *
3743 * inModifiers:
3744 * The event modifiers that the user pressed. If the Shift
3745 * modifier is set, focus will move to the previous view;
3746 * otherwise, it will move to the next view.
3747 *
3748 * inOptions:
3749 * Options to further customize the focusing behavior. See
3750 * kHIViewFocus constants.
3751 *
3752 * Result:
3753 * An operating system result code, including errCouldntSetFocus if
3754 * the focus could not be set.
3755 *
3756 * Availability:
3757 * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
3758 * CarbonLib: not available
3759 * Non-Carbon CFM: not available
3760 }
HIViewAdvanceFocusWithOptionsnull3761 function HIViewAdvanceFocusWithOptions( inRootForFocus: HIViewRef; inModifiers: UInt32; inOptions: OptionBits ): OSStatus; external name '_HIViewAdvanceFocusWithOptions';
3762 (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
3763
3764
3765 {
3766 * HIViewGetFocusPart()
3767 *
3768 * Discussion:
3769 * Returns the currently focused part of the given view.
3770 *
3771 * Mac OS X threading:
3772 * Not thread safe
3773 *
3774 * Parameters:
3775 *
3776 * inView:
3777 * The view to inquire about.
3778 *
3779 * outFocusPart:
3780 * The part currently focused.
3781 *
3782 * Result:
3783 * An operating system result code.
3784 *
3785 * Availability:
3786 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
3787 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
3788 * Non-Carbon CFM: not available
3789 }
HIViewGetFocusPartnull3790 function HIViewGetFocusPart( inView: HIViewRef; var outFocusPart: HIViewPartCode ): OSStatus; external name '_HIViewGetFocusPart';
3791 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
3792
3793
3794 {
3795 * HIViewSubtreeContainsFocus()
3796 *
3797 * Discussion:
3798 * Given a view, this function checks to see if it or any of its
3799 * children currently are the keyboard focus. If so, true is
3800 * returned as the function result.
3801 *
3802 * Mac OS X threading:
3803 * Not thread safe
3804 *
3805 * Parameters:
3806 *
3807 * inSubtreeStart:
3808 * The view to start searching at.
3809 *
3810 * Result:
3811 * A boolean result.
3812 *
3813 * Availability:
3814 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
3815 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
3816 * Non-Carbon CFM: not available
3817 }
HIViewSubtreeContainsFocusnull3818 function HIViewSubtreeContainsFocus( inSubtreeStart: HIViewRef ): Boolean; external name '_HIViewSubtreeContainsFocus';
3819 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
3820
3821
3822 {
3823 * HIViewSetNextFocus()
3824 *
3825 * Discussion:
3826 * This function hard-wires the next sibling view to shift focus to
3827 * whenever the keyboard focus is advanced.
3828 *
3829 * Mac OS X threading:
3830 * Not thread safe
3831 *
3832 * Parameters:
3833 *
3834 * inView:
3835 * The view to set the next focus view for. This parameter and the
3836 * inNextFocus parameter must both have the same parent view.
3837 *
3838 * inNextFocus:
3839 * The view to set focus to next. This parameter and the inView
3840 * parameter must both have the same parent view. Pass NULL to
3841 * tell the view system to use the default rules.
3842 *
3843 * Result:
3844 * An operating system result code.
3845 *
3846 * Availability:
3847 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
3848 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
3849 * Non-Carbon CFM: not available
3850 }
HIViewSetNextFocusnull3851 function HIViewSetNextFocus( inView: HIViewRef; inNextFocus: HIViewRef { can be NULL } ): OSStatus; external name '_HIViewSetNextFocus';
3852 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
3853
3854
3855 {
3856 * HIViewSetFirstSubViewFocus()
3857 *
3858 * Discussion:
3859 * This function hard-wires the first subview to shift focus to
3860 * whenever the keyboard focus is advanced and the container view is
3861 * entered.
3862 *
3863 * Mac OS X threading:
3864 * Not thread safe
3865 *
3866 * Parameters:
3867 *
3868 * inParent:
3869 * The parent view.
3870 *
3871 * inSubView:
3872 * The first child which should receive focus. Pass NULL to tell
3873 * the view system to use the default rules.
3874 *
3875 * Result:
3876 * An operating system result code.
3877 *
3878 * Availability:
3879 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
3880 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
3881 * Non-Carbon CFM: not available
3882 }
HIViewSetFirstSubViewFocusnull3883 function HIViewSetFirstSubViewFocus( inParent: HIViewRef; inSubView: HIViewRef { can be NULL } ): OSStatus; external name '_HIViewSetFirstSubViewFocus';
3884 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
3885
3886
3887 {
3888 * HIViewSetFocus()
3889 *
3890 * Summary:
3891 * Sets the focused view in a window.
3892 *
3893 * Discussion:
3894 * This API is a replacement for the SetKeyboardFocus API.
3895 *
3896 * Mac OS X threading:
3897 * Not thread safe
3898 *
3899 * Parameters:
3900 *
3901 * inView:
3902 * The view that should be focused. The window is implicitly
3903 * specified by this view.
3904 *
3905 * inPart:
3906 * The view part that should be focused. This parameter may be
3907 * kHIViewNoPart to remove focus from the view (and the window).
3908 *
3909 * inOptions:
3910 * Options to further customize the focusing behavior. Only
3911 * kHIViewFocusOnAnyControl and kHIViewFocusTraditionally are
3912 * currently allowed.
3913 *
3914 * Result:
3915 * An operating system result code.
3916 *
3917 * Availability:
3918 * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
3919 * CarbonLib: not available
3920 * Non-Carbon CFM: not available
3921 }
HIViewSetFocusnull3922 function HIViewSetFocus( inView: HIViewRef; inPart: HIViewPartCode; inOptions: OptionBits ): OSStatus; external name '_HIViewSetFocus';
3923 (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
3924
3925
3926 {
3927 * HIViewGetFocus()
3928 *
3929 * Summary:
3930 * Retrieves the focused view in a window.
3931 *
3932 * Discussion:
3933 * This API is a replacement for the GetKeyboardFocus API.
3934 *
3935 * Mac OS X threading:
3936 * Not thread safe
3937 *
3938 * Parameters:
3939 *
3940 * inWindow:
3941 * The window whose focused view to retrieve.
3942 *
3943 * outView:
3944 * On exit, contains the window's focused view.
3945 *
3946 * outPart:
3947 * On exit, contains the focused part of the focused view. This
3948 * parameter may be NULL if you don't need this information. You
3949 * can also get the focused part by calling HIViewGetFocusPart on
3950 * the focused view.
3951 *
3952 * Availability:
3953 * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
3954 * CarbonLib: not available
3955 * Non-Carbon CFM: not available
3956 }
HIViewGetFocusnull3957 function HIViewGetFocus( inWindow: WindowRef; var outView: HIViewRef; outPart: HIViewPartCodePtr { can be NULL } ): OSStatus; external name '_HIViewGetFocus';
3958 (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
3959
3960
3961 {
3962 * HIViewShowsFocus()
3963 *
3964 * Summary:
3965 * Indicates whether a view should show focus indicators, such as
3966 * focus rings.
3967 *
3968 * Discussion:
3969 * There are several factors that control whether a view should show
3970 * focus indicators, including:
3971 *
3972 * - does the view have a focused part?
3973 * - is the view active?
3974 * - is the view enabled?
3975 * - is the view contained in a window that shows focus indicators?
3976 *
3977 *
3978 * This API encapsulates checking for all of these factors.
3979 * Typically, a view will call this API in its kEventControlDraw
3980 * handler to determine whether it should draw focus indicators in
3981 * addition to its normal drawing.
3982 *
3983 * Mac OS X threading:
3984 * Not thread safe
3985 *
3986 * Parameters:
3987 *
3988 * inView:
3989 * The view whose state to examine.
3990 *
3991 * inPart:
3992 * A view part code. If this value is kHIViewNoPart, the API
3993 * returns true if any part of the view is focused. If this value
3994 * is not kHIViewNoPart, the API returns true if that specific
3995 * part is focused.
3996 *
3997 * Result:
3998 * Whether the view should draw focus indicators.
3999 *
4000 * Availability:
4001 * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
4002 * CarbonLib: not available
4003 * Non-Carbon CFM: not available
4004 }
HIViewShowsFocusnull4005 function HIViewShowsFocus( inView: HIViewRef; inPart: HIViewPartCode ): Boolean; external name '_HIViewShowsFocus';
4006 (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
4007
4008
4009 {==============================================================================}
4010 { LAYOUT }
4011 { Mac OS X 10.3 provides a layout engine for HIViews that allows applications }
4012 { to specify the layout relationships between multiple views. The layout }
4013 { engine will automatically reposition and resize views that have layout }
4014 { information when necessary. }
4015 {==============================================================================}
4016 {$endc} {not TARGET_CPU_64}
4017
4018
4019 {
4020 * Summary:
4021 * Since horizontal and vertical bindings are very similar in
4022 * application, except along different axes, the binding kinds have
4023 * been abstracted to minimum and maximum. Synonyms have been
4024 * provided for convenience. You are encouraged to use them.
4025 *
4026 * Discussion:
4027 * HIBindingKind constants.
4028 }
4029 const
4030 {
4031 * No binding is to occur.
4032 }
4033 kHILayoutBindNone = 0;
4034
4035 {
4036 * Bind to the minimum of the axis.
4037 }
4038 kHILayoutBindMin = 1;
4039
4040 {
4041 * Bind to the maximum of the axis.
4042 }
4043 kHILayoutBindMax = 2;
4044 kHILayoutBindLeft = kHILayoutBindMin;
4045 kHILayoutBindRight = kHILayoutBindMax;
4046
4047 {
4048 * Synonyms for convenience and clarity.
4049 }
4050 kHILayoutBindTop = kHILayoutBindMin;
4051 kHILayoutBindBottom = kHILayoutBindMax;
4052
4053 type
4054 HIBindingKind = UInt16;
4055
4056 {
4057 * HISideBinding
4058 *
4059 * Summary:
4060 * A binding for a side of an HIView.
4061 *
4062 * Discussion:
4063 * A side binding is entirely related to the change of the parent's
4064 * position or size (but only as the size affects the maximum edge
4065 * position). A side binding doesn't mean "move to where my
4066 * relative's side is" but rather "move as my relative's side has
4067 * moved".
4068 }
4069 type
4070 HISideBinding = record
4071 {
4072 * An HIViewRef to the view to which this side is bound. Can be NULL,
4073 * indicating that the the side is bound to its parent view.
4074 }
4075 toView: HIViewRef; { NULL means parent}
4076
4077 {
4078 * An HIBindingKind indicating the bind kind.
4079 }
4080 kind: HIBindingKind;
4081
4082 {
4083 * Not currently used. Must be set to 0.
4084 }
4085 offset: CGFloat;
4086 end;
4087
4088 {
4089 * HIBinding
4090 *
4091 * Summary:
4092 * A set of Top, Left, Bottom, and Right bindings for an HIView.
4093 }
4094 type
4095 HIBinding = record
4096 {
4097 * The top side bindings.
4098 }
4099 top: HISideBinding;
4100
4101 {
4102 * The left side bindings.
4103 }
4104 left: HISideBinding;
4105
4106 {
4107 * The bottom side bindings.
4108 }
4109 bottom: HISideBinding;
4110
4111 {
4112 * The right side bindings.
4113 }
4114 right: HISideBinding;
4115 end;
4116
4117 {
4118 * Discussion:
4119 * HIScaleKind constants.
4120 }
4121 const
4122 {
4123 * The scale is determined from the axis size.
4124 }
4125 kHILayoutScaleAbsolute = 0;
4126
4127
4128 type
4129 HIScaleKind = UInt16;
4130
4131 {
4132 * HIAxisScale
4133 *
4134 * Summary:
4135 * A scale description for an axis of an HIView.
4136 }
4137 type
4138 HIAxisScale = record
4139 {
4140 * An HIViewRef to the view to which this axis is scaled. Can be
4141 * NULL, indicating that the the axis is scaled relative to its
4142 * parent view.
4143 }
4144 toView: HIViewRef; { NULL means parent}
4145
4146 {
4147 * An HIScaleKind describing the type of scaling to be applied.
4148 * Currently, this field can't be anything other than
4149 * kHILayoutScaleAbsolute.
4150 }
4151 kind: HIScaleKind;
4152
4153 {
4154 * A CGFloat indicating how much to scale the HIView. 0 indicates no
4155 * scaling. A value of 1 indicates that the view is to always have
4156 * the same axial size.
4157 }
4158 ratio: CGFloat;
4159 end;
4160
4161 {
4162 * HIScaling
4163 *
4164 * Summary:
4165 * A set of scaling descriptions for the axes of an HIView.
4166 }
4167 type
4168 HIScaling = record
4169 {
4170 * An HIAxisScale describing the horizontal scaling for an HIView.
4171 }
4172 x: HIAxisScale;
4173
4174 {
4175 * An HIAxisScale describing the vertical scaling for an HIView.
4176 }
4177 y: HIAxisScale;
4178 end;
4179
4180 {
4181 * Summary:
4182 * Since horizontal and vertical positions are very similar in
4183 * application, except along different axes, the position kinds have
4184 * been abstracted to minimum and maximum. Synonyms have been
4185 * provided for convenience. You are encouraged to use them.
4186 *
4187 * Discussion:
4188 * HIPositionKind constants.
4189 }
4190 const
4191 {
4192 * No positioning is to occur.
4193 }
4194 kHILayoutPositionNone = 0;
4195
4196 {
4197 * Centered positioning will occur. The view will be centered
4198 * relative to the specified view.
4199 }
4200 kHILayoutPositionCenter = 1;
4201
4202 {
4203 * Minimum positioning will occur. The view will be left or top
4204 * aligned relative to the specified view.
4205 }
4206 kHILayoutPositionMin = 2;
4207
4208 {
4209 * Maximum positioning will occur. The view will be right or bottom
4210 * aligned relative to the specified view.
4211 }
4212 kHILayoutPositionMax = 3;
4213
4214 {
4215 * Synonyms for convenience and clarity.
4216 }
4217 kHILayoutPositionLeft = kHILayoutPositionMin;
4218 kHILayoutPositionRight = kHILayoutPositionMax;
4219 kHILayoutPositionTop = kHILayoutPositionMin;
4220 kHILayoutPositionBottom = kHILayoutPositionMax;
4221
4222
4223 type
4224 HIPositionKind = UInt16;
4225
4226 {
4227 * HIAxisPosition
4228 *
4229 * Summary:
4230 * An axial position description for an HIView.
4231 }
4232 type
4233 HIAxisPosition = record
4234 {
4235 * An HIViewRef to the view relative to which a view will be
4236 * positioned. Can be NULL, indicating that the the view is
4237 * positioned relative to its parent view.
4238 }
4239 toView: HIViewRef; { NULL means parent}
4240
4241 {
4242 * An HIPositionKind indicating the kind of positioning to apply.
4243 }
4244 kind: HIPositionKind;
4245
4246 {
4247 * After the position kind has been applied, the origin component
4248 * that corresponds to the positioning axis is offet by this value.
4249 * (ex: Left aligned + 10 ).
4250 }
4251 offset: CGFloat;
4252 end;
4253
4254 {
4255 * HIPositioning
4256 *
4257 * Summary:
4258 * A positioning description for an HIView.
4259 }
4260 type
4261 HIPositioning = record
4262 {
4263 * An HIAxisPosition describing the horizontal positioning for an
4264 * HIView.
4265 }
4266 x: HIAxisPosition;
4267 y: HIAxisPosition;
4268 end;
4269
4270 {
4271 * HILayoutInfo
4272 *
4273 * Summary:
4274 * A layout description for an HIView.
4275 *
4276 * Discussion:
4277 * The different layout transformations are applied sequentially to
4278 * the HIView.
4279 *
4280 * First, the bindings are applied. Note that the bindings are
4281 * applied recursively to a container's HIViews. This requires care
4282 * on your part, especially when applying inter-relational bindings.
4283 *
4284 *
4285 * Then the scaling is applied (which could potentially override
4286 * some of the previously applied bindings). Then the positioning is
4287 * applied (which could potentially override some of the previously
4288 * applied scaling and bindings).
4289 }
4290 type
4291 HILayoutInfo = record
4292 {
4293 * The version of the structure. The current version is
4294 * kHILayoutInfoVersionZero.
4295 }
4296 version: UInt32;
4297
4298 {
4299 * An HIBinding structure describing the bindings to apply to the
4300 * sides of an HIView.
4301 }
4302 binding: HIBinding;
4303
4304 {
4305 * An HIScaling structure describing the axial scaling to apply to an
4306 * HIView.
4307 }
4308 scale: HIScaling;
4309
4310 {
4311 * An HIPositioning structure describing the positioning to apply to
4312 * an HIView.
4313 }
4314 position: HIPositioning;
4315 end;
4316 const
4317 kHILayoutInfoVersionZero = 0;
4318
4319 {$ifc not TARGET_CPU_64}
4320 {
4321 * HIViewGetLayoutInfo()
4322 *
4323 * Summary:
4324 * Get the layout info of an HIView.
4325 *
4326 * Mac OS X threading:
4327 * Not thread safe
4328 *
4329 * Parameters:
4330 *
4331 * inView:
4332 * The HIView whose layout info is to be retreived.
4333 *
4334 * outLayoutInfo:
4335 * A pointer to an HILayoutInfo record into which to copy the
4336 * layout info of the HIView. The version field of this record
4337 * must be valid or the call will fail.
4338 *
4339 * Result:
4340 * An operating system status code.
4341 *
4342 * Availability:
4343 * Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
4344 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
4345 * Non-Carbon CFM: not available
4346 }
HIViewGetLayoutInfonull4347 function HIViewGetLayoutInfo( inView: HIViewRef; var outLayoutInfo: HILayoutInfo ): OSStatus; external name '_HIViewGetLayoutInfo';
4348 (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
4349
4350
4351 {
4352 * HIViewSetLayoutInfo()
4353 *
4354 * Summary:
4355 * Set the layout info of an HIView.
4356 *
4357 * Mac OS X threading:
4358 * Not thread safe
4359 *
4360 * Parameters:
4361 *
4362 * inView:
4363 * The HIView whose layout info is to be set.
4364 *
4365 * inLayoutInfo:
4366 * A pointer to an HILayoutInfo record containing the layout
4367 * values to be set.
4368 *
4369 * Result:
4370 * An operating system status code.
4371 *
4372 * Availability:
4373 * Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
4374 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
4375 * Non-Carbon CFM: not available
4376 }
HIViewSetLayoutInfonull4377 function HIViewSetLayoutInfo( inView: HIViewRef; const (*var*) inLayoutInfo: HILayoutInfo ): OSStatus; external name '_HIViewSetLayoutInfo';
4378 (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
4379
4380
4381 {
4382 * HIViewSuspendLayout()
4383 *
4384 * Summary:
4385 * Suspends all layout handling for this layout and its children.
4386 *
4387 * Mac OS X threading:
4388 * Not thread safe
4389 *
4390 * Parameters:
4391 *
4392 * inView:
4393 * The HIView whose layout handling is to be suspended.
4394 *
4395 * Result:
4396 * An operating system status code.
4397 *
4398 * Availability:
4399 * Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
4400 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
4401 * Non-Carbon CFM: not available
4402 }
HIViewSuspendLayoutnull4403 function HIViewSuspendLayout( inView: HIViewRef ): OSStatus; external name '_HIViewSuspendLayout';
4404 (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
4405
4406
4407 {
4408 * HIViewResumeLayout()
4409 *
4410 * Summary:
4411 * Resumes all layout handling for this layout and its children.
4412 *
4413 * Mac OS X threading:
4414 * Not thread safe
4415 *
4416 * Parameters:
4417 *
4418 * inView:
4419 * The HIView whose layout handling is to be resumed.
4420 *
4421 * Result:
4422 * An operating system status code.
4423 *
4424 * Availability:
4425 * Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
4426 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
4427 * Non-Carbon CFM: not available
4428 }
HIViewResumeLayoutnull4429 function HIViewResumeLayout( inView: HIViewRef ): OSStatus; external name '_HIViewResumeLayout';
4430 (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
4431
4432
4433 {
4434 * HIViewIsLayoutActive()
4435 *
4436 * Summary:
4437 * Tests the view to determine if layout is active or suspended.
4438 * Note that this test does not determine whether or not the view
4439 * has a valid layout, only whether or not the layout engine is
4440 * active for the view.
4441 *
4442 * Discussion:
4443 * The view's layout active state is also affected by the layout
4444 * active state of its parents; if any parent view has inactive
4445 * layout, this view is considered to have inactive layout as well.
4446 * See HIViewIsLayoutLatentlyActive if latent layout active state is
4447 * required.
4448 *
4449 * Mac OS X threading:
4450 * Not thread safe
4451 *
4452 * Parameters:
4453 *
4454 * inView:
4455 * The HIView whose layout handling is to be tested.
4456 *
4457 * Result:
4458 * True if the view would respond to any linked relative's changes,
4459 * otherwise false.
4460 *
4461 * Availability:
4462 * Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
4463 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
4464 * Non-Carbon CFM: not available
4465 }
HIViewIsLayoutActivenull4466 function HIViewIsLayoutActive( inView: HIViewRef ): Boolean; external name '_HIViewIsLayoutActive';
4467 (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
4468
4469
4470 {
4471 * HIViewIsLayoutLatentlyActive()
4472 *
4473 * Summary:
4474 * The view's layout active state is also affected by the layout
4475 * active state of its parents; if any parent view has inactive
4476 * layout, this view is considered to have inactive layout as well.
4477 * HIViewIsLayoutLatentlyActive returns whether a view's layout is
4478 * latently active, even if one of its parent's layouts is not.
4479 *
4480 * Mac OS X threading:
4481 * Not thread safe
4482 *
4483 * Parameters:
4484 *
4485 * inView:
4486 * The HIView whose latent layout handling is to be tested.
4487 *
4488 * Result:
4489 * True if the view would latently respond to any linked relative's
4490 * changes, otherwise false.
4491 *
4492 * Availability:
4493 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
4494 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
4495 * Non-Carbon CFM: not available
4496 }
HIViewIsLayoutLatentlyActivenull4497 function HIViewIsLayoutLatentlyActive( inView: HIViewRef ): Boolean; external name '_HIViewIsLayoutLatentlyActive';
4498 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
4499
4500
4501 {
4502 * HIViewApplyLayout()
4503 *
4504 * Summary:
4505 * Applies the current layout into to the specified view. Side
4506 * bindings have no effect, but positioning and scaling will occur,
4507 * in that order.
4508 *
4509 * Mac OS X threading:
4510 * Not thread safe
4511 *
4512 * Parameters:
4513 *
4514 * inView:
4515 * The HIView whose layout info is to be applied.
4516 *
4517 * Result:
4518 * An operating system status code.
4519 *
4520 * Availability:
4521 * Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
4522 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
4523 * Non-Carbon CFM: not available
4524 }
HIViewApplyLayoutnull4525 function HIViewApplyLayout( inView: HIViewRef ): OSStatus; external name '_HIViewApplyLayout';
4526 (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
4527
4528
4529 {==============================================================================}
4530 { IMAGE CONTENT MANAGEMENT }
4531 {==============================================================================}
4532 {
4533 * HIViewSetImageContent()
4534 *
4535 * Summary:
4536 * Sets the content of a view to a particular image.
4537 *
4538 * Discussion:
4539 * This API attempts to set the view's image content using
4540 * SetControlData and the kControlContentTag constant.
4541 *
4542 * Mac OS X threading:
4543 * Not thread safe
4544 *
4545 * Parameters:
4546 *
4547 * inView:
4548 * The view whose image content to set.
4549 *
4550 * inPart:
4551 * The view part whose image content to set. For most views, you
4552 * should pass kHIViewEntireView. Some views, such as the
4553 * segmented view, allow you to pass a specific partcode here to
4554 * indicate a particular part of the view.
4555 *
4556 * inContent:
4557 * The image content to set. You may pass NULL to remove content
4558 * from the view.
4559 *
4560 * Availability:
4561 * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
4562 * CarbonLib: not available
4563 * Non-Carbon CFM: not available
4564 }
HIViewSetImageContentnull4565 function HIViewSetImageContent( inView: HIViewRef; inPart: HIViewPartCode; {const} inContent: HIViewContentInfoPtr { can be NULL } ): OSStatus; external name '_HIViewSetImageContent';
4566 (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
4567
4568
4569 {
4570 * HIViewCopyImageContentWithSize()
4571 *
4572 * Summary:
4573 * Retrieves the image content of a view.
4574 *
4575 * Discussion:
4576 * This API attempts to get the view's image content using
4577 * GetControlData and the kControlContentTag constant. If
4578 * successful, it calls HIViewRetainImageContent.
4579 *
4580 * Mac OS X threading:
4581 * Not thread safe
4582 *
4583 * Parameters:
4584 *
4585 * inView:
4586 * The view whose image content to retrieve.
4587 *
4588 * inPart:
4589 * The view part whose image content to retrieve. For most views,
4590 * you should pass kHIViewEntireView. Some views, such as the
4591 * segmented view, allow you to pass a specific partcode here to
4592 * indicate a particular part of the view.
4593 *
4594 * inContentSize:
4595 * The size in bytes of the HIViewContentInfo structure that you
4596 * are passing to the API. At most this many bytes will be written
4597 * to your HIViewContentInfo structure.
4598 *
4599 * outContent:
4600 * On exit, contains the view's image content. For image content
4601 * types that support a refcount, the content has been retained
4602 * before being returned; such content should be released by the
4603 * caller. For image content that does not support a refcount, the
4604 * actual content reference used by the view is returned; this
4605 * content should not be released. You may use
4606 * HIViewReleaseImageContent to release the content returned by
4607 * this API.
4608 *
4609 * Availability:
4610 * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
4611 * CarbonLib: not available
4612 * Non-Carbon CFM: not available
4613 }
HIViewCopyImageContentWithSizenull4614 function HIViewCopyImageContentWithSize( inView: HIViewRef; inPart: HIViewPartCode; inContentSize: ByteCount; var outContent: HIViewContentInfo ): OSStatus; external name '_HIViewCopyImageContentWithSize';
4615 (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
4616
4617
4618 {
4619 * HIViewRetainImageContent()
4620 *
4621 * Summary:
4622 * Retains refcountable content contained in an HIViewContentInfo
4623 * structure.
4624 *
4625 * Discussion:
4626 * For image content data types that are refcountable, the image
4627 * content retain count is incremented. Non-refcountable image
4628 * content is ignored.
4629 *
4630 * Mac OS X threading:
4631 * Not thread safe
4632 *
4633 * Parameters:
4634 *
4635 * inContent:
4636 * The image content to retain.
4637 *
4638 * Availability:
4639 * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
4640 * CarbonLib: not available
4641 * Non-Carbon CFM: not available
4642 }
4643 procedure HIViewRetainImageContent( const (*var*) inContent: HIViewContentInfo ); external name '_HIViewRetainImageContent';
4644 (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
4645
4646
4647 {
4648 * HIViewReleaseImageContent()
4649 *
4650 * Summary:
4651 * Releases refcountable content contained in an HIViewContentInfo
4652 * structure.
4653 *
4654 * Discussion:
4655 * For image content data types that are refcountable, the image
4656 * content retain count is decremented. Non-refcountable image
4657 * content is ignored; it is _not_ freed. You must explicitly free
4658 * non-refcountable image content yourself.
4659 *
4660 * Mac OS X threading:
4661 * Not thread safe
4662 *
4663 * Parameters:
4664 *
4665 * ioContent:
4666 * The image content to release. On exit, ioContent->contentType
4667 * is set to kHIViewContentNone.
4668 *
4669 * Availability:
4670 * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
4671 * CarbonLib: not available
4672 * Non-Carbon CFM: not available
4673 }
4674 procedure HIViewReleaseImageContent( var ioContent: HIViewContentInfo ); external name '_HIViewReleaseImageContent';
4675 (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
4676
4677
4678 {==============================================================================}
4679 { MISCELLANEOUS }
4680 {==============================================================================}
4681 {
4682 * HIViewGetWindow()
4683 *
4684 * Discussion:
4685 * Returns a reference to the window a given view is bound to. If
4686 * the view reference passed is invalid, or the view is not embedded
4687 * into any window, NULL is returned.
4688 *
4689 * Mac OS X threading:
4690 * Not thread safe
4691 *
4692 * Parameters:
4693 *
4694 * inView:
4695 * The view to query.
4696 *
4697 * Result:
4698 * A window reference.
4699 *
4700 * Availability:
4701 * Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
4702 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
4703 * Non-Carbon CFM: not available
4704 }
HIViewGetWindownull4705 function HIViewGetWindow( inView: HIViewRef ): WindowRef; external name '_HIViewGetWindow';
4706 (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
4707
4708
4709 {
4710 * HIViewFindByID()
4711 *
4712 * Discussion:
4713 * Allows you to find a particular view by its ID. The HIViewID type
4714 * used by this API is identical to the older ControlID type.
4715 *
4716 * Mac OS X threading:
4717 * Not thread safe
4718 *
4719 * Parameters:
4720 *
4721 * inStartView:
4722 * The view to start searching at.
4723 *
4724 * inID:
4725 * The ID of the view you are looking for.
4726 *
4727 * outView:
4728 * Receives the view if found.
4729 *
4730 * Result:
4731 * An operating system result code.
4732 *
4733 * Availability:
4734 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
4735 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
4736 * Non-Carbon CFM: not available
4737 }
HIViewFindByIDnull4738 function HIViewFindByID( inStartView: HIViewRef; inID: HIViewID; var outView: HIViewRef ): OSStatus; external name '_HIViewFindByID';
4739 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
4740
4741
4742 {
4743 * HIViewGetAttributes()
4744 *
4745 * Discussion:
4746 * Allows you to get the attributes of a view.
4747 *
4748 * Mac OS X threading:
4749 * Not thread safe
4750 *
4751 * Parameters:
4752 *
4753 * inView:
4754 * The view to inspect.
4755 *
4756 * outAttrs:
4757 * The attributes of the view.
4758 *
4759 * Result:
4760 * An operating system result code.
4761 *
4762 * Availability:
4763 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
4764 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
4765 * Non-Carbon CFM: not available
4766 }
HIViewGetAttributesnull4767 function HIViewGetAttributes( inView: HIViewRef; var outAttrs: OptionBits ): OSStatus; external name '_HIViewGetAttributes';
4768 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
4769
4770
4771 {
4772 * HIViewChangeAttributes()
4773 *
4774 * Discussion:
4775 * Allows you to change the attributes of a view. You can
4776 * simultaneously set and clear attributes.
4777 *
4778 * Mac OS X threading:
4779 * Not thread safe
4780 *
4781 * Parameters:
4782 *
4783 * inView:
4784 * The view to muck with.
4785 *
4786 * inAttrsToSet:
4787 * The attributes you wish to set.
4788 *
4789 * inAttrsToClear:
4790 * The attributes you wish to clear.
4791 *
4792 * Result:
4793 * An operating system result code.
4794 *
4795 * Availability:
4796 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
4797 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
4798 * Non-Carbon CFM: not available
4799 }
HIViewChangeAttributesnull4800 function HIViewChangeAttributes( inView: HIViewRef; inAttrsToSet: OptionBits; inAttrsToClear: OptionBits ): OSStatus; external name '_HIViewChangeAttributes';
4801 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
4802
4803
4804 {$endc} {not TARGET_CPU_64}
4805
4806
4807 {
4808 * Summary:
4809 * Option bits for use with HIViewCreateOffscreenImage.
4810 }
4811 const
4812 {
4813 * Requests that the offscreen image should use the resolution of the
4814 * window's backing store. If the window is using crisp HiDPI mode,
4815 * the image size will therefore be equal to the view bounds
4816 * multiplied by the result of HIWindowGetBackingScaleFactor on the
4817 * view's window. Available in Mac OS X 10.8 and later.
4818 }
4819 kHIViewOffscreenImageUseWindowBackingResolution = 1 shl 0;
4820
4821 {$ifc not TARGET_CPU_64}
4822 {
4823 * HIViewCreateOffscreenImage()
4824 *
4825 * Discussion:
4826 * Creates an CGImageRef for the view passed in. The view and any
4827 * children it has are rendered in the resultant image.
4828 *
4829 * Note that prior to Mac OS X 10.5, we do not recommend passing the
4830 * root view of a window (returned by HIViewGetRoot) to this API.
4831 * The API implementation in earlier versions of Mac OS X contained
4832 * a bug that would corrupt the root view state, such that
4833 * subsequent QuickDraw drawing in subviews of the root view would
4834 * not appear in the root view's containing window.
4835 *
4836 * Mac OS X threading:
4837 * Not thread safe
4838 *
4839 * Parameters:
4840 *
4841 * inView:
4842 * The view you wish to create an image of.
4843 *
4844 * inOptions:
4845 * Options. In Mac OS X 10.8 and later, you may pass
4846 * kHIViewOffscreenImageUseWindowBackingResolution. Otherwise this
4847 * parameter must be 0.
4848 *
4849 * outFrame:
4850 * The frame of the view within the resultant image. It is in the
4851 * coordinate system of the image, where 0,0 is the top left
4852 * corner of the image. This is so you can know exactly where the
4853 * view lives in the image when the view draws outside its bounds
4854 * for things such as shadows.
4855 *
4856 * outImage:
4857 * The image of the view, including anything that would be drawn
4858 * outside the view's frame.
4859 *
4860 * Result:
4861 * An operating system status code.
4862 *
4863 * Availability:
4864 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
4865 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
4866 * Non-Carbon CFM: not available
4867 }
HIViewCreateOffscreenImagenull4868 function HIViewCreateOffscreenImage( inView: HIViewRef; inOptions: OptionBits; outFrame: HIRectPtr { can be NULL }; var outImage: CGImageRef ): OSStatus; external name '_HIViewCreateOffscreenImage';
4869 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
4870
4871
4872 {
4873 * HIViewDrawCGImage()
4874 *
4875 * Discussion:
4876 * Draws an image in the right direction for an HIView. This is
4877 * functionally the same as CGContextDrawImage, but it flips the
4878 * context appropriately so that the image is drawn correctly.
4879 * Because HIViews have their origin at the top, left, you are
4880 * really drawing upside-down, so if you were to use the CG image
4881 * drawing, you'd see what I mean! This call attempts to insulate
4882 * you from that fact.
4883 *
4884 * Mac OS X threading:
4885 * Not thread safe
4886 *
4887 * Parameters:
4888 *
4889 * inContext:
4890 * The context to draw in.
4891 *
4892 * inBounds:
4893 * The bounds to draw the image into.
4894 *
4895 * inImage:
4896 * The image to draw.
4897 *
4898 * Result:
4899 * An operating system status code.
4900 *
4901 * Availability:
4902 * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
4903 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
4904 * Non-Carbon CFM: not available
4905 }
HIViewDrawCGImagenull4906 function HIViewDrawCGImage( inContext: CGContextRef; const (*var*) inBounds: HIRect; inImage: CGImageRef ): OSStatus; external name '_HIViewDrawCGImage';
4907 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
4908
4909
4910 {$endc} {not TARGET_CPU_64}
4911
4912
4913 {$ifc not TARGET_CPU_64}
4914 {
4915 * HIViewGetFeatures()
4916 *
4917 * Discussion:
4918 * Returns the features for the current view. This only returns
4919 * feature bits for the HIView space. Older Control Manager features
4920 * such as kControlSupportsDataAccess are not returned.
4921 *
4922 * Mac OS X threading:
4923 * Not thread safe
4924 *
4925 * Parameters:
4926 *
4927 * inView:
4928 * The view to query
4929 *
4930 * outFeatures:
4931 * On output, the features for the view.
4932 *
4933 * Result:
4934 * An operating system status code.
4935 *
4936 * Availability:
4937 * Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
4938 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
4939 * Non-Carbon CFM: not available
4940 }
HIViewGetFeaturesnull4941 function HIViewGetFeatures( inView: HIViewRef; var outFeatures: HIViewFeatures ): OSStatus; external name '_HIViewGetFeatures';
4942 (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
4943
4944
4945 {
4946 * HIViewChangeFeatures()
4947 *
4948 * Discussion:
4949 * Allows you to change a view's features on the fly. Typically,
4950 * this is up to the view itself to control. For example, it might
4951 * decide that under some situations it is opaque and in others it
4952 * is transparent. In general entities outside of the view itself
4953 * should not call this function. The only exception might be UI
4954 * building tools, where it would want to make sure a view always
4955 * responds to clicks, for example, so it could override mouse
4956 * tracking to drag items around.
4957 *
4958 * When implementing a custom HIView, it is common to use
4959 * HIViewChangeFeatures in the view's kEventHIObjectInitialize
4960 * function to set up the view's initial feature bits. If your view
4961 * needs to run on Mac OS X 10.2, however, where
4962 * HIViewChangeFeatures is not available, you can set the view's
4963 * initial feature bits by handling kEventControlInitialize and
4964 * returning the appropriate feature flags in the
4965 * kEventParamControlFeatures parameter. Note that in this case, you
4966 * can only return feature flag constants starting with "kControl"
4967 * from the Control Feature Bits enumeration in Controls.h; you
4968 * cannot return kHIViewFeature constants.
4969 *
4970 * Mac OS X threading:
4971 * Not thread safe
4972 *
4973 * Parameters:
4974 *
4975 * inView:
4976 * The view to change
4977 *
4978 * inFeaturesToSet:
4979 * The features to enable
4980 *
4981 * inFeaturesToClear:
4982 * The features to disable
4983 *
4984 * Result:
4985 * An operating system status code.
4986 *
4987 * Availability:
4988 * Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
4989 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
4990 * Non-Carbon CFM: not available
4991 }
HIViewChangeFeaturesnull4992 function HIViewChangeFeatures( inView: HIViewRef; inFeaturesToSet: HIViewFeatures; inFeaturesToClear: HIViewFeatures ): OSStatus; external name '_HIViewChangeFeatures';
4993 (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
4994
4995
4996 {$endc} {not TARGET_CPU_64}
4997
4998
4999 {
5000 * Summary:
5001 * Constants for use with the HICreateTransformedCGImage API.
5002 }
5003 const
5004 {
5005 * No visual transform should be applied.
5006 }
5007 kHITransformNone = $00;
5008
5009 {
5010 * The image should be transformed to use a disabled appearance. This
5011 * transform should not be combined with any other transform.
5012 }
5013 kHITransformDisabled = $01;
5014
5015 {
5016 * The image should be transformed to use a selected appearance. This
5017 * transform should not be combined with any other transform.
5018 }
5019 kHITransformSelected = $4000;
5020
5021 {$ifc not TARGET_CPU_64}
5022 {
5023 * HICreateTransformedCGImage()
5024 *
5025 * Summary:
5026 * Creates a new CGImage with a standard selected or disabled
5027 * appearance.
5028 *
5029 * Mac OS X threading:
5030 * Not thread safe
5031 *
5032 * Parameters:
5033 *
5034 * inImage:
5035 * The original image.
5036 *
5037 * inTransform:
5038 * The transform to apply to the image.
5039 *
5040 * outImage:
5041 * The new image. This image should be released by the caller.
5042 *
5043 * Availability:
5044 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
5045 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
5046 * Non-Carbon CFM: not available
5047 }
HICreateTransformedCGImagenull5048 function HICreateTransformedCGImage( inImage: CGImageRef; inTransform: OptionBits; var outImage: CGImageRef ): OSStatus; external name '_HICreateTransformedCGImage';
5049 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
5050
5051
5052 {
5053 * HIViewGetEventTarget()
5054 *
5055 * Discussion:
5056 * Returns the EventTargetRef for the specified view. Once you
5057 * obtain this reference, you can send events to the target and
5058 * install event handler on it.
5059 *
5060 * Mac OS X threading:
5061 * Not thread safe
5062 *
5063 * Parameters:
5064 *
5065 * inView:
5066 * The view to return the target for.
5067 *
5068 * Result:
5069 * An EventTargetRef.
5070 *
5071 * Availability:
5072 * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
5073 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
5074 * Non-Carbon CFM: not available
5075 }
HIViewGetEventTargetnull5076 function HIViewGetEventTarget( inView: HIViewRef ): EventTargetRef; external name '_HIViewGetEventTarget';
5077 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
5078
5079
5080 {
5081 * HIViewSetUpTextColor()
5082 *
5083 * Summary:
5084 * Applies the proper text color for the given view to the current
5085 * context.
5086 *
5087 * Discussion:
5088 * An embedding-savvy view which draws text must ensure that its
5089 * text color properly contrasts the background on which it draws.
5090 * This routine sends kEventControlApplyTextColor to each superview
5091 * in the view hierarchy to determine and apply the proper text
5092 * color to the given context until the event is handled. If no
5093 * superview handles the event, HIView chooses a text color which
5094 * contrasts any ThemeBrush which has been associated with the
5095 * owning window (see SetThemeWindowBackground).
5096 *
5097 * Mac OS X threading:
5098 * Not thread safe
5099 *
5100 * Parameters:
5101 *
5102 * inView:
5103 * The HIViewRef that wants to draw text.
5104 *
5105 * inContext:
5106 * The context into which drawing will take place.
5107 *
5108 * Result:
5109 * An OSStatus code indicating success or failure. The most likely
5110 * error is a controlHandleInvalidErr, resulting from a bad
5111 * HIViewRef. Any non-noErr result indicates that the color set up
5112 * failed, and that the caller should probably give up its attempt
5113 * to draw.
5114 *
5115 * Availability:
5116 * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
5117 * CarbonLib: not available
5118 * Non-Carbon CFM: not available
5119 }
HIViewSetUpTextColornull5120 function HIViewSetUpTextColor( inView: HIViewRef; inContext: CGContextRef ): OSStatus; external name '_HIViewSetUpTextColor';
5121 (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
5122
5123
5124 {$endc} {not TARGET_CPU_64}
5125
5126 {$endc} {TARGET_OS_MAC}
5127 {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
5128
5129 end.
5130 {$endc} {not MACOSALLINCLUDE}
5131