undo-history.cpp revision e9b6af083e34e2397a8ddbe9781920733d09d151
/** @file
* @brief Undo History dialog - implementation
*/
/* Author:
* Gustav Broberg <broberg@kth.se>
*
* Copyright (C) 2006 Authors
* Released under GNU GPL. Read the file 'COPYING' for more information.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <gtk/gtkimage.h>
#include "document.h"
#include "inkscape.h"
#include "verbs.h"
#include "desktop-handles.h"
#include "undo-history.h"
namespace Inkscape {
namespace UI {
namespace Dialog {
/* Rendering functions for custom cell renderers */
void
{
// if this event type doesn't have an icon...
// if the icon isn't cached, render it to a pixbuf
if ( !_icon_cache[_property_event_type] ) {
if (icon) {
// check icon type (inkscape, gtk, none)
} else {
delete icon;
return;
}
delete icon;
}
} else {
}
}
void
{
if( _filter(_property_number) ) {
std::ostringstream s;
property_text() = s.str();
}
}
{
return *new UndoHistory();
}
void
{
if (!desktop) return;
}
{
_event_list_view.set_rules_hint(false);
_event_list_view.set_enable_search(false);
_event_list_view.set_headers_visible(false);
children_renderer->property_weight() = 600; // =Pango::WEIGHT_SEMIBOLD (not defined in old versions of pangomm)
// connect EventLog callbacks
_event_list_selection->signal_changed().connect(sigc::mem_fun(*this, &Inkscape::UI::Dialog::UndoHistory::_onListSelectionChange));
_event_list_view.signal_row_expanded().connect(sigc::mem_fun(*this, &Inkscape::UI::Dialog::UndoHistory::_onExpandEvent));
_event_list_view.signal_row_collapsed().connect(sigc::mem_fun(*this, &Inkscape::UI::Dialog::UndoHistory::_onCollapseEvent));
// connect with the EventLog
// scroll to the selected row
}
{
}
void
{
/* If no event is selected in the view, find the right one and select it. This happens whenever
* a branch we're currently in is collapsed.
*/
if (!selected) {
if (curr_event->parent()) {
}
_event_log->blockNotifications(false);
} else { // this should not happen
}
} else {
/* Selecting a collapsed parent event is equal to selecting the last child
* of that parent's branch.
*/
{
--selected;
}
// An event before the current one has been selected. Undo to the selected event.
{
while ( selected != last_selected ) {
if ( last_selected->parent() &&
{
} else {
}
}
}
_event_log->blockNotifications(false);
} else { // An event after the current one has been selected. Redo to the selected event.
while ( selected != last_selected ) {
} else {
if ( last_selected->parent() &&
{
}
}
}
_event_log->blockNotifications(false);
}
}
}
void
UndoHistory::_onExpandEvent(const Gtk::TreeModel::iterator &iter, const Gtk::TreeModel::Path &/*path*/)
{
}
}
void
UndoHistory::_onCollapseEvent(const Gtk::TreeModel::iterator &iter, const Gtk::TreeModel::Path &/*path*/)
{
// Collapsing a branch we're currently in is equal to stepping to the last event in that branch
}
_event_log->blockNotifications(false);
}
}
} // namespace Dialog
} // namespace UI
} // namespace Inkscape
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :