Features/Evince Introspection Bindings: Difference between revisions

Godiard (talk | contribs)
Godiard (talk | contribs)
Line 24: Line 24:


There are a bug related https://bugzilla.gnome.org/show_bug.cgi?id=635705
There are a bug related https://bugzilla.gnome.org/show_bug.cgi?id=635705
 
the evince developers know we need it, and there are working on this.
and the method factory_get_document needed to open a document, is marked as not introspectable https://bugzilla.gnome.org/show_bug.cgi?id=662709
The patches are against evince 3.4 (shipped in F17), after review of the patches, we need look if  can be backported to evince 3.2
to update Fedora 16.  


=== Implementation plan ===
=== Implementation plan ===
Line 36: Line 37:
  docmodel.set_document(doc)
  docmodel.set_document(doc)
  e.set_model(model)
  e.set_model(model)
With gtk 3 is:
from gi.repository import Gtk, Gio
from gi.repository import EvinceDocument
from gi.repository import EvinceView
class HelloWorldApp(Gtk.Application):
    def __init__(self):
        Gtk.Application.__init__(self, application_id="apps.test.helloevince",
                                flags=Gio.ApplicationFlags.FLAGS_NONE)
        self.connect("activate", self.on_activate)
       
    def on_activate(self, data=None):
        window = Gtk.Window(type=Gtk.WindowType.TOPLEVEL)
        window.set_title("Evince Gtk3 Python Example")
        window.set_border_width(24)
        scroll = Gtk.ScrolledWindow()
        window.add(scroll)
        EvinceDocument.init()
        doc = EvinceDocument.Document.factory_get_document('file:///home/gonzalo/Desktop/AjedrezyLeyendas-Postmortem.pdf')
        view = EvinceView.View()
        model = EvinceView.DocumentModel()
        model.set_document(doc)
        view.set_model(model)
        scroll.add(view)
        window.show_all()
        self.add_window(window)
   
if __name__ == "__main__":
    app = HelloWorldApp()
    app.run(None)


=== More information ===
=== More information ===