1 /************************************************************************/
2 /*									*/
3 /*  Page Layout page on an inspector:					*/
4 /*									*/
5 /************************************************************************/
6 
7 #   include	"appFrameConfig.h"
8 
9 #   include	<stdio.h>
10 #   include	<stddef.h>
11 #   include	<limits.h>
12 
13 #   include	<appUnit.h>
14 
15 #   include	"appFrame.h"
16 #   include	"appPageLayoutTool.h"
17 #   include	"guiWidgetDrawingSurface.h"
18 #   include	"guiDrawingWidget.h"
19 #   include	"guiDrawPage.h"
20 #   include	"guiToolUtil.h"
21 #   include	"guiTextUtil.h"
22 
23 #   include	<appDebugon.h>
24 
25 #   define	DRH_MM		32
26 
27 /************************************************************************/
28 /*									*/
29 /*  Refresh the section page.						*/
30 /*									*/
31 /************************************************************************/
32 
appPageLayoutRefreshPageLayoutPage(PageLayoutTool * plt)33 static void appPageLayoutRefreshPageLayoutPage(	PageLayoutTool *	plt )
34     {
35     EditApplication *		ea= plt->pltApplication;
36     DocumentGeometry *		dg= &(plt->pltGeometryChosen);
37 
38     appPaperChooserAdaptToGeometry( &(plt->pltPaperChooser), dg );
39 
40     appMarginToolShowMargins( &(plt->pltMarginTool), plt->pltUnitType, dg );
41 
42     guiExposeDrawingWidget( plt->pltPageDrawing );
43 
44     if  ( plt->pltHeaderPositionText )
45 	{
46 	appLengthToTextWidget( plt->pltHeaderPositionText,
47 				dg->dgHeaderPositionTwips, ea->eaUnitInt );
48 	}
49 
50     if  ( plt->pltFooterPositionText )
51 	{
52 	appLengthToTextWidget( plt->pltFooterPositionText,
53 				dg->dgFooterPositionTwips, ea->eaUnitInt );
54 	}
55 
56     if  ( plt->pltHeaderFooterFrame )
57 	{
58 	guiEnableWidget( plt->pltHeaderFooterFrame,
59 		    plt->pltCanChangeSelection || plt->pltCanChangeDocument );
60 
61 	guiEnableText( plt->pltHeaderPositionText,
62 		    plt->pltCanChangeSelection || plt->pltCanChangeDocument );
63 	guiEnableText( plt->pltFooterPositionText,
64 		    plt->pltCanChangeSelection || plt->pltCanChangeDocument );
65 	}
66 
67     appEnablePaperChooser( &(plt->pltPaperChooser),
68 		    plt->pltCanChangeSelection || plt->pltCanChangeDocument );
69     appEnableMarginTool( &(plt->pltMarginTool),
70 		    plt->pltCanChangeSelection || plt->pltCanChangeDocument );
71 
72     if  ( plt->pltChangeSelectionWidget )
73 	{
74 	guiEnableWidget( plt->pltChangeSelectionWidget,
75 						plt->pltCanChangeSelection );
76 	}
77     if  ( plt->pltRevertSelectionWidget )
78 	{
79 	guiEnableWidget( plt->pltRevertSelectionWidget,
80 						plt->pltCanChangeSelection );
81 	}
82     if  ( plt->pltChangeDocumentWidget )
83 	{
84 	guiEnableWidget( plt->pltChangeDocumentWidget,
85 						plt->pltCanChangeDocument );
86 	}
87     if  ( plt->pltRevertDocumentWidget )
88 	{
89 	guiEnableWidget( plt->pltRevertDocumentWidget,
90 						plt->pltCanChangeDocument );
91 	}
92 
93     return;
94     }
95 
appPageLayoutPageRefresh(PageLayoutTool * plt,InspectorSubject * is,const DocumentGeometry * dgSect,const DocumentGeometry * dgDoc)96 void appPageLayoutPageRefresh(	PageLayoutTool *		plt,
97 				InspectorSubject *		is,
98 				const DocumentGeometry *	dgSect,
99 				const DocumentGeometry *	dgDoc )
100     {
101     if  ( plt->pltManageSelection && dgSect )
102 	{
103 	plt->pltGeometryChosen= *dgSect;
104 	plt->pltGeometrySetSelection= *dgSect;
105 	plt->pltGeometrySetDocument= *dgDoc;
106 	}
107     else{
108 	plt->pltGeometryChosen= *dgDoc;
109 	plt->pltGeometrySetSelection= *dgDoc;
110 	plt->pltGeometrySetDocument= *dgDoc;
111 	}
112 
113     appPageLayoutRefreshPageLayoutPage( plt );
114 
115     return;
116     }
117 
118 /************************************************************************/
119 /*									*/
120 /*  The 'Change' button of the row tool has been pushed.		*/
121 /*									*/
122 /************************************************************************/
123 
appPageLayoutChangeLayout(PageLayoutTool * plt,int wholeDocument)124 static void appPageLayoutChangeLayout(	PageLayoutTool *	plt,
125 					int			wholeDocument )
126     {
127     EditApplication *		ea= plt->pltApplication;
128     EditDocument *		ed= ea->eaCurrentDocument;
129 
130     int				changed;
131 
132     PropertyMask		sizeUpdMask;
133     PropertyMask		margUpdMask;
134     PropertyMask		margChgMask;
135     PropertyMask		setMask;
136 
137     DocumentGeometry		dgNew;
138 
139     const int			minValue= 1;
140     const int			adaptToMin= 0;
141     const int			maxValue= INT_MAX;
142     const int			adaptToMax= 0;
143 
144     if  ( ! ed )
145 	{ XDEB(ed); return;	}
146 
147     utilPropMaskClear( &sizeUpdMask );
148     utilPropMaskClear( &margUpdMask );
149 
150     utilPropMaskClear( &setMask );
151     utilPropMaskFill( &setMask, DGprop_COUNT );
152 
153     utilInitDocumentGeometry( &dgNew );
154 
155     dgNew= plt->pltGeometryChosen;
156 
157     if  ( appPaperChooserGetSize( &sizeUpdMask, &(plt->pltPaperChooser),
158 								    &dgNew ) )
159 	{ LDEB(1); return;	}
160 
161     utilPropMaskClear( &margChgMask );
162     utilPropMaskFill( &margChgMask, DGprop_COUNT );
163 
164     if  ( appMarginToolGetMargins( &margUpdMask, &margChgMask, plt->pltUnitType,
165 					     &(plt->pltMarginTool), &dgNew ) )
166 	{ return;	}
167 
168     if  ( appMarginToolCheckMargins( &dgNew ) )
169 	{ return;	}
170 
171     if  ( plt->pltManageHeadersFooters )
172 	{
173 	if  ( appGetLengthFromTextWidget( plt->pltHeaderPositionText,
174 			    &(dgNew.dgHeaderPositionTwips),
175 			    &changed, ea->eaUnitInt,
176 			    minValue, adaptToMin, maxValue, adaptToMax ) )
177 	    { return;	}
178 
179 	if  ( appGetLengthFromTextWidget( plt->pltFooterPositionText,
180 			    &(dgNew.dgFooterPositionTwips),
181 			    &changed, ea->eaUnitInt,
182 			    minValue, adaptToMin, maxValue, adaptToMax ) )
183 	    { return;	}
184 	}
185     else{
186 	PROPmaskUNSET( &setMask, DGpropHEADER_POSITION );
187 	PROPmaskUNSET( &setMask, DGpropFOOTER_POSITION );
188 	}
189 
190     (*ea->eaSetPageLayout)( ed, &setMask, &dgNew, wholeDocument );
191 
192     return;
193     }
194 
APP_BUTTON_CALLBACK_H(appPageLayoutChangeSelectionPushed,w,voidplt)195 static APP_BUTTON_CALLBACK_H( appPageLayoutChangeSelectionPushed, w, voidplt )
196     {
197     PageLayoutTool *	plt= (PageLayoutTool *)voidplt;
198     const int		wholeDocument= 0;
199 
200     appPageLayoutChangeLayout( plt, wholeDocument );
201     }
202 
APP_BUTTON_CALLBACK_H(appPageLayoutChangeDocumentPushed,w,voidplt)203 static APP_BUTTON_CALLBACK_H( appPageLayoutChangeDocumentPushed, w, voidplt )
204     {
205     PageLayoutTool *	plt= (PageLayoutTool *)voidplt;
206     const int		wholeDocument= 1;
207 
208     appPageLayoutChangeLayout( plt, wholeDocument );
209     }
210 
appSectHeaderFooterPosChanged(PageLayoutTool * plt,APP_WIDGET w)211 static void appSectHeaderFooterPosChanged(	PageLayoutTool *	plt,
212 						APP_WIDGET		w )
213     {
214     EditApplication *		ea= plt->pltApplication;
215     DocumentGeometry *		dgSect= &(plt->pltGeometryChosen);
216 
217     int				width;
218     int				changed;
219 
220     const int			minValue= 1;
221     const int			adaptToMin= 0;
222     const int			maxValue= INT_MAX;
223     const int			adaptToMax= 0;
224 
225     if  ( w == plt->pltHeaderPositionText )
226 	{ width= dgSect->dgHeaderPositionTwips;	}
227     if  ( w == plt->pltFooterPositionText )
228 	{ width= dgSect->dgFooterPositionTwips;	}
229 
230     if  ( ! appGetLengthFromTextWidget( w, &width, &changed, ea->eaUnitInt,
231 				minValue, adaptToMin, maxValue, adaptToMax ) )
232 	{
233 	appLengthToTextWidget( w, width, ea->eaUnitInt );
234 	}
235     }
236 
APP_TXTYPING_CALLBACK_H(appSectHeaderPositionChanged,w,voidplt)237 static APP_TXTYPING_CALLBACK_H( appSectHeaderPositionChanged, w, voidplt )
238     {
239     PageLayoutTool *		plt= (PageLayoutTool *)voidplt;
240 
241     appSectHeaderFooterPosChanged( plt, plt->pltHeaderPositionText );
242 
243     return;
244     }
245 
APP_TXTYPING_CALLBACK_H(appSectFooterPositionChanged,w,voidplt)246 static APP_TXTYPING_CALLBACK_H( appSectFooterPositionChanged, w, voidplt )
247     {
248     PageLayoutTool *		plt= (PageLayoutTool *)voidplt;
249 
250     appSectHeaderFooterPosChanged( plt, plt->pltFooterPositionText );
251 
252     return;
253     }
254 
255 /************************************************************************/
256 /*									*/
257 /*  One of the margins has been changed by the user.			*/
258 /*									*/
259 /************************************************************************/
260 
APP_TXACTIVATE_CALLBACK_H(appPaperMarginChanged,w,voidplt)261 static APP_TXACTIVATE_CALLBACK_H( appPaperMarginChanged, w, voidplt )
262     {
263     PageLayoutTool *		plt= (PageLayoutTool *)voidplt;
264     DocumentGeometry *		dgSect= &(plt->pltGeometryChosen);
265 
266     PropertyMask		dgUpdMask;
267     PropertyMask		dgChgMask;
268 
269     DocumentGeometry		dg;
270 
271     utilPropMaskClear( &dgUpdMask );
272     utilPropMaskClear( &dgChgMask );
273 
274     dg= *dgSect;
275 
276     utilPropMaskFill( &dgChgMask, DGprop_COUNT );
277 
278     if  ( appMarginToolGetMargins( &dgUpdMask, &dgChgMask,
279 			    plt->pltUnitType, &(plt->pltMarginTool), &dg ) )
280 	{ return;	}
281 
282     if  ( utilPropMaskIsEmpty( &dgUpdMask ) )
283 	{ return;	}
284 
285     if  ( appMarginToolCheckMargins( &dg ) )
286 	{ return;	}
287 
288     dgSect->dgLeftMarginTwips= dg.dgLeftMarginTwips;
289     dgSect->dgTopMarginTwips= dg.dgTopMarginTwips;
290     dgSect->dgRightMarginTwips= dg.dgRightMarginTwips;
291     dgSect->dgBottomMarginTwips= dg.dgBottomMarginTwips;
292 
293     guiExposeDrawingWidget( plt->pltPageDrawing );
294 
295     return;
296     }
297 
298 /************************************************************************/
299 /*									*/
300 /*  The 'Revert' button of the row tool has been pushed.		*/
301 /*									*/
302 /************************************************************************/
303 
APP_BUTTON_CALLBACK_H(appPageLayoutRevertSelectionPushed,w,voidplt)304 static APP_BUTTON_CALLBACK_H( appPageLayoutRevertSelectionPushed, w, voidplt )
305     {
306     PageLayoutTool *	plt= (PageLayoutTool *)voidplt;
307 
308     plt->pltGeometryChosen= plt->pltGeometrySetSelection;
309 
310     appPageLayoutRefreshPageLayoutPage( plt );
311 
312     return;
313     }
314 
APP_BUTTON_CALLBACK_H(appPageLayoutRevertDocumentPushed,w,voidplt)315 static APP_BUTTON_CALLBACK_H( appPageLayoutRevertDocumentPushed, w, voidplt )
316     {
317     PageLayoutTool *	plt= (PageLayoutTool *)voidplt;
318 
319     plt->pltGeometryChosen= plt->pltGeometrySetDocument;
320 
321     appPageLayoutRefreshPageLayoutPage( plt );
322 
323     return;
324     }
325 
326 /************************************************************************/
327 /*									*/
328 /*  Draw a schematic view of the page.					*/
329 /*									*/
330 /************************************************************************/
331 
APP_EVENT_HANDLER_H(appPageLayoutToolDrawPage,w,voidplt,exposeEvent)332 static APP_EVENT_HANDLER_H( appPageLayoutToolDrawPage, w, voidplt, exposeEvent )
333     {
334     PageLayoutTool *		plt= (PageLayoutTool *)voidplt;
335     DrawingSurface		ds= plt->pltDrawingSurface;
336     DocumentGeometry *		dg= &(plt->pltGeometryChosen);
337 
338     appDrawPageDiagram( w, ds, &(plt->pltBackgroundColor),
339 						    plt->pltPixelsPerTwip, dg );
340     }
341 
342 /************************************************************************/
343 /*									*/
344 /*  A paper size was chosen.						*/
345 /*									*/
346 /************************************************************************/
347 
appPageLayoutToolPaperRectChanged(PaperChooser * pc,void * voidplt,const DocumentGeometry * dg)348 static void appPageLayoutToolPaperRectChanged(
349 				PaperChooser *			pc,
350 				void *				voidplt,
351 				const DocumentGeometry *	dg )
352     {
353     PageLayoutTool *		plt= (PageLayoutTool *)voidplt;
354 
355     plt->pltGeometryChosen.dgPageWideTwips= dg->dgPageWideTwips;
356     plt->pltGeometryChosen.dgPageHighTwips= dg->dgPageHighTwips;
357 
358     guiExposeDrawingWidget( plt->pltPageDrawing );
359 
360     return;
361     }
362 
363 /************************************************************************/
364 /*									*/
365 /*  Make the frame for the header and footer positions.			*/
366 /*									*/
367 /************************************************************************/
368 
appPageLayoutMakeHeaderFooterWidgets(APP_WIDGET parent,const PageLayoutPageResources * plpr,PageLayoutTool * plt)369 static void appPageLayoutMakeHeaderFooterWidgets(
370 				APP_WIDGET			parent,
371 				const PageLayoutPageResources *	plpr,
372 				PageLayoutTool *		plt )
373     {
374     APP_WIDGET	label;
375     APP_WIDGET	row;
376 
377     const int	colspan= 1;
378 
379     appMakeRowFrameInColumn( &(plt->pltHeaderFooterFrame),
380 					&(plt->pltHeaderFooterInside),
381 					parent, 2, plpr->plprPositionsText );
382 
383     appMakeColumnInRow( &(plt->pltHeaderFooterLeftColumn),
384 				    plt->pltHeaderFooterInside, 0, colspan );
385 
386     appMakeColumnInRow( &(plt->pltHeaderFooterRightColumn),
387 				    plt->pltHeaderFooterInside, 1, colspan );
388 
389     /**********************/
390 #   define	TW	7
391 
392     guiToolMakeLabelAndTextRow( &row, &label, &(plt->pltHeaderPositionText),
393 				    plt->pltHeaderFooterLeftColumn,
394 				    plpr->plprHeaderPositionText, TW, 1 );
395 
396     guiToolMakeLabelAndTextRow( &row, &label, &(plt->pltFooterPositionText),
397 				    plt->pltHeaderFooterRightColumn,
398 				    plpr->plprFooterPositionText, TW, 1 );
399 
400     appGuiSetGotValueCallbackForText( plt->pltHeaderPositionText,
401 				appSectHeaderPositionChanged, (void *)plt );
402 
403     appGuiSetGotValueCallbackForText( plt->pltFooterPositionText,
404 				appSectFooterPositionChanged, (void *)plt );
405 
406     return;
407     }
408 
409 /************************************************************************/
410 /*									*/
411 /*  Make a page layout page in an inspector tool.			*/
412 /*									*/
413 /************************************************************************/
414 
appPageLayoutPageFillPage(PageLayoutTool * plt,int doHdFt,int doSelection,const PageLayoutPageResources * plpr,InspectorSubject * is,APP_WIDGET pageWidget,const InspectorSubjectResources * isr)415 void appPageLayoutPageFillPage(	PageLayoutTool *		plt,
416 				int				doHdFt,
417 				int				doSelection,
418 				const PageLayoutPageResources *	plpr,
419 				InspectorSubject *		is,
420 				APP_WIDGET			pageWidget,
421 				const InspectorSubjectResources * isr )
422     {
423     EditApplication *	ea= plt->pltApplication;
424     APP_WIDGET		row;
425 
426     /**/
427 
428     plt->pltUnitType= appUnitTypeInt( plpr->plprUnitType );
429     if  ( plt->pltUnitType < 0 )
430 	{ SDEB(plpr->plprUnitType); plt->pltUnitType= UNITtyINCH;	}
431 
432     plt->pltHeaderPositionText= (APP_WIDGET)0;
433     plt->pltFooterPositionText= (APP_WIDGET)0;
434     plt->pltRevertSelectionWidget= (APP_WIDGET)0;
435     plt->pltChangeSelectionWidget= (APP_WIDGET)0;
436 
437     /**/
438     plt->pltPageResources= plpr;
439     plt->pltManageHeadersFooters= doHdFt;
440     plt->pltManageSelection= doSelection;
441 
442     plt->pltCanChangeSelection= 1;
443     plt->pltCanChangeDocument= 1;
444 
445     plt->pltHeaderFooterFrame= (APP_WIDGET)0;
446     plt->pltHeaderFooterLeftColumn= (APP_WIDGET)0;
447     plt->pltHeaderFooterRightColumn= (APP_WIDGET)0;
448     plt->pltHeaderPositionText= (APP_WIDGET)0;
449     plt->pltFooterPositionText= (APP_WIDGET)0;
450 
451     /**/
452 
453     plt->pltDrawingSurface= (DrawingSurface)0;
454 
455     utilInitDocumentGeometry( &(plt->pltGeometrySetDocument) );
456     utilInitDocumentGeometry( &(plt->pltGeometrySetSelection) );
457     utilInitDocumentGeometry( &(plt->pltGeometryChosen) );
458 
459     plt->pltGeometrySetDocument.dgPageWideTwips= 0;
460     plt->pltGeometrySetSelection.dgPageWideTwips= 0;
461     plt->pltGeometryChosen.dgPageWideTwips= 0;
462 
463     appInitPaperChooser( &(plt->pltPaperChooser) );
464 
465     /**************/
466     plt->pltPageHighMm= DRH_MM;
467     plt->pltPixelsPerTwip= ( plt->pltPageHighMm* ea->eaPixelsPerTwip )/
468 								A3_MM_HIGH;
469 
470     plt->pltPageDrawing= appMakePageDrawing( pageWidget,
471 				ea->eaPixelsPerTwip, plt->pltPageHighMm,
472 				appPageLayoutToolDrawPage, (void *)plt );
473 
474     appMakePaperChooserWidgets( pageWidget, plpr->plprPage,
475 					    plt->pltUnitType,
476 					    &(plt->pltPaperChooser),
477 					    appPageLayoutToolPaperRectChanged,
478 					    (void *)plt );
479 
480     appPaperChooserAddOrientationToggles( &(plt->pltPaperChooser),
481 					    plpr->plprPortraitText,
482 					    plpr->plprLandscapeText );
483 
484     /**************/
485 
486     appMakeMarginToolWidgets( pageWidget, &(plpr->plprMarginToolResources),
487 					    &(plt->pltMarginTool),
488 					    appPaperMarginChanged,
489 					    (void *)plt );
490 
491 
492     /**************/
493 
494     if  ( plt->pltManageHeadersFooters )
495 	{
496 	appPageLayoutMakeHeaderFooterWidgets( pageWidget, plpr, plt );
497 	}
498 
499     if  ( plt->pltManageSelection )
500 	{
501 	guiToolMake2BottonRow( &row, pageWidget,
502 				    &(plt->pltRevertSelectionWidget),
503 				    &(plt->pltChangeSelectionWidget),
504 				    plpr->plprRevertSelectionText,
505 				    plpr->plprChangeSelectionText,
506 				    appPageLayoutRevertSelectionPushed,
507 				    appPageLayoutChangeSelectionPushed,
508 				    (void *)plt );
509 	}
510 
511     guiToolMake2BottonRow( &(is->isApplyRow), pageWidget,
512 				&(is->isRevertButton), &(is->isApplyButton),
513 				isr->isrRevert, isr->isrApplyToSubject,
514 				appPageLayoutRevertDocumentPushed,
515 				appPageLayoutChangeDocumentPushed,
516 				(void *)plt );
517 
518     plt->pltChangeDocumentWidget= is->isApplyButton;
519     plt->pltRevertDocumentWidget= is->isRevertButton;
520 
521     return;
522     }
523 
524 /************************************************************************/
525 /*									*/
526 /*  Finish the page layout page.					*/
527 /*									*/
528 /************************************************************************/
529 
appPageLayoutPageFillChoosers(PageLayoutTool * plt,const PageLayoutPageResources * plpr)530 void appPageLayoutPageFillChoosers(	PageLayoutTool *		plt,
531 					const PageLayoutPageResources *	plpr )
532     {
533     appPaperChooserFillMenu( &(plt->pltPaperChooser),
534 					    plpr->plprCustomPageSizeText );
535 
536     return;
537     }
538 
appPageLayoutPageFinishPage(PageLayoutTool * plt,const PageLayoutPageResources * plpr)539 void appPageLayoutPageFinishPage(	PageLayoutTool *		plt,
540 					const PageLayoutPageResources *	plpr )
541     {
542     appPaperChooserRefreshMenuWidth( &(plt->pltPaperChooser) );
543 
544     plt->pltDrawingSurface= guiDrawingSurfaceForNativeWidget(
545 		plt->pltPageDrawing,
546 		plt->pltApplication->eaPostScriptFontList.psflAvoidFontconfig );
547 
548     guiGetBackgroundColor( &(plt->pltBackgroundColor), plt->pltPageDrawing );
549 
550     return;
551     }
552 
553 /************************************************************************/
554 /*									*/
555 /*  Clean the page layout tool.						*/
556 /*									*/
557 /************************************************************************/
558 
appCleanPageLayoutTool(PageLayoutTool * plt)559 void appCleanPageLayoutTool(	PageLayoutTool *	plt )
560     {
561     appCleanPaperChooser( &(plt->pltPaperChooser) );
562 
563     if  ( plt->pltDrawingSurface )
564 	{ drawFreeDrawingSurface( plt->pltDrawingSurface );	}
565 
566     return;
567     }
568 
569 /************************************************************************/
570 /*									*/
571 /*  Get page layout tool resources.					*/
572 /*									*/
573 /************************************************************************/
574 
575 static AppConfigurableResource APP_PageSubjectResourceTable[]=
576     {
577     APP_RESOURCE( "tableToolPageLayout",
578 		offsetof(InspectorSubjectResources,isrSubjectName),
579 		"Page Layout" ),
580     APP_RESOURCE( "tableToolChangeDocumentPageLayout",
581 		offsetof(InspectorSubjectResources,isrApplyToSubject),
582 		"Apply to Document" ),
583     APP_RESOURCE( "tableToolRevertDocumentPageLayout",
584 		offsetof(InspectorSubjectResources,isrRevert),
585 		"Revert to Document" ),
586     };
587 
588 static AppConfigurableResource APP_PageToolResourceTable[]=
589     {
590     APP_RESOURCE( "tableToolRevertSection",
591 		offsetof(PageLayoutPageResources,plprRevertSelectionText),
592 		"Revert to Selection" ),
593     APP_RESOURCE( "tableToolChangeSelection",
594 		offsetof(PageLayoutPageResources,plprChangeSelectionText),
595 		"Apply to Selection" ),
596     /**/
597     APP_RESOURCE( "unit",
598 		offsetof(PageLayoutPageResources,plprUnitType),
599 		"inch" ),
600     APP_RESOURCE( "formatToolPageLayoutPage",
601 		offsetof(PageLayoutPageResources,plprPage),
602 		"Page" ),
603     APP_RESOURCE( "pageToolCustom",
604 		offsetof(PageLayoutPageResources,plprCustomPageSizeText),
605 		"Custom" ),
606     APP_RESOURCE( "pageToolPortrait",
607 		offsetof(PageLayoutPageResources,plprPortraitText),
608 		"Portrait" ),
609     APP_RESOURCE( "pageToolLandscape",
610 		offsetof(PageLayoutPageResources,plprLandscapeText),
611 		"Landscape" ),
612     /**/
613     APP_RESOURCE( "pageToolMargins",
614 		offsetof(PageLayoutPageResources,
615 				plprMarginToolResources.mtrTitleText),
616 		"Margins" ),
617     APP_RESOURCE( "pageToolLeftMargin",
618 		offsetof(PageLayoutPageResources,
619 				plprMarginToolResources.mtrLeftMarginText),
620 		"Left" ),
621     APP_RESOURCE( "pageToolTopMargin",
622 		offsetof(PageLayoutPageResources,
623 				plprMarginToolResources.mtrTopMarginText),
624 		"Top" ),
625     APP_RESOURCE( "pageToolRightMargin",
626 		offsetof(PageLayoutPageResources,
627 				plprMarginToolResources.mtrRightMarginText),
628 		"Right" ),
629     APP_RESOURCE( "pageToolBottomMargin",
630 		offsetof(PageLayoutPageResources,
631 				plprMarginToolResources.mtrBottomMarginText),
632 		"Bottom" ),
633     /**/
634     APP_RESOURCE( "formatToolSectHeaderFooterPositions",
635 		offsetof(PageLayoutPageResources,plprPositionsText),
636 		"Positions" ),
637     APP_RESOURCE( "formatToolSectHeaderPosition",
638 		offsetof(PageLayoutPageResources,plprHeaderPositionText),
639 		"Header" ),
640     APP_RESOURCE( "formatToolSectFooterPosition",
641 		offsetof(PageLayoutPageResources,plprFooterPositionText),
642 		"Footer" ),
643     };
644 
appPageLayoutPageGetResourceTable(EditApplication * ea,PageLayoutPageResources * plpr,InspectorSubjectResources * isr)645 void appPageLayoutPageGetResourceTable(	EditApplication *		ea,
646 					PageLayoutPageResources *	plpr,
647 					InspectorSubjectResources *	isr )
648     {
649     static int	gotToolResources;
650     static int	gotSubjectResources;
651 
652     if  ( ! gotToolResources )
653 	{
654 	appGuiGetResourceValues( &gotToolResources, ea, (void *)plpr,
655 				APP_PageToolResourceTable,
656 				sizeof(APP_PageToolResourceTable)/
657 				sizeof(AppConfigurableResource) );
658 	}
659 
660     if  ( ! gotSubjectResources )
661 	{
662 	appGuiGetResourceValues( &gotSubjectResources, ea, (void *)isr,
663 				APP_PageSubjectResourceTable,
664 				sizeof(APP_PageSubjectResourceTable)/
665 				sizeof(AppConfigurableResource) );
666 	}
667 
668     return;
669     }
670