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
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
|
{
File: HIToolbox/HISegmentedView.h
Contains: API and type definitions related to HISegmentedView.
Version: HIToolbox-437~1
Copyright: © 2006-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
}
{ Pascal Translation Updated: Jonas Maebe, <jonas@freepascal.org>, 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 HISegmentedView;
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,HIGeometry,HIObject,HIView,CFBase,CGBase;
{$endc} {not MACOSALLINCLUDE}
{$ifc TARGET_OS_MAC}
{$ALIGN POWER}
{==============================================================================}
{ HISegmentedView }
{ HISegmentedView is a new view available in Mac OS X 10.3 and later. }
{ Examples of the segmented view are the Finder's icon/column/list view }
{ switcher, and the back/forward buttons in Open panels. }
{ The segmented view operates as a group of buttons, each of which can be }
{ configured with different behaviors and content. }
{ Accessibility Notes: Those of you who wish to customize the accessibility }
{ information provided for individual segments of the segmented view -- by }
{ handling various kEventClassAccessibility Carbon Events, by calling }
{ HIObjectSetAuxiliaryAccessibilityAttribute, etc. -- need to know how to }
{ interpret and/or build AXUIElementRefs that represent individual segments. }
{ The AXUIElement representing an individual segment will/must be constructed }
{ using the segmented view's HIViewRef and the UInt64 identifier of the }
{ one-based index of the segment the element refers to. As usual, a UInt64 }
{ identifier of zero represents the segmented view as a whole. You must }
{ neither interpret nor create segmented view elements whose identifiers are }
{ greater than the count of segments in the segmented view. }
{==============================================================================}
{ The HIObject class ID for the HISegmentedView class. }
{$ifc USE_CFSTR_CONSTANT_MACROS}
{$definec kHISegmentedViewClassID CFSTRP('com.apple.HISegmentedView')}
{$endc}
{ The HIViewKind for the HISegmentedView class. }
const
kHISegmentedViewKind = FourCharCode('sgmt');
{$ifc not TARGET_CPU_64}
{
* HISegmentedViewCreate()
*
* Summary:
* Creates a segmented view. This is the type of view you would use
* to implement the icon/column/list view switcher as seen in the
* Finder.
*
* After creating a segmented view, you need to set the number of
* segments via HISegmentedViewSetSegmentCount. Each segment can be
* configured independently using the other HISegmentedView APIs.
*
*
* Changing the number of segments and configuring each segment will
* change the appearance of the segmented view. After you configure
* the view, you may want to call HIViewGetOptimalBounds on the view
* and resize it so the content will fit optimally.
*
* The value of the whole segmented view corresponds to the index of
* the currently selected segment with the radio behavior. If you
* set the value of the whole segmented view to n via
* HIViewSetValue, every radio-behavior segment will have its value
* set to zero except for the segment at index n; if segment n also
* has the radio behavior, it will have its value set to one. When a
* radio-behavior segment is clicked, the value of the whole
* segmented view will be set to the segment's index.
*
* The segmented view works in both compositing and non-compositing
* modes.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inBounds:
* The bounds of the view to be created. Can be NULL, in which
* case the view is created with CGRectZero bounds.
*
* outRef:
* A valid pointer to an HIViewRef. On successful completion of
* this routine, the destination HIViewRef will be filled with the
* HIViewRef of the newly created view. The view is initially
* invisible.
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
* Non-Carbon CFM: not available
}
function HISegmentedViewCreate( {const} inBounds: HIRectPtr { can be NULL }; var outRef: HIViewRef ): OSStatus; external name '_HISegmentedViewCreate';
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{
* HISegmentedViewSetSegmentCount()
*
* Summary:
* Sets the number of segments for the segmented view. Any previous
* segments beyond the new count will have their content released.
* All new segments beyond the previous count be initialized with
* the most basic settings possible: momentary, no attributes, zero
* value, enabled, no command, no label, no content, and
* auto-calculated content width. You should configure any new
* segments to match your needs.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inSegmentedView:
* The segmented view for which the number of segments is to be
* set.
*
* inSegmentCount:
* A positive integer indicating how many segments the view is to
* have.
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
* Non-Carbon CFM: not available
}
function HISegmentedViewSetSegmentCount( inSegmentedView: HIViewRef; inSegmentCount: UInt32 ): OSStatus; external name '_HISegmentedViewSetSegmentCount';
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{
* HISegmentedViewGetSegmentCount()
*
* Summary:
* Gets the number of segments in the segmented view.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inSegmentedView:
* The segmented view for which the number of segments is to be
* retrieved.
*
* Result:
* A UInt32 indicating the number of segments in the segmented view.
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
* Non-Carbon CFM: not available
}
function HISegmentedViewGetSegmentCount( inSegmentedView: HIViewRef ): UInt32; external name '_HISegmentedViewGetSegmentCount';
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{$endc} {not TARGET_CPU_64}
{
* Summary:
* HISegmentBehavior constants
}
const
{
* Pops back up after being pressed, just like a push button.
}
kHISegmentBehaviorMomentary = 1;
{
* Stays pressed until another segment with the radio behavior is
* pressed. This makes the segment behave like a radio button. After
* this segment is clicked, the segmented view's value will be
* changed to this segment's one-based index.
}
kHISegmentBehaviorRadio = 2;
{
* Like a check box. When clicked, it toggles back and forth between
* checked and unchecked states. This behavior is not implemented in
* any version of Mac OS X, and this constant is deprecated.
}
kHISegmentBehaviorToggles = 3;
{
* After being pressed, this type of segment stays pressed until you
* programatically unpress it. This behavior is not implemented in
* any version of Mac OS X, and this constant is deprecated.
}
kHISegmentBehaviorSticky = 4;
type
HISegmentBehavior = UInt32;
{$ifc not TARGET_CPU_64}
{
* HISegmentedViewSetSegmentBehavior()
*
* Summary:
* Changes the behavior of an individual segment of a segmented
* view. By default, a segment has the kHISegmentBehaviorMomentary
* behavior.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inSegmentedView:
* The segmented view that owns the segment whose behavior you
* want to change.
*
* inSegmentIndexOneBased:
* The one-based index of the segment whose behavior you want to
* change. This must be a non-zero value that is no higher than
* the segmented view's current segment count.
*
* inBehavior:
* A HISegmentBehavior describing the behavior you wish the
* segment to have.
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
* Non-Carbon CFM: not available
}
function HISegmentedViewSetSegmentBehavior( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32; inBehavior: HISegmentBehavior ): OSStatus; external name '_HISegmentedViewSetSegmentBehavior';
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{
* HISegmentedViewGetSegmentBehavior()
*
* Summary:
* Returns the behavior of an individual segment of a segmented view.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inSegmentedView:
* The segmented view that owns the segment being queried.
*
* inSegmentIndexOneBased:
* The one-based index of the segment whose behavior you desire.
* This must be a non-zero value that is no higher than the
* segmented view's current segment count.
*
* Result:
* A HISegmentBehavior describing the behavior of the given segment.
* If you pass an illegal segment index, the result is undefined.
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
* Non-Carbon CFM: not available
}
function HISegmentedViewGetSegmentBehavior( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32 ): HISegmentBehavior; external name '_HISegmentedViewGetSegmentBehavior';
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{$endc} {not TARGET_CPU_64}
{
* Summary:
* HISegmentedView segment attributes
*
* Discussion:
* These attribute bits are for use with
* HISegmentedViewChangeSegmentAttributes and
* HISegmentedViewGetSegmentAttributes.
}
const
{
* Pass this to indicate no attributes at all.
}
kHISegmentNoAttributes = 0;
{
* If this attribute bit is set, the command that gets sent out when
* the segment is clicked will be directed at the user focus instead
* of up the segmented view's containment hierarchy.
}
kHISegmentSendCmdToUserFocus = 1 shl 0;
{$ifc not TARGET_CPU_64}
{
* HISegmentedViewChangeSegmentAttributes()
*
* Summary:
* Changes the attributes of an individual segment of a segmented
* view. By default, a segment has no attribute bits set.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inSegmentedView:
* The segmented view that owns the segment whose attributes you
* want to change.
*
* inSegmentIndexOneBased:
* The one-based index of the segment whose attributes you want to
* change. This must be a non-zero value that is no higher than
* the segmented view's current segment count.
*
* inAttributesToSet:
* The attribute bits you wish to set for the segment.
*
* inAttributesToClear:
* The attribute bits you wish to clear for the segment.
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
* Non-Carbon CFM: not available
}
function HISegmentedViewChangeSegmentAttributes( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32; inAttributesToSet: OptionBits; inAttributesToClear: OptionBits ): OSStatus; external name '_HISegmentedViewChangeSegmentAttributes';
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{
* HISegmentedViewGetSegmentAttributes()
*
* Summary:
* Returns the attributes of an individual segment of a segmented
* view.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inSegmentedView:
* The segmented view that owns the segment being queried.
*
* inSegmentIndexOneBased:
* The one-based index of the segment whose attributes you desire.
* This must be a non-zero value that is no higher than the
* segmented view's current segment count.
*
* Result:
* The attribute bits that are set/enabled for the given segment. If
* you pass an illegal segment index, the result is undefined.
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
* Non-Carbon CFM: not available
}
function HISegmentedViewGetSegmentAttributes( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32 ): OptionBits; external name '_HISegmentedViewGetSegmentAttributes';
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{
* HISegmentedViewSetSegmentValue()
*
* Summary:
* Changes the value of an individual segment of a segmented view.
* This is only meaningful for segments with the sticky, toggles, or
* radio behaviors. If you set the value of momentary segments to
* something other than zero, the behavior is undefined.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inSegmentedView:
* The segmented view that owns the segment whose value you want
* to change.
*
* inSegmentIndexOneBased:
* The one-based index of the segment whose value you want to
* change. This must be a non-zero value that is no higher than
* the segmented view's current segment count.
*
* inValue:
* The value you wish the segment to have. Zero means
* unpressed/unselected and one means pressed/selected. Other
* values will result in undefined behavior.
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
* Non-Carbon CFM: not available
}
function HISegmentedViewSetSegmentValue( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32; inValue: SInt32 ): OSStatus; external name '_HISegmentedViewSetSegmentValue';
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{
* HISegmentedViewGetSegmentValue()
*
* Summary:
* Determines the value of an individual segment of a segmented
* view. This is only meaningful for segments with the sticky,
* toggles, or radio behaviors. The value of a momentary segment is
* undefined.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inSegmentedView:
* The segmented view that owns the segment being queried.
*
* inSegmentIndexOneBased:
* The one-based index of the segment whose value you desire. This
* must be a non-zero value that is no higher than the segmented
* view's current segment count.
*
* Result:
* A SInt32 indicating the value of the given segment. If you pass
* an illegal segment index, the result is undefined.
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
* Non-Carbon CFM: not available
}
function HISegmentedViewGetSegmentValue( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32 ): SInt32; external name '_HISegmentedViewGetSegmentValue';
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{
* HISegmentedViewSetSegmentEnabled()
*
* Summary:
* Enables or disables an individual segment of a segmented view.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inSegmentedView:
* The segmented view that owns the segment to enable or disable.
*
* inSegmentIndexOneBased:
* The one-based index of the segment to disable or enable. This
* must be a non-zero value that is no higher than the segmented
* view's current segment count.
*
* inEnabled:
* A Boolean indicating whether the segment is to become enabled
* or disabled.
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
* Non-Carbon CFM: not available
}
function HISegmentedViewSetSegmentEnabled( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32; inEnabled: Boolean ): OSStatus; external name '_HISegmentedViewSetSegmentEnabled';
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{
* HISegmentedViewIsSegmentEnabled()
*
* Summary:
* Tests an individual segment of a segmented view to see if it is
* enabled or disabled.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inSegmentedView:
* The segmented view that owns the segment being queried.
*
* inSegmentIndexOneBased:
* The one-based index of the segment to test. This must be a
* non-zero value that is no higher than the segmented view's
* current segment count.
*
* Result:
* True if the segment is enabled or false if the segment is
* disabled. If you pass an illegal segment index, the result is
* undefined.
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
* Non-Carbon CFM: not available
}
function HISegmentedViewIsSegmentEnabled( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32 ): Boolean; external name '_HISegmentedViewIsSegmentEnabled';
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{
* HISegmentedViewSetSegmentCommand()
*
* Summary:
* Sets the command ID for the given segment. By default, the
* command is zero. If you set any non-zero command ID, the
* segmented view will send an HICommand whenever the segment is
* clicked. By default, the command is sent to the segmented view
* and up the containment hierarchy. You can request that the
* command start at the user focus instead by turning on the
* kHISegmentSendCmdToUserFocus attribute for the segment.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inSegmentedView:
* The segmented view that owns the segment whose command you wish
* to set.
*
* inSegmentIndexOneBased:
* The one-based index of the segment whose command you wish to
* set. This must be a non-zero value that is no higher than the
* segmented view's current segment count.
*
* inCommand:
* The command ID you wish to associate with the segment. A value
* of zero signifies "no command".
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
* Non-Carbon CFM: not available
}
function HISegmentedViewSetSegmentCommand( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32; inCommand: UInt32 ): OSStatus; external name '_HISegmentedViewSetSegmentCommand';
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{
* HISegmentedViewGetSegmentCommand()
*
* Summary:
* Gets the command ID associated with the given segment.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inSegmentedView:
* The segmented view that owns the segment being queried.
*
* inSegmentIndexOneBased:
* The one-based index of the segment to query. This must be a
* non-zero value that is no higher than the segmented view's
* current segment count.
*
* Result:
* Returns the command ID associated with the segment. If you pass
* an illegal segment index, the result is undefined.
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
* Non-Carbon CFM: not available
}
function HISegmentedViewGetSegmentCommand( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32 ): UInt32; external name '_HISegmentedViewGetSegmentCommand';
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{
* HISegmentedViewSetSegmentLabel()
*
* Summary:
* Sets the label string for the given segment. By default, a
* segment has no label string.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inSegmentedView:
* The segmented view that owns the segment whose label you wish
* to set.
*
* inSegmentIndexOneBased:
* The one-based index of the segment whose label you wish to set.
* This must be a non-zero value that is no higher than the
* segmented view's current segment count.
*
* inLabel:
* A CFStringRef with the text of the label. The segmented view
* will copy the string passed in. You may pass NULL or an empty
* CFStringRef if you wish to eliminate the label from the segment.
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
* Non-Carbon CFM: not available
}
function HISegmentedViewSetSegmentLabel( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32; inLabel: CFStringRef ): OSStatus; external name '_HISegmentedViewSetSegmentLabel';
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{
* HISegmentedViewCopySegmentLabel()
*
* Summary:
* Gets the label associated with the given segment.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inSegmentedView:
* The segmented view that owns the segment being queried.
*
* inSegmentIndexOneBased:
* The one-based index of the segment to query. This must be a
* non-zero value that is no higher than the segmented view's
* current segment count.
*
* outLabel:
* On exit, outLabel will be a copy of the label associated with
* the segment; you must release this string. If there is no label
* associated with the segment, outLabel will be set to NULL.
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
* Non-Carbon CFM: not available
}
function HISegmentedViewCopySegmentLabel( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32; var outLabel: CFStringRef ): OSStatus; external name '_HISegmentedViewCopySegmentLabel';
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{
* HISegmentedViewSetSegmentContentWidth()
*
* Summary:
* Sets whether you want the segment to automatically calculate its
* own width or whether you want to determine the segment's width
* manually. The content width is the horizontal area taken up by a
* segment's label and/or image.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inSegmentedView:
* The segmented view that owns the segment whose content width
* you wish to set.
*
* inSegmentIndexOneBased:
* The one-based index of the segment whose content width you wish
* to set. This must be a non-zero value that is no higher than
* the segmented view's current segment count.
*
* inAutoCalculateWidth:
* A Boolean indicating whether you want the segment to calculate
* its own width. If you pass true, the inWidth parameter is
* ignored.
*
* inWidth:
* If you passed false in inAutoCalculateWidth, this parameter
* specifies the width you want to manually associate with the
* segment. If you pass a negative width, the behavior is
* undefined.
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
* Non-Carbon CFM: not available
}
function HISegmentedViewSetSegmentContentWidth( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32; inAutoCalculateWidth: Boolean; inWidth: CGFloat ): OSStatus; external name '_HISegmentedViewSetSegmentContentWidth';
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{
* HISegmentedViewGetSegmentContentWidth()
*
* Summary:
* Gets the content width of the given segment. This also optionally
* passes back a Boolean indicating whether the width was
* automatically calculated. The content width is the horizontal
* area taken up by a segment's label and/or image.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inSegmentedView:
* The segmented view that owns the segment being queried.
*
* inSegmentIndexOneBased:
* The one-based index of the segment to query. This must be a
* non-zero value that is no higher than the segmented view's
* current segment count.
*
* outAutoCalculated:
* On exit, this is a Boolean indicating whether the width was
* automatically calculated. You may pass NULL if you don't need
* this information.
*
* Result:
* Returns the width of the content for the given segment. If you
* pass an illegal segment index, the result is undefined.
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
* Non-Carbon CFM: not available
}
function HISegmentedViewGetSegmentContentWidth( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32; outAutoCalculated: BooleanPtr ): CGFloat; external name '_HISegmentedViewGetSegmentContentWidth';
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{
* HISegmentedViewSetSegmentImage()
*
* Summary:
* Sets or clears the image associated with a given segment.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inSegmentedView:
* The segmented view that owns the segment whose image you wish
* to set.
*
* inSegmentIndexOneBased:
* The one-based index of the segment whose image you wish to set.
* This must be a non-zero value that is no higher than the
* segmented view's current segment count.
*
* inImage:
* An HIViewImageContentInfo structure with the image information
* for the given segment. Prior to Mac OS X 10.5, segments only
* support three types of image content: kHIViewContentNone (no
* image), kHIViewContentIconRef, and kHIViewContentCGImageRef.
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
* Non-Carbon CFM: not available
}
function HISegmentedViewSetSegmentImage( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32; const (*var*) inImage: HIViewImageContentInfo ): OSStatus; external name '_HISegmentedViewSetSegmentImage';
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{
* HISegmentedViewGetSegmentImageContentType()
*
* Summary:
* Gets the type of image content drawn by the given segment. You
* will need to call this before calling
* HISegmentedViewCopySegmentImage so you know what type of image
* content to request from the latter API.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inSegmentedView:
* The segmented view that owns the segment being queried.
*
* inSegmentIndexOneBased:
* The one-based index of the segment to query. This must be a
* non-zero value that is no higher than the segmented view's
* current segment count.
*
* Result:
* Returns the image content type of the image drawn by the given
* segment. If you pass an illegal segment index, the result is
* undefined.
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
* Non-Carbon CFM: not available
}
function HISegmentedViewGetSegmentImageContentType( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32 ): HIViewImageContentType; external name '_HISegmentedViewGetSegmentImageContentType';
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{
* HISegmentedViewCopySegmentImage()
*
* Summary:
* Gives you a copy of the image (if any) drawn by the given
* segment. You are responsible for releasing any image passed back
* by this function. You request the image by asking for a
* particular type of image. If the segment isn't using the
* requested type of image, an error will be returned. If you wish
* to know the actual type of image displayed by the segment, you
* can call HISegmentedViewGetSegmentImageContentType.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inSegmentedView:
* The segmented view that owns the segment being queried.
*
* inSegmentIndexOneBased:
* The one-based index of the segment to query. This must be a
* non-zero value that is no higher than the segmented view's
* current segment count.
*
* ioImage:
* On entry, you must fill out the contentType field of this
* structure with the type of image you desire. On exit, if that
* type of image is used by the segment, the appropriate field of
* the union will be filled in with a copy of the image. You are
* responsible for releasing the image.
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
* Non-Carbon CFM: not available
}
function HISegmentedViewCopySegmentImage( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32; var ioImage: HIViewImageContentInfo ): OSStatus; external name '_HISegmentedViewCopySegmentImage';
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{$endc} {not TARGET_CPU_64}
{$endc} {TARGET_OS_MAC}
{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
end.
{$endc} {not MACOSALLINCLUDE}
|