comp.lang.ada
 help / color / mirror / Atom feed
* Cairo Bindings now added to Gnoga
@ 2014-10-24  6:07 David Botton
  2014-10-28 16:18 ` Dmitry A. Kazakov
  0 siblings, 1 reply; 7+ messages in thread
From: David Botton @ 2014-10-24  6:07 UTC (permalink / raw)


I've adopted the Cairo bindings from GtkAda for Gnoga.

This adds in a quick instant tons of functionality for vector graphics. This of course is a great fit since Cairo will produce SVG in addition to PNG and PDFs so a really great fit.

I'll be adding a thicker layer to it for easier use in general and for Gnoga.

Cairo libs are usually installed already on Linux, for Mac I use home brew - brew install cairo and brew install libsvg-cairo for Windows install GtkAda even though not dependant on it, it installs all the needed libs for cairo.

David Botton

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Cairo Bindings now added to Gnoga
  2014-10-24  6:07 Cairo Bindings now added to Gnoga David Botton
@ 2014-10-28 16:18 ` Dmitry A. Kazakov
  2014-10-28 19:08   ` David Botton
  0 siblings, 1 reply; 7+ messages in thread
From: Dmitry A. Kazakov @ 2014-10-28 16:18 UTC (permalink / raw)


On Thu, 23 Oct 2014 23:07:31 -0700 (PDT), David Botton wrote:

> I've adopted the Cairo bindings from GtkAda for Gnoga.
> 
> This adds in a quick instant tons of functionality for vector graphics.
> This of course is a great fit since Cairo will produce SVG in addition to
> PNG and PDFs so a really great fit.
> 
> I'll be adding a thicker layer to it for easier use in general and for Gnoga.
> 
> Cairo libs are usually installed already on Linux, for Mac I use home brew
> - brew install cairo and brew install libsvg-cairo for Windows install
> GtkAda even though not dependant on it, it installs all the needed libs
> for cairo.

This looks very interesting, though I don't understand the architecture of
it, as Cairo uses the native rendering backend. Presently it is Windows GDI
or else X11. I had a, possibly wrong, impression that Gnoda rather uses
browser for rendering.

Making it a bit more concrete, can you use this:

http://www.dmitry-kazakov.de/ada/aicwl.htm

from Gnoda? All widgets there are Cairo-based. [Actually all GTK is
Cairo-based since the version 3.0.]

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Cairo Bindings now added to Gnoga
  2014-10-28 16:18 ` Dmitry A. Kazakov
@ 2014-10-28 19:08   ` David Botton
  2014-10-28 21:07     ` Dmitry A. Kazakov
  0 siblings, 1 reply; 7+ messages in thread
From: David Botton @ 2014-10-28 19:08 UTC (permalink / raw)


> This looks very interesting, though I don't understand the architecture of
> it, as Cairo uses the native rendering backend.

Actually Cairo is not dependant on any backend. It outputs just as happily to bitmap in memory or as SVG and PDF.

> Gnoga rather usee browser for rendering.

Correct and browsers have both bitmap surfaces and SVG surfaces.

Currently with Cairo I am just outputting directly to files for the browser to load up, however at a later point, I'll add code to have cairo output directly over the websocket.

> Making it a bit more concrete, can you use this:
> 
> http://www.dmitry-kazakov.de/ada/aicwl.htm

Actually your controls were what gave me the idea of doing the Cairo bindings. At some point when I can take the time I want to attempt to adopt them to Gnoga.

David Botton


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Cairo Bindings now added to Gnoga
  2014-10-28 19:08   ` David Botton
@ 2014-10-28 21:07     ` Dmitry A. Kazakov
  2014-10-28 22:18       ` David Botton
  0 siblings, 1 reply; 7+ messages in thread
From: Dmitry A. Kazakov @ 2014-10-28 21:07 UTC (permalink / raw)


On Tue, 28 Oct 2014 12:08:02 -0700 (PDT), David Botton wrote:

>> Gnoga rather usee browser for rendering.
> 
> Correct and browsers have both bitmap surfaces and SVG surfaces.
>
> Currently with Cairo I am just outputting directly to files for the
> browser to load up, however at a later point, I'll add code to have cairo
> output directly over the websocket.

I see. Thanks for the explanation. Even with websockets that would be
awfully slow and lose nice doubly buffering Cairo has to prevent
flickering.

I wonder if the browser could have a proper context over websocket rather
than SVG surface.

I am no expert in the matter. What is your take on this:

https://gramps-project.org/wiki/index.php?title=Broadway_Gtk3_backend

Broadway looks like a proper GTK (and thus Cairo) backend.

However, the use-case scenario for Broadway is unclear to me. It looks like
GTK would run on the server side doing much low-level rendering remotely in
the browser. Is that correct?

This does not look good in the case when a single server works with many
clients. It is fine when the server and one client are on the same host.
But why not to use the native backend then?

Although it might be an interesting option for embedded applications
running under VxWorks (no GTK at all) or under Linux without X11 support.

>> Making it a bit more concrete, can you use this:
>> 
>> http://www.dmitry-kazakov.de/ada/aicwl.htm
> 
> Actually your controls were what gave me the idea of doing the Cairo
> bindings. At some point when I can take the time I want to attempt to
> adopt them to Gnoga.

Let me know if you find bugs or need changes.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Cairo Bindings now added to Gnoga
  2014-10-28 21:07     ` Dmitry A. Kazakov
