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

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

バージョンを5.0.0.5に上げた(CP5としてリリース用)。

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