On Tue, 12 Mar 2002, James Rich wrote:
> >
> > I found something strange -- I'll send you the SCS file, so you can
> > reproduce it...
>
> Okay, that should be fixed now. The scs file you sent doesn't have the
> spps code in it; it never sets the page size. scs2pdf had a default page
> size that worked for the old code but not the new stuff. So fixing the
> default helped. Then I noticed that the page size was being computed
> wrong because we used ints instead of floats. That's all working now,
> tested with the scs file you sent me.
Except that my page is 14"x11", but your default cuts it off at 8.5x11.
I wonder if we can guess at the page size by the number of columns of text
that are sent to us?
> Right, this is what I'm thinking, too. Almost like event-driven
> programming? Create callbacks, etc., or is that not what you mean?
That's exactly what I mean. Create a struct which contains pointers
to the different "event" functions. Then, call an "init" routine that
sets these pointers to the appropriate values.
Maybe something like:
struct _Tn5250DocFormatter {
int (* start_doc) (arg1, arg2, etc);
int (* start_page) (arg1, arg2, etc);
int (* add_text) (int x, int y, char *text);
int (* end_page) (etc);
int (* end_doc) (etc);
}
#define tn5250_docformatter_start_doc(This, arg1, arg2, etc) \
(* (This->start_doc) ((This),(arg1),(arg2),(etc))
and so on... See stream.h and stream.c as an example of where
we're using this sort of thing. It attaches the SSL stream object or the
Telnet stream object as appropriate.
>
> This latest diff is available at the usual place:
>
> http://www.eaerich.com/tn5250.diff
>
This should now be in CVS.
_______________________________________________
This is the Linux 5250 Development Project (LINUX5250) mailing list
To post a message email: [EMAIL PROTECTED]
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/linux5250
or email: [EMAIL PROTECTED]
Before posting, please take a moment to review the archives
at http://archive.midrange.com/linux5250.