1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
|
{
File: HIToolbox/HIImageViews.h
Contains: API and type definitions related to views that display image content.
Version: HIToolbox-437~1
Copyright: © 1999-2008 by Apple Computer, Inc., all rights reserved.
Bugs?: For bug reports, consult the following page on
the World Wide Web:
http://www.freepascal.org/bugs.html
}
{ Initial Pascal Translation: Jonas Maebe, <jonas@freepascal.org>, October 2009 }
{ Pascal Translation Updated: Gorazd Krosl, <gorazd_1957@yahoo.ca>, October 2009 }
{
Modified for use with Free Pascal
Version 308
Please report any bugs to <gpc@microbizz.nl>
}
{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
{$mode macpas}
{$packenum 1}
{$macro on}
{$inline on}
{$calling mwpascal}
unit HIImageViews;
interface
{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
{$setc GAP_INTERFACES_VERSION := $0308}
{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
{$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
{$endc}
{$ifc defined CPUPOWERPC and defined CPUI386}
{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
{$endc}
{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
{$endc}
{$ifc not defined __ppc__ and defined CPUPOWERPC32}
{$setc __ppc__ := 1}
{$elsec}
{$setc __ppc__ := 0}
{$endc}
{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
{$setc __ppc64__ := 1}
{$elsec}
{$setc __ppc64__ := 0}
{$endc}
{$ifc not defined __i386__ and defined CPUI386}
{$setc __i386__ := 1}
{$elsec}
{$setc __i386__ := 0}
{$endc}
{$ifc not defined __x86_64__ and defined CPUX86_64}
{$setc __x86_64__ := 1}
{$elsec}
{$setc __x86_64__ := 0}
{$endc}
{$ifc not defined __arm__ and defined CPUARM}
{$setc __arm__ := 1}
{$elsec}
{$setc __arm__ := 0}
{$endc}
{$ifc defined cpu64}
{$setc __LP64__ := 1}
{$elsec}
{$setc __LP64__ := 0}
{$endc}
{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
{$error Conflicting definitions for __ppc__ and __i386__}
{$endc}
{$ifc defined __ppc__ and __ppc__}
{$setc TARGET_CPU_PPC := TRUE}
{$setc TARGET_CPU_PPC64 := FALSE}
{$setc TARGET_CPU_X86 := FALSE}
{$setc TARGET_CPU_X86_64 := FALSE}
{$setc TARGET_CPU_ARM := FALSE}
{$setc TARGET_OS_MAC := TRUE}
{$setc TARGET_OS_IPHONE := FALSE}
{$setc TARGET_IPHONE_SIMULATOR := FALSE}
{$elifc defined __ppc64__ and __ppc64__}
{$setc TARGET_CPU_PPC := FALSE}
{$setc TARGET_CPU_PPC64 := TRUE}
{$setc TARGET_CPU_X86 := FALSE}
{$setc TARGET_CPU_X86_64 := FALSE}
{$setc TARGET_CPU_ARM := FALSE}
{$setc TARGET_OS_MAC := TRUE}
{$setc TARGET_OS_IPHONE := FALSE}
{$setc TARGET_IPHONE_SIMULATOR := FALSE}
{$elifc defined __i386__ and __i386__}
{$setc TARGET_CPU_PPC := FALSE}
{$setc TARGET_CPU_PPC64 := FALSE}
{$setc TARGET_CPU_X86 := TRUE}
{$setc TARGET_CPU_X86_64 := FALSE}
{$setc TARGET_CPU_ARM := FALSE}
{$ifc defined(iphonesim)}
{$setc TARGET_OS_MAC := FALSE}
{$setc TARGET_OS_IPHONE := TRUE}
{$setc TARGET_IPHONE_SIMULATOR := TRUE}
{$elsec}
{$setc TARGET_OS_MAC := TRUE}
{$setc TARGET_OS_IPHONE := FALSE}
{$setc TARGET_IPHONE_SIMULATOR := FALSE}
{$endc}
{$elifc defined __x86_64__ and __x86_64__}
{$setc TARGET_CPU_PPC := FALSE}
{$setc TARGET_CPU_PPC64 := FALSE}
{$setc TARGET_CPU_X86 := FALSE}
{$setc TARGET_CPU_X86_64 := TRUE}
{$setc TARGET_CPU_ARM := FALSE}
{$setc TARGET_OS_MAC := TRUE}
{$setc TARGET_OS_IPHONE := FALSE}
{$setc TARGET_IPHONE_SIMULATOR := FALSE}
{$elifc defined __arm__ and __arm__}
{$setc TARGET_CPU_PPC := FALSE}
{$setc TARGET_CPU_PPC64 := FALSE}
{$setc TARGET_CPU_X86 := FALSE}
{$setc TARGET_CPU_X86_64 := FALSE}
{$setc TARGET_CPU_ARM := TRUE}
{ will require compiler define when/if other Apple devices with ARM cpus ship }
{$setc TARGET_OS_MAC := FALSE}
{$setc TARGET_OS_IPHONE := TRUE}
{$setc TARGET_IPHONE_SIMULATOR := FALSE}
{$elsec}
{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
{$endc}
{$ifc defined __LP64__ and __LP64__ }
{$setc TARGET_CPU_64 := TRUE}
{$elsec}
{$setc TARGET_CPU_64 := FALSE}
{$endc}
{$ifc defined FPC_BIG_ENDIAN}
{$setc TARGET_RT_BIG_ENDIAN := TRUE}
{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
{$elifc defined FPC_LITTLE_ENDIAN}
{$setc TARGET_RT_BIG_ENDIAN := FALSE}
{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
{$elsec}
{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
{$endc}
{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
{$setc CALL_NOT_IN_CARBON := FALSE}
{$setc OLDROUTINENAMES := FALSE}
{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
{$setc OPAQUE_UPP_TYPES := TRUE}
{$setc OTCARBONAPPLICATION := TRUE}
{$setc OTKERNEL := FALSE}
{$setc PM_USE_SESSION_APIS := TRUE}
{$setc TARGET_API_MAC_CARBON := TRUE}
{$setc TARGET_API_MAC_OS8 := FALSE}
{$setc TARGET_API_MAC_OSX := TRUE}
{$setc TARGET_CARBON := TRUE}
{$setc TARGET_CPU_68K := FALSE}
{$setc TARGET_CPU_MIPS := FALSE}
{$setc TARGET_CPU_SPARC := FALSE}
{$setc TARGET_OS_UNIX := FALSE}
{$setc TARGET_OS_WIN32 := FALSE}
{$setc TARGET_RT_MAC_68881 := FALSE}
{$setc TARGET_RT_MAC_CFM := FALSE}
{$setc TARGET_RT_MAC_MACHO := TRUE}
{$setc TYPED_FUNCTION_POINTERS := TRUE}
{$setc TYPE_BOOL := FALSE}
{$setc TYPE_EXTENDED := FALSE}
{$setc TYPE_LONGLONG := TRUE}
uses MacTypes,HIView,Controls,IconsCore,Icons,QuickdrawTypes,CGBase,CGImage,HIObject;
{$endc} {not MACOSALLINCLUDE}
{$ifc TARGET_OS_MAC}
{$ALIGN POWER}
{==============================================================================}
{ HIImageView }
{ The image view is a new view starting in Mac OS 10.2. It can only be used }
{ in a compositing window. Like all new HIFoo views, this view is initially }
{ invisible. You must show the view after creation. }
{==============================================================================}
{ The HIObject class ID for the HIImageView class. }
{$ifc USE_CFSTR_CONSTANT_MACROS}
{$definec kHIImageViewClassID CFSTRP('com.apple.HIImageView')}
{$endc}
const
{
* The control kind of the image view
}
kControlKindHIImageView = FourCharCode('imag');
{$ifc not TARGET_CPU_64}
{
* HIImageViewCreate()
*
* Discussion:
* Creates an image view. The view responds to the scrollable
* interface and can be used in a scrolling view. You can pass an
* image initially, or set one later.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inImage:
* An initial image, or NULL. You can set the image later via
* SetControlData.
*
* outView:
* The new image view.
*
* Result:
* An operating system result code.
*
* Availability:
* Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
* Non-Carbon CFM: not available
}
function HIImageViewCreate( inImage: CGImageRef { can be NULL }; var outView: HIViewRef ): OSStatus; external name '_HIImageViewCreate';
(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
{
* HIImageViewSetOpaque()
*
* Discussion:
* Allows you to set whether an image view should be treated as
* opaque. If this is set to true, the image view can make certain
* optimizations for compositing and scrolling. The alpha-related
* image view APIs are rendered useless if opacity it set to true.
* An image view, when created, is transparent by default.
*
* NOTE: In Mac OS X 10.2, this view was documented as being opaque
* by default, but the implementation did not enforce that. So in
* Mac OS X 10.3 and beyond, the view is transparent by default, and
* you can make it opaque by calling HIImageViewSetOpaque.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inView:
* The image view to affect.
*
* inOpaque:
* The new opacity setting. Pass true to indicate you want the
* image to be treated as opaque.
*
* Result:
* An operating system result code.
*
* Availability:
* Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
* Non-Carbon CFM: not available
}
function HIImageViewSetOpaque( inView: HIViewRef; inOpaque: Boolean ): OSStatus; external name '_HIImageViewSetOpaque';
(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
{
* HIImageViewIsOpaque()
*
* Discussion:
* Allows you to determine whether an image view is opaque or not.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inView:
* The image view to query.
*
* Result:
* A boolean result, where true indicates the image view is opaque.
*
* Availability:
* Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
* Non-Carbon CFM: not available
}
function HIImageViewIsOpaque( inView: HIViewRef ): Boolean; external name '_HIImageViewIsOpaque';
(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
{
* HIImageViewSetAlpha()
*
* Discussion:
* Allows you to set the alpha for an image, making it more or less
* transparent. An alpha of 1.0 is fully opaque, and 0.0 is fully
* transparent. The default alpha for an image is 1.0.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inView:
* The image view to affect.
*
* inAlpha:
* The new alpha value.
*
* Result:
* An operating system result code.
*
* Availability:
* Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
* Non-Carbon CFM: not available
}
function HIImageViewSetAlpha( inView: HIViewRef; inAlpha: CGFloat ): OSStatus; external name '_HIImageViewSetAlpha';
(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
{
* HIImageViewGetAlpha()
*
* Discussion:
* Allows you to get the alpha for an image. An alpha of 1.0 is
* fully opaque, and 0.0 is fully transparent.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inView:
* The image view to query.
*
* Result:
* A floating point number representing the alpha from 0.0 through
* 1.0.
*
* Availability:
* Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
* Non-Carbon CFM: not available
}
function HIImageViewGetAlpha( inView: HIViewRef ): CGFloat; external name '_HIImageViewGetAlpha';
(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
{
* HIImageViewSetScaleToFit()
*
* Discussion:
* Normally an image view will clip to the view's bounds. Using this
* API, you can instead tell the image view to size the image to fit
* into the view bounds specified.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inView:
* The image view to affect.
*
* inScaleToFit:
* A boolean indicating whether the image should be scaled to fit
* the view bounds (true) or merely clip to the view bounds
* (false).
*
* Result:
* An operating system status code.
*
* Availability:
* Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
* Non-Carbon CFM: not available
}
function HIImageViewSetScaleToFit( inView: HIViewRef; inScaleToFit: Boolean ): OSStatus; external name '_HIImageViewSetScaleToFit';
(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
{
* HIImageViewGetScaleToFit()
*
* Discussion:
* Returns whether or not an image view will scale the image it
* displays to the view bounds or merely clip to the view bounds. A
* true result means it scales.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inView:
* The image view to query.
*
* Result:
* A boolean result.
*
* Availability:
* Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
* Non-Carbon CFM: not available
}
function HIImageViewGetScaleToFit( inView: HIViewRef ): Boolean; external name '_HIImageViewGetScaleToFit';
(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
{
* HIImageViewSetImage()
*
* Discussion:
* Sets the image to display in an image view. The image passed in
* is retained by the view, so you may release the image after
* calling this API if you no longer need to reference it.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inView:
* The image view to affect.
*
* inImage:
* The image to set.
*
* Result:
* An operating system status code.
*
* Availability:
* Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
* Non-Carbon CFM: not available
}
function HIImageViewSetImage( inView: HIViewRef; inImage: CGImageRef { can be NULL } ): OSStatus; external name '_HIImageViewSetImage';
(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
{
* HIImageViewCopyImage()
*
* Discussion:
* Gets the image for an image view. If there is no image set on the
* view, or the view ref is invalid, NULL is returned. The image is
* retained, so you should take care to release it when you are
* finished with it.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inView:
* The image view to query.
*
* Result:
* A CoreGraphics (Quartz) image ref.
*
* Availability:
* Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
* Non-Carbon CFM: not available
}
function HIImageViewCopyImage( inView: HIViewRef ): CGImageRef; external name '_HIImageViewCopyImage';
(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
{$endc} {not TARGET_CPU_64}
{
* HIImageViewAutoTransformOptions
*
* Summary:
* These are the available options for applying automatic transforms
* on image views and can be accessed with the
* HIImageViewSetAutoTransform and HIImageViewGetAutoTransform APIs.
*
* Discussion:
* Currently, the auto transforms for disabled or inactive image
* views is similar to the transform applied to the image of an
* image well or the image in a bevel button when those controls are
* disabled or inactive.
}
type
HIImageViewAutoTransformOptions = UInt32;
const
{
* No transform is applied to the image.
}
kHIImageViewAutoTransformNone = 0;
{
* Transforms are applied to the image view's image when the view is
* disabled.
}
kHIImageViewAutoTransformOnDisable = 1 shl 0;
{
* Transforms are applied to the image view's image when the view is
* deactivated.
}
kHIImageViewAutoTransformOnDeactivate = 1 shl 1;
{$ifc not TARGET_CPU_64}
{
* HIImageViewSetAutoTransform()
*
* Discussion:
* Sets how an image view will automatically transform its image.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inView:
* The image view for which to set the auto transform options.
*
* inOptions:
* A set of HIImageViewAutoTransformOptions bits.
*
* Result:
* An operating system status code.
*
* Availability:
* Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
* CarbonLib: not available
* Non-Carbon CFM: not available
}
function HIImageViewSetAutoTransform( inView: HIViewRef; inOptions: HIImageViewAutoTransformOptions ): OSStatus; external name '_HIImageViewSetAutoTransform';
(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
{
* HIImageViewGetAutoTransform()
*
* Discussion:
* Gets how an image view is set to automatically transform its
* image.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inView:
* The image view to query.
*
* Result:
* A value of HIImageViewAutoTransformOptions bits. The return value
* is undefined if the HIViewRef is invalid.
*
* Availability:
* Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
* CarbonLib: not available
* Non-Carbon CFM: not available
}
function HIImageViewGetAutoTransform( inView: HIViewRef ): HIImageViewAutoTransformOptions; external name '_HIImageViewGetAutoTransform';
(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
{$endc} {not TARGET_CPU_64}
const
{
* This tag is used with GetControlData and SetControlData to get or
* set the CGImageRef associated with an HIImageView. This constant
* is deprecated; use the HIImageViewCopyImage and
* HIImageViewSetImage APIs to get or set the image for an image view.
}
kHIImageViewImageTag = FourCharCode('imag');
{ΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡ}
{ ₯ ICON CONTROL (CDEF 20) }
{ΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡ}
{ Value parameter should contain the ID of the ICON or cicn you wish to display when }
{ creating controls of this type. If you don't want the control tracked at all, use }
{ the 'no track' variant. }
{ Icon control proc IDs }
const
kControlIconProc = 320;
kControlIconNoTrackProc = 321; { immediately returns kControlIconPart}
kControlIconSuiteProc = 322;
kControlIconSuiteNoTrackProc = 323; { immediately returns kControlIconPart}
const
{ icon ref controls may have either an icon, color icon, icon suite, or icon ref.}
{ for data other than icon, you must set the data by passing a}
{ ControlButtonContentInfo to SetControlData}
kControlIconRefProc = 324;
kControlIconRefNoTrackProc = 325; { immediately returns kControlIconPart}
{ Control Kind Tag }
const
kControlKindIcon = FourCharCode('icon');
{ The HIObject class ID for the HIIconView class. }
{$ifc USE_CFSTR_CONSTANT_MACROS}
{$definec kHIIconViewClassID CFSTRP('com.apple.HIIconView')}
{$endc}
{$ifc not TARGET_CPU_64}
{
* CreateIconControl()
*
* Summary:
* Creates an Icon control at a specific position in the specified
* window.
*
* Discussion:
* Icon controls display an icon that (optionally) hilites when
* clicked on. On Mac OS X, a root control will be created for the
* window if one does not already exist. If a root control exists
* for the window, the Icon control will be embedded into it.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inWindow:
* The WindowRef into which the Icon control will be created. May
* be NULL on 10.3 and later.
*
* inBoundsRect:
* The desired position (in coordinates local to the window's
* port) for the Icon control.
*
* inIconContent:
* The descriptor for the icon you want the control to display.
* Mac OS X and CarbonLib 1.5 (and beyond) support all of the icon
* content types. Prior to CarbonLib 1.5, the only content types
* that are properly respected are kControlContentIconSuiteRes,
* kControlContentCIconRes, and kControlContentICONRes.
*
* inDontTrack:
* A Boolean value indicating whether the control should hilite
* when it is clicked on. False means hilite and track the mouse.
*
* outControl:
* On successful output, outControl will contain a reference to
* the Icon control.
*
* Result:
* An OSStatus code indicating success or failure.
*
* Availability:
* Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
* CarbonLib: in CarbonLib 1.1 and later
* Non-Carbon CFM: not available
}
function CreateIconControl( inWindow: WindowRef { can be NULL }; const (*var*) inBoundsRect: Rect; const (*var*) inIconContent: ControlButtonContentInfo; inDontTrack: Boolean; var outControl: ControlRef ): OSStatus; external name '_CreateIconControl';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{ Tagged data supported by icon controls }
{$endc} {not TARGET_CPU_64}
const
kControlIconTransformTag = FourCharCode('trfm'); { IconTransformType}
kControlIconAlignmentTag = FourCharCode('algn'); { IconAlignmentType}
{ Tags available with appearance 1.1 or later }
const
kControlIconResourceIDTag = FourCharCode('ires'); { SInt16 resource ID of icon to use}
kControlIconContentTag = kControlContentTag; { ControlImageContentInfo}
{ΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡ}
{ ₯ IMAGE WELL (CDEF 11) }
{ΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡ}
{ Image Wells allow you to control the content type (pict/icon/etc.) shown in the }
{ well. }
{ This is made possible by overloading the Min and Value parameters for the control. }
{ Parameter What Goes Here }
{ ΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡ ΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡ }
{ Min content type (see constants for bevel buttons) }
{ Value Resource ID of content type, if resource-based. }
{ Handle-based Content }
{ ΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡ }
{ You can create your control and then set the content to an existing handle to an }
{ icon suite, etc. using the macros below. Please keep in mind that resource-based }
{ content is owned by the control, handle-based content is owned by you. The CDEF will}
{ not try to dispose of handle-based content. If you are changing the content type of }
{ the button on the fly, you must make sure that if you are replacing a handle- }
{ based content with a resource-based content to properly dispose of the handle, }
{ else a memory leak will ensue. }
{ Image Well proc IDs }
const
kControlImageWellProc = 176;
{ Control Kind Tag }
const
kControlKindImageWell = FourCharCode('well');
{ The HIObject class ID for the HIImageWell class. }
{$ifc USE_CFSTR_CONSTANT_MACROS}
{$definec kHIImageWellClassID CFSTRP('com.apple.HIImageWell')}
{$endc}
{ Creation API: Carbon only }
{$ifc not TARGET_CPU_64}
{
* CreateImageWellControl()
*
* Mac OS X threading:
* Not thread safe
*
* Availability:
* Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
* CarbonLib: in CarbonLib 1.1 and later
* Non-Carbon CFM: not available
}
function CreateImageWellControl( window: WindowRef; const (*var*) boundsRect: Rect; const (*var*) info: ControlButtonContentInfo; var outControl: ControlRef ): OSStatus; external name '_CreateImageWellControl';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{ Tagged data supported by image wells }
{$endc} {not TARGET_CPU_64}
const
kControlImageWellContentTag = kControlContentTag; { ControlImageContentInfo}
kControlImageWellTransformTag = FourCharCode('tran'); { IconTransformType}
kControlImageWellIsDragDestinationTag = FourCharCode('drag'); { Boolean}
{ Helper routines are available only thru the shared library/glue. }
{$ifc not TARGET_CPU_64}
{
* GetImageWellContentInfo()
*
* Mac OS X threading:
* Not thread safe
*
* Availability:
* Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in AppearanceLib 1.0 and later
}
function GetImageWellContentInfo( inButton: ControlRef; outContent: ControlButtonContentInfoPtr ): OSErr; external name '_GetImageWellContentInfo';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* SetImageWellContentInfo()
*
* Mac OS X threading:
* Not thread safe
*
* Availability:
* Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in AppearanceLib 1.0 and later
}
function SetImageWellContentInfo( inButton: ControlRef; inContent: ControlButtonContentInfoPtr ): OSErr; external name '_SetImageWellContentInfo';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* SetImageWellTransform()
*
* Mac OS X threading:
* Not thread safe
*
* Availability:
* Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in AppearanceLib 1.0 and later
}
function SetImageWellTransform( inButton: ControlRef; inTransform: IconTransformType ): OSErr; external name '_SetImageWellTransform';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{$endc} {not TARGET_CPU_64}
{$endc} {TARGET_OS_MAC}
{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
end.
{$endc} {not MACOSALLINCLUDE}
|