Code::Blocks  SVN r11506
sdk_events.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of the Code::Blocks IDE and licensed under the GNU Lesser General Public License, version 3
3  * http://www.gnu.org/licenses/lgpl-3.0.html
4  *
5  * $Revision: 10502 $
6  * $Id: sdk_events.cpp 10502 2015-09-26 09:17:37Z fuscated $
7  * $HeadURL: https://svn.code.sf.net/p/codeblocks/code/trunk/src/sdk/sdk_events.cpp $
8  */
9 
10 #include "sdk_precomp.h"
11 
12 #ifndef CB_PRECOMP
13  #include "sdk_events.h"
14  #include "cbproject.h"
15  #include "editorbase.h"
16  #include "cbplugin.h"
17  #include "logmanager.h"
18 #endif
19 
20 
26 
27 
28 CodeBlocksLogEvent::CodeBlocksLogEvent(wxEventType commandType, Logger* logger_in, const wxString& title_in, wxBitmap *icon_in)
29  : wxEvent(wxID_ANY, commandType),
30  logger(logger_in), logIndex(-1), icon(icon_in), title(title_in), window(nullptr)
31 {
32  // special case for add
33  if (commandType == cbEVT_ADD_LOG_WINDOW && logger)
34  {
35  if (Manager::Get()->GetLogManager()->FindIndex(logger) == LogManager::invalid_log)
36  {
37  logIndex = Manager::Get()->GetLogManager()->SetLog(logger);
38  cbAssert(logIndex != LogManager::invalid_log);
39  Manager::Get()->GetLogManager()->Slot(logIndex).title = title;
40  Manager::Get()->GetLogManager()->Slot(logIndex).icon = icon;
41  return;
42  }
43  }
44 
45  logIndex = Manager::Get()->GetLogManager()->FindIndex(logger);
46 }
47 
48 CodeBlocksLogEvent::CodeBlocksLogEvent(wxEventType commandType, int logIndex_in, const wxString& title_in, wxBitmap *icon_in)
49  : wxEvent(wxID_ANY, commandType),
50  logger(nullptr), logIndex(logIndex_in), icon(icon_in), title(title_in), window(nullptr)
51 {
53 }
54 
55 CodeBlocksLogEvent::CodeBlocksLogEvent(wxEventType commandType, wxWindow* window_in, const wxString& title_in, wxBitmap *icon_in)
56  : wxEvent(wxID_ANY, commandType),
57  logger(nullptr), logIndex(-1), icon(icon_in), title(title_in), window(window_in)
58 {
59 }
60 
62  : wxEvent(wxID_ANY, rhs.GetEventType()), logger(rhs.logger), logIndex(rhs.logIndex), icon(rhs.icon), title(rhs.title), window(rhs.window)
63 {
64 }
65 
66 
67 // app events
73 // plugin events
79 // editor events
94 // project events
115 // build targets events
120 // pipedprocess events
124 // thread-pool events
128 // request app to dock/undock a window
133 // force update current view layout
135 // ask which is the current view layout
137 // request app to switch view layout
139 // app notifies that a new layout has been applied
141 // app notifies that a docked window has been hidden/shown
143 // app notifies that the menubar is started being (re)created
145 // app notifies that the menubar (re)creation ended
147 // compiler-related events
154 // request app to compile a single file
156 // debugger-related events
160 
161 // logger-related events
171 
172 //cbAUiNotebook related events
174 
175 // code-completion related events
178 
const wxEventType cbEVT_EDITOR_OPEN
Definition: sdk_events.cpp:81
const wxEventType cbEVT_EDITOR_SWITCHED
Definition: sdk_events.cpp:82
const wxEventType cbEVT_EDITOR_BEFORE_SAVE
Definition: sdk_events.cpp:85
const wxEventType cbEVT_PIPEDPROCESS_STDOUT
Definition: sdk_events.cpp:121
const wxEventType cbEVT_DEBUGGER_STARTED
Definition: sdk_events.cpp:157
const wxEventType cbEVT_DEBUGGER_FINISHED
Definition: sdk_events.cpp:159
const wxEventType cbEVT_REMOVE_DOCK_WINDOW
Definition: sdk_events.cpp:130
const wxEventType cbEVT_PLUGIN_LOADING_COMPLETE
Definition: sdk_events.cpp:78
const wxEventType cbEVT_COMPLETE_CODE
Definition: sdk_events.cpp:176
const wxEventType cbEVT_PROJECT_TARGETS_MODIFIED
Definition: sdk_events.cpp:108
const wxEventType cbEVT_UNLOCK_LOG_MANAGER
Definition: sdk_events.cpp:170
const wxEventType cbEVT_ADD_DOCK_WINDOW
Definition: sdk_events.cpp:129
wxWindow * window
A non-logger window. Needed at least by cbEVT_REMOVE_LOG_WINDOW.
Definition: sdk_events.h:196
const wxEventType cbEVT_THREADTASK_ENDED
Definition: sdk_events.cpp:126
const wxEventType cbEVT_REMOVE_LOG_WINDOW
Definition: sdk_events.cpp:163
static Manager * Get()
Use Manager::Get() to get a pointer to its instance Manager::Get() is guaranteed to never return an i...
Definition: manager.cpp:182
const wxEventType cbEVT_EDITOR_TOOLTIP
Definition: sdk_events.cpp:88
const wxEventType cbEVT_PROJECT_BEGIN_REMOVE_FILES
Definition: sdk_events.cpp:102
const wxEventType cbEVT_HIDE_LOG_WINDOW
Definition: sdk_events.cpp:164
const wxEventType cbEVT_WORKSPACE_CHANGED
Definition: sdk_events.cpp:111
const wxEventType cbEVT_CBAUIBOOK_LEFT_DCLICK
Definition: sdk_events.cpp:173
const wxEventType cbEVT_ADD_LOG_WINDOW
Definition: sdk_events.cpp:162
const wxEventType cbEVT_MENUBAR_CREATE_END
Definition: sdk_events.cpp:146
const wxEventType cbEVT_EDITOR_UNSPLIT
Definition: sdk_events.cpp:91
const wxEventType cbEVT_APP_STARTUP_DONE
Definition: sdk_events.cpp:68
const wxEventType cbEVT_SHOW_DOCK_WINDOW
Definition: sdk_events.cpp:131
const wxEventType cbEVT_SWITCHED_VIEW_LAYOUT
Definition: sdk_events.cpp:140
const wxEventType cbEVT_EDITOR_UPDATE_UI
Definition: sdk_events.cpp:92
size_t FindIndex(Logger *l)
Definition: logmanager.cpp:152
Event used to request from the main app to add a log.
Definition: sdk_events.h:182
Event used to request from the main app to add a window to the docking system.
Definition: sdk_events.h:83
CodeBlocksLogEvent(wxEventType commandType=wxEVT_NULL, Logger *logger=nullptr, const wxString &title=wxEmptyString, wxBitmap *icon=nullptr)
Definition: sdk_events.cpp:28
const wxEventType cbEVT_APP_ACTIVATED
Definition: sdk_events.cpp:70
const wxEventType cbEVT_COMPILE_FILE_REQUEST
Definition: sdk_events.cpp:155
The base class for all kinds of loggers, see loggers.h for its derived classes.
Definition: logger.h:23
const wxEventType cbEVT_QUERY_VIEW_LAYOUT
Definition: sdk_events.cpp:136
const wxEventType cbEVT_UPDATE_VIEW_LAYOUT
Definition: sdk_events.cpp:134
const wxEventType cbEVT_PROJECT_POPUP_MENU
Definition: sdk_events.cpp:107
const wxEventType cbEVT_DOCK_WINDOW_VISIBILITY
Definition: sdk_events.cpp:142
const wxEventType cbEVT_CLEAN_PROJECT_STARTED
Definition: sdk_events.cpp:151
const wxEventType cbEVT_BUILDTARGET_SELECTED
Definition: sdk_events.cpp:119
A generic Code::Blocks event.
Definition: sdk_events.h:20
const wxEventType cbEVT_APP_DEACTIVATED
Definition: sdk_events.cpp:71
const wxEventType cbEVT_SWITCH_VIEW_LAYOUT
Definition: sdk_events.cpp:138
const wxEventType cbEVT_PLUGIN_ATTACHED
Definition: sdk_events.cpp:74
const wxEventType cbEVT_PLUGIN_UNINSTALLED
Definition: sdk_events.cpp:77
const wxEventType cbEVT_HIDE_LOG_MANAGER
Definition: sdk_events.cpp:168
const wxEventType cbEVT_COMPILER_SETTINGS_CHANGED
Definition: sdk_events.cpp:153
const wxEventType cbEVT_PLUGIN_RELEASED
Definition: sdk_events.cpp:75
wxBitmap * icon
The logger's icon. Valid only for cbEVT_ADD_LOG_WINDOW.
Definition: sdk_events.h:194
const wxEventType cbEVT_PROJECT_ACTIVATE
Definition: sdk_events.cpp:99
const wxEventType cbEVT_BUILDTARGET_REMOVED
Definition: sdk_events.cpp:117
null_pointer_t nullptr
Definition: nullptr.cpp:16
const wxEventType cbEVT_EDITOR_MODIFIED
Definition: sdk_events.cpp:87
const wxEventType cbEVT_COMPILER_SET_BUILD_OPTIONS
Definition: sdk_events.cpp:150
const wxEventType cbEVT_THREADTASK_ALLDONE
Definition: sdk_events.cpp:127
IMPLEMENT_DYNAMIC_CLASS(cbDummyEditor, wxPGEditor)
LogManager * GetLogManager() const
Definition: manager.cpp:439
wxString title
Definition: logmanager.h:64
const wxEventType cbEVT_PROJECT_RENAMED
Definition: sdk_events.cpp:109
const wxEventType cbEVT_EDITOR_ACTIVATED
Definition: sdk_events.cpp:83
const wxEventType cbEVT_PROJECT_FILE_CHANGED
Definition: sdk_events.cpp:106
const wxEventType cbEVT_GET_ACTIVE_LOG_WINDOW
Definition: sdk_events.cpp:166
const wxEventType cbEVT_PROJECT_END_REMOVE_FILES
Definition: sdk_events.cpp:103
const wxEventType cbEVT_PIPEDPROCESS_TERMINATED
Definition: sdk_events.cpp:123
#define cbAssert(expr)
Definition: cbexception.h:48
const wxEventType cbEVT_WORKSPACE_CLOSING_BEGIN
Definition: sdk_events.cpp:113
wxString title
The logger's title. Valid only for cbEVT_ADD_LOG_WINDOW.
Definition: sdk_events.h:195
Logger * logger
The logger.
Definition: sdk_events.h:192
const wxEventType cbEVT_EDITOR_SAVE
Definition: sdk_events.cpp:86
const wxEventType cbEVT_COMPILER_FINISHED
Definition: sdk_events.cpp:149
const wxEventType cbEVT_PROJECT_FILE_ADDED
Definition: sdk_events.cpp:104
const wxEventType cbEVT_SETTINGS_CHANGED
Definition: sdk_events.cpp:179
const wxEventType cbEVT_PROJECT_FILE_REMOVED
Definition: sdk_events.cpp:105
const wxEventType cbEVT_HIDE_DOCK_WINDOW
Definition: sdk_events.cpp:132
const wxEventType cbEVT_PROJECT_OPTIONS_CHANGED
Definition: sdk_events.cpp:110
LogSlot & Slot(int i)
Definition: logmanager.cpp:147
const wxEventType cbEVT_PROJECT_END_ADD_FILES
Definition: sdk_events.cpp:101
const wxEventType cbEVT_COMPILER_STARTED
Definition: sdk_events.cpp:148
const wxEventType cbEVT_PIPEDPROCESS_STDERR
Definition: sdk_events.cpp:122
wxEventType wxNewEventType()
const wxEventType cbEVT_WORKSPACE_LOADING_COMPLETE
Definition: sdk_events.cpp:112
const wxEventType cbEVT_EDITOR_SPLIT
Definition: sdk_events.cpp:90
const wxEventType cbEVT_SHOW_CALL_TIP
Definition: sdk_events.cpp:177
Logger * GetLogger() const
Definition: logmanager.cpp:54
const wxEventType cbEVT_EDITOR_TOOLTIP_CANCEL
Definition: sdk_events.cpp:89
const wxEventType cbEVT_CLEAN_WORKSPACE_STARTED
Definition: sdk_events.cpp:152
const wxEventType cbEVT_PROJECT_SAVE
Definition: sdk_events.cpp:98
const wxEventType cbEVT_PROJECT_NEW
Definition: sdk_events.cpp:95
const wxEventType cbEVT_EDITOR_DEACTIVATED
Definition: sdk_events.cpp:84
const wxEventType cbEVT_WORKSPACE_CLOSING_COMPLETE
Definition: sdk_events.cpp:114
const wxEventType cbEVT_SHOW_LOG_MANAGER
Definition: sdk_events.cpp:167
int wxEventType
const wxEventType cbEVT_APP_START_SHUTDOWN
Definition: sdk_events.cpp:69
const wxEventType cbEVT_LOCK_LOG_MANAGER
Definition: sdk_events.cpp:169
const wxEventType cbEVT_SWITCH_TO_LOG_WINDOW
Definition: sdk_events.cpp:165
int logIndex
The logger's index.
Definition: sdk_events.h:193
const wxEventType cbEVT_EDITOR_CLOSE
Definition: sdk_events.cpp:80
const wxEventType cbEVT_PLUGIN_INSTALLED
Definition: sdk_events.cpp:76
const wxEventType cbEVT_EDITOR_CC_DONE
Definition: sdk_events.cpp:93
const wxEventType cbEVT_BUILDTARGET_RENAMED
Definition: sdk_events.cpp:118
const wxEventType cbEVT_MENUBAR_CREATE_BEGIN
Definition: sdk_events.cpp:144
const wxEventType cbEVT_BUILDTARGET_ADDED
Definition: sdk_events.cpp:116
size_t SetLog(Logger *l, int index=no_index)
Definition: logmanager.cpp:110
const wxEventType cbEVT_PROJECT_CLOSE
Definition: sdk_events.cpp:96
wxBitmap * icon
Definition: logmanager.h:63
const wxEventType cbEVT_APP_CMDLINE
Definition: sdk_events.cpp:72
const wxEventType cbEVT_DEBUGGER_PAUSED
Definition: sdk_events.cpp:158
const wxEventType cbEVT_PROJECT_BEGIN_ADD_FILES
Definition: sdk_events.cpp:100
const wxEventType cbEVT_PROJECT_OPEN
Definition: sdk_events.cpp:97
Event used to request from the main app to manage the view layouts.
Definition: sdk_events.h:158
const wxEventType cbEVT_THREADTASK_STARTED
Definition: sdk_events.cpp:125