random.cpp revision d791add241565753096af6b57e311558db1328b6
/**
* \brief Scalar Widget - A labelled text box, with spin buttons and optional
* icon or suffix, for entering arbitrary number values. It adds an extra
* number called "startseed", that is not UI edittable, but should be put in SVG.
* This does NOT generate a random number, but provides merely the saving of
* the startseed value.
*
* Authors:
* Carl Hetherington <inkscape@carlh.net>
* Derek P. Moore <derekm@hackunix.org>
* Bryce Harrington <bryce@bryceharrington.org>
*
* Copyright (C) 2004 Carl Hetherington
*
* Released under GNU GPL. Read the file 'COPYING' for more information.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "random.h"
namespace Inkscape {
namespace UI {
namespace Widget {
/**
* Construct a Random scalar Widget.
*
* \param label Label.
* \param suffix Suffix, placed after the widget (defaults to "").
* \param icon Icon filename, placed before the label (defaults to "").
* \param mnemonic Mnemonic toggle; if true, an underscore (_) in the label
* indicates the next character should be used for the
* mnemonic accelerator key (defaults to false).
*/
bool mnemonic)
{
startseed = 0;
}
/**
* Construct a Random Scalar Widget.
*
* \param label Label.
* \param digits Number of decimal digits to display.
* \param suffix Suffix, placed after the widget (defaults to "").
* \param icon Icon filename, placed before the label (defaults to "").
* \param mnemonic Mnemonic toggle; if true, an underscore (_) in the label
* indicates the next character should be used for the
* mnemonic accelerator key (defaults to false).
*/
unsigned digits,
bool mnemonic)
{
startseed = 0;
}
/**
* Construct a Random Scalar Widget.
*
* \param label Label.
* \param adjust Adjustment to use for the SpinButton.
* \param digits Number of decimal digits to display (defaults to 0).
* \param suffix Suffix, placed after the widget (defaults to "").
* \param icon Icon filename, placed before the label (defaults to "").
* \param mnemonic Mnemonic toggle; if true, an underscore (_) in the label
* indicates the next character should be used for the
* mnemonic accelerator key (defaults to true).
*/
unsigned digits,
bool mnemonic)
{
startseed = 0;
}
/** Gets the startseed */
long
Random::getStartSeed() const
{
return startseed;
}
/** Sets the startseed number */
void
{
}
/** Add reseed button to the widget */
void
{
_tooltips.set_tip(*pButton, _("Reseed the random number generator; this creates a different sequence of random numbers."));
}
void
{
startseed = g_random_int();
}
} // namespace Widget
} // 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 :