@ 2014-10-28 22:18       ` David Botton
  2014-10-29  9:06         ` Dmitry A. Kazakov
  0 siblings, 1 reply; 7+ messages in thread
From: David Botton @ 2014-10-28 22:18 UTC (permalink / raw)


> I am no expert in the matter. What is your take on this:

That is actually a much slower way of doing things than I am using with Gnoga It is using websockets for a VNC like environment.

> Broadway looks like a proper GTK (and thus Cairo) backend.

Not at all, it is just broadcasting images. Even in GTK most of cairo's work is _not_ being done using the "native" backend as you are calling it but rather on an image surface (png) that is then transferred to the X11 context. That is no different then in Gnoga, render the image to a png and transfer to browser for render. Except that I can also transfer SVG (which interestingly enough on most browsers use Cairo to display :)

> But why not to use the native backend then?

When running a Gnoga app local it will be possible to transfer the entire image in memory to the browser and so as fast as in Gtk. Keep in mind that even over websockets you can achieve easily 20-30fps second in many situations and if transfering SVG even faster.

In summary the only difference in Cairo between GTK and Gnoga, is that in Gnoga the "buffered" image has to be transferred across the network. Once I have the webkit local app portion ready, that will also not be a factor for local apps.


> Although it might be an interesting option for embedded applications
> running under VxWorks (no GTK at all) or under Linux without X11 support.

Gnoga would be, but Broadway is slow and very intense on the processor.

In fact one area I think that Gnoga will shine in the long term is its use in embedded systems to provide a remote GUI.

David Botton

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Cairo Bindings now added to Gnoga
  2014-10-28 22:18       ` David Botton
@ 2014-10-29  9:06         ` Dmitry A. Kazakov
  2014-10-29 15:11           ` David Botton
  0 siblings, 1 reply; 7+ messages in thread
From: Dmitry A. Kazakov @ 2014-10-29  9:06 UTC (permalink / raw)


On Tue, 28 Oct 2014 15:18:31 -0700 (PDT), David Botton wrote:

>> But why not to use the native backend then?
> 
> When running a Gnoga app local it will be possible to transfer the entire
> image in memory to the browser and so as fast as in Gtk.

So the procedure is that at the refresh rate you create a new surface, do
all drawing into its context, get the image bits, send them out, destroy
the surface. Is it so?

> Keep in mind that
> even over websockets you can achieve easily 20-30fps second in many
> situations and if transfering SVG even faster.

You need 10ms (100Hz) for things like running waveforms and very stable
latencies (magnitude is unimportant). Otherwise the output would look
jerky.

> In fact one area I think that Gnoga will shine in the long term is its use
> in embedded systems to provide a remote GUI.

Yes, that's the idea. Somehow to work around porting all non-portable GTK
stuff. I thought that GTK with the Broadway backend would become portable
and small, because all the mess with themes etc would move to the remote
host.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Cairo Bindings now added to Gnoga
  2014-10-29  9:06         ` Dmitry A. Kazakov
@ 2014-10-29 15:11           ` David Botton
  0 siblings, 0 replies; 7+ messages in thread
From: David Botton @ 2014-10-29 15:11 UTC (permalink / raw)


>I thought that GTK with the Broadway backend would become portable
> and small, because all the mess with themes etc would move to the remote
> host.

Everything runs on the server side, the browser is just a VNC client so to speak.

I did look at it before I decided on Gnoga.

David Botton

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-10-29 15:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-24  6:07 Cairo Bindings now added to Gnoga David Botton
2014-10-28 16:18 ` Dmitry A. Kazakov
2014-10-28 19:08   ` David Botton
2014-10-28 21:07     ` Dmitry A. Kazakov
2014-10-28 22:18       ` David Botton
2014-10-29  9:06         ` Dmitry A. Kazakov
2014-10-29 15:11           ` David Botton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox