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

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

不要な宣言を除去

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
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.00.00"
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
408class CFileInfo{
409 std::string filepath;
410public:
411 HTREEITEM m_hTreeItem;
412 CFileInfo( const std::string &filepath, HTREEITEM hTreeItem );
413
414 const std::string &GetPath() const
415 {
416 return filepath;
417 }
418
419 void GetFullPath(char *buffer);
420};
421class CDBFileInfo{
422public:
423 int iNum;
424 CFileInfo **ppobj_FileInfo;
425
426 CDBFileInfo();
427 ~CDBFileInfo();
428
429 void add(char *path,HTREEITEM hTreeItem);
430 void del(HTREEITEM hTreeItem);
431 const std::string &GetPath(HTREEITEM hTreeItem);
432 BOOL IsMainFile(HTREEITEM hTreeItem);
433
434 void SetTreeItem(int index,HTREEITEM hTreeItem);
435 void ResetTree(void);
436
437 BOOL dupli_check(char *path);
438};
439
440struct PROCINFO{
441 char *name;
442 int FileNum;
443 HTREEITEM hTreeItem;
444
445 int code_pos;
446};
447struct INCPROCINFO{
448 char *name;
449 char *Parms;
450 char *type;
451};
452
453//ダイアログアイテムの種類
454#define CT_BUTTON 1
455#define CT_CHECKBOX 2
456#define CT_COMBOBOX 3
457#define CT_EDIT 4
458#define CT_GROUPBOX 5
459#define CT_HSCROLLBAR 6
460#define CT_IMAGEBOX 7
461#define CT_LISTBOX 8
462#define CT_LISTVIEW 9
463#define CT_RADIOBUTTON 10
464#define CT_STATIC 11
465#define CT_TREEVIEW 12
466#define CT_VSCROLLBAR 13
467#define CT_UPDOWN 14
468#define CT_PROGRESSBAR 15
469#define CT_TRACKBAR 16
470#define CT_MENU 99
471
472//イベント タイプ
473#define EVENTTYPE_DEFAULT 0
474#define EVENTTYPE_MENU 1
475#define EVENTTYPE_MMSYS 2
476
477
478struct NEWPROJECTINFO{
479 char name[MAX_PATH];
480 DWORD dwTypeID;
481 _int8 ShowHelloWorld;
482 DWORD dwOption;
483};
484struct MENU_INFO{
485 char *IdName;
486 char *caption;
487 UINT type;
488 UINT state;
489
490 int NumberOfMenu;
491 MENU_INFO *pMenuInfo;
492
493 HTREEITEM hTreeItem;
494};
495#define MT_EXE 0 //EXEモジュールタイプ
496#define MT_DLL 1 //DLLモジュールタイプ
497#define MT_SLL 2 //SLLモジュールタイプ
498#define PJ_OP_SOURCE_MASK 0x00FFFFFF
499#define PJ_OP_MMSYSTEM 0x00000001
500#define PJ_OP_COMMCTRL 0x00000002
501#define PJ_OP_RICHEDIT 0x00000004
502#define PJ_OP_WINSOCK 0x00000008
503#define PJ_OP_STRICT 0x00010000 // #strictディレクティブは今は使われていない
504#define PJ_OP_RC_MANIFEST 0x00020000
505#define PJ_OP_UNICODE 0x00040000
506
507
508
509struct SAVEREBAR{
510 int RebarID;
511 int RebarLength;
512 int IsBandBreak;
513};
514
515struct ITEMEVENTINFO{
516 char *IdName;
517 char **pEventNames;
518 int ClassID;
519 int EventNum;
520};
521
522#define PARAMETER_HINT_MAX_SIZE 8192
523struct METHODCHECKINFO{
524 HWND hWnd;
525 LOGFONT LogFont;
526 HFONT hFont;
527 HFONT hBoldFont;
528 char BeforeMethodName[VN_SIZE];
529 char msg[PARAMETER_HINT_MAX_SIZE];
530 int ParmNum;
531 int HeadPos;
532};
533
534
535/////////////////////
536// コード補完機能
537/////////////////////
538
539#define ACCESS_NON 0
540#define ACCESS_PRIVATE 1
541#define ACCESS_PUBLIC 2
542#define ACCESS_PROTECTED 3
543#define ACCESS_PAIRCOMMAND 4
544#define ACCESS_HTML_GENERAL_PARAM 5
545#define ACCESS_HTML_PARAM 6
546struct MEMBERINFO{
547 //クラス名
548 char *pName;
549 DWORD dwProc;
550 DWORD dwAccess;
551
552 int code_pos;
553};
554struct COMPLEMENT_WINDOW_INFO{
555 HWND hWnd;
556 HWND hList;
557
558 int iPos;
559 int iLength;
560
561 MEMBERINFO *pMemberInfo;
562 int MemberNum;
563
564 //ペアステートメントのインデント格納用
565 char szIndent[255];
566};
567
568
569
570class CSettingFile{
571 BOOL GetDataLine(const char *name,char *parms);
572protected:
573 char *buffer;
574
575 BOOL GetWholeValue(const char *name,int *pi32data);
576 bool GetBoolean( const char *name,bool &b );
577 BOOL Get3WholeValue(char *name,int *pd1,int *pd2,int *pd3);
578 BOOL GetRGBValue(char *name,COLORREF *prgb);
579 BOOL GetStringValue(char *name,char *str);
580 BOOL GetRectValue(char *name,RECT *prc);
581 BOOL GetLogFont(char *name,LOGFONT *plf);
582 BOOL GetRebarBand(SAVEREBAR *psr,int num);
583
584 void SetWholeValue( const char *name,long i32data);
585 void SetBoolean( const char *name,bool b);
586 void Set3WholeValue(char *name,long d1,long d2,long d3);
587 void SetRGBValue(char *name,COLORREF rgb);
588 void SetStringValue(char *name,char *str);
589 void SetRectValue(char *name,RECT *prc);
590 void SetLogFont(char *name,LOGFONT *plf);
591 void SetRebarBand(SAVEREBAR *psr,int num);
592};
593#include "DesignTheme.h"
594
595
596
597//ProjectEditor.cpp
598void HeapDefaultFree(LPVOID lpMem);
599void ToBigChar(char str[]);
600int GetWndNum(HWND hChild);
601int GetNowWndNum(void);
602int GetFileNum(int WndNum);
603void SendTextEditResizeEvent(HWND hwnd);
604void RedrawAllWindow(void);
605int DocumentModifyCheck(HWND hChild);
606void SetStatusText(char *MenuText);
607void ResetState_UndoMenu(void);
608void ResetState_EditMenu(void);
609void ResetState_DocMenu(void);
610void DuplicateTitleCheck(char *lpszTitle);
611HWND NewTextEditWindow(char *filepath,_int8 DocumentType,COLORREF TabColor=TABCOLOR_GRAY);
612void CloseDocWindow(int WndNum);
613void ResizeTextEditWnd(HWND hwnd,int cx,int cy);
614#define FLAG_DBLCLK 1
615#define FLAG_BEAMCURSOR 2
616int RegWndClass(WNDPROC WndProc,char *lpClassName,HBRUSH hBackBrush,DWORD dwFlag);
617
618//Backup.cpp
619void CreateBackupDir(void);
620void backup(void *dummy);
621BOOL restore(void);
622
623//DialogBoxes.cpp
624void SetPosCenter(HWND hParent,HWND hwnd);
625void SetPosCenter(HWND hwnd);
626BOOL SetFontDialog(HWND hwnd,LOGFONT *lf,BOOL bFixedPitchOnly,int *lpiPointSize=0);
627void DlgNewProjectWizard(HWND hwnd);
628BOOL CALLBACK DlgNewFile(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
629void DlgProjectOptionSetting(HWND hwnd);
630void DlgOptionSetting(HWND hwnd);
631BOOL CALLBACK DialogAbout(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
632
633//FileOperation.cpp
634void MakeUserSettingDir(void);
635char *ReadBuffer( const std::string &path );
636char *ReadBuffer_NonErrMsg( const std::string &path );
637_int8 WriteBuffer(const std::string &path,const char *buffer,int length, bool isEnableError = true);
638_int8 WriteBuffer_NonErrMsg(const std::string &path,char *buffer,int length);
639void GetRelationalPath(char *path,char *dir);
640void GetFullPath(char *path,const char *dir);
641void RemoveDirectoryStrong(const char *dirPath);
642BOOL GetFilePathDialog(HWND hwnd,char *filename,LPSTR Filter,LPSTR Title,_int8 IsOpen);
643BOOL GetFolder(HWND hWnd,char *folder,char *OpenFolderTitle);
644int GetFileExtension( const char *path );
645HWND OpenFileWithExtension( const std::string &filePath );
646BOOL SaveDocument(HWND hChild,char *SaveFileName);
647BOOL ShortPathToLongPath(char ShortPath[MAX_PATH],char *LongPath);
648bool IsExistFile( const char *FilePath );
649bool IsExistDirectory( const char *DirPath );
650
651//rebar.cpp
652#define MAX_BAND 255
653typedef HWND (*AddBandProc)(HWND hRebar,int num,char *lpszText);
654class CDBRebarBand{
655 int BandId[MAX_BAND];
656 AddBandProc pAddProc[MAX_BAND];
657 int iMaxBandNum;
658public:
659 HWND hRebar;
660 CDBRebarBand();
661 ~CDBRebarBand();
662 void add(int band_id,AddBandProc add_proc);
663 HWND call_add(int band_id,int num,char *lpszText);
664};
665class CMainRebar{
666 CDBRebarBand *pobj_DBRebarBand;
667
668 void SetupRebar(HWND hwnd);
669public:
670 HWND hParent;
671 HWND hRebar;
672
673 CMainRebar(HWND hwnd_parent);
674 ~CMainRebar();
675
676 void ResetInitRebar();
677 void ResetRebar();
678 void SaveRebarState(void);
679 void ChangeRebarBand(int BandID);
680 void menu_popup(HWND hwnd,int PosX,int PosY);
681};
682extern CMainRebar *pobj_Rebar;
683void ResetRebarData(void);
684LRESULT CALLBACK DefaultToolbarProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
685LRESULT CALLBACK DocComboProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
686LRESULT CALLBACK DebuggerToolbarProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
687
688//SubOperation.cpp
689void ScreenToClient(HWND hwnd,RECT *pRect);
690void ClientToScreen(HWND hwnd,RECT *pRect);
691BOOL IsWow64(void);
692void URLEncode(LPSTR pszSrc);
693void Digit(int num,char *buffer);
694void RectNaturalFormat(RECT *ReadRect,RECT *CopyRect);
695void RectNaturalFormat(int *x1,int *y1,int *x2,int *y2);
696void KillSpaces(char *str1,char *str2);
697void RemoveStringQuotes(char *str);
698void SlideString(char *str,int slide);
699void SlideBuffer(char *buffer,int length,int slide);
700BOOL IsVariableTopChar(char c);
701BOOL IsVariableChar(char c);
702BOOL IsCommandBackDelimitation(char *buffer,int pos);
703BOOL IsCommandDelimitation(char *buffer,int p);
704char *ComparisonString( char *str1, char *str2, bool isBigSmall, bool isWordUnit );
705int GetOneParameter(char *Parameter,int pos,char *retAns);
706int GetStringInPare(char *buffer,char *ReadBuffer);
707int GetStringInBracket(char *buffer,char *ReadBuffer);
708void JumpBlank(char *pBuf,int *piPos);
709BOOL CheckParenthesis(char *buffer);
710DWORD GetValue(char *value);
711BOOL IsManagementCommand(int ComNum);
712int IsBasicReservedWord(char *str);
713HBITMAP CreateGradationBitmap(SIZE *pSize,COLORREF color1,COLORREF color2);
714HBITMAP CreateVertGradationBitmap(SIZE *pSize,COLORREF color1,COLORREF color2);
715HBITMAP CreateHorzGradationBitmap(SIZE *pSize,COLORREF color1,COLORREF color2);
716HICON CreateGrayIcon(HICON hBaseIcon);
717void GetSize(SIZE *pSize,RECT *pRect);
718BOOL HitTest(RECT *pRect,POINT *pPos);
719BOOL Rectangle(HDC hdc,RECT *pRect);
720void ComboBox_SetSelText(HWND hCombo,char *lpszText);
721void SetCursorByState(int state);
722void SetTextEditColorDesign(TEXTEDIT_COLOR_INFO *pColorInfo,CTheme *pobj_Theme,BOOL bRedraw);
723BOOL SetupProjectEditor(void);
724void EndProjectEditor(void);
725BOOL SetRunning(HWND hChild);
726BOOL IsNeedCompile( const std::string &filepath, BOOL bDebug );
727std::string GetLastErrorString();
728
729//DocumentAdvice.cpp
730void MenuAdvice(WPARAM msg);
731void ShowToolTipText(LPTOOLTIPTEXT TipText);
732char *IncludeFiles(char *buffer);
733void AddParameterHints_ToProject(char *path);
734
735
736
737/////////////////////
738// テキスト エディタ
739/////////////////////
740
741#define CONTROL_TAB_SPACE_DEFAULT 10 //エディタ画面左端のコントロールタブ(通常)
742
743//DrawBuffer.cpp
744void TextEdit_DrawBuffer(HDC hdc,int WndNum);
745
746//TextEditor.cpp
747int GetControlTabSpace(int WndNum,int *piCount=0);
748void ResetTextEditFont(HWND hwnd);
749void SetTextEditWordColor(int WndNum);
750BOOL IsHiragana(char *pBuf);
751BOOL IsAlphabet(char c);
752BOOL IsReturnCode(char *pBuf);
753void ResetScrollbar(int WndNum,int max_x,int max_y);
754#define WORDCARET_BEFORE 1
755#define WORDCARET_AFTER 2
756void TextEdit_GetWordCaret(HWND hwnd,int WndNum,POINT *pPos,int *piStart,int *piEnd,BOOL bBeforeAfterFlag);
757void CancelBeforeAutoIndent(int WndNum);
758LRESULT CALLBACK TextEditProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
759
760//Caret.cpp
761BOOL IsRightTurn(char *pBuf,int i,int now_x);
762int GetBufferIndexFromCaretPos(char *pBuf,int now_x,int now_y);
763void GetCaretPosFromBufferIndex(char *pBuf,int index,POINT *pCaretPos);
764void TextEdit_GetSel(int WndNum,CHARRANGE *pCharRange);
765void TextEdit_GetSelText(int WndNum,CHARRANGE *pCharRange,char *buffer);
766void GetScrollBaseCaretPos(int WndNum,int *pNaturalBaseX,int *pNaturalBaseY);
767void GetNaturalBaseCaretPos(int WndNum,int *pScrollBaseX,int *pScrollBaseY);
768void TextEdit_SetSel(int WndNum,int StartIndex,int EndIndex,BOOL bShowCenter=0);
769void TextEdit_SelectOneLine(int WndNum,int code_pos,BOOL bShowCenter=0);
770void ResetCaretPos(int WndNum,BOOL bInputAndReset=0);
771BOOL TextEdit_ScrollCaret(int WndNum,BOOL bScrollOneStep_x,BOOL bShowCenter=0);
772void CaretPos_LooseToNatural(int WndNum,int loose_x,int loose_y,POINT *pCaretPos);
773void GetNaturalCaretPos_Click(int WndNum,int mouse_x,int mouse_y,POINT *pCaretPos);
774void GetNaturalCaretPos_Left(int WndNum);
775void GetNaturalCaretPos_Right(int WndNum,POINT *pCaretPos);
776void GetNaturalCaretPos_Up(int WndNum,POINT *pCaretPos);
777void GetNaturalCaretPos_Down(int WndNum,POINT *pCaretPos);
778void GetNaturalCaretPos_PageUp(int WndNum,POINT *pCaretPos);
779void GetNaturalCaretPos_PageDown(int WndNum,POINT *pCaretPos);
780
781//Replace.cpp
782void TextEdit_Replace(int WndNum,char *str,BOOL bRedraw);
783void TextEdit_ReplaceUpdateUndoData(int WndNum,char *str,BOOL bPaste,BOOL bRedraw);
784void TextEdit_Convert(int id);
785
786//TextEditor_UndoRedo.cpp
787void TextEdit_UndoCommand(int WndNum);
788void TextEdit_RedoCommand(int WndNum);
789void TextEdit_NoticeChanging(int WndNum,int Command,char *KeyStr,char *DelStr,CHARRANGE *Range,CHARRANGE *DelRange);
790void TextEdit_DeleteUndoData(TEXTEDIT_UNDOSTATE *pUndoState,int pos);
791
792//Search.cpp
793void AddFindData(HWND hwnd,char ppData[MAX_FINDLIST][MAX_PATH],char *str);
794BOOL CALLBACK DlgFind(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
795BOOL CALLBACK DlgPermutation(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
796
797//analysis.cpp
798BOOL GetVarFormatString(char *buffer,char *array,char *array2,char *NestMember,int *pRefType);
799BOOL CheckReferType(char *ClassName,BOOL bArray,char *VarArray,int VarRefType);
800void GetOriginalClassName(char *ClassName);
801int GetClassPos(char *pBuf,char *ClassName,DWORD *pdwClassType);
802BOOL GetClassNameFromClassMember(char *pBuf,int iPos,char *VarName,char *ClassName,BOOL *pbArray);
803void GetCodeAreaType(char *pBuf,int iPos,int *piProcPos,char *NowClass);
804BOOL GetVariableClassName(char *pEditBuf,int iPos,char *VarName,char *ClassName,BOOL *pbArray);
805
806//EndPairCommandComplement.cpp
807BOOL GetEndPairCommandInfo(char *buffer,int p);
808BOOL IsNeedNewIndentCommand(char *name);
809void GetWithObjectVariable(char *buffer,int p,char *pObjectVar);
810
811//Complement.cpp
812void DeleteComplementInfo(void);
813BOOL GetComplementInfo(char *variable,char *pEditBuf,int iPos);
814void CodeComplement(int WndNum,int iPos);
815LRESULT CALLBACK ComplementWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
816
817//ParameterHint.cpp
818char *GetUserSourceCode(void);
819void ChangeReturnCode(char *buffer);
820void DeleteComment(char *buffer);
821LRESULT CALLBACK MethodCheckWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
822void ShowParameterHint(int WndNum);
823
824//CodeFormatter.cpp
825char *CodeFormatter(char *lpszReadBuffer);
826
827#ifdef THETEXT
828//StringCount.cpp
829BOOL CALLBACK DlgStringCount(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
830#endif
831
832//Print.cpp
833class CPage{
834public:
835 PAGESETUPDLG psd;
836 CPage();
837 ~CPage();
838
839 BOOL SetupDlg(void);
840};
841extern CPage obj_Page;
842LRESULT CALLBACK PreviewWndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
843void Preview(void);
844void Printout(void);
845
846//History.cpp
847#define IS_FILEHISTORY_COMMAND(a) (100<=a&&a<=199)
848class CHistory{
849 int iNum;
850 int iMaxHistoryNum;
851
852 int m_BaseID;
853public:
854 char *lpszPath[255];
855
856 CHistory(int BaseID);
857 ~CHistory();
858
859 void load(char *path);
860 void save(char *path);
861
862 void add(char *path);
863 void insert(const char *path);
864
865 void ResetFileMenu(CSubMenuEx *pobj_SubMenu,BOOL bOwnerDraw);
866};
867
868
869
870
871//////////////////////
872/* プロジェクト解析 */
873
874//CClassInfo.cpp
875class CClassInfo{
876public:
877 char ClassName[VN_SIZE];
878 MEMBERINFO *pMemberInfo;
879 int MemberNum;
880 CClassInfo();
881 ~CClassInfo();
882 int Analyze(char *pBuf,int *p);
883};
884
885//ClassTree.cpp
886struct TREEHASH{
887 HTREEITEM hItem;
888 int iFileNum;
889 TREEHASH *pNextData;
890};
891#define CTV_ROOT 1 //ルート
892#define CTV_FOLDER 2 //フォルダ
893#define CTV_GLOBAL_PROC 3 //プロシージャ
894#define CTV_CLASS 4 //クラス
895#define CTV_PUBLIC_MEMBER 5 //公開cメンバ変数
896#define CTV_PUBLIC_METHOD 6 //公開メソッド
897#define CTV_PRIVATE_MEMBER 7 //非公開メンバ変数
898#define CTV_PRIVATE_METHOD 8 //非公開メソッド
899class CClassTreeView{
900 HWND hTreeWnd;
901 int iNowFile;
902 TREEHASH tree_data[MAX_HASH];
903
904 HTREEITEM hGlobalProcedureFolder;
905 HTREEITEM hNowClassFolder;
906
907 int hash_default(LONG_PTR lpdata);
908
909 void AddValidItem(HTREEITEM hItem,int iFileNum);
910 BOOL delete_check(HTREEITEM hItem);
911 void DeleteInvalidItems(HTREEITEM hItem);
912 void DeleteTreeHash(TREEHASH *pth);
913
914 HTREEITEM insert(HTREEITEM hParentItem,int flag,char *lpszName,int iFileNum);
915
916public:
917 HTREEITEM hRootFolder;
918
919 int NumberOfProcedures;
920 PROCINFO *pProcInfo;
921
922 BOOL bCloseSwitch;
923 BOOL bShowSwitch;
924
925 CClassTreeView();
926 ~CClassTreeView();
927 void init(HWND hwnd,int iFileNum);
928
929 void InsertRootFolder(void);
930 void InsertGlobalProcedureFolder(void);
931 HTREEITEM InsertGlobalProcedure(int flag,char *lpszName,int iFileNum);
932 HTREEITEM insert_code_item(HTREEITEM hParentItem,int flag,char *lpszName,int iFileNum,char *pBuf,int p);
933 void InsertClassFolder(char *lpszName,int iFileNum,char *pBuf,int p);
934 void InsertClassMember(int flag,char *lpszName,int iFileNum,char *pBuf,int p);
935 void finish();
936};
937extern CClassTreeView *pobj_ClassTreeView;
938void ResetClassTree(int iFileNum);
939
940//ProjectControl.cpp
941void ResizeProjectView_ToolWindow(void);
942LRESULT CALLBACK ProjectView_ToolWindowProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
943void ShowFileView();
944void ShowClassView();
945void ShowMaterialView();
946LRESULT CALLBACK ProjectViewProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
947void Project_File_Insert(char *path);
948void Project_File_Delete(HTREEITEM hTreeItem);
949void MakeNewProject(void);
950BOOL ProjectModifyCheck(BOOL bRun);
951void MakeWorkFile(void);
952void SaveProject(void);
953BOOL SetProjectToRun(void);
954BOOL IsNeedCompileForProject(BOOL bDebug);
955
956//WindowControl.cpp
957int GetWndInfoNum( const std::string &name );
958ActiveBasic::PM::WindowInfo *GetWndInfo( const std::string &name );
959HGLOBAL Rad_GetChildInfoClipboardData(int WndNum,int WndInfoNum);
960void Rad_PasteChildInfoClipboardData(int WndNum,HGLOBAL hGlobal);
961char *PermutationWndPgmTemplate(char *pBuf,const char *pPjName, char *pWndName, char *pHandleName, char *pProcName);
962const std::string PermutationWndPgmTemplate( const std::string &templateFilePath, const std::string &projectName, std::string &windowName, std::string &handleName, std::string &procName );
963void GetItemClassName(char *buffer,int Control);
964void SaveWindowProgram();
965void SaveWindowFile( char *path, const ActiveBasic::PM::WindowInfos &windowInfos );
966_int8 OpenWindowFile(char *path);
967void GetDefaultWindowFont(LOGFONT *LogFont);
968void Project_Window_Insert(void);
969void Project_Window_Delete(int WndInfoNum);
970
971//Resource.cpp
972void Project_CursorResInsert(void);
973void Project_Cursor_Delete(int CursorInfoNum);
974void Project_Cursor_RenameID(int CursorInfoNum);
975void Project_BitmapResInsert(void);
976void Project_Bitmap_Delete(int IconInfoNum);
977void Project_Bitmap_RenameID(int BitmapInfoNum);
978void Project_IconResInsert(void);
979void Project_Icon_Delete(int IconInfoNum);
980void Project_Icon_RenameID(int IconInfoNum);
981BOOL CALLBACK DlgProject_ResourceID_Input(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
982
983
984
985///////////////////
986/* RADウィンドウ */
987
988//RadProc.cpp
989void NewRadWindow( const ActiveBasic::PM::WindowInfo &windowInfo );
990int 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);
991void DeleteDlgItem(int WndNum,int WndInfoNum,int ItemNum,BOOL bNoticeChanging);
992void CursorPos_GlobalToLocal(HWND hwnd,long *x,long *y);
993void DrawSelectingRect(HWND hwnd,int WndNum,int WndInfoNum,int ButtonSelect);
994void ChangePropertyWindow(int WndNum,int WndInfoNum);
995void ResetScrollbarOfRadEditor(int WndNum,int weight,int height);
996LRESULT CALLBACK RadWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
997void ResizeToRadToolWindows(int WndNum,int weight,int height);
998LRESULT CALLBACK MDIClientWindow_Rad(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
999
1000//DrawWindow.cpp
1001void DrawRadWindow(int WndNum,const ActiveBasic::PM::WindowInfo *pWindowInfo);
1002
1003//Rad_UndoRedo.cpp
1004void Rad_UndoCommand(int WndNum);
1005void Rad_RedoCommand(int WndNum);
1006void Rad_DeleteUndoData(int WndNum,int pos);
1007void Rad_NoticeChanging(int WndNum,int Command,int SelectItemNum,DWORD dwData);
1008
1009//RadToolsAndPropertyProc.cpp
1010LRESULT CALLBACK RadToolsWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1011BOOL CALLBACK RadProperty_WindowProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1012BOOL CALLBACK DlgRadProperty_Item_RenameCaption(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1013BOOL CALLBACK RadProperty_ButtonProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1014BOOL CALLBACK RadProperty_CheckBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1015BOOL CALLBACK RadProperty_ComboBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1016BOOL CALLBACK RadProperty_EditProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1017BOOL CALLBACK RadProperty_GroupBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1018BOOL CALLBACK RadProperty_ImageBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1019BOOL CALLBACK RadProperty_ListBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1020BOOL CALLBACK RadProperty_ListViewProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1021BOOL CALLBACK RadProperty_ProgressBarProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1022BOOL CALLBACK RadProperty_RadioButtonProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1023BOOL CALLBACK RadProperty_ScrollBarProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1024BOOL CALLBACK RadProperty_StaticProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1025BOOL CALLBACK RadProperty_TrackBarProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1026BOOL CALLBACK RadProperty_TreeViewProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1027BOOL CALLBACK RadProperty_UpDownProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1028LRESULT CALLBACK RadPropertyWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1029
1030//MessageCallOperation.cpp
1031char **GetProcedureNamesOfMessageCall(int WndInfoNum,ITEMEVENTINFO **ppItemEventInfo,int *num,BOOL *pbAlways);
1032void SelectProcedureOfMessageCall(int WndInfoNum,char *ProcedureName,char *Parameter);
1033BOOL CALLBACK DlgEventCode(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1034
1035//RadSupport.cpp
1036LRESULT CALLBACK TestWindowProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1037void SetSupportDlgData(int WndNum, const ActiveBasic::PM::WindowInfo &windowInfo );
1038BOOL CALLBACK DlgRadSupport(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1039
1040
1041
1042////////////////////
1043/* MENUウィンドウ */
1044
1045//MenuProc.cpp
1046int GetMenuInfoNum(const std::string &name);
1047void HeapMenuDataFree(MENU_INFO *pMenuInfo,int ItemNum,int *NumberOfFreedItem);
1048BOOL CALLBACK DlgProject_MenuID_Input(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1049void Project_Menu_Insert(void);
1050void Project_Menu_Delete(int MenuInfoNum);
1051void NewMenuWindow(MENU_INFO *pMenuInfo);
1052BOOL CALLBACK MenuEditDlg(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1053LRESULT CALLBACK MenuEditWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1054LRESULT CALLBACK MDIClientWindow_Menu(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1055
1056
1057
1058//////////////////////////////////
1059/* アイコン エディタ ウィンドウ */
1060
1061//IconEditor.cpp
1062void AddIconType(int WndNum,int IconType);
1063void DeleteIconType(int WndNum);
1064void NewIconEditWindow(const char *filepath);
1065void SaveIconFile(char *filepath,HWND hwnd);
1066LRESULT CALLBACK MDIClientWindow_IconEdit(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1067
1068//IconEditor_Main.cpp
1069HGLOBAL IconEdit_GetChildInfoClipboardData(int WndNum);
1070void IconEdit_PasteChildInfoClipboardData(int WndNum,HBITMAP hBmp);
1071void IconEdit_PasteImage(int WndNum);
1072void DrawIconToMemBmp(int WndNum,RECT *pRect);
1073void IconEdit_EraseRect(int WndNum,RECT *pRect);
1074LRESULT CALLBACK IconEditWindowProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1075
1076//IconEditor_Tool.cpp
1077BOOL CALLBACK DlgIconButtons(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1078BOOL CALLBACK DlgIconToolProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1079
1080//IconEditor_Color.cpp
1081BOOL CALLBACK DlgIconColorProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
1082
1083//IconEditor_UndoRedo.cpp
1084void IconEdit_UndoCommand(int WndNum);
1085void IconEdit_RedoCommand(int WndNum);
1086void IconEdit_NoticeChanging(int WndNum);
1087
1088
1089
1090
1091
1092#include "NonVolatile.h"
1093
1094
1095
1096
1097#ifdef _DEBUG
1098/*Debug*/
1099
1100#define HeapAlloc CheckHeapAlloc
1101#define HeapReAlloc CheckHeapReAlloc
1102LPVOID CheckHeapAlloc(HANDLE hHeap,DWORD dwFlags,DWORD dwBytes);
1103LPVOID CheckHeapReAlloc(HANDLE hHeap,DWORD dwFlags,LPVOID lpMem,DWORD dwBytes);
1104
1105#define DeleteObject CheckDeleteObject
1106BOOL CheckDeleteObject(HGDIOBJ hObject);
1107
1108#endif
Note: See TracBrowser for help on using the repository browser.