[Top][All Lists]

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

[XForms] Some requests

From: LukenShiro
Subject: [XForms] Some requests
Date: Sun, 27 Dec 2009 16:52:46 +0100

Hello Jens and everyone,

I would have some requests that would seem to ease my python porting
work if it was technically possible, but only if it doesn't cause too
much hassle to you, Jens, and if it doesn't have any backward
incompatibility issues.

1) FL_OBJECT unique identifier for comparison.

In XForms a user can use "if obj == exitbutton" to allow comparison
 between two FL_OBJECTs (where obj is the product of fl_do_forms(), and
 exitbutton is the product of fl_add_button(...)).

ctypes (the library I use to wrap XForms in python) uses
different created instances of FL_OBJECT class (equivalent of C
FL_OBJECT struct), so a simple comparison using "if _obj_ ==
_anotherobj_" is not useful (that is: comparison always fails).

In order to resolve this problem I have used .u_ldata assigning to it a
 unique value for a particular Object, so I could compare .u_ldata
 FL_OBJECT element with another one.
Nonetheless, as .u_ldata element could be maybe used for other purposes
by users, I'd ask for another (new) element in FL_OBJECT struct (maybe
something like .u_uid, of 'int' type).

2) I've noticed in XForms .h headers (i.e. #define macros) and in .c
demos several references to X11 libraries functions.

While XForms functions are meant to be only called by ctypes prototypes
(so I don't have to deal with internal implementation), macros have to
be trasposed completely in python code, explicitly wrapping X11
libraries, too.

As my intention was to wrap XForms libraries only, I'd ask if it was
possible to transform macros containing X11 functions into
corresponding functions.
I'm referring to:

 #define fl_create_from_bitmapdata( win, data, w, h )  \
    XCreateBitmapFromData( fl_get_display( ), win, ( char * ) data, w,
    h )

 #define fl_free_pixmap( id )                  \
    do { if ( id != None )                    \
             XFreePixmap( fl_display, id );   \
    } while( 0 )

 #define fl_raise_form( f )                          \
    do { if ( f->window )                            \
             XRaiseWindow( fl_display, f->window );  \
    } while( 0 )

 #define fl_lower_form( f )                          \
    do { if ( f->window )                            \
             XLowerWindow( fl_display, f->window );  \
    } while( 0 )

 #define fl_set_foreground( gc, c )   \
    XSetForeground( fl_display, gc, fl_get_pixel( c ) )

 #define fl_set_background( gc, c )   \
    XSetBackground( fl_display, gc, fl_get_pixel( c ) )

From examples in demos, the same happens for:

demos/minput2.c:63 and 102
 XFlush( fl_get_display( ) );

Thank you in advance. Regards.

GNU/Linux * Slackware64 current
Slackware 13.0-32bit VM
LU #210970 SU #12583 LM #98222/#412913

reply via email to

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