home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Misc / DC-POS24.LZX / pOS / pOSxA.lzx / pOSxA / clib / intuition_protos.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-03-12  |  20.5 KB  |  651 lines

  1. #ifndef __INC_POSA_CLIB_INTUITION_PROTOS_C
  2. #define __INC_POSA_CLIB_INTUITION_PROTOS_C
  3. /*******************************************************************
  4.  $CRT 09 Jul 1996 : hb
  5.  
  6.  $AUT Holger Burkarth
  7.  $DAT >>intuition_protos.c<<   31 Jan 1997    17:21:44 - (C) ProDAD
  8. *******************************************************************/
  9. #define NOMYDEBUG
  10. #pragma -
  11.  
  12. #include <exec/Types.h>
  13. #include <intuition/screens.h>
  14. #include <clib/intuition_protos.h>
  15. #include "p:proto/pIntui2.h"
  16. //#include "p:proto/pScreen.h"
  17. #include "p:proto/pUtil2.h"
  18. #include "p:pIntui/IntuMsg.h"
  19. #include "p:pIntui/IClass.h"
  20. #include "p:pScreen/Screen.h"
  21. #include "p:pScreen/Window.h"
  22. #include "p:pGFX/GfxTags.h"
  23. #include "p:pGFX/Text.h"
  24.  
  25.  
  26. // mcpp:cppc -c ci:_Projekte/pOSxA/clib/intuition_protos.c -pc
  27.  
  28.  
  29.  
  30. UWORD AddGadget(struct Window *window,struct Gadget *gadget,ULONG position)
  31.   {  pOS_AddGadget((struct pOS_Window*)window,(struct pOS_Gadget*)gadget);  return(1); }
  32.  
  33. void ClearMenuStrip( struct Window *window )
  34.   { pOS_SetMenuStrip((struct pOS_Window*)window,NULL);}
  35.  
  36.  
  37. BOOL CloseScreen( struct Screen *screen )
  38.   {
  39. //    kprintf("CloseScreen %lx\n",screen);
  40.     pOS_UnlockPubScreen((APTR)screen); return(1);
  41.   }
  42. //  { return(pOS_CloseScreen((pOS_Screen*)screen));}
  43.  
  44.  
  45. void CloseWindow( struct Window *window )
  46.   { pOS_CloseWindow((struct pOS_Window*)window);}
  47.  
  48.  
  49. void CurrentTime( ULONG *seconds, ULONG *micros )
  50.   { pOS_CurrentTime(seconds,micros); }
  51.  
  52. void DisplayBeep( struct Screen *screen )
  53.   { pOS_DisplayBeep((APTR)screen,0); }
  54.  
  55. BOOL DoubleClick( unsigned long sSeconds, unsigned long sMicros,
  56.         unsigned long cSeconds, unsigned long cMicros )
  57.   {
  58.     struct pOS_DoubleClick Just={0,0};
  59.     struct pOS_DoubleClick Old={0,0};
  60.     Just.dk_Seconds=cSeconds;  Just.dk_Micros=cMicros;
  61.     Old.dk_Seconds=sSeconds;   Old.dk_Micros=sMicros;
  62.  
  63.     return( pOS_CmpDoubleClick(&Just,&Old) );
  64.   }
  65.  
  66. void DrawBorder(struct RastPort *rp,struct Border *bor,long leftOffset,long topOffset)
  67.   {
  68.     for(; bor; bor=bor->NextBorder) {
  69.       const struct pOS_WPoint* WP=(struct pOS_WPoint*)bor->XY;
  70.       SWORD X=bor->LeftEdge, Y=bor->TopEdge;
  71.       UWORD Cnt;
  72.       pOS_SetABPenDrMd((struct pOS_RastPort*)rp,bor->FrontPen,bor->BackPen,bor->DrawMode);
  73.       pOS_SetPosition((struct pOS_RastPort*)rp,X,Y);
  74.       for(Cnt=bor->Count; Cnt>0; --Cnt,++WP)
  75.             pOS_DrawLine((struct pOS_RastPort*)rp,WP->X+X,WP->Y+Y);
  76.     }
  77.   }
  78.  
  79. void DrawImage(struct RastPort *rp,struct Image *im,long leftOffset,long topOffset)
  80.   {
  81.     pOS_StdPlanarGfxMap GM;
  82.     ULONG Size,Offset;
  83.     UWORD d;
  84.  
  85.     memset(&GM,0,sizeof(GM)); // *** Zur Sicherheit
  86.     GM.plgm_Gfx.gm_Type = GFXMAPTYP_StdPlanar;
  87.  
  88.     for(; im; im=im->NextImage) {
  89.       GM.plgm_Gfx.gm_Width =im->Width;
  90.       GM.plgm_Gfx.gm_Height=im->Height;
  91.       GM.plgm_BytesPerRow=((im->Width+15)>>4)<<1;
  92.       GM.plgm_Depth=im->Depth;
  93.       Offset=0;
  94.       Size=GM.plgm_BytesPerRow*GM.plgm_Gfx.gm_Height/sizeof(UWORD);
  95.       for(d=0; d<im->Depth; ++d, Offset+=Size) {
  96.         GM.plgm_Planes[d]=(UBYTE*) &im->ImageData[Offset];
  97.       }
  98.       pOS_WriteStdGfxMapRastPort(&GM.plgm_Gfx,0,0,
  99.          (struct pOS_RastPort*)rp,leftOffset+im->LeftEdge,topOffset+im->TopEdge,
  100.          GM.plgm_Gfx.gm_Width,GM.plgm_Gfx.gm_Height,
  101.          0);
  102.     }
  103.   }
  104.  
  105.  
  106. struct MenuItem *ItemAddress(struct Menu *menuStrip,ULONG menuNumber )
  107.   {
  108.     return( (struct MenuItem*)
  109.               pOS_GetMenuItemFromNum(&((struct pOS_MenuList*)menuStrip)->ml_List ,
  110.                                       (struct pOS_MenuNum*)&menuNumber) );
  111.   }
  112.  
  113. BOOL ModifyIDCMP( struct Window *window, unsigned long flags )
  114.   { return(pOS_ModifyIDCMP((struct pOS_Window*)window,flags));}
  115.  
  116.  
  117. void MoveWindow( struct Window *window, long dx, long dy )
  118.   { pOS_ChangeWindowBox((struct pOS_Window*)window,dx,dy,0,0); }
  119.  
  120. void OffGadget(struct Gadget *gadget,struct Window *window,struct Requester* req)
  121.   { pOS_EnableGadget((struct pOS_Window*)window,(struct pOS_Gadget*)gadget,FALSE); }
  122.  
  123. void OffMenu(struct Window *window,ULONG menuNumber)
  124.   {
  125.     struct pOS_MenuNum MN;
  126.     MN.men_U.men_Num=menuNumber;
  127.     pOS_EnableWindowMenu((APTR)window,&MN,FALSE);
  128.   }
  129.  
  130. void OnGadget(struct Gadget *gadget,struct Window *window,struct Requester* req)
  131.   { pOS_EnableGadget((struct pOS_Window*)window,(struct pOS_Gadget*)gadget,TRUE); }
  132.  
  133. void OnMenu(struct Window *window,ULONG menuNumber)
  134.   {
  135.     struct pOS_MenuNum MN;
  136.     MN.men_U.men_Num=menuNumber;
  137.     pOS_EnableWindowMenu((APTR)window,&MN,TRUE);
  138.   }
  139.  
  140. struct Window *OpenWindow(struct NewWindow *nw)
  141.   { return( OpenWindowTagList(nw,NULL) );}
  142.  
  143.  
  144. void RefreshGadgets(struct Gadget *gadgets,struct Window *window,struct Requester* req)
  145.   { pOS_RefreshGadgets((struct pOS_Window*)window,(struct pOS_Gadget*)gadgets,-1); }
  146.  
  147. UWORD RemoveGadget(struct Window *window,struct Gadget *gadget)
  148.   {  pOS_RemGadget((struct pOS_Window*)window,(struct pOS_Gadget*)gadget);  return(1);}
  149.  
  150. BOOL SetMenuStrip( struct Window *window, struct Menu *menu )
  151.   {
  152.     pOS_SetMenuStrip((struct pOS_Window*)window,(struct pOS_MenuList*)menu);
  153.     return(TRUE);
  154.   }
  155.  
  156. void SetWindowTitles(struct Window *window,UBYTE *windowTitle,UBYTE *screenTitle)
  157.   { pOS_SetWindowTitles((struct pOS_Window*)window,(CHAR*)windowTitle,(CHAR*)screenTitle); }
  158.  
  159.  
  160. void SizeWindow( struct Window *window, long dx, long dy )
  161.   { pOS_ChangeWindowBox((struct pOS_Window*)window,0,0,dx,dy); }
  162.  
  163.  
  164. struct ViewPort *ViewPortAddress( struct Window *window )
  165.   { return((struct ViewPort*) ((struct pOS_Window*)window)->win_Screen->scr_ViewPort  );}
  166.  
  167. void WindowToBack( struct Window *window )
  168.   { pOS_WindowToBack((struct pOS_Window*)window); }
  169.  
  170. void WindowToFront( struct Window *window )
  171.   { pOS_WindowToFront((struct pOS_Window*)window); }
  172.  
  173. BOOL WindowLimits(struct Window *window,long widthMin,long heightMin,ULONG widthMax,ULONG heightMax )
  174.   { return(pOS_SetWindowLimits((struct pOS_Window*)window,widthMin,heightMin,widthMax,heightMax));}
  175.  
  176. void BeginRefresh( struct Window *window )
  177.   { pOS_BeginRefresh((struct pOS_Window*)window,NULL); }
  178.  
  179. void EndRefresh( struct Window *window, long complete )
  180.   { pOS_EndRefresh((struct pOS_Window*)window,complete); }
  181.  
  182. void FreeSysRequest( struct Window *window )
  183.   { pOS_DeleteRequestWin((struct pOS_Window*)window); }
  184.  
  185.  
  186. void RefreshGList(struct Gadget *gadgets,struct Window *window,struct Requester* req,long numGad)
  187.   { pOS_RefreshGadgets((struct pOS_Window*)window,(struct pOS_Gadget*)gadgets,numGad); }
  188.  
  189. UWORD AddGList(struct Window *window,struct Gadget *gadget,ULONG pos,ULONG numGad,struct Requester* req)
  190.   {
  191.     struct Gadget *Next;
  192.     for(; gadget!=NULL && numGad>0; gadget=Next,--numGad) {
  193.       Next=gadget->U.NextGadget;
  194.       gadget->U.gad_Node.mln_Succ=0;
  195.       gadget->U.gad_Node.mln_Pred=0;
  196.       pOS_AddGadget((struct pOS_Window*)window,(struct pOS_Gadget*)gadget);
  197.     }
  198.     return(1);
  199.   }
  200.  
  201. UWORD RemoveGList(struct Window *window,struct Gadget *gadget,ULONG numGad)
  202.   {
  203.     struct Gadget *Next,*Pred;
  204.  
  205.     Pred=NULL;
  206.     for(Next=(struct Gadget*)gadget;
  207.         Next->U.gad_Node.mln_Succ && numGad>0;
  208.         gadget=Next, --numGad)
  209.     {
  210.       Next=(struct Gadget*)gadget->U.gad_Node.mln_Succ;
  211.       pOS_RemGadget((struct pOS_Window*)window,(struct pOS_Gadget*)gadget);
  212.  
  213.       if(Pred) Pred->U.NextGadget=gadget;
  214.       Pred=gadget;
  215.       gadget->U.NextGadget=NULL;
  216.     }
  217.     return(1);
  218.   }
  219.  
  220. void ActivateWindow( struct Window *window )
  221.   { pOS_ActivateWindow((struct pOS_Window*)window); }
  222.  
  223. void RefreshWindowFrame( struct Window *window )
  224.   { pOS_RefreshWindowFrame((struct pOS_Window*)window); }
  225.  
  226. BOOL ActivateGadget(struct Gadget *gadgets,struct Window *window,struct Requester* req)
  227.   { return(pOS_ActivateGadget((struct pOS_Window*)window,(struct pOS_Gadget*)gadgets)); }
  228.  
  229.  
  230. LONG QueryOverscan(unsigned long displayID,struct Rectangle *rect,long oScanType)
  231.   {
  232. //OSCAN_TEXT
  233. //OSCAN_STANDARD
  234. //OSCAN_MAX
  235. //OSCAN_VIDEO
  236.     switch(oScanType) {
  237.        case OSCAN_STANDARD:
  238.     }
  239.     rect->MinX=0;     rect->MinY=0;
  240.     rect->MaxX=639;   rect->MaxY=254;
  241.     return(TRUE);
  242.   }
  243.  
  244.  
  245. void ChangeWindowBox(struct Window *window,long left,long top,long width,long height)
  246.   { pOS_ChangeWindowBox((struct pOS_Window*)window,left,top,width,height); }
  247.  
  248.  
  249. LONG SetMouseQueue(struct Window *window,ULONG queueLength)
  250.   { return( pOS_SetMouseQueue((struct pOS_Window*)window,queueLength) );}
  251.  
  252. void ZipWindow( struct Window *window )
  253.   { pOS_ZipWindow((struct pOS_Window*)window); }
  254.  
  255. struct Screen *LockPubScreen( UBYTE *name )
  256.   {
  257.     return((struct Screen*)pOS_LockPubScreen((CHAR*)name));
  258.   }
  259.  
  260. void UnlockPubScreen( UBYTE *name, struct Screen *screen )
  261.   {
  262.     pOS_UnlockPubScreen((struct pOS_Screen*)screen);
  263.   }
  264.  
  265. UWORD PubScreenStatus(struct Screen *screen,ULONG statusFlags )
  266.   {
  267.     return( statusFlags);
  268. //    return(pOS_PubScreenStatus((struct pOS_Screen*)screen,statusFlags));
  269.   }
  270.  
  271.  
  272. LONG EasyRequestArgs(struct Window *window,struct EasyStruct *easyStruct,ULONG *idcmpPtr,APTR args)
  273.   {
  274.     struct pOS_EasyStruct *ES=(struct pOS_EasyStruct*)easyStruct;
  275.     ES->es_HelpID=0; ES->es_HelpFile=0; ES->es_Tags=0;
  276.     return(pOS_EasyRequestArgs((struct pOS_Window*)window,ES,idcmpPtr,(APTR)args));
  277.   }
  278.  
  279. LONG EasyRequest( struct Window *window, struct EasyStruct *easyStruct,ULONG *idcmpPtr, ... )
  280.   {
  281.     struct pOS_EasyStruct *ES=(struct pOS_EasyStruct*)easyStruct;
  282.     ES->es_HelpID=0; ES->es_HelpFile=0; ES->es_Tags=0;
  283.     return(pOS_EasyRequestArgs((struct pOS_Window*)window,ES,idcmpPtr,(APTR) ((&idcmpPtr)+1) ));
  284.   }
  285.  
  286. LONG SysReqHandler( struct Window *window, ULONG *idcmpPtr, long waitInput )
  287.   { return(pOS_RequestWinHandler((struct pOS_Window*)window,idcmpPtr,waitInput)); }
  288.  
  289. struct Window *OpenWindowTagList(struct NewWindow *nw,struct TagItem *tagList)
  290.   {
  291.     struct Window *Win;
  292.     struct pOS_TagItem Tags[8];
  293.     struct pOS_TagItem *TIGad;
  294.  
  295.     TIGad=pOS_FindTagItem(SCRTAG_Gadget,(struct pOS_TagItem*)tagList);
  296.     if(TIGad) TIGad->ti_Tag=TAG_IGNORE;
  297.  
  298.     if(nw) {
  299.       Tags[0].ti_Tag=SCRTAG_LeftEdge;     Tags[0].ti_Data=nw->LeftEdge;
  300.       Tags[1].ti_Tag=SCRTAG_TopEdge;      Tags[1].ti_Data=nw->TopEdge;
  301.       Tags[2].ti_Tag=SCRTAG_Width;        Tags[2].ti_Data=nw->Width;
  302.       Tags[3].ti_Tag=SCRTAG_Height;       Tags[3].ti_Data=nw->Height;
  303.       Tags[4].ti_Tag=SCRTAG_Screen;       Tags[4].ti_Data=(ULONG)nw->Screen;
  304.       Tags[5].ti_Tag=SCRTAG_Flags;        Tags[5].ti_Data=(ULONG)nw->Flags;
  305.       Tags[6].ti_Tag=SCRTAG_IDCMP;        Tags[6].ti_Data=(ULONG)nw->IDCMPFlags;
  306.       Tags[7].ti_Tag=TAG_MORE;            Tags[7].ti_Data=(ULONG)tagList;
  307.       tagList=(APTR)Tags;
  308.     }
  309.  
  310.     Win=(struct Window*)pOS_OpenWindowA((struct pOS_TagItem*)tagList);
  311.  
  312.     if(TIGad && TIGad->ti_Data) {
  313.       TIGad->ti_Tag=SCRTAG_Gadget;
  314.       if(Win) AddGList(Win,(struct Gadget*)TIGad->ti_Data,~0,~0,NULL);
  315.     }
  316.  
  317.     return(Win);
  318.   }
  319.  
  320. struct Window *OpenWindowTags( struct NewWindow *newWindow,
  321.         unsigned long tag1Type, ... )
  322.   { return( OpenWindowTagList(newWindow,(struct TagItem*)&tag1Type) );}
  323.  
  324. struct Screen *OpenScreenTagList(struct NewScreen *newScreen,struct TagItem *tagList)
  325.   {
  326.     return((APTR)pOS_LockPubScreen(NULL) );
  327.   }
  328. //  { return((struct Screen*)pOS_OpenScreenA((pOS_TagItem*)tagList));}
  329.  
  330.  
  331. struct Screen *OpenScreenTags( struct NewScreen *newScreen,
  332.         unsigned long tag1Type, ... )
  333.   { return( OpenScreenTagList(newScreen,(struct TagItem*)&tag1Type) );}
  334.  
  335.  
  336. APTR NewObjectA(struct IClass *classPtr,UBYTE *classID,struct TagItem *tagList)
  337.   { return(pOS_NewIObjectA((struct pOS_NClass*)classPtr,(CHAR*)classID,0,(struct pOS_TagItem*)tagList));}
  338.  
  339. APTR NewObject(struct IClass *classPtr,UBYTE *classID,ULONG tag1,...)
  340.   { return( NewObjectA(classPtr,classID,(struct TagItem*)&tag1) );}
  341.  
  342.  
  343. void DisposeObject( APTR object )
  344.   { if(object) pOS_DisposeIObject(object); }
  345.  
  346. ULONG SetAttrsA( APTR object, struct TagItem *tagList )
  347. {
  348.   struct pOS_IntuiMethod Mth;
  349.  
  350.   Mth.imth_Method=ICLMTH_Set;
  351.   Mth.imth_U.imth_Set.imst_Info=NULL;
  352.   Mth.imth_U.imth_Set.imst_Tags=(struct pOS_TagItem*)tagList;
  353.   return( pOS_DoIMethodA(object,(struct pOS_Method*)&Mth) );
  354. }
  355.  
  356. ULONG SetAttrs( APTR object, unsigned long tag1, ... )
  357.   { return( SetAttrsA(object,(struct TagItem*)&tag1 ) );}
  358.  
  359.  
  360. ULONG GetAttr( unsigned long attrID, APTR object, ULONG *storagePtr )
  361. {
  362.   struct pOS_IntuiMethod Mth;
  363.  
  364.   Mth.imth_Method=ICLMTH_Get;
  365.   Mth.imth_U.imth_Get.imgt_ID=attrID;
  366.   Mth.imth_U.imth_Get.imgt_Variable=storagePtr;
  367.   return( pOS_DoIMethodA(object,(struct pOS_Method*)&Mth) );
  368. }
  369.  
  370.  
  371. ULONG SetGadgetAttrsA(struct Gadget *gadget,struct Window *window,struct Requester* req,struct TagItem *tagList)
  372.   { return(pOS_SetGadgetAttrsA((struct pOS_Window*)window,(struct pOS_Gadget*)gadget,(struct pOS_TagItem*)tagList));}
  373.  
  374. ULONG SetGadgetAttrs(struct Gadget *gadget,struct Window *window,struct Requester* req,ULONG tag, ...)
  375.   { return(pOS_SetGadgetAttrsA((struct pOS_Window*)window,(struct pOS_Gadget*)gadget,(struct pOS_TagItem*)&tag));}
  376.  
  377. struct DrawInfo *GetScreenDrawInfo( struct Screen *screen )
  378.   { return((struct DrawInfo*) ((struct pOS_Screen*)screen)->scr_DrawInfo);}
  379.  
  380. void FreeScreenDrawInfo( struct Screen *screen, struct DrawInfo *drawInfo )
  381.   {}
  382.  
  383. void ScrollWindowRaster(struct Window *win,long dx,long dy,long xMin,long yMin,long xMax,long yMax)
  384.   {  pOS_ScrollRaster((struct pOS_RastPort*) ((struct pOS_Window*)win)->win_RastPort, dx,dy,xMin,yMin,xMax,yMax,0); }
  385.  
  386.  
  387. void ReportMouse( long flag, struct Window *win )
  388.   {
  389.     pOS_ModifyIDCMP((struct pOS_Window*)win,
  390.         flag ? (IDCMP_MouseMove | win->IDCMPFlags) : (win->IDCMPFlags & ~IDCMP_MouseMove) );
  391.   }
  392.  
  393. void ReportMouse1( struct Window *win, long flag )
  394.   {
  395.     pOS_ModifyIDCMP((struct pOS_Window*)win,
  396.         flag ? (IDCMP_MouseMove | win->IDCMPFlags) : (win->IDCMPFlags & ~IDCMP_MouseMove) );
  397.   }
  398.  
  399. APTR AllocRemember( struct Remember **rememberKey,ULONG size,ULONG flags )
  400.   {
  401.     struct Remember *RB;
  402.  
  403.     RB=(struct Remember*)pOS_AllocMem(size+sizeof(struct Remember),flags);
  404.     if(RB) {
  405.       RB->NextRemember=*rememberKey;
  406.       RB->RememberSize=size;
  407.       RB->Memory=(UBYTE*)(RB+1);
  408.       *rememberKey=RB;
  409.  
  410.       return((APTR) (RB+1));
  411.     }
  412.     return(NULL);
  413.   }
  414.  
  415. void FreeRemember( struct Remember **rememberKey, long reallyForget )
  416.   {
  417.     struct Remember *RB,*RM;
  418.  
  419.     for(RB=*rememberKey; RB; RB=RM) {
  420.       RM=RB->NextRemember;
  421.       RB--;
  422.       pOS_FreeMem(RB,sizeof(struct Remember)+RB->RememberSize);
  423.     }
  424.     *rememberKey=NULL;
  425.   }
  426.  
  427. void MoveScreen( struct Screen *screen, long dx, long dy )
  428.   {
  429.     struct pOS_Screen* Scr=(struct pOS_Screen*)screen;
  430.     pOS_SetScreenPosition(Scr,dx-Scr->scr_LeftEdge,dy-Scr->scr_TopEdge);
  431.   }
  432.  
  433. void ScreenToBack( struct Screen *screen )
  434.   { pOS_ScreenToBack((struct pOS_Screen*)screen); }
  435.  
  436. void ScreenToFront( struct Screen *screen )
  437.   { pOS_ScreenToFront((struct pOS_Screen*)screen); }
  438.  
  439. /*MIC*/ void PrintIText(struct RastPort *rp, struct IntuiText *intuitext, LONG dx, LONG dy)
  440.   {
  441.     struct pOS_RastPort *RastPort;
  442.     struct IntuiText    *Txt;
  443.  
  444.       if(RastPort=(struct pOS_RastPort *)pOS_AllocRastPort(((struct pOS_RastPort *)rp)->rp_Base,GFXTAG_MasterRastPort,rp,TAG_DONE))
  445.       {
  446.         for(Txt=intuitext; Txt; Txt=Txt->NextText)
  447.         {
  448.           struct pOS_TextFont *TxtFont=NULL;
  449.  
  450.           SetFont(RastPort,NULL);   /* default-Font setzen */
  451.  
  452.           if(Txt->ITextFont)
  453.           {
  454.             if((TxtFont=(struct pOS_TextFont *)pOS_OpenFont((struct pOS_TextAttr*)Txt->ITextFont)))
  455.             {
  456.               pOS_SetFont(RastPort,TxtFont);
  457.             }
  458.           }
  459.  
  460.           pOS_SetABPenDrMd(RastPort,Txt->FrontPen,Txt->BackPen,Txt->DrawMode);
  461.           pOS_SetPosition(RastPort,Txt->LeftEdge+dx,Txt->TopEdge+dy+TxtFont->tf_Baseline);
  462.           pOS_DrawText(RastPort,Txt->IText,strlen(Txt->IText));
  463.  
  464.           if(TxtFont)
  465.           {
  466.             pOS_CloseFont(TxtFont);
  467.           }
  468.         }
  469.  
  470.         pOS_FreeRastPort(RastPort);
  471.       }
  472.   }
  473.  
  474. /*MIC*/ LONG IntuiTextLength( struct IntuiText *intuitext )
  475.   {
  476.     struct pOS_Screen   *Screen;
  477.     struct pOS_RastPort *RastPort;
  478.     struct pOS_TextFont *TxtFont=NULL;
  479.     struct pOS_TextDim TextDim;
  480.     TextDim.td_MaxWidth=32000;
  481.  
  482.     if(Screen=pOS_LockPubScreen(NULL))
  483.     {
  484.       if(RastPort=(struct pOS_RastPort *)pOS_AllocRastPort(Screen->scr_RastPort->rp_Base,GFXTAG_RastPort,Screen->scr_RastPort,TAG_DONE))
  485.       {
  486.         if(intuitext->ITextFont)
  487.         {
  488.           if((TxtFont=(struct pOS_TextFont *)pOS_OpenFont((struct pOS_TextAttr*)intuitext->ITextFont)))
  489.           {
  490.             pOS_SetFont(RastPort,TxtFont);
  491.           }
  492.         }
  493.  
  494.         pOS_CalcTextDim(RastPort,intuitext->IText,strlen(intuitext->IText),&TextDim,0);
  495.  
  496.         if(TxtFont)
  497.         {
  498.           pOS_CloseFont(TxtFont);
  499.         }
  500.  
  501.         pOS_FreeRastPort(RastPort);
  502.       }
  503.       pOS_UnlockPubScreen(Screen);
  504.     }
  505.  
  506.     return( TextDim.td_UsedWidth );
  507.   }
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516. #ifdef __IGNORE_NOT_SUPPORTED__
  517.  
  518.  
  519.  
  520.  
  521. BOOL ClearDMRequest( struct Window *window )
  522. {return(0);}
  523. void ClearPointer( struct Window *window )
  524. {}
  525. LONG CloseWorkBench( void )
  526. {return(0);}
  527. BOOL DisplayAlert( unsigned long alertNumber, UBYTE *string,ULONG height )
  528. {return(0);}
  529. void EndRequest( struct Requester *requester, struct Window *window )
  530. {}
  531. struct Preferences *GetDefPrefs( struct Preferences *preferences, long size )
  532. {return(0);}
  533. struct Preferences *GetPrefs( struct Preferences *preferences, long size )
  534. {return(0);}
  535. void InitRequester( struct Requester *requester )
  536. {}
  537. void ModifyProp(struct Gadget*,struct Window*,struct Requester*,ULONG,ULONG,ULONG,ULONG,ULONG)
  538. {}
  539. struct Screen *OpenScreen( struct NewScreen *newScreen )
  540. {return(0);}
  541. ULONG OpenWorkBench( void )
  542. {return(0);}
  543. BOOL Request( struct Requester *requester, struct Window *window )
  544. {return(0);}
  545. BOOL SetDMRequest( struct Window *window, struct Requester *requester )
  546. {return(0);}
  547. void SetPointer(struct Window*,UWORD*,long,long,long,long)
  548. {}
  549. void ShowTitle( struct Screen *screen, long showIt )
  550. {}
  551. struct View *ViewAddress( void )
  552. {return(0);}
  553. struct Preferences *SetPrefs(struct Preferences*,long,long)
  554. {return(0);}
  555. BOOL WBenchToBack( void )
  556. {return(0);}
  557. BOOL WBenchToFront( void )
  558. {return(0);}
  559. BOOL AutoRequest(struct Window*,struct IntuiText*,struct IntuiText*,struct IntuiText*,ULONG,ULONG,ULONG,ULONG)
  560. {return(0);}
  561. struct Window *BuildSysRequest(struct Window*,struct IntuiText*,struct IntuiText*,struct IntuiText*,ULONG,ULONG,ULONG)
  562. {return(0);}
  563. LONG MakeScreen( struct Screen *screen )
  564. {return(0);}
  565. LONG RemakeDisplay( void )
  566. {return(0);}
  567. LONG RethinkDisplay( void )
  568. {return(0);}
  569. ULONG LockIBase( unsigned long dontknow )
  570. {return(0);}
  571. void UnlockIBase( unsigned long ibLock )
  572. {}
  573. LONG GetScreenData(APTR,ULONG,ULONG,struct Screen*)
  574. {return(0);}
  575. void NewModifyProp(struct Gadget*,struct Window*,struct Requester*,ULONG,ULONG,ULONG,ULONG,ULONG,SLONG)
  576. {}
  577. void MoveWindowInFrontOf( struct Window*,struct Window*)
  578. {}
  579. struct Hook *SetEditHook(struct Hook*)
  580. {return(0);}
  581. struct List *LockPubScreenList( void )
  582. {return(0);}
  583. void UnlockPubScreenList( void )
  584. {}
  585. UBYTE *NextPubScreen( struct Screen *screen, UBYTE *namebuf )
  586. {return(0);}
  587. void SetDefaultPubScreen( UBYTE *name )
  588. {}
  589. UWORD SetPubScreenModes( unsigned long modes )
  590. {return(0);}
  591. struct RastPort *ObtainGIRPort( struct GadgetInfo *gInfo )
  592. {return(0);}
  593. void ReleaseGIRPort( struct RastPort *rp )
  594. {}
  595. void GadgetMouse(struct Gadget*,struct GadgetInfo*,WORD*)
  596. {}
  597. void GetDefaultPubScreen( UBYTE *nameBuffer )
  598. {}
  599. struct Window *BuildEasyRequestArgs(struct Window*,struct EasyStruct*,ULONG,APTR)
  600. {return(0);}
  601. struct Window *BuildEasyRequest(struct Window*,struct EasyStruct*,ULONG, ... )
  602. {return(0);}
  603. void DrawImageState(struct RastPort*,struct Image*,long,long,ULONG,struct DrawInfo*)
  604. {}
  605. BOOL PointInImage( unsigned long point, struct Image *image )
  606. {return(0);}
  607. void EraseImage(struct RastPort*,struct Image*,long,long)
  608. {}
  609. APTR NextObject( APTR objectPtrPtr )
  610. {return(0);}
  611. struct IClass *MakeClass(UBYTE*,UBYTE*,struct IClass*,ULONG,ULONG)
  612. {return(0);}
  613. void AddClass( struct IClass *classPtr )
  614. {}
  615. BOOL ResetMenuStrip( struct Window *window, struct Menu *menu )
  616. {return(0);}
  617. void RemoveClass( struct IClass *classPtr )
  618. {}
  619. BOOL FreeClass( struct IClass *classPtr )
  620. {return(0);}
  621. struct ScreenBuffer *AllocScreenBuffer(struct Screen*,struct BitMap*,ULONG)
  622. {return(0);}
  623. void FreeScreenBuffer( struct Screen *sc, struct ScreenBuffer *sb )
  624. {}
  625. ULONG ChangeScreenBuffer( struct Screen *sc, struct ScreenBuffer *sb )
  626. {return(0);}
  627. void ScreenDepth( struct Screen *screen, unsigned long flags, APTR reserved )
  628. {}
  629. void ScreenPosition(struct Screen*,ULONG,long,long,long,long)
  630. {}
  631. void LendMenus( struct Window *fromwindow, struct Window *towindow )
  632. {}
  633. ULONG DoGadgetMethodA(struct Gadget*,struct Window*,struct Requester*,APTR)
  634. {return(0);}
  635. ULONG DoGadgetMethod(struct Gadget*,struct Window*,struct Requester*,ULONG, ... )
  636. {return(0);}
  637. void SetWindowPointerA( struct Window *win, struct TagItem *taglist )
  638. {}
  639. void SetWindowPointer( struct Window *win, unsigned long tag1, ... )
  640. {}
  641. BOOL TimedDisplayAlert(ULONG,UBYTE*,ULONG,ULONG)
  642. {return(0);}
  643. void HelpControl( struct Window *win, unsigned long flags )
  644. {}
  645.  
  646. #endif  /** __IGNORE_NOT_SUPPORTED__ **/
  647.  
  648.  
  649.  
  650. #endif
  651.