Commit a09eafb7 authored by Florent D'Halluin's avatar Florent D'Halluin
Browse files

[yavgui] Get rid of double pointers where applicable.

GScene** -> GScene* and GView** -> GView*.

* yavgui/src/automaton_instance.cc,
* yavgui/src/automaton_instance.hxx,
* yavgui/src/g_painter.cc,
* yavgui/src/g_painter.hh,
* yavgui/src/g_painter.hxx,
* yavgui/src/g_vcsn_handler.cc,
* yavgui/src/g_vcsn_handler.hh,
* yavgui/src/g_vcsn_handler.hxx,
* yavgui/src/vcsn_automaton.cc,
* yavgui/src/vcsn_automaton.hh: Do that.
parent 7ea984b1
2009-08-04 d-halluin <d-halluin@lrde.epita.fr>
[yavgui] Get rid of double pointers where applicable.
GScene** -> GScene* and GView** -> GView*.
* yavgui/src/automaton_instance.cc,
* yavgui/src/automaton_instance.hxx,
* yavgui/src/g_painter.cc,
* yavgui/src/g_painter.hh,
* yavgui/src/g_painter.hxx,
* yavgui/src/g_vcsn_handler.cc,
* yavgui/src/g_vcsn_handler.hh,
* yavgui/src/g_vcsn_handler.hxx,
* yavgui/src/vcsn_automaton.cc,
* yavgui/src/vcsn_automaton.hh: Do that.
2009-08-04 d-halluin <d-halluin@lrde.epita.fr>
 
