~ubuntu-branches/ubuntu/hardy/codeblocks/hardy-backports

« back to all changes in this revision

Viewing changes to src/sdk/sdk_events.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Michael Casadevall
  • Date: 2008-07-17 04:39:23 UTC
  • Revision ID: james.westby@ubuntu.com-20080717043923-gmsy5cwkdjswghkm
Tags: upstream-8.02
ImportĀ upstreamĀ versionĀ 8.02

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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: 4909 $
 
6
 * $Id: sdk_events.cpp 4909 2008-02-27 13:15:26Z mortenmacfly $
 
7
 * $HeadURL: svn://svn.berlios.de/codeblocks/tags/8.02/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
 
 
21
IMPLEMENT_DYNAMIC_CLASS(CodeBlocksEvent, wxEvent)
 
22
IMPLEMENT_DYNAMIC_CLASS(CodeBlocksDockEvent, wxEvent)
 
23
IMPLEMENT_DYNAMIC_CLASS(CodeBlocksLayoutEvent, wxEvent)
 
24
IMPLEMENT_DYNAMIC_CLASS(CodeBlocksLogEvent, wxEvent)
 
25
 
 
26
 
 
27
CodeBlocksLogEvent::CodeBlocksLogEvent(wxEventType commandType, Logger* logger, const wxString& title, wxBitmap *icon)
 
28
        : wxEvent(wxID_ANY, commandType),
 
29
        logger(logger), logIndex(-1), icon(icon), title(title), window(0)
 
30
{
 
31
        // special case for add
 
32
        if (commandType == cbEVT_ADD_LOG_WINDOW && logger)
 
33
        {
 
34
                if (Manager::Get()->GetLogManager()->FindIndex(logger) == LogManager::invalid_log)
 
35
                {
 
36
                        logIndex = Manager::Get()->GetLogManager()->SetLog(logger);
 
37
                        cbAssert(logIndex != LogManager::invalid_log);
 
38
                        Manager::Get()->GetLogManager()->Slot(logIndex).title = title;
 
39
                        Manager::Get()->GetLogManager()->Slot(logIndex).icon = icon;
 
40
                        return;
 
41
                }
 
42
        }
 
43
 
 
44
        logIndex = Manager::Get()->GetLogManager()->FindIndex(logger);
 
45
}
 
46
 
 
47
CodeBlocksLogEvent::CodeBlocksLogEvent(wxEventType commandType, int logIndex, const wxString& title, wxBitmap *icon)
 
48
        : wxEvent(wxID_ANY, commandType),
 
49
        logger(0), logIndex(logIndex), icon(icon), title(title), window(0)
 
50
{
 
51
        logger = Manager::Get()->GetLogManager()->Slot(logIndex).GetLogger();
 
52
}
 
53
 
 
54
CodeBlocksLogEvent::CodeBlocksLogEvent(wxEventType commandType, wxWindow* window, const wxString& title, wxBitmap *icon)
 
55
        : wxEvent(wxID_ANY, commandType),
 
56
        logger(0), logIndex(-1), icon(icon), title(title), window(window)
 
57
{
 
58
}
 
59
 
 
60
CodeBlocksLogEvent::CodeBlocksLogEvent(const CodeBlocksLogEvent& rhs)
 
61
        : logger(rhs.logger), logIndex(rhs.logIndex), icon(rhs.icon), title(rhs.title), window(rhs.window)
 
62
{
 
63
}
 
64
 
 
65
 
 
66
// app events
 
67
const wxEventType cbEVT_APP_STARTUP_DONE = wxNewEventType();
 
68
const wxEventType cbEVT_APP_START_SHUTDOWN = wxNewEventType();
 
69
// plugin events
 
70
const wxEventType cbEVT_PLUGIN_ATTACHED = wxNewEventType();
 
71
const wxEventType cbEVT_PLUGIN_RELEASED = wxNewEventType();
 
72
const wxEventType cbEVT_PLUGIN_INSTALLED = wxNewEventType();
 
73
const wxEventType cbEVT_PLUGIN_UNINSTALLED = wxNewEventType();
 
74
// editor events
 
75
const wxEventType cbEVT_EDITOR_CLOSE = wxNewEventType();
 
76
const wxEventType cbEVT_EDITOR_OPEN = wxNewEventType();
 
77
const wxEventType cbEVT_EDITOR_ACTIVATED = wxNewEventType();
 
78
const wxEventType cbEVT_EDITOR_DEACTIVATED = wxNewEventType();
 
79
const wxEventType cbEVT_EDITOR_SAVE = wxNewEventType();
 
80
const wxEventType cbEVT_EDITOR_MODIFIED = wxNewEventType();
 
81
const wxEventType cbEVT_EDITOR_TOOLTIP = wxNewEventType();
 
82
const wxEventType cbEVT_EDITOR_TOOLTIP_CANCEL = wxNewEventType();
 
83
const wxEventType cbEVT_EDITOR_BREAKPOINT_ADD = wxNewEventType();
 
84
const wxEventType cbEVT_EDITOR_BREAKPOINT_EDIT = wxNewEventType();
 
85
const wxEventType cbEVT_EDITOR_BREAKPOINT_DELETE = wxNewEventType();
 
86
const wxEventType cbEVT_EDITOR_UPDATE_UI = wxNewEventType();
 
87
// project events
 
88
const wxEventType cbEVT_PROJECT_CLOSE = wxNewEventType();
 
89
const wxEventType cbEVT_PROJECT_OPEN = wxNewEventType();
 
90
const wxEventType cbEVT_PROJECT_SAVE = wxNewEventType();
 
91
const wxEventType cbEVT_PROJECT_ACTIVATE = wxNewEventType();
 
92
const wxEventType cbEVT_PROJECT_BEGIN_ADD_FILES = wxNewEventType();
 
93
const wxEventType cbEVT_PROJECT_END_ADD_FILES = wxNewEventType();
 
94
const wxEventType cbEVT_PROJECT_BEGIN_REMOVE_FILES = wxNewEventType();
 
95
const wxEventType cbEVT_PROJECT_END_REMOVE_FILES = wxNewEventType();
 
96
const wxEventType cbEVT_PROJECT_FILE_ADDED = wxNewEventType();
 
97
const wxEventType cbEVT_PROJECT_FILE_REMOVED = wxNewEventType();
 
98
const wxEventType cbEVT_PROJECT_POPUP_MENU = wxNewEventType();
 
99
const wxEventType cbEVT_PROJECT_TARGETS_MODIFIED = wxNewEventType();
 
100
const wxEventType cbEVT_PROJECT_RENAMED = wxNewEventType();
 
101
const wxEventType cbEVT_WORKSPACE_CHANGED = wxNewEventType();
 
102
// build targets events
 
103
const wxEventType cbEVT_BUILDTARGET_ADDED = wxNewEventType();
 
104
const wxEventType cbEVT_BUILDTARGET_REMOVED = wxNewEventType();
 
105
const wxEventType cbEVT_BUILDTARGET_RENAMED = wxNewEventType();
 
106
const wxEventType cbEVT_BUILDTARGET_SELECTED = wxNewEventType();
 
107
// pipedprocess events
 
108
const wxEventType cbEVT_PIPEDPROCESS_STDOUT = wxNewEventType();
 
109
const wxEventType cbEVT_PIPEDPROCESS_STDERR = wxNewEventType();
 
110
const wxEventType cbEVT_PIPEDPROCESS_TERMINATED = wxNewEventType();
 
111
// thread-pool events
 
112
const wxEventType cbEVT_THREADTASK_STARTED = wxNewEventType();
 
113
const wxEventType cbEVT_THREADTASK_ENDED = wxNewEventType();
 
114
const wxEventType cbEVT_THREADTASK_ALLDONE = wxNewEventType();
 
115
// request app to dock/undock a window
 
116
const wxEventType cbEVT_ADD_DOCK_WINDOW = wxNewEventType();
 
117
const wxEventType cbEVT_REMOVE_DOCK_WINDOW = wxNewEventType();
 
118
const wxEventType cbEVT_SHOW_DOCK_WINDOW = wxNewEventType();
 
119
const wxEventType cbEVT_HIDE_DOCK_WINDOW = wxNewEventType();
 
120
// ask which is the current view layout
 
121
const wxEventType cbEVT_QUERY_VIEW_LAYOUT = wxNewEventType();
 
122
// request app to switch view layout
 
123
const wxEventType cbEVT_SWITCH_VIEW_LAYOUT = wxNewEventType();
 
124
// app notifies that a new layout has been applied
 
125
const wxEventType cbEVT_SWITCHED_VIEW_LAYOUT = wxNewEventType();
 
126
// app notifies that a docked window has been hidden/shown
 
127
const wxEventType cbEVT_DOCK_WINDOW_VISIBILITY = wxNewEventType();
 
128
// app notifies that the menubar is started being (re)created
 
129
const wxEventType cbEVT_MENUBAR_CREATE_BEGIN = wxNewEventType();
 
130
// app notifies that the menubar (re)creation ended
 
131
const wxEventType cbEVT_MENUBAR_CREATE_END = wxNewEventType();
 
132
// compiler-related events
 
133
const wxEventType cbEVT_COMPILER_STARTED = wxNewEventType();
 
134
const wxEventType cbEVT_COMPILER_FINISHED = wxNewEventType();
 
135
const wxEventType cbEVT_COMPILER_SET_BUILD_OPTIONS = wxNewEventType();
 
136
// debugger-related events
 
137
const wxEventType cbEVT_DEBUGGER_STARTED = wxNewEventType();
 
138
const wxEventType cbEVT_DEBUGGER_PAUSED = wxNewEventType();
 
139
const wxEventType cbEVT_DEBUGGER_FINISHED = wxNewEventType();
 
140
 
 
141
// logger-related events
 
142
const wxEventType cbEVT_ADD_LOG_WINDOW = wxNewEventType();
 
143
const wxEventType cbEVT_REMOVE_LOG_WINDOW = wxNewEventType();
 
144
const wxEventType cbEVT_SWITCH_TO_LOG_WINDOW = wxNewEventType();
 
145
const wxEventType cbEVT_SHOW_LOG_MANAGER = wxNewEventType();
 
146
const wxEventType cbEVT_HIDE_LOG_MANAGER = wxNewEventType();
 
147
const wxEventType cbEVT_LOCK_LOG_MANAGER = wxNewEventType();
 
148
const wxEventType cbEVT_UNLOCK_LOG_MANAGER = wxNewEventType();