After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 102226 - libgnomeprint / libgnomeprintui bindings
libgnomeprint / libgnomeprintui bindings
Status: RESOLVED FIXED
Product: gnome-python-desktop
Classification: Deprecated
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Python bindings maintainers
Python bindings maintainers
Depends on: 103371
Blocks:
 
 
Reported: 2002-12-30 16:30 UTC by Johan (not receiving bugmail) Dahlin
Modified: 2006-02-07 12:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for configure.in/Makefile.am (2.89 KB, patch)
2003-01-02 14:27 UTC, Gustavo Carneiro
none Details | Review
The gnome/print directory with the libgnomeprint[ui] bindings (16.01 KB, application/octet-stream)
2003-01-02 14:29 UTC, Gustavo Carneiro
  Details
All changes except new files in gnome/print (2.89 KB, patch)
2003-01-13 12:12 UTC, Gustavo Carneiro
none Details | Review
The gnome/print directory (80.00 KB, application/x-tar)
2003-01-13 12:13 UTC, Gustavo Carneiro
  Details
Final touches for the gnomeprint module (2.86 KB, patch)
2003-01-15 15:10 UTC, Gustavo Carneiro
none Details | Review

Description Johan (not receiving bugmail) Dahlin 2002-12-30 16:30:41 UTC
We are currently missing libgnomeprint and libgnomeprintui bindings.

They should be placed under the namespace:

gnome.print
gnome.print.Font for example

What about libgnomeprintui?
gnome.print.ui or gnome.printui ?

In bonobo is bonobo.ui, but it's only two levels.

Maybe move to a seperate directory gnomeprint?
Comment 1 Gustavo Carneiro 2003-01-02 14:26:54 UTC
  I have create gnomeprint and gnomeprintui bindings. They're not
complete, but most important stuff is there and working.
  I'm attaching my changes; I hope they get committed...
  Cheers.
Comment 2 Gustavo Carneiro 2003-01-02 14:27:47 UTC
Created attachment 13313 [details] [review]
Patch for configure.in/Makefile.am
Comment 3 Gustavo Carneiro 2003-01-02 14:29:02 UTC
Created attachment 13314 [details]
The gnome/print directory with the libgnomeprint[ui] bindings
Comment 4 Gustavo Carneiro 2003-01-02 14:36:56 UTC
I forgot my "release notes" :)

1. I didn't wrap any functions involving plain structure datatypes.
This includes libart_lgpl types, GnomePrintUnit and GnomeGlyphList;
Eventually:
    o libart_lgpl should register boxed types and have python bindings;
    o GnomePrintUnit and GnomeGlyphList should register as boxed types
or GObject, but that should be done on libgnomeprint itself.

2. The implemented namespace is gnomeprint and gnomeprint.ui. I tried
using the gnome.print namespace, but the python parser doesn't allow
that since 'print' is a python keyword;

3. I didn't wrap page callbacks because I have a feeling you guys will
want to use the _closure version, and I honestly don't understand
closures very well. Maybe someone else will complete this?...
Comment 5 Gustavo Carneiro 2003-01-10 15:00:13 UTC
It's been a while and I got no feedback in my last patch. Anything
else I can do? Maybe I could commit this if the maintainers would give
me permission? :)
I am already using these bindings in my project, and they're working
great...
Comment 6 Johan (not receiving bugmail) Dahlin 2003-01-10 15:28:59 UTC
Okay, some feedback.

1) Please submit as a diff against current cvs, use -N to include new
files, not known by cvs.
2) Don't include backups or Makefile.am
3) Remove the linker hacks in __init__.py, It's the wrong way of
solving the problem. Make sure libgnomeprint[ui] (both the libraries
and bindings) are linked against all libraries they use symbols from
instead.
4) You don't need register bonobo.defs in Makefile.am
5) You currently require a version of libgnomeprint[ui] that's not
included in gnome 2.0 (it's in 2.1/2.2/CVS). The current policy has
been to always use gnome 2.0 libraries and not 2.2. At some point in
the future we will branch (most probably post pygtk-2.0) and start to
update all the bindings against 2.2. If it's not possible to use the
2.0 libraries you're bindings will have to wait until we branch i am
afraid.
5) Is it possible to create bindings for Libart_lgpl so we can get a
more complete wrapping of libgnomeprint?
6) For information about how to wrap closures, look in pygtk's source
code.
7) Don't remove functions/comment things in the .defs file, add ignore
statements in your .override instead. This makes the .defs file
general and .override specific to the python bindings.
8) pyprintui_add_defined_constants in printmodele/uimodule.c can be
made better. There are functions for adding consts to a module look in
modsupport.h in your python distribution. An even better solution
would be to pester the libgnomeprint[ui] maintainers to include ENUMs
by default. Most libraries doesn't do this, (but gtk+ and friend does)
but filing a bug report upstream never hurts.
9) Maybe rename to printmodule.c/printuimodule.c so we don't confuse
with the uimodule in gnome. (which probably could be rename to gnomeui
too)
10) the macros in print.override/printui.override does not belong in
the python bindings, should go upstream.
11) In the defs file you can specify default parameters for functions,
so use it instead of | in PyArg_ParseTuple (as in
O!|i:GnomePaperSelector.__init_)

Apart from that the bindings looks good, complete with lots of
functions wrapped.
Try to resolv the issues i mentioned above and submitt an new
attachment as diff (not .tar.gz) so i can view it directly in my web
browser.
Comment 7 Gustavo Carneiro 2003-01-10 16:18:32 UTC
So much feedback in so little time! :)
My comments on the issues:

1) I didn't know about cvs diff -N, otherwise I would had sent as diff
instead of tgz. Sorry!
2) Don't you mean to not include Makefile.in instead of Makefile.am?
3) I think the problem is that the gnomeprint modules are not linked
to libgnomeprint itself. I was trying not to touch libgnomeprint[ui],
but I guess it won't be possible;
4) ok, I'll fix that.
5) libgnomeprint[ui] 2.2 has some incompatible changes to 2.0. I would
prefer to use only 2.2. The roadmap points for a gnome 2.2 initial
release at the end of this month. Any planned date for pygtk branching?
5*) Wrapping libart_lgpl would require registering boxed types. Since
libart_lgpl doesn't link to glib, that would have to be done inside
gnome-python.
7-9) ok
10) Those macros should belong in some header file, but instead were
moved to the corresponding C file; I have no idea why.
11) good! Didn't know that :-)

I already knew there was still plenty to do, this initial patch was
only to "break the ice" and get things moving. I'll try to improve it,
this weekend.
Comment 8 James Henstridge 2003-01-11 11:32:41 UTC
Ignoring libgnomeprint-2.0 is a good idea.  There were some things in
2.0 that made language bindings difficult.  Sounds like there are some
other problems too (the enum problems Johan brought up).
Comment 9 Johan (not receiving bugmail) Dahlin 2003-01-11 13:11:10 UTC
So, if we're ignoring 2.0 and going for 2.2, should the gnomeprint
bindings wait until gnome-python 2.2 branching or included together
with the other 2.0 bindings?
If so, should we upgrade gnome, bonobo and friends to 2.2?
Comment 10 Gustavo Carneiro 2003-01-13 12:10:50 UTC
  I think I solved most issues reported by jdahlin. In the end, I came
up with 100% complete set of libgnomeprint[ui] bindings! ;-)
  Problems remaining:

1) It still targets libgnomeprint[ui]-2.2, not 2.0. For what I can
see, the differences from 2.0 to 2.2 are:
    a) s/GnomePrintMaster/GnomePrintJob/
    b) Some functions from 2.0 are missing in 2.2. For example, now
you cannot create a GnomePrintDialog without passing in a GnomePrintJob.
   I still think it is best to target 2.2 only, if possible.

2) Well, there are some const related warnings I couldn't get rid of.
Well, I could get rid of them, but I would need to override some
functions just because of them.

3) These bindings depend on bug #103371.

  Please don't forget to give me some feedback. Thanks!
  PS: cvs diff -N doesn't work because 'gnome/print' there is a new
directory. I'll attach a patch file and a tar file. Sorry!
Comment 11 Gustavo Carneiro 2003-01-13 12:12:06 UTC
Created attachment 13526 [details] [review]
All changes except new files in gnome/print
Comment 12 Gustavo Carneiro 2003-01-13 12:13:20 UTC
Created attachment 13527 [details]
The gnome/print directory
Comment 13 James Henstridge 2003-01-14 07:46:25 UTC
Talked with Chema on IRC today.  He has just released libgnomeprint
2.1.8, which includes Gustavo's patches which should make it easier to
move forward.
Comment 14 Johan (not receiving bugmail) Dahlin 2003-01-14 16:03:54 UTC
I tried the latest patch, it looks much better, but i could not build
it. I'm using the latest CVS.

print.c: In function `_wrap_gnome_glyphlist_duplicate':
print.c:619: `GNOME_TYPE_GLYPHLIST' undeclared (first use in this
function)
print.c:619: (Each undeclared identifier is reported only once
print.c:619: for each function it appears in.)
print.c: In function `_wrap_gnome_print_config_get':
print.c:890: warning: implicit declaration of function
`GNOME_PRINT_CONFIG'
print.c:890: warning: passing arg 1 of `gnome_print_config_get' makes
pointer from integer without a cast

Btw, you forgot to AC_SUBST the variables in configure.in and do not
include -I$(topsrc_dir)/libart_lgpl in the Makefiles
Comment 15 Gustavo Carneiro 2003-01-14 16:27:03 UTC
Regarding AC_SUBST, I didn't include it because I don't understand why
all those AC_SUBST's are necessary, since PKG_CHECK_MODULES already
does AC_SUBST.

About -I$(topsrc_dir)/libart_lgpl, sorry, I had an initial idea of
making a 'art' python module, then changed my mind and forgot to
remove that include.

You are not able to compile because of #103371. You need to update
your copy if libgnomeprint and install it.
Comment 16 Johan (not receiving bugmail) Dahlin 2003-01-14 21:45:50 UTC
So, i managed to compile with latest libgnomeprint[ui], but i get this
error when i'm trying to import, i don't know if it's your/pygobject
or libgnomeprints fault.

>>> import gnomeprint

(process:6364): GLib-GObject-CRITICAL **: file gboxed.c: line 310
(g_boxed_type_register_static): assertion `boxed_copy != NULL' failed

** (process:6364): CRITICAL **: file pygboxed.c: line 135
(pyg_register_boxed): assertion `boxed_type != 0' failed

Btw, renamed gnome/print to gnomeprint and checked in everything into
CVS. 
Comment 17 James Henstridge 2003-01-15 03:22:24 UTC
Just reopenned the dependent gnomeprint bug.  The registration for the
GnomePrintUnit type passes NULL for the copy/free functions, which
sounds like the cause of the above.
Comment 18 Gustavo Carneiro 2003-01-15 10:37:52 UTC
Just for the record, my original patch that I attached to #103371 used
empty functions for GBoxedCopy/GBoxedFree; Chema thought of
simplifying the code a bit by passing NULL instead. I didn't know that
NULL didn't work, so I said nothing. I *do* test my patches
(minimally) before sending them to bugzilla, rest assured.
Comment 19 Gustavo Carneiro 2003-01-15 15:10:17 UTC
Created attachment 13588 [details] [review]
Final touches for the gnomeprint module
Comment 20 Gustavo Carneiro 2003-01-15 15:11:30 UTC
Please consider committing this last patch. After that, I think we can
finally close this bug. :-)
Comment 21 Johan (not receiving bugmail) Dahlin 2003-01-15 19:12:36 UTC
So, checked in.
To compile without warning the bindings depends on bug 103589

Many thanks Gustavo, you rock!

-> marking FIXED
Comment 22 Gustavo Carneiro 2006-02-07 12:02:28 UTC
mass reassign...