/**
* @file
* Undo History dialog - implementation.
*/
/* Author:
* Gustav Broberg <broberg@kth.se>
* Abhishek Sharma
* Jon A. Cruz <jon@joncruz.org>
*
* Copyright (C) 2014 Authors
* Released under GNU GPL. Read the file 'COPYING' for more information.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "undo-history.h"
#include <stddef.h>
#include "document.h"
#include "document-undo.h"
#include "inkscape.h"
#include "verbs.h"
#include "util/signal-blocker.h"
#include "desktop.h"
#include <gtkmm/invisible.h>
namespace Inkscape {
namespace UI {
namespace Dialog {
/* Rendering functions for custom cell renderers */
#if WITH_GTKMM_3_0
#else
#endif
{
// 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)
#if WITH_GTKMM_3_0
#else
#endif
} else {
delete icon;
return;
}
delete icon;
}
} else {
}
#if WITH_GTKMM_3_0
#else
#endif
}
#if WITH_GTKMM_3_0
#else
#endif
{
if( _filter(_property_number) ) {
std::ostringstream s;
property_text() = s.str();
#if WITH_GTKMM_3_0
#else
#endif
}
}
{
return *new UndoHistory();
}
_desktop(getDesktop()),
_deskTrack(),
{
// connect with the EventLog
_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));
_desktopChangeConn = _deskTrack.connectDesktopChanged( sigc::mem_fun(*this, &UndoHistory::setDesktop) );
// connect to be informed of document changes
// scroll to the selected row
}
{
}
{
// same desktop set
}
else
{
}
}
{
// disconnect from prior
if (_event_log) {
}
}
{
if (_event_log) {
}
}
{
}
}
{
if (data) {
}
return result;
}
// called *after* _event_log has been destroyed.
{
if (_event_log) {
_event_log = NULL;
}
return NULL;
}
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:fileencoding=utf-8:textwidth=99 :