mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 07:45:00 +01:00
change foo(string bar) to foo(const char * bar) for foo()s only being called with C-string args.
git-svn-id: svn://localhost/trunk/ardour2@202 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
5c819462b8
commit
24e9a93968
4 changed files with 51 additions and 42 deletions
|
|
@ -65,7 +65,7 @@ ActionManager::init ()
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<Action>
|
RefPtr<Action>
|
||||||
ActionManager::register_action (RefPtr<ActionGroup> group, string name, string label, slot<void> sl, guint key, Gdk::ModifierType mods)
|
ActionManager::register_action (RefPtr<ActionGroup> group, const char * name, const char * label, slot<void> sl, guint key, Gdk::ModifierType mods)
|
||||||
{
|
{
|
||||||
RefPtr<Action> act = register_action (group, name, label, sl);
|
RefPtr<Action> act = register_action (group, name, label, sl);
|
||||||
AccelMap::add_entry (act->get_accel_path(), key, mods);
|
AccelMap::add_entry (act->get_accel_path(), key, mods);
|
||||||
|
|
@ -74,7 +74,7 @@ ActionManager::register_action (RefPtr<ActionGroup> group, string name, string l
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<Action>
|
RefPtr<Action>
|
||||||
ActionManager::register_action (RefPtr<ActionGroup> group, string name, string label, slot<void> sl)
|
ActionManager::register_action (RefPtr<ActionGroup> group, const char * name, const char * label, slot<void> sl)
|
||||||
{
|
{
|
||||||
RefPtr<Action> act = register_action (group, name, label);
|
RefPtr<Action> act = register_action (group, name, label);
|
||||||
group->add (act, sl);
|
group->add (act, sl);
|
||||||
|
|
@ -83,7 +83,7 @@ ActionManager::register_action (RefPtr<ActionGroup> group, string name, string l
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<Action>
|
RefPtr<Action>
|
||||||
ActionManager::register_action (RefPtr<ActionGroup> group, string name, string label)
|
ActionManager::register_action (RefPtr<ActionGroup> group, const char * name, const char * label)
|
||||||
{
|
{
|
||||||
RefPtr<Action> act;
|
RefPtr<Action> act;
|
||||||
|
|
||||||
|
|
@ -95,7 +95,7 @@ ActionManager::register_action (RefPtr<ActionGroup> group, string name, string l
|
||||||
|
|
||||||
|
|
||||||
RefPtr<Action>
|
RefPtr<Action>
|
||||||
ActionManager::register_radio_action (RefPtr<ActionGroup> group, RadioAction::Group rgroup, string name, string label, slot<void> sl, guint key, Gdk::ModifierType mods)
|
ActionManager::register_radio_action (RefPtr<ActionGroup> group, RadioAction::Group rgroup, const char * name, const char * label, slot<void> sl, guint key, Gdk::ModifierType mods)
|
||||||
{
|
{
|
||||||
RefPtr<Action> act = register_radio_action (group, rgroup, name, label, sl);
|
RefPtr<Action> act = register_radio_action (group, rgroup, name, label, sl);
|
||||||
AccelMap::add_entry (act->get_accel_path(), key, mods);
|
AccelMap::add_entry (act->get_accel_path(), key, mods);
|
||||||
|
|
@ -104,7 +104,7 @@ ActionManager::register_radio_action (RefPtr<ActionGroup> group, RadioAction::Gr
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<Action>
|
RefPtr<Action>
|
||||||
ActionManager::register_radio_action (RefPtr<ActionGroup> group, RadioAction::Group rgroup, string name, string label, slot<void> sl)
|
ActionManager::register_radio_action (RefPtr<ActionGroup> group, RadioAction::Group rgroup, const char * name, const char * label, slot<void> sl)
|
||||||
{
|
{
|
||||||
RefPtr<Action> act;
|
RefPtr<Action> act;
|
||||||
|
|
||||||
|
|
@ -116,7 +116,7 @@ ActionManager::register_radio_action (RefPtr<ActionGroup> group, RadioAction::Gr
|
||||||
|
|
||||||
|
|
||||||
RefPtr<Action>
|
RefPtr<Action>
|
||||||
ActionManager::register_toggle_action (RefPtr<ActionGroup> group, string name, string label, slot<void> sl, guint key, Gdk::ModifierType mods)
|
ActionManager::register_toggle_action (RefPtr<ActionGroup> group, const char * name, const char * label, slot<void> sl, guint key, Gdk::ModifierType mods)
|
||||||
{
|
{
|
||||||
RefPtr<Action> act = register_toggle_action (group,name, label, sl);
|
RefPtr<Action> act = register_toggle_action (group,name, label, sl);
|
||||||
AccelMap::add_entry (act->get_accel_path(), key, mods);
|
AccelMap::add_entry (act->get_accel_path(), key, mods);
|
||||||
|
|
@ -125,7 +125,7 @@ ActionManager::register_toggle_action (RefPtr<ActionGroup> group, string name, s
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<Action>
|
RefPtr<Action>
|
||||||
ActionManager::register_toggle_action (RefPtr<ActionGroup> group, string name, string label, slot<void> sl)
|
ActionManager::register_toggle_action (RefPtr<ActionGroup> group, const char * name, const char * label, slot<void> sl)
|
||||||
{
|
{
|
||||||
RefPtr<Action> act;
|
RefPtr<Action> act;
|
||||||
|
|
||||||
|
|
@ -189,18 +189,19 @@ ActionManager::add_action_group (RefPtr<ActionGroup> grp)
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget*
|
Widget*
|
||||||
ActionManager::get_widget (ustring name)
|
ActionManager::get_widget (const char * name)
|
||||||
{
|
{
|
||||||
return ui_manager->get_widget (name);
|
return ui_manager->get_widget (name);
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<Action>
|
RefPtr<Action>
|
||||||
ActionManager::get_action (ustring name)
|
ActionManager::get_action (const char * _name)
|
||||||
{
|
{
|
||||||
/* the C++ API for functions used here appears to be broken in
|
/* the C++ API for functions used here appears to be broken in
|
||||||
gtkmm2.6, so we fall back to the C level.
|
gtkmm2.6, so we fall back to the C level.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
ustring name(_name);
|
||||||
GList* list = gtk_ui_manager_get_action_groups (ui_manager->gobj());
|
GList* list = gtk_ui_manager_get_action_groups (ui_manager->gobj());
|
||||||
GList* node;
|
GList* node;
|
||||||
RefPtr<Action> act;
|
RefPtr<Action> act;
|
||||||
|
|
@ -241,7 +242,7 @@ ActionManager::set_sensitive (vector<RefPtr<Action> >& actions, bool state)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ActionManager::uncheck_toggleaction (const std::string& actionname)
|
ActionManager::uncheck_toggleaction (const char * actionname)
|
||||||
{
|
{
|
||||||
RefPtr<Action> act = get_action (actionname);
|
RefPtr<Action> act = get_action (actionname);
|
||||||
if (act) {
|
if (act) {
|
||||||
|
|
|
||||||
|
|
@ -35,30 +35,30 @@ class ActionManager
|
||||||
static std::string unbound_string; /* the key string returned if an action is not bound */
|
static std::string unbound_string; /* the key string returned if an action is not bound */
|
||||||
static Glib::RefPtr<Gtk::UIManager> ui_manager;
|
static Glib::RefPtr<Gtk::UIManager> ui_manager;
|
||||||
|
|
||||||
static Gtk::Widget* get_widget (Glib::ustring name);
|
static Gtk::Widget* get_widget (const char * name);
|
||||||
static Glib::RefPtr<Gtk::Action> get_action (Glib::ustring name);
|
static Glib::RefPtr<Gtk::Action> get_action (const char * name);
|
||||||
|
|
||||||
static void add_action_group (Glib::RefPtr<Gtk::ActionGroup>);
|
static void add_action_group (Glib::RefPtr<Gtk::ActionGroup>);
|
||||||
|
|
||||||
static Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group,
|
static Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group,
|
||||||
std::string name, std::string label);
|
const char * name, const char * label);
|
||||||
static Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group,
|
static Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group,
|
||||||
std::string name, std::string label, sigc::slot<void> sl,
|
const char * name, const char * label, sigc::slot<void> sl,
|
||||||
guint key, Gdk::ModifierType mods);
|
guint key, Gdk::ModifierType mods);
|
||||||
static Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group,
|
static Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group,
|
||||||
std::string name, std::string label, sigc::slot<void> sl);
|
const char * name, const char * label, sigc::slot<void> sl);
|
||||||
|
|
||||||
static Glib::RefPtr<Gtk::Action> register_radio_action (Glib::RefPtr<Gtk::ActionGroup> group, Gtk::RadioAction::Group,
|
static Glib::RefPtr<Gtk::Action> register_radio_action (Glib::RefPtr<Gtk::ActionGroup> group, Gtk::RadioAction::Group,
|
||||||
std::string name, std::string label, sigc::slot<void> sl,
|
const char * name, const char * label, sigc::slot<void> sl,
|
||||||
guint key, Gdk::ModifierType mods);
|
guint key, Gdk::ModifierType mods);
|
||||||
static Glib::RefPtr<Gtk::Action> register_radio_action (Glib::RefPtr<Gtk::ActionGroup> group, Gtk::RadioAction::Group,
|
static Glib::RefPtr<Gtk::Action> register_radio_action (Glib::RefPtr<Gtk::ActionGroup> group, Gtk::RadioAction::Group,
|
||||||
std::string name, std::string label, sigc::slot<void> sl);
|
const char * name, const char * label, sigc::slot<void> sl);
|
||||||
|
|
||||||
static Glib::RefPtr<Gtk::Action> register_toggle_action (Glib::RefPtr<Gtk::ActionGroup> group,
|
static Glib::RefPtr<Gtk::Action> register_toggle_action (Glib::RefPtr<Gtk::ActionGroup> group,
|
||||||
std::string name, std::string label, sigc::slot<void> sl,
|
const char * name, const char * label, sigc::slot<void> sl,
|
||||||
guint key, Gdk::ModifierType mods);
|
guint key, Gdk::ModifierType mods);
|
||||||
static Glib::RefPtr<Gtk::Action> register_toggle_action (Glib::RefPtr<Gtk::ActionGroup> group,
|
static Glib::RefPtr<Gtk::Action> register_toggle_action (Glib::RefPtr<Gtk::ActionGroup> group,
|
||||||
std::string name, std::string label, sigc::slot<void> sl);
|
const char * name, const char * label, sigc::slot<void> sl);
|
||||||
|
|
||||||
static bool lookup_entry (const Glib::ustring accel_path, Gtk::AccelKey& key);
|
static bool lookup_entry (const Glib::ustring accel_path, Gtk::AccelKey& key);
|
||||||
|
|
||||||
|
|
@ -67,7 +67,7 @@ class ActionManager
|
||||||
std::vector<std::string>& keys,
|
std::vector<std::string>& keys,
|
||||||
std::vector<Gtk::AccelKey>& bindings);
|
std::vector<Gtk::AccelKey>& bindings);
|
||||||
|
|
||||||
static void uncheck_toggleaction (const std::string& actionname);
|
static void uncheck_toggleaction (const char * actionname);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* __ardour_gtk_actions_h__ */
|
#endif /* __ardour_gtk_actions_h__ */
|
||||||
|
|
|
||||||
|
|
@ -92,15 +92,17 @@ public:
|
||||||
XMLNode *add_content(const string & = string());
|
XMLNode *add_content(const string & = string());
|
||||||
|
|
||||||
const XMLNodeList & children(const string & = string()) const;
|
const XMLNodeList & children(const string & = string()) const;
|
||||||
XMLNode *add_child(const string &);
|
XMLNode *add_child(const char *);
|
||||||
XMLNode *add_child_copy(const XMLNode&);
|
XMLNode *add_child_copy(const XMLNode&);
|
||||||
void add_child_nocopy (XMLNode&);
|
void add_child_nocopy (XMLNode&);
|
||||||
|
|
||||||
const XMLPropertyList & properties() const { return _proplist; };
|
const XMLPropertyList & properties() const { return _proplist; };
|
||||||
XMLProperty *property(const string &);
|
XMLProperty *property(const char * );
|
||||||
const XMLProperty *property(const string &n) const
|
const XMLProperty *property(const char * n) const
|
||||||
{ return ((XMLNode *) this)->property(n); };
|
{ return ((XMLNode *) this)->property(n); };
|
||||||
XMLProperty *add_property(const string &, const string & = string());
|
XMLProperty *add_property(const char *, const string &);
|
||||||
|
XMLProperty *add_property(const char *, const char * = "");
|
||||||
|
|
||||||
void remove_property(const string &);
|
void remove_property(const string &);
|
||||||
|
|
||||||
/** Remove all nodes with the name passed to remove_nodes */
|
/** Remove all nodes with the name passed to remove_nodes */
|
||||||
|
|
|
||||||
|
|
@ -191,7 +191,7 @@ XMLNode::XMLNode(const XMLNode& from)
|
||||||
|
|
||||||
props = from.properties();
|
props = from.properties();
|
||||||
for (curprop = props.begin(); curprop != props.end(); curprop++)
|
for (curprop = props.begin(); curprop != props.end(); curprop++)
|
||||||
add_property((*curprop)->name(), (*curprop)->value());
|
add_property((*curprop)->name().c_str(), (*curprop)->value());
|
||||||
|
|
||||||
nodes = from.children();
|
nodes = from.children();
|
||||||
for (curnode = nodes.begin(); curnode != nodes.end(); curnode++)
|
for (curnode = nodes.begin(); curnode != nodes.end(); curnode++)
|
||||||
|
|
@ -244,7 +244,7 @@ XMLNode::children(const string & n) const
|
||||||
}
|
}
|
||||||
|
|
||||||
XMLNode *
|
XMLNode *
|
||||||
XMLNode::add_child(const string & n)
|
XMLNode::add_child(const char * n)
|
||||||
{
|
{
|
||||||
return add_child_copy(XMLNode (n));
|
return add_child_copy(XMLNode (n));
|
||||||
}
|
}
|
||||||
|
|
@ -266,33 +266,42 @@ XMLNode::add_child_copy(const XMLNode& n)
|
||||||
XMLNode *
|
XMLNode *
|
||||||
XMLNode::add_content(const string & c)
|
XMLNode::add_content(const string & c)
|
||||||
{
|
{
|
||||||
return add_child_copy(XMLNode (string(), c));
|
return add_child_copy(XMLNode (string(), c));
|
||||||
}
|
}
|
||||||
|
|
||||||
XMLProperty *
|
XMLProperty *
|
||||||
XMLNode::property(const string & n)
|
XMLNode::property(const char * n)
|
||||||
{
|
{
|
||||||
if (_propmap.find(n) == _propmap.end())
|
string ns(n);
|
||||||
|
if (_propmap.find(ns) == _propmap.end())
|
||||||
return 0;
|
return 0;
|
||||||
return _propmap[n];
|
return _propmap[ns];
|
||||||
}
|
}
|
||||||
|
|
||||||
XMLProperty *
|
XMLProperty *
|
||||||
XMLNode::add_property(const string & n, const string & v)
|
XMLNode::add_property(const char * n, const string & v)
|
||||||
{
|
{
|
||||||
if(_propmap.find(n) != _propmap.end()){
|
string ns(n);
|
||||||
remove_property(n);
|
if(_propmap.find(ns) != _propmap.end()){
|
||||||
|
remove_property(ns);
|
||||||
}
|
}
|
||||||
|
|
||||||
XMLProperty *tmp = new XMLProperty(n, v);
|
XMLProperty *tmp = new XMLProperty(ns, v);
|
||||||
|
|
||||||
if (!tmp)
|
if (!tmp)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
_propmap[tmp->name()] = tmp;
|
_propmap[tmp->name()] = tmp;
|
||||||
_proplist.insert(_proplist.end(), tmp);
|
_proplist.insert(_proplist.end(), tmp);
|
||||||
|
|
||||||
return tmp;
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
XMLProperty *
|
||||||
|
XMLNode::add_property(const char * n, const char * v)
|
||||||
|
{
|
||||||
|
string vs(v);
|
||||||
|
return add_property(n, vs);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -357,17 +366,14 @@ readnode(xmlNodePtr node)
|
||||||
|
|
||||||
if (node->name)
|
if (node->name)
|
||||||
name = (char *) node->name;
|
name = (char *) node->name;
|
||||||
else
|
|
||||||
name = string();
|
|
||||||
|
|
||||||
tmp = new XMLNode(name);
|
tmp = new XMLNode(name);
|
||||||
|
|
||||||
for (attr = node->properties; attr; attr = attr->next) {
|
for (attr = node->properties; attr; attr = attr->next) {
|
||||||
name = (char *) attr->name;
|
|
||||||
content = "";
|
content = "";
|
||||||
if (attr->children)
|
if (attr->children)
|
||||||
content = (char *) attr->children->content;
|
content = (char *) attr->children->content;
|
||||||
tmp->add_property(name, content);
|
tmp->add_property((char *) attr->name, content);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node->content)
|
if (node->content)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue