13
0

add -D actions to gtkmm2ext

This commit is contained in:
Paul Davis 2024-02-14 17:10:21 -07:00
parent 023c21ff58
commit e7731f2e89
3 changed files with 8 additions and 0 deletions

View File

@ -41,6 +41,7 @@
#include "pbd/stacktrace.h" #include "pbd/stacktrace.h"
#include "gtkmm2ext/actions.h" #include "gtkmm2ext/actions.h"
#include "gtkmm2ext/debug.h"
#include "gtkmm2ext/utils.h" #include "gtkmm2ext/utils.h"
#include "pbd/i18n.h" #include "pbd/i18n.h"
@ -391,6 +392,7 @@ ActionManager::register_action (RefPtr<ActionGroup> group, const char* name, con
string fullpath; string fullpath;
RefPtr<Action> act = Action::create (name, label); RefPtr<Action> act = Action::create (name, label);
DEBUG_TRACE (PBD::DEBUG::Actions, string_compose ("created action %1 in %2 success: %3\n", name, group->get_name(), (bool) act));
fullpath = group->get_name(); fullpath = group->get_name();
fullpath += '/'; fullpath += '/';
@ -413,6 +415,7 @@ ActionManager::register_action (RefPtr<ActionGroup> group,
string fullpath; string fullpath;
RefPtr<Action> act = Action::create (name, label); RefPtr<Action> act = Action::create (name, label);
DEBUG_TRACE (PBD::DEBUG::Actions, string_compose ("created action %1 in %2 success: %3\n", name, group->get_name(), (bool) act));
fullpath = group->get_name(); fullpath = group->get_name();
fullpath += '/'; fullpath += '/';
@ -436,6 +439,7 @@ ActionManager::register_radio_action (RefPtr<ActionGroup> group,
string fullpath; string fullpath;
RefPtr<Action> act = RadioAction::create (rgroup, name, label); RefPtr<Action> act = RadioAction::create (rgroup, name, label);
DEBUG_TRACE (PBD::DEBUG::Actions, string_compose ("created action %1 in %2 success: %3\n", name, group->get_name(), (bool) act));
RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act); RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
fullpath = group->get_name(); fullpath = group->get_name();
@ -461,6 +465,7 @@ ActionManager::register_radio_action (RefPtr<ActionGroup> group,
string fullpath; string fullpath;
RefPtr<Action> act = RadioAction::create (rgroup, name, label); RefPtr<Action> act = RadioAction::create (rgroup, name, label);
DEBUG_TRACE (PBD::DEBUG::Actions, string_compose ("created radio-action %1 in %2 success: %3\n", name, group->get_name(), (bool) act));
RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act); RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
ract->property_value() = value; ract->property_value() = value;
@ -489,6 +494,7 @@ ActionManager::register_toggle_action (RefPtr<ActionGroup> group,
fullpath += name; fullpath += name;
RefPtr<Action> act = ToggleAction::create (name, label); RefPtr<Action> act = ToggleAction::create (name, label);
DEBUG_TRACE (PBD::DEBUG::Actions, string_compose ("created action %1 in %2 success: %2\n", name, group->get_name(), (bool) act));
if (actions.insert (ActionMap::value_type (fullpath, act)).second) { if (actions.insert (ActionMap::value_type (fullpath, act)).second) {
group->add (act, sl); group->add (act, sl);

View File

@ -22,3 +22,4 @@
PBD::DebugBits PBD::DEBUG::Keyboard = PBD::new_debug_bit ("keyboard"); PBD::DebugBits PBD::DEBUG::Keyboard = PBD::new_debug_bit ("keyboard");
PBD::DebugBits PBD::DEBUG::Bindings = PBD::new_debug_bit ("bindings"); PBD::DebugBits PBD::DEBUG::Bindings = PBD::new_debug_bit ("bindings");
PBD::DebugBits PBD::DEBUG::Actions = PBD::new_debug_bit ("actions");

View File

@ -29,6 +29,7 @@ namespace PBD {
namespace DEBUG { namespace DEBUG {
LIBGTKMM2EXT_API extern DebugBits Keyboard; LIBGTKMM2EXT_API extern DebugBits Keyboard;
LIBGTKMM2EXT_API extern DebugBits Bindings; LIBGTKMM2EXT_API extern DebugBits Bindings;
LIBGTKMM2EXT_API extern DebugBits Actions;
} }
} }