Re:GCC now includes Modula-2 and Rust. Do they work on OpenBSD?
by jaas on Monday December 19, 2022 @03:23PM
(#34057154)
The OS X platform code for Firefox is written in Objective-C++. It's not without issues, but overall it's a nice way to use Objective-C from within a larger C++ code base. I didn't find it difficult to work with, particularly as opposed to what we'd have to do if Objective-C++ didn't exist.
If you want to see what this looks like, look at the .mm files here:
Basically what you're looking for is being able to make Obj-C calls (e.g. [[ChildView alloc] initWithFrame:r geckoChild:this]) from within what is otherwise normal C++, and vice-versa.
If you want to see what this looks like, look at the .mm files here:
https://github.com/mozilla/gecko-dev/tree/master/widget/coco...
If you want a specific file to look at with good examples of how this works, here's one:
https://github.com/mozilla/gecko-dev/blob/master/widget/coco...
Basically what you're looking for is being able to make Obj-C calls (e.g. [[ChildView alloc] initWithFrame:r geckoChild:this]) from within what is otherwise normal C++, and vice-versa.