Re: [Lazarus] OSX 64 bit Cocoa + Catalina Installer

2019-10-15 Thread Anthony Walter via lazarus
I have to search my backup drives for some of this code, but I believe I
also added a few extra classes to simplify some of the weirdness of Apple's
classes. For example I greatly simplified the steps needed to work with
CGContext and CGBitmapContextCreate such that it was completely
transparent. A TCGBitmap class was defined (not in the framework, but
wrapping CGBitmapContextCreate), and it would be compatible with
TCGContext, but adding methods for loading, saving, blitting ect.

Also some types have been simplified, NSString becomes regular pascal
string, NSRect/CGRect becomes TRectF, and so on.

Obviously defining all these types is definitely a lot of work, but to
reiterate it does aid in type safety, object management, and discovery (how
to combine the use the Framework objects with each other). One approach to
tackling all this work, if anyone decides it's beneficial, might be to add
it in gradually for what is needed, which is how I am using it right now.
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] OSX 64 bit Cocoa + Catalina Installer

2019-10-15 Thread Dmitry Boyarintsev via lazarus
I see. Thanks for the insight

On Tuesday, October 15, 2019, Anthony Walter via lazarus <
lazarus@lists.lazarus-ide.org> wrote:

> What I've done is created a reference counted class hierarchy to match
> part of the Cocoa framework.
>
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] OSX 64 bit Cocoa + Catalina Installer

2019-10-15 Thread Anthony Walter via lazarus
Dimitry,

What I've done is created a reference counted class hierarchy to match part
of the Cocoa framework. It's only partially done, but it allows Pascal code
to be written to simplify interaction with native OSX frameworks and APIs
like AppKit in the following ways:

Using NSWindow class as an example:
https://developer.apple.com/documentation/appkit/nswindow

* TNSWindow mirrors NSWindow and uses an automatic reference counting
scheme to automatically release objects when they are are no longer needed.

* All methods and properties of NSWindow are provided by TNSWindow and
there is no need to pass native objects as handles to functions. It's
implicit in Self and the underlying handle is manged by TNSWindow ->
TNSResponder -> TNSObject  -> and ultimately TFrameworkObject.

* It uses an object oriented hierarchy the same as the Apple frameworks,
only translated to Pascal objects. That is you can pass a derived class to
methods of other object methods which may expect any less specific class.

* Other classes such as CGContext (TCGContext -> TFrameworkObject) are
provided as well as other Apple frameworks classes, all translated to
Pascal classes with all the same benefits as outlined above.

My implementation isn't complete, which is to say I haven't wrapped every
single Apple framework class in the manner described above. For the
extremely limited amount of translations I did complete, I saw a big
benefit in my own personal projects on OSX. Most notably the way of
organizing code I outlined above allowed me to much more easily understand
how to use Apple's frameworks, reduce errors with type safety and automatic
object lifetime management, as well as aid in the discovery when combining
Apple framework object to accomplish programming tasks. I expect if this
were integrated into the Cocoa widgetset it would make development a bit
easier. Certainly there is a lot of work involved in defining every Apple
framework object in this way, but it provides a certain level of
organization and usability that I at least feel makes a big difference when
working with native Apple APIs.
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] OSX 64 bit Cocoa + Catalina Installer

2019-10-15 Thread Dmitry Boyarintsev via lazarus
On Tue, Oct 15, 2019 at 11:50 AM Anthony Walter via lazarus <
lazarus@lists.lazarus-ide.org> wrote:

> Personally I've implemented some OSX core classes in a manner that is much
> more elegant manner that what's currently used in the Cocoa widgetset and
> if time permits I may propose some of my changes that could push Cocoa
> forward in a positive direction.
>

a preview or sneak peek available?
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] OSX 64 bit Cocoa + Catalina Installer

2019-10-15 Thread Anthony Walter via lazarus
Note to all, the install source I posted comes from a random clone of svn
trunk fpc and trunk lazarus put together from whatever was in the svn
repository on Saturday. As such it might contain any number of
potential bugs. That said, the reason trunk sources should be used is that
the Cocoa widgetset is still in a beta state.

Personally I've implemented some OSX core classes in a manner that is much
more elegant manner that what's currently used in the Cocoa widgetset and
if time permits I may propose some of my changes that could push Cocoa
forward in a positive direction. I feel that many of the problems everyone
might be experiencing is tied to the specific implementation state we
currently have. This is not meant as a dig on the Cocoa LCL widgetset
developers, obviously its difficult and tedious work trying to create a
100% compatible and bug free implementation and you work is very much
appreciated so please keep it up! I know well get it working.

On a side note, if anyone reading this message has done some work on
committing widgetset code to Lazarus, either with the Gtk3 or Cocoa
libraries, and would like to coordinate some of my improvements we can take
this discussion to private emails or perhaps freenode irc and we can hash
out merging my work.
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] OSX 64 bit Cocoa + Catalina Installer

2019-10-15 Thread Anthony Tekatch via lazarus
I'll test the debugger options later.

I tried installing online package manager and got these errors after trying to 
rebuild:
  Compile package laz.virtualtreeview_package 5.5.3.1: Exit code 1, Errors: 1
  laz.virtualtrees.pas(68,3) Fatal: Cannot find laz.FakeActiveX used by 
laz.VirtualTrees of package laz.virtualtreeview_package.

-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] OSX 64 bit Cocoa + Catalina Installer

2019-10-15 Thread Martin Frb via lazarus

On 15/10/2019 12:14, Martin Frb via lazarus wrote:

On 15/10/2019 04:23, Anthony Walter via lazarus wrote:
Here is a short video where I demonstrate how to switch between the 
gdb and lldb inside Lazarus.

https://cache.getlazarus.org/videos/lazarus-lldb.mp4

You can add a 2nd configuration via the toolbar. Then use the toolbar 
to toggle. That way you  (once the conf is added) you only need to 
select in the toolbars dropdown, instead of having to change 2 fields. 
(The toolbar is Lazarus 2.1 only)


https://wiki.lazarus.freepascal.org/IDE_Window:_DebuggerClassOptionsFrame

Also, you should NOT use the "lldb debugger (ALPHA)"

There is a "LLDB debugger (with fpdebug) (beta)" which I recommend. It 
features watches in Pascal format.


If it does not show, then install the package LazDebuggerFPlldb. Mind 
the FP before lldb.

If you build "bigide" I would have expected it to be there by default.

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] OSX 64 bit Cocoa + Catalina Installer

2019-10-15 Thread Martin Frb via lazarus

On 15/10/2019 04:23, Anthony Walter via lazarus wrote:
Here is a short video where I demonstrate how to switch between the 
gdb and lldb inside Lazarus.

https://cache.getlazarus.org/videos/lazarus-lldb.mp4

You can add a 2nd configuration via the toolbar. Then use the toolbar to 
toggle. That way you  (once the conf is added) you only need to select 
in the toolbars dropdown, instead of having to change 2 fields. (The 
toolbar is Lazarus 2.1 only)


https://wiki.lazarus.freepascal.org/IDE_Window:_DebuggerClassOptionsFrame
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus