danny@iconsys.UUCP (Danny Young) (10/21/87)
References: I would like to be able to look at the information in the PrinterExtendedData portion of the current Preference-chosen printer driver. My question is: Is there a way I can get to this data (through several levels of indirection) from the pointer returned to me by an OpenDevice("printer.device") command? The only other way I can think of is to ask Intuition for Preferences info, look at which printer is chosen, LoadSeg the printer driver, and get to it that way (ughh). Please reply by email. I get the distinct impression that this is an easy question, but I sure can't seem to find the answer in my RKM. If enough of you give me an indication that this is a non-trivial question, I'll post a summary of the answers. My project is to modify the program which catches all calls for DumpRPort (the name of the author escapes me) so that besides letting you change the arguments, it will suggest some intelligent alternatives based on the resolution of the printer being used. I CRAVE better printer output! While I'm on the subject, another possible solution that I can think of for better graphic text output is to crop all the vertical rows of dots from the RIGHT side of the picture that need to be removed rather than every so often in the middle of the picture. I don't mind knowing that part of my DPaint screen will not print out (and planning for that) so long as the part that does print out is pretty :^). In fact... #define WISH_LIST I would love it if every graphics program gave me the option to work in a drawing window whose resolution is a multiple (or factor) of the current preference printer's resolution. Or, let me finish my masterpiece on a full screen, but show me a preview of what the printer.device will do to it and let me doctor it up before it gets sent to the printer. Are any of these ideas feasible, or am I missing something? #undef WISH_LIST BTW, I have been a silent listener on this net for a long time and I really appreciate everything all of you have contributed. ------------------------------------------ -- Daniel A. Young uunet!iconsys!danny Icon International, Inc. {ihnp4,psivax}!nrcvax!nrc-ut!iconsys!danny Orem, Utah 84058 ARPANET: icon%byuadam.bitnet@wiscvm.wisc.edu (801) 225-6888 BITNET: icon%byuadam.bitnet
carolyn@cbmvax.UUCP (10/30/87)
In article <186@iconsys.UUCP> danny@iconsys.UUCP (Danny Young) writes: >I would like to be able to look at the information in the >PrinterExtendedData portion of the current Preference-chosen >printer driver. > >My question is: Is there a way I can get to this data (through >several levels of indirection) from the pointer returned to me >by an OpenDevice("printer.device") command? ------------------------------------------------------------------------- Fragment of code for accessing printertag and printer prefs. ... #include exec/ports.h #include exec/io.h #include intuition/intuition.h #include devices/printer.h #include devices/prtbase.h ... union printerIO { struct IOStdReq ios; struct IODRPReq iodrp; struct IOPrtCmdReq iopc; }; union printerIO *request; struct MsgPort *printerPort; struct PrinterData *pdata; struct Preferences *prefs; int error; ... main { ... (libraries, init, etc) printerPort = (struct MsgPort *)CreatePort("myPrtPort",0); ... (error checking) request = (union printerIO *)CreateExtIO(printerPort, sizeof(union printerIO)); error = OpenDevice("printer.device",0,request,0) ... (error checking) pdata = (struct PrinterData *)request->ios.io_Device; prefs = (struct Preferences *)&pdata->pd_Preferences; /* Giving you ptr to PrinterData structure and printer device's copy of Preferences in that structure */ printf("Prefs color0 = %x\n",prefs->color0); printf("NumRows = %x\n",pdata->pd_SegmentData->ps_PED.ped_NumRows); /* Last line prints one of the values from the printertag data */ ... } -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Carolyn Scheppner -- CATS >>Commodore Amiga Technical Support<< UUCP ...{allegra,ihnp4,rutgers}!cbmvax!carolyn PHONE 215-431-9180 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=