denemo-devel
[Top][All Lists]
Advanced

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

Re: [Denemo-devel] Failure to print from the Evince widget


From: Richard Shann
Subject: Re: [Denemo-devel] Failure to print from the Evince widget
Date: Mon, 21 Nov 2011 17:24:15 +0000

On Mon, 2011-11-21 at 09:11 +0000, Richard Shann wrote:
> I turned the test code into a callable function and then called it from
> earlier and earlier places in Denemo's startup looking for the position
> where it stopped working.
> It turned out to be where the external (Unix) SIGUSR1 is given a handler
> - it would seem that the GtkPrintOperation widget is using this. By the
> most fortuitous of coincidences we don't need that code once the evince
> widget is working, as we get point-and-click from that.
> I'll check in the fix now.
This is checked into git now. Jeremiah, can you remove denemo_client.c
and the configure/make stuff that you created for it? It seems such a
short while ago, but this is so much better.
Also, Jeremiah, where is the gtk3 story now? And Dominic Sacre, where is
the playback story now? It would be really great to make a release with
all this stuff in it.

Richard



> Richard
> 
> On Sun, 2011-11-20 at 10:06 -0600, Jeremiah Benham wrote:
> > On 11/20/2011 07:29 AM, Richard Shann wrote:
> > > Below is a self-contained test file for printing from the evince widget.
> > > It uses the same code as print.c for the printing, and it works.
> > > I have tried embedding it into Denemo and when I do this it does not
> > > print. It seems that the draw_page signal is not emitted (that is, the
> > > callback which libevince attaches is never called).
> > > I have built a debug version of libevince, and verified that the handler
> > > for draw_page is connected.
> > > Something we are doing in Denemo must be causing this. It is all the
> > > stranger since until now we were using the draw_page signal ourselves to
> > > print from a .png loaded into the print preview window.
> > This test prints and runs fine when compiled with gtk-3 and libevince-3. 
> > I use this to compile it:
> > 
> > gcc evince_test.c -o test `pkg-config --libs --cflags evince-view-3.0` 
> > `pkg-config --libs --cflags gtk+-3.0`
> > 
> > I will glance over it and see if I notice anything also.
> > 
> > Jeremiah
> > > If anyone has any idea how this signal might be getting lost I would
> > > like to know.
> > >
> > > Richard
> > >
> > >
> > > #include<stdio.h>
> > > #include<gtk/gtk.h>
> > > #include<evince-view.h>
> > >
> > >
> > > evince_print() {
> > >   GError *err = NULL;
> > >    GFile       *file;
> > >    gchar *filename = "test.pdf";
> > >    file = g_file_new_for_commandline_arg (filename);
> > >    gchar *uri = g_file_get_uri (file);
> > >    g_object_unref (file);
> > >    EvDocument *doc = ev_document_factory_get_document (uri,&err);
> > >    if(err) {
> > >      g_warning ("Trying to read the pdf file %s gave an error: %s", uri,
> > > err->message);
> > >      if(err)
> > >                   g_error_free (err);
> > >      err = NULL;
> > >    } else {
> > >      EvPrintOperation *printop = ev_print_operation_new (doc);
> > >      ev_print_operation_run (printop, NULL);
> > >    }
> > > }
> > >
> > > int main(int argc, char **argv)
> > > {
> > >
> > >    GtkWidget *main_vbox, *top;
> > >    gtk_init(&argc,&argv);
> > >    ev_init();
> > >    GtkWidget *printarea;
> > >    top = gtk_window_new(GTK_WINDOW_TOPLEVEL);
> > >    gtk_window_set_title(GTK_WINDOW(top), "Evince Print Test");
> > >
> > >
> > >    printarea = gtk_button_new_with_label("click me to print the file
> > > test.pdf");
> > >    gtk_container_add (GTK_CONTAINER(top), (GtkWidget*)printarea);
> > >
> > >    g_signal_connect (G_OBJECT (printarea), "clicked",
> > >                 G_CALLBACK (evince_print), NULL);
> > >    gtk_widget_show_all(top);
> > >   gtk_main();
> > >   return 0;
> > > }
> > >
> > > //////////////// end of source code
> > > To build use something like
> > >
> > > gcc testevince.c -o test -I/usr/include/gtk-2.0 
> > > -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo 
> > > -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ 
> > > -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 
> > > -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include      
> > > -I/usr/include/libxml2   -pthread -I/usr/include/gtksourceview-2.0 
> > > -I/usr/include/libxml2 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include 
> > > -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 
> > > -I/usr/include/gio-unix-2.0/ -I/usr/include/pixman-1 
> > > -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/glib-2.0 
> > > -I/usr/lib/glib-2.0/include   -pthread -I/usr/include/librsvg-2 
> > > -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include 
> > > -I/usr/include/gtk-2.0 -I/usr/include/cairo -I/usr/include/pixman-1 
> > > -I/usr/include/freetype2 -I/usr/include/libpng12     
> > > -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   
> > > -I/usr/include/evince/2.30 -levview -levdocument
> > >
> > > (a lot of that could be omitted I'm sure :)
> > >
> > >
> > >
> > > _______________________________________________
> > > Denemo-devel mailing list
> > > address@hidden
> > > https://lists.gnu.org/mailman/listinfo/denemo-devel
> > 
> > 
> > 
> > _______________________________________________
> > Denemo-devel mailing list
> > address@hidden
> > https://lists.gnu.org/mailman/listinfo/denemo-devel
> 
> 
> 
> _______________________________________________
> Denemo-devel mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/denemo-devel





reply via email to

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