!!
!! $RCSfile: Import.uil,v $
!!
!! (c) Copyright 1992-1994 Adobe Systems Incorporated.
!! All rights reserved.
!! 
!! Permission to use, copy, modify, distribute, and sublicense this software
!! and its documentation for any purpose and without fee is hereby granted,
!! provided that the above copyright notices appear in all copies and that
!! both those copyright notices and this permission notice appear in
!! supporting documentation and that the name of Adobe Systems Incorporated
!! not be used in advertising or publicity pertaining to distribution of the
!! software without specific, written prior permission.  No trademark license
!! to use the Adobe trademarks is hereby granted.  If the Adobe trademark
!! "Display PostScript"(tm) is used to describe this software, its
!! functionality or for any other purpose, such use shall be limited to a
!! statement that this software works in conjunction with the Display
!! PostScript system.  Proper trademark attribution to reflect Adobe's
!! ownership of the trademark shall be given whenever any such reference to
!! the Display PostScript system is made.
!! 
!! ADOBE MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THE SOFTWARE FOR
!! ANY PURPOSE.  IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
!! ADOBE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
!! IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
!! NON- INFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO EVENT SHALL ADOBE BE LIABLE
!! TO YOU OR ANY OTHER PARTY FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL
!! DAMAGES OR ANY DAMAGES WHATSOEVER WHETHER IN AN ACTION OF CONTRACT,
!! NEGLIGENCE, STRICT LIABILITY OR ANY OTHER ACTION ARISING OUT OF OR IN
!! CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  ADOBE WILL NOT
!! PROVIDE ANY TRAINING OR OTHER SUPPORT FOR THE SOFTWARE.
!! 
!! Adobe, PostScript, and Display PostScript are trademarks of Adobe Systems
!! Incorporated which may be registered in certain jurisdictions
!! 
!! Author:  Adobe Systems Incorporated

!!***************************************************************
!! MODULE DECLARATIONS
!!***************************************************************

!!
!! module ImportApp
!!
module ImportApp
        version = 'v1.0'
        names = case_sensitive
        objects =
		{
                XmCascadeButton	= gadget ;
                XmLabel		= gadget ;
                XmPushButton	= gadget ;
                XmSeparator	= gadget ;
                XmToggleButton	= gadget ;
		}


!!***************************************************************
!! PROCEDURE DECLARATIONS
!!***************************************************************

procedure
        resizeWindow  		();
        refreshWindow 		();
	createProc   		(integer);
        quitApp       		();
	scrollProc		();
	traceProc		();
	showBufferProc		();
	bufferExposeProc	();
	fileProc		(integer);
	cutProc			();
	copyProc		();
	pasteProc		();
	deleteProc		();
	rotateProc		();
	scaleProc		();
	frontProc		();
	backProc		();
	origSizeProc		();
	origRatioProc		();
	useBoxProc		();
	setPreview		(integer);

!!***************************************************************
!! VALUE DECLARATIONS
!!***************************************************************

!!
!! the following list is duplicated in patt.c for identification
!! of widgets as they are created
!!
value
		cMainDrawArea		: 1;
		cBufferDrawArea0	: 2;
		cBufferDrawArea1	: 3;
		cTraceToggle		: 4;
		cMainHorzSBar		: 5;
		cMainVertSBar		: 6;

!!
!! ADOBE FONTS
!!
value
    hel_bold_font12 :
      font('-adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1');
    hel_bold_font14 :
      font('-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1');
    hel_bold_font18 :
      font('-adobe-helvetica-bold-r-normal--18-180-75-75-p-103-iso8859-1');
    newcenturyschlbk_bold24 :
      font('-adobe-new century schoolbook-bold-r-normal--24-240-75-75-p-149-iso8859-1');

    dialogFont      : hel_bold_font12;
	textFont        : hel_bold_font12;
	labelFont       : hel_bold_font14;
	buttonFont      : hel_bold_font14;
	bigFont         : hel_bold_font18;
	jumboFont       : newcenturyschlbk_bold24;


!!
!! general constant values
!!
value
        vLabelOffset	: 7;	! pixels
        vFrameShadow	: XmSHADOW_ETCHED_IN;

!!
!! main window constant values
!!
value
        vMainWidth      : 420;	! pixels
        vMainHeight     : 450;	! pixels


!!
!! option box constant values
!!
value
		vOptionMargin	: 20;	! pixels
		vBottomPosition	: 97;	! percent

		vMouseLeft		: 20;	! percent
		vMouseDrawLeft	: 22;	! percent

		vMagLeft		: 17;	! percent

		vMouseDrawWidth	: 50;	! pixels
		vMouseDrawHeight: 50;	! pixels


!!
!! buffer box constant values
!!
value
        vBufferDrawWidth    : 100;  ! pixels
        vBufferDrawHeight   : 100;  ! pixels

        vBufferSpacing  : 10;   ! pixels


!!***************************************************************
!! TOP LEVEL WIDGETS
!!***************************************************************

!!
!! The main window widget.  This displays the drawing.
!!
object MainWindow : XmMainWindow
{
    arguments
    {
        XmNheight   = vMainHeight;
        XmNwidth    = vMainWidth ;
    };
    controls
    {
        XmMenuBar           mMenuBar;
        XmScrolledWindow    mScrolled;
    };
};

!!
!! The buffer box is used to display the buffers
!!
object BufferBox : XmBulletinBoardDialog
{
    arguments
    {
        XmNdialogStyle	= XmDIALOG_MODELESS;
    };
    controls
    {
		XmForm		oBufferBoxForm;
    };
};

object oBufferBoxForm: XmForm
{
	arguments
	{
        XmNhorizontalSpacing    = vBufferSpacing;
        XmNverticalSpacing      = vBufferSpacing;
    };
    controls
    {
        XmLabel         bLabel0;
        XmDrawingArea   bDrawArea0;
        XmLabel         bLabel1;
        XmDrawingArea   bDrawArea1;
	};
};


!!***************************************************************
!! Main window menu bar
!!***************************************************************

object mMenuBar : XmMenuBar           
{
	controls
	{
		XmCascadeButton mCommandButton;
		XmCascadeButton mEditButton;
		XmCascadeButton mArrangeButton;
		XmCascadeButton mPreviewButton;
	
	};
};

object mCommandButton : XmCascadeButton
{
	arguments
    {
        XmNfontList    = buttonFont;
    };
    controls
    {
        XmPulldownMenu mCommandMenu;
    };
};

object mCommandMenu : XmPulldownMenu
{
    controls
    {
	XmPushButton  	mOpenButton;
	XmPushButton  	mSaveButton;
        XmSeparator     {};
	XmToggleButton	mBoxButton;
	XmToggleButton	mTraceButton;
        XmToggleButton  mShowBufferButton;
        XmSeparator     {};
        XmPushButton    mQuitButton;
    };
};

object mOpenButton : XmPushButton
{
    arguments
    {
        XmNfontList    = buttonFont;
    };
    callbacks
    {
        XmNactivateCallback = procedure fileProc (0);
    };
};

object mSaveButton : XmPushButton
{
    arguments
    {
        XmNfontList    = buttonFont;
    };
    callbacks
    {
        XmNactivateCallback = procedure fileProc (1);
    };
};

object mBoxButton : XmToggleButton
{
    arguments
    {
        XmNfontList    = buttonFont;
    };
    callbacks
    {
        XmNvalueChangedCallback = procedure useBoxProc ();
    };
};

object mTraceButton : XmToggleButton
{
    arguments
    {
        XmNfontList    = buttonFont;
    };
    callbacks
    {
	MrmNcreateCallback	= procedure createProc (cTraceToggle);
        XmNvalueChangedCallback = procedure traceProc ();
    };
};

object mShowBufferButton : XmToggleButton
{
    arguments
    {
        XmNfontList    = buttonFont;
    };
    callbacks
    {
        XmNvalueChangedCallback = procedure showBufferProc ();
    };
};

object mQuitButton : XmPushButton
{
    arguments
    {
        XmNfontList    = buttonFont;
    };
    callbacks
    {
        XmNactivateCallback = procedure quitApp ();
    };
};
 
object mEditButton : XmCascadeButton
{
    arguments
    {
        XmNfontList    = buttonFont;
    };
    controls
    {
        XmPulldownMenu mEditMenu;
    };
};

object mEditMenu : XmPulldownMenu
{
    controls
    {
        XmPushButton 	mCutButton;
        XmPushButton 	mCopyButton;
        XmPushButton  	mPasteButton;
        XmPushButton  	mDeleteButton;
    };
};

object mCutButton : XmPushButton
{
    arguments
    {
        XmNfontList    = buttonFont;
    };
    callbacks
    {
        XmNactivateCallback = procedure cutProc ();
    };
};

object mCopyButton : XmPushButton
{
    arguments
    {
        XmNfontList    = buttonFont;
    };
    callbacks
    {
        XmNactivateCallback = procedure copyProc ();
    };
};

object mPasteButton : XmPushButton
{
    arguments
    {
        XmNfontList    = buttonFont;
    };
    callbacks
    {
        XmNactivateCallback = procedure pasteProc ();
    };
};

object mDeleteButton : XmPushButton
{
    arguments
    {
        XmNfontList    = buttonFont;
    };
    callbacks
    {
        XmNactivateCallback = procedure deleteProc ();
    };
};

object mArrangeButton : XmCascadeButton
{
    arguments
    {
        XmNfontList    = buttonFont;
    };
    controls
    {
        XmPulldownMenu mArrangeMenu;
    };
};

object mArrangeMenu : XmPulldownMenu
{
    controls
    {
        XmPushButton  	mRotateButton;
        XmPushButton  	mScaleButton;
        XmPushButton  	mFrontButton;
        XmPushButton  	mBackButton;
	XmPushButton  	mOrigSizeButton;
	XmPushButton 	mOrigRatioButton;
    };
};

object mRotateButton : XmPushButton
{
    arguments
    {
        XmNfontList    = buttonFont;
    };
    callbacks
    {
        XmNactivateCallback = procedure rotateProc ();
    };
};

object mScaleButton : XmPushButton
{
    arguments
    {
        XmNfontList    = buttonFont;
    };
    callbacks
    {
        XmNactivateCallback = procedure scaleProc ();
    };
};

object mFrontButton : XmPushButton
{
    arguments
    {
        XmNfontList    = buttonFont;
    };
    callbacks
    {
        XmNactivateCallback = procedure frontProc ();
    };
};

object mBackButton : XmPushButton
{
    arguments
    {
        XmNfontList    = buttonFont;
    };
    callbacks
    {
        XmNactivateCallback = procedure backProc ();
    };
};

object mOrigSizeButton : XmPushButton
{
    arguments
    {
        XmNfontList    = buttonFont;
    };
    callbacks
    {
        XmNactivateCallback = procedure origSizeProc ();
    };
};

object mOrigRatioButton : XmPushButton
{
    arguments
    {
        XmNfontList    = buttonFont;
    };
    callbacks
    {
        XmNactivateCallback = procedure origRatioProc ();
    };
};

object mPreviewButton : XmCascadeButton
{
    arguments
    {
        XmNfontList    = buttonFont;
    };
    controls
    {
        XmPulldownMenu mPreviewMenu;
    };
};

object mPreviewMenu : XmPulldownMenu
{
    controls
    {
	XmToggleButton mPreviewButton0;
	XmToggleButton mPreviewButton1;
    };
};

object mPreviewButton0 : XmToggleButton
{
    arguments
    {
        XmNfontList    = buttonFont;
    };
    callbacks
    {
        XmNvalueChangedCallback = procedure setPreview(0);
    };
};

object mPreviewButton1 : XmToggleButton
{
    arguments
    {
        XmNfontList    = buttonFont;
    };
    callbacks
    {
        XmNvalueChangedCallback = procedure setPreview(1);
    };
};

!!***************************************************************
!! Main window scrolled drawing area
!!***************************************************************
object mScrolled : XmScrolledWindow    
{
	arguments
	{
		XmNheight			= vMainHeight;
		XmNwidth			= vMainWidth ;
        XmNhorizontalScrollBar  = XmScrollBar mHorzSBar;
        XmNverticalScrollBar    = XmScrollBar mVertSBar;
        XmNworkWindow           = XmDrawingArea mDrawArea;
	} ;
	controls
	{
        XmScrollBar     mHorzSBar;
        XmScrollBar     mVertSBar;
		XmDrawingArea   mDrawArea ;
	} ;
} ;

object mHorzSBar : XmScrollBar
{
    arguments
    {
        XmNorientation          = XmHORIZONTAL;
        XmNincrement            = 50;
        XmNpageIncrement        = 300;
    };
    callbacks
    {
        MrmNcreateCallback      = procedure createProc (cMainHorzSBar);
        XmNvalueChangedCallback = procedure scrollProc ();
        XmNdragCallback         = procedure scrollProc ();
    };
};

object mVertSBar : XmScrollBar
{
    arguments
    {
        XmNorientation          = XmVERTICAL;
        XmNincrement            = 50;
        XmNpageIncrement        = 300;
    } ;
    callbacks
    {
        MrmNcreateCallback      = procedure createProc (cMainVertSBar);
        XmNvalueChangedCallback = procedure scrollProc ();
        XmNdragCallback         = procedure scrollProc ();
    } ;
} ;

object mDrawArea : XmDrawingArea
{
	arguments
	{
	};
	callbacks
	{
        MrmNcreateCallback = procedure createProc (cMainDrawArea);
		XmNexposeCallback = procedure refreshWindow ();
		XmNresizeCallback = procedure resizeWindow ();
	};
};

!!***************************************************************
!! Buffer box drawing areas
!!***************************************************************
object bLabel0 : XmLabel
{
    arguments
    {
        !!XmNbackground     = color('blue');
        XmNalignment        = XmALIGNMENT_CENTER;
        XmNfontList         = labelFont ;

        XmNleftAttachment   = XmATTACH_FORM ;
        XmNrightAttachment  = XmATTACH_WIDGET ;
        XmNrightWidget      = XmDrawingArea bDrawArea1;

        XmNtopAttachment    = XmATTACH_FORM ;
        XmNbottomAttachment = XmATTACH_WIDGET ;
        XmNbottomWidget     = XmDrawingArea bDrawArea0;
    };
};

object bDrawArea0 : XmDrawingArea
{
    arguments
    {
        !!XmNbackground     = color('green');
        XmNheight           = vBufferDrawHeight;
        XmNwidth            = vBufferDrawWidth;

        XmNleftAttachment   = XmATTACH_FORM ;

        XmNbottomAttachment = XmATTACH_FORM ;
    };
    callbacks
    {
        MrmNcreateCallback = procedure createProc (cBufferDrawArea0);
        XmNexposeCallback = procedure bufferExposeProc ();
    };
};

object bLabel1 : XmLabel
{
    arguments
    {
        !!XmNbackground     = color('green');
        XmNalignment        = XmALIGNMENT_CENTER;
        XmNfontList         = labelFont ;

        XmNleftAttachment   = XmATTACH_WIDGET ;
        XmNleftWidget       = XmDrawingArea bDrawArea0;
        XmNrightAttachment  = XmATTACH_FORM ;

        XmNtopAttachment    = XmATTACH_FORM ;
        XmNbottomAttachment = XmATTACH_WIDGET ;
        XmNbottomWidget     = XmDrawingArea bDrawArea1;
    };
};

object bDrawArea1 : XmDrawingArea
{
    arguments
    {
        !!XmNbackground     = color('blue');
        XmNheight           = vBufferDrawHeight;
        XmNwidth            = vBufferDrawWidth;

        XmNleftAttachment   = XmATTACH_WIDGET ;
        XmNleftWidget       = XmDrawingArea bDrawArea0;
        XmNrightAttachment  = XmATTACH_FORM ;

        XmNbottomAttachment = XmATTACH_FORM ;
    };
    callbacks
    {
        MrmNcreateCallback = procedure createProc (cBufferDrawArea1);
        XmNexposeCallback = procedure bufferExposeProc ();
    };
};


!!***************************************************************
end module;

