GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Fri Apr 25, 2014 2:27 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Embedding things in GTK+
PostPosted: Mon Dec 17, 2007 7:46 am 
Offline
Familiar Face

Joined: Sat Apr 21, 2007 11:09 am
Posts: 8
Location: Melbourne
Hi folks. Just wanted to know if it was a possibility to embed things into GTK as widgets. What I am referring to are things like Firefox html display window, or Evince pdf viewer. I'm writing a program (finally took the plunge) to manage PDF files on your computer, and wanted to know how I could embed a viewer that has already been made (if it is at all possible).

Many thanks guys!
Jason.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 17, 2007 4:39 pm 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 12:07 am
Posts: 563
Location: Portland, OR USA
For the most part, you're going to look for a widget that is already created for your purpose. That is, you can't just embed any application.

For HTML, GtkMozEmbed and GtkHtml2 and GtkHtml3 (they are different widgets) are readily available.

I have no idea about PDFs though. You may want to look at the source code for a GTK-based PDF viewer.

_________________
Micah Carrick - Forum Administrator
http://www.micahcarrick.com


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 07, 2008 6:06 am 
Offline
GTK+ Guru

Joined: Thu Jun 21, 2007 1:52 pm
Posts: 198
Location: Wilkes Barre Pa
You can certanly embed things like firefox & evince using http://www.gtk.org/api/2.6/gtk/PlugSocket.html but for what you wan't to do there are better options.

Instead of embeding firefox you would be better off just useing Gtk+ WebCore "WebKit"

The WebKit framework uses Cairo for all rendering in the GTK+ port. Support has also been added for SVG and <canvas> content using Cairo.
http://trac.webkit.org/projects/webkit/wiki/BuildingGtk

And for pdf just use cairo with poppler installed.
The Poppler library uses Cairo to render PDF documents. Cairo enables the drawing of antialiased vector graphics and transparent objects.
http://cairographics.org/manual/cairo-PDF-Surfaces.html

Plus if you actualy want to generate pdf files for your viewer you can use Haru Free PDF Library

HARU is a free, cross platform, open-sourced software library for generating PDF. It supports the following features.

Generating PDF files with lines, text, images.
Outline, text annotation, link annotation.
Compressing document with deflate-decode.
Embedding PNG, Jpeg images.
Embedding Type1 font and TrueType font.
Creating encrypted PDF files.
Using various character set (ISO8859-1~16, MSCP1250~8, KOI-8R).
Supporting CJK fonts and encodings.

You can add the feature of PDF creation by using HARU without understanding complicated internal structure of PDF.

http://libharu.sourceforge.net/

If you want a canvas widget to tie everything together you can use goocanvas.
http://library.gnome.org/devel/goocanvas/unstable/

Features
Optional model/view split.
Uses interfaces for items and views.
Basic items - rect/ellipse/polyline/text/image/group.
Path item, using SVG path specification strings.
Table item for layout of other items (similar to the GtkTable widget). (This also supports items whose requested height changes according to their allocated width, such as text items.)
Embedded GTK+ widgets.
Layers/stacking order with raise/lower functions.
Cascading styles - line width/style/dashes, colors, fill patterns.
Affine transformations for all items - rotations/scales/skews.
Event handling - button/motion events, "pointer-events" property like SVG.
Grabs - support for pointer and keyboard grabs.
Keyboard focus traversal.
Accessibility (item title and description properties and hierarchy stuff).
Printing (output to a given cairo_t).
Scrolling.
Zooming.
Item visibility setting - on/off/above zoom threshold.
Simple animation.
Scalable - support for thousands of items over a large canvas area.
Support for different units - pixels/points/inches/millimeters.

Hope that helps :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Gunner and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group