1
#ifndef SEEN_NUMBER_OPT_NUMBER_H
2
#define SEEN_NUMBER_OPT_NUMBER_H
5
* <number-opt-number> implementation.
9
* Hugo Rodrigues <haa.rodrigues@gmail.com>
11
* Copyright (C) 2006 Hugo Rodrigues
13
* Released under GNU GPL, read the file 'COPYING' for more information
21
#include <glib/gprintf.h>
22
//todo: use glib instead of stdlib
24
#include "svg/stringstream.h"
27
gdouble fixed_g_ascii_strtod (const gchar *nptr, gchar **endptr);
29
class NumberOptNumber {
39
guint optNumber_set : 1;
47
optNumber_set = FALSE;
64
void setOptNumber(gfloat num)
70
void setNumber(gfloat num)
84
gchar *getValueString()
86
Inkscape::SVGOStringStream os;
93
os << number << " " << optNumber;
99
return g_strdup(os.str().c_str());
102
void set(gchar const *str)
107
gchar **values = g_strsplit(str, " ", 2);
109
if( values[0] != NULL )
111
number = g_ascii_strtod(values[0], NULL);
114
if( values[1] != NULL )
116
optNumber = g_ascii_strtod(values[1], NULL);
117
optNumber_set = TRUE;
120
optNumber_set = FALSE;
124
optNumber_set = FALSE;
130
#endif /* !SEEN_NUMBER_OPT_NUMBER_H */
135
c-file-style:"stroustrup"
136
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
141
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :