Web lists-archives.com

Re: RFC: GtkPreview library




After talking to Owen today, I'm wondering if it makes sense to consider GtkPreview a portable widget. These platforms tend to already have their own document preview systems, and I'm not sure it makes sense to port all our apps (evince preview system, LibreOffice preview system) to use our own system instead of simply using the native preview widget.

OS X has QuickLook: https://developer.apple.com/library/mac/documentation/UserExperience/Conceptual/Quicklook_Programming_Guide/Introduction/Introduction.html

While I can't find a Win32 equivalent, it seems file pickers use IThumbnailCache: https://msdn.microsoft.com/en-us/library/windows/desktop/bb774628%28v=vs.85%29.aspx



On Wed, Jan 28, 2015 at 1:23 AM, Jasper St. Pierre <jstpierre@xxxxxxxxxxx> wrote:
All of this is part of wl_event_loop, which is an unfortunate public API that should probably go away.

On Wed, Jan 28, 2015 at 1:21 AM, Philip Chimento <philip.chimento@xxxxxxxxx> wrote:
On Tue, Jan 27, 2015 at 8:49 AM, Jasper St. Pierre <jstpierre@xxxxxxxxxxx> wrote:
Gah. I always get those backwards. I actually typed "SCM_RIGHTS" and then changed it to "SCM_CREDENTIALS". I still don't understand why fd passing is called "rights".

On Tue, Jan 27, 2015 at 11:25 AM, Simon McVittie <simon.mcvittie@xxxxxxxxxxxxxxx> wrote:
On 27/01/15 15:55, Jasper St. Pierre wrote:
> Wayland requires two features that would perhaps make it unportable: FD
> passing (SCM_CREDENTIALS), and shared memory (allocate a temporary
> files, ftruncate it, mmap it, unlink it and then send the fd across the
> wire). Everything else is just a simple Unix domain socket. Does OS X
> support those two features?

I think you mean SCM_RIGHTS?

SCM_RIGHTS is "here's a message with an open fd attached". It's how
D-Bus does fd-passing, so if D-Bus fd-passing works on your favourite
platform, Wayland fd-passing should too.

SCM_CREDENTIALS is "here's a message with my uid, gid and pid[1]
attached, the kernel will check that I haven't lied to you" (also called
SCM_CREDS on e.g. FreeBSD). Basically every Unix has either this or a
syscall to query those things or both, but most Unixes also have their
own unique spelling for the API, because standards are hard.[2]

    S

[1] Strictly speaking "the uid, gid and pid I had at the time I opened
this socket"
[2] Except that FreeBSD, Dragonfly BSD and Hurd share SCM_CREDS, and
several platforms (sadly not including Linux) share getpeereid(). For
the gory details see libdbus source code.

I put it to the test and tried to build Jasper's proof of concept (and therefore Wayland) on OSX. I didn't get very far. Wayland's configure.ac checks for SFD_CLOEXEC and TFD_CLOEXEC which implies that it uses signalfd() and timerfd(), not available on OSX. I guess the replacement would be something with kqueue though I really haven't the faintest idea what I'm talking about there.

Wayland also wants clock_gettime() - not insurmountable to provide on OSX but afaik uses a different API, quick googling showed up this: http://stackoverflow.com/a/6725161/172999

PS. Funny thing that this is one of the top results for googling SFD_CLOEXEC, even without adding "osx" or "wayland": http://stackoverflow.com/questions/27864027/sfd-cloexec-wayland

Best,
--
Philip



--
  Jasper



--
  Jasper
_______________________________________________
gtk-devel-list mailing list
gtk-devel-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-devel-list