discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GWorkspace.app Feature Request-- Tabbed Shelf


From: Richard Frith-Macdonald
Subject: Re: GWorkspace.app Feature Request-- Tabbed Shelf
Date: Sun, 29 Jun 2003 07:27:39 +0100


On Sunday, June 29, 2003, at 12:49  am, Tima Vaisburd wrote:

Richard Frith-Macdonald wrote:

Would it not make sense for the existing iconForFile: method to ask a
service provider for the thumbnail transparently ...
eg. internally it might call
[NSPasteboard +pasteboardByFilteringFile:ofType:]
where the type is a new one produced by
NSCreateFileContentsPastebaordType(@"thumbnail")

I do not know anything about NSPasteboard yet, but I fully rely upon you :-)
One small thing is how to control the size of the thumbnail.
I'd prefer to know the desired size before the rendering and not after it
so the program won't produce a fine postcript image, for instance,
to drop most of the work.

I would expect to use a standard size for thumbnails ... so I would expect
a service to return all thumbnails with the same dimensions.

Then any application (or other service provider) offering a standard
filter service of that type would be automatically invoked to provide
the thumbnail.

That would be great.
But let me return to the original question. I've seen
many people in this thread are saying that service
should make the icons and save them in files in a standartized
place, and then another application get it from there.

I've seen talk of as freedesktop.org spec ... that mandates
storage of thumbnails in a particular directory.  Makes sense where
you expect to re-use the thumbnails in a lot of different programs.

I thought it would be better to get the icon
right from the service process, through DO mechanism.

That's what services do ... an app would ask the service provider
for a thumbnail, and the provider would either fetch it from the
thumbnail directory or generate it if there is no thumbnail in the
directory.

If this is to be done behind the scenes, then still
-iconForFile can get the image from the running process
and not from the file. What is your opinion on that?

I've changed my mind ... someone pointed out that -iconForFile
is supposed to return an icon representing the type of file,
eg. the icon should be the same for all jpegs, and the same for all
gifs, so you can immediately see what kind of file it represents,
rather than the contents.

So I now think that -iconForFile should not return a thumbnail,
and applications wanting to use thumbnails should just use
a line of code like -

thumbnail = [[NSPasteboard pasteboardByFilteringFile: @"filename.xxx"]
  dataForType: @"Thumbnail:128x128"];


But effectively, having applications
registering for creating thumbnails is interessting.

Yes ... they could do that using the service/filters mechanism.

Probably that was precisely what I meant, I only wish I new
about service/filters mechanism better.
Could you, please, tell me what's the meaning of "filter" here?

In OpenStep, a general 'service' is a mechanism used from the
applications 'services' menu.  When some data in the application
is selected, and a services menu item is clicked on, the selected
data is send to the service provider application which advertised
the service, and some other data is returned.

A 'filter service' is similar, but filters do not appear on the service
menu, instead they are used automatically by some of the
standard pasteboard methods, when you ask the pasteboard for
data of a particular type.

So,
[NSPasteboard pasteboardByFilteringFile: @"filename.xxx"]
returns a pasteboard object which contains the file name 'filename'

and calling the -dataForType: method asks the pasteboard to
return the contents of that file, as modified by any filter service
provider which is able to produce data of the requested type.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]