2
* Inkscape::UnitTracker - Simple mediator to synchronize changes to a set
6
* Jon A. Cruz <jon@joncruz.org>
8
* Copyright (C) 2007 Jon A. Cruz
10
* Released under GNU GPL, read the file 'COPYING' for more information
13
#ifndef SEEN_INKSCAPE_UNIT_TRACKER_H
14
#define SEEN_INKSCAPE_UNIT_TRACKER_H
18
#include <gtk/gtkaction.h>
20
#include "helper/units.h"
27
UnitTracker( guint bases = (SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE) );
28
virtual ~UnitTracker();
30
void setBase( guint bases ); // SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE
31
void addUnit( SPUnitId id, gint index );
33
bool isUpdating() const;
35
void setActiveUnit( SPUnit const *unit );
36
SPUnit const* getActiveUnit() const;
38
void addAdjustment( GtkAdjustment* adj );
39
void setFullVal( GtkAdjustment* adj, gdouble val );
41
GtkAction* createAction( gchar const* name, gchar const* label, gchar const* tooltip );
44
static void _unitChangedCB( GtkAction* action, gpointer data );
45
static void _actionFinalizedCB( gpointer data, GObject *where_the_object_was );
46
static void _adjustmentFinalizedCB( gpointer data, GObject *where_the_object_was );
47
void _setActive( gint index );
48
void _fixupAdjustments( SPUnit const* oldUnit, SPUnit const *newUnit );
49
void _actionFinalized( GObject *where_the_object_was );
50
void _adjustmentFinalized( GObject *where_the_object_was );
59
std::map <GtkAdjustment*, gdouble> _priorValues;
64
#endif // SEEN_INKSCAPE_UNIT_TRACKER_H
69
c-file-style:"stroustrup"
70
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
75
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :