Ticket #199: 199-4.patch
File 199-4.patch, 20.4 KB (added by , 18 years ago) |
---|
-
src/apps/terminal/TermWindow.cpp
27 27 #include "CodeConv.h" 28 28 #include "ColorWindow.h" 29 29 #include "MenuUtil.h" 30 #include "FindDlg.h" 30 31 #include "PrefDlg.h" 31 32 #include "PrefView.h" 32 33 #include "PrefHandler.h" … … 173 174 fTermParse->InitTermParse(fTermView, fCodeConv); 174 175 175 176 // Set Coding. 177 178 // Init find parameters 179 fMatchCase = false; 180 fMatchWord = false; 176 181 177 182 // Initialize MessageRunner. 178 183 fWindowUpdate = new BMessageRunner(BMessenger(this), … … 219 224 fEditmenu->AddSeparatorItem (); 220 225 fEditmenu->AddItem (new BMenuItem ("Select All", new BMessage (B_SELECT_ALL), 'A')); 221 226 fEditmenu->AddItem (new BMenuItem ("Clear All", new BMessage (MENU_CLEAR_ALL), 'L')); 227 fEditmenu->AddSeparatorItem (); 228 fEditmenu->AddItem (new BMenuItem ("Find", new BMessage (MENU_FIND_STRING),'F')); 229 fFindBackwardMenuItem = new BMenuItem ("Find Backward", new BMessage (MENU_FIND_BACKWARD), '['); 230 fEditmenu->AddItem (fFindBackwardMenuItem); 231 fFindBackwardMenuItem->SetEnabled(false); 232 fFindForwardMenuItem = new BMenuItem ("Find Forward", new BMessage (MENU_FIND_FORWARD), ']'); 233 fEditmenu->AddItem (fFindForwardMenuItem); 234 fFindForwardMenuItem->SetEnabled(false); 235 222 236 223 /*224 // TODO: Implement Finding225 fEditmenu->AddSeparatorItem ();226 fEditmenu->AddItem (new BMenuItem ("Find", new BMessage (MENU_FIND_STRING),'F'));227 fEditmenu->AddItem (new BMenuItem ("Find Again", new BMessage (MENU_FIND_AGAIN), ']'));228 */229 237 fMenubar->AddItem (fEditmenu); 230 238 231 239 // Make Help Menu. … … 277 285 BRect r; 278 286 BFont halfFont; 279 287 BFont fullFont; 288 bool findselection, forwardsearch, findresult; 280 289 281 290 switch (message->what) { 282 291 case MENU_SWITCH_TERM: { … … 303 312 fPrefWindow = NULL; 304 313 break; 305 314 } 315 case MENU_FIND_STRING: { 316 if (!fFindPanel) { 317 BRect r = Frame(); 318 r.left += 20; 319 r.top += 20; 320 r.right = r.left + 260; 321 r.bottom = r.top + 190; 322 fFindPanel = new FindDlg(r, this); 323 } 324 else 325 fFindPanel->Activate(); 326 break; 327 } 328 case MSG_FIND: { 329 fFindPanel->PostMessage(B_QUIT_REQUESTED); 330 message->FindBool("findselection", &findselection); 331 if (!findselection) 332 message->FindString("findstring", &fFindString); 333 else 334 fTermView->GetSelection(fFindString); 335 336 if (fFindString.Length() == 0) { 337 BAlert *alert = new BAlert("find failed", "No search string.", "Okay", NULL, 338 NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); 339 alert->Go(); 340 fFindBackwardMenuItem->SetEnabled(false); 341 fFindForwardMenuItem->SetEnabled(false); 342 break; 343 } 344 345 message->FindBool("forwardsearch", &forwardsearch); 346 message->FindBool("matchcase", &fMatchCase); 347 message->FindBool("matchword", &fMatchWord); 348 findresult = fTermView->Find(fFindString, forwardsearch, fMatchCase, fMatchWord); 349 350 if (!findresult) { 351 BAlert *alert = new BAlert("find failed", "Not Found.", "Okay", NULL, 352 NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); 353 alert->Go(); 354 fFindBackwardMenuItem->SetEnabled(false); 355 fFindForwardMenuItem->SetEnabled(false); 356 break; 357 } 358 359 //Enable the menu items Find Forward and Find Backward 360 fFindBackwardMenuItem->SetEnabled(true); 361 fFindForwardMenuItem->SetEnabled(true); 362 break; 363 } 364 case MENU_FIND_FORWARD: { 365 findresult = fTermView->Find(fFindString, true, fMatchCase, fMatchWord); 366 if (!findresult) { 367 BAlert *alert = new BAlert("find failed", "Not Found.", "Okay", NULL, 368 NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); 369 alert->Go(); 370 } 371 break; 372 } 373 case MENU_FIND_BACKWARD: { 374 findresult = fTermView->Find(fFindString, false, fMatchCase, fMatchWord); 375 if (!findresult) { 376 BAlert *alert = new BAlert("find failed", "Not Found.", "Okay", NULL, 377 NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); 378 alert->Go(); 379 } 380 break; 381 } 382 case MSG_FIND_CLOSED: { 383 fFindPanel = NULL; 384 break; 385 } 306 386 case MENU_FILE_QUIT: { 307 387 be_app->PostMessage(B_QUIT_REQUESTED); 308 388 break; … … 522 602 { 523 603 delete fTermParse; 524 604 delete fCodeConv; 525 if(fPrefWindow) fPrefWindow->PostMessage (B_QUIT_REQUESTED); 526 be_app->PostMessage (B_QUIT_REQUESTED, be_app); 605 if (fPrefWindow) fPrefWindow->PostMessage (B_QUIT_REQUESTED); 606 if (fFindPanel) fFindPanel->PostMessage(B_QUIT_REQUESTED); 607 608 be_app->PostMessage (B_QUIT_REQUESTED, be_app); 527 609 BWindow::Quit (); 528 610 } 529 611 -
src/apps/terminal/TermBuffer.cpp
103 103 mRowSize = rows; 104 104 105 105 mRowOffset = 0; 106 107 mSelStart.Set(-1,-1); 108 mSelEnd.Set(-1,-1); 106 109 107 110 buffer_size = gTermPref->getInt32(PREF_HISTORY_SIZE); 108 111 if (buffer_size < 1000) … … 544 547 } 545 548 } 546 549 550 //Returns the complete internal buffer as a BString 551 void 552 TermBuffer::ToString(BString &str) 553 { 554 int rows = mRowSize + mRowOffset; 555 for (int y = 0; y < rows; y++) { 556 for (int x = 0; x < mNowColSize; x++) { 557 GetCharFromRegion(x, y, str); 558 } 559 } 560 AvoidWaste(str); 561 } 562 No newline at end of file -
src/apps/terminal/TermView.cpp
22 22 23 23 #include <string.h> 24 24 #include <stdlib.h> 25 #include <ctype.h> 25 26 26 27 #include "TermView.h" 27 28 #include "TermWindow.h" … … 2248 2249 *height = fFontHeight; 2249 2250 } 2250 2251 2252 // Find a string, and select it if found 2253 bool 2254 TermView::Find (const BString &str, bool forwardSearch, bool matchCase, bool matchWord) 2255 { 2256 BString buffer; 2257 CurPos selectionstart, selectionend; 2258 int offset = 0; 2259 int initialresult = -1; 2260 int result = B_ERROR; 2261 2262 //Get the buffer contents 2263 fTextBuffer->ToString(buffer); 2264 2265 selectionstart = fTextBuffer->GetSelectionStart(); 2266 selectionend = fTextBuffer->GetSelectionEnd(); 2267 2268 if (selectionstart.x >= 0 || selectionstart.y >= 0) { 2269 if (forwardSearch) 2270 //Set the offset to the end of the selection 2271 offset = (selectionend.y) * fTermColumns + selectionend.x; 2272 else 2273 offset = (selectionstart.y) * fTermColumns + selectionstart.x; 2274 } 2275 2276 restart: 2277 //Actual search 2278 if (forwardSearch) { 2279 if (matchCase) { 2280 result = buffer.FindFirst(str, offset); 2281 } else { 2282 result = buffer.IFindFirst(str, offset); 2283 } 2284 } else { 2285 if (matchCase) { 2286 result = buffer.FindLast(str, offset); 2287 } else { 2288 result = buffer.IFindLast(str, offset); 2289 } 2290 } 2291 if (result == B_ERROR) { //Wrap search like Be's Terminal 2292 if (forwardSearch) { 2293 if (matchCase) { 2294 result = buffer.FindFirst(str, 0); 2295 } else { 2296 result = buffer.IFindFirst(str, 0); 2297 } 2298 } else { 2299 if (matchCase) { 2300 result = buffer.FindLast(str, buffer.Length()); 2301 } else { 2302 result = buffer.IFindLast(str, buffer.Length()); 2303 } 2304 } 2305 } 2306 2307 if (result < 0) 2308 return false; 2309 2310 if (matchWord) { 2311 if (isalnum(buffer.ByteAt(result - 1)) || isalnum(buffer.ByteAt(result + str.Length()))) { 2312 if (initialresult == -1) //Set the initial offset to the first result to aid word matching 2313 initialresult = result; 2314 else if (initialresult == result) //We went round the buffer, nothing found 2315 return false; 2316 if (forwardSearch) 2317 offset = result + str.Length(); 2318 else 2319 offset = result; 2320 goto restart; 2321 } 2322 } 2323 2324 //Select the found text 2325 selectionstart.y = result / fTermColumns; 2326 selectionstart.x = result % fTermColumns; 2327 //Length -1 since it seems to count the \0 as well 2328 selectionend.y = (result + str.Length() - 1) / fTermColumns; 2329 selectionend.x = (result + str.Length() - 1) % fTermColumns; 2330 //Update the contents of the view 2331 DeSelect(); 2332 Select(selectionstart, selectionend); 2333 //Scroll if the position is out of reach 2334 float viewposition = selectionstart.y * fCursorHeight; 2335 if (Bounds().top > viewposition || Bounds().bottom < (viewposition + fCursorHeight) ) 2336 ScrollTo(0, selectionstart.y * fCursorHeight); 2337 2338 return true; 2339 } 2340 2341 //! Get the selected text and copy to str 2342 void 2343 TermView::GetSelection(BString &str) 2344 { 2345 str.SetTo(""); 2346 fTextBuffer->GetStringFromRegion(str); 2347 } 2348 2251 2349 // Send DrawRect data to Draw Engine thread. 2252 2350 inline void 2253 2351 TermView::SendDataToDrawEngine(int x1, int y1, int x2, int y2) -
src/apps/terminal/Changelog
13 13 Terminal window supports scrolling 14 14 15 15 TODO: 16 Make a Jamfile17 Make Find work18 16 Fix titling (-t works already, its the Terminal 1, 2, 3, etc...) 19 17 Fix the Colour menu 20 18 Move Fonts and font sizes to the "Right Place" 21 19 Kill the Preferences Panel 22 Move to .rdef source resources -
src/apps/terminal/FindDlg.h
33 33 #include <Window.h> 34 34 #include <TextView.h> 35 35 36 #include "CurPos.h" 37 36 const ulong MSG_FIND = 'msgf'; 38 37 const ulong MSG_FIND_START = 'msac'; 38 const ulong MSG_FIND_CLOSED = 'mfcl'; 39 39 40 40 class BRect; 41 41 class BBitmap; 42 42 class BMessage; 43 43 class TermWindow; 44 class BTextControl; 45 class BRadioButton; 46 class BCheckBox; 44 47 45 48 class FindDlg : public BWindow 46 49 { 47 50 public: 48 FindDlg(BRect frame, TermWindow *win);49 51 FindDlg (BRect frame, TermWindow *win); 52 ~FindDlg (); 50 53 51 void Find (CurPos *start, CurPos *end); 54 private: 55 virtual void Quit (void); 56 void MessageReceived (BMessage *msg); 52 57 53 private: 54 virtual void Quit (void); 55 56 BString *fFindString; 57 TermWindow *fWindow; 58 void SendFindMessage (void); 58 59 60 BView *fFindView; 61 BTextControl *fFindLabel; 62 BRadioButton *fTextRadio; 63 BRadioButton *fSelectionRadio; 64 BBox *fSeparator; 65 BCheckBox *fForwardSearchBox; 66 BCheckBox *fMatchCaseBox; 67 BCheckBox *fMatchWordBox; 68 BButton *fFindButton; 69 70 BString *fFindString; 71 TermWindow *fWindow; 59 72 }; 60 73 61 74 -
src/apps/terminal/ShellPrefView.cpp
22 22 #include "TermBuffer.h" 23 23 #include "TermConst.h" 24 24 #include "MenuUtil.h" 25 #include "TTextControl.h"26 25 27 26 28 27 extern PrefHandler *gTermPref; -
src/apps/terminal/Jamfile
7 7 AppearPrefView.cpp 8 8 CodeConv.cpp 9 9 CurPos.cpp 10 FindDlg.cpp 10 11 MenuUtil.cpp 11 12 Terminal.cpp 12 13 PrefDlg.cpp -
src/apps/terminal/TermWindow.h
87 87 BMenuItem *item; 88 88 BRect fSavedFrame; 89 89 window_look fSavedLook; 90 //Saved search parameters 91 BString fFindString; 92 BMenuItem *fFindForwardMenuItem; 93 BMenuItem *fFindBackwardMenuItem; 94 bool fMatchCase; 95 bool fMatchWord; 90 96 }; 91 97 92 98 #endif // TERMWIN_H -
src/apps/terminal/ColorWindow.cpp
44 44 #include "TermView.h" 45 45 #include "TermBuffer.h" 46 46 #include "MenuUtil.h" 47 #include "TTextControl.h"48 47 49 48 50 49 -
src/apps/terminal/TermBuffer.h
95 95 // 96 96 void ClearAll (void); 97 97 98 // Set / Unset Selection 98 // 99 // Selection Methods 100 // 99 101 void Select (const CurPos &start, const CurPos &end); 100 102 void DeSelect (void); 103 104 const CurPos &GetSelectionStart (void) { return mSelStart; }; 105 const CurPos &GetSelectionEnd (void) { return mSelEnd; }; 101 106 102 107 int CheckSelectedRegion (const CurPos &pos); 108 109 // 110 // Other methods 111 // 103 112 bool FindWord (const CurPos &pos, CurPos *start, CurPos *end); 104 113 105 114 void GetCharFromRegion (int x, int y, BString &str); 106 115 void AvoidWaste (BString &str); 116 117 void ToString (BString &str); 107 118 108 119 int32 GetArraySize (void); 109 120 -
src/apps/terminal/FindDlg.cpp
31 31 #include <Window.h> 32 32 #include <Rect.h> 33 33 #include <TextControl.h> 34 #include <Box.h> 35 #include <CheckBox.h> 34 36 #include <Button.h> 37 #include <RadioButton.h> 35 38 #include <Message.h> 36 39 #include <stdio.h> 37 40 #include <File.h> 38 41 #include <String.h> 39 42 43 #include "TermWindow.h" 40 44 #include "FindDlg.h" 41 45 #include "TermApp.h" 42 46 #include "MenuUtil.h" … … 44 48 45 49 // message define 46 50 47 const uint32 FPANEL_HIDE = 'Fhid';51 const uint32 MSG_FIND_HIDE = 'Fhid'; 48 52 49 53 ////////////////////////////////////////////////////////////////////////////// 50 54 // FindDlg 51 55 // Constructer 52 56 ////////////////////////////////////////////////////////////////////////////// 53 57 FindDlg::FindDlg (BRect frame, TermWindow *win) 54 55 58 : BWindow(frame, "Find", 59 B_FLOATING_WINDOW, B_NOT_RESIZABLE|B_NOT_ZOOMABLE) 56 60 { 57 PrefHandler title;58 LoadLocaleFile (&title);61 fWindow = win; 62 SetTitle("Find"); 59 63 60 fWindow = win; 61 this->SetTitle (title.getString ("Find")); 64 AddShortcut ((ulong)'W', (ulong)B_COMMAND_KEY, new BMessage (MSG_FIND_HIDE)); 62 65 63 AddShortcut ((ulong)'Q', (ulong)B_COMMAND_KEY, new BMessage (FPANEL_HIDE)); 64 AddShortcut ((ulong)'W', (ulong)B_COMMAND_KEY, new BMessage (FPANEL_HIDE)); 66 //Build up view 67 fFindView = new BView(Bounds(), "FindView", B_FOLLOW_ALL, B_WILL_DRAW); 68 fFindView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); 69 AddChild(fFindView); 65 70 66 BRect r (10, 10, 120, 20); 67 68 BTextControl *text_ctl = new BTextControl (r, "text", NULL, NULL, NULL); 69 AddChild (text_ctl); 71 font_height height; 72 fFindView->GetFontHeight(&height); 73 float lineHeight = height.ascent + height.descent + height.leading; 70 74 71 r.Set (100, 40, 130, 60); 72 BButton *button = new BButton (r, NULL, "Find", new BMessage (MSG_FIND_START)); 73 AddChild (button); 74 75 //These labels are from the bottom up 76 float buttonsTop = frame.Height() - 19 - lineHeight; 77 float matchwordBottom = buttonsTop - 4; 78 float matchwordTop = matchwordBottom - lineHeight - 8; 79 float matchcaseBottom = matchwordTop - 4; 80 float matchcaseTop = matchcaseBottom - lineHeight - 8; 81 float forwardsearchBottom = matchcaseTop - 4; 82 float forwardsearchTop = forwardsearchBottom - lineHeight - 8; 83 84 //These things are calculated from the top 85 float textRadioTop = 12; 86 float textRadioBottom = textRadioTop + 2 + lineHeight + 2 + 1; 87 float textRadioRight = fFindView->StringWidth("Use Text: ") + 30; 88 float selectionRadioTop = textRadioBottom + 4; 89 float selectionRadioBottom = selectionRadioTop + lineHeight + 8; 90 91 //Divider 92 float dividerHeight = (selectionRadioBottom + forwardsearchTop) / 2; 93 94 //Button Coordinates 95 float searchbuttonLeft = (frame.Width() - fFindView->StringWidth("Find") - 60) / 2; 96 float searchbuttonRight = searchbuttonLeft + fFindView->StringWidth("Find") + 60; 97 98 //Build the Views 99 fTextRadio = new BRadioButton(BRect(14, textRadioTop, textRadioRight, textRadioBottom), 100 "fTextRadio", "Use Text: ", NULL); 101 fFindView->AddChild(fTextRadio); 102 fTextRadio->SetValue(1); //enable first option 103 104 fFindLabel = new BTextControl(BRect(textRadioRight + 4, textRadioTop, frame.Width() - 14, textRadioBottom), 105 "fFindLabel", "", "", NULL); 106 fFindLabel->SetDivider(0); 107 fFindView->AddChild(fFindLabel); 108 fFindLabel->MakeFocus(true); 109 110 fSelectionRadio = new BRadioButton(BRect(14, selectionRadioTop, frame.Width() - 14, selectionRadioBottom), 111 "fSelectionRadio", "Use Selection", NULL); 112 fFindView->AddChild(fSelectionRadio); 113 114 fSeparator = new BBox(BRect(6, dividerHeight, frame.Width() - 6, dividerHeight + 1)); 115 fFindView->AddChild(fSeparator); 116 117 fForwardSearchBox = new BCheckBox(BRect(14, forwardsearchTop, frame.Width() - 14, forwardsearchBottom), 118 "fForwardSearchBox", "Search Forward", NULL); 119 fFindView->AddChild(fForwardSearchBox); 120 121 fMatchCaseBox = new BCheckBox(BRect(14, matchcaseTop, frame.Width() - 14, matchcaseBottom), 122 "fMatchCaseBox", "Match Case", NULL); 123 fFindView->AddChild(fMatchCaseBox); 124 125 fMatchWordBox = new BCheckBox(BRect(14, matchwordTop, frame.Width() - 14, matchwordBottom), 126 "fMatchWordBox", "Match Word", NULL); 127 fFindView->AddChild(fMatchWordBox); 128 129 fFindButton = new BButton(BRect(searchbuttonLeft, buttonsTop, searchbuttonRight, frame.Height() - 14), 130 "fFindButton", "Find", new BMessage(MSG_FIND)); 131 fFindButton->MakeDefault(true); 132 fFindView->AddChild(fFindButton); 133 134 Show(); 75 135 } 76 136 77 137 FindDlg::~FindDlg (void) … … 80 140 } 81 141 82 142 void 143 FindDlg::MessageReceived (BMessage *msg) 144 { 145 switch (msg->what) { 146 case B_QUIT_REQUESTED: 147 Quit(); 148 break; 149 case MSG_FIND: 150 SendFindMessage(); 151 break; 152 case MSG_FIND_HIDE: 153 Quit(); 154 break; 155 default: 156 BWindow::MessageReceived(msg); 157 break; 158 } 159 } 160 161 void 83 162 FindDlg::Quit (void) 84 163 { 85 BWindow::Quit (); 164 fWindow->PostMessage(MSG_FIND_CLOSED); 165 BWindow::Quit (); 86 166 } 87 167 168 void 169 FindDlg::SendFindMessage (void) 170 { 171 BMessage message(MSG_FIND); 172 173 if (fTextRadio->Value() == B_CONTROL_ON) { 174 message.AddString("findstring", fFindLabel->Text()); 175 message.AddBool("findselection", false); 176 } else 177 message.AddBool("findselection", true); 178 179 //Add the other parameters 180 message.AddBool("usetext", fTextRadio->Value() == B_CONTROL_ON); 181 message.AddBool("forwardsearch", fForwardSearchBox->Value() == B_CONTROL_ON); 182 message.AddBool("matchcase", fMatchCaseBox->Value() == B_CONTROL_ON); 183 message.AddBool("matchword", fMatchWordBox->Value() == B_CONTROL_ON); 184 185 fWindow->PostMessage(&message); 186 } -
src/apps/terminal/TermView.h
184 184 void ScrollScreenDraw (void); 185 185 void GetFrameSize (float *width, float *height); 186 186 void GetFontInfo (int *, int*); 187 bool Find (const BString &str, bool forwardSearch, bool matchCase, bool matchWord); 188 void GetSelection (BString &str); 189 187 190 188 191 /* 189 192 * PRIVATE MEMBER. -
src/apps/terminal/Constants.h
1 /*Terminal: constants*/2 #ifndef CONSTANTS_H3 #define CONSTANTS_H4 5 #include <GraphicsDefs.h>6 #include <SupportDefs.h>7 8 #define APP_SIGNATURE "application/x-vnd.obos.terminal"9 10 const float TEXT_INSET = 3.0;11 12 // Application messages13 14 const uint32 OPEN_TERMINAL ='OTRM';15 16 // Messages for menu commands17 18 // Terminal19 const uint32 TERMINAL_SWITCH_TERMINAL ='TSWT';20 const uint32 TERMINAL_START_NEW_TERMINAL='TSNT';21 const uint32 TERMINAL_LOG_TO_FILE ='TLTF';22 // Edit23 const uint32 EDIT_WRITE_SELECTION ='EWSL';24 const uint32 EDIT_CLEAR_ALL ='ECLA';25 const uint32 EDIT_FIND ='EFND';26 const uint32 EDIT_FIND_BACKWARD ='EFBK';27 const uint32 EDIT_FIND_FORWARD ='EFFD';28 // Settings29 const uint32 SETTINGS_WINDOW_SIZE ='SWSZ';30 const uint32 SETTINGS_FONT ='SFNT';31 const uint32 SETTINGS_FONT_SIZE ='SFSZ';32 const uint32 SETTINGS_FONT_ENCODING ='SFEN';33 const uint32 SETTINGS_TAB_WIDTH ='STBW';34 const uint32 SETTINGS_COLOR ='SCLR';35 const uint32 SETTINGS_SAVE_AS_DEFAULT ='SSAD';36 const uint32 SETTINGS_SAVE_AS_SETTINGS ='SSAS';37 38 // Edit menu toggle39 const uint32 ENABLE_ITEMS ='EDON';40 const uint32 DISABLE_ITEMS ='EDOF';41 42 #endif // CONSTANTS_H -
src/apps/terminal/TermConst.h
63 63 const uint32 MENU_PAGE_SETUP = 'Mpst'; 64 64 const uint32 MENU_PRINT = 'Mpnt'; 65 65 const uint32 MENU_FIND_STRING = 'Mfnd'; 66 const uint32 MENU_FIND_AGAIN = 'Mfag'; 66 const uint32 MENU_FIND_FORWARD = 'Mffw'; 67 const uint32 MENU_FIND_BACKWARD = 'Mfbw'; 67 68 const uint32 MENU_SHOW_COLOR = 'Mcol'; 68 69 69 70 const uint32 M_GET_DEVICE_NUM = 'Mgdn';