Re: New files types handlers

John Ellis <[email protected]> Wed, 15 Nov 2006 16:50:08 -0500
Newsgroups gmane.comp.gnome.apps.gqview.devel
Message-ID <[email protected]>
Frédéric wrote:
> Hi,
> 
> Is there a (simple) way to add handlers to decode new files types ? I would 
> like gqview to be able to display some text files, like .bib (from 
> Bibblepro raw converter), or .pano (from AutoPano Pro panorama assembler).

There are no actual image file handlers in GQview, it uses whatever is 
advertised as supported by gdk-pixbuf. (raw files are a special case, but 
even then the embedded jpegs are handed off to gdk-pixbuf for loading).

Writing a gdk-pixbuf loader and installing it for use by gdk-pixbuf should 
not be too difficult, at least librsvg and libwmf seem to have done it.

If you just want to hack on GQview code to try to get something going, the 
ImageLoader functions would be the entry point for tacking on a parser for 
text files. The easiest way would be to create a GdkPixbuf, draw the text 
onto it (see pixbuf_util.h), and pass the pixbuf to GQview to display as 
any other image. Making ImageLoader look to GQview like a GdkPixbufLoader 
is in use may be the biggest rough spot.

> PS : John, do you plan to add the symbolic link feature ? Or can you tell 
> me where to look in the code to do that ?

Symbolic links are a low priority for me right now.

The way I would do it would be to add it to the move/copy code in utilops.c 
as a third mode of operation.

Warning: utilops.c is the oldest remaining code of GQview, single and 
multiple file operations each have a different code path, and you will 
either have to add a lot more if()s or change over all of 
file_util_move_*() to use switch().


Greetings,
John

-- 
John Ellis <[email protected]>

http://gqview.sourceforge.net <GQview> | http://hideseek.sourceforge.net
http://gqmpeg.sourceforge.net <GQmpeg> |     <Preferences Hide and Seek>



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV