ruler.cpp revision 584e74d32e520855b500ecc8bdb6c661d2291ab6
/** \file
* in desktop-events.cpp
*/
/*
* Authors:
* Ralf Stephan <ralf@ark.in-berlin.de>
* Lauris Kaplinski
* Jon A. Cruz <jon@joncruz.org>
* Abhishek Sharma
*
* Copyright (C) 2005 Ralf Stephan
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "display/sp-canvas.h"
#include "display/guideline.h"
#include "desktop.h"
#include "desktop-handles.h"
#include "document.h"
#include "document-undo.h"
#include "sp-namedview.h"
#include "verbs.h"
namespace Inkscape {
namespace UI {
namespace Widget {
void
{
_canvas_widget = &w;
_dragging = false;
_guide = 0;
}
void
{
}
void
{
}
/// Set metric from namedview
void
{
if (!_dt) return;
}
/// Returns text to be used for tooltip for ruler.
/// \todo incorrect
{
: &sp_unit_get_by_id(SP_UNIT_PT) ));
}
/// Helper that gets mouse coordinates relative to canvas widget.
void
Ruler::canvas_get_pointer(int &x, int &y)
{
}
{
}
bool
{
_dragging = true;
_guide = sp_guideline_new(_dt->guides, NULL, event_dt, _horiz_f ? Geom::Point(0.,1.) : Geom::Point(1.,0.));
(void) get_window()->pointer_grab(false,
}
return false;
}
bool
{
if (_dragging) {
}
return false;
}
bool
{
_guide = 0;
_dragging = false;
/* TODO: annotate */ "ruler.cpp:157");
}
}
return false;
}
//------------------------------------------------------------
{
_dt = 0;
_horiz_f = true;
}
{
}
{
_dt = 0;
_horiz_f = false;
}
{
}
}}}
/*
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 :