Index: ERRORS.H =================================================================== RCS file: /cvs/mushclient/ERRORS.H,v retrieving revision 1.26 retrieving revision 1.28 diff -c -r1.26 -r1.28 *** ERRORS.H 26 Feb 2006 02:37:21 -0000 1.26 --- ERRORS.H 23 Jul 2008 06:24:53 -0000 1.28 *************** *** 70,78 **** eItemInUse, // cannot delete trigger/alias/timer because it is executing a script = 30063 eSpellCheckNotActive, // spell checker is not active = 30064 #ifdef PANE ! ePaneAlreadyExists, // specified pane cannot be created because it already exists = 30065 ! ePaneDoesNotExist, // specified pane does not exist = 30065 #endif // if you add things see lua_methods.cpp - there is a copy there --- 70,92 ---- eItemInUse, // cannot delete trigger/alias/timer because it is executing a script = 30063 eSpellCheckNotActive, // spell checker is not active = 30064 + // stuff for miniwindows + + eCannotAddFont, // cannot create requested font = 30065 + ePenStyleNotValid, // invalid settings for pen parameter = 30066 + eUnableToLoadImage, // bitmap image could not be loaded = 30067 + eImageNotInstalled, // image has not been loaded into window = 30068 + eInvalidNumberOfPoints, // number of points supplied is incorrect = 30069 + eInvalidPoint, // point is not numeric = 30070 + eHotspotPluginChanged, // hotspot processing must all be in same plugin = 30071 + eHotspotNotInstalled, // hotspot has not been defined for this window = 30072 + eNoSuchWindow, // requested miniwindow does not exist = 30073 + eBrushStyleNotValid, // invalid settings for brush parameter = 30074 + + #ifdef PANE ! ePaneAlreadyExists, // specified pane cannot be created because it already exists = 30073 ! ePaneDoesNotExist, // specified pane does not exist = 30074 #endif // if you add things see lua_methods.cpp - there is a copy there Index: MUSHclient.dsp =================================================================== RCS file: /cvs/mushclient/MUSHclient.dsp,v retrieving revision 1.99 retrieving revision 1.100 diff -c -r1.99 -r1.100 *** MUSHclient.dsp 21 Jun 2008 04:43:53 -0000 1.99 --- MUSHclient.dsp 16 Jul 2008 20:52:28 -0000 1.100 *************** *** 179,184 **** --- 179,188 ---- # End Source File # Begin Source File + SOURCE=.\MiniWindow.cpp + # End Source File + # Begin Source File + SOURCE=.\MUSHclient.cpp # End Source File # Begin Source File *************** *** 1475,1480 **** --- 1479,1487 ---- # End Source File # End Target # End Project + # Section MUSHclient : {00000000-0001-0000-0000-000000000000} + # 1:23:CG_IDR_POPUP_MAIN_FRAME:126 + # End Section # Section MUSHclient : {F3B13065-16CC-11D0-B7D0-00A0247B3BFD} # 0:8:TipDlg.h:D:\SOURCE\MUSHclient\TipDlg.h # 0:10:TipDlg.cpp:D:\SOURCE\MUSHclient\TipDlg.cpp *************** *** 1521,1527 **** # End Section # Section MUSHclient : {00000000-000C-0000-0C00-00004944445F} # 1:26:CG_IDR_POPUP_ACTIVITY_VIEW:127 - # End Section - # Section MUSHclient : {00000000-0001-0000-0000-000000000000} - # 1:23:CG_IDR_POPUP_MAIN_FRAME:126 # End Section --- 1528,1531 ---- Index: MUSHclient.rc =================================================================== RCS file: /cvs/mushclient/MUSHclient.rc,v retrieving revision 1.224 diff -c -r1.224 MUSHclient.rc *** MUSHclient.rc 10 Jul 2008 01:24:51 -0000 1.224 --- MUSHclient.rc 26 Jul 2008 06:14:11 -0000 *************** *** 75,82 **** // VS_VERSION_INFO VERSIONINFO ! FILEVERSION 4,0,33,0 ! PRODUCTVERSION 4,0,33,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L --- 75,82 ---- // VS_VERSION_INFO VERSIONINFO ! FILEVERSION 4,0,34,0 ! PRODUCTVERSION 4,0,34,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L *************** *** 94,107 **** VALUE "Comments", "MUSHclient - a client program for playing MUD games\0" VALUE "CompanyName", "Gammon Software Solutions\0" VALUE "FileDescription", "MUSHclient\0" ! VALUE "FileVersion", "4.33\0" VALUE "InternalName", "MUSHCLIENT\0" VALUE "LegalCopyright", "Copyright © 2008 Gammon Software Solutions\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "MUSHCLIENT.EXE\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "MUSHclient\0" ! VALUE "ProductVersion", "4.33\0" VALUE "SpecialBuild", "\0" END END --- 94,107 ---- VALUE "Comments", "MUSHclient - a client program for playing MUD games\0" VALUE "CompanyName", "Gammon Software Solutions\0" VALUE "FileDescription", "MUSHclient\0" ! VALUE "FileVersion", "4.34\0" VALUE "InternalName", "MUSHCLIENT\0" VALUE "LegalCopyright", "Copyright © 2008 Gammon Software Solutions\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "MUSHCLIENT.EXE\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "MUSHclient\0" ! VALUE "ProductVersion", "4.34\0" VALUE "SpecialBuild", "\0" END END Index: OtherTypes.h =================================================================== RCS file: /cvs/mushclient/OtherTypes.h,v retrieving revision 1.76 retrieving revision 1.94 diff -c -r1.76 -r1.94 *** OtherTypes.h 6 Jul 2008 03:40:55 -0000 1.76 --- OtherTypes.h 26 Jul 2008 06:13:19 -0000 1.94 *************** *** 1096,1099 **** string sValue_; // value ! }; // end of class CStringValuePair \ No newline at end of file --- 1096,1295 ---- string sValue_; // value ! }; // end of class CStringValuePair ! ! ! // for imbedded windows ! ! // fonts ! typedef map FontMap; ! typedef FontMap::iterator FontMapIterator; ! ! // images ! typedef map ImageMap; ! typedef ImageMap::iterator ImageMapIterator; ! ! ! // hotspots ! class CHotspot ! { ! ! public: ! ! CHotspot () : m_Cursor (0), m_Flags (0) {} // constructor ! ! CRect m_rect; // where it is ! ! string m_sMouseOver; // function to call on mouseover ! string m_sCancelMouseOver; // function to call when mouse moves away or is clicked ! ! string m_sMouseDown; // mouse down here (might cancel mouseover first) ! string m_sCancelMouseDown; // they let go somewhere else ! string m_sMouseUp; // mouse up following a mouse-down in this hotspot ! ! string m_sTooltipText; // tooltip text ! ! long m_Cursor; // what cursor to show ! long m_Flags; // flags ! }; // end of class CStringValuePair ! ! ! typedef map HotspotMap; ! typedef HotspotMap::iterator HotspotMapIterator; ! ! // flags ! ! #define MINIWINDOW_DRAW_UNDERNEATH 0x01 // draw underneath scrolling text ! #define MINIWINDOW_ABSOLUTE_LOCATION 0x02 // use m_iLeft, m_iTop to position ! #define MINIWINDOW_TRANSPARENT 0x04 // draw transparently, using m_iBackgroundColour ! ! class CMiniWindow ! { ! private: ! ! CDC dc; // our offscreen device context ! CBitmap * m_oldBitmap; // bitmap originally found in CMyMemDC ! CBitmap m_Bitmap; // where it all happens ! FontMap m_Fonts; // all the fonts they want ! ImageMap m_Images; // other images they may want to blt onto the window ! ! long m_iWidth; ! long m_iHeight; ! ! CPoint m_Location; // left, top position (if absolute position) ! short m_iPosition; // where to position it ! long m_iFlags; // see defines above ! COLORREF m_iBackgroundColour; ! ! bool m_bShow; // true = draw it ! ! ! public: ! CMiniWindow (); // constructor ! ! ~CMiniWindow (); // destructor ! ! ! CRect m_rect; // where we actually put it ! bool m_bTemporarilyHide; // no room right now ! HotspotMap m_Hotspots; // where we can click with the mouse ! ! string m_sMouseOverHotspot; // last hotspot we moused over ! string m_sMouseDownHotspot; // last hotspot we mouse clicked in ! ! string m_sCallbackPlugin; // plugin we are using ! ! const long GetWidth () const { return m_iWidth; } ! const long GetHeight () const { return m_iHeight; } ! const short GetPosition () const { return m_iPosition; } ! const bool GetShow () const { return m_bShow; } ! const long GetFlags () const { return m_iFlags; } ! const CPoint GetLocation () const { return m_Location; } ! const COLORREF GetBackgroundColour () const { return m_iBackgroundColour; } ! ! void Create (long Left, long Top, long Width, long Height, ! short Position, long Flags, ! COLORREF iBackgroundColour); ! ! void Show (bool bShow); ! ! CDC* GetDC (void) { return &dc; } ! ! long FixRight (const long Right); ! long FixBottom (const long Bottom); ! ! void Info (long InfoType, VARIANT & vaResult); ! ! long RectOp (short Action, long Left, ! long Top, long Right, long Bottom, ! long Colour1, long Colour2); ! ! long CircleOp (short Action, ! long Left, long Top, long Right, long Bottom, ! long PenColour, long PenStyle, long PenWidth, ! long BrushColour, long BrushStyle, ! long Extra1, long Extra2, long Extra3, long Extra4); ! ! long Font (LPCTSTR FontId, LPCTSTR FontName, ! double Size, ! BOOL Bold, BOOL Italic, BOOL Underline, BOOL Strikeout, ! short Charset, short PitchAndFamily); ! ! void FontInfo (LPCTSTR FontId, long InfoType, VARIANT & vaResult); ! void FontList (VARIANT & vaResult); ! ! long Text (LPCTSTR FontId, // which previously-created font ! LPCTSTR Text, // what to say ! long Left, long Top, long Right, long Bottom, // where to put it ! long Colour, // colour to show it in ! BOOL Unicode); // true if UTF8 ! ! long TextWidth (LPCTSTR FontId, // which previously-created font ! LPCTSTR Text, // what to measure ! BOOL Unicode); // true if UTF8 ! ! long Line (long x1, long y1, long x2, long y2, ! long PenColour, long PenStyle, long PenWidth); ! ! long Arc (long Left, long Top, long Right, long Bottom, ! long x1, long y1, ! long x2, long y2, ! long PenColour, long PenStyle, long PenWidth); ! ! long LoadImage (LPCTSTR ImageId, LPCTSTR FileName); ! ! long DrawImage(LPCTSTR ImageId, ! long Left, long Top, long Right, long Bottom, ! short Mode, ! long SrcLeft, long SrcTop, long SrcRight, long SrcBottom); ! ! void ImageList(VARIANT & vaResult); ! ! void ImageInfo(LPCTSTR ImageId, long InfoType, VARIANT & vaResult); ! ! long Bezier(LPCTSTR Points, long PenColour, long PenStyle, long PenWidth); ! ! long Polygon(LPCTSTR Points, ! long PenColour, short PenStyle, long PenWidth, ! long BrushColour, long BrushStyle, ! BOOL Close, ! BOOL Winding); ! ! long Position(long Left, long Top, ! short Position, ! long Flags); ! ! ! long AddHotspot(LPCTSTR HotspotId, ! string sPluginID, ! long Left, long Top, long Right, long Bottom, ! LPCTSTR MouseOver, ! LPCTSTR CancelMouseOver, ! LPCTSTR MouseDown, ! LPCTSTR CancelMouseDown, ! LPCTSTR MouseUp, ! LPCTSTR TooltipText, ! long Cursor, ! long Flags); ! ! long DeleteHotspot(LPCTSTR HotspotId); ! void HotspotList(VARIANT & vaResult); ! long DeleteAllHotspots(); ! ! void HotspotInfo(LPCTSTR HotspotId, ! long InfoType, VARIANT & vaResult); ! ! long ImageOp(short Action, ! long Left, long Top, long Right, long Bottom, ! long PenColour, long PenStyle, long PenWidth, ! long BrushColour, LPCTSTR ImageId, ! long EllipseWidth, long EllipseHeight); ! ! long CreateImage(LPCTSTR ImageId, ! long Row1, long Row2, long Row3, long Row4, long Row5, long Row6, long Row7, long Row8); ! ! }; ! ! typedef map MiniWindowMap; ! ! typedef MiniWindowMap::iterator MiniWindowMapIterator; Index: Splash.cpp =================================================================== RCS file: /cvs/mushclient/Splash.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -c -r1.8 -r1.9 *** Splash.cpp 1 Apr 2007 03:47:32 -0000 1.8 --- Splash.cpp 24 Jul 2008 01:28:44 -0000 1.9 *************** *** 178,184 **** CenterWindow(); // Set a timer to destroy the splash screen. ! SetTimer(SPLASH_SCREEN_TIMER_ID, m_bNick ? 10000 : 4000, NULL); return 0; } --- 178,191 ---- CenterWindow(); // Set a timer to destroy the splash screen. ! SetTimer(SPLASH_SCREEN_TIMER_ID, m_bNick ? 10000 : ! #ifdef _DEBUG ! 500, ! #else ! 4000, ! #endif ! ! NULL); return 0; } Index: doc.cpp =================================================================== RCS file: /cvs/mushclient/doc.cpp,v retrieving revision 1.235 retrieving revision 1.250 diff -c -r1.235 -r1.250 *** doc.cpp 10 Jul 2008 01:24:51 -0000 1.235 --- doc.cpp 26 Jul 2008 06:13:19 -0000 1.250 *************** *** 511,516 **** --- 511,547 ---- DISP_FUNCTION(CMUSHclientDoc, "ShiftTabCompleteItem", ShiftTabCompleteItem, VT_I4, VTS_BSTR) DISP_FUNCTION(CMUSHclientDoc, "NotepadReadOnly", NotepadReadOnly, VT_I4, VTS_BSTR VTS_BOOL) DISP_FUNCTION(CMUSHclientDoc, "AddFont", AddFont, VT_I4, VTS_BSTR) + DISP_FUNCTION(CMUSHclientDoc, "SetBackgroundImage", SetBackgroundImage, VT_I4, VTS_BSTR VTS_I2) + DISP_FUNCTION(CMUSHclientDoc, "SetForegroundImage", SetForegroundImage, VT_I4, VTS_BSTR VTS_I2) + DISP_FUNCTION(CMUSHclientDoc, "SetBackgroundColour", SetBackgroundColour, VT_I4, VTS_I4) + DISP_FUNCTION(CMUSHclientDoc, "WindowRectOp", WindowRectOp, VT_I4, VTS_BSTR VTS_I2 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4) + DISP_FUNCTION(CMUSHclientDoc, "WindowShow", WindowShow, VT_I4, VTS_BSTR VTS_BOOL) + DISP_FUNCTION(CMUSHclientDoc, "WindowTextWidth", WindowTextWidth, VT_I4, VTS_BSTR VTS_BSTR VTS_BSTR VTS_BOOL) + DISP_FUNCTION(CMUSHclientDoc, "WindowFontInfo", WindowFontInfo, VT_VARIANT, VTS_BSTR VTS_BSTR VTS_I4) + DISP_FUNCTION(CMUSHclientDoc, "WindowLine", WindowLine, VT_I4, VTS_BSTR VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4) + DISP_FUNCTION(CMUSHclientDoc, "WindowArc", WindowArc, VT_I4, VTS_BSTR VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4) + DISP_FUNCTION(CMUSHclientDoc, "WindowList", WindowList, VT_VARIANT, VTS_NONE) + DISP_FUNCTION(CMUSHclientDoc, "WindowFontList", WindowFontList, VT_VARIANT, VTS_BSTR) + DISP_FUNCTION(CMUSHclientDoc, "WindowInfo", WindowInfo, VT_VARIANT, VTS_BSTR VTS_I4) + DISP_FUNCTION(CMUSHclientDoc, "WindowLoadImage", WindowLoadImage, VT_I4, VTS_BSTR VTS_BSTR VTS_BSTR) + DISP_FUNCTION(CMUSHclientDoc, "WindowImageList", WindowImageList, VT_VARIANT, VTS_BSTR) + DISP_FUNCTION(CMUSHclientDoc, "WindowText", WindowText, VT_I4, VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_BOOL) + DISP_FUNCTION(CMUSHclientDoc, "WindowDrawImage", WindowDrawImage, VT_I4, VTS_BSTR VTS_BSTR VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I2 VTS_I4 VTS_I4 VTS_I4 VTS_I4) + DISP_FUNCTION(CMUSHclientDoc, "WindowImageInfo", WindowImageInfo, VT_VARIANT, VTS_BSTR VTS_BSTR VTS_I4) + DISP_FUNCTION(CMUSHclientDoc, "GetDeviceCaps", GetDeviceCaps, VT_I4, VTS_I4) + DISP_FUNCTION(CMUSHclientDoc, "WindowBezier", WindowBezier, VT_I4, VTS_BSTR VTS_BSTR VTS_I4 VTS_I4 VTS_I4) + DISP_FUNCTION(CMUSHclientDoc, "WindowCreate", WindowCreate, VT_I4, VTS_BSTR VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I2 VTS_I4 VTS_I4) + DISP_FUNCTION(CMUSHclientDoc, "WindowPosition", WindowPosition, VT_I4, VTS_BSTR VTS_I4 VTS_I4 VTS_I2 VTS_I4) + DISP_FUNCTION(CMUSHclientDoc, "WindowDeleteHotspot", WindowDeleteHotspot, VT_I4, VTS_BSTR VTS_BSTR) + DISP_FUNCTION(CMUSHclientDoc, "WindowHotspotList", WindowHotspotList, VT_VARIANT, VTS_BSTR) + DISP_FUNCTION(CMUSHclientDoc, "WindowDeleteAllHotspots", WindowDeleteAllHotspots, VT_I4, VTS_BSTR) + DISP_FUNCTION(CMUSHclientDoc, "WindowHotspotInfo", WindowHotspotInfo, VT_VARIANT, VTS_BSTR VTS_BSTR VTS_I4) + DISP_FUNCTION(CMUSHclientDoc, "WindowPolygon", WindowPolygon, VT_I4, VTS_BSTR VTS_BSTR VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_BOOL VTS_BOOL) + DISP_FUNCTION(CMUSHclientDoc, "WindowAddHotspot", WindowAddHotspot, VT_I4, VTS_BSTR VTS_BSTR VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I4) + DISP_FUNCTION(CMUSHclientDoc, "WindowCircleOp", WindowCircleOp, VT_I4, VTS_BSTR VTS_I2 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4) + DISP_FUNCTION(CMUSHclientDoc, "WindowCreateImage", WindowCreateImage, VT_I4, VTS_BSTR VTS_BSTR VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4) + DISP_FUNCTION(CMUSHclientDoc, "WindowImageOp", WindowImageOp, VT_I4, VTS_BSTR VTS_I2 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_BSTR VTS_I4 VTS_I4) + DISP_FUNCTION(CMUSHclientDoc, "WindowFont", WindowFont, VT_I4, VTS_BSTR VTS_BSTR VTS_BSTR VTS_R8 VTS_BOOL VTS_BOOL VTS_BOOL VTS_BOOL VTS_I2 VTS_I2) DISP_PROPERTY_PARAM(CMUSHclientDoc, "NormalColour", GetNormalColour, SetNormalColour, VT_I4, VTS_I2) DISP_PROPERTY_PARAM(CMUSHclientDoc, "BoldColour", GetBoldColour, SetBoldColour, VT_I4, VTS_I2) DISP_PROPERTY_PARAM(CMUSHclientDoc, "CustomColourText", GetCustomColourText, SetCustomColourText, VT_I4, VTS_I2) *************** *** 617,642 **** } // end of not having a positions array yet - // background image stuff - not an enormous success - - /* - CString szFilename ("g:\\source\\mushclient\\example.bmp"); - HBITMAP hBmp = (HBITMAP)::LoadImage( - NULL, - szFilename, - IMAGE_BITMAP, - 0, - 0, - LR_LOADFROMFILE|LR_CREATEDIBSECTION - ); - - if( hBmp) - { - m_bitmap.Attach( hBmp ); - } // end of having a bitmap loaded - - */ - // we defer allocating the first line to now, because m_nWrapColumn is read from the // document file. --- 648,653 ---- *************** *** 7919,7923 **** m_strSpecialFontName.Empty (); } - --- 7930,7933 ---- Index: doc.h =================================================================== RCS file: /cvs/mushclient/doc.h,v retrieving revision 1.251 retrieving revision 1.266 diff -c -r1.251 -r1.266 *** doc.h 10 Jul 2008 01:24:51 -0000 1.251 --- doc.h 26 Jul 2008 06:13:19 -0000 1.266 *************** *** 21,28 **** // New versions - things to change ! #define THISVERSION 433 // Step 1. ! const CString MUSHCLIENT_VERSION = "4.33"; // Step 2. // Step 3. Don't forget VERSION resource in Resources tab // Step 4. Remember: README.TXT --- 21,28 ---- // New versions - things to change ! #define THISVERSION 434 // Step 1. ! const CString MUSHCLIENT_VERSION = "4.34"; // Step 2. // Step 3. Don't forget VERSION resource in Resources tab // Step 4. Remember: README.TXT *************** *** 1198,1209 **** long AddSpecialFont (LPCTSTR PathName); void RemoveSpecialFont (void); - /* // background image ! CPalette m_pal; ! CBitmap m_bitmap; ! */ // for DirectSound LPDIRECTSOUNDBUFFER m_pDirectSoundSecondaryBuffer [MAX_SOUND_BUFFERS]; --- 1198,1216 ---- long AddSpecialFont (LPCTSTR PathName); void RemoveSpecialFont (void); // background image ! CString m_strBackgroundImageName; ! CBitmap m_BackgroundBitmap; ! int m_iBackgroundMode; ! ! COLORREF m_iBackgroundColour; ! ! // foreground image ! CString m_strForegroundImageName; ! CBitmap m_ForegroundBitmap; ! int m_iForegroundMode; ! MiniWindowMap m_MiniWindows; // for DirectSound LPDIRECTSOUNDBUFFER m_pDirectSoundSecondaryBuffer [MAX_SOUND_BUFFERS]; *************** *** 2451,2456 **** --- 2458,2494 ---- afx_msg long ShiftTabCompleteItem(LPCTSTR Item); afx_msg long NotepadReadOnly(LPCTSTR Title, BOOL ReadOnly); afx_msg long AddFont(LPCTSTR PathName); + afx_msg long SetBackgroundImage(LPCTSTR FileName, short Mode); + afx_msg long SetForegroundImage(LPCTSTR FileName, short Mode); + afx_msg long SetBackgroundColour(long Colour); + afx_msg long WindowRectOp(LPCTSTR Name, short Action, long Left, long Top, long Right, long Bottom, long Colour1, long Colour2); + afx_msg long WindowShow(LPCTSTR Name, BOOL Show); + afx_msg long WindowTextWidth(LPCTSTR Name, LPCTSTR FontId, LPCTSTR Text, BOOL Unicode); + afx_msg VARIANT WindowFontInfo(LPCTSTR Name, LPCTSTR FontId, long InfoType); + afx_msg long WindowLine(LPCTSTR Name, long x1, long y1, long x2, long y2, long PenColour, long PenStyle, long PenWidth); + afx_msg long WindowArc(LPCTSTR Name, long Left, long Top, long Right, long Bottom, long x1, long y1, long x2, long y2, long PenColour, long PenStyle, long PenWidth); + afx_msg VARIANT WindowList(); + afx_msg VARIANT WindowFontList(LPCTSTR Name); + afx_msg VARIANT WindowInfo(LPCTSTR Name, long InfoType); + afx_msg long WindowLoadImage(LPCTSTR Name, LPCTSTR ImageId, LPCTSTR FileName); + afx_msg VARIANT WindowImageList(LPCTSTR Name); + afx_msg long WindowText(LPCTSTR Name, LPCTSTR FontId, LPCTSTR Text, long Left, long Top, long Right, long Bottom, long Colour, BOOL Unicode); + afx_msg long WindowDrawImage(LPCTSTR Name, LPCTSTR ImageId, long Left, long Top, long Right, long Bottom, short Mode, long SrcLeft, long SrcTop, long SrcRight, long SrcBottom); + afx_msg VARIANT WindowImageInfo(LPCTSTR Name, LPCTSTR ImageId, long InfoType); + afx_msg long GetDeviceCaps(long Index); + afx_msg long WindowBezier(LPCTSTR Name, LPCTSTR Points, long PenColour, long PenStyle, long PenWidth); + afx_msg long WindowCreate(LPCTSTR Name, long Left, long Top, long Width, long Height, short Position, long Flags, long BackgroundColour); + afx_msg long WindowPosition(LPCTSTR Name, long Left, long Top, short Position, long Flags); + afx_msg long WindowDeleteHotspot(LPCTSTR Name, LPCTSTR HotspotId); + afx_msg VARIANT WindowHotspotList(LPCTSTR Name); + afx_msg long WindowDeleteAllHotspots(LPCTSTR Name); + afx_msg VARIANT WindowHotspotInfo(LPCTSTR Name, LPCTSTR HotspotId, long InfoType); + afx_msg long WindowPolygon(LPCTSTR Name, LPCTSTR Points, long PenColour, long PenStyle, long PenWidth, long BrushColour, long BrushStyle, BOOL Close, BOOL Winding); + afx_msg long WindowAddHotspot(LPCTSTR Name, LPCTSTR HotspotId, long Left, long Top, long Right, long Bottom, LPCTSTR MouseOver, LPCTSTR CancelMouseOver, LPCTSTR MouseDown, LPCTSTR CancelMouseDown, LPCTSTR MouseUp, LPCTSTR TooltipText, long Cursor, long Flags); + afx_msg long WindowCircleOp(LPCTSTR Name, short Action, long Left, long Top, long Right, long Bottom, long PenColour, long PenStyle, long PenWidth, long BrushColour, long BrushStyle, long Extra1, long Extra2, long Extra3, long Extra4); + afx_msg long WindowCreateImage(LPCTSTR Name, LPCTSTR ImageId, long Row1, long Row2, long Row3, long Row4, long Row5, long Row6, long Row7, long Row8); + afx_msg long WindowImageOp(LPCTSTR Name, short Action, long Left, long Top, long Right, long Bottom, long PenColour, long PenStyle, long PenWidth, long BrushColour, LPCTSTR ImageId, long EllipseWidth, long EllipseHeight); + afx_msg long WindowFont(LPCTSTR Name, LPCTSTR FontId, LPCTSTR FontName, double Size, BOOL Bold, BOOL Italic, BOOL Underline, BOOL Strikeout, short Charset, short PitchAndFamily); afx_msg long GetNormalColour(short WhichColour); afx_msg void SetNormalColour(short WhichColour, long nNewValue); afx_msg long GetBoldColour(short WhichColour); Index: doc_construct.cpp =================================================================== RCS file: /cvs/mushclient/doc_construct.cpp,v retrieving revision 1.32 retrieving revision 1.36 diff -c -r1.32 -r1.36 *** doc_construct.cpp 8 Jul 2008 03:49:51 -0000 1.32 --- doc_construct.cpp 17 Jul 2008 02:25:21 -0000 1.36 *************** *** 46,51 **** --- 46,55 ---- m_CurrentPlugin = NULL; // no plugin active right now + m_iBackgroundMode = 0; + m_iForegroundMode = 0; + m_iBackgroundColour = NO_COLOUR; + m_iCurrentActionSource = eUnknownActionSource; m_nBytesIn = 0; m_nBytesOut = 0; *************** *** 584,589 **** --- 588,601 ---- safe_for_each (m_PaneMap.begin (), m_PaneMap.end (), closepane); #endif // PANE + + // delete MiniWindow map + + for (MiniWindowMapIterator mwit = m_MiniWindows.begin (); + mwit != m_MiniWindows.end (); + mwit++) + delete mwit->second; + } Index: functionlist.cpp =================================================================== RCS file: /cvs/mushclient/functionlist.cpp,v retrieving revision 1.36 retrieving revision 1.49 diff -c -r1.36 -r1.49 *** functionlist.cpp 8 Jul 2008 03:49:51 -0000 1.36 --- functionlist.cpp 24 Jul 2008 01:28:44 -0000 1.49 *************** *** 144,149 **** --- 144,150 ---- "GetCurrentValue", "GetCustomColourName", "GetDefaultValue", + "GetDeviceCaps", "GetEntity", "GetFrame", "GetGlobalOption", *************** *** 300,312 **** "SendSpecial", "SendToNotepad", "SetAliasOption", ! "SetAlphaOption", "SetChanged", "SetChatOption", "SetClipboard", "SetCommand", "SetCustomColourName", "SetEntity", "SetInputFont", "SetNotes", "SetOption", --- 301,316 ---- "SendSpecial", "SendToNotepad", "SetAliasOption", ! "SetAlphaOption", ! "SetBackgroundColour", ! "SetBackgroundImage", "SetChanged", "SetChatOption", "SetClipboard", "SetCommand", "SetCustomColourName", "SetEntity", + "SetForegroundImage", "SetInputFont", "SetNotes", "SetOption", *************** *** 337,343 **** "UdpListen", "UdpPortList", "UdpSend", ! "Version", "WorldAddress", "WorldName", "WorldPort", --- 341,374 ---- "UdpListen", "UdpPortList", "UdpSend", ! "Version", ! "WindowAddHotspot", ! "WindowArc", ! "WindowBezier", ! "WindowCircleOp", ! "WindowCreate", ! "WindowCreateImage", ! "WindowDeleteAllHotspots", ! "WindowDeleteHotspot", ! "WindowDrawImage", ! "WindowFont", ! "WindowFontInfo", ! "WindowFontList", ! "WindowHotspotInfo", ! "WindowHotspotList", ! "WindowImageInfo", ! "WindowImageList", ! "WindowImageOp", ! "WindowInfo", ! "WindowLine", ! "WindowList", ! "WindowLoadImage", ! "WindowPolygon", ! "WindowPosition", ! "WindowRectOp", ! "WindowShow", ! "WindowText", ! "WindowTextWidth", "WorldAddress", "WorldName", "WorldPort", Index: lua_methods.cpp =================================================================== RCS file: /cvs/mushclient/lua_methods.cpp,v retrieving revision 1.92 retrieving revision 1.108 diff -c -r1.92 -r1.108 *** lua_methods.cpp 10 Jul 2008 01:24:51 -0000 1.92 --- lua_methods.cpp 24 Jul 2008 01:28:44 -0000 1.108 *************** *** 2129,2134 **** --- 2129,2143 ---- return pushVariant (L, v); } // end of L_GetDefaultValue + //---------------------------------------- + // world.GetDeviceCaps + //---------------------------------------- + static int L_GetDeviceCaps (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + lua_pushnumber (L, pDoc->GetDeviceCaps (my_checknumber (L, 1))); + return 1; // number of result fields + } // end of L_GetDeviceCaps //---------------------------------------- // world.GetEntity *************** *** 4412,4417 **** --- 4421,4450 ---- return 1; // number of result fields } // end of L_SetAlphaOption + //---------------------------------------- + // world.SetBackgroundColour + //---------------------------------------- + static int L_SetBackgroundColour (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + lua_pushnumber (L, pDoc->SetBackgroundColour ( + my_checknumber (L, 1) // RGB colour + )); + return 1; // number of result fields + } // end of L_SetBackgroundColour + + //---------------------------------------- + // world.SetBackgroundImage + //---------------------------------------- + static int L_SetBackgroundImage (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + lua_pushnumber (L, pDoc->SetBackgroundImage ( + my_checkstring (L, 1), // FileName + my_checknumber (L, 2) // mode + )); + return 1; // number of result fields + } // end of L_SetBackgroundImage //---------------------------------------- // world.SetChatOption *************** *** 4493,4498 **** --- 4526,4545 ---- } // end of L_SetEntity //---------------------------------------- + // world.SetForegroundImage + //---------------------------------------- + static int L_SetForegroundImage (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + lua_pushnumber (L, pDoc->SetForegroundImage ( + my_checkstring (L, 1), // FileName + my_checknumber (L, 2) // mode + )); + return 1; // number of result fields + } // end of L_SetForegroundImage + + + //---------------------------------------- // world.SetInputFont //---------------------------------------- static int L_SetInputFont (lua_State *L) *************** *** 4884,4889 **** --- 4931,5398 ---- return pushBstr (L, str); // number of result fields } // end of L_Version + //---------------------------------------- + // world.WindowAddHotspot + //---------------------------------------- + static int L_WindowAddHotspot (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + lua_pushnumber (L, pDoc->WindowAddHotspot ( + my_checkstring (L, 1), // Name + my_checkstring (L, 2), // HotspotId + my_checknumber (L, 3), // Left + my_checknumber (L, 4), // Top + my_checknumber (L, 5), // Right + my_checknumber (L, 6), // Bottom + my_checkstring (L, 7), // MouseOver + my_checkstring (L, 8), // CancelMouseOver + my_checkstring (L, 9), // MouseDown + my_checkstring (L, 10), // CancelMouseDown + my_checkstring (L, 11), // MouseUp + my_checkstring (L, 12), // TooltipText + my_checknumber (L, 13), // Cursor + my_checknumber (L, 14) // Flags + + )); + return 1; // number of result fields + } // end of L_WindowAddHotspot + + //---------------------------------------- + // world.WindowArc + //---------------------------------------- + static int L_WindowArc (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + lua_pushnumber (L, pDoc->WindowArc ( + my_checkstring (L, 1), // Name + my_checknumber (L, 2), // Left + my_checknumber (L, 3), // Top + my_checknumber (L, 4), // Right + my_checknumber (L, 5), // Bottom + my_checknumber (L, 6), // x1 + my_checknumber (L, 7), // y2 + my_checknumber (L, 8), // x1 + my_checknumber (L, 9), // y2 + my_checknumber (L, 10), // PenColour + my_checknumber (L, 11), // PenStyle + my_checknumber (L, 12) // PenWidth + )); + return 1; // number of result fields + } // end of L_WindowArc + + //---------------------------------------- + // world.WindowBezier + //---------------------------------------- + static int L_WindowBezier (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + lua_pushnumber (L, pDoc->WindowBezier ( + my_checkstring (L, 1), // Name + my_checkstring (L, 2), // Points + my_checknumber (L, 3), // PenColour + my_checknumber (L, 4), // PenStyle + my_checknumber (L, 5) // PenWidth + )); + return 1; // number of result fields + } // end of L_WindowBezier + + //---------------------------------------- + // world.WindowCircleOp + //---------------------------------------- + static int L_WindowCircleOp (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + lua_pushnumber (L, pDoc->WindowCircleOp ( + my_checkstring (L, 1), // Name + my_checknumber (L, 2), // Action + my_checknumber (L, 3), // Left + my_checknumber (L, 4), // Top + my_checknumber (L, 5), // Right + my_checknumber (L, 6), // Bottom + my_checknumber (L, 7), // PenColour + my_checknumber (L, 8), // PenStyle + my_checknumber (L, 9), // PenWidth + my_checknumber (L, 10), // BrushColour + my_optnumber (L, 11, 0), // BrushStyle + my_optnumber (L, 12, 0), // Extra1 + my_optnumber (L, 13, 0), // Extra2 + my_optnumber (L, 14, 0), // Extra3 + my_optnumber (L, 15, 0) // Extra4 + )); + return 1; // number of result fields + } // end of L_WindowCircleOp + + //---------------------------------------- + // world.WindowCreate + //---------------------------------------- + static int L_WindowCreate (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + lua_pushnumber (L, pDoc->WindowCreate ( + my_checkstring (L, 1), // Name + my_checknumber (L, 2), // Left + my_checknumber (L, 3), // Top + my_checknumber (L, 4), // Width + my_checknumber (L, 5), // Height + my_checknumber (L, 6), // Position + my_checknumber (L, 7), // Flags + my_checknumber (L, 8) // Background Colour + )); + + return 1; // number of result fields + } // end of L_WindowCreate + + //---------------------------------------- + // world.WindowCreateImage + //---------------------------------------- + static int L_WindowCreateImage (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + lua_pushnumber (L, pDoc->WindowCreateImage ( + my_checkstring (L, 1), // Name + my_checkstring (L, 2), // ImageId + my_checknumber (L, 3), // Row1 + my_checknumber (L, 4), // Row2 + my_checknumber (L, 5), // Row3 + my_checknumber (L, 6), // Row4 + my_checknumber (L, 7), // Row5 + my_checknumber (L, 8), // Row6 + my_checknumber (L, 9), // Row7 + my_checknumber (L, 10) // Row8 + )); + + return 1; // number of result fields + } // end of L_WindowCreateImage + + //---------------------------------------- + // world.WindowDeleteAllHotspots + //---------------------------------------- + static int L_WindowDeleteAllHotspots (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + lua_pushnumber (L, pDoc->WindowDeleteAllHotspots ( + my_checkstring (L, 1) // Name + )); + return 1; // number of result fields + } // end of L_WindowDeleteAllHotspots + + //---------------------------------------- + // world.WindowDeleteHotspot + //---------------------------------------- + static int L_WindowDeleteHotspot (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + lua_pushnumber (L, pDoc->WindowDeleteHotspot ( + my_checkstring (L, 1), // Name + my_checkstring (L, 2) // HotspotId + )); + return 1; // number of result fields + } // end of L_WindowDeleteHotspot + + //---------------------------------------- + // world.WindowDrawImage + //---------------------------------------- + static int L_WindowDrawImage (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + lua_pushnumber (L, pDoc->WindowDrawImage ( + my_checkstring (L, 1), // Name + my_checkstring (L, 2), // ImageId + my_checknumber (L, 3), // Left + my_checknumber (L, 4), // Top + my_checknumber (L, 5), // Right + my_checknumber (L, 6), // Bottom + my_optnumber (L, 7, 1), // Mode + my_optnumber (L, 8, 0), // SrcLeft + my_optnumber (L, 9, 0), // SrcTop + my_optnumber (L, 10, 0), // SrcRight + my_optnumber (L, 11, 0) // SrcBottom + )); + return 1; // number of result fields + } // end of L_WindowDrawImage + + //---------------------------------------- + // world.WindowFont + //---------------------------------------- + static int L_WindowFont (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + lua_pushnumber (L, pDoc->WindowFont ( + my_checkstring (L, 1), // Name + my_checkstring (L, 2), // FontId + my_checkstring (L, 3), // FontName + my_checknumber (L, 4), // Size + optboolean (L, 5, 0), // Bold + optboolean (L, 6, 0), // Italic + optboolean (L, 7, 0), // Underline + optboolean (L, 8, 0), // Strikeout + my_optnumber (L, 9, DEFAULT_CHARSET), // Charset + my_optnumber (L, 10, FF_DONTCARE) // PitchAndFamily + )); + + return 1; // number of result fields + } // end of L_WindowFont + + //---------------------------------------- + // world.WindowFontInfo + //---------------------------------------- + static int L_WindowFontInfo (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + VARIANT v = pDoc->WindowFontInfo ( + my_checkstring (L, 1), // Name + my_checkstring (L, 2), // FontId + my_checknumber (L, 3) // InfoType + ); + + return pushVariant (L, v); + } // end of L_WindowFontInfo + + //---------------------------------------- + // world.WindowFontList + //---------------------------------------- + static int L_WindowFontList (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + VARIANT v = pDoc->WindowFontList (my_checkstring (L, 1)); // name + return pushVariant (L, v); // number of result fields + } // end of L_WindowFontList + + //---------------------------------------- + // world.WindowHotspotInfo + //---------------------------------------- + static int L_WindowHotspotInfo (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + VARIANT v = pDoc->WindowHotspotInfo ( + my_checkstring (L, 1), // Name + my_checkstring (L, 2), // HotspotId + my_checknumber (L, 3) // InfoType + ); + + return pushVariant (L, v); + } // end of L_WindowHotspotInfo + + //---------------------------------------- + // world.WindowHotspotList + //---------------------------------------- + static int L_WindowHotspotList (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + VARIANT v = pDoc->WindowHotspotList (my_checkstring (L, 1)); // name + return pushVariant (L, v); // number of result fields + } // end of L_WindowHotspotList + + //---------------------------------------- + // world.WindowImageInfo + //---------------------------------------- + static int L_WindowImageInfo (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + VARIANT v = pDoc->WindowImageInfo ( + my_checkstring (L, 1), // Name + my_checkstring (L, 2), // ImageId + my_checknumber (L, 3) // InfoType + ); + + return pushVariant (L, v); + } // end of L_WindowImageInfo + + //---------------------------------------- + // world.WindowImageList + //---------------------------------------- + static int L_WindowImageList (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + VARIANT v = pDoc->WindowImageList (my_checkstring (L, 1)); // name + return pushVariant (L, v); // number of result fields + } // end of L_WindowImageList + + //---------------------------------------- + // world.WindowImageOp + //---------------------------------------- + static int L_WindowImageOp (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + lua_pushnumber (L, pDoc->WindowImageOp ( + my_checkstring (L, 1), // Name + my_checknumber (L, 2), // Action + my_checknumber (L, 3), // Left + my_checknumber (L, 4), // Top + my_checknumber (L, 5), // Right + my_checknumber (L, 6), // Bottom + my_checknumber (L, 7), // PenColour + my_checknumber (L, 8), // PenStyle + my_checknumber (L, 9), // PenWidth + my_checknumber (L, 10), // BrushColour + my_checkstring (L, 11), // ImageId + my_optnumber (L, 12, 0), // EllipseWidth + my_optnumber (L, 13, 0) // EllipseHeight + )); + return 1; // number of result fields + } // end of L_WindowImageOp + + //---------------------------------------- + // world.WindowInfo + //---------------------------------------- + static int L_WindowInfo (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + VARIANT v = pDoc->WindowInfo ( + my_checkstring (L, 1), // Name + my_checknumber (L, 2) // InfoType + ); + + return pushVariant (L, v); + } // end of L_WindowInfo + + //---------------------------------------- + // world.WindowLine + //---------------------------------------- + static int L_WindowLine (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + lua_pushnumber (L, pDoc->WindowLine ( + my_checkstring (L, 1), // Name + my_checknumber (L, 2), // x1 + my_checknumber (L, 3), // y2 + my_checknumber (L, 4), // x1 + my_checknumber (L, 5), // y2 + my_checknumber (L, 6), // PenColour + my_checknumber (L, 7), // PenStyle + my_checknumber (L, 8) // PenWidth + )); + return 1; // number of result fields + } // end of L_WindowLine + + //---------------------------------------- + // world.WindowList + //---------------------------------------- + static int L_WindowList (lua_State *L) + { + VARIANT v = doc (L)->WindowList (); + return pushVariant (L, v); // number of result fields + } // end of L_WindowList + + //---------------------------------------- + // world.WindowLoadImage + //---------------------------------------- + static int L_WindowLoadImage (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + lua_pushnumber (L, pDoc->WindowLoadImage ( + my_checkstring (L, 1), // Name + my_checkstring (L, 2), // FontId + my_checkstring (L, 3) // FileName + )); + + return 1; // number of result fields + } // end of L_WindowLoadImage + + //---------------------------------------- + // world.WindowPolygon + //---------------------------------------- + static int L_WindowPolygon (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + lua_pushnumber (L, pDoc->WindowPolygon ( + my_checkstring (L, 1), // Name + my_checkstring (L, 2), // Points + my_checknumber (L, 3), // PenColour + my_checknumber (L, 4), // PenStyle + my_checknumber (L, 5), // PenWidth + my_checknumber (L, 6), // BrushColour + my_optnumber (L, 7, 0), // BrushStyle + optboolean (L, 8, 0), // Close + optboolean (L, 9, 0) // Winding + )); + return 1; // number of result fields + } // end of L_WindowPolygon + + //---------------------------------------- + // world.WindowPosition + //---------------------------------------- + static int L_WindowPosition (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + lua_pushnumber (L, pDoc->WindowPosition ( + my_checkstring (L, 1), // Name + my_checknumber (L, 2), // Left + my_checknumber (L, 3), // Top + my_checknumber (L, 4), // Position + my_checknumber (L, 5) // Flags + )); + + return 1; // number of result fields + } // end of L_WindowPosition + + //---------------------------------------- + // world.WindowRectOp + //---------------------------------------- + static int L_WindowRectOp (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + lua_pushnumber (L, pDoc->WindowRectOp ( + my_checkstring (L, 1), // Name + my_checknumber (L, 2), // Action + my_checknumber (L, 3), // Left + my_checknumber (L, 4), // Top + my_checknumber (L, 5), // Right + my_checknumber (L, 6), // Bottom + my_checknumber (L, 7), // Colour1 + my_optnumber (L, 8, 0) // Colour2 + )); + return 1; // number of result fields + } // end of L_WindowRectOp + + //---------------------------------------- + // world.WindowShow + //---------------------------------------- + static int L_WindowShow (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + lua_pushnumber (L,pDoc->WindowShow ( + my_checkstring (L, 1), // Name + optboolean (L, 2, 1))); // Show + return 1; // number of result fields + } // end of L_WindowShow + + //---------------------------------------- + // world.WindowText + //---------------------------------------- + static int L_WindowText (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + lua_pushnumber (L, pDoc->WindowText ( + my_checkstring (L, 1), // Name + my_checkstring (L, 2), // Font + my_checkstring (L, 3), // Text + my_checknumber (L, 4), // Left + my_checknumber (L, 5), // Top + my_checknumber (L, 6), // Right + my_checknumber (L, 7), // Bottom + my_checknumber (L, 8), // Colour + optboolean (L, 9, 0) // Unicode + )); + + return 1; // number of result fields + } // end of L_WindowText + + //---------------------------------------- + // world.WindowTextWidth + //---------------------------------------- + static int L_WindowTextWidth (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + lua_pushnumber (L, pDoc->WindowTextWidth ( + my_checkstring (L, 1), // Name + my_checkstring (L, 2), // Font + my_checkstring (L, 3), // Text + optboolean (L, 4, 0) // Unicode + )); + + return 1; // number of result fields + } // end of WindowTextWidth //---------------------------------------- // world.WorldAddress *************** *** 5069,5074 **** --- 5578,5584 ---- {"GetCurrentValue", L_GetCurrentValue}, {"GetCustomColourName", L_GetCustomColourName}, {"GetDefaultValue", L_GetDefaultValue}, + {"GetDeviceCaps", L_GetDeviceCaps}, {"GetEntity", L_GetEntity}, {"GetXMLEntity", L_GetXMLEntity}, {"GetFrame", L_GetFrame}, *************** *** 5232,5237 **** --- 5742,5749 ---- {"SendToNotepad", L_SendToNotepad}, {"SetAliasOption", L_SetAliasOption}, {"SetAlphaOption", L_SetAlphaOption}, + {"SetBackgroundColour", L_SetBackgroundColour}, + {"SetBackgroundImage", L_SetBackgroundImage}, {"SetChatOption", L_SetChatOption}, {"SetChanged", L_SetChanged}, {"SetClipboard", L_SetClipboard}, *************** *** 5239,5244 **** --- 5751,5757 ---- {"SetCommandWindowHeight", L_SetCommandWindowHeight}, {"SetCustomColourName", L_SetCustomColourName}, {"SetEntity", L_SetEntity}, + {"SetForegroundImage", L_SetForegroundImage}, {"SetInputFont", L_SetInputFont}, {"SetNotes", L_SetNotes}, {"SetOption", L_SetOption}, *************** *** 5272,5277 **** --- 5785,5817 ---- {"UdpPortList", L_UdpPortList}, {"UdpSend", L_UdpSend}, {"Version", L_Version}, + {"WindowAddHotspot", L_WindowAddHotspot}, + {"WindowArc", L_WindowArc}, + {"WindowBezier", L_WindowBezier}, + {"WindowCircleOp", L_WindowCircleOp}, + {"WindowCreate", L_WindowCreate}, + {"WindowCreateImage", L_WindowCreateImage}, + {"WindowDeleteAllHotspots", L_WindowDeleteAllHotspots}, + {"WindowDeleteHotspot", L_WindowDeleteHotspot}, + {"WindowDrawImage", L_WindowDrawImage}, + {"WindowFont", L_WindowFont}, + {"WindowFontInfo", L_WindowFontInfo}, + {"WindowFontList", L_WindowFontList}, + {"WindowHotspotInfo", L_WindowHotspotInfo}, + {"WindowHotspotList", L_WindowHotspotList}, + {"WindowImageInfo", L_WindowImageInfo}, + {"WindowImageList", L_WindowImageList}, + {"WindowImageOp", L_WindowImageOp}, + {"WindowInfo", L_WindowInfo}, + {"WindowLine", L_WindowLine}, + {"WindowList", L_WindowList}, + {"WindowLoadImage", L_WindowLoadImage}, + {"WindowPolygon", L_WindowPolygon}, + {"WindowPosition", L_WindowPosition}, + {"WindowRectOp", L_WindowRectOp}, + {"WindowShow", L_WindowShow}, + {"WindowText", L_WindowText}, + {"WindowTextWidth", L_WindowTextWidth}, {"WorldAddress", L_WorldAddress}, {"WorldName", L_WorldName}, {"WorldPort", L_WorldPort}, *************** *** 5414,5484 **** static flags_pair error_codes[] = { ! { "eOK", 0 }, // No error ! { "eWorldOpen", 30001 }, // The world is already open ! { "eWorldClosed", 30002 }, // The world is closed, this action cannot be performed ! { "eNoNameSpecified", 30003 }, // No name has been specified where one is required ! { "eCannotPlaySound", 30004 }, // The sound file could not be played ! { "eTriggerNotFound", 30005 }, // The specified trigger name does not exist ! { "eTriggerAlreadyExists", 30006 }, // Attempt to add a trigger that already exists ! { "eTriggerCannotBeEmpty", 30007 }, // The trigger "match" string cannot be empty ! { "eInvalidObjectLabel", 30008 }, // The name of this object is invalid ! { "eScriptNameNotLocated", 30009 }, // Script name is not in the script file ! { "eAliasNotFound", 30010 }, // The specified alias name does not exist ! { "eAliasAlreadyExists", 30011 }, // Attempt to add a alias that already exists ! { "eAliasCannotBeEmpty", 30012 }, // The alias "match" string cannot be empty ! { "eCouldNotOpenFile", 30013 }, // Unable to open requested file ! { "eLogFileNotOpen", 30014 }, // Log file was not open ! { "eLogFileAlreadyOpen", 30015 }, // Log file was already open ! { "eLogFileBadWrite", 30016 }, // Bad write to log file ! { "eTimerNotFound", 30017 }, // The specified timer name does not exist ! { "eTimerAlreadyExists", 30018 }, // Attempt to add a timer that already exists ! { "eVariableNotFound", 30019 }, // Attempt to delete a variable that does not exist ! { "eCommandNotEmpty", 30020 }, // Attempt to use SetCommand with a non-empty command window ! { "eBadRegularExpression", 30021 }, // Bad regular expression syntax ! { "eTimeInvalid", 30022 }, // Time given to AddTimer is invalid ! { "eBadMapItem", 30023 }, // Direction given to AddToMapper is invalid ! { "eNoMapItems", 30024 }, // No items in mapper ! { "eUnknownOption", 30025 }, // Option name not found ! { "eOptionOutOfRange", 30026 }, // New value for option is out of range { "eTriggerSequenceOutOfRange", 30027 }, // Trigger sequence value invalid ! { "eTriggerSendToInvalid", 30028 }, // Where to send trigger text to is invalid ! { "eTriggerLabelNotSpecified", 30029 }, // Trigger label not specified/invalid for 'send to variable' ! { "ePluginFileNotFound", 30030 }, // File name specified for plugin not found ! { "eProblemsLoadingPlugin", 30031 }, // There was a parsing or other problem loading the plugin ! { "ePluginCannotSetOption", 30032 }, // Plugin is not allowed to set this option ! { "ePluginCannotGetOption", 30033 }, // Plugin is not allowed to get this option ! { "eNoSuchPlugin", 30034 }, // Requested plugin is not installed ! { "eNotAPlugin", 30035 }, // Only a plugin can do this ! { "eNoSuchRoutine", 30036 }, // Plugin does not support that subroutine (subroutine not in script) ! { "ePluginDoesNotSaveState", 30037 }, // Plugin does not support saving state ! { "ePluginCouldNotSaveState", 30037 }, // Plugin could not save state (eg. no state directory) ! { "ePluginDisabled", 30039 }, // Plugin is currently disabled { "eErrorCallingPluginRoutine", 30040 }, // Could not call plugin routine ! { "eCommandsNestedTooDeeply", 30041 }, // Calls to "Execute" nested too deeply ! { "eCannotCreateChatSocket", 30042 }, // Unable to create socket for chat connection ! { "eCannotLookupDomainName", 30043 }, // Unable to do DNS (domain name) lookup for chat connection ! { "eNoChatConnections", 30044 }, // No chat connections open ! { "eChatPersonNotFound", 30045 }, // Requested chat person not connected ! { "eBadParameter", 30046 }, // General problem with a parameter to a script call ! { "eChatAlreadyListening", 30047 }, // Already listening for incoming chats ! { "eChatIDNotFound", 30048 }, // Chat session with that ID not found ! { "eChatAlreadyConnected", 30049 }, // Already connected to that server/port ! { "eClipboardEmpty", 30050 }, // Cannot get (text from the) clipboard ! { "eFileNotFound", 30051 }, // Cannot open the specified file ! { "eAlreadyTransferringFile", 30052 }, // Already transferring a file ! { "eNotTransferringFile", 30053 }, // Not transferring a file ! { "eNoSuchCommand", 30054 }, // There is not a command of that name ! { "eArrayAlreadyExists", 30055 }, // Chat session with that ID not found ! { "eArrayDoesNotExist", 30056 }, // Already connected to that server/port ! { "eArrayNotEvenNumberOfValues", 30057 }, // Cannot get (text from the) clipboard ! { "eImportedWithDuplicates", 30058 }, // Cannot open the specified file ! { "eBadDelimiter", 30059 }, // Already transferring a file { "eSetReplacingExistingValue", 30060 }, // Not transferring a file ! { "eKeyDoesNotExist", 30061 }, // There is not a command of that name ! { "eCannotImport", 30062 }, // There is not a command of that name ! { "eItemInUse", 30063 }, // Cannot delete trigger/alias/timer because it is executing a script ! { "eSpellCheckNotActive", 30064 }, // spell checker is not active { NULL, 0 } }; --- 5954,6035 ---- static flags_pair error_codes[] = { ! { "eOK", 0 }, // No error ! { "eWorldOpen", 30001 }, // The world is already open ! { "eWorldClosed", 30002 }, // The world is closed, this action cannot be performed ! { "eNoNameSpecified", 30003 }, // No name has been specified where one is required ! { "eCannotPlaySound", 30004 }, // The sound file could not be played ! { "eTriggerNotFound", 30005 }, // The specified trigger name does not exist ! { "eTriggerAlreadyExists", 30006 }, // Attempt to add a trigger that already exists ! { "eTriggerCannotBeEmpty", 30007 }, // The trigger "match" string cannot be empty ! { "eInvalidObjectLabel", 30008 }, // The name of this object is invalid ! { "eScriptNameNotLocated", 30009 }, // Script name is not in the script file ! { "eAliasNotFound", 30010 }, // The specified alias name does not exist ! { "eAliasAlreadyExists", 30011 }, // Attempt to add a alias that already exists ! { "eAliasCannotBeEmpty", 30012 }, // The alias "match" string cannot be empty ! { "eCouldNotOpenFile", 30013 }, // Unable to open requested file ! { "eLogFileNotOpen", 30014 }, // Log file was not open ! { "eLogFileAlreadyOpen", 30015 }, // Log file was already open ! { "eLogFileBadWrite", 30016 }, // Bad write to log file ! { "eTimerNotFound", 30017 }, // The specified timer name does not exist ! { "eTimerAlreadyExists", 30018 }, // Attempt to add a timer that already exists ! { "eVariableNotFound", 30019 }, // Attempt to delete a variable that does not exist ! { "eCommandNotEmpty", 30020 }, // Attempt to use SetCommand with a non-empty command window ! { "eBadRegularExpression", 30021 }, // Bad regular expression syntax ! { "eTimeInvalid", 30022 }, // Time given to AddTimer is invalid ! { "eBadMapItem", 30023 }, // Direction given to AddToMapper is invalid ! { "eNoMapItems", 30024 }, // No items in mapper ! { "eUnknownOption", 30025 }, // Option name not found ! { "eOptionOutOfRange", 30026 }, // New value for option is out of range { "eTriggerSequenceOutOfRange", 30027 }, // Trigger sequence value invalid ! { "eTriggerSendToInvalid", 30028 }, // Where to send trigger text to is invalid ! { "eTriggerLabelNotSpecified", 30029 }, // Trigger label not specified/invalid for 'send to variable' ! { "ePluginFileNotFound", 30030 }, // File name specified for plugin not found ! { "eProblemsLoadingPlugin", 30031 }, // There was a parsing or other problem loading the plugin ! { "ePluginCannotSetOption", 30032 }, // Plugin is not allowed to set this option ! { "ePluginCannotGetOption", 30033 }, // Plugin is not allowed to get this option ! { "eNoSuchPlugin", 30034 }, // Requested plugin is not installed ! { "eNotAPlugin", 30035 }, // Only a plugin can do this ! { "eNoSuchRoutine", 30036 }, // Plugin does not support that subroutine (subroutine not in script) ! { "ePluginDoesNotSaveState", 30037 }, // Plugin does not support saving state ! { "ePluginCouldNotSaveState", 30037 }, // Plugin could not save state (eg. no state directory) ! { "ePluginDisabled", 30039 }, // Plugin is currently disabled { "eErrorCallingPluginRoutine", 30040 }, // Could not call plugin routine ! { "eCommandsNestedTooDeeply", 30041 }, // Calls to "Execute" nested too deeply ! { "eCannotCreateChatSocket", 30042 }, // Unable to create socket for chat connection ! { "eCannotLookupDomainName", 30043 }, // Unable to do DNS (domain name) lookup for chat connection ! { "eNoChatConnections", 30044 }, // No chat connections open ! { "eChatPersonNotFound", 30045 }, // Requested chat person not connected ! { "eBadParameter", 30046 }, // General problem with a parameter to a script call ! { "eChatAlreadyListening", 30047 }, // Already listening for incoming chats ! { "eChatIDNotFound", 30048 }, // Chat session with that ID not found ! { "eChatAlreadyConnected", 30049 }, // Already connected to that server/port ! { "eClipboardEmpty", 30050 }, // Cannot get (text from the) clipboard ! { "eFileNotFound", 30051 }, // Cannot open the specified file ! { "eAlreadyTransferringFile", 30052 }, // Already transferring a file ! { "eNotTransferringFile", 30053 }, // Not transferring a file ! { "eNoSuchCommand", 30054 }, // There is not a command of that name ! { "eArrayAlreadyExists", 30055 }, // Chat session with that ID not found ! { "eArrayDoesNotExist", 30056 }, // Already connected to that server/port ! { "eArrayNotEvenNumberOfValues", 30057 }, // Cannot get (text from the) clipboard ! { "eImportedWithDuplicates", 30058 }, // Cannot open the specified file ! { "eBadDelimiter", 30059 }, // Already transferring a file { "eSetReplacingExistingValue", 30060 }, // Not transferring a file ! { "eKeyDoesNotExist", 30061 }, // There is not a command of that name ! { "eCannotImport", 30062 }, // There is not a command of that name ! { "eItemInUse", 30063 }, // Cannot delete trigger/alias/timer because it is executing a script ! { "eSpellCheckNotActive", 30064 }, // spell checker is not active ! { "eCannotAddFont", 30065 }, // cannot create requested font ! { "ePenStyleNotValid", 30066 }, // invalid settings for pen parameter ! { "eUnableToLoadImage", 30067 }, // bitmap image could not be loaded ! { "eImageNotInstalled", 30068 }, // image has not been loaded into window ! { "eInvalidNumberOfPoints", 30069 }, // number of points supplied is incorrect ! { "eInvalidPoint", 30070 }, // point is not numeric ! { "eHotspotPluginChanged", 30071 }, // hotspot processing must all be in same plugin ! { "eHotspotNotInstalled", 30072 }, // hotspot has not been defined for this window ! { "eNoSuchWindow", 30073 }, // requested miniwindow does not exist ! { "eBrushStyleNotValid", 30074 }, // invalid settings for brush parameter ! { NULL, 0 } }; *************** *** 5551,5557 **** { 30062, Translate_NoOp ("Cannot import because cannot find unused temporary character") }, { 30063, Translate_NoOp ("Cannot delete trigger/alias/timer because it is executing a script") }, { 30064, Translate_NoOp ("Spell checker is not active") }, ! { NULL, 0 } }; --- 6102,6118 ---- { 30062, Translate_NoOp ("Cannot import because cannot find unused temporary character") }, { 30063, Translate_NoOp ("Cannot delete trigger/alias/timer because it is executing a script") }, { 30064, Translate_NoOp ("Spell checker is not active") }, ! { 30065, Translate_NoOp ("Cannot create requested font") }, ! { 30066, Translate_NoOp ("Invalid settings for pen parameter") }, ! { 30067, Translate_NoOp ("Bitmap image could not be loaded") }, ! { 30068, Translate_NoOp ("Image has not been loaded into window") }, ! { 30069, Translate_NoOp ("Number of points supplied is incorrect") }, ! { 30070, Translate_NoOp ("Point is not numeric") }, ! { 30071, Translate_NoOp ("Hotspot processing must all be in same plugin") }, ! { 30072, Translate_NoOp ("Hotspot has not been defined for this window") }, ! { 30073, Translate_NoOp ("Requested miniwindow does not exist") }, ! { 30074, Translate_NoOp ("Invalid settings for brush parameter") }, ! { NULL, 0 } }; Index: methods.cpp =================================================================== RCS file: /cvs/mushclient/methods.cpp,v retrieving revision 1.223 retrieving revision 1.242 diff -c -r1.223 -r1.242 *** methods.cpp 10 Jul 2008 01:24:51 -0000 1.223 --- methods.cpp 26 Jul 2008 06:13:19 -0000 1.242 *************** *** 4144,4149 **** --- 4144,4151 ---- { 75, "Last MUD-specific string received" }, { 76, "Special font pathname" }, { 77, "OS Version - service pack" }, + { 78, "Foreground image filename" }, + { 79, "Background image filename" }, // (booleans - calculated at runtime) *************** *** 4237,4242 **** --- 4239,4248 ---- { 266, "OS Version - minor" }, { 267, "OS Version - build number" }, { 268, "OS Version - platform ID" }, + { 269, "Foreground image mode" }, + { 270, "Background image mode" }, + { 271, "Background colour" }, + // (dates - calculated at runtime) *************** *** 4435,4440 **** --- 4441,4449 ---- break; } + case 78: SetUpVariantString (vaResult, m_strForegroundImageName); break; + case 79: SetUpVariantString (vaResult, m_strBackgroundImageName); break; + case 101: SetUpVariantBool (vaResult, m_bNoEcho); break; case 102: SetUpVariantBool (vaResult, m_bDebugIncomingPackets); break; case 103: SetUpVariantBool (vaResult, m_bCompress); break; *************** *** 4784,4789 **** --- 4793,4802 ---- break; } + case 269: SetUpVariantLong (vaResult, m_iForegroundMode); break; + case 270: SetUpVariantLong (vaResult, m_iBackgroundMode); break; + case 271: SetUpVariantLong (vaResult, m_iBackgroundColour); break; + case 301: if (m_tConnectTime.GetTime ()) // only if non-zero, otherwise return empty SetUpVariantDate (vaResult, COleDateTime (m_tConnectTime.GetTime ())); *************** *** 10590,10596 **** { CTextView* pmyView = (CTextView*)pView; pmyView->GetParentFrame ()->MoveWindow (Left, Top, Width, Height); ! return true; } // end of having the right type of view } // end of having a view } // end of having an existing notepad document --- 10603,10609 ---- { CTextView* pmyView = (CTextView*)pView; pmyView->GetParentFrame ()->MoveWindow (Left, Top, Width, Height); ! return true; } // end of having the right type of view } // end of having a view } // end of having an existing notepad document *************** *** 12147,12152 **** --- 12160,12166 ---- } // end of CMUSHclientDoc::GetChildFrame + // set the height of the command window long CMUSHclientDoc::SetCommandWindowHeight(short Height) { *************** *** 12188,12195 **** return eOK; ! } long CMUSHclientDoc::SetToolBarPosition(short Which, BOOL Float, short Side, long Top, long Left) { CToolBar * pToolBar = NULL; --- 12202,12210 ---- return eOK; ! } // end of CMUSHclientDoc::SetCommandWindowHeight + // move a toolbar long CMUSHclientDoc::SetToolBarPosition(short Which, BOOL Float, short Side, long Top, long Left) { CToolBar * pToolBar = NULL; *************** *** 12242,12251 **** } return eOK; ! } ! long CMUSHclientDoc::ShiftTabCompleteItem(LPCTSTR Item) { if (strlen (Item) <= 0 || strlen (Item) > 30) --- 12257,12266 ---- } return eOK; ! } // end of CMUSHclientDoc::SetToolBarPosition + // add an item for shift+tab completion long CMUSHclientDoc::ShiftTabCompleteItem(LPCTSTR Item) { if (strlen (Item) <= 0 || strlen (Item) > 30) *************** *** 12265,12272 **** } return eOK; ! } long CMUSHclientDoc::NotepadReadOnly(LPCTSTR Title, BOOL ReadOnly) { CTextDocument * pTextDoc = FindNotepad (Title); --- 12280,12288 ---- } return eOK; ! } // end of CMUSHclientDoc::ShiftTabCompleteItem + // make a notepad read-only long CMUSHclientDoc::NotepadReadOnly(LPCTSTR Title, BOOL ReadOnly) { CTextDocument * pTextDoc = FindNotepad (Title); *************** *** 12277,12285 **** pTextDoc->SetReadOnly (ReadOnly); return true; ! } long CMUSHclientDoc::AddFont(LPCTSTR PathName) { --- 12293,12302 ---- pTextDoc->SetReadOnly (ReadOnly); return true; ! } // end of CMUSHclientDoc::NotepadReadOnly + // add a new font from a file long CMUSHclientDoc::AddFont(LPCTSTR PathName) { *************** *** 12288,12297 **** return AddSpecialFont (PathName); } ! /* ====================================================================== --- 12305,13040 ---- return AddSpecialFont (PathName); + } // end of CMUSHclientDoc::AddFont + + /* modes: + + 0 = strech to output view size + 1 = stretch with aspect ratio + + -- next two will not be affected by command window size changes: + + 2 = strech to owner size + 3 = stretch with aspect ratio + + -- going clockwise here: + + -- top + 4 = top left + 5 = center left-right at top + 6 = top right + + -- rh side + 7 = on right, center top-bottom + 8 = on right, at bottom + + -- bottom + 9 = center left-right at bottom + + -- lh side + 10 = on left, at bottom + 11 = on left, center top-bottom + + -- middle + 12 = center all + + 13 = tile + + + */ + + + // set main window background image + long CMUSHclientDoc::SetBackgroundImage(LPCTSTR FileName, short Mode) + { + + if (Mode < 0 || Mode > 13) + return eBadParameter; + + if ((HBITMAP) m_BackgroundBitmap) + m_BackgroundBitmap.DeleteObject (); + + m_strBackgroundImageName.Empty (); + + UpdateAllViews (NULL); + + // no file name means get rid of images + if (strlen (FileName) == 0) + return eOK; + + HBITMAP hBmp = (HBITMAP)::LoadImage( + NULL, + FileName, + IMAGE_BITMAP, + 0, + 0, + LR_LOADFROMFILE|LR_CREATEDIBSECTION + ); + + if (hBmp) + { + m_BackgroundBitmap.Attach (hBmp); + m_iBackgroundMode = Mode; + m_strBackgroundImageName = FileName; + return eOK; + } // end of having a bitmap loaded + + + if (GetLastError () == 2) + return eFileNotFound; + + return eCouldNotOpenFile; + + } // end of CMUSHclientDoc::SetBackgroundImage + + // set main window foreground image + long CMUSHclientDoc::SetForegroundImage(LPCTSTR FileName, short Mode) + { + if (Mode < 0 || Mode > 13) + return eBadParameter; + + if ((HBITMAP) m_ForegroundBitmap) + m_ForegroundBitmap.DeleteObject (); + + m_strForegroundImageName.Empty (); + + UpdateAllViews (NULL); + + // no file name means get rid of images + if (strlen (FileName) == 0) + return eOK; + + HBITMAP hBmp = (HBITMAP)::LoadImage( + NULL, + FileName, + IMAGE_BITMAP, + 0, + 0, + LR_LOADFROMFILE|LR_CREATEDIBSECTION + ); + + if (hBmp) + { + m_ForegroundBitmap.Attach (hBmp); + m_iForegroundMode = Mode; + m_strForegroundImageName = FileName; + return eOK; + } // end of having a bitmap loaded + + + if (GetLastError () == 2) + return eFileNotFound; + + return eCouldNotOpenFile; + + } // end of CMUSHclientDoc::SetForegroundImage + + // set main window background colour + long CMUSHclientDoc::SetBackgroundColour(long Colour) + { + long oldColour = m_iBackgroundColour; + + m_iBackgroundColour = Colour; + + UpdateAllViews (NULL); + + return oldColour; + } // end of CMUSHclientDoc::SetBackgroundColour + + /* positions: + + 0 = strech to output view size + 1 = stretch with aspect ratio + + 2 = strech to owner size + 3 = stretch with aspect ratio + + -- going clockwise here: + + -- top + 4 = top left + 5 = center left-right at top + 6 = top right + + -- rh side + 7 = on right, center top-bottom + 8 = on right, at bottom + + -- bottom + 9 = center left-right at bottom + + -- lh side + 10 = on left, at bottom + 11 = on left, center top-bottom + + -- middle + 12 = center all + + 13 = tile + + + */ + + // create (or re-create) a mini-window + long CMUSHclientDoc::WindowCreate(LPCTSTR Name, + long Left, long Top, + long Width, long Height, + short Position, + long Flags, + long BackgroundColour) + { + MiniWindowMapIterator it = m_MiniWindows.find (Name); + + CMiniWindow * pMiniWindow = NULL; + + if (it == m_MiniWindows.end ()) + { + pMiniWindow = new CMiniWindow (); + m_MiniWindows [Name] = pMiniWindow; + } + else + pMiniWindow = it->second; + + pMiniWindow->Create (Left, Top, Width, Height, + Position, Flags, + BackgroundColour); + + return eOK; + } // end of CMUSHclientDoc::WindowCreate + + // set/clear the show flag so the window becomes visible + long CMUSHclientDoc::WindowShow(LPCTSTR Name, BOOL Show) + { + MiniWindowMapIterator it = m_MiniWindows.find (Name); + + if (it == m_MiniWindows.end ()) + return eNoSuchWindow; + + it->second->Show (Show); + + UpdateAllViews (NULL); + + return eOK; + } // end of CMUSHclientDoc::WindowShow + + /* + + ------------------------------------------------------------------------------------ + See: http://www.functionx.com/win32/Lesson11.htm + + for some nice examples of what they look like + ------------------------------------------------------------------------------------ + + */ + + // various rectangle operations + long CMUSHclientDoc::WindowRectOp(LPCTSTR Name, short Action, + long Left, long Top, long Right, long Bottom, + long Colour1, long Colour2) + { + MiniWindowMapIterator it = m_MiniWindows.find (Name); + + if (it == m_MiniWindows.end ()) + return eNoSuchWindow; + + return it->second->RectOp (Action, + Left, Top, Right, Bottom, + Colour1, Colour2); + + } // end of CMUSHclientDoc::WindowRectOp + + + // various circle/ellipse/pie operations + long CMUSHclientDoc::WindowCircleOp(LPCTSTR Name, short Action, + long Left, long Top, long Right, long Bottom, + long PenColour, long PenStyle, long PenWidth, + long BrushColour, long BrushStyle, + long Extra1, long Extra2, long Extra3, long Extra4) + { + MiniWindowMapIterator it = m_MiniWindows.find (Name); + + if (it == m_MiniWindows.end ()) + return eNoSuchWindow; + + return it->second->CircleOp (Action, + Left, Top, Right, Bottom, + PenColour, PenStyle, PenWidth, + BrushColour, BrushStyle, + Extra1, Extra2, Extra3, Extra4); + + } // end of CMUSHclientDoc::WindowCircleOp + + + // add a font to our map of fonts by name (eg. "inventory") + long CMUSHclientDoc::WindowFont(LPCTSTR Name, // which window + LPCTSTR FontId, // eg. Inventory + LPCTSTR FontName, // eg. Courier New + double Size, // eg. 9 pt + BOOL Bold, BOOL Italic, BOOL Underline, BOOL Strikeout, + short Charset, + short PitchAndFamily) + { + MiniWindowMapIterator it = m_MiniWindows.find (Name); + + if (it == m_MiniWindows.end ()) + return -1; + + return it->second->Font (FontId, FontName, + Size, + Bold, Italic, Underline, Strikeout, + Charset, PitchAndFamily); + } // end of CMUSHclientDoc::WindowFont + + // output text, ordinary or UTF8 - returns length of text + long CMUSHclientDoc::WindowText(LPCTSTR Name, // which window + LPCTSTR FontId, // eg. Inventory + LPCTSTR Text, // what to say + long Left, long Top, long Right, long Bottom, // where to put it + long Colour, // colour to show it in + BOOL Unicode) // true if UTF8 + { + MiniWindowMapIterator it = m_MiniWindows.find (Name); + + if (it == m_MiniWindows.end ()) + return -1; + + return it->second->Text (FontId, Text, Left, Top, Right, Bottom, Colour, Unicode ); + } // end of CMUSHclientDoc::WindowText + + // measure text, ordinary or UTF8 + long CMUSHclientDoc::WindowTextWidth(LPCTSTR Name, LPCTSTR FontId, LPCTSTR Text, BOOL Unicode) + { + MiniWindowMapIterator it = m_MiniWindows.find (Name); + + if (it == m_MiniWindows.end ()) + return -1; + + return it->second->TextWidth (FontId, Text, Unicode ); + } // end of CMUSHclientDoc::WindowTextWidth + + // return info about the select font + VARIANT CMUSHclientDoc::WindowFontInfo(LPCTSTR Name, LPCTSTR FontId, long InfoType) + { + + VARIANT vaResult; + VariantInit(&vaResult); + + vaResult.vt = VT_EMPTY; + + MiniWindowMapIterator it = m_MiniWindows.find (Name); + + if (it == m_MiniWindows.end ()) + return vaResult; + + it->second->FontInfo (FontId, InfoType, vaResult); + return vaResult; + } // end of CMUSHclientDoc::WindowFontInfo + + // draws a straight line + long CMUSHclientDoc::WindowLine(LPCTSTR Name, + long x1, long y1, long x2, long y2, + long PenColour, long PenStyle, long PenWidth) + { + MiniWindowMapIterator it = m_MiniWindows.find (Name); + + if (it == m_MiniWindows.end ()) + return eNoSuchWindow; + + return it->second->Line (x1, y1, x2, y2, PenColour, PenStyle, PenWidth); } ! // draws an arc ! long CMUSHclientDoc::WindowArc(LPCTSTR Name, ! long Left, long Top, long Right, long Bottom, ! long x1, long y1, ! long x2, long y2, ! long PenColour, long PenStyle, long PenWidth) ! { ! MiniWindowMapIterator it = m_MiniWindows.find (Name); ! ! if (it == m_MiniWindows.end ()) ! return eNoSuchWindow; ! ! return it->second->Arc (Left, Top, Right, Bottom, x1, y1, x2, y2, PenColour, PenStyle, PenWidth); ! } // end of CMUSHclientDoc::WindowArc ! ! ! // return list of windows we have made ! VARIANT CMUSHclientDoc::WindowList() ! { ! COleSafeArray sa; // for array list ! ! long iCount = 0; ! ! // put the arrays into the array ! if (!m_MiniWindows.empty ()) // cannot create empty dimension ! { ! sa.CreateOneDim (VT_VARIANT, m_MiniWindows.size ()); ! ! for (MiniWindowMapIterator it = m_MiniWindows.begin (); ! it != m_MiniWindows.end (); ! it++) ! { ! // the array must be a bloody array of variants, or VBscript kicks up ! COleVariant v (it->first.c_str ()); ! sa.PutElement (&iCount, &v); ! iCount++; ! } ! ! } // end of having at least one ! ! return sa.Detach (); ! } // end of CMUSHclientDoc::WindowList ! ! // return list of fonts created for this window ! VARIANT CMUSHclientDoc::WindowFontList(LPCTSTR Name) ! { ! VARIANT vaResult; ! VariantInit(&vaResult); ! ! vaResult.vt = VT_EMPTY; ! ! MiniWindowMapIterator it = m_MiniWindows.find (Name); ! ! if (it == m_MiniWindows.end ()) ! return vaResult; ! ! it->second->FontList (vaResult); ! return vaResult; ! } // end of CMUSHclientDoc::WindowFontList ! ! // information about a window ! VARIANT CMUSHclientDoc::WindowInfo(LPCTSTR Name, long InfoType) ! { ! VARIANT vaResult; ! VariantInit(&vaResult); ! ! vaResult.vt = VT_EMPTY; ! ! MiniWindowMapIterator it = m_MiniWindows.find (Name); ! ! if (it == m_MiniWindows.end ()) ! return vaResult; ! ! it->second->Info (InfoType, vaResult); ! return vaResult; ! } // end of CMUSHclientDoc::WindowInfo ! ! // load an image from disk ! long CMUSHclientDoc::WindowLoadImage(LPCTSTR Name, ! LPCTSTR ImageId, ! LPCTSTR FileName) ! { ! MiniWindowMapIterator it = m_MiniWindows.find (Name); ! ! if (it == m_MiniWindows.end ()) ! return eNoSuchWindow; ! ! return it->second->LoadImage (ImageId, FileName); ! } // end of CMUSHclientDoc::WindowLoadImage ! ! // draw an image ! long CMUSHclientDoc::WindowDrawImage(LPCTSTR Name, ! LPCTSTR ImageId, ! long Left, long Top, long Right, long Bottom, ! short Mode, ! long SrcLeft, long SrcTop, long SrcRight, long SrcBottom) ! { ! MiniWindowMapIterator it = m_MiniWindows.find (Name); ! ! if (it == m_MiniWindows.end ()) ! return eNoSuchWindow; ! ! return it->second->DrawImage (ImageId, Left, Top, Right, Bottom, Mode, ! SrcLeft, SrcTop, SrcRight, SrcBottom); ! } // end of CMUSHclientDoc::WindowDrawImage ! ! // list loaded images ! VARIANT CMUSHclientDoc::WindowImageList(LPCTSTR Name) ! { ! VARIANT vaResult; ! VariantInit(&vaResult); ! ! vaResult.vt = VT_EMPTY; ! ! MiniWindowMapIterator it = m_MiniWindows.find (Name); ! ! if (it == m_MiniWindows.end ()) ! return vaResult; ! ! it->second->ImageList (vaResult); ! return vaResult; ! } // end of CMUSHclientDoc::WindowImageList ! ! ! // info about an image ! VARIANT CMUSHclientDoc::WindowImageInfo(LPCTSTR Name, LPCTSTR ImageId, long InfoType) ! { ! VARIANT vaResult; ! VariantInit(&vaResult); ! ! vaResult.vt = VT_EMPTY; ! ! MiniWindowMapIterator it = m_MiniWindows.find (Name); ! ! if (it == m_MiniWindows.end ()) ! return vaResult; ! ! it->second->ImageInfo (ImageId, InfoType, vaResult); ! return vaResult; ! } // end of CMUSHclientDoc::WindowImageInfo ! ! /* ! Device Parameters for GetDeviceCaps() ! ! DRIVERVERSION 0 Device driver version ! TECHNOLOGY 2 Device classification ! HORZSIZE 4 Horizontal size in millimeters ! VERTSIZE 6 Vertical size in millimeters ! HORZRES 8 Horizontal width in pixels ! VERTRES 10 Vertical height in pixels ! BITSPIXEL 12 Number of bits per pixel ! PLANES 14 Number of planes ! NUMBRUSHES 16 Number of brushes the device has ! NUMPENS 18 Number of pens the device has ! NUMMARKERS 20 Number of markers the device has ! NUMFONTS 22 Number of fonts the device has ! NUMCOLORS 24 Number of colors the device supports ! PDEVICESIZE 26 Size required for device descriptor ! CURVECAPS 28 Curve capabilities ! LINECAPS 30 Line capabilities ! POLYGONALCAPS 32 Polygonal capabilities ! TEXTCAPS 34 Text capabilities ! CLIPCAPS 36 Clipping capabilities ! RASTERCAPS 38 Bitblt capabilities ! ASPECTX 40 Length of the X leg ! ASPECTY 42 Length of the Y leg ! ASPECTXY 44 Length of the hypotenuse ! ! SHADEBLENDCAPS 45 Shading and blending caps ! ! LOGPIXELSX 88 Logical pixels/inch in X ! LOGPIXELSY 90 Logical pixels/inch in Y ! ! SIZEPALETTE 104 Number of entries in physical palette ! NUMRESERVED 106 Number of reserved entries in palette ! COLORRES 108 Actual color resolution ! ! // Display driver specific ! ! VREFRESH 116 Current vertical refresh rate of the ! display device (for displays only) in Hz ! DESKTOPVERTRES 117 Horizontal width of entire desktop in ! pixels ! DESKTOPHORZRES 118 Vertical height of entire desktop in ! pixels ! BLTALIGNMENT 119 Preferred blt alignment ! ! */ ! ! // get device capabilites ! long CMUSHclientDoc::GetDeviceCaps(long Index) ! { ! CDC dc; ! dc.CreateCompatibleDC (NULL); ! return dc.GetDeviceCaps (Index); ! } // end of CMUSHclientDoc::GetDeviceCaps ! ! // draw a bezier curve ! long CMUSHclientDoc::WindowBezier(LPCTSTR Name, ! LPCTSTR Points, ! long PenColour, long PenStyle, long PenWidth) ! { ! MiniWindowMapIterator it = m_MiniWindows.find (Name); ! ! if (it == m_MiniWindows.end ()) ! return eNoSuchWindow; ! ! return it->second->Bezier (Points, PenColour, PenStyle, PenWidth); ! } // end of CMUSHclientDoc::WindowBezier ! ! ! // draw an open or closed polygon ! long CMUSHclientDoc::WindowPolygon(LPCTSTR Name, ! LPCTSTR Points, ! long PenColour, long PenStyle, long PenWidth, ! long BrushColour, long BrushStyle, ! BOOL Close, // close the polygon ! BOOL Winding) // ALTERNATE or WINDING fill ! { ! MiniWindowMapIterator it = m_MiniWindows.find (Name); ! ! if (it == m_MiniWindows.end ()) ! return eNoSuchWindow; ! ! return it->second->Polygon (Points, PenColour, PenStyle, PenWidth, BrushColour, BrushStyle, Close, Winding); ! } // end of CMUSHclientDoc::WindowPolygon ! ! ! // move an existing window ! long CMUSHclientDoc::WindowPosition(LPCTSTR Name, ! long Left, long Top, ! short Position, ! long Flags) ! { ! MiniWindowMapIterator it = m_MiniWindows.find (Name); ! ! if (it == m_MiniWindows.end ()) ! return eNoSuchWindow; ! ! return it->second->Position (Left, Top, Position, Flags); ! } // end of CMUSHclientDoc::WindowPosition ! ! ! /* ! ! Cursor values: ! ! 0: arrow ! 1: hand ! 2: I-beam ! 3: + symbol ! 4: wait (hour-glass) ! 5: up arrow ! 6: arrow nw-se ! 7: arrow ne-sw ! 8: arrow e-w ! 9: arrow n-s ! 10: arrow - all ways ! 11: (X) no, no, I won't do that, but ... ! 12: help (? symbol) ! ! */ ! ! ! // add a hotspot for handling mouse-over, mouse up/down events ! long CMUSHclientDoc::WindowAddHotspot(LPCTSTR Name, ! LPCTSTR HotspotId, ! long Left, long Top, long Right, long Bottom, ! LPCTSTR MouseOver, ! LPCTSTR CancelMouseOver, ! LPCTSTR MouseDown, ! LPCTSTR CancelMouseDown, ! LPCTSTR MouseUp, ! LPCTSTR TooltipText, ! long Cursor, ! long Flags) ! { ! MiniWindowMapIterator it = m_MiniWindows.find (Name); ! ! if (it == m_MiniWindows.end ()) ! return eNoSuchWindow; ! ! string sPluginID; ! ! if (!m_CurrentPlugin) ! return eNotAPlugin; ! ! sPluginID = m_CurrentPlugin->m_strID; ! ! return it->second->AddHotspot (HotspotId, ! sPluginID, ! Left, Top, Right, Bottom, ! MouseOver, ! CancelMouseOver, ! MouseDown, ! CancelMouseDown, ! MouseUp, ! TooltipText, ! Cursor, ! Flags); ! } // end of CMUSHclientDoc::WindowHotspot ! ! // remove a previously-installed hotspot ! long CMUSHclientDoc::WindowDeleteHotspot(LPCTSTR Name, LPCTSTR HotspotId) ! { ! MiniWindowMapIterator it = m_MiniWindows.find (Name); ! ! if (it == m_MiniWindows.end ()) ! return eNoSuchWindow; ! ! return it->second->DeleteHotspot (HotspotId); ! } // end of CMUSHclientDoc::WindowDeleteHotspot ! ! // return list of all hotspots in this miniwindow ! VARIANT CMUSHclientDoc::WindowHotspotList(LPCTSTR Name) ! { ! VARIANT vaResult; ! VariantInit(&vaResult); ! ! vaResult.vt = VT_EMPTY; ! ! MiniWindowMapIterator it = m_MiniWindows.find (Name); ! ! if (it == m_MiniWindows.end ()) ! return vaResult; ! ! it->second->HotspotList (vaResult); ! return vaResult; ! } // end of CMUSHclientDoc::WindowHotspotList ! ! // delete all hotspots ! long CMUSHclientDoc::WindowDeleteAllHotspots(LPCTSTR Name) ! { ! MiniWindowMapIterator it = m_MiniWindows.find (Name); ! ! if (it == m_MiniWindows.end ()) ! return eNoSuchWindow; ! ! return it->second->DeleteAllHotspots (); ! } // end of CMUSHclientDoc::WindowDeleteAllHotspots ! ! ! // get information about a hotspot ! VARIANT CMUSHclientDoc::WindowHotspotInfo(LPCTSTR Name, LPCTSTR HotspotId, long InfoType) ! { ! VARIANT vaResult; ! VariantInit(&vaResult); ! ! vaResult.vt = VT_EMPTY; ! ! MiniWindowMapIterator it = m_MiniWindows.find (Name); ! ! if (it == m_MiniWindows.end ()) ! return vaResult; ! ! it->second->FontInfo (HotspotId, InfoType, vaResult); ! return vaResult; ! } // end of CMUSHclientDoc::WindowHotspotInfo ! ! ! long CMUSHclientDoc::WindowImageOp(LPCTSTR Name, short Action, ! long Left, long Top, long Right, long Bottom, ! long PenColour, long PenStyle, long PenWidth, ! long BrushColour, // 0-bits are drawn in this colour ! LPCTSTR ImageId, ! long EllipseWidth, long EllipseHeight) ! { ! MiniWindowMapIterator it = m_MiniWindows.find (Name); ! ! if (it == m_MiniWindows.end ()) ! return eNoSuchWindow; ! ! return it->second->ImageOp (Action, Left, Top, Right, Bottom, ! PenColour, PenStyle, PenWidth, ! BrushColour, ImageId, ! EllipseWidth, EllipseHeight); ! } ! ! long CMUSHclientDoc::WindowCreateImage(LPCTSTR Name, LPCTSTR ImageId, ! long Row1, long Row2, long Row3, long Row4, long Row5, long Row6, long Row7, long Row8) ! { ! MiniWindowMapIterator it = m_MiniWindows.find (Name); ! ! if (it == m_MiniWindows.end ()) ! return eNoSuchWindow; ! ! return it->second->CreateImage (ImageId, Row1, Row2, Row3, Row4, Row5, Row6, Row7, Row8); ! } ! ! ! /* ====================================================================== Index: mushclient.cnt =================================================================== RCS file: /cvs/mushclient/mushclient.cnt,v retrieving revision 1.38 retrieving revision 1.51 diff -c -r1.38 -r1.51 *** mushclient.cnt 8 Jul 2008 03:49:51 -0000 1.38 --- mushclient.cnt 24 Jul 2008 01:28:45 -0000 1.51 *************** *** 290,295 **** --- 290,296 ---- 3 GetCurrentValue=FNC_GetCurrentValue 3 GetCustomColourName=FNC_GetCustomColourName 3 GetDefaultValue=FNC_GetDefaultValue + 3 GetDeviceCaps=FNC_GetDeviceCaps 3 GetEntity=FNC_GetEntity 3 GetFrame=FNC_GetFrame 3 GetGlobalOption=FNC_GetGlobalOption *************** *** 446,451 **** --- 447,454 ---- 3 SendToNotepad=FNC_SendToNotepad 3 SetAliasOption=FNC_SetAliasOption 3 SetAlphaOption=FNC_SetAlphaOption + 3 SetBackgroundColour=FNC_SetBackgroundColour + 3 SetBackgroundImage=FNC_SetBackgroundImage 3 SetChanged=FNC_SetChanged 3 SetChatOption=FNC_SetChatOption 3 SetClipboard=FNC_SetClipboard *************** *** 453,458 **** --- 456,462 ---- 3 SetCommandWindowHeight=FNC_SetCommandWindowHeight 3 SetCustomColourName=FNC_SetCustomColourName 3 SetEntity=FNC_SetEntity + 3 SetForegroundImage=FNC_SetForegroundImage 3 SetInputFont=FNC_SetInputFont 3 SetNotes=FNC_SetNotes 3 SetOption=FNC_SetOption *************** *** 484,489 **** --- 488,520 ---- 3 UdpPortList=FNC_UdpPortList 3 UdpSend=FNC_UdpSend 3 Version=FNC_Version + 3 WindowAddHotspot=FNC_WindowAddHotspot + 3 WindowArc=FNC_WindowArc + 3 WindowBezier=FNC_WindowBezier + 3 WindowCircleOp=FNC_WindowCircleOp + 3 WindowCreate=FNC_WindowCreate + 3 WindowCreateImage=FNC_WindowCreateImage + 3 WindowDeleteAllHotspots=FNC_WindowDeleteAllHotspots + 3 WindowDeleteHotspot=FNC_WindowDeleteHotspot + 3 WindowDrawImage=FNC_WindowDrawImage + 3 WindowFont=FNC_WindowFont + 3 WindowFontInfo=FNC_WindowFontInfo + 3 WindowFontList=FNC_WindowFontList + 3 WindowImageInfo=FNC_WindowImageInfo + 3 WindowImageList=FNC_WindowImageList + 3 WindowImageOp=FNC_WindowImageOp + 3 WindowHotspotInfo=FNC_WindowHotspotInfo + 3 WindowHotspotList=FNC_WindowHotspotList + 3 WindowInfo=FNC_WindowInfo + 3 WindowLine=FNC_WindowLine + 3 WindowList=FNC_WindowList + 3 WindowLoadImage=FNC_WindowLoadImage + 3 WindowPolygon=FNC_WindowPolygon + 3 WindowPosition=FNC_WindowPosition + 3 WindowRectOp=FNC_WindowRectOp + 3 WindowShow=FNC_WindowShow + 3 WindowText=FNC_WindowText + 3 WindowTextWidth=FNC_WindowTextWidth 3 WorldAddress=FNC_WorldAddress 3 WorldName=FNC_WorldName 3 WorldPort=FNC_WorldPort Index: mushclient.hlp =================================================================== RCS file: /cvs/mushclient/mushclient.hlp,v retrieving revision 1.99 retrieving revision 1.100 diff -c -r1.99 -r1.100 Binary files /tmp/cvsBhOWV5 and /tmp/cvs9MbJEl differ Index: mushclient.odl =================================================================== RCS file: /cvs/mushclient/mushclient.odl,v retrieving revision 1.117 retrieving revision 1.132 diff -c -r1.117 -r1.132 *** mushclient.odl 8 Jul 2008 03:50:02 -0000 1.117 --- mushclient.odl 26 Jul 2008 06:13:31 -0000 1.132 *************** *** 70,83 **** [id(44)] long SetCommand(BSTR Message); [id(45)] BSTR GetNotes(); [id(46)] void SetNotes(BSTR Message); ! [id(327), propget] long NormalColour(short WhichColour); ! [id(327), propput] void NormalColour(short WhichColour, long nNewValue); ! [id(328), propget] long BoldColour(short WhichColour); ! [id(328), propput] void BoldColour(short WhichColour, long nNewValue); ! [id(329), propget] long CustomColourText(short WhichColour); ! [id(329), propput] void CustomColourText(short WhichColour, long nNewValue); ! [id(330), propget] long CustomColourBackground(short WhichColour); ! [id(330), propput] void CustomColourBackground(short WhichColour, long nNewValue); [id(47)] void Redraw(); [id(48)] long ResetTimer(BSTR TimerName); [id(49)] void SetOutputFont(BSTR FontName, short PointSize); --- 70,83 ---- [id(44)] long SetCommand(BSTR Message); [id(45)] BSTR GetNotes(); [id(46)] void SetNotes(BSTR Message); ! [id(358), propget] long NormalColour(short WhichColour); ! [id(358), propput] void NormalColour(short WhichColour, long nNewValue); ! [id(359), propget] long BoldColour(short WhichColour); ! [id(359), propput] void BoldColour(short WhichColour, long nNewValue); ! [id(360), propget] long CustomColourText(short WhichColour); ! [id(360), propput] void CustomColourText(short WhichColour, long nNewValue); ! [id(361), propget] long CustomColourBackground(short WhichColour); ! [id(361), propput] void CustomColourBackground(short WhichColour, long nNewValue); [id(47)] void Redraw(); [id(48)] long ResetTimer(BSTR TimerName); [id(49)] void SetOutputFont(BSTR FontName, short PointSize); *************** *** 358,363 **** --- 358,394 ---- [id(324)] long ShiftTabCompleteItem(BSTR Item); [id(325)] long NotepadReadOnly(BSTR Title, BOOL ReadOnly); [id(326)] long AddFont(BSTR PathName); + [id(327)] long SetBackgroundImage(BSTR FileName, short Mode); + [id(328)] long SetForegroundImage(BSTR FileName, short Mode); + [id(329)] long SetBackgroundColour(long Colour); + [id(330)] long WindowRectOp(BSTR Name, short Action, long Left, long Top, long Right, long Bottom, long Colour1, long Colour2); + [id(331)] long WindowShow(BSTR Name, BOOL Show); + [id(332)] long WindowTextWidth(BSTR Name, BSTR FontId, BSTR Text, BOOL Unicode); + [id(333)] VARIANT WindowFontInfo(BSTR Name, BSTR FontId, long InfoType); + [id(334)] long WindowLine(BSTR Name, long x1, long y1, long x2, long y2, long PenColour, long PenStyle, long PenWidth); + [id(335)] long WindowArc(BSTR Name, long Left, long Top, long Right, long Bottom, long x1, long y1, long x2, long y2, long PenColour, long PenStyle, long PenWidth); + [id(336)] VARIANT WindowList(); + [id(337)] VARIANT WindowFontList(BSTR Name); + [id(338)] VARIANT WindowInfo(BSTR Name, long InfoType); + [id(339)] long WindowLoadImage(BSTR Name, BSTR ImageId, BSTR FileName); + [id(340)] VARIANT WindowImageList(BSTR Name); + [id(341)] long WindowText(BSTR Name, BSTR FontId, BSTR Text, long Left, long Top, long Right, long Bottom, long Colour, BOOL Unicode); + [id(342)] long WindowDrawImage(BSTR Name, BSTR ImageId, long Left, long Top, long Right, long Bottom, short Mode, long SrcLeft, long SrcTop, long SrcRight, long SrcBottom); + [id(343)] VARIANT WindowImageInfo(BSTR Name, BSTR ImageId, long InfoType); + [id(344)] long GetDeviceCaps(long Index); + [id(345)] long WindowBezier(BSTR Name, BSTR Points, long PenColour, long PenStyle, long PenWidth); + [id(346)] long WindowCreate(BSTR Name, long Left, long Top, long Width, long Height, short Position, long Flags, long BackgroundColour); + [id(347)] long WindowPosition(BSTR Name, long Left, long Top, short Position, long Flags); + [id(348)] long WindowDeleteHotspot(BSTR Name, BSTR HotspotId); + [id(349)] VARIANT WindowHotspotList(BSTR Name); + [id(350)] long WindowDeleteAllHotspots(BSTR Name); + [id(351)] VARIANT WindowHotspotInfo(BSTR Name, BSTR HotspotId, long InfoType); + [id(352)] long WindowPolygon(BSTR Name, BSTR Points, long PenColour, long PenStyle, long PenWidth, long BrushColour, long BrushStyle, BOOL Close, BOOL Winding); + [id(353)] long WindowAddHotspot(BSTR Name, BSTR HotspotId, long Left, long Top, long Right, long Bottom, BSTR MouseOver, BSTR CancelMouseOver, BSTR MouseDown, BSTR CancelMouseDown, BSTR MouseUp, BSTR TooltipText, long Cursor, long Flags); + [id(354)] long WindowCircleOp(BSTR Name, short Action, long Left, long Top, long Right, long Bottom, long PenColour, long PenStyle, long PenWidth, long BrushColour, long BrushStyle, long Extra1, long Extra2, long Extra3, long Extra4); + [id(355)] long WindowCreateImage(BSTR Name, BSTR ImageId, long Row1, long Row2, long Row3, long Row4, long Row5, long Row6, long Row7, long Row8); + [id(356)] long WindowImageOp(BSTR Name, short Action, long Left, long Top, long Right, long Bottom, long PenColour, long PenStyle, long PenWidth, long BrushColour, BSTR ImageId, long EllipseWidth, long EllipseHeight); + [id(357)] long WindowFont(BSTR Name, BSTR FontId, BSTR FontName, double Size, BOOL Bold, BOOL Italic, BOOL Underline, BOOL Strikeout, short Charset, short PitchAndFamily); //}}AFX_ODL_METHOD }; Index: mushview.cpp =================================================================== RCS file: /cvs/mushclient/mushview.cpp,v retrieving revision 1.93 retrieving revision 1.109 diff -c -r1.93 -r1.109 *** mushview.cpp 3 Jul 2008 23:55:25 -0000 1.93 --- mushview.cpp 25 Jul 2008 01:24:52 -0000 1.109 *************** *** 486,492 **** OffsetRect (&r, -m_scroll_position.x, -m_scroll_position.y); if (bBackground) ! pDC->FillSolidRect (&r, pDoc->TranslateColour (clrBackground)); else { if (pDoc->m_bUTF_8) // Unicode output --- 486,501 ---- OffsetRect (&r, -m_scroll_position.x, -m_scroll_position.y); if (bBackground) ! { ! COLORREF b; ! if (pDoc->m_bCustom16isDefaultColour) ! b = pDoc->m_customback [15]; ! else ! b = pDoc->m_normalcolour [BLACK]; ! ! if (clrBackground != b) ! pDC->FillSolidRect (&r, pDoc->TranslateColour (clrBackground)); ! } else { if (pDoc->m_bUTF_8) // Unicode output *************** *** 594,599 **** --- 603,831 ---- operator CMyMemDC*() {return this;} }; + /* modes: + + 0 = strech to output view size + 1 = stretch with aspect ratio + + 2 = strech to owner size + 3 = stretch with aspect ratio + + -- going clockwise here: + + -- top + 4 = top left + 5 = center left-right at top + 6 = top right + + -- rh side + 7 = on right, center top-bottom + 8 = on right, at bottom + + -- bottom + 9 = center left-right at bottom + + -- lh side + 10 = on left, at bottom + 11 = on left, center top-bottom + + -- middle + 12 = center all + + 13 = tile + + + */ + + void CMUSHView::Blit_Bitmap (CDC* pDestDC, CDC* pSrcDC, + const long iWidth, const long iHeight, + const short iMode, + CRect & rect, + const bool bUseRect, + const bool bTransparent, + const COLORREF TransparentColour) + { + + if (iWidth <= 0 || iHeight <= 0) + return; + + CChildFrame * pFrame = m_owner_frame; + + + RECT r; + + if (iMode == 2 || iMode == 3) + pFrame->GetClientRect (&r); + else + GetClientRect (&r); + + pDestDC->SetStretchBltMode (HALFTONE); // looks better when squashed + + // they know where they want it to go + if (bUseRect) + { + rect.right = iWidth; + rect.bottom = iHeight; + } + else + { + switch (iMode) + { + case 0 : // stretch + case 2 : + rect = CRect (0, 0, r.right, r.bottom); + break; + + + case 1: // stretch with aspect ratio + case 3: + { + double ratio = ((double) iWidth) / ((double) iHeight); + rect = CRect (0, 0, r.bottom * ratio, r.bottom); + break; + + } + + case 4: // top left + rect = CRect (0, 0, iWidth, iHeight); + break; + + + case 5 : // center left-right at top + rect = CRect ((r.right - iWidth) / 2, 0, iWidth, iHeight); + break; + + case 6 : // top right + rect = CRect (r.right - iWidth, 0, iWidth, iHeight); + break; + + + case 7 : // on right, center top-bottom + rect = CRect (r.right - iWidth, (r.bottom - iHeight) / 2, iWidth, iHeight); + break; + + + case 8 : // on right at bottom + rect = CRect (r.right - iWidth, r.bottom - iHeight, iWidth, iHeight); + break; + + case 9 : // center left-right at bottom + rect = CRect ((r.right - iWidth) / 2, r.bottom - iHeight, iWidth, iHeight); + break; + + case 10 : // on left, at bottom + rect = CRect (0, r.bottom - iHeight, iWidth, iHeight); + break; + + + case 11 : // on left, center top-bottom + rect = CRect (0, (r.bottom - iHeight) / 2, iWidth, iHeight); + + break; + + case 12: // center all + rect = CRect ((r.right - iWidth) / 2, (r.bottom - iHeight) / 2, iWidth, iHeight); + break; + + case 13 : // tile + { + rect = r; + int iAcross = (r.right / iWidth) + 1; + int iDown = (r.bottom / iHeight) + 1; + int x, y; + + for (x = 0; x < iAcross; x++) + { + for (y = 0; y < iDown; y++) + { + pDestDC->BitBlt (x * iWidth, y * iHeight, + iWidth, iHeight, pSrcDC, 0, 0, SRCCOPY); + + } // each y + } // each x + + + + } // tile + + return; // don't blit again + + } // end switch + } // end of not absolute position + + + if (iMode <= 3) // stretch + pDestDC->StretchBlt(rect.left, rect.top, rect.right, rect.bottom, pSrcDC, 0, 0, iWidth, iHeight, SRCCOPY); + else + { // normal + if (bTransparent) + { + COLORREF crOldBack = pDestDC->SetBkColor (RGB (255, 255, 255)); // white + COLORREF crOldText = pDestDC->SetTextColor (RGB (0, 0, 0)); // black + CDC dcTrans; // transparency mask + + + // Create a memory dc for the mask + dcTrans.CreateCompatibleDC(pDestDC); + + // Create the mask bitmap for the subset of the main image + CBitmap bitmapTrans; + bitmapTrans.CreateBitmap(iWidth, iHeight, 1, 1, NULL); + + // Select the mask bitmap into the appropriate dc + CBitmap* pOldBitmapTrans = dcTrans.SelectObject(&bitmapTrans); + + // Set transparency colour + COLORREF crOldBackground = pSrcDC->SetBkColor (TransparentColour); + + // Build mask based on transparent colour at location 0, 0 + dcTrans.BitBlt (0, 0, iWidth, iHeight, pSrcDC, 0, 0, SRCCOPY); + + // Do the work + pDestDC->BitBlt (rect.left, rect.top, iWidth, iHeight, pSrcDC, 0, 0, SRCINVERT); + pDestDC->BitBlt (rect.left, rect.top, iWidth, iHeight, &dcTrans, 0, 0, SRCAND); + pDestDC->BitBlt (rect.left, rect.top, iWidth, iHeight, pSrcDC, 0, 0, SRCINVERT); + + // Restore settings + dcTrans.SelectObject(pOldBitmapTrans); + pDestDC->SetBkColor(crOldBack); + pDestDC->SetTextColor(crOldText); + pSrcDC->SetBkColor(crOldBackground); + } + else // not transparent + pDestDC->BitBlt (rect.left, rect.top, rect.right, rect.bottom, pSrcDC, 0, 0, SRCCOPY); + } + + // make into rectangle, not position and width/height + rect.right += rect.left; + rect.bottom += rect.top; + + } // end of CMUSHView::Blit_Bitmap + + + void CMUSHView::DrawImage (CDC* pDC, CBitmap & bitmap, const short iMode) + { + + if ((HBITMAP) bitmap == NULL) + return; + + + CClientDC dc(this); + CDC bmDC; + bmDC.CreateCompatibleDC(&dc); + CBitmap *pOldbmp = bmDC.SelectObject(&bitmap); + + BITMAP bi; + bitmap.GetBitmap(&bi); + CRect r; + + Blit_Bitmap (pDC, &bmDC, bi.bmWidth, bi.bmHeight, iMode, r); + + bmDC.SelectObject(pOldbmp); + + + } // end of CMUSHView::DrawImage + void CMUSHView::OnDraw(CDC* dc) { *************** *** 621,664 **** CBrush backbr; CRect rect; ! if (pDoc->m_bCustom16isDefaultColour) backbr.CreateSolidBrush (pDoc->TranslateColour (pDoc->m_customback [15])); else backbr.CreateSolidBrush (pDoc->TranslateColour (pDoc->m_normalcolour [BLACK])); ! pDC->GetClipBox (&rect); pDC->SetBkMode (OPAQUE); ! pDC->FillRect (&rect, &backbr); ! /* ! // background image ! // didn't really work - because text isn't transparent, for one thing ! if ((HBITMAP) pDoc->m_bitmap) ! { ! BITMAP bi; ! pDoc->m_bitmap.GetBitmap(&bi); ! CClientDC dc(this); ! CDC bmDC; ! bmDC.CreateCompatibleDC(&dc); ! CBitmap *pOldbmp = bmDC.SelectObject(&pDoc->m_bitmap); - pDC->BitBlt(0,0,bi.bmWidth,bi.bmHeight,&bmDC,0,0,SRCCOPY); - bmDC.SelectObject(pOldbmp); - } - - */ CPoint pt = GetScrollPosition (); - RECT r; - - GetClientRect (&r); startline = (pt.y - pDoc->m_iPixelOffset) / pDoc->m_FontHeight; endline = ((pt.y + r.bottom) / pDoc->m_FontHeight) + 2; --- 853,912 ---- CBrush backbr; CRect rect; ! // background colour ! if (pDoc->m_iBackgroundColour != NO_COLOUR) ! backbr.CreateSolidBrush (pDoc->m_iBackgroundColour); ! else if (pDoc->m_bCustom16isDefaultColour) backbr.CreateSolidBrush (pDoc->TranslateColour (pDoc->m_customback [15])); else backbr.CreateSolidBrush (pDoc->TranslateColour (pDoc->m_normalcolour [BLACK])); ! RECT r; ! ! GetClientRect (&r); pDC->SetBkMode (OPAQUE); ! pDC->FillRect (&r, &backbr); + // background image + if ((HBITMAP) pDoc->m_BackgroundBitmap) + DrawImage (pDC, pDoc->m_BackgroundBitmap, pDoc->m_iBackgroundMode); ! Calculate_MiniWindow_Rectangles (pDoc, true); ! MiniWindowMapIterator mwit; ! // mini windows - on bottom ! for (mwit = pDoc->m_MiniWindows.begin (); ! mwit != pDoc->m_MiniWindows.end (); ! mwit++) ! { ! CMiniWindow * mw = mwit->second; ! // not if not to be shown ! if (!mw->GetShow () || mw->m_bTemporarilyHide) ! continue; ! ! long iFlags = mw->GetFlags (); ! ! // not if wrong time ! if (!(iFlags & MINIWINDOW_DRAW_UNDERNEATH)) ! continue; ! ! // blit onto screen ! Blit_Bitmap (pDC, mw->GetDC (), ! mw->GetWidth (), mw->GetHeight (), ! mw->GetPosition (), ! mw->m_rect, ! mw->GetPosition () != 13, // absolute? - we precalculated so yes (except tile) ! (iFlags & MINIWINDOW_TRANSPARENT) != 0, // transparent? ! mw->GetBackgroundColour ()); ! } // end for each window CPoint pt = GetScrollPosition (); startline = (pt.y - pDoc->m_iPixelOffset) / pDoc->m_FontHeight; endline = ((pt.y + r.bottom) / pDoc->m_FontHeight) + 2; *************** *** 773,778 **** --- 1021,1033 ---- if (bBackground && App.m_bBleedBackground) { + + COLORREF b; + if (pDoc->m_bCustom16isDefaultColour) + b = pDoc->m_customback [15]; + else + b = pDoc->m_normalcolour [BLACK]; + pDC->SetBkMode (OPAQUE); RECT r, cr; // client rect *************** *** 820,826 **** OffsetRect (&r, -m_scroll_position.x, -m_scroll_position.y); ! pDC->FillSolidRect (&r, pDoc->TranslateColour (clrBackground)); // -------- bleed to right -------- --- 1075,1082 ---- OffsetRect (&r, -m_scroll_position.x, -m_scroll_position.y); ! if (clrBackground != b) ! pDC->FillSolidRect (&r, pDoc->TranslateColour (clrBackground)); // -------- bleed to right -------- *************** *** 866,872 **** OffsetRect (&r, -m_scroll_position.x, -m_scroll_position.y); ! pDC->FillSolidRect (&r, pDoc->TranslateColour (clrBackground)); } // end of bleed wanted // special drawing for horizontal rule --- 1122,1129 ---- OffsetRect (&r, -m_scroll_position.x, -m_scroll_position.y); ! if (clrBackground != b) ! pDC->FillSolidRect (&r, pDoc->TranslateColour (clrBackground)); } // end of bleed wanted // special drawing for horizontal rule *************** *** 906,912 **** FixupTitle (); } ! } void CMUSHView::OnInitialUpdate() { --- 1163,1205 ---- FixupTitle (); } ! ! // foreground image ! ! if ((HBITMAP) pDoc->m_ForegroundBitmap) ! DrawImage (pDC, pDoc->m_ForegroundBitmap, pDoc->m_iForegroundMode); ! ! Calculate_MiniWindow_Rectangles (pDoc, false); ! ! // mini windows - on bottom ! for (mwit = pDoc->m_MiniWindows.begin (); ! mwit != pDoc->m_MiniWindows.end (); ! mwit++) ! { ! CMiniWindow * mw = mwit->second; ! // not if not to be shown ! if (!mw->GetShow () || mw->m_bTemporarilyHide) ! continue; ! ! long iFlags = mw->GetFlags (); ! ! // not if wrong time ! if ((iFlags & MINIWINDOW_DRAW_UNDERNEATH)) ! continue; ! ! // blit onto screen ! Blit_Bitmap (pDC, mw->GetDC (), ! mw->GetWidth (), mw->GetHeight (), ! mw->GetPosition (), ! mw->m_rect, ! mw->GetPosition () != 13, // absolute? - we precalculated so yes (except tile) ! (iFlags & MINIWINDOW_TRANSPARENT) != 0, // transparent? ! mw->GetBackgroundColour ()); ! ! } // end for each window ! ! } // end CMUSHView::OnDraw ! void CMUSHView::OnInitialUpdate() { *************** *** 936,942 **** TRACE("Error in creating ToolTip"); } ! } ///////////////////////////////////////////////////////////////////////////// // CMUSHView printing --- 1229,1235 ---- TRACE("Error in creating ToolTip"); } ! } // end CMUSHView::OnInitialUpdate ///////////////////////////////////////////////////////////////////////////// // CMUSHView printing *************** *** 1560,1570 **** if (!pDoc->m_FontHeight) return; ! if (GetKeyState (VK_CONTROL) < 0) // ctrl+click ! { ! AliasMenu (point); ! return; ! } // end of ctrl+click // CView changes the viewport origin and mapping mode. // It's necessary to convert the point from device coordinates --- 1853,1860 ---- if (!pDoc->m_FontHeight) return; ! CPoint orig_point = point; // for AliasMenu ! // CView changes the viewport origin and mapping mode. // It's necessary to convert the point from device coordinates *************** *** 1572,1760 **** CClientDC dc(this); OnPrepareDC(&dc); dc.DPtoLP(&point); dc.SelectObject(pDoc->m_font [0]); m_last_mouse_position = point; ! // new, for MXP - see if they clicked on a hyperlink ! // if (pDoc->m_bMXP) ! if (true) // NJG ! { ! // find which line and column the mouse position is at ! ! calculate_line_and_column (point, dc, line, col, false); ! // find line ! CLine * pLine = pDoc->m_LineList.GetAt (pDoc->GetLinePosition (line)); ! unsigned int iStyle; ! CStyle * pStyle; ! POSITION foundpos; ! int iCol; ! // don't do it *past* end of last word ! long pixel = calculate_width (line, pLine->len, pDoc, dc) + pDoc->m_iPixelOffset; ! if (point.x < pixel && ! pDoc->FindStyle (pLine, col, iCol, pStyle, foundpos)) ! { ! iStyle = pStyle->iFlags; ! ! if (pStyle->pAction && ! !pStyle->pAction->m_strAction.IsEmpty () && ! pStyle->pAction->m_strAction.Find ("&text;") == -1) ! if ((iStyle & ACTIONTYPE) == ACTION_SEND || ! (iStyle & ACTIONTYPE) == ACTION_PROMPT) ! { ! CString strActions = pStyle->pAction->m_strAction; // action ! CString strHints = pStyle->pAction->m_strHint; // hints, if any ! CStringList actionsList; ! StringToList (strActions, POPUP_DELIMITER, actionsList); ! CString strAction = actionsList.GetHead (); ! // just send first action (default action) ! // unpause the output window if wanted ! if (pDoc->m_bUnpauseOnSend && m_freeze) ! { ! m_freeze = false; ! addedstuff (); ! } ! if ((iStyle & ACTIONTYPE) == ACTION_SEND && ! (pLine->flags & COMMENT) == COMMENT) ! { ! // action_send on a note line will be executed, not sent ! // (for the world.Hyperlink function) ! // However an action in the form !!pluginID:script(arg) ! // eg. !!753ba7e011f3c8943a885f18:mysub(1234) ! // will be passed the nominted sub in the nominated plugin ! ! CPlugin * pPlugin = NULL; ! ! // rather elaborate test ... ! ! // a. Must start with !! ! // b. Must end with ) ! // c. Must have a "(" in it ! // d. After the !! there must be 24 hex characters ! // e. After that must be a colon (:) ! // f. After the colon must be a valid subroutine name ! if (strAction.GetLength () >= PLUGIN_UNIQUE_ID_LENGTH + 5 && ! strAction.Left (2) == "!!" && ! strAction.Right (1) == ")" && ! strAction.Find ("(") != -1 && ! strAction.Mid (PLUGIN_UNIQUE_ID_LENGTH + 2, 1) == ":" && ! IsPluginID (strAction.Mid (2, PLUGIN_UNIQUE_ID_LENGTH)) && ! IsSubName (strAction.Mid (PLUGIN_UNIQUE_ID_LENGTH + 3))) ! { // correct syntax for plugin call ! CString strPluginID = strAction.Mid (2, PLUGIN_UNIQUE_ID_LENGTH); ! strAction = strAction.Mid (PLUGIN_UNIQUE_ID_LENGTH + 3); ! int iBracket = strAction.Find ("("); ! if (iBracket != -1) { ! CString strScriptName = strAction.Left (iBracket); ! strScriptName.TrimRight (); ! CString strArg = strAction.Mid (iBracket + 1); ! strArg = strArg.Left (strArg.GetLength () - 1); // drop trailing ) ! long iResult = pDoc->CallPlugin (strPluginID, strScriptName, strArg); ! CString strName = strPluginID; // default to ID ! if (iResult != eOK) ! { ! CPlugin * pPlugin = pDoc->GetPlugin (strPluginID); ! if (pPlugin) ! strName = pPlugin->m_strName; ! } // end of finding plugin's name ! switch (iResult) ! { ! case eNoSuchPlugin: ! pDoc->ColourNote ("white", "red", ! TFormat ("Plugin \"%s\" is not installed", ! (LPCTSTR) strName)); ! break; ! case eNoSuchRoutine: ! pDoc->ColourNote ("white", "red", ! TFormat ("Script routine \"%s\" is not in plugin %s", ! (LPCTSTR) strScriptName, ! (LPCTSTR) strName)); ! break; ! ! case eErrorCallingPluginRoutine: ! pDoc->ColourNote ("white", "red", ! TFormat ("An error occurred calling plugin %s", ! (LPCTSTR) strName)); ! break; ! ! } // end of switch on errors ! } // end of ( found (this should occur, really) ! } // end of plugin existing ! else ! { // plugin does not exist - just execute it ! pDoc->m_iExecutionDepth = 0; ! pDoc->Execute (strAction); ! } ! } // end of note hyperlink else ! { // not note line ! if (pDoc->CheckConnected ()) ! return; ! // send to command window? ! if ( (iStyle & ACTIONTYPE) == ACTION_PROMPT) ! { ! if (m_bottomview->CheckTyping (pDoc, strAction)) ! return; ! m_bottomview->SetCommand (strAction); ! } ! else ! { ! // send it ! pDoc->SendMsg (strAction, ! pDoc->m_bEchoHyperlinkInOutputWindow, ! false, // don't queue ! pDoc->LoggingInput ()); ! if (pDoc->m_bHyperlinkAddsToCommandHistory) ! m_bottomview->AddToCommandHistory (strAction); ! } ! // put the focus back in the send window ! OnKeysActivatecommandview (); ! } // end of not execute wanted ! return; ! } // end of ACTION_SEND or ACTION_PROMPT ! else ! if ((iStyle & ACTIONTYPE) == ACTION_HYPERLINK) ! { ! CString strAction = pStyle->pAction->m_strAction; ! // don't let them slip in arbitrary OS commands ! if (strAction.Left (7).CompareNoCase ("http://") != 0 && ! strAction.Left (8).CompareNoCase ("https://") != 0 && ! strAction.Left (7).CompareNoCase ("mailto:") != 0) ! ::UMessageBox(TFormat ("Hyperlink action \"%s\" - permission denied.", (const char *) strAction), MB_ICONEXCLAMATION); ! else ! if ((long) ShellExecute (Frame, _T("open"), strAction, NULL, NULL, SW_SHOWNORMAL) <= 32) ! ::UMessageBox(TFormat ("Unable to open the hyperlink \"%s\"", ! (const char *) strAction), ! MB_ICONEXCLAMATION); ! return; ! } // end of ACTION_HYPERLINK ! } // end of column found - } // end of MXP enabled calculate_line_and_column (point, dc, line, col, true); --- 1862,2057 ---- CClientDC dc(this); OnPrepareDC(&dc); dc.DPtoLP(&point); + + // if click in mini-window, don't continue + if (Mouse_Down_MiniWindow (pDoc, point, 0x10)) // LH mouse, singe click + return; + + if (GetKeyState (VK_CONTROL) < 0) // ctrl+click + { + AliasMenu (orig_point); + return; + } // end of ctrl+click + dc.SelectObject(pDoc->m_font [0]); m_last_mouse_position = point; ! // see if they clicked on a hyperlink ! // find which line and column the mouse position is at ! ! calculate_line_and_column (point, dc, line, col, false); ! // find line ! CLine * pLine = pDoc->m_LineList.GetAt (pDoc->GetLinePosition (line)); ! unsigned int iStyle; ! CStyle * pStyle; ! POSITION foundpos; ! int iCol; ! // don't do it *past* end of last word ! long pixel = calculate_width (line, pLine->len, pDoc, dc) + pDoc->m_iPixelOffset; ! if (point.x < pixel && ! pDoc->FindStyle (pLine, col, iCol, pStyle, foundpos)) ! { ! iStyle = pStyle->iFlags; ! ! if (pStyle->pAction && ! !pStyle->pAction->m_strAction.IsEmpty () && ! pStyle->pAction->m_strAction.Find ("&text;") == -1) ! if ((iStyle & ACTIONTYPE) == ACTION_SEND || ! (iStyle & ACTIONTYPE) == ACTION_PROMPT) ! { ! CString strActions = pStyle->pAction->m_strAction; // action ! CString strHints = pStyle->pAction->m_strHint; // hints, if any ! CStringList actionsList; ! StringToList (strActions, POPUP_DELIMITER, actionsList); ! CString strAction = actionsList.GetHead (); ! // just send first action (default action) ! // unpause the output window if wanted ! if (pDoc->m_bUnpauseOnSend && m_freeze) ! { ! m_freeze = false; ! addedstuff (); ! } ! if ((iStyle & ACTIONTYPE) == ACTION_SEND && ! (pLine->flags & COMMENT) == COMMENT) ! { ! // action_send on a note line will be executed, not sent ! // (for the world.Hyperlink function) ! // However an action in the form !!pluginID:script(arg) ! // eg. !!753ba7e011f3c8943a885f18:mysub(1234) ! // will be passed the nominted sub in the nominated plugin ! ! CPlugin * pPlugin = NULL; ! ! // rather elaborate test ... ! ! // a. Must start with !! ! // b. Must end with ) ! // c. Must have a "(" in it ! // d. After the !! there must be 24 hex characters ! // e. After that must be a colon (:) ! // f. After the colon must be a valid subroutine name ! if (strAction.GetLength () >= PLUGIN_UNIQUE_ID_LENGTH + 5 && ! strAction.Left (2) == "!!" && ! strAction.Right (1) == ")" && ! strAction.Find ("(") != -1 && ! strAction.Mid (PLUGIN_UNIQUE_ID_LENGTH + 2, 1) == ":" && ! IsPluginID (strAction.Mid (2, PLUGIN_UNIQUE_ID_LENGTH)) && ! IsSubName (strAction.Mid (PLUGIN_UNIQUE_ID_LENGTH + 3))) ! { // correct syntax for plugin call ! CString strPluginID = strAction.Mid (2, PLUGIN_UNIQUE_ID_LENGTH); ! strAction = strAction.Mid (PLUGIN_UNIQUE_ID_LENGTH + 3); ! int iBracket = strAction.Find ("("); ! if (iBracket != -1) ! { ! CString strScriptName = strAction.Left (iBracket); ! strScriptName.TrimRight (); ! CString strArg = strAction.Mid (iBracket + 1); ! strArg = strArg.Left (strArg.GetLength () - 1); // drop trailing ) ! long iResult = pDoc->CallPlugin (strPluginID, strScriptName, strArg); ! CString strName = strPluginID; // default to ID ! if (iResult != eOK) { ! CPlugin * pPlugin = pDoc->GetPlugin (strPluginID); ! if (pPlugin) ! strName = pPlugin->m_strName; ! } // end of finding plugin's name ! switch (iResult) ! { ! case eNoSuchPlugin: ! pDoc->ColourNote ("white", "red", ! TFormat ("Plugin \"%s\" is not installed", ! (LPCTSTR) strName)); ! break; ! case eNoSuchRoutine: ! pDoc->ColourNote ("white", "red", ! TFormat ("Script routine \"%s\" is not in plugin %s", ! (LPCTSTR) strScriptName, ! (LPCTSTR) strName)); ! break; ! ! case eErrorCallingPluginRoutine: ! pDoc->ColourNote ("white", "red", ! TFormat ("An error occurred calling plugin %s", ! (LPCTSTR) strName)); ! break; ! ! } // end of switch on errors ! } // end of ( found (this should occur, really) ! } // end of plugin existing else ! { // plugin does not exist - just execute it ! pDoc->m_iExecutionDepth = 0; ! pDoc->Execute (strAction); ! } ! } // end of note hyperlink ! else ! { // not note line ! if (pDoc->CheckConnected ()) ! return; ! // send to command window? ! if ( (iStyle & ACTIONTYPE) == ACTION_PROMPT) ! { ! if (m_bottomview->CheckTyping (pDoc, strAction)) !