[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Gnome2::Print binding
- From: Emmanuele Bassi <bassi-e libero it>
- To: GTK-Perl ML <gtk-perl-list gnome org>
- Subject: Gnome2::Print binding
- Date: Thu, 14 Aug 2003 06:19:11 +0200
Hi all,
Using muppet's excellent binding howto, I've been toying around in order
to get a working binding for libgnomeprint(ui), and it seems that I've
just god some luck. :-)
I said "toying around" since I'm no XS-expert, and my code will need
some "peer review" (just being optimistic: probably, you're going to
LART me with a big stick :-)).
I've been able to port the gnomeprint example from PyGNOME under
gtk2perl, but there are still some functions that need to be bound, so
I'm going to work on them within this week. As a sample, here's a patch
against the current CVS.
And remember: do not beat me too hard. ;-)
+++
BTW: Seems to me that there's some black magic at work, inside
libgnomeprint. gperl complains loudly that there are some missing types
(e.g.: "GnomePrintPdf", "GnomePrintMeta") all subtypes of
GnomePrintContext; unfortunately, they are not defined inside the header
files, so I'll need to download the complet source tarball of
libgnomeprint, unless there's some obvious method to wrap them and that
I do not know. :-)
Kind regards,
Emmanuele.
--
Emmanuele Bassi (Zefram) [ http://digilander.libero.it/ebassi/ ]
GnuPG Key fingerprint = 4DD0 C90D 4070 F071 5738 08BD 8ECC DB8F A432 0FF4
diff -Nur /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/MANIFEST ./GnomePrint2/MANIFEST
--- /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/MANIFEST Thu Jan 1 01:00:00 1970
+++ ./GnomePrint2/MANIFEST Thu Aug 14 05:48:02 2003
@@ -0,0 +1,20 @@
+Makefile.PL
+MANIFEST
+MANIFEST.SKIP
+Print.pm
+genmaps.pl
+maps
+gnomeprintperl.h
+examples/test-print.pl
+t/00.GnomePrint.t
+t/01.GnomePrintConfig.t
+t/02.GnomePrintContext.t
+t/03.GnomePrintJob.t
+t/04.GnomePrintDialog.t
+xs/GnomePrint2.xs
+xs/GnomePrintConfig.xs
+xs/GnomePrintContext.xs
+xs/GnomePrintContextHelper.xs
+xs/GnomePrintDialog.xs
+xs/GnomePrintJob.xs
+xs/GnomePrintJobPreview.xs
diff -Nur /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/MANIFEST.SKIP ./GnomePrint2/MANIFEST.SKIP
--- /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/MANIFEST.SKIP Thu Jan 1 01:00:00 1970
+++ ./GnomePrint2/MANIFEST.SKIP Thu Aug 14 00:58:33 2003
@@ -0,0 +1,12 @@
+CVS
+\.bak$
+\.bs$
+\.c$
+\.o$
+Makefile$
+Makefile\.old$
+~$
+\.sw.$
+\.cvsignore$
+blib
+build
diff -Nur /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/Makefile.PL ./GnomePrint2/Makefile.PL
--- /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/Makefile.PL Fri Aug 8 22:35:13 2003
+++ ./GnomePrint2/Makefile.PL Thu Aug 14 05:57:34 2003
@@ -10,7 +10,8 @@
use Glib::PkgConfig;
use Gtk2::CodeGen;
-%pkgcfg = Glib::PkgConfig->find ('libgnomeprintui-2.0');
+
+%pkgcfg = Glib::PkgConfig->find ('libgnomeprint-2.2 libgnomeprintui-2.2');
mkdir 'build', 0777;
@@ -20,7 +21,6 @@
Gtk2::CodeGen->parse_maps ('gnomeprintperl');
Gtk2::CodeGen->write_boot (ignore => '^Gnome2::Print$');
-
# now we're ready to start creating the makefile.
# we need to use ExtUtils::Depends to get relevant information out of
# the Glib extension, and to save config information for other modules which
@@ -30,7 +30,7 @@
$gnomeprint2->set_inc ($pkgcfg{cflags} . ' -I. -I./build ');
$gnomeprint2->set_libs ($pkgcfg{libs});
$gnomeprint2->add_xs (<xs/*.xs>);
-$gnomeprint2->add_pm ('Print.pm' => '$(INST_LIBDIR)/Gnome2/Print.pm');
+$gnomeprint2->add_pm ('Print.pm' => '$(INST_LIBDIR)/Print.pm');
my $cwd = cwd();
$gnomeprint2->add_typemaps (map {File::Spec->catfile($cwd,$_)} 'build/gnomeprintperl.typemap');
$gnomeprint2->add_headers ('gnomeprintperl.h');
diff -Nur /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/Print.pm ./GnomePrint2/Print.pm
--- /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/Print.pm Sat May 17 15:31:07 2003
+++ ./GnomePrint2/Print.pm Thu Aug 14 06:17:12 2003
@@ -42,22 +42,29 @@
1;
__END__
-# Below is stub documentation for your module. You'd better edit it!
-
=head1 NAME
Gnome2::Print - Perl wrappers for the Gnome Print utilities.
=head1 SYNOPSIS
- use Gtk2;
- Gtk2->init;
- my $window = Gtk2::Window->new ('toplevel');
- my $button = Gtk2::Button->new ('Quit');
- $button->signal_connect (clicked => sub { Gtk2->main_quit });
- $window->add ($button);
- $window->show_all;
- Gtk2->main;
+ use Gnome2::Print;
+
+ my $job = Gnome2::Print::Job->new;
+ my $config = $job->get_config;
+ my $pc = $job->get_context;
+
+ my ($width, $height) = $config->get_page_size;
+
+ $pc->beginpage("1");
+
+ $pc->setlinewidth(3.0);
+ $pc->rect_stroked($width * .1, $height * .1, $width * .9, $height * .9);
+
+ $pc->showpage;
+
+ $job->render($pc);
+ $job->close;
=head1 ABSTRACT
@@ -74,19 +81,20 @@
To discuss gtk2-perl, ask questions and flame/praise the authors,
join gtk-perl-list gnome org at lists.gnome.org.
-If you have a web site set up for your module, mention it here.
-
-FIXME we have no other documentation, but we probably need it.
+This module allows you to use the GNOME Print libraries within your
+applications written using the gtk2-perl wrapper.
=head1 SEE ALSO
-perl(1), Glib(1), Gtk2(1).
+perl(1), Glib(3pm), Gtk2(3pm), Gnome2(3pm).
=head1 AUTHOR
-muppet E<lt>scott asofyet orgE<gt>
+muppet E<lt>scott asofyet orgE<gt>, Emmanuele Bassi E<lt>emmanuele bassi iol itE<gt>
=head1 COPYRIGHT AND LICENSE
+
+Copyright 2003 by Emmanuele Bassi
Copyright 2003 by muppet
diff -Nur /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/examples/test-print.pl ./GnomePrint2/examples/test-print.pl
--- /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/examples/test-print.pl Thu Jan 1 01:00:00 1970
+++ ./GnomePrint2/examples/test-print.pl Thu Aug 14 05:07:00 2003
@@ -0,0 +1,84 @@
+#
+# A simple gnomeprint dialog
+#
+
+use Gtk2;
+use Gnome2::Print;
+
+Gtk2->init;
+
+$d = create_dialog();
+$d->show;
+
+Gtk2->main;
+
+0;
+
+sub render_job
+{
+ my $job = shift;
+ my $conf = $job->get_config;
+ my ($width, $height) = $conf->get_page_size;
+ my $pc = $job->get_context;
+
+ $pc->beginpage("1");
+
+ $x1 = $width * .1;
+ $x2 = $width * .9;
+ $y1 = $width * .1;
+ $y2 = $width * .9;
+
+ $pc->setlinewidth(3.0);
+ $pc->rect_stroked($x1, $y1, $x2 - $x1, $y2 - $y1);
+ $pc->line_stroked($x1, $y1, $x2, $y2);
+ $pc->line_stroked($x2, $y1, $x1, $y2);
+ $pc->showpage;
+
+ $job->close;
+}
+
+sub create_dialog
+{
+ $job = Gnome2::Print::Job->new;
+ $dialog = Gnome2::Print::Dialog->new($job, "Sample print dialog", 0);
+ $gpc = $job->get_context;
+ $config = $job->get_config;
+
+ $dialog->signal_connect("delete_event", sub { $dialog->destroy; });
+ $dialog->signal_connect("destroy", sub { Gtk2->main_quit; });
+ $dialog->signal_connect("response", sub
+ {
+ my ($d, $response, $job) = @_;
+ print "response := " . $response . "\n";
+
+ my $conf = $d->get_config;
+ my $j = Gnome2::Print::Job->new($conf);
+
+ if (1 == $response) # user hit 'Print'
+ {
+ render_job($j);
+
+ my $pc = Gnome2::Print::Context->new($conf);
+ $j->render($pc);
+ $pc->close;
+
+ $dialog->destroy;
+ }
+ elsif (2 == $response) # user hit 'Preview'
+ {
+ render_job($j);
+
+ my $preview = Gnome2::Print::JobPreview->new($j, "Sample preview dialog");
+ $preview->set_property("allow-grow", 1);
+ $preview->set_property("allow-shrink", 1);
+ $preview->set_transient_for($d);
+ $preview->show_all;
+ }
+ else
+ {
+ $d->destroy;
+ }
+ }, $job);
+
+ return $dialog;
+}
diff -Nur /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/genmaps.pl ./GnomePrint2/genmaps.pl
--- /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/genmaps.pl Sun Apr 20 18:41:14 2003
+++ ./GnomePrint2/genmaps.pl Thu Aug 14 06:17:52 2003
@@ -1,20 +1,13 @@
-#read !grep _TYPE_ /usr/include/gtk-2.0/gtk/*.h | grep get_type
-#% s/^.*[ \t]\([_A-Z0-9]*_TYPE_[_A-Z0-9]*\)[ \t].*$/\1/
-#
-# $Header: /cvsroot/gtk2-perl/gtk2-perl-xs/GnomePrint2/genmaps.pl,v 1.2 2003/04/20 16:41:14 rwmcfa1 Exp $
-#
-
-
=out
-libgnomeprint-2.0
-libgnomeprintui-2.0
+libgnomeprint-2.2
+libgnomeprintui-2.2
=cut
@dirs = (
- '/usr/include/libgnomeprint-2.0/libgnomeprint/',
- '/usr/include/libgnomeprintui-2.0/libgnomeprintui/',
+ '/usr/include/libgnomeprint-2.2/libgnomeprint/',
+ '/usr/include/libgnomeprintui-2.2/libgnomeprintui/',
);
foreach $dir (@dirs) {
@@ -32,14 +25,19 @@
print '#include <stdio.h>
#include <gnome.h>
+
+#include <libgnomeprint/gnome-font.h>
+#include <libgnomeprint/gnome-glyphlist.h>
#include <libgnomeprint/gnome-print.h>
+#include <libgnomeprint/gnome-print-config.h>
+#include <libgnomeprint/gnome-print-job.h>
+
#include <libgnomeprintui/gnome-font-dialog.h>
-#include <libgnomeprintui/gnome-print-copies.h>
#include <libgnomeprintui/gnome-print-dialog.h>
-#include <libgnomeprintui/gnome-printer-dialog.h>
-#include <libgnomeprintui/gnome-print-master-preview.h>
-#include <libgnomeprintui/gnome-print-paper-selector.h>
+#include <libgnomeprintui/gnome-print-job-preview.h>
#include <libgnomeprintui/gnome-print-preview.h>
+#include <libgnomeprintui/gnome-print-paper-selector.h>
+#include <libgnomeprintui/gnome-print-unit-selector.h>
const char * find_base (GType gtype)
{
@@ -94,16 +92,13 @@
close FOO;
select STDOUT;
-system 'gcc -DGTK_DISABLE_DEPRECATED -Wall -o foo foo.c `pkg-config libgnomeui-2.0 libgnomeprintui-2.0 --cflags --libs`'
+system 'gcc -DGTK_DISABLE_DEPRECATED -Wall -o foo foo.c `pkg-config libgnomeui-2.0 libgnomeprint-2.2 libgnomeprintui-2.2 --cflags --libs`'
and die "couldn't compile helper program";
-# these are matched in order; for example, GnomePrinter must test before
-# GnomePrint to avoid matching the wrong thing.
@packagemap = (
[ GnomeFont => 'Gnome2::Font' ],
- [ GnomePaper => 'Gnome2::Paper' ],
- [ GnomePrinter => 'Gnome2::Printer' ],
[ GnomePrint => 'Gnome2::Print' ],
+ [ GnomeGlyphList => 'Gnome2::GlyphList' ],
[ Gnome => 'Gnome2' ], # fallback
);
diff -Nur /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/gnomeprintperl.h ./GnomePrint2/gnomeprintperl.h
--- /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/gnomeprintperl.h Sun Apr 20 18:41:14 2003
+++ ./GnomePrint2/gnomeprintperl.h Thu Aug 14 05:38:46 2003
@@ -1,13 +1,20 @@
-/*
- * * $Header: /cvsroot/gtk2-perl/gtk2-perl-xs/GnomePrint2/gnomeprintperl.h,v 1.2 2003/04/20 16:41:14 rwmcfa1 Exp $
- * */
-
#ifndef _GNOME_PRINT_PERL_H_
#define _GNOME_PRINT_PERL_H_
#include <gnome2perl.h>
-#include <libgnomeprint/libgnomeprint.h>
-#include <libgnomeprintui/libgnomeprintui.h>
+
+/* basic include files */
+#include <libgnomeprint/gnome-print.h>
+#include <libgnomeprint/gnome-print-config.h>
+#include <libgnomeprint/gnome-print-job.h>
+
+#include <libgnomeprintui/gnome-font-dialog.h>
+#include <libgnomeprintui/gnome-print-dialog.h>
+#include <libgnomeprintui/gnome-print-job-preview.h>
+#include <libgnomeprintui/gnome-print-preview.h>
+#include <libgnomeprintui/gnome-print-paper-selector.h>
+#include <libgnomeprintui/gnome-print-unit-selector.h>
+
#include "gnomeprintperl-autogen.h"
#endif /* _GNOME_PRINT_PERL_H_ */
diff -Nur /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/maps ./GnomePrint2/maps
--- /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/maps Thu Jan 1 01:00:00 1970
+++ ./GnomePrint2/maps Thu Aug 14 05:52:59 2003
@@ -0,0 +1,15 @@
+GNOME_TYPE_FONT_FACE GnomeFontFace GObject Gnome2::Font::Face
+GNOME_TYPE_FONT GnomeFont GObject Gnome2::Font
+GNOME_TYPE_GLYPHLIST GnomeGlyphList GBoxed Gnome2::GlyphList
+GNOME_TYPE_PRINT_CONFIG GnomePrintConfig GObject Gnome2::Print::Config
+GNOME_TYPE_PRINT_JOB GnomePrintJob GObject Gnome2::Print::Job
+GNOME_TYPE_PRINT_UNIT GnomePrintUnit GBoxed Gnome2::Print::Unit
+GNOME_TYPE_PRINT_CONTEXT GnomePrintContext GObject Gnome2::Print::Context
+GNOME_TYPE_FONT_PREVIEW GnomeFontPreview GtkObject Gnome2::Font::Preview
+GNOME_TYPE_FONT_SELECTION GnomeFontSelection GtkObject Gnome2::Font::Selection
+GNOME_TYPE_FONT_DIALOG GnomeFontDialog GtkObject Gnome2::Font::Dialog
+GNOME_TYPE_PRINT_DIALOG GnomePrintDialog GtkObject Gnome2::Print::Dialog
+GNOME_TYPE_PRINT_JOB_PREVIEW GnomePrintJobPreview GtkObject Gnome2::Print::JobPreview
+GNOME_TYPE_PAPER_SELECTOR GnomePaperSelector GtkObject Gnome2::PaperSelector
+GNOME_TYPE_PRINT_PREVIEW GnomePrintPreview GObject Gnome2::Print::Preview
+GNOME_TYPE_PRINT_UNIT_SELECTOR GnomePrintUnitSelector GtkObject Gnome2::Print::UnitSelector
diff -Nur /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/t/00.GnomePrint.t ./GnomePrint2/t/00.GnomePrint.t
--- /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/t/00.GnomePrint.t Thu Jan 1 01:00:00 1970
+++ ./GnomePrint2/t/00.GnomePrint.t Thu Aug 14 00:51:07 2003
@@ -0,0 +1,11 @@
+#########################
+# GnomePrint2 Tests
+# - ebb
+#########################
+
+#########################
+
+use Test::More tests => 1;
+BEGIN { use_ok('Gnome2::Print') };
+
+#########################
diff -Nur /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/t/01.GnomePrintConfig.t ./GnomePrint2/t/01.GnomePrintConfig.t
--- /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/t/01.GnomePrintConfig.t Thu Jan 1 01:00:00 1970
+++ ./GnomePrint2/t/01.GnomePrintConfig.t Thu Aug 14 00:52:40 2003
@@ -0,0 +1,13 @@
+#########################
+# GnomePrint2 Tests
+# - ebb
+#########################
+
+#########################
+
+use Test::More tests => 2;
+BEGIN { use_ok('Gnome2::Print') };
+
+#########################
+
+ok( $config = Gnome2::Print::Config->default );
diff -Nur /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/t/02.GnomePrintContext.t ./GnomePrint2/t/02.GnomePrintContext.t
--- /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/t/02.GnomePrintContext.t Thu Jan 1 01:00:00 1970
+++ ./GnomePrint2/t/02.GnomePrintContext.t Thu Aug 14 00:52:54 2003
@@ -0,0 +1,15 @@
+#########################
+# GnomePrint2 Tests
+# - ebb
+#########################
+
+#########################
+
+use Test::More tests => 2;
+BEGIN { use_ok('Gnome2::Print') };
+
+#########################
+
+$config = Gnome2::Print::Config->default;
+
+ok($pc = Gnome2::Print::Context->new($config));
diff -Nur /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/t/03.GnomePrintJob.t ./GnomePrint2/t/03.GnomePrintJob.t
--- /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/t/03.GnomePrintJob.t Thu Jan 1 01:00:00 1970
+++ ./GnomePrint2/t/03.GnomePrintJob.t Thu Aug 14 01:40:40 2003
@@ -0,0 +1,18 @@
+#########################
+# GnomePrint2 Tests
+# - ebb
+#########################
+
+#########################
+
+use Test::More tests => 3;
+BEGIN { use_ok('Gnome2::Print') };
+
+#########################
+
+$config = Gnome2::Print::Config->default;
+
+ok($job = Gnome2::Print::Job->new($config));
+
+$job->close;
+ok(1);
diff -Nur /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/t/04.GnomePrintDialog.t ./GnomePrint2/t/04.GnomePrintDialog.t
--- /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/t/04.GnomePrintDialog.t Thu Jan 1 01:00:00 1970
+++ ./GnomePrint2/t/04.GnomePrintDialog.t Thu Aug 14 02:19:48 2003
@@ -0,0 +1,24 @@
+#########################
+# GnomePrint2 Tests
+# - ebb
+#########################
+
+#########################
+
+use Test::More tests => 4;
+BEGIN { use_ok('Gnome2::Print') };
+
+#########################
+
+use Gtk2;
+Gtk2->init;
+
+$config = Gnome2::Print::Config->default;
+$job = Gnome2::Print::Job->new($config);
+
+ok( $dialog = Gnome2::Print::Dialog->new($job, "Test", 0) );
+
+$dialog->show;
+ok(1);
+
+ok( $res = $dialog->run );
diff -Nur /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/xs/GnomePrint2.xs ./GnomePrint2/xs/GnomePrint2.xs
--- /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/xs/GnomePrint2.xs Thu Jan 1 01:00:00 1970
+++ ./GnomePrint2/xs/GnomePrint2.xs Thu Aug 14 06:13:25 2003
@@ -0,0 +1,10 @@
+#include <gnome2perl.h>
+#include "gnomeprintperl.h"
+
+
+MODULE = Gnome2::Print PACKAGE = Gnome2::Print PREFIX = gnome_print_
+
+
+BOOT:
+#include "register.xsh"
+#include "boot.xsh"
diff -Nur /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/xs/GnomePrintConfig.xs ./GnomePrint2/xs/GnomePrintConfig.xs
--- /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/xs/GnomePrintConfig.xs Thu Jan 1 01:00:00 1970
+++ ./GnomePrint2/xs/GnomePrintConfig.xs Thu Aug 14 05:33:56 2003
@@ -0,0 +1,37 @@
+#include "gnomeprintperl.h"
+
+MODULE = Gnome2::Print::Config PACKAGE = Gnome2::Print::Config PREFIX = gnome_print_config_
+
+
+GnomePrintConfig_noinc *
+gnome_print_config_default (SV * class);
+ C_ARGS:
+ /* void */
+
+gchar *
+gnome_print_config_to_string (gpc, flags)
+ GnomePrintConfig * gpc
+ guint flags
+
+GnomePrintConfig_noinc *
+gnome_print_config_from_string (str, flags)
+ const gchar * str
+ guint flags
+
+void
+gnome_print_config_dump (gpc)
+ GnomePrintConfig * gpc
+
+gboolean
+gnome_print_config_get_page_size (gpc)
+ GnomePrintConfig * gpc
+ PREINIT:
+ gdouble width;
+ gdouble height;
+ PPCODE:
+ if (!gnome_print_config_get_page_size (gpc, &width, &height))
+ XSRETURN_EMPTY;
+
+ EXTEND (SP, 2);
+ PUSHs (sv_2mortal (newSVnv (width)));
+ PUSHs (sv_2mortal (newSVnv (height)));
diff -Nur /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/xs/GnomePrintContext.xs ./GnomePrint2/xs/GnomePrintContext.xs
--- /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/xs/GnomePrintContext.xs Thu Jan 1 01:00:00 1970
+++ ./GnomePrint2/xs/GnomePrintContext.xs Thu Aug 14 05:34:04 2003
@@ -0,0 +1,17 @@
+#include "gnomeprintperl.h"
+
+MODULE = Gnome2::Print::Context PACKAGE = Gnome2::Print::Context PREFIX = gnome_print_context_
+
+
+GnomePrintContext_noinc *
+gnome_print_context_new (class, config)
+ SV * class
+ GnomePrintConfig * config
+ C_ARGS:
+ config
+
+gint gnome_print_context_close (pc)
+ GnomePrintContext * pc
+
+gint gnome_print_context_create_transport (ctx)
+ GnomePrintContext * ctx
diff -Nur /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/xs/GnomePrintContextHelper.xs ./GnomePrint2/xs/GnomePrintContextHelper.xs
--- /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/xs/GnomePrintContextHelper.xs Thu Jan 1 01:00:00 1970
+++ ./GnomePrint2/xs/GnomePrintContextHelper.xs Thu Aug 14 05:58:41 2003
@@ -0,0 +1,214 @@
+/* This file is necessary, since all these functions, that are placed inside
+ * libgnomeprint/gnome-print.h, belong to GnomePrintContext.
+ */
+#include "gnomeprintperl.h"
+
+
+MODULE = Gnome2::Print::ContextHelper PACKAGE = Gnome2::Print::Context PREFIX = gnome_print_
+
+
+gint
+gnome_print_newpath (pc)
+ GnomePrintContext * pc
+
+gint
+gnome_print_moveto (pc, x, y)
+ GnomePrintContext * pc
+ gdouble x
+ gdouble y
+
+gint
+gnome_print_lineto (pc, x, y)
+ GnomePrintContext * pc
+ gdouble x
+ gdouble y
+
+gint
+gnome_print_curveto (pc, x1, y1, x2, y2, x3, y3)
+ GnomePrintContext * pc
+ gdouble x1
+ gdouble y1
+ gdouble x2
+ gdouble y2
+ gdouble x3
+ gdouble y3
+
+gint
+gnome_print_closepath (pc)
+ GnomePrintContext * pc
+
+gint
+gnome_print_strokepath (pc)
+ GnomePrintContext * pc
+
+##gint gnome_print_bpath (GnomePrintContext *pc, const ArtBpath *bpath, gboolean append)
+##gint gnome_print_vpath (GnomePrintContext *pc, const ArtVpath *vpath, gboolean append)
+
+gint
+gnome_print_arcto (pc, x, y, radius, angle1, angle2, direction)
+ GnomePrintContext * pc
+ gdouble x
+ gdouble y
+ gdouble radius
+ gdouble angle1
+ gdouble angle2
+ gint direction
+
+gint
+gnome_print_setrgbcolor (pc, r, g, b)
+ GnomePrintContext * pc
+ gdouble r
+ gdouble g
+ gdouble b
+
+gint
+gnome_print_setopacity (pc, opacity)
+ GnomePrintContext * pc
+ gdouble opacity
+
+gint
+gnome_print_setlinewidth (pc, width)
+ GnomePrintContext * pc
+ gdouble width
+
+gint
+gnome_print_setmiterlimit (pc, limit)
+ GnomePrintContext * pc
+ gdouble limit
+
+gint
+gnome_print_setlinejoin (pc, jointype)
+ GnomePrintContext * pc
+ gint jointype
+
+gint
+gnome_print_setlinecap (pc, captype)
+ GnomePrintContext * pc
+ gint captype
+
+##gint gnome_print_setdash (GnomePrintContext *pc, gint n_values, const gdouble *values, gdouble offset);
+
+gint
+gnome_print_setfont (pc, font)
+ GnomePrintContext * pc
+ GnomeFont * font
+
+gint
+gnome_print_clip (pc)
+ GnomePrintContext * pc
+
+gint
+gnome_print_eoclip (pc)
+ GnomePrintContext * pc
+
+##gint gnome_print_concat (GnomePrintContext *pc, const gdouble *matrix);
+
+gint
+gnome_print_scale (pc, sx, sy)
+ GnomePrintContext * pc
+ gdouble sx
+ gdouble sy
+
+gint
+gnome_print_rotate (pc, theta)
+ GnomePrintContext * pc
+ gdouble theta
+
+gint
+gnome_print_translate (pc, x, y)
+ GnomePrintContext * pc
+ gdouble x
+ gdouble y
+
+gint
+gnome_print_gsave (pc)
+ GnomePrintContext * pc
+
+gint
+gnome_print_grestore (pc)
+ GnomePrintContext * pc
+
+gint
+gnome_print_fill (pc)
+ GnomePrintContext * pc
+
+gint
+gnome_print_eofill (pc)
+ GnomePrintContext * pc
+
+gint
+gnome_print_stroke (pc)
+ GnomePrintContext * pc
+
+gint
+gnome_print_show (pc, text)
+ GnomePrintContext * pc
+ const guchar * text
+
+gint
+gnome_print_show_sized (pc, text, bytes)
+ GnomePrintContext * pc
+ const guchar * text
+ gint bytes
+
+gint
+gnome_print_glyphlist (pc, glyphlist)
+ GnomePrintContext * pc
+ GnomeGlyphList * glyphlist
+
+gint
+gnome_print_grayimage (pc, data, width, height, rowstride)
+ GnomePrintContext * pc
+ const guchar * data
+ gint width
+ gint height
+ gint rowstride
+
+gint
+gnome_print_rgbimage (pc, data, width, height, rowstride)
+ GnomePrintContext * pc
+ const guchar * data
+ gint width
+ gint height
+ gint rowstride
+
+gint
+gnome_print_rgbaimage (pc, data, width, height, rowstride)
+ GnomePrintContext * pc
+ const guchar * data
+ gint width
+ gint height
+ gint rowstride
+
+gint
+gnome_print_beginpage (pc, name)
+ GnomePrintContext * pc
+ const guchar * name
+
+gint
+gnome_print_showpage (pc)
+ GnomePrintContext * pc
+
+gint
+gnome_print_line_stroked (pc, x0, y0, x1, y1)
+ GnomePrintContext * pc
+ gdouble x0
+ gdouble y0
+ gdouble x1
+ gdouble y1
+
+gint
+gnome_print_rect_stroked (pc, x, y, width, height)
+ GnomePrintContext * pc
+ gdouble x
+ gdouble y
+ gdouble width
+ gdouble height
+
+gint
+gnome_print_rect_filled (pc, x, y, width, height)
+ GnomePrintContext * pc
+ gdouble x
+ gdouble y
+ gdouble width
+ gdouble height
diff -Nur /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/xs/GnomePrintDialog.xs ./GnomePrint2/xs/GnomePrintDialog.xs
--- /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/xs/GnomePrintDialog.xs Thu Jan 1 01:00:00 1970
+++ ./GnomePrint2/xs/GnomePrintDialog.xs Thu Aug 14 06:14:19 2003
@@ -0,0 +1,37 @@
+#include "gnomeprintperl.h"
+
+
+MODULE = Gnome2::Print::Dialog PACKAGE = Gnome2::Print::Dialog PREFIX = gnome_print_dialog_
+
+
+GtkWidget *
+gnome_print_dialog_new (class, gpj, title, flags)
+ SV * class
+ GnomePrintJob * gpj
+ const guchar * title
+ gint flags
+ C_ARGS:
+ gpj, title, flags
+
+GnomePrintConfig *
+gnome_print_dialog_get_config (gpd)
+ GnomePrintDialog *gpd
+
+void
+gnome_print_dialog_get_copies (gpd)
+ GnomePrintDialog *gpd
+ PREINIT:
+ gint copies;
+ gint collate;
+ PPCODE:
+ gnome_print_dialog_get_copies (gpd, &copies, &collate);
+
+ EXTEND (SP, 2);
+ PUSHs (sv_2mortal (newSVnv (copies)));
+ PUSHs (sv_2mortal (newSVnv (collate)));
+
+void
+gnome_print_dialog_set_copies (gpd, copies, collate)
+ GnomePrintDialog * gpd
+ gint copies
+ gint collate
diff -Nur /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/xs/GnomePrintJob.xs ./GnomePrint2/xs/GnomePrintJob.xs
--- /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/xs/GnomePrintJob.xs Thu Jan 1 01:00:00 1970
+++ ./GnomePrint2/xs/GnomePrintJob.xs Thu Aug 14 06:14:01 2003
@@ -0,0 +1,54 @@
+#include "gnomeprintperl.h"
+
+
+MODULE = Gnome2::Print::Job PACKAGE = Gnome2::Print::Job PREFIX = gnome_print_job_
+
+
+GnomePrintJob_noinc *
+gnome_print_job_new (class, config=NULL)
+ SV * class
+ GnomePrintConfig_ornull * config
+ C_ARGS:
+ config
+
+GnomePrintConfig_noinc *gnome_print_job_get_config (job)
+ GnomePrintJob * job
+
+GnomePrintContext_noinc * gnome_print_job_get_context (job)
+ GnomePrintJob * job
+
+gint gnome_print_job_close (job)
+ GnomePrintJob * job
+
+gint gnome_print_job_print (job)
+ GnomePrintJob * job
+
+gint gnome_print_job_render (job, ctx)
+ GnomePrintJob * job
+ GnomePrintContext * ctx
+
+gint
+gnome_print_job_render_page (job, ctx, page, pageops)
+ GnomePrintJob * job
+ GnomePrintContext * ctx
+ gint page
+ gboolean pageops
+
+gint gnome_print_job_get_pages (job)
+ GnomePrintJob * job
+
+gint gnome_print_job_print_to_file (GnomePrintJob *job, gchar *output);
+
+gboolean
+gnome_print_job_get_page_size (job)
+ GnomePrintJob * job
+ PREINIT:
+ gdouble width;
+ gdouble height;
+ PPCODE:
+ if (!gnome_print_job_get_page_size (job, &width, &height))
+ XSRETURN_EMPTY;
+
+ EXTEND (SP, 2);
+ PUSHs (sv_2mortal (newSVnv (width)));
+ PUSHs (sv_2mortal (newSVnv (height)));
diff -Nur /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/xs/GnomePrintJobPreview.xs ./GnomePrint2/xs/GnomePrintJobPreview.xs
--- /home/zefram/cvsroot/gtk2-perl-xs/GnomePrint2/xs/GnomePrintJobPreview.xs Thu Jan 1 01:00:00 1970
+++ ./GnomePrint2/xs/GnomePrintJobPreview.xs Thu Aug 14 06:14:11 2003
@@ -0,0 +1,13 @@
+#include "gnomeprintperl.h"
+
+
+MODULE = Gnome2::Print::JobPreview PACKAGE = Gnome2::Print::JobPreview PREFIX = gnome_print_job_preview_
+
+
+GtkWidget *
+gnome_print_job_preview_new (class, gpm, title)
+ SV * class
+ GnomePrintJob * gpm
+ const guchar * title
+ C_ARGS:
+ gpm, title
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]