scmno****@osdn*****
scmno****@osdn*****
2018年 9月 8日 (土) 03:50:47 JST
Revision: 7230 http://sourceforge.jp/projects/ttssh2/scm/svn/commits/7230 Author: zmatsuo Date: 2018-09-08 03:50:47 +0900 (Sat, 08 Sep 2018) Log Message: ----------- tekwin対応 Modified Paths: -------------- branches/cmake/teraterm/teraterm/teklib.c branches/cmake/teraterm/teraterm/tekwin.cpp branches/cmake/teraterm/teraterm/tekwin.h branches/cmake/teraterm/teraterm/vtwin.cpp -------------- next part -------------- Modified: branches/cmake/teraterm/teraterm/teklib.c =================================================================== --- branches/cmake/teraterm/teraterm/teklib.c 2018-09-06 16:59:55 UTC (rev 7229) +++ branches/cmake/teraterm/teraterm/teklib.c 2018-09-07 18:50:47 UTC (rev 7230) @@ -61,25 +61,25 @@ static UseCount = 0; static const GetProcAddressList ProcList[] = { - { &TEKInit, "TEKInit" }, - { &TEKResizeWindow, "TEKResizeWindow" }, - { &TEKChangeCaret, "TEKChangeCaret" }, - { &TEKDestroyCaret, "TEKDestroyCaret" }, - { &TEKParse, "TEKParse" }, - { &TEKReportGIN, "TEKReportGIN" }, - { &TEKPaint, "TEKPaint" }, - { &TEKWMLButtonDown, "TEKWMLButtonDown" }, - { &TEKWMLButtonUp, "TEKWMLButtonUp" }, - { &TEKWMMouseMove, "TEKWMMouseMove" }, - { &TEKWMSize, "TEKWMSize" }, - { &TEKCMCopy, "TEKCMCopy" }, - { &TEKCMCopyScreen, "TEKCMCopyScreen" }, - { &TEKPrint, "TEKPrint" }, - { &TEKClearScreen, "TEKClearScreen" }, - { &TEKSetupFont, "TEKSetupFont" }, - { &TEKResetWin, "TEKResetWin" }, - { &TEKRestoreSetup, "TEKRestoreSetup" }, - { &TEKEnd, "TEKEnd" }, + { &TEKInit, "TEKInit", 8 }, + { &TEKResizeWindow, "TEKResizeWindow", 16 }, + { &TEKChangeCaret, "TEKChangeCaret", 8 }, + { &TEKDestroyCaret, "TEKDestroyCaret", 8 }, + { &TEKParse, "TEKParse", 12 }, + { &TEKReportGIN, "TEKReportGIN", 16 }, + { &TEKPaint, "TEKPaint", 16 }, + { &TEKWMLButtonDown, "TEKWMLButtonDown", 20 }, + { &TEKWMLButtonUp, "TEKWMLButtonUp", 8 }, + { &TEKWMMouseMove, "TEKWMMouseMove", 16 }, + { &TEKWMSize, "TEKWMSize", 24 }, + { &TEKCMCopy, "TEKCMCopy", 8 }, + { &TEKCMCopyScreen, "TEKCMCopyScreen", 8 }, + { &TEKPrint, "TEKPrint", 16 }, + { &TEKClearScreen, "TEKClearScreen", 8 }, + { &TEKSetupFont, "TEKSetupFont", 8 }, + { &TEKResetWin, "TEKResetWin", 12 }, + { &TEKRestoreSetup, "TEKRestoreSetup", 8 }, + { &TEKEnd, "TEKEnd", 4 }, }; static void FreeTTTEKCommon() @@ -102,6 +102,7 @@ if (!ret) { FreeTTTEKCommon(); + return FALSE; } } UseCount++; Modified: branches/cmake/teraterm/teraterm/tekwin.cpp =================================================================== --- branches/cmake/teraterm/teraterm/tekwin.cpp 2018-09-06 16:59:55 UTC (rev 7229) +++ branches/cmake/teraterm/teraterm/tekwin.cpp 2018-09-07 18:50:47 UTC (rev 7230) @@ -1,6 +1,6 @@ /* * Copyright (C) 1994-1998 T. Teranishi - * (C) 2006-2017 TeraTerm Project + * (C) 2006-2018 TeraTerm Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,7 +28,7 @@ */ /* TERATERM.EXE, TEK window */ -//#include "stdafx.h" +#include <windowsx.h> #include "teraterm.h" #include "tttypes.h" #include "tektypes.h" @@ -47,8 +47,6 @@ #define CWnd TTCWnd #define CFrameWnd TTCFrameWnd -#define CMenu TTCMenu -#define CPoint TTCPoint #define TEKClassName "TEKWin32" @@ -340,7 +338,7 @@ } } -void CTEKWindow::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized) +void CTEKWindow::OnActivate(UINT nState, HWND pWndOther, BOOL bMinimized) { if (nState!=WA_INACTIVE) { tk.Active = TRUE; @@ -396,9 +394,9 @@ lpMMI->ptMaxTrackSize.y = 10000; } -void CTEKWindow::OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu) +void CTEKWindow::OnInitMenuPopup(HMENU hPopupMenu, UINT nIndex, BOOL bSysMenu) { - InitMenuPopup(pPopupMenu->m_hMenu); + InitMenuPopup(hPopupMenu); } void CTEKWindow::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) @@ -417,7 +415,7 @@ CFrameWnd::OnKillFocus(hNewWnd); } -void CTEKWindow::OnLButtonDown(UINT nFlags, CPoint point) +void CTEKWindow::OnLButtonDown(UINT nFlags, POINTS point) { POINT p; HMENU PopupMenu, PopupBase; @@ -469,17 +467,17 @@ TEKWMLButtonDown(&tk,&ts,&cv,p); } -void CTEKWindow::OnLButtonUp(UINT nFlags, CPoint point) +void CTEKWindow::OnLButtonUp(UINT nFlags, POINTS point) { TEKWMLButtonUp(&tk,&ts); } -void CTEKWindow::OnMButtonUp(UINT nFlags, CPoint point) +void CTEKWindow::OnMButtonUp(UINT nFlags, POINTS point) { //OnRButtonUp(nFlags,point); } -int CTEKWindow::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message) +int CTEKWindow::OnMouseActivate(HWND pDesktopWnd, UINT nHitTest, UINT message) { if ((ts.SelOnActive==0) && (nHitTest==HTCLIENT)) { //disable mouse event for text selection @@ -490,7 +488,7 @@ } } -void CTEKWindow::OnMouseMove(UINT nFlags, CPoint point) +void CTEKWindow::OnMouseMove(UINT nFlags, POINTS point) { POINT p; @@ -521,7 +519,7 @@ EndPaint(&ps); } -void CTEKWindow::OnRButtonUp(UINT nFlags, CPoint point) +void CTEKWindow::OnRButtonUp(UINT nFlags, POINTS point) { CBStartPaste(tk.HWin, FALSE, FALSE); } @@ -868,3 +866,123 @@ (*AboutDialog)(tk.HWin); FreeTTDLG(); } + +LRESULT CTEKWindow::Proc(UINT msg, WPARAM wp, LPARAM lp) +{ + LRESULT retval = 0; + switch(msg) + { + case WM_ACTIVATE: + OnActivate(wp & 0xFFFF, (HWND)wp, (wp >> 16) & 0xFFFF); + break; + case WM_CHAR: + OnChar(wp, LOWORD(lp), HIWORD(lp)); + break; + case WM_DESTROY: + OnDestroy(); + PostQuitMessage(0); + break; + case WM_GETMINMAXINFO: + OnGetMinMaxInfo((MINMAXINFO *)lp); + break; + case WM_INITMENUPOPUP: + OnInitMenuPopup((HMENU)wp, LOWORD(lp), HIWORD(lp)); + break; + case WM_KEYDOWN: + OnKeyDown(wp, LOWORD(lp), HIWORD(lp)); + break; + case WM_KEYUP: + OnKeyUp(wp, LOWORD(lp), HIWORD(lp)); + break; + case WM_KILLFOCUS: + OnKillFocus((HWND)wp); + break; + case WM_LBUTTONDOWN: + OnLButtonDown(wp, MAKEPOINTS(lp)); + break; + case WM_LBUTTONUP: + OnLButtonUp(wp, MAKEPOINTS(lp)); + break; + case WM_MBUTTONUP: + OnMButtonUp(wp, MAKEPOINTS(lp)); + break; + case WM_MOUSEACTIVATE: + OnMouseActivate((HWND)wp, LOWORD(lp), HIWORD(lp)); + break; + case WM_MOUSEMOVE: + OnMouseMove(wp, MAKEPOINTS(lp)); + break; + case WM_MOVE: + OnMove(LOWORD(lp), HIWORD(lp)); + break; + case WM_PAINT: + OnPaint(); + break; + case WM_RBUTTONUP: + OnRButtonUp((UINT)wp, MAKEPOINTS(lp)); + break; + case WM_SETFOCUS: + OnSetFocus((HWND)wp); + TTCFrameWnd::Proc(msg, wp, lp); + break; + case WM_SIZE: + OnSize(wp, LOWORD(lp), HIWORD(lp)); + break; + case WM_SYSCOMMAND: + OnSysCommand((wp & 0xFFF0), lp); + TTCFrameWnd::Proc(msg, wp, lp); + break; + case WM_SYSKEYDOWN: + OnSysKeyDown(wp, LOWORD(lp), HIWORD(lp)); + break; + case WM_SYSKEYUP: + OnSysKeyUp(wp, LOWORD(lp), HIWORD(lp)); + break; + case WM_TIMER: + OnTimer(wp); + break; + case WM_USER_ACCELCOMMAND: + OnAccelCommand(wp, lp); + break; + case WM_USER_CHANGEMENU: + OnChangeMenu(wp, lp); + break; + case WM_USER_CHANGETBAR: + OnChangeTBar(wp, lp); + break; + case WM_USER_DLGHELP2: + OnDlgHelp(wp, lp); + break; + case WM_USER_GETSERIALNO: + OnGetSerialNo(wp, lp); + break; + case WM_COMMAND: + { + const WORD wID = GET_WM_COMMAND_ID(wp, lp); + switch (wID) { + case ID_TEKFILE_PRINT: OnFilePrint(); break; + case ID_TEKFILE_EXIT: OnFileExit(); break; + case ID_TEKEDIT_COPY: OnEditCopy(); break; + case ID_TEKEDIT_COPYSCREEN: OnEditCopyScreen(); break; + case ID_TEKEDIT_PASTE: OnEditPaste(); break; + case ID_TEKEDIT_PASTECR: OnEditPasteCR(); break; + case ID_TEKEDIT_CLEARSCREEN: OnEditClearScreen(); break; + case ID_TEKSETUP_WINDOW: OnSetupWindow(); break; + case ID_TEKSETUP_FONT: OnSetupFont(); break; + case ID_TEKVTWIN: OnVTWin(); break; + case ID_TEKWINDOW_WINDOW: OnWindowWindow(); break; + case ID_TEKHELP_INDEX: OnHelpIndex(); break; + case ID_TEKHELP_ABOUT: OnHelpAbout(); break; + default: + OnCommand(wp, lp); + break; + } + break; + } + default: + retval = TTCFrameWnd::Proc(msg, wp, lp); + break; + } + + return retval; +} Modified: branches/cmake/teraterm/teraterm/tekwin.h =================================================================== --- branches/cmake/teraterm/teraterm/tekwin.h 2018-09-06 16:59:55 UTC (rev 7229) +++ branches/cmake/teraterm/teraterm/tekwin.h 2018-09-07 18:50:47 UTC (rev 7230) @@ -58,22 +58,22 @@ protected: //{{AFX_MSG(CTEKWindow) #define afx_msg - afx_msg void OnActivate(UINT nState, TTCWnd* pWndOther, BOOL bMinimized); + afx_msg void OnActivate(UINT nState, HWND pWndOther, BOOL bMinimized); afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags); afx_msg void OnDestroy(); afx_msg void OnGetMinMaxInfo(MINMAXINFO *lpMMI); - afx_msg void OnInitMenuPopup(TTCMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu); + afx_msg void OnInitMenuPopup(HMENU hPopupMenu, UINT nIndex, BOOL bSysMenu); afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags); afx_msg void OnKillFocus(HWND hNewWnd); - afx_msg void OnLButtonDown(UINT nFlags, TTCPoint point); - afx_msg void OnLButtonUp(UINT nFlags, TTCPoint point); - afx_msg void OnMButtonUp(UINT nFlags, TTCPoint point); - afx_msg int OnMouseActivate(TTCWnd* pDesktopWnd, UINT nHitTest, UINT message); - afx_msg void OnMouseMove(UINT nFlags, TTCPoint point); + afx_msg void OnLButtonDown(UINT nFlags, POINTS point); + afx_msg void OnLButtonUp(UINT nFlags, POINTS point); + afx_msg void OnMButtonUp(UINT nFlags, POINTS point); + afx_msg int OnMouseActivate(HWND hDesktopWnd, UINT nHitTest, UINT message); + afx_msg void OnMouseMove(UINT nFlags, POINTS point); afx_msg void OnMove(int x, int y); afx_msg void OnPaint(); - afx_msg void OnRButtonUp(UINT nFlags, TTCPoint point); + afx_msg void OnRButtonUp(UINT nFlags, POINTS point); afx_msg void OnSetFocus(HWND hOldWnd); afx_msg void OnSize(UINT nType, int cx, int cy); afx_msg void OnSysCommand(UINT nID, LPARAM lParam); @@ -102,4 +102,5 @@ //}}AFX_MSG // DECLARE_MESSAGE_MAP() #undef afx_msg + virtual LRESULT Proc(UINT msg, WPARAM wp, LPARAM lp); }; Modified: branches/cmake/teraterm/teraterm/vtwin.cpp =================================================================== --- branches/cmake/teraterm/teraterm/vtwin.cpp 2018-09-06 16:59:55 UTC (rev 7229) +++ branches/cmake/teraterm/teraterm/vtwin.cpp 2018-09-07 18:50:47 UTC (rev 7230) @@ -2013,8 +2013,10 @@ FreeIME(); FreeTTSET(); +#if 0 // free\x82Ɏ\xB8\x94s\x82\xB7\x82\xE9\x82܂\xC5free\x82\xB5\x91\xB1\x82\xAF\x82\xE9 do { } while (FreeTTDLG()); +#endif do { } while (FreeTTFILE());