[yavgui] GState: mark getter as const.
......
......@@ -39,7 +39,7 @@ namespace gui
view_->setScene (scene_);
scene_->setSceneRect(-SCENE_SIZE / 2, -SCENE_SIZE / 2,
SCENE_SIZE, SCENE_SIZE);
vcsn_automaton_.set_vcsn_handler(&scene_, &view_);
vcsn_automaton_.set_vcsn_handler(scene_, view_);
}
AutomatonInstance::AutomatonInstance (const AutomatonInstance&)
......
......@@ -97,7 +97,7 @@ namespace gui
void AutomatonInstance::update (QTextEdit* status, display::GLayout layout)
{
vcsn_automaton_.paint (&scene_, &view_, layout);
vcsn_automaton_.paint (scene_, view_, layout);
refresh (status);
state_ = MODIFIED;
}
......
......@@ -31,8 +31,8 @@ namespace gui
namespace display
{
GPainter::GPainter (GScene** scene,
GView** view,
GPainter::GPainter (GScene* scene,
GView* view,
GLayout layout)
: scene_ (scene),
view_ (view),
......@@ -43,9 +43,9 @@ namespace gui
void GPainter::clear ()
{
(*scene_)->clear();
(*scene_)->setSceneRect(-SCENE_SIZE / 2, -SCENE_SIZE / 2,
SCENE_SIZE, SCENE_SIZE);
scene_->clear();
scene_->setSceneRect(-SCENE_SIZE / 2, -SCENE_SIZE / 2,
SCENE_SIZE, SCENE_SIZE);
}
......
......@@ -43,8 +43,8 @@ namespace gui
class GPainter: public boost::static_visitor<>
{
public:
GPainter (GScene** scene,
GView** view,
GPainter (GScene* scene,
GView* view,
GLayout layout = GLAYOUT_CIRCLE);
void clear ();
......@@ -56,8 +56,8 @@ namespace gui
private:
void position (std::vector<GState*>& states);
GScene** scene_;
GView** view_;
GScene* scene_;
GView* view_;
GLayout layout_;
};
} // ! namespace display
......
......@@ -73,9 +73,9 @@ namespace gui
initial_entry,
final_entry);
states.push_back(state);
(*scene_)->addItem (state);
scene_->addItem (state);
state_map[*istate] = state;
(*scene_)->connectState(state);
scene_->connectState(state);
}
position (states);
......@@ -95,13 +95,13 @@ namespace gui
GTransition *transition =
new GTransition (*itransition, *from, *to,
label.str ().c_str (), index);
(*scene_)->addItem (transition);
(*scene_)->connectTransition(transition);
scene_->addItem (transition);
scene_->connectTransition(transition);
}
(*view_)->fitInView ((*scene_)->itemsBoundingRect (),
Qt::KeepAspectRatio);
(*view_)->scale (0.9, 0.9);
view_->fitInView (scene_->itemsBoundingRect (),
Qt::KeepAspectRatio);
view_->scale (0.9, 0.9);
}
} // ! namespace display
} // ! namespace gui
......
......@@ -43,7 +43,7 @@ namespace gui
throw exceptions::NoAutomatonStructure ();
AddState op(info_, pos);
boost::apply_visitor (op, **(info_.automaton));
boost::apply_visitor(op, **(info_.automaton));
}
GVcsnHandler::DelState::DelState(SceneInfo& i, GState* s)
......@@ -61,7 +61,7 @@ namespace gui
throw exceptions::NullParameter ();
DelState op(info_, state);
boost::apply_visitor (op, **(info_.automaton));
boost::apply_visitor(op, **(info_.automaton));
}
GVcsnHandler::DelTransition::DelTransition(SceneInfo& i, GTransition* t)
......@@ -82,18 +82,18 @@ namespace gui
boost::apply_visitor (op, **(info_.automaton));
}
GVcsnHandler::GVcsnHandler (GScene** scene,
GView** view,
GVcsnHandler::GVcsnHandler (GScene* scene,
GView* view,
automaton_variant** automaton)
{
info_.scene = scene;
info_.view = view;
info_.automaton = automaton;
connect(*scene, SIGNAL(addState(QPointF)),
connect(scene, SIGNAL(addState(QPointF)),
this, SLOT(addState(QPointF)));
connect(*scene, SIGNAL(delState(GState*)),
connect(scene, SIGNAL(delState(GState*)),
this, SLOT(delState(GState*)));
connect(*scene, SIGNAL(delTransition(GTransition*)),
connect(scene, SIGNAL(delTransition(GTransition*)),
this, SLOT(delTransition(GTransition*)));
}
......
......@@ -50,13 +50,13 @@ namespace gui
public:
struct SceneInfo
{
GScene** scene;
GView** view;
GScene* scene;
GView* view;
automaton_variant** automaton;
};
GVcsnHandler(GScene** scene,
GView** view,
GVcsnHandler(GScene* scene,
GView* view,
automaton_variant** automaton);
virtual ~GVcsnHandler();
......
......@@ -47,8 +47,8 @@ namespace gui
GState *state = new GState(i, QColor("white"));
state->setPos(pos);
(*(info.scene))->addItem(state);
(*(info.scene))->connectState(state);
info.scene->addItem(state);
info.scene->connectState(state);
}
template<typename Automaton>
......@@ -60,7 +60,7 @@ namespace gui
automaton.del_state(state->index());
delete (state); // removes it from the scene properly.
(*(info.scene))->itemDeselected();
info.scene->itemDeselected();
state = 0;
}
......@@ -74,7 +74,7 @@ namespace gui
automaton.del_transition((htransition_t) transition->index());
delete (transition); // removes it from the scene properly.
(*(info.scene))->itemDeselected();
info.scene->itemDeselected();
transition = 0;
}
} // ! namespace display
......
......@@ -35,8 +35,8 @@ using namespace vcsn;
namespace gui
{
void VcsnAutomaton::paint (GScene** scene,
GView** view,
void VcsnAutomaton::paint (GScene* scene,
GView* view,
display::GLayout layout)
{
if (layout != display::GLAYOUT_NONE)
......@@ -47,8 +47,8 @@ namespace gui
boost::apply_visitor (p, *automaton_);
}
void VcsnAutomaton::set_vcsn_handler (GScene** scene,
GView** view)
void VcsnAutomaton::set_vcsn_handler (GScene* scene,
GView* view)
{
if (vcsn_handler_)
delete vcsn_handler_;
......
......@@ -57,11 +57,11 @@ namespace gui
inline automaton_variant& automaton ();
void set_vcsn_handler (GScene** scene,
GView** view);
void set_vcsn_handler (GScene* scene,
GView* view);
void paint (GScene** scene,
GView** view,
void paint (GScene* scene,
GView* view,
GLayout layout = GLAYOUT_NONE);
void load (QString filename);
void save (QString filename);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment