home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
ibmodf.zip
/
CNTNRPRT.ZIP
/
CNTNRPRT.IDL
< prev
next >
Wrap
Text File
|
1995-03-23
|
22KB
|
579 lines
#ifdef __PRIVATE__
//#
//# File: CntnrPrt.idl
//#
//# Contains: IDL description of Container Part
//#
//# Written by: Jason Crawford
//#
//# Copyright: (c) 1994 by IBM Corp., all rights reserved.
//#
//# Change History (most recent first):
//#
//# <3> 11/05/94 ced Changes related to removal of
//# proxy regions (see cntnrprt.cpp)
//# <2> 10/7/94 ced Add methods for tracking mouse
//# <1> 7/6/94 jlc first checked in
//#
//# To Do:
//#
#else
//# Copyright: (c) 1993-1994 by IBM Corp., all rights reserved.
#endif
#ifndef _CNTNRPRT_
#define _CNTNRPRT_
#ifndef _PART_
#include "Part.idl"
#endif
interface ODWindow;
interface ODFocusSet;
//interface ODFrame;
//interface ODMenuBar;
interface ODSemanticInterface;
interface ODSelectedContainerPartExtension;
interface ODNotebook;
//#ifdef __PRIVATE__
//=====================================================================================
// Implementation Types
//=====================================================================================
interface ODxOrderedCollection;
typedef somToken RGBColor;
typedef somToken Proxy;
#ifdef _PLATFORM_OS2_
//@jlc hack to get this to pass through idl compile without asking too many questions.
typedef long PRNINFO;
typedef long HPS;
typedef long HDC;
typedef long HRGN;
#else
typedef somToken TPrPort;
typedef somToken THPrint;
#endif
//#endif
//module AppleTestDraw
//{
interface ContainerPart : ODPart
{
//#ifdef __PRIVATE__
#if 0
//jlc
// the following are entries that in the old c++ class declaration
// that we think are handled by the override directive later in
// this file. I haven't checked for signature changes.
// -Drag&Drop-
void FulfillPromise(ODStorageUnitView *promiseSUView);
void DropCompleted(ODPart* destPart, ODDropResult dropResult);
MRESULT DragEnter(ODDragItemIterator* dragInfo, ODFacet* facet, ODPoint where); //dwf
MRESULT DragWithin(ODDragItemIterator* dragInfo, ODFacet* facet, ODPoint where); //dwf
void DragLeave(ODFacet* facet, ODPoint where);
ODDropResult Drop(ODDragItemIterator* dropInfo, ODFacet* facet, ODPoint where);
// -Embedding-
ODStorageUnit* GetContainingPartProperties(ODFrame* displayFrame);
ODEmbeddedFramesIterator* CreateEmbeddedFramesIterator();
// -Frame-
void AddDisplayFrame(ODFrame* frame);
void AttachSourceFrame(ODFrame* frame, ODFrame* sourceFrame);
void RemoveDisplayFrame(ODFrame* frame);
void CloseDisplayFrame(ODFrame* frame);
void FrameShapeChanged(ODFrame* frame);
void ViewTypeChanged(ODFrame* frame);
void PresentationChanged(ODFrame* frame);
void WritePartInfo(ODPtr partInfo, ODStorageUnitView* storageUnitView);
ODPtr ReadPartInfo(ODFrame* frame, ODStorageUnitView* storageUnitView);
ODID Open(ODFrame* frame); //Override
void RemoveEmbeddedFrame(ODFrame* embeddedFrame);
ODShape* RequestFrameShape(ODFrame* embeddedFrame, ODShape* frameShape);
void UsedShapeChanged(ODFrame* embeddedFrame);
// -Facet-
void FacetAdded(ODFacet* facet);
void FacetRemoved(ODFacet* facet);
void GeometryChanged(ODFacet* facet);
// -Imaging-
void Draw(ODFacet* facet, ODShape* invalidShape);
// -Part Activation-
void CommitRelinquishFocus(ODTypeToken focus,
ODFrame* ownerFrame,
ODFrame* proposedFrame);
void FocusAcquired(ODTypeToken focus, ODFrame* ownerFrame);
void FocusLost(ODTypeToken focus, ODFrame* ownerFrame);
// -Storage-
void Externalize();
void CloneInto(ODDraftKey key, ODStorageUnit* storageUnit, ODStorageUnit* initiatingFrameSU);
// -UI Events-
ODBoolean HandleEvent(ODEventData event, ODFrame* frame, ODFacet* facet);
void AdjustMenus(ODFrame* frame);
void AdjustRootMenus(ODFrame* frame, ODBoolean propagate, ODOS2MenuBar * mb);
// -Undo-
void UndoAction(ODActionData actionState);
void RedoAction(ODActionData actionState);
void DisposeActionState(ODActionData actionState,
ODDoneState doneState);
protected:
void InitPart(ODStorageUnit* storageUnit);
void InitPartFromStorage(ODStorageUnit* storageUnit);
void Release();
#endif
#if 0
//jlc
// the following are entries in the old c++ class declaration
// that haven't been mapped yet to this file.
// -Embedding-
ODSLong CountEmbeddedFrames();
// -Frame-
ODFrame* CreateEmbeddedFrame(ODFrame* containingFrame,
ODShape* frameShape,
ODTransform* externalTransform,
ODPart* embedPart,
ODTypeToken viewType,
ODTypeToken presentation,
ODID frameGroupID,
ODBoolean isOverlaid);
// -Facet-
void ClipShapeChanged(ODFacet* facet);
void ExternalTransformChanged(ODFacet* facet);
// -Memory Management-
ODSize Purge(ODSize size);
// -UI Events-
void AdjustRootMenus(ODFrame* frame, ODBoolean propagate, ODOS2MenuBar * mb);
protected:
friend ODPart* EXPENTRY CreatePart(void);
// -constructor/destructor-
ContainerPart();
virtual ~ContainerPart();
// ==== PRINTING ==== protected
ODUShort DetermineNumberOfPagesinDoc(ODFrame* frame, Rect page);
ULONG ViewPrintGetQueue( ODFrame * frame, PSZ szQueue);
void* fPrintRecord;
void CollectHandlers( void );
private:
int ExtractMenuPartStrings( char * fullstring , char * * dllstring , int * dllstringlength , char * * descripstring );
XMPID fWindowID; // ID of View As Window window
POINTL fDragStart;
//MenuHandle fEmbedMenu;
//MenuHandle fColorMenu;
//MenuHandle fFrameMenu;
XMPIcon fLargeIcons;
XMPIcon fSmallIcons;
XMPSemanticInterface* fSemtIntf;
#endif
ODSemanticInterface GetSemanticInterface();
#ifdef _PLATFORM_MAC_
void SetNewBounds( in ODFrame frame, in Rect r ) ;
#endif
Proxy* ProxyForFrame(in ODFrame frame);
// (CED - 110594) void UpdateProxyRegion(in Proxy* proxy);
// (CED - 110594) void CreateProxySelectionBorder(in Proxy* p);
void CreateProxySelectionBorder(in ODFacet facet, in Proxy* p); // (CED - 110594)
void InvalidateSelection(in ODFrame frame);
void ClipEmbeddedFrames(in ODFrame frame);
void CommonInitContainerPart();
#ifdef _PLATFORM_MAC_
void LoadIcons();
#endif
//@jlc whatisit? void InstallObjectAccessors();
ODxOrderedCollection GetEmbeddedFrames();
Proxy* ProxyForFrameID(in ODID frameID);
#ifdef _PLATFORM_MAC_
//@jlc When porting I notice that the Mac and old OS2 versions have
//@jlc different signatures. I don't the who or when. This can
//@jlc be checked later.
void HighlightSelection();
void HighlightProxyBorder(in Proxy* p);
void HighlightContentObject(in Proxy* p);
void ClipEmbeddedFacets(in ODFacet facet);
#else
void HighlightSelection( in ODFacet facet);
void HighlightProxyBorder( in Proxy *p, in ODFacet facet);
void HighlightContentObject( in Proxy *p, in ODFacet facet);
void ClipEmbeddedFacets( in ODFacet facet);
#endif
void FillSelectedMenu( in ODFrame frame, in ODMenuBar menubar );
void AdjustPopupMenu( in ODFrame frame, in ODMenuBar menubar, in ODMenuID menuID );
void AdjustSPEMenu( in ODFrame frame, in ODMenuBar menubar, in ODMenuID menuID );
void EmptySelection();
ODMenuBar GetSPEMenuOfSelection( );
void RefreshRemappedSPEMenuOfSelection( );
ODBoolean HandleMouseDown( in ODFacet facet,
in ODPoint where,
in ODEventData event);
void MoveResize( in ODFacet facet, in Proxy* selection, in ODSLong fs );
ODBoolean HandleMouseDownDrag(in ODFacet facet, in Proxy* selection, in ODEventData event);
ODBoolean HandleMouseDownEdgeResize(in ODFacet facet, in Proxy* selection, in POINTL mouse);
ODBoolean HandleMouseDownCornerResize(in ODFacet facet, in Proxy* selection, in POINTL mouse);
ODBoolean HandleMouseDownInEmbeddedFrame( in ODFacet container,
in ODFacet facet,
in ODPoint where,
in ODEventData event);
ODBoolean HandleKeyDown(in ODFrame focusFrame, in ODEventData event);
ODBoolean HandleMenuEvent(in ODFrame focusFrame, in ODEventData event);
#ifdef _PLATFORM_OS2_
ODBoolean HandleMouseMove( in ODFacet facet,
in ODFrame frame,
in ODPoint where,
in ODEventData event);
ODBoolean HandleMouseUp(in ODFacet facet,
in ODFrame frame,
in ODPoint where,
in ODEventData event);
void UpdateTrackRect(in POINTL* ptlMouse,
in ODPlatformWindow hwnd);
void MouseFocusLost(in ODFrame ownerFrame);
#else
ODBoolean HandlePageSetup(in ODFrame focusFrame);
#endif
ODBoolean HandlePrinting(in ODFrame frame);
#ifdef _PLATFORM_MAC_
void CreateDefPrintRec();
ODFacet BeginPrinting(in ODFrame rootFrame, in TPrPort* thePrPort);
void PrintPage(in ODFacet prFacet, in ODUShort page);
void PrintDocument(in ODFrame frame);
#else
ODFacet BeginPrinting(in ODFrame rootFrame, in PRNINFO *pPI );
void PrintPage(in ODFacet prFacet, in ODUShort pagenum, in PRNINFO *pPI);
long PrintPages( in ODFrame frame , in PRNINFO *pPI ) ;
#endif
void EndPrinting(in ODFacet prFacet);
ODBoolean DoCut(in ODFrame frame);
ODBoolean DoCopy(in ODFrame frame);
ODBoolean DoPaste(in ODFrame frame);
ODBoolean DoPasteLink(in ODFrame frame);
ODBoolean DoClear(in ODFrame frame);
ODBoolean DoSelectAll(in ODFrame frame);
void ActivateFrame(in ODFrame frame);
void DeActivateFrame(in ODFrame frame);
void ActivatingWindow(in ODFrame frame);
void DeActivatingWindow(in ODFrame frame);
void InstallMenus(in ODFrame aFrame);
void RemoveMenus(in ODFrame aFrame);
void UserSetBGColor(in ODFrame frame, in RGBColor whichColor);
void SetBGColor1(in ODFrame aFrame, in ODUShort whichColor);
void SetBGColor2(in ODFrame aFrame, in RGBColor whichColor);
void Embed(in short item, in ODFrame frame, out ODPart newPart);
void SetGrafPortOrigin(in ODFacet facet);
void InvalEmbedFrameAfterResize(in ODFacet facet, in Proxy* selection,
// (CED - 110594) in ODShape oldShape, in ODShape newShape, in POINTL transOffset);
in ODShape newShape, in ODTransform newTransform); // (CED - 110594)
RECTL * GetSelectionRectLocal(in Proxy* selection);
#ifndef _PLATFORM_OS2_
void GetBGColor(in ODUShort whichColor, out RGBColor newColor);
#endif
ODFrame MakeEmbeddedFrame(in ODFrame containingFrame, in ODShape frameShape,
in ODTransform externalTransform, in ODPart embedPart,
in ODBoolean isOverlaid);
ODWindow CreateWindow(in ODFrame sourceFrame);
#ifdef _PLATFORM_OS2_
ODBoolean MoveToFront(in ODFrame frame);
ODBoolean MoveToBack(in ODFrame frame);
ODBoolean MoveForward(in ODFrame frame);
ODBoolean MoveBackward(in ODFrame frame);
// -utilities-
void ClearAccelTable( in ODFrame oldOwner );
void SetAccelTable( in ODFrame newOwner );
// -demo-
long GetDemoState();
#endif
//#endif
#ifdef __SOMIDL__
implementation
{
functionprefix = ContainerPart;
majorversion = 1;
minorversion = 0;
releaseorder:
FillSelectedMenu,
GetSemanticInterface,
CreateNewPart ,
SetNewBounds ,
ProxyForFrame,
#if 0
// (CED - 110594) UpdateProxyRegion,
#endif
CreateProxySelectionBorder,
InvalidateSelection,
ClipEmbeddedFrames,
CommonInitContainerPart,
InstallObjectAccessors,
GetEmbeddedFrames,
ProxyForFrameID,
HighlightSelection,
HighlightProxyBorder,
HighlightContentObject,
ClipEmbeddedFacets,
EmptySelection,
HandleMouseDown,
MoveResize,
HandleMouseDownDrag,
HandleMouseDownEdgeResize,
HandleMouseDownCornerResize,
HandleMouseDownInEmbeddedFrame,
HandleKeyDown,
HandleMenuEvent,
HandlePageSetup,
HandlePrinting,
#ifdef _PLATFORM_OS2_ // CED
HandleMouseMove,
HandleMouseUp,
UpdateTrackRect,
MouseFocusLost,
#endif // _PLATFORM_OS2_
GetDemoState,
CreateDefPrintRec,
BeginPrinting,
PrintPage,
EndPrinting,
PrintDocument,
DoCut,
DoCopy,
DoPaste,
DoPasteLink,
DoClear,
DoSelectAll,
ActivateFrame,
DeActivateFrame,
ActivatingWindow,
DeActivatingWindow,
InstallMenus,
RemoveMenus,
SetBGColor1,
UserSetBGColor,
SetBGColor2,
Embed,
SetGrafPortOrigin,
InvalEmbedFrameAfterResize,
GetSelectionRectLocal,
GetBGColor,
MakeEmbeddedFrame,
CreateWindow,
MoveToFront,
MoveToBack,
MoveForward,
MoveBackward,
ClearAccelTable,
SetAccelTable,
AdjustPopupMenu,
GetSPEMenuOfSelection,
RefreshRemappedSPEMenuOfSelection,
AdjustSPEMenu,
PrintPages
;
override:
somInit,
somUninit,
FulfillPromise,
DropCompleted,
DragEnter,
DragWithin,
DragLeave,
Drop,
GetExtension,
ReleaseExtension,
HasExtension,
ContainingPartPropertiesChanged,
GetContainingPartProperties,
CreateRootMenuBar,
RevealFrame,
EmbeddedFrameSpec,
CreateEmbeddedFramesIterator,
AddDisplayFrame,
AttachSourceFrame,
RemoveDisplayFrame,
CloseDisplayFrame,
FrameShapeChanged,
ViewTypeChanged,
PresentationChanged,
SequenceChanged,
WritePartInfo,
ReadPartInfo,
Open,
RequestEmbeddedFrame,
RemoveEmbeddedFrame,
RequestFrameShape,
UsedShapeChanged,
AdjustBorderShape,
FacetAdded,
FacetRemoved,
CanvasChanged,
GeometryChanged,
Draw,
CanvasUpdated,
HighlightChanged,
GetPrintResolution,
CreateLink,
LinkUpdated,
RevealLink,
EmbeddedFrameChanged,
LinkStatusChanged,
BeginRelinquishFocus,
CommitRelinquishFocus,
AbortRelinquishFocus,
FocusAcquired,
FocusLost,
CloneInto,
ExternalizeKinds,
Externalize,
ChangeKind,
HandleEvent,
HandleEventInEmbedded,
MouseEnter,
MouseWithin,
MouseLeave,
AdjustMenus,
UndoAction,
RedoAction,
DisposeActionState,
WriteActionState,
ReadActionState,
InitPart,
InitPartFromStorage,
Release;
#if 1 //def __PRIVATE__
passthru C_xh = ""
"class ODFrame ;"
"class ODTransform ;"
#ifdef _PLATFORM_MAC_
"struct Proxy {"
"ODRgnHandle region;"
"ODFrame* frame;"
"ODTransform* transform;"
"Proxy(ODRgnHandle r, ODFrame* f, ODTransform* t) {region = r; frame = f; transform = t; }"
"};"
"#include <Printing.h>"
"#include <Quickdraw.h>";
#else
"struct Proxy;"
"struct PRNINFO;";
passthru C_xh_after = "typedef long RGBColor;";
#endif
passthru C_xih = " "
#ifdef _PLATFORM_MAC_
"typedef Handle ODIcon;"
#endif
;
#endif
#ifdef __PRIVATE__
// instance variables
ODxOrderedCollection fDisplayFrames;
ODxOrderedCollection fEmbeddedFrames;
ODID fWindowID; // ID of View As Window window
//ODULong fFrameGroupIDCounter;
POINTL fDragStart;
RGBColor fDefaultColor; // Initial background color of all display frames
ODxOrderedCollection fContents;
ODxOrderedCollection fSelection;
ODRgnHandle fSelectRgn;
ODRgnHandle fCornerHandleRgn;
ODRgnHandle fEdgeHandleRgn;
//ODIcon fLargeIcons;
//ODIcon fSmallIcons;
ODFocusSet fFocusSet;
ODTypeToken fSelectionFocus;
ODTypeToken fMenuFocus;
ODTypeToken fKeyFocus;
ODTypeToken fMouseFocus;
ODSemanticInterface fSemtIntf;
ODSelectedContainerPartExtension fSelectedPartExtension;
ODSession fSession;
//ODStorageUnit fTestDrawSU;
ODBoolean fNeedToExternalize;
ODNotebook fNotebook;
#ifdef _PLATFORM_MAC_
ODMenuBar fMenuBar;
MenuHandle fEmbedMenu;
MenuHandle fColorMenu;
MenuHandle fFrameMenu;
THPrint fPrintRecord;
#else
HPS hpsMem;
HDC hdcMem;
ODPoint mouseStart; //dwf
ODBoolean fTracking; // tracking the mouse?
POINTL ptlOrigin; // origin of tracking rect
POINTL ptlEnd; // end of tracking rect
HRGN hrgnTrackingClip; // clip rgn for tracking rect
// just for the sake of debugging, we'll have a menu item
// for toggling the check and enable state of another
// menu item. It will toggle between four states.
long DemoState;
long DemoOpenCount;
ODMenuBar fSPEMenuOfSelection;
ODMenuBar fRemappedSPEMenuOfSelection;
#endif
#endif
};
#endif
};
#endif // _CNTNRPRT_