Debian Codegraph @

CodeLite/cl_command_event.cpp

raw
1 //////////////////////////////////////////////////////////////////////////////
2 //////////////////////////////////////////////////////////////////////////////
3 //
4 // copyright : (C) 2014 Eran Ifrah
5 // file name : cl_command_event.cpp
6 //
7 // -------------------------------------------------------------------------
8 // A
9 // _____ _ _ _ _
10 // / __ \ | | | | (_) |
11 // | / \/ ___ __| | ___| | _| |_ ___
12 // | | / _ \ / _ |/ _ \ | | | __/ _ )
13 // | \__/\ (_) | (_| | __/ |___| | || __/
14 // \____/\___/ \__,_|\___\_____/_|\__\___|
15 //
16 // F i l e
17 //
18 // This program is free software; you can redistribute it and/or modify
19 // it under the terms of the GNU General Public License as published by
20 // the Free Software Foundation; either version 2 of the License, or
21 // (at your option) any later version.
22 //
23 //////////////////////////////////////////////////////////////////////////////
24 //////////////////////////////////////////////////////////////////////////////
25
26 #include "cl_command_event.h"
27
28 clCommandEvent::clCommandEvent(wxEventType commandType, int winid)
29 : wxCommandEvent(commandType, winid)
30 , m_answer(false)
31 , m_allowed(true)
32 , m_lineNumber(0)
33 , m_selected(false)
34 {
35 }
36
37 clCommandEvent::clCommandEvent(const clCommandEvent& event)
38 : wxCommandEvent(event)
39 , m_answer(false)
40 , m_allowed(true)
41 {
42 *this = event;
43 }
44
45 clCommandEvent& clCommandEvent::operator=(const clCommandEvent& src)
46 {
47 m_strings.clear();
48 m_ptr = src.m_ptr;
49 for(size_t i = 0; i < src.m_strings.size(); ++i) {
50 m_strings.Add(src.m_strings.Item(i).c_str());
51 }
52 m_fileName = src.m_fileName;
53 m_answer = src.m_answer;
54 m_allowed = src.m_allowed;
55 m_oldName = src.m_oldName;
56 m_lineNumber = src.m_lineNumber;
57 m_selected = src.m_selected;
58
59 // Copy wxCommandEvent members here
60 m_eventType = src.m_eventType;
61 m_id = src.m_id;
62 m_cmdString = src.m_cmdString;
63 m_commandInt = src.m_commandInt;
64 m_extraLong = src.m_extraLong;
65 return *this;
66 }
67
68 clCommandEvent::~clCommandEvent() { m_ptr.reset(); }
69
70 wxEvent* clCommandEvent::Clone() const
71 {
72 clCommandEvent* new_event = new clCommandEvent(*this);
73 return new_event;
74 }
75
76 void clCommandEvent::SetClientObject(wxClientData* clientObject) { m_ptr = clientObject; }
77
78 wxClientData* clCommandEvent::GetClientObject() const { return m_ptr.get(); }
79
80 // ---------------------------------
81 // Code Completion event
82 // ---------------------------------
83 wxEvent* clCodeCompletionEvent::Clone() const
84 {
85 clCodeCompletionEvent* new_event = new clCodeCompletionEvent(*this);
86 return new_event;
87 }
88
89 clCodeCompletionEvent::clCodeCompletionEvent(const clCodeCompletionEvent& event)
90 : clCommandEvent(event)
91 , m_insideCommentOrString(false)
92 {
93 *this = event;
94 m_position = wxNOT_FOUND;
95 m_entry.reset(NULL);
96 }
97
98 clCodeCompletionEvent::clCodeCompletionEvent(wxEventType commandType, int winid)
99 : clCommandEvent(commandType, winid)
100 , m_insideCommentOrString(false)
101 {
102 m_position = wxNOT_FOUND;
103 m_entry.reset(NULL);
104 }
105
106 clCodeCompletionEvent::~clCodeCompletionEvent() {}
107
108 clCodeCompletionEvent& clCodeCompletionEvent::operator=(const clCodeCompletionEvent& src)
109 {
110 // Call parent operator =
111 clCommandEvent::operator=(src);
112 // Implement our copy c tor
113 m_word = src.m_word;
114 m_position = src.m_position;
115 m_tooltip = src.m_tooltip;
116 m_insideCommentOrString = src.m_insideCommentOrString;
117 m_entry = src.m_entry;
118 m_definitions = src.m_definitions;
119 m_entries = src.m_entries;
120 m_triggerKind = src.m_triggerKind;
121 m_classes = src.m_classes;
122 m_variables = src.m_variables;
123 return *this;
124 }
125
126 // ------------------------------------------------
127 // clColourEvent
128 // ------------------------------------------------
129
130 clColourEvent::clColourEvent(const clColourEvent& event) { *this = event; }
131
132 clColourEvent::clColourEvent(wxEventType commandType, int winid)
133 : clCommandEvent(commandType, winid)
134 #if wxUSE_GUI
135 , m_page(NULL)
136 #endif
137 , m_isActiveTab(false)
138 {
139 }
140
141 clColourEvent::~clColourEvent() {}
142
143 clColourEvent& clColourEvent::operator=(const clColourEvent& src)
144 {
145 // Call parent operator =
146 clCommandEvent::operator=(src);
147 #if wxUSE_GUI
148 m_bgColour = src.m_bgColour;
149 m_fgColour = src.m_fgColour;
150 m_page = src.m_page;
151 m_borderColour = src.m_borderColour;
152 #endif
153 m_isActiveTab = src.m_isActiveTab;
154 return *this;
155 }
156
157 // ------------------------------------------------
158 // clBuildEvent
159 // ------------------------------------------------
160
161 clBuildEvent::clBuildEvent(const clBuildEvent& event) { *this = event; }
162
163 clBuildEvent::clBuildEvent(wxEventType commandType, int winid)
164 : clCommandEvent(commandType, winid)
165 , m_projectOnly(false)
166 , m_warningCount(0)
167 , m_errorCount(0)
168 , m_isRunning(false)
169 {
170 }
171
172 clBuildEvent::~clBuildEvent() {}
173
174 clBuildEvent& clBuildEvent::operator=(const clBuildEvent& src)
175 {
176 // Call parent operator =
177 clCommandEvent::operator=(src);
178 m_projectName = src.m_projectName;
179 m_configurationName = src.m_configurationName;
180 m_command = src.m_command;
181 m_projectOnly = src.m_projectOnly;
182 m_errorCount = src.m_errorCount;
183 m_warningCount = src.m_warningCount;
184 m_kind = src.m_kind;
185 m_isRunning = src.m_isRunning;
186 m_cleanLog = src.m_cleanLog;
187 m_flags = src.m_flags;
188 m_toolchain = src.m_toolchain;
189 return *this;
190 }
191
192 // ------------------------------------------------------------------
193 // clDebugEvent
194 // ------------------------------------------------------------------
195 clDebugEvent::clDebugEvent(wxEventType commandType, int winid)
196 : clCommandEvent(commandType, winid)
197 , m_features(kAllFeatures)
198 , m_memoryBlockSize(32)
199 {
200 }
201
202 clDebugEvent::~clDebugEvent() {}
203
204 clDebugEvent::clDebugEvent(const clDebugEvent& event) { *this = event; }
205
206 clDebugEvent& clDebugEvent::operator=(const clDebugEvent& other)
207 {
208 clCommandEvent::operator=(other);
209 m_features = other.m_features;
210 m_debuggerName = other.m_debuggerName;
211 m_projectName = other.m_projectName;
212 m_configurationName = other.m_configurationName;
213 m_executableName =
214 other.m_executableName; // This will be set for wxEVT_DBG_UI_QUICK_DEBUG and wxEVT_DBG_UI_CORE_FILE
215 m_coreFile = other.m_coreFile; // wxEVT_DBG_UI_CORE_FILE
216 m_workingDirectory = other.m_workingDirectory; // wxEVT_DBG_UI_CORE_FILE, wxEVT_DBG_UI_QUICK_DEBUG
217 m_arguments = other.m_arguments; // wxEVT_DBG_UI_QUICK_DEBUG
218 m_startupCommands = other.m_startupCommands; // wxEVT_DBG_UI_QUICK_DEBUG
219 m_memoryBlockSize = other.m_memoryBlockSize;
220 m_memoryAddress = other.m_memoryAddress;
221 m_memoryBlockValue = other.m_memoryBlockValue;
222 m_breakpoints = other.m_breakpoints;
223 m_isSSHDebugging = other.m_isSSHDebugging;
224 m_sshAccount = other.m_sshAccount;
225 m_alternateDebuggerPath = other.m_alternateDebuggerPath;
226 m_uiBreakpoint = other.m_uiBreakpoint;
227 return *this;
228 }
229
230 //-------------------------------------------------------------------------
231 // clNewProjectEvent
232 //-------------------------------------------------------------------------
233
234 clNewProjectEvent::clNewProjectEvent(wxEventType commandType, int winid)
235 : clCommandEvent(commandType, winid)
236 {
237 }
238
239 clNewProjectEvent::clNewProjectEvent(const clNewProjectEvent& event) { *this = event; }
240
241 clNewProjectEvent::~clNewProjectEvent() {}
242
243 clNewProjectEvent& clNewProjectEvent::operator=(const clNewProjectEvent& other)
244 {
245 clCommandEvent::operator=(other);
246 m_templates = other.m_templates;
247 m_toolchain = other.m_toolchain;
248 m_debugger = other.m_debugger;
249 m_projectName = other.m_projectName;
250 m_projectFolder = other.m_projectFolder;
251 m_templateName = other.m_templateName;
252 return *this;
253 }
254
255 // --------------------------------------------------------------
256 // Compiler event
257 // --------------------------------------------------------------
258 clCompilerEvent::~clCompilerEvent() {}
259
260 clCompilerEvent::clCompilerEvent(const clCompilerEvent& event) { *this = event; }
261
262 clCompilerEvent::clCompilerEvent(wxEventType commandType, int winid)
263 : clCommandEvent(commandType, winid)
264 {
265 }
266
267 clCompilerEvent& clCompilerEvent::operator=(const clCompilerEvent& src)
268 {
269 clCommandEvent::operator=(src);
270 return *this;
271 }
272
273 // --------------------------------------------------------------
274 // Source formatting event
275 // --------------------------------------------------------------
276
277 clSourceFormatEvent::clSourceFormatEvent(const clSourceFormatEvent& event) { *this = event; }
278
279 clSourceFormatEvent::clSourceFormatEvent(wxEventType commandType, int winid)
280 : clCommandEvent(commandType, winid)
281 {
282 }
283
284 clSourceFormatEvent::~clSourceFormatEvent() {}
285
286 clSourceFormatEvent& clSourceFormatEvent::operator=(const clSourceFormatEvent& src)
287 {
288 clCommandEvent::operator=(src);
289 m_formattedString = src.m_formattedString;
290 m_inputString = src.m_inputString;
291 return *this;
292 }
293
294 //-------------------------------------------------------------------------
295 // clContextMenuEvent
296 //-------------------------------------------------------------------------
297
298 clContextMenuEvent::clContextMenuEvent(wxEventType commandType, int winid)
299 : clCommandEvent(commandType, winid)
300 #if wxUSE_GUI
301 , m_menu(NULL)
302 #endif
303 , m_editor(NULL)
304 {
305 }
306
307 clContextMenuEvent::clContextMenuEvent(const clContextMenuEvent& event) { *this = event; }
308 clContextMenuEvent& clContextMenuEvent::operator=(const clContextMenuEvent& src)
309 {
310 clCommandEvent::operator=(src);
311 m_editor = src.m_editor;
312 #if wxUSE_GUI
313 m_menu = src.m_menu;
314 #endif
315 m_path = src.m_path;
316 return *this;
317 }
318
319 clContextMenuEvent::~clContextMenuEvent() {}
320
321 //-------------------------------------------------------------------------
322 // clExecuteEvent
323 //-------------------------------------------------------------------------
324
325 clExecuteEvent::clExecuteEvent(const clExecuteEvent& event) { *this = event; }
326 clExecuteEvent::~clExecuteEvent() {}
327 clExecuteEvent& clExecuteEvent::operator=(const clExecuteEvent& src)
328 {
329 clCommandEvent::operator=(src);
330 m_targetName = src.m_targetName;
331 return *this;
332 }
333
334 clExecuteEvent::clExecuteEvent(wxEventType commandType, int winid)
335 : clCommandEvent(commandType, winid)
336 {
337 }
338
339 //------------------------------------------------------------------------
340 // clProjectSettingsEvent
341 //------------------------------------------------------------------------
342 clProjectSettingsEvent& clProjectSettingsEvent::operator=(const clProjectSettingsEvent& src)
343 {
344 clCommandEvent::operator=(src);
345 m_configName = src.m_configName;
346 m_projectName = src.m_projectName;
347 return *this;
348 }
349
350 clProjectSettingsEvent::clProjectSettingsEvent(const clProjectSettingsEvent& event) { *this = event; }
351
352 clProjectSettingsEvent::clProjectSettingsEvent(wxEventType commandType, int winid)
353 : clCommandEvent(commandType, winid)
354 {
355 }
356
357 clProjectSettingsEvent::~clProjectSettingsEvent() {}
358
359 //------------------------------------------------------------------------
360 // clFindEvent
361 //------------------------------------------------------------------------
362 clFindEvent& clFindEvent::operator=(const clFindEvent& src)
363 {
364 clCommandEvent::operator=(src);
365 m_ctrl = src.m_ctrl;
366 return *this;
367 }
368
369 clFindEvent::clFindEvent(const clFindEvent& event) { *this = event; }
370
371 clFindEvent::clFindEvent(wxEventType commandType, int winid)
372 : clCommandEvent(commandType, winid)
373 , m_ctrl(NULL)
374 {
375 }
376
377 clFindEvent::~clFindEvent() {}
378
379 //------------------------------------------------------------------------
380 // clFindInFilesEvent
381 //------------------------------------------------------------------------
382 clFindInFilesEvent& clFindInFilesEvent::operator=(const clFindInFilesEvent& src)
383 {
384 clCommandEvent::operator=(src);
385 m_paths = src.m_paths;
386 m_fileMask = src.m_fileMask;
387 m_options = src.m_options;
388 m_transientPaths = src.m_transientPaths;
389 m_matches = src.m_matches;
390 return *this;
391 }
392
393 clFindInFilesEvent::clFindInFilesEvent(const clFindInFilesEvent& event) { *this = event; }
394
395 clFindInFilesEvent::clFindInFilesEvent(wxEventType commandType, int winid)
396 : clCommandEvent(commandType, winid)
397 {
398 }
399
400 clFindInFilesEvent::~clFindInFilesEvent() {}
401
402 //------------------------------------------------------------------------
403 // clParseEvent
404 //------------------------------------------------------------------------
405
406 clParseEvent::clParseEvent(const clParseEvent& event) { *this = event; }
407
408 clParseEvent::clParseEvent(wxEventType commandType, int winid)
409 : clCommandEvent(commandType, winid)
410 , m_curfileIndex(0)
411 , m_totalFiles(0)
412 {
413 }
414
415 clParseEvent::~clParseEvent() {}
416
417 clParseEvent& clParseEvent::operator=(const clParseEvent& src)
418 {
419 clCommandEvent::operator=(src);
420 m_curfileIndex = src.m_curfileIndex;
421 m_totalFiles = src.m_totalFiles;
422 return *this;
423 }
424
425 //-------------------------------------------------------------------
426 // clProcessEvent
427 //-------------------------------------------------------------------
428
429 clProcessEvent::clProcessEvent(const clProcessEvent& event) { *this = event; }
430
431 clProcessEvent::clProcessEvent(wxEventType commandType, int winid)
432 : clCommandEvent(commandType, winid)
433 , m_process(NULL)
434 {
435 }
436
437 clProcessEvent::~clProcessEvent() {}
438
439 clProcessEvent& clProcessEvent::operator=(const clProcessEvent& src)
440 {
441 clCommandEvent::operator=(src);
442 m_process = src.m_process;
443 m_output = src.m_output;
444 return *this;
445 }
446
447 // --------------------------------------------------------------
448 // Compiler event
449 // --------------------------------------------------------------
450 clEditorConfigEvent::~clEditorConfigEvent() {}
451
452 clEditorConfigEvent::clEditorConfigEvent(const clEditorConfigEvent& event) { *this = event; }
453
454 clEditorConfigEvent::clEditorConfigEvent(wxEventType commandType, int winid)
455 : clCommandEvent(commandType, winid)
456 {
457 }
458
459 clEditorConfigEvent& clEditorConfigEvent::operator=(const clEditorConfigEvent& src)
460 {
461 clCommandEvent::operator=(src);
462 m_editorConfigSection = src.m_editorConfigSection;
463 return *this;
464 }
465
466 // --------------------------------------------------------------
467 // Goto Event
468 // --------------------------------------------------------------
469 clGotoEvent::clGotoEvent(wxEventType commandType, int winid)
470 : clCommandEvent(commandType, winid)
471 {
472 }
473
474 clGotoEvent::clGotoEvent(const clGotoEvent& src) { *this = src; }
475
476 clGotoEvent::~clGotoEvent() {}
477
478 clGotoEvent& clGotoEvent::operator=(const clGotoEvent& src)
479 {
480 if(this == &src) {
481 return *this;
482 }
483 clCommandEvent::operator=(src);
484 m_entries = src.m_entries;
485 m_entry = src.m_entry;
486 return *this;
487 }
488
489 // --------------------------------------------------------------
490 // Source control event
491 // --------------------------------------------------------------
492 clSourceControlEvent::clSourceControlEvent(wxEventType commandType, int winid)
493 : clCommandEvent(commandType, winid)
494 {
495 }
496
497 clSourceControlEvent::clSourceControlEvent(const clSourceControlEvent& event) { *this = event; }
498
499 clSourceControlEvent::~clSourceControlEvent() {}
500
501 wxEvent* clSourceControlEvent::Clone() const { return new clSourceControlEvent(*this); }
502
503 clSourceControlEvent& clSourceControlEvent::operator=(const clSourceControlEvent& src)
504 {
505 if(this == &src) {
506 return *this;
507 }
508 clCommandEvent::operator=(src);
509 m_sourceControlName = src.m_sourceControlName;
510 return *this;
511 }
512
513 // --------------------------------------------------------------
514 // Recent workspace event
515 // --------------------------------------------------------------
516 clRecentWorkspaceEvent::clRecentWorkspaceEvent(wxEventType commandType, int winid)
517 : clCommandEvent(commandType, winid)
518 {
519 }
520
521 clRecentWorkspaceEvent::clRecentWorkspaceEvent(const clRecentWorkspaceEvent& event) { *this = event; }
522
523 clRecentWorkspaceEvent::~clRecentWorkspaceEvent() {}
524
525 wxEvent* clRecentWorkspaceEvent::Clone() const { return new clRecentWorkspaceEvent(*this); }
526
527 clRecentWorkspaceEvent& clRecentWorkspaceEvent::operator=(const clRecentWorkspaceEvent& src)
528 {
529 if(this == &src) {
530 return *this;
531 }
532
533 clCommandEvent::operator=(src);
534 m_workspaces = src.m_workspaces;
535 return *this;
536 }
537
538 ///----------------------------------------------------------------------------------
539 /// clLanguageServerEvent
540 ///----------------------------------------------------------------------------------
541
542 clLanguageServerEvent::clLanguageServerEvent(wxEventType commandType, int winid)
543 : clCommandEvent(commandType, winid)
544 {
545 }
546
547 clLanguageServerEvent::clLanguageServerEvent(const clLanguageServerEvent& event) {}
548
549 clLanguageServerEvent::~clLanguageServerEvent() {}
550 clLanguageServerEvent& clLanguageServerEvent::operator=(const clLanguageServerEvent& src)
551 {
552 if(this == &src) {
553 return *this;
554 }
555 clCommandEvent::operator=(src);
556 m_lspName = src.m_lspName;
557 m_lspCommand = src.m_lspCommand;
558 m_flags = src.m_flags;
559 m_priority = src.m_priority;
560 m_connectionString = src.m_connectionString;
561 m_enviroment = src.m_enviroment;
562 m_initOptions = src.m_initOptions;
563 m_languages = src.m_languages;
564 m_action = src.m_action;
565 m_rootUri = src.m_rootUri;
566 return *this;
567 }
568
569 wxEvent* clLanguageServerEvent::Clone() const { return new clLanguageServerEvent(*this); }