rpc.cmsd: use TIRPC on Linux
[oweals/cde.git] / cde / programs / dtprintinfo / README
1 /* $XConsortium: README /main/2 1996/07/15 14:15:33 drk $ */
2 Directories:
3
4    libUI              - Contains base class for UI
5    libUI/MotifUI      - Contains Motif UI classes
6    UI                 - Subclasses of objects in libUI/MotifUI.  These objects
7                         define the UI for dtprintinfo.
8    objects            - Contains base class for objects
9    objects/PrintObj   - Contains print queue objects
10    util               - Contains utility classes
11    service            - No longer used
12
13 Actions
14
15  The following actions are defined in /usr/dt/appconfig/types/C/print.dt.
16
17    DtPrintManager - runs 'dtprintinfo -all'
18
19    DtPrint (no args) - runs the DtPrintinfo action
20
21    DtPrint (with args) - runs the Print action
22
23    DtPrintinfo (no args) - runs 'dtprintinfo' to show the LPDEST or
24                            default printer
25
26    DtPrintinfo (with args) - runs 'dtprintinfo -p <printer>' to show the
27                              specific printer
28
29  The default printer actions are defined in /etc/dt/appconfig/types/C by
30  running 'dtprintinfo -populate'.  There's a datatype (action definition)
31  file for each queue on the system name <printer>.dt.
32
33    <printer>_Print (no args) - runs the 'DtPrintinfo <printer>' action.
34
35    <printer>_Print (with args) - runs the 'Print' action.
36
37  Printer action files are created in $HOME/.dt/.Printers. These are empty
38  files named <printer>_Print and have the execute bit set.  They are the
39  action files that are supplied when a printer is dragged from Print Manager
40  to the File Manager or Front Panel.
41
42  The CreateActionFile function in UI/DtPrinterIcon.C creates the system action
43  definition files in /etc/dt/appconfig/types/$LANG and customized action 
44  definition in $HOME/.dt/types.  The Apply function in UI/DtPrtProps.C modifies
45  action definition in $HOME/.dt/types.
46
47 Drag-n-Drop
48
49    The guts of drag-n-drop (DND) is coded in the libUI/MotifUI/DtDND.C file.
50    Currently, only the DtFILENAME_TRANSFER protocol is used.  The printer
51    icons, DtPrinterIcon objects defined in UI/DtPrinterIcon.C, use the DtDND
52    class to handle files dropped on the printer icon and print job list box and
53    to handle dragging printers to other objects.  When a file is dropped on a
54    printer or print job list box, dtprintinfo receives a filename and when
55    a printer is dragged to an object, dtprintinfo supplies the filename of
56    the action file (Example: $HOME/.dt/.Printers/<printer>_Print).
57
58 Widgets
59
60    libUI/MotifUI/Icon.c - Custom icon widget used by the IconObj class defined
61                           in libUI/MotifUI/IconObj.C.
62
63    libUI/MotifUI/WorkArea.c - Custom container widget used by the Container
64                               class defined in libUI/MotifUI/Container.C.
65
66 Classes
67
68    There are 2 class hierarchies: an UI class hierarchy and a object class
69    hierarchy.  The Motif User Interface classes are defined in the
70    libUI/MotifUI directory.  The printer objects are defined in the
71    objects/PrintObj directory.  These classes are designed to be used as
72    libraries.
73
74 Action API's
75   
76    The DtPrinterIcon class uses the DtDbLoad, DtActionInvoke, DtDbReloadNotify,
77    DtActionExists, DtActionIcon, DtActionDescription, and DtActionLabel
78    functions.  The DtPrtProps class uses the DtActionInvoke function.  The 
79    Application class uses the DtDbLoad function.
80
81 Drag-n-Drop API's
82   
83    The DtDND class uses the XmDropSiteUpdate, XmDropSiteConfigureStackingOrder, 
84    DtDndDropRegister, and DtDndDragStart functions.
85
86 Remote Printer related API's
87
88    The ConnectToPrintServer function in objects/PrintObj/ParseJobs.C uses the
89    gethostbyname, gethostbyaddr, getservbyname, rresvport, and connect
90    functions to return a socket to a remote print server.
91    
92    The SendPrintJobStatusReguest function writes to the socket a request for
93    long format printer status.
94    
95    These two high level functions are called by the OpenClose function in
96    UI/DtApp.C and by the ProcessJobs function in objects/PrintObj/Queue.C
97    via the call to the RemotePrintJobs function in ParseJobs.C.
98
99    The RemotePrintJobs is a high level function that reads the socket for
100    the print status that's returned by the server.  This functions waits for
101    the output, thus it blocks the dtprintinfo process.  It is used during the
102    'Find Print Jobs' operation in the Print Manager version of dtprintinfo.
103
104    The OpenClose function in UI/DtApp.C uses the BaseUI->Thread function
105    function to gather the status returned by the print server so that the
106    dtprintinfo process does not block.  This is accomplished by using the
107    the fcntl function to set the O_NDELAY bit on the socket and then using the
108    socket as the file descriptor in the XtAppAddInput function.  Refer to the
109    CreateThread function in libUI/MotifUI/MotifThread.C.
110
111 Message Catalog
112
113    The message catalog uses symbolic tags and a MESSAGE macro that makes the
114    source code easier to read and modify.  When building dtprintinfo the
115    dtprintinfo_cat.h and dtprintinfo_msg.h header are automatically generated
116    by the sym2num script, gencat, and awk msg.awk script.  Here's a sample
117    output of creating the message header files.
118
119         rm -f dtprintinfo.cat dtprintinfo_msg.h dtprintinfo_cat.h
120         ./sym2num dtprintinfo dtprintinfo.msg > msg.tmp
121         gencat dtprintinfo.cat msg.tmp
122         awk -f msg.awk dtprintinfo.msg > dtprintinfo_cat.h
123         rm -f msg.tmp