Sign in Join
Wiki copytemporary

Carbon interface internals/de: what changed

Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
1-[![macOSlogo.png](/wiki-images/1/15/macOSlogo.png)](</File:macOSlogo.png>)
2-
3-Dieser Artikel behandelt ausschließlich [macOS](</Category:macOS> "Category:macOS").
4-
5-Siehe auch: [[Multiplatform Programming Guide/de]]
6-
7-[![Apple iOS new.svg](https://upload.wikimedia.org/wikipedia/commons/thumb/4/48/Apple_iOS_new.svg/50px-Apple_iOS_new.svg.png)](</File:Apple_iOS_new.svg>)
8-
9-Dieser Artikel behandelt ausschließlich [iOS](</Category:iOS> "Category:iOS").
10-
11-Siehe auch: [[Multiplatform Programming Guide/de]]
12-
13-
14-****
15-
16-## Contents
17-
18- * 1 Einleitung
19- * 2 Andere Schnittstellen
20- * 2.1 Artikel über die Entwicklung von Schnittstellen
21- * 3 Dokumentation über Carbon
22- * 4 Carbon Schnittstelle Entwicklungs-Grundlagen
23- * 5 Was funktioniert bereits ?
24- * 6 Was muss als nächstes getan werden ?
25- * 7 Carbon IDE Bugs
26- * 8 Implementation Details
27- * 8.1 Keyboard
28- * 8.2 Application
29- * 8.3 Drawing and measuring text precisely in parts
30- * 8.4 Screenshot taking
31- * 9 Kompatibilitätsprobleme
32- * 9.1 Mouse.CursorPos changing does not generate mouse (move) events
33- * 9.2 Release mouse capture is not supported
34- * 9.3 Kommandozeilenparameter
35- * 9.4 Shortcuts indication is not supported
36- * 9.5 Drawing on Canvas outside OnPaint event is not supported
37- * 9.6 Drawing on screen device context is not supported
38- * 9.7 TCustomControl.Color of clBtnFace makes its background transparent
39- * 9.8 TWinControl.Font fsStrikeOut wird nicht unterstützt
40- * 9.9 TForm
41- * 9.10 TEdit.PasswordChar different then default is not supported
42- * 9.11 TMemo.WordWrap when is disabled, does not allow to scroll text horizontally
43- * 9.12 TListBox.Columns wird nicht unterstützt
44- * 9.13 TComboBox
45- * 9.14 TPanel.Bevelxxx: bvLowered und bvSpace werden nicht unterstützt
46- * 9.15 TBitBtn.Spacing is not supported
47- * 9.16 TTrackBar
48- * 9.17 TProgressBar
49- * 9.18 TColorDialog.Title is not supported
50- * 10 Wie man ein neues Bedienelement hinzufügt
51-
521## Einleitung
532
54-Diese Seite bietet einen Überblick über die LCL Carbon Schnittstelle für macOS und soll neuen Entwicklern helfen.
3+Diese Seite bietet einen Überblick über die LCL Carbon Schnittstelle für macOS und soll neuen Entwicklern helfen.
554
56-Für die Installation und Erzeugung einer ersten Carbon Anwendung lesen sie zunächst [[Carbon Interface/de|Carbon Interface]].
5+Für die Installation und Erzeugung einer ersten Carbon Anwendung lesen sie zunächst [[Carbon Interface/de|Carbon Interface]].
576
587## Andere Schnittstellen
598
60- * [[Lazarus known issues \(things that will never be fixed\|Lazarus known issues (things that will never be fixed)]]> "Lazarus known issues \(things that will never be fixed\)") \- Eine Liste mit Kompatibilitätsproblemen der Schnittstellen
61- * [[Win32/64 Interface]] \- Die winapi Schnittstelle für Windows 95/98/Me/2K/XP/Vista, aber nicht CE
62- * [[GTK2 Interface]] \- Die gtk2 Schnittstelle für Unixes, macOS, Windows
63- * [[Carbon Interface]] \- Die Carbon Schnittstelle für macOS
64- * [[Qt Interface]] \- Die Qt 4 Schnittstelle für Unixes, macOS und linux-basierte PDAs
65- * [[Windows CE Interface]] \- Für Pocket PC und Smartphones
66- * [[fpGUI Interface]] \- Ein Widgetset komplett in Object Pascal geschrieben
9+- [[Lazarus known issues (things that will never be fixed)]] - Eine Liste mit Kompatibilitätsproblemen der Schnittstellen
10+- [[Win32/64 Interface]] - Die winapi Schnittstelle für Windows 95/98/Me/2K/XP/Vista, aber nicht CE
11+- [[GTK2 Interface]] - Die gtk2 Schnittstelle für Unixes, macOS, Windows
12+- [[Carbon Interface]] - Die Carbon Schnittstelle für macOS
13+- [[Qt Interface]] - Die Qt 4 Schnittstelle für Unixes, macOS und linux-basierte PDAs
14+- [[Windows CE Interface]] - Für Pocket PC und Smartphones
15+- [[fpGUI Interface]] - Ein Widgetset komplett in Object Pascal geschrieben
6716
6817### Artikel über die Entwicklung von Schnittstellen
6918
70- * [[Carbon interface internals]] \- Wenn du helfen willst, die Carbon Schnittstelle zu verbessern
71- * [[Windows CE Development Notes]] \- Für Pocket PC und Smartphones
72- * [[Adding a new interface]] \- Wie man eine neue Widgetset-Schnittstelle entwickelt
19+- [[Carbon interface internals]] - Wenn du helfen willst, die Carbon Schnittstelle zu verbessern
20+- [[Windows CE Development Notes]] - Für Pocket PC und Smartphones
21+- [[Adding a new interface]] - Wie man eine neue Widgetset-Schnittstelle entwickelt
7322
7423## Dokumentation über Carbon
7524
76- * [Apple Carbon docs](<http://developer.apple.com/documentation/Carbon>)
25+- [Apple Carbon docs](http://developer.apple.com/documentation/Carbon)
7726
78- * [Apple Mailing List search](<http://search.lists.apple.com>)
27+- [Apple Mailing List search](http://search.lists.apple.com)
7928
80- * [Carbon Buch zum Download](<http://www.mactech.com/macintosh-c/downloads.html>)
29+- [Carbon Buch zum Download](http://www.mactech.com/macintosh-c/downloads.html)
8130
82- * [Carbon Dev](<http://www.carbondev.com/site/>)
31+- [Carbon Dev](http://www.carbondev.com/site/)
8332
84- * ["Learning Carbon" sample book chapter](<http://www.oreilly.com/catalog/learncarbon>)
33+- ["Learning Carbon" sample book chapter](http://www.oreilly.com/catalog/learncarbon)
8534
86-Die Carbon API unit von FreePascal ist FPCMacOSAll.pas in /usr/local/share/fpcsrc/packages/extra/univint.
35+Die Carbon API unit von FreePascal ist FPCMacOSAll.pas in /usr/local/share/fpcsrc/packages/extra/univint.
8736
8837## Carbon Schnittstelle Entwicklungs-Grundlagen
8938
90- * Die macOS Zielversion ist 10.4
91- * Vermeiden sie die Verwendung von veralteten oder ausgemusterten APIs und Funktionen (z.B. QuickDraw vs. _Quartz 2D_)
92- * Verwenden sie den Objektansatz
93- * Prüfen sie die Ergebnisse von Carbon Aufrufen mit der OSError Funktion
94- * erwenden Sie UTF-8 kodierte Zeichenketten zwischen LCL und dem Carbon widgetset (für zukünftige Lazarus Unicode Unterstützung)
39+- Die macOS Zielversion ist 10.4
40+- Vermeiden sie die Verwendung von veralteten oder ausgemusterten APIs und Funktionen (z.B. QuickDraw vs. *Quartz 2D*)
41+- Verwenden sie den Objektansatz
42+- Prüfen sie die Ergebnisse von Carbon Aufrufen mit der OSError Funktion
43+- erwenden Sie UTF-8 kodierte Zeichenketten zwischen LCL und dem Carbon widgetset (für zukünftige Lazarus Unicode Unterstützung)
9544
9645## Was funktioniert bereits ?
9746
98- * Features - siehe [[Roadmap|Roadmap#Status_of_features_on_each_widgetset]]
99- * Formulare und Bedienelemente - siehe [[Roadmap|Roadmap Widgetset dependent components]]
100- * Erstellen von TOpenGLControl mit AGL Kontext (siehe components/opengl/)
101- * Maus Ereignisse
102- * Tastatur Ereignisse (VK_ mapping für fremde Tastaturen muss noch getestet werden)
47+- Features - siehe [[Roadmap|Roadmap#Status_of_features_on_each_widgetset]]
48+- Formulare und Bedienelemente - siehe [[Roadmap|Roadmap Widgetset dependent components]]
49+- Erstellen von TOpenGLControl mit AGL Kontext (siehe components/opengl/)
50+- Maus Ereignisse
51+- Tastatur Ereignisse (VK_ mapping für fremde Tastaturen muss noch getestet werden)
10352
104-[![Working components in the Carbon interface](/wiki-images/d/d3/Carbon_interface_show_case.png)](</File:Carbon_interface_show_case.png> "Working components in the Carbon interface")
53+<img src="Carbon_interface_show_case.png" title="Working components in the Carbon interface" width="640" />
10554
10655## Was muss als nächstes getan werden ?
10756
108-Siehe [Bug Tracker Carbon open issues](<http://www.freepascal.org/mantis/view_all_set.php?type=3&source_query_id=1017>)
57+Siehe [Bug Tracker Carbon open issues](http://www.freepascal.org/mantis/view_all_set.php?type=3&source_query_id=1017)
10958
11059## Carbon IDE Bugs
11160
112-Item | Anmerkung | Abhängigkeiten | Verantwortlich
113----|---|---|---
114-'...' buttons in dialogs | Now they are too large I think | |
115-OK/Cancel | Many dialogs have non-Mac check-X glyphs | |
116-Menu bar | Too wide for 1024x768 display resolution | |
117-Lazarus menu | Help About and app prefs (Environment options) should be accessible here | |
118-Menus | Many missing or non-standard menu shortcuts:
119-File New should be Cmd+N
120-File Save As should be Shift+Cmd+S
121-File Quit should be Cmd+Q
122-Search Find should be Cmd+F
123-Search Find Next should be Cmd+G
124-Search Find Previous should be Shift+Cmd+G
125-(Goto line and Procedure List need to be reassigned)
126-Option+Cmd+F does not bring up Search Results
127-F11 behaves weird! | |
128-
129-Siehe [Bug Tracker Carbon IDE open issues](<http://www.freepascal.org/mantis/view_all_set.php?type=3&source_query_id=1018>)
61+<thead>
13062
63+</thead>
64+<tbody>
65+
66+File New should be Cmd+N<br />
67+File Save As should be Shift+Cmd+S<br />
68+File Quit should be Cmd+Q<br />
69+Search Find should be Cmd+F<br />
70+Search Find Next should be Cmd+G<br />
71+Search Find Previous should be Shift+Cmd+G<br />
72+(Goto line and Procedure List need to be reassigned)<br />
73+Option+Cmd+F does not bring up Search Results<br />
74+F11 behaves weird!</td>
75+
76+</tbody>
77+
78+Siehe [Bug Tracker Carbon IDE open issues](http://www.freepascal.org/mantis/view_all_set.php?type=3&source_query_id=1018)
79+
13180## Implementation Details
13281
13382### Keyboard
13483
135- * Apple Command key is mapped to ssCtrl per [Apple Guidelines](<http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/index.html>)
136- * Apple Control key is mapped to ssMeta
137- * Apple Option key is mapped to its inscription, i.e. ssAlt
138- * Virtual key codes mapping is not reliable (depends on keyboard language layout!)
84+- Apple Command key is mapped to ssCtrl per [Apple Guidelines](http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/index.html)
85+- Apple Control key is mapped to ssMeta
86+- Apple Option key is mapped to its inscription, i.e. ssAlt
87+- Virtual key codes mapping is not reliable (depends on keyboard language layout!)
13988
14089### Application
14190
142- * Title: You cannot change it at runtime. You have to set it in Application Bundle.
143- * OnDropFiles event is fired when file is dropped on application dock icon or opened via Finder if is associated. You have to enable this event in Application Bundle.
91+- Title: You cannot change it at runtime. You have to set it in Application Bundle.
92+- OnDropFiles event is fired when file is dropped on application dock icon or opened via Finder if is associated. You have to enable this event in Application Bundle.
14493
14594### Drawing and measuring text precisely in parts
14695
147-If you want to draw (via TextOut, TextRect) or measure (via TextWidth, TextHeight) text divided into various parts and rely it will be displayed same each time not depending on its division, you have to disable some default typographic features (like kerning, fractional positioning, ...) of Canvas. You can choose one of the following:
96+If you want to draw (via TextOut, TextRect) or measure (via TextWidth, TextHeight) text divided into various parts and rely it will be displayed same each time not depending on its division, you have to disable some default typographic features (like kerning, fractional positioning, ...) of Canvas. You can choose one of the following:
14897
149- * CarbonWidgetSet.SetTextFractional(Canvas, False); // from CarbonInt unit
150- * TCarbonCustomControl(CustomControl.Handle).TextFractional := False; // from CarbonPrivate unit
151- * TCarbonDeviceContext(Canvas.Handle)..TextFractional := False; // from CarbonCanvas unit
98+- CarbonWidgetSet.SetTextFractional(Canvas, False); // from CarbonInt unit
99+- TCarbonCustomControl(CustomControl.Handle).TextFractional := False; // from CarbonPrivate unit
100+- TCarbonDeviceContext(Canvas.Handle)..TextFractional := False; // from CarbonCanvas unit
152101
153102### Screenshot taking
154103
155-The only possible efficient way of taking a screenshot on macOS is using OpenGL. Apple provides a demonstration function which returns a CGImageRef with the screenshot. This function was converted to Pascal and is available on the glgrab.pas unit on the carbon interface directory. This function requires the Apple-specific parts of the Apple OpenGL headers, and those didn't exist yet in Pascal at this point, so the headers were translated and are placed on opengl.pas until they are released on a stable Free Pascal.
104+The only possible efficient way of taking a screenshot on macOS is using OpenGL. Apple provides a demonstration function which returns a CGImageRef with the screenshot. This function was converted to Pascal and is available on the glgrab.pas unit on the carbon interface directory. This function requires the Apple-specific parts of the Apple OpenGL headers, and those didn't exist yet in Pascal at this point, so the headers were translated and are placed on opengl.pas until they are released on a stable Free Pascal.
156105
157-It isn't possible to directly access the bytes of a CGImageRef, and the Screenshot taking rountine (TWidgetset.RawImage_fromDevice) requires doing that, so the image needs to be drawn to a CGContextRef which uses a memory area allocated by us as buffer. This painting has the great advantage of converting from the internal format of the screenshot bytes to the very convenient ARGB, 32-bits depth, 8-bits per channel format that is default to LCL.
106+It isn't possible to directly access the bytes of a CGImageRef, and the Screenshot taking rountine (TWidgetset.RawImage_fromDevice) requires doing that, so the image needs to be drawn to a CGContextRef which uses a memory area allocated by us as buffer. This painting has the great advantage of converting from the internal format of the screenshot bytes to the very convenient ARGB, 32-bits depth, 8-bits per channel format that is default to LCL.
158107
159108## Kompatibilitätsprobleme
160109
161-These are things that will probably never be solved.
110+These are things that will probably never be solved.
162111
163112### Mouse.CursorPos changing does not generate mouse (move) events
164113
165114### Release mouse capture is not supported
166115
167116### Kommandozeilenparameter
168117
169-Because Carbon applications are executed via Application Bundle, command line parameters are not passed. You have to use OnDropFiles event to detect openning associated files.
118+Because Carbon applications are executed via Application Bundle, command line parameters are not passed. You have to use OnDropFiles event to detect openning associated files.
170119
171120### Shortcuts indication is not supported
172121
173122### Drawing on Canvas outside OnPaint event is not supported
174123
175124### Drawing on screen device context is not supported
176125
177126### TCustomControl.Color of clBtnFace makes its background transparent
178127
179128### TWinControl.Font fsStrikeOut wird nicht unterstützt
180129
181130### TForm
182131
183- * Icon wird nicht unterstützt
184- * ShowInTaskbar wird nicht unterstützt
132+- Icon wird nicht unterstützt
133+- ShowInTaskbar wird nicht unterstützt
185134
186135### TEdit.PasswordChar different then default is not supported
187136
188137### TMemo.WordWrap when is disabled, does not allow to scroll text horizontally
189138
190139### TListBox.Columns wird nicht unterstützt
191140
192141### TComboBox
193142
194- * OnDropDown is called when set focus
195- * OnCloseUp is called when released focus
196- * DroppedDown does not show drop down list when style is csDropDownList
197- * DropDownCount wird nicht unterstützt
198- * Style: csSimple, csOwnerDrawFixed und csOwnerDrawVariable werden nicht unterstützt
143+- OnDropDown is called when set focus
144+- OnCloseUp is called when released focus
145+- DroppedDown does not show drop down list when style is csDropDownList
146+- DropDownCount wird nicht unterstützt
147+- Style: csSimple, csOwnerDrawFixed und csOwnerDrawVariable werden nicht unterstützt
199148
200149### TPanel.Bevelxxx: bvLowered und bvSpace werden nicht unterstützt
201150
202151### TBitBtn.Spacing is not supported
203152
204153### TTrackBar
205154
206- * LineSize wird nicht unterstützt
207- * ScalePos wird nicht unterstützt
208- * TickMarks werden nicht unterstützt
155+- LineSize wird nicht unterstützt
156+- ScalePos wird nicht unterstützt
157+- TickMarks werden nicht unterstützt
209158
210159### TProgressBar
211160
212- * BarShowText wird nicht unterstützt
213- * Smooth wird nicht unterstützt
214- * Step wird nicht unterstützt
161+- BarShowText wird nicht unterstützt
162+- Smooth wird nicht unterstützt
163+- Step wird nicht unterstützt
215164
216165### TColorDialog.Title is not supported
217166
218167## Wie man ein neues Bedienelement hinzufügt
219168
220-Zum Beispiel TButton.
169+Zum Beispiel TButton.
221170
222-TButton wird definiert in lcl/buttons.pp. Dies ist der plattformunabhängige Teil der LCL, welcher vom normalen LCL Programmierer benutzt wird.
171+TButton wird definiert in lcl/buttons.pp. Dies ist der plattformunabhängige Teil der LCL, welcher vom normalen LCL Programmierer benutzt wird.
223172
224-Seine widgetset Klasse befindet sich in lcl/widgetset/wsbuttons.pp. Dies ist die plattformabhängige Basis für alle widgetsets (carbon, gtk, win32, ...).
173+Seine widgetset Klasse befindet sich in lcl/widgetset/wsbuttons.pp. Dies ist die plattformabhängige Basis für alle widgetsets (carbon, gtk, win32, ...).
225174
226-Seine Carbon Schnittstellenklasse ist in lcl/interfaces/carbon/carbonwsbuttons.pp:
227-```
228-TCarbonWSButton = class(TWSButton)
229- private
230- protected
231- public
232- class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override;
233- end;
234-```
175+Seine Carbon Schnittstellenklasse ist in lcl/interfaces/carbon/carbonwsbuttons.pp:
235176
236-Jede WS Klasse, die tatsächlich etwas implementiert, muss registriert werden. Schauen sie sich den initialization Abschnitt am Ende der carbonwsXXX.pp Unit an:
237-```
238-RegisterWSComponent(TCustomButton, TCarbonWSButton);
239-```
177+` TCarbonWSButton = class(TWSButton)`\
178+` private`\
179+` protected`\
180+` public`\
181+`   class function  CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override;`\
182+` end;`
240183
184+Jede WS Klasse, die tatsächlich etwas implementiert, muss registriert werden. Schauen sie sich den initialization Abschnitt am Ende der carbonwsXXX.pp Unit an:
185+
186+` RegisterWSComponent(TCustomButton, TCarbonWSButton);`
187+
241188TCarbonWSButton setzt CreateHandle außer Kraft und erzeugt eine Carbon-Schaltfläche-Helfer-Klasse namens TCarbonButton in carbonprivate.pp, die die Schaltfläche in Carbon erzeugt und die Event-Handler installiert.
242189
243190---
244-*From the Free Pascal wiki, page "Carbon interface internals/de", as the Internet Archive kept it on 2024-09-09. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
191+*From the Free Pascal wiki, page "Carbon interface internals/de", as it stood on 2019-12-17 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history