2016-06-27 14:38:36 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator.
|
|
|
|
|
**
|
|
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
|
|
|
|
**
|
|
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#include "debuggericons.h"
|
|
|
|
|
|
|
|
|
|
using namespace Utils;
|
|
|
|
|
|
|
|
|
|
namespace Debugger {
|
|
|
|
|
namespace Icons {
|
|
|
|
|
|
|
|
|
|
const Icon BREAKPOINT({
|
2016-11-02 18:06:37 +01:00
|
|
|
{":/utils/images/filledcircle.png", Theme::IconsErrorColor}}, Icon::Tint);
|
2016-06-27 14:38:36 +02:00
|
|
|
const Icon BREAKPOINT_DISABLED({
|
|
|
|
|
{":/debugger/images/breakpoint_disabled.png", Theme::IconsErrorColor}}, Icon::Tint);
|
|
|
|
|
const Icon BREAKPOINT_PENDING({
|
2016-11-02 18:06:37 +01:00
|
|
|
{":/utils/images/filledcircle.png", Theme::IconsErrorColor},
|
2016-06-27 14:38:36 +02:00
|
|
|
{":/debugger/images/breakpoint_pending_overlay.png", Theme::PanelTextColorDark}}, Icon::IconStyleOptions(Icon::Tint | Icon::PunchEdges));
|
|
|
|
|
const Icon BREAKPOINTS(
|
|
|
|
|
":/debugger/images/debugger_breakpoints.png");
|
|
|
|
|
const Icon WATCHPOINT({
|
2016-08-03 17:55:54 +02:00
|
|
|
{":/utils/images/eye_open.png", Theme::TextColorNormal}}, Icon::Tint);
|
2016-06-27 14:38:36 +02:00
|
|
|
const Icon TRACEPOINT({
|
2016-08-03 17:55:54 +02:00
|
|
|
{":/utils/images/eye_open.png", Theme::TextColorNormal},
|
2016-06-27 14:38:36 +02:00
|
|
|
{":/debugger/images/tracepointoverlay.png", Theme::TextColorNormal}}, Icon::Tint | Icon::PunchEdges);
|
2018-04-26 16:02:59 +02:00
|
|
|
const Icon TRACEPOINT_TOOLBAR({
|
|
|
|
|
{":/utils/images/eye_open.png", Theme::IconsBaseColor},
|
|
|
|
|
{":/debugger/images/tracepointoverlay.png", Theme::IconsBaseColor}});
|
2016-06-27 14:38:36 +02:00
|
|
|
const Icon CONTINUE(
|
|
|
|
|
":/debugger/images/debugger_continue.png");
|
|
|
|
|
const Icon CONTINUE_FLAT({
|
|
|
|
|
{":/debugger/images/debugger_continue_1_mask.png", Theme::IconsInterruptToolBarColor},
|
|
|
|
|
{":/debugger/images/debugger_continue_2_mask.png", Theme::IconsRunToolBarColor},
|
|
|
|
|
{":/projectexplorer/images/debugger_beetle_mask.png", Theme::IconsDebugColor}});
|
|
|
|
|
const Icon DEBUG_CONTINUE_SMALL({
|
|
|
|
|
{":/projectexplorer/images/continue_1_small.png", Theme::IconsInterruptColor},
|
|
|
|
|
{":/projectexplorer/images/continue_2_small.png", Theme::IconsRunColor},
|
|
|
|
|
{":/projectexplorer/images/debugger_overlay_small.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle);
|
|
|
|
|
const Icon DEBUG_CONTINUE_SMALL_TOOLBAR({
|
|
|
|
|
{":/projectexplorer/images/continue_1_small.png", Theme::IconsInterruptToolBarColor},
|
|
|
|
|
{":/projectexplorer/images/continue_2_small.png", Theme::IconsRunToolBarColor},
|
|
|
|
|
{":/projectexplorer/images/debugger_overlay_small.png", Theme::IconsDebugColor}});
|
|
|
|
|
const Icon INTERRUPT(
|
|
|
|
|
":/debugger/images/debugger_interrupt.png");
|
|
|
|
|
const Icon INTERRUPT_FLAT({
|
|
|
|
|
{":/debugger/images/debugger_interrupt_mask.png", Theme::IconsInterruptToolBarColor},
|
|
|
|
|
{":/projectexplorer/images/debugger_beetle_mask.png", Theme::IconsDebugColor}});
|
2019-04-03 14:31:43 +02:00
|
|
|
const Icon STOP(
|
|
|
|
|
":/debugger/images/debugger_stop.png");
|
2018-10-04 14:44:39 +02:00
|
|
|
const Icon STOP_FLAT({
|
2019-04-03 14:31:43 +02:00
|
|
|
{":/debugger/images/debugger_stop_mask.png", Theme::IconsStopToolBarColor},
|
2018-10-04 14:44:39 +02:00
|
|
|
{":/projectexplorer/images/debugger_beetle_mask.png", Theme::IconsDebugColor}});
|
2016-06-27 14:38:36 +02:00
|
|
|
const Icon DEBUG_INTERRUPT_SMALL({
|
2016-08-03 17:55:54 +02:00
|
|
|
{":/utils/images/interrupt_small.png", Theme::IconsInterruptColor},
|
2016-06-27 14:38:36 +02:00
|
|
|
{":/projectexplorer/images/debugger_overlay_small.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle);
|
|
|
|
|
const Icon DEBUG_INTERRUPT_SMALL_TOOLBAR({
|
2016-08-03 17:55:54 +02:00
|
|
|
{":/utils/images/interrupt_small.png", Theme::IconsInterruptToolBarColor},
|
2016-06-27 14:38:36 +02:00
|
|
|
{":/projectexplorer/images/debugger_overlay_small.png", Theme::IconsDebugColor}});
|
|
|
|
|
const Icon DEBUG_EXIT_SMALL({
|
2016-08-03 17:55:54 +02:00
|
|
|
{":/utils/images/stop_small.png", Theme::IconsStopColor},
|
2016-06-27 14:38:36 +02:00
|
|
|
{":/projectexplorer/images/debugger_overlay_small.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle);
|
|
|
|
|
const Icon DEBUG_EXIT_SMALL_TOOLBAR({
|
2016-08-03 17:55:54 +02:00
|
|
|
{":/utils/images/stop_small.png", Theme::IconsStopToolBarColor},
|
2016-06-27 14:38:36 +02:00
|
|
|
{":/projectexplorer/images/debugger_overlay_small.png", Theme::IconsDebugColor}});
|
|
|
|
|
const Icon LOCATION({
|
|
|
|
|
{":/debugger/images/location_background.png", Theme::IconsCodeModelOverlayForegroundColor},
|
|
|
|
|
{":/debugger/images/location.png", Theme::IconsWarningToolBarColor}}, Icon::Tint);
|
Debugger: Make most views per-engine instead of singletons
This is a step towards properly supporting multiple debugger
sessions side-by-side.
The combined C++-and-QML engine has been removed, instead a
combined setup creates now two individual engines, under a single
DebuggerRunTool but mostly independent with no combined state
machine. This requires a few more clicks in some cases, but
makes it easier to direct e.g. interrupt requests to the
interesting engine.
Care has been taken to not change the UX of the single debugger
session use case if possible. The fat debug button operates
as-before in that case, i.e. switches to Interrupt if the
single active runconfiguration runs in the debugger etc.
Most views are made per-engine, running an engine creates
a new Perspective, which is destroyed when the run control dies.
The snapshot view remains global and becomes primary source
of information on a "current engine" that receives all menu
and otherwise global input.
There is a new global "Breakpoint Preset" view containing
all "static" breakpoint data. When an engine starts up it
"claims" breakpoint it believes it can handle, but operates
on a copy of the static data. The markers of the static
version are suppressed as long as an engine controls a
breakpoint (that inclusive all resolved locations), but are
re-instatet once the engine quits.
The old Breakpoint class that already contained this split
per-instance was split into a new Breakpoint and a
GlobalBreakpoint class, with a per-engine model for Breakpoints,
and a singleton model containing GlobalBreakpoints.
There is a new CppDebuggerEngine intermediate level serving as
base for C++ (or, rather, "compiled") binary debugging, i.e.
{Gdb,Lldb,Cdb}Engine, taking over bits of the current DebuggerEngine
base that are not applicable to non-binary debuggers.
Change-Id: I9994f4c188379b4aee0c4f379edd4759fbb0bd43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-07-31 12:30:48 +02:00
|
|
|
const Icon REVERSE_LOCATION({
|
|
|
|
|
{":/debugger/images/debugger_reversemode_background.png", Theme::IconsCodeModelOverlayForegroundColor},
|
|
|
|
|
{":/debugger/images/debugger_reversemode.png", Theme::IconsWarningToolBarColor}}, Icon::Tint);
|
2016-06-27 14:38:36 +02:00
|
|
|
const Icon REVERSE_MODE({
|
|
|
|
|
{":/debugger/images/debugger_reversemode_background.png", Theme::IconsCodeModelOverlayForegroundColor},
|
|
|
|
|
{":/debugger/images/debugger_reversemode.png", Theme::IconsInfoColor}}, Icon::Tint);
|
Debugger: Make most views per-engine instead of singletons
This is a step towards properly supporting multiple debugger
sessions side-by-side.
The combined C++-and-QML engine has been removed, instead a
combined setup creates now two individual engines, under a single
DebuggerRunTool but mostly independent with no combined state
machine. This requires a few more clicks in some cases, but
makes it easier to direct e.g. interrupt requests to the
interesting engine.
Care has been taken to not change the UX of the single debugger
session use case if possible. The fat debug button operates
as-before in that case, i.e. switches to Interrupt if the
single active runconfiguration runs in the debugger etc.
Most views are made per-engine, running an engine creates
a new Perspective, which is destroyed when the run control dies.
The snapshot view remains global and becomes primary source
of information on a "current engine" that receives all menu
and otherwise global input.
There is a new global "Breakpoint Preset" view containing
all "static" breakpoint data. When an engine starts up it
"claims" breakpoint it believes it can handle, but operates
on a copy of the static data. The markers of the static
version are suppressed as long as an engine controls a
breakpoint (that inclusive all resolved locations), but are
re-instatet once the engine quits.
The old Breakpoint class that already contained this split
per-instance was split into a new Breakpoint and a
GlobalBreakpoint class, with a per-engine model for Breakpoints,
and a singleton model containing GlobalBreakpoints.
There is a new CppDebuggerEngine intermediate level serving as
base for C++ (or, rather, "compiled") binary debugging, i.e.
{Gdb,Lldb,Cdb}Engine, taking over bits of the current DebuggerEngine
base that are not applicable to non-binary debuggers.
Change-Id: I9994f4c188379b4aee0c4f379edd4759fbb0bd43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-07-31 12:30:48 +02:00
|
|
|
const Icon DIRECTION_BACKWARD({
|
|
|
|
|
{":/debugger/images/debugger_reversemode_background.png", Theme::IconsCodeModelOverlayForegroundColor},
|
|
|
|
|
{":/debugger/images/debugger_reversemode.png", Theme::IconsInfoColor}}, Icon::Tint);
|
|
|
|
|
const Icon DIRECTION_FORWARD({
|
|
|
|
|
{":/debugger/images/location_background.png", Theme::IconsCodeModelOverlayForegroundColor},
|
|
|
|
|
{":/debugger/images/location.png", Theme::IconsInfoColor}}, Icon::Tint);
|
2016-06-27 14:38:36 +02:00
|
|
|
const Icon APP_ON_TOP({
|
2017-11-15 11:57:25 +01:00
|
|
|
{":/utils/images/app-on-top.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle);
|
2016-06-27 14:38:36 +02:00
|
|
|
const Icon APP_ON_TOP_TOOLBAR({
|
2017-11-15 11:57:25 +01:00
|
|
|
{":/utils/images/app-on-top.png", Theme::IconsBaseColor}});
|
2016-06-27 14:38:36 +02:00
|
|
|
const Icon SELECT({
|
2017-11-15 11:57:25 +01:00
|
|
|
{":/utils/images/select.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle);
|
2016-06-27 14:38:36 +02:00
|
|
|
const Icon SELECT_TOOLBAR({
|
2017-11-15 11:57:25 +01:00
|
|
|
{":/utils/images/select.png", Theme::IconsBaseColor}});
|
2016-06-27 14:38:36 +02:00
|
|
|
const Icon EMPTY(
|
|
|
|
|
":/debugger/images/debugger_empty_14.png");
|
|
|
|
|
const Icon RECORD_ON({
|
|
|
|
|
{":/debugger/images/recordfill.png", Theme::IconsStopColor},
|
|
|
|
|
{":/debugger/images/recordoutline.png", Theme::IconsBaseColor}}, Icon::Tint | Icon::DropShadow);
|
|
|
|
|
const Icon RECORD_OFF({
|
|
|
|
|
{":/debugger/images/recordfill.png", Theme::IconsDisabledColor},
|
|
|
|
|
{":/debugger/images/recordoutline.png", Theme::IconsBaseColor}}, Icon::Tint | Icon::DropShadow);
|
|
|
|
|
|
|
|
|
|
const Icon STEP_OVER({
|
|
|
|
|
{":/debugger/images/debugger_stepover_small.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle);
|
|
|
|
|
const Icon STEP_OVER_TOOLBAR({
|
|
|
|
|
{":/debugger/images/debugger_stepover_small.png", Theme::IconsBaseColor}});
|
|
|
|
|
const Icon STEP_INTO({
|
|
|
|
|
{":/debugger/images/debugger_stepinto_small.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle);
|
|
|
|
|
const Icon STEP_INTO_TOOLBAR({
|
|
|
|
|
{":/debugger/images/debugger_stepinto_small.png", Theme::IconsBaseColor}});
|
|
|
|
|
const Icon STEP_OUT({
|
|
|
|
|
{":/debugger/images/debugger_stepout_small.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle);
|
|
|
|
|
const Icon STEP_OUT_TOOLBAR({
|
|
|
|
|
{":/debugger/images/debugger_stepout_small.png", Theme::IconsBaseColor}});
|
|
|
|
|
const Icon RESTART({
|
|
|
|
|
{":/debugger/images/debugger_restart_small.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle);
|
|
|
|
|
const Icon RESTART_TOOLBAR({
|
|
|
|
|
{":/debugger/images/debugger_restart_small.png", Theme::IconsRunToolBarColor}});
|
|
|
|
|
const Icon SINGLE_INSTRUCTION_MODE({
|
|
|
|
|
{":/debugger/images/debugger_singleinstructionmode.png", Theme::IconsBaseColor}});
|
|
|
|
|
|
|
|
|
|
const Icon MODE_DEBUGGER_CLASSIC(
|
|
|
|
|
":/debugger/images/mode_debug.png");
|
|
|
|
|
const Icon MODE_DEBUGGER_FLAT({
|
|
|
|
|
{":/debugger/images/mode_debug_mask.png", Theme::IconsBaseColor}});
|
|
|
|
|
const Icon MODE_DEBUGGER_FLAT_ACTIVE({
|
|
|
|
|
{":/debugger/images/mode_debug_mask.png", Theme::IconsModeDebugActiveColor}});
|
|
|
|
|
|
Add macOS touch bar support
Introduce a generic Utils::TouchBar that implements a touch bar for
macOS based on QAction. Touch bars can be nested, and one is set to be
the application's top level touch bar.
Also add an ActionContainer for the touch bar. That allows us to manage
the layout of the touch bar the same way we do with menus.
Since the touch bar is an input device with very limited space, a
command in the touch bar needs to be specifically styled for the touch
bar by setting either touchBarText or touchBarIcon (or both).
Touch bars can be nested by nesting the ActionContainers. A nested touch
bar ActionContainer needs to specify an icon and/or text to show in the
touch bar button that opens that sub-bar.
Commands are only shown in the touch bar if they are valid within the
current context.
Implementation-wise we cannot use the standard NSPopoverTouchBarItem for
nesting touch bar levels. We cannot hide items in the touch bar, because
hidden items still take up space in the touch bar. So we need to rebuild
the touch bar regularly. Since the items we show are very dynamic, every
time the items in the toplevel bar change because of a context change,
any opened sub-level touch bar closes. That is why we maintain a stack of
touch bar levels ourselves, replacing the main touch bar with the current
level, and managing opening and closing the levels manually.
This patch adds buttons for Help, Bookmarks, Header/Source, Follow
(Symbol), Decl/Def, and a sub-bar for the debugger actions.
Fixes: QTCREATORBUG-21263
Change-Id: Ib63e610f21a993f1d324fe23c83a7f2224f434ac
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-10-05 13:52:57 +02:00
|
|
|
const Icon MACOS_TOUCHBAR_DEBUG(
|
|
|
|
|
":/debugger/images/macos_touchbar_debug.png");
|
|
|
|
|
const Icon MACOS_TOUCHBAR_DEBUG_EXIT(
|
|
|
|
|
":/debugger/images/macos_touchbar_debug_exit.png");
|
|
|
|
|
const Icon MACOS_TOUCHBAR_DEBUG_INTERRUPT(
|
|
|
|
|
":/debugger/images/macos_touchbar_debug_interrupt.png");
|
|
|
|
|
const Icon MACOS_TOUCHBAR_DEBUG_CONTINUE(
|
|
|
|
|
":/debugger/images/macos_touchbar_debug_continue.png");
|
|
|
|
|
const Icon MACOS_TOUCHBAR_DEBUG_STEP_OVER(
|
|
|
|
|
":/debugger/images/macos_touchbar_debug_step_over.png");
|
|
|
|
|
const Icon MACOS_TOUCHBAR_DEBUG_STEP_INTO(
|
|
|
|
|
":/debugger/images/macos_touchbar_debug_step_into.png");
|
|
|
|
|
const Icon MACOS_TOUCHBAR_DEBUG_STEP_OUT(
|
|
|
|
|
":/debugger/images/macos_touchbar_debug_step_out.png");
|
2016-06-27 14:38:36 +02:00
|
|
|
} // namespace Icons
|
|
|
|
|
} // namespace Debugger
|