source: dev/trunk/ab5.0/abdev/abdev/Common.h@ 624

Last change on this file since 624 was 624, checked in by dai_9181, 16 years ago

WindowInfoクラスをリファクタリング

File size: 32.0 KB
Line 
1#pragma once
2
3#define OEMRESOURCE
4#define _CRT_SECURE_NO_DEPRECATE //セキュリティ警告を出さない
5#define _CRT_NONSTDC_NO_DEPRECATE
6#include <windows.h>
7#include <stdio.h>
8#include <string.h>
9#include <commctrl.h>
10#include "htmlhelp.h"
11#include <shlobj.h>
12#include <zmouse.h>
13#include <math.h>
14#include <limits.h>
15#include <process.h>
16#include <wininet.h>
17
18#include "nkf_class.h"
19#include "WebSearch.h"
20#include "ruler.h"
21#include "TabCtrl.h"
22#include "ExtensionLink.h"
23#include "HtmlAnalysis.h"
24#include "FileTree.h"
25#include "menu.h"
26#include "LuxCtrl.h"
27#include "MdiTextEdit.h"
28#include "BREGEXP.H"
29#include "../compiler_x86/CommandValue.h"
30
31
32typedef struct _charrange {
33 LONG cpMin;
34 LONG cpMax;
35} CHARRANGE;
36
37
38#include "Attach.h"
39#include "Debugger.h"
40
41
42#pragma comment(lib, "wininet.lib")
43
44
45
46#ifdef THETEXT
47
48////////////////////////////
49// TheTextのバージョン情報
50////////////////////////////
51#define APPLICATION_NAME "TheText"
52#define VERSION_APPLI_NAME APPLICATION_NAME
53#define VERSION_STRING "1.02"
54
55#else
56
57/////////////////////////////////////////////////
58// ActiveBasic/ProjectEditorのバージョン情報
59/////////////////////////////////////////////////
60#define APPLICATION_NAME "ActiveBasic 5.0"
61#define VERSION_APPLI_NAME APPLICATION_NAME
62#define VERSION_STRING "5.00.00"
63
64#endif
65
66
67
68#ifndef IMAGE_FILE_MACHINE_AMD64
69#define IMAGE_FILE_MACHINE_AMD64 0x8664 // AMD64 (K8)
70#endif
71
72
73#if defined(JPN)
74
75#ifdef THETEXT
76//TheText日本語
77#include "../res_TheText/resource.h"
78#include "common_msg_jpn.h"
79#else
80//日本語
81#include "../res/resource.h"
82#include "common_msg_jpn.h"
83#endif
84
85#else
86//英語
87#include "../res_e/resource.h"
88#include "common_msg_eng.h"
89#endif
90
91//アイコンリソース
92#include "../icon_res/resource.h"
93
94
95
96
97#define GENERAL_SIZE 8192
98#define MAX_ARRAYDIM 16
99
100#define MAX_WNDNUM 255
101
102
103#ifdef _AMD64_
104#else
105typedef long LONG_PTR;
106typedef DWORD ULONG_PTR;
107#endif
108
109//ファイルタイプ
110#define FT_BASICPROGRAM 1
111#define FT_SUBPROGRAM 2
112#define FT_TEXT 3
113#define FT_PROJECT 4
114#define FT_ICON 5
115#define FT_HTML 6
116#define FT_OTHER 0
117
118#define BMPNUM_STANDARDTOOLBAR 10 //hDefaultToolbarのビットマップ数
119#define SEPNUM_STANDARDTOOLBAR 4 //hDefaultToolbarのセパレータ数
120#define BMPNUM_DEBUGGERTOOLBAR 8 //hDebuggerToolbarのビットマップ数
121#define SEPNUM_DEBUGGERTOOLBAR 2 //hDebuggerToolbarのセパレータ数
122#define BMPNUM_RADTOOLBAR 18 //コントロール挿入用ツールバーのビットマップ数(区切り用BMPを最後の1つに用意する)
123#define SEPNUM_RADTOOLBAR 3 //コントロール挿入用ツールバーのセパレータ数
124
125//MDIクライアントウィンドウ下のドキュメントウィンドウタイプ
126#define WNDTYPE_BASIC 1
127#define WNDTYPE_TEXT 2
128#define WNDTYPE_RAD 3
129#define WNDTYPE_MENU 4
130#define WNDTYPE_ICONEDIT 5
131#define WNDTYPE_HTML 6
132
133#define IS_DOCUMENT_TEXT(a) (a==WNDTYPE_BASIC||a==WNDTYPE_TEXT||a==WNDTYPE_HTML)
134
135#define IS_RETURN(buffer,p) (buffer[p]=='\r'&&buffer[p+1]=='\n')
136#define IS_BLANK(c) (c==' '||c=='\t')
137
138//Rebarコントロールの個数(レバー追加)
139#define MAX_REBARBANDS 5
140
141//RebarコントロールのID(レバー追加)
142#define ID_DOCCOMBO 1
143#define ID_STANDARDTOOLBAR 2
144#define ID_RELEASETOOLBAR 3
145#define ID_DEBUGGERTOOLBAR 4
146#define ID_SELECTCOMPILERCOMBO 5
147#define ID_WEB_SEARCH 6
148
149//検索コンボボックスの最大リスト数
150#define MAX_FINDLIST 20
151
152#define ID_FIRSTCHILD 100
153
154
155//タブカラー
156#define TABCOLOR_GRAY RGB(230,230,230) //灰色
157#define TABCOLOR_WHITE RGB(255,255,255) //白
158#define TABCOLOR_RED RGB(255,200,200) //赤
159#define TABCOLOR_GREEN RGB(200,255,200) //緑
160#define TABCOLOR_BLUE RGB(200,220,255) //青
161#define TABCOLOR_YELLOW RGB(255,255,180) //黄色
162
163
164#define WM_RESETCARETPOS WM_USER+80 //オートスクロールスレッドからのキャレット設定
165
166#define WM_SEARCH_TAB_CREATE WM_USER+90 //Web検索のタブアイテムの生成メッセージ
167#define WM_SEARCH_TAB_CLOSE WM_USER+91 //Web検索のタブアイテムの破棄メッセージ
168
169//SideWeb
170#define WM_BROWS_CREATE WM_USER+100
171#define WM_BROWS_DESTROY WM_USER+101
172#define WM_BROWS_GO WM_USER+102
173#define WM_BROWS_NAVI WM_USER+103
174
175
176
177#define MAX_HASH 32768
178
179
180//////////////////////////////////
181// メインウィンドウのタイマーID
182
183#define ID_TIMER_BACKUP 10
184#define ID_DEBUGSAFTY 20
185
186// ここまで
187//////////////////////////////////
188
189
190
191extern HANDLE hHeap;
192extern HINSTANCE hInst,hResInst,hIconResInst;
193extern HWND hOwner;
194extern HWND hClient;
195extern int ScreenX,ScreenY;
196extern char pj_editor_Dir[MAX_PATH];
197
198
199//アルファブレンド用のAPI
200#define WS_EX_LAYERED 0x00080000
201#define LWA_ALPHA 0x00000002
202typedef BOOL (WINAPI *FWINLAYER)(HWND hwnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags );
203
204
205
206//新規プロジェクトのベース
207#define BASE_VOID 0
208#define BASE_PROMPT 1
209#define BASE_NORMAL 2
210
211struct POINTANDSIZE{
212 POINT pos;
213 SIZE size;
214};
215
216
217
218//////////////////////////////////////////
219// リソース ヘッダ(アイコン、カーソル用)
220typedef struct{
221 WORD idReserved;
222 WORD idType;
223 WORD idCount;
224}ICONDIR,CURSORDIR;
225
226////////////////////////////
227//.icoファイルのヘッダ情報
228struct ICONDIRENTRY{
229 BYTE bWidth;
230 BYTE bHeight;
231 BYTE bColorCount;
232 BYTE bReserved;
233 WORD wPlanes;
234 WORD wBitCount;
235 DWORD dwBytesInRes;
236 DWORD dwImageOffset;
237};
238
239
240/////////////////////
241//MDIウィンドウ情報
242
243#define MAX_UNDONUM 300//512未完成
244#define MAX_ICONEDIT_UNDONUM 32
245
246#define TEXTEDIT_UNDO_KEY 1
247#define TEXTEDIT_UNDO_PASTE 2
248#define TEXTEDIT_UNDO_SELKEY 3
249struct TEXTEDIT_UNDOSTATE{
250 int NowPos;
251 int Command[MAX_UNDONUM];
252 char *KeyStr[MAX_UNDONUM];
253 char *DelStr[MAX_UNDONUM];
254 CHARRANGE Range[MAX_UNDONUM];
255 CHARRANGE DelRange[MAX_UNDONUM];
256};
257
258struct RAD_UNDOSTATE_NAME{
259 std::string name;
260 std::string HandleName;
261 char *CallBackName;
262};
263#define RAD_UNDO_INSERTWND 1
264#define RAD_UNDO_DELETEWND 2
265#define RAD_UNDO_INSERTITEM 3
266#define RAD_UNDO_DELETEITEM 4
267#define RAD_UNDO_NAME 5
268#define RAD_UNDO_CAPTION 6
269#define RAD_UNDO_FONT 7
270#define RAD_UNDO_BGCOLOR 8
271#define RAD_UNDO_WINDOWMENU 9
272#define RAD_UNDO_ICONRES 10
273#define RAD_UNDO_STYLE 11
274#define RAD_UNDO_EXSTYLE 12
275#define RAD_UNDO_POSITION 13
276#define RAD_UNDO_IMAGESTATE 14
277#define RAD_UNDO_TYPE 15
278struct RAD_UNDOSTATE{
279 int NowPos;
280 int Command[MAX_UNDONUM];
281 int SelectItemNum[MAX_UNDONUM];
282 DWORD lpdwData[MAX_UNDONUM];
283};
284
285#define MAX_RAD_SELITEM 255
286struct MDIRADINFO{
287 //Radツール用
288
289 HWND hTools;
290
291 HWND hProperty;
292 HWND hProp_Dlg;
293
294 HWND hSupport;
295
296 HWND hRad;
297
298 HBITMAP hBitmap;
299 HBITMAP hOldBitmap;
300 HDC hMemDC;
301 int SelectingItem[MAX_RAD_SELITEM];
302 int ButtonSelect;
303
304 //ウィンドウクライアント領域
305 POINT ClientPos;
306 SIZE ClientSize;
307
308 //変更情報
309 RAD_UNDOSTATE undo;
310};
311
312struct MDIMENUINFO{
313 HWND hList;
314 HWND hMenuEdit;
315 HWND hEdit_Dlg;
316};
317
318#define ICONTYPE_16_16 0
319#define ICONTYPE_16_256 1
320#define ICONTYPE_32_16 2
321#define ICONTYPE_32_256 3
322struct ICONEDIT_UNDOSTATE{
323 int NowPos;
324 BYTE *lpData[MAX_ICONEDIT_UNDONUM];
325};
326struct MDIICONEDITINFO{
327 HWND hMain;
328 HWND hToolDlg;
329 HWND hButtonsDlg;
330 HWND hColorDlg;
331
332 HDC memdc;
333 HBITMAP hMemBmp;
334
335 HBITMAP hSelectingBmp;
336 int SelectLevel;
337 RECT DraggingRect;
338
339 int num;
340 int SelectIconNum;
341 union{
342 BYTE *pIconImage[8]; //アイコンのイメージデータ配列(マップ配列、カラー配列、マスク配列)
343 BITMAPINFOHEADER *pBmpHdr[8];
344 };
345 DWORD dwBytesInRes[8];
346
347 DWORD NowTool;
348 COLORREF MainColor;
349 COLORREF SubColor;
350
351 ICONEDIT_UNDOSTATE undo[8];
352 BOOL bModify;
353};
354
355struct MDIINFO{
356 HWND hwnd;
357 int DocType;
358 char *title;
359 char *path;
360
361 union{
362 MDIRADINFO *MdiRadInfo;
363 MDIMENUINFO *MdiMenuInfo;
364 MDIICONEDITINFO *MdiIconEditInfo;
365 CMdiTextEdit *pMdiTextEdit;
366 };
367
368 char *IndentStr;
369};
370extern MDIINFO MdiInfo[MAX_WNDNUM];
371
372//RADツールのマウスドラッグ
373#define FRAME_CHANGEPOS_START 1 //----- ここから -----
374#define FRAME_UPPER_LEFT 1
375#define FRAME_UPPER_RIGHT 2
376#define FRAME_LOWER_LEFT 3
377#define FRAME_LOWER_RIGHT 4
378#define FRAME_LEFT 5
379#define FRAME_RIGHT 6
380#define FRAME_UPPER 7
381#define FRAME_LOWER 8
382#define FRAME_INSIDE 9
383#define FRAME_CHANGEPOS_END 9 //----- ここまで -----
384#define ITEM_MAKING 10
385#define SELECTING_FRAME 11
386
387//アイテムの大きさの限界値
388#define MIN_ITEM_X 12
389#define MIN_ITEM_Y 9
390
391//選択アイテム
392#define SELECT_WINDOW -1
393#define NON_TOOL -1
394
395struct RADINFO{
396 int NowDragging;
397 POINT DragStartPos;
398 RECT DragStartRect[MAX_RAD_SELITEM];
399 RECT DraggingRect[MAX_RAD_SELITEM];
400 RECT OldDraggingRect[MAX_RAD_SELITEM];
401};
402
403
404//////////////////
405//リソース情報
406extern HTREEITEM hCursorTreeItemForProjectView;
407extern HTREEITEM hBitmapTreeItemForProjectView;
408extern HTREEITEM hIconTreeItemForProjectView;
409
410
411////////////////////
412//プロジェクト情報
413
414#define PROJECT_VERSION 10
415
416class CFileInfo{
417public:
418 char *m_path;
419 HTREEITEM m_hTreeItem;
420 CFileInfo(char *path,HTREEITEM hTreeItem);
421 ~CFileInfo();
422
423 void GetFullPath(char *buffer);
424};
425class CDBFileInfo{
426public:
427 int iNum;
428 CFileInfo **ppobj_FileInfo;
429
430 CDBFileInfo();
431 ~CDBFileInfo();
432
433 void add(char *path,HTREEITEM hTreeItem);
434 void del(HTREEITEM hTreeItem);
435 char *GetPath(HTREEITEM hTreeItem);
436 BOOL IsMainFile(HTREEITEM hTreeItem);
437
438 void SetTreeItem(int index,HTREEITEM hTreeItem);
439 void ResetTree(void);
440
441 BOOL dupli_check(char *path);
442};
443struct FILEINFO{
444 char *pPath;
445 HTREEITEM hTreeItem;
446};
447
448struct PROCINFO{
449 char *name;
450 int FileNum;
451 HTREEITEM hTreeItem;
452
453 int code_pos;
454};
455struct INCPROCINFO{
456 char *name;
457 char *Parms;
458 char *type;
459};
460
461//ダイアログアイテムの種類
462#define CT_BUTTON 1
463#define CT_CHECKBOX 2
464#define CT_COMBOBOX 3
465#define CT_EDIT 4
466#define CT_GROUPBOX 5
467#define CT_HSCROLLBAR 6
468#define CT_IMAGEBOX 7
469#define CT_LISTBOX 8
470#define CT_LISTVIEW 9
471#define CT_RADIOBUTTON 10
472#define CT_STATIC 11
473#define CT_TREEVIEW 12
474#define CT_VSCROLLBAR 13
475#define CT_UPDOWN 14
476#define CT_PROGRESSBAR 15
477#define CT_TRACKBAR 16
478#define CT_MENU 99
479
480//イベント タイプ
481#define EVENTTYPE_DEFAULT 0
482#define EVENTTYPE_MENU 1
483#define EVENTTYPE_MMSYS 2
484
485//ウィンドウ タイプ
486#define WNDTYPE_DEFAULT 0
487#define WNDTYPE_MODALDLG 1
488#define WNDTYPE_MODELESSDLG 3
489
490struct NEWPROJECTINFO{
491 char name[MAX_PATH];
492 DWORD dwTypeID;
493 _int8 ShowHelloWorld;
494 DWORD dwOption;
495};
496struct MENU_INFO{
497 char *IdName;
498 char *caption;
499 UINT type;
500 UINT state;
501
502 int NumberOfMenu;
503 MENU_INFO *pMenuInfo;
504
505 HTREEITEM hTreeItem;
506};
507#define MT_EXE 0 //EXEモジュールタイプ
508#define MT_DLL 1 //DLLモジュールタイプ
509#define MT_SLL 2 //SLLモジュールタイプ
510#define PJ_OP_SOURCE_MASK 0x00FFFFFF
511#define PJ_OP_MMSYSTEM 0x00000001
512#define PJ_OP_COMMCTRL 0x00000002
513#define PJ_OP_RICHEDIT 0x00000004
514#define PJ_OP_WINSOCK 0x00000008
515#define PJ_OP_STRICT 0x00010000 // #strictディレクティブは今は使われていない
516#define PJ_OP_RC_MANIFEST 0x00020000
517#define PJ_OP_UNICODE 0x00040000
518
519
520
521struct SAVEREBAR{
522 int RebarID;
523 int RebarLength;
524 int IsBandBreak;
525};
526
527struct ITEMEVENTINFO{
528 char *IdName;
529 char **pEventNames;
530 int ClassID;
531 int EventNum;
532};
533
534#define PARAMETER_HINT_MAX_SIZE 8192
535struct METHODCHECKINFO{
536 HWND hWnd;
537 LOGFONT LogFont;
538 HFONT hFont;
539 HFONT hBoldFont;
540 char BeforeMethodName[VN_SIZE];
541 char msg[PARAMETER_HINT_MAX_SIZE];
542 int ParmNum;
543 int HeadPos;
544};
545
546
547/////////////////////
548// コード補完機能
549/////////////////////
550
551#define ACCESS_NON 0
552#define ACCESS_PRIVATE 1
553#define ACCESS_PUBLIC 2
554#define ACCESS_PROTECTED 3
555#define ACCESS_PAIRCOMMAND 4
556#define ACCESS_HTML_GENERAL_PARAM 5
557#define ACCESS_HTML_PARAM 6
558struct MEMBERINFO{
559 //クラス名
560 char *pName;
561 DWORD dwProc;
562 DWORD dwAccess;
563
564 int code_pos;
565};
566struct COMPLEMENT_WINDOW_INFO{
567 HWND hWnd;
568 HWND hList;
569
570 int iPos;
571 int iLength;
572
573 MEMBERINFO *pMemberInfo;
574 int MemberNum;
575
576 //ペアステートメントのインデント格納用
577 char szIndent[255];
578};
579
580
581
582class CSettingFile{
583 BOOL GetDataLine(const char *name,char *parms);
584protected:
585 char *buffer;
586
587 BOOL GetWholeValue(const char *name,int *pi32data);
588 bool GetBoolean( const char *name,bool &b );
589 BOOL Get3WholeValue(char *name,int *pd1,int *pd2,int *pd3);
590 BOOL GetRGBValue(char *name,COLORREF *prgb);
591 BOOL GetStringValue(char *name,char *str);
592 BOOL GetRectValue(char *name,RECT *prc);
593 BOOL GetLogFont(char *name,LOGFONT *plf);
594 BOOL GetRebarBand(SAVEREBAR *psr,int num);
595
596 void SetWholeValue( const char *name,long i32data);
597 void SetBoolean( const char *name,bool b);
598 void Set3WholeValue(char *name,long d1,long d2,long d3);
599 void SetRGBValue(char *name,COLORREF rgb);
600 void SetStringValue(char *name,char *str);
601 void SetRectValue(char *name,RECT *prc);
602 void SetLogFont(char *name,LOGFONT *plf);
603 void SetRebarBand(SAVEREBAR *psr,int num);
604};
605#include "DesignTheme.h"
606
607
608
609//ProjectEditor.cpp
610void HeapDefaultFree(LPVOID lpMem);
611void ToBigChar(char str[]);
612int GetWndNum(HWND hChild);
613int GetNowWndNum(void);
614int GetFileNum(int WndNum);
615void SendTextEditResizeEvent(HWND hwnd);
616void RedrawAllWindow(void);
617int DocumentModifyCheck(HWND hChild);
618void SetStatusText(char *MenuText);
619void ResetState_UndoMenu(void);
620void ResetState_EditMenu(void);
621void ResetState_DocMenu(void);
622void DuplicateTitleCheck(char *lpszTitle);
623HWND NewTextEditWindow(char *filepath,_int8 DocumentType,COLORREF TabColor=TABCOLOR_GRAY);
624void CloseDocWindow(int WndNum);
625void ResizeTextEditWnd(HWND hwnd,int cx,int cy);
626void ResizeOwnerWnd(void);
627#define FLAG_DBLCLK 1
628#define FLAG_BEAMCURSOR 2
629int RegWndClass(WNDPROC WndProc,char *lpClassName,HBRUSH hBackBrush,DWORD dwFlag);
630
631//Backup.cpp
632void CreateBackupDir(void);
633void backup(void *dummy);
634BOOL restore(void);
635
636//DialogBoxes.cpp
637void SetPosCenter(HWND hParent,HWND hwnd);
638void SetPosCenter(HWND hwnd);
639BOOL SetFontDialog(HWND hwnd,LOGFONT *lf,BOOL bFixedPitchOnly,int *lpiPointSize=0);
640void DlgNewProjectWizard(HWND hwnd);
641BOOL CALLBACK DlgNewFile(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
642void DlgProjectOptionSetting(HWND hwnd);
643void DlgOptionSetting(HWND hwnd);
644BOOL CALLBACK DialogAbout(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
645
646//FileOperation.cpp
647void MakeUserSettingDir(void);
648char *ReadBuffer( const std::string &path );
649char *ReadBuffer_NonErrMsg( const std::string &path );
650_int8 WriteBuffer(const std::string &path,char *buffer,int length, bool isEnableError = true);
651_int8 WriteBuffer_NonErrMsg(const std::string &path,char *buffer,int length);
652void GetRelationalPath(char *path,char *dir);
653void GetFullPath(char *path,const char *dir);
654void RemoveDirectoryStrong(const char *dirPath);
655BOOL GetFilePathDialog(HWND hwnd,char *filename,LPSTR Filter,LPSTR Title,_int8 IsOpen);
656BOOL GetFolder(HWND hWnd,char *folder,char *OpenFolderTitle);
657int GetFileExtension(char *path);
658HWND OpenFileWithExtension( const std::string &filePath );
659BOOL SaveDocument(HWND hChild,char *SaveFileName);
660BOOL ShortPathToLongPath(char ShortPath[MAX_PATH],char *LongPath);
661bool IsExistFile( const char *FilePath );
662bool IsExistDirectory( const char *DirPath );
663
664//rebar.cpp
665#define MAX_BAND 255
666typedef HWND (*AddBandProc)(HWND hRebar,int num,char *lpszText);
667class CDBRebarBand{
668 int BandId[MAX_BAND];
669 AddBandProc pAddProc[MAX_BAND];
670 int iMaxBandNum;
671public:
672 HWND hRebar;
673 CDBRebarBand();
674 ~CDBRebarBand();
675 void add(int band_id,AddBandProc add_proc);
676 HWND call_add(int band_id,int num,char *lpszText);
677};
678class CMainRebar{
679 CDBRebarBand *pobj_DBRebarBand;
680
681 void SetupRebar(HWND hwnd);
682public:
683 HWND hParent;
684 HWND hRebar;
685
686 CMainRebar(HWND hwnd_parent);
687 ~CMainRebar();
688
689 void ResetInitRebar();
690 void ResetRebar();
691 void SaveRebarState(void);
692 void ChangeRebarBand(int BandID);
693 void menu_popup(HWND hwnd,int PosX,int PosY);
694};
695extern CMainRebar *pobj_Rebar;
696void ResetRebarData(void);
697LRESULT CALLBACK DefaultToolbarProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
698LRESULT CALLBACK DocComboProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
699LRESULT CALLBACK DebuggerToolbarProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
700
701//SubOperation.cpp
702void ScreenToClient(HWND hwnd,RECT *pRect);
703void ClientToScreen(HWND hwnd,RECT *pRect);
704BOOL IsWow64(void);
705void URLEncode(LPSTR pszSrc);
706void Digit(int num,char *buffer);
707void RectNaturalFormat(RECT *ReadRect,RECT *CopyRect);
708void RectNaturalFormat(int *x1,int *y1,int *x2,int *y2);
709void KillSpaces(char *str1,char *str2);
710void RemoveStringQuotes(char *str);
711void SlideString(char *str,int slide);
712void SlideBuffer(char *buffer,int length,int slide);
713BOOL IsVariableTopChar(char c);
714BOOL IsVariableChar(char c);
715BOOL IsCommandBackDelimitation(char *buffer,int pos);
716BOOL IsCommandDelimitation(char *buffer,int p);
717char *ComparisonString( char *str1, char *str2, bool isBigSmall, bool isWordUnit );
718int GetOneParameter(char *Parameter,int pos,char *retAns);
719int GetStringInPare(char *buffer,char *ReadBuffer);
720int GetStringInBracket(char *buffer,char *ReadBuffer);
721void JumpBlank(char *pBuf,int *piPos);
722BOOL CheckParenthesis(char *buffer);
723DWORD GetValue(char *value);
724BOOL IsManagementCommand(int ComNum);
725int IsBasicReservedWord(char *str);
726HBITMAP CreateGradationBitmap(SIZE *pSize,COLORREF color1,COLORREF color2);
727HBITMAP CreateVertGradationBitmap(SIZE *pSize,COLORREF color1,COLORREF color2);
728HBITMAP CreateHorzGradationBitmap(SIZE *pSize,COLORREF color1,COLORREF color2);
729HICON CreateGrayIcon(HICON hBaseIcon);
730void GetSize(SIZE *pSize,RECT *pRect);
731BOOL HitTest(RECT *pRect,POINT *pPos);
732BOOL Rectangle(HDC hdc,RECT *pRect);
733void ComboBox_SetSelText(HWND hCombo,char *lpszText);
734void SetCursorByState(int state);
735void SetTextEditColorDesign(TEXTEDIT_COLOR_INFO *pColorInfo,CTheme *pobj_Theme,BOOL bRedraw);
736BOOL SetupProjectEditor(void);
737void EndProjectEditor(void);
738void SetupWindow(HWND hwnd);
739BOOL SetRunning(HWND hChild);
740BOOL IsNeedCompile(char *FileName,BOOL bDebug);
741std::string GetLastErrorString();
742
743//DocumentAdvice.cpp
744void MenuAdvice(WPARAM msg);
745void ShowToolTipText(LPTOOLTIPTEXT TipText);
746char *IncludeFiles(char *buffer);
747void AddParameterHints_ToProject(char *path);
748
749
750
751/////////////////////
752// テキスト エディタ
753/////////////////////
754
755#define CONTROL_TAB_SPACE_DEFAULT 10 //エディタ画面左端のコントロールタブ(通常)
756
757//DrawBuffer.cpp
758void TextEdit_DrawBuffer(HDC hdc,int WndNum);
759
760//TextEditor.cpp
761int GetControlTabSpace(int WndNum,int *piCount=0);
762void ResetTextEditFont(HWND hwnd);
763void SetTextEditWordColor(int WndNum);
764BOOL IsHiragana(char *pBuf);
765BOOL IsAlphabet(char c);
766BOOL IsReturnCode(char *pBuf);
767void ResetScrollbar(int WndNum,int max_x,int max_y);
768#define WORDCARET_BEFORE 1
769#define WORDCARET_AFTER 2
770void TextEdit_GetWordCaret(HWND hwnd,int WndNum,POINT *pPos,int *piStart,int *piEnd,BOOL bBeforeAfterFlag);
771void CancelBeforeAutoIndent(int WndNum);
772LRESULT CALLBACK TextEditProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
773
774//Caret.cpp
775BOOL IsRightTurn(char *pBuf,int i,int now_x);
776int GetBufferIndexFromCaretPos(char *pBuf,int now_x,int now_y);
777void GetCaretPosFromBufferIndex(char *pBuf,int index,POINT *pCaretPos);
778void TextEdit_GetSel(int WndNum,CHARRANGE *pCharRange);
779void TextEdit_GetSelText(int WndNum,CHARRANGE *pCharRange,char *buffer);
780void GetScrollBaseCaretPos(int WndNum,int *pNaturalBaseX,int *pNaturalBaseY);
781void GetNaturalBaseCaretPos(int WndNum,int *pScrollBaseX,int *pScrollBaseY);
782void TextEdit_SetSel(int WndNum,int StartIndex,int EndIndex,BOOL bShowCenter=0);
783void TextEdit_SelectOneLine(int WndNum,int code_pos,BOOL bShowCenter=0);
784void ResetCaretPos(int WndNum,BOOL bInputAndReset=0);
785BOOL TextEdit_ScrollCaret(int WndNum,BOOL bScrollOneStep_x,BOOL bShowCenter=0);
786void CaretPos_LooseToNatural(int WndNum,int loose_x,int loose_y,POINT *pCaretPos);
787void GetNaturalCaretPos_Click(int WndNum,int mouse_x,int mouse_y,POINT *pCaretPos);
788void GetNaturalCaretPos_Left(int WndNum);
789void GetNaturalCaretPos_Right(int WndNum,POINT *pCaretPos);
790void GetNaturalCaretPos_Up(int WndNum,POINT *pCaretPos);
791void GetNaturalCaretPos_Down(int WndNum,POINT *pCaretPos);
792void GetNaturalCaretPos_PageUp(int WndNum,POINT *pCaretPos);
793void GetNaturalCaretPos_PageDown(int WndNum,POINT *pCaretPos);
794
795//Replace.cpp
796void TextEdit_Replace(int WndNum,char *str,BOOL bRedraw);
797void TextEdit_ReplaceUpdateUndoData(int WndNum,char *str,BOOL bPaste,BOOL bRedraw);
798void TextEdit_Convert(int id);
799
800//TextEditor_UndoRedo.cpp
801void TextEdit_UndoCommand(int WndNum);
802void TextEdit_RedoCommand(int WndNum);
803void TextEdit_NoticeChanging(int WndNum,int Command,char *KeyStr,char *DelStr,CHARRANGE *Range,CHARRANGE *DelRange);
804void TextEdit_DeleteUndoData(TEXTEDIT_UNDOSTATE *pUndoState,int pos);
805
806//Search.cpp
807void AddFindData(HWND hwnd,char ppData[MAX_FINDLIST][MAX_PATH],char *str);
808BOOL CALLBACK DlgFind(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
809BOOL CALLBACK DlgPermutation(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
810
811//analysis.cpp
812BOOL GetVarFormatString(char *buffer,char *array,char *array2,char *NestMember,int *pRefType);
813BOOL CheckReferType(char *ClassName,BOOL bArray,char *VarArray,int VarRefType);
814void GetOriginalClassName(char *ClassName);
815int GetClassPos(char *pBuf,char *ClassName,DWORD *pdwClassType);
816BOOL GetClassNameFromClassMember(char *pBuf,int iPos,char *VarName,char *ClassName,BOOL *pbArray);
817void GetCodeAreaType(char *pBuf,int iPos,int *piProcPos,char *NowClass);
818BOOL GetVariableClassName(char *pEditBuf,int iPos,char *VarName,char *ClassName,BOOL *pbArray);
819
820//EndPairCommandComplement.cpp
821BOOL GetEndPairCommandInfo(char *buffer,int p);
822BOOL IsNeedNewIndentCommand(char *name);
823void GetWithObjectVariable(char *buffer,int p,char *pObjectVar);
824
825//Complement.cpp
826void DeleteComplementInfo(void);
827BOOL GetComplementInfo(char *variable,char *pEditBuf,int iPos);
828void CodeComplement(int WndNum,int iPos);
829LRESULT CALLBACK ComplementWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
830
831//ParameterHint.cpp
832char *GetUserSourceCode(void);
833void ChangeReturnCode(char *buffer);
834void DeleteComment(char *buffer);
835LRESULT CALLBACK MethodCheckWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
836void ShowParameterHint(int WndNum);
837
838//CodeFormatter.cpp
839char *CodeFormatter(char *lpszReadBuffer);
840
841#ifdef THETEXT
842//StringCount.cpp
843BOOL CALLBACK DlgStringCount(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
844#endif
845
846//Print.cpp
847class CPage{
848public:
849 PAGESETUPDLG psd;
850 CPage();
851 ~CPage();
852
853 BOOL SetupDlg(void);
854};
855extern CPage obj_Page;
856LRESULT CALLBACK PreviewWndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
857void Preview(void);
858void Printout(void);
859
860//History.cpp
861#define IS_FILEHISTORY_COMMAND(a) (100<=a&&a<=199)
862class CHistory{
863 int iNum;
864 int iMaxHistoryNum;
865
866 int m_BaseID;
867public:
868 char *lpszPath[255];
869
870 CHistory(int BaseID);
871 ~CHistory();
872
873 void load(char *path);
874 void save(char *path);
875
876 void add(char *path);
877 void insert(char *path);
878
879 void ResetFileMenu(CSubMenuEx *pobj_SubMenu,BOOL bOwnerDraw);
880};
881
882
883
884
885//////////////////////
886/* プロジェクト解析 */
887
888//CClassInfo.cpp
889class CClassInfo{
890public:
891 char ClassName[VN_SIZE];
892 MEMBERINFO *pMemberInfo;
893 int MemberNum;
894 CClassInfo();
895 ~CClassInfo();
896 int Analyze(char *pBuf,int *p);
897};
898
899//ClassTree.cpp
900struct TREEHASH{
901 HTREEITEM hItem;
902 int iFileNum;
903 TREEHASH *pNextData;
904};
905#define CTV_ROOT 1 //ルート
906#define CTV_FOLDER 2 //フォルダ
907#define CTV_GLOBAL_PROC 3 //プロシージャ
908#define CTV_CLASS 4 //クラス
909#define CTV_PUBLIC_MEMBER 5 //公開cメンバ変数
910#define CTV_PUBLIC_METHOD 6 //公開メソッド
911#define CTV_PRIVATE_MEMBER 7 //非公開メンバ変数
912#define CTV_PRIVATE_METHOD 8 //非公開メソッド
913class CClassTreeView{
914 HWND hTreeWnd;
915 int iNowFile;
916 TREEHASH tree_data[MAX_HASH];
917
918 HTREEITEM hGlobalProcedureFolder;
919 HTREEITEM hNowClassFolder;
920
921 int hash_default(LONG_PTR lpdata);
922
923 void AddValidItem(HTREEITEM hItem,int iFileNum);
924 BOOL delete_check(HTREEITEM hItem);
925 void DeleteInvalidItems(HTREEITEM hItem);
926 void DeleteTreeHash(TREEHASH *pth);
927
928 HTREEITEM insert(HTREEITEM hParentItem,int flag,char *lpszName,int iFileNum);
929
930public:
931 HTREEITEM hRootFolder;
932
933 int NumberOfProcedures;
934 PROCINFO *pProcInfo;
935
936 BOOL bCloseSwitch;
937 BOOL bShowSwitch;
938
939 CClassTreeView();
940 ~CClassTreeView();
941 void init(HWND hwnd,int iFileNum);
942
943 void InsertRootFolder(void);
944 void InsertGlobalProcedureFolder(void);
945 HTREEITEM InsertGlobalProcedure(int flag,char *lpszName,int iFileNum);
946 HTREEITEM insert_code_item(HTREEITEM hParentItem,int flag,char *lpszName,int iFileNum,char *pBuf,int p);
947 void InsertClassFolder(char *lpszName,int iFileNum,char *pBuf,int p);
948 void InsertClassMember(int flag,char *lpszName,int iFileNum,char *pBuf,int p);
949 void finish();
950};
951extern CClassTreeView *pobj_ClassTreeView;
952void ResetClassTree(int iFileNum);
953
954//ProjectControl.cpp
955void ResizeProjectView_ToolWindow(void);
956LRESULT CALLBACK ProjectView_ToolWindowProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
957void ShowFileView();
958void ShowClassView();
959void ShowMaterialView();
960LRESULT CALLBACK ProjectViewProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
961void Project_File_Insert(char *path);
962void Project_File_Delete(HTREEITEM hTreeItem);
963void MakeNewProject(void);
964BOOL ProjectModifyCheck(BOOL bRun);
965void MakeWorkFile(void);
966void SaveProject(void);
967BOOL SetProjectToRun(void);
968BOOL IsNeedCompileForProject(BOOL bDebug);
969
970//WindowControl.cpp
971int GetWndInfoNum(char *name);
972ActiveBasic::PM::WindowInfo *GetWndInfo( char *name );
973HGLOBAL Rad_GetChildInfoClipboardData(int WndNum,int WndInfoNum);
974void Rad_PasteChildInfoClipboardData(int WndNum,HGLOBAL hGlobal);
975char *PermutationWndPgmTemplate(char *pBuf,const char *pPjName, char *pWndName, char *pHandleName, char *pProcName);
976void GetItemClassName(char *buffer,int Control);
977void SaveWindowProgram();
978void SaveWindowFile( char *path, const ActiveBasic::PM::WindowInfos &windowInfos );
979_int8 OpenWindowFile(char *path);
980void GetDefaultWindowFont(LOGFONT *LogFont);
981void Project_Window_Insert(void);
982void Project_Window_Delete(int WndInfoNum);
983
984//Resource.cpp
985void Project_CursorResInsert(void);
986void Project_Cursor_Delete(int CursorInfoNum);
987void Project_Cursor_RenameID(int CursorInfoNum);
988void Project_BitmapResInsert(void);
989void Project_Bitmap_Delete(int IconInfoNum);
990void Project_Bitmap_RenameID(int BitmapInfoNum);
991void Project_IconResInsert(void);
992void Project_Icon_Delete(int IconInfoNum);
993void Project_Icon_RenameID(int IconInfoNum);
994BOOL CALLBACK DlgProject_ResourceID_Input(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
995
996
997
998///////////////////
999/* RADウィンドウ */
1000
1001//RadProc.cpp
1002void NewRadWindow( const ActiveBasic::PM::WindowInfo &windowInfo );
1003int InsertDlgItem(int WndNum,int WndInfoNum,int ItemNum,POINT *pPos,SIZE *pSize,const char *IdName,const char *caption,DWORD style_or_WndNum,DWORD ExStyle,int Control,ActiveBasic::PM::ImageReferenceType::EnumType ImageType,const char *ImagePath,DWORD dwInsertType);
1004void DeleteDlgItem(int WndNum,int WndInfoNum,int ItemNum,BOOL bNoticeChanging);
1005void CursorPos_GlobalToLocal(HWND hwnd,long *x,long *y);
1006void DrawSelectingRect(HWND hwnd,int WndNum,int WndInfoNum,int ButtonSelect);
1007void ChangePropertyWindow(int WndNum,int WndInfoNum);
1008void ResetScrollbarOfRadEditor(int WndNum,int weight,int height);
1009LRESULT CALLBACK RadWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1010void ResizeToRadToolWindows(int WndNum,int weight,int height);
1011LRESULT CALLBACK MDIClientWindow_Rad(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1012
1013//DrawWindow.cpp
1014void DrawRadWindow(int WndNum,const ActiveBasic::PM::WindowInfo *pWindowInfo);
1015
1016//Rad_UndoRedo.cpp
1017void Rad_UndoCommand(int WndNum);
1018void Rad_RedoCommand(int WndNum);
1019void Rad_DeleteUndoData(int WndNum,int pos);
1020void Rad_NoticeChanging(int WndNum,int Command,int SelectItemNum,DWORD dwData);
1021
1022//RadToolsAndPropertyProc.cpp
1023LRESULT CALLBACK RadToolsWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1024BOOL CALLBACK RadProperty_WindowProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1025BOOL CALLBACK DlgRadProperty_Item_RenameCaption(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1026BOOL CALLBACK RadProperty_ButtonProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1027BOOL CALLBACK RadProperty_CheckBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1028BOOL CALLBACK RadProperty_ComboBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1029BOOL CALLBACK RadProperty_EditProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1030BOOL CALLBACK RadProperty_GroupBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1031BOOL CALLBACK RadProperty_ImageBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1032BOOL CALLBACK RadProperty_ListBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1033BOOL CALLBACK RadProperty_ListViewProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1034BOOL CALLBACK RadProperty_ProgressBarProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1035BOOL CALLBACK RadProperty_RadioButtonProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1036BOOL CALLBACK RadProperty_ScrollBarProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1037BOOL CALLBACK RadProperty_StaticProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1038BOOL CALLBACK RadProperty_TrackBarProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1039BOOL CALLBACK RadProperty_TreeViewProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1040BOOL CALLBACK RadProperty_UpDownProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1041LRESULT CALLBACK RadPropertyWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1042
1043//MessageCallOperation.cpp
1044char **GetProcedureNamesOfMessageCall(int WndInfoNum,ITEMEVENTINFO **ppItemEventInfo,int *num,BOOL *pbAlways);
1045void SelectProcedureOfMessageCall(int WndInfoNum,char *ProcedureName,char *Parameter);
1046BOOL CALLBACK DlgEventCode(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1047
1048//RadSupport.cpp
1049LRESULT CALLBACK TestWindowProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1050void SetSupportDlgData(int WndNum, const ActiveBasic::PM::WindowInfo &windowInfo );
1051BOOL CALLBACK DlgRadSupport(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1052
1053
1054
1055////////////////////
1056/* MENUウィンドウ */
1057
1058//MenuProc.cpp
1059int GetMenuInfoNum(const char *name);
1060void HeapMenuDataFree(MENU_INFO *pMenuInfo,int ItemNum,int *NumberOfFreedItem);
1061BOOL CALLBACK DlgProject_MenuID_Input(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1062void Project_Menu_Insert(void);
1063void Project_Menu_Delete(int MenuInfoNum);
1064void NewMenuWindow(MENU_INFO *pMenuInfo);
1065BOOL CALLBACK MenuEditDlg(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1066LRESULT CALLBACK MenuEditWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1067LRESULT CALLBACK MDIClientWindow_Menu(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1068
1069
1070
1071//////////////////////////////////
1072/* アイコン エディタ ウィンドウ */
1073
1074//IconEditor.cpp
1075void AddIconType(int WndNum,int IconType);
1076void DeleteIconType(int WndNum);
1077void NewIconEditWindow(const char *filepath);
1078void SaveIconFile(char *filepath,HWND hwnd);
1079LRESULT CALLBACK MDIClientWindow_IconEdit(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1080
1081//IconEditor_Main.cpp
1082HGLOBAL IconEdit_GetChildInfoClipboardData(int WndNum);
1083void IconEdit_PasteChildInfoClipboardData(int WndNum,HBITMAP hBmp);
1084void IconEdit_PasteImage(int WndNum);
1085void DrawIconToMemBmp(int WndNum,RECT *pRect);
1086void IconEdit_EraseRect(int WndNum,RECT *pRect);
1087LRESULT CALLBACK IconEditWindowProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1088
1089//IconEditor_Tool.cpp
1090BOOL CALLBACK DlgIconButtons(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1091BOOL CALLBACK DlgIconToolProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1092
1093//IconEditor_Color.cpp
1094BOOL CALLBACK DlgIconColorProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1095
1096//IconEditor_UndoRedo.cpp
1097void IconEdit_UndoCommand(int WndNum);
1098void IconEdit_RedoCommand(int WndNum);
1099void IconEdit_NoticeChanging(int WndNum);
1100
1101
1102
1103
1104
1105#include "NonVolatile.h"
1106
1107
1108
1109
1110#ifdef _DEBUG
1111/*Debug*/
1112
1113#define HeapAlloc CheckHeapAlloc
1114#define HeapReAlloc CheckHeapReAlloc
1115LPVOID CheckHeapAlloc(HANDLE hHeap,DWORD dwFlags,DWORD dwBytes);
1116LPVOID CheckHeapReAlloc(HANDLE hHeap,DWORD dwFlags,LPVOID lpMem,DWORD dwBytes);
1117
1118#define DeleteObject CheckDeleteObject
1119BOOL CheckDeleteObject(HGDIOBJ hObject);
1120
1121#endif
Note: See TracBrowser for help on using the repository browser.