prefs-utils.cpp revision 973c92f3bdd6e7877e29e556eff3d9675df1be35
/*
* Utility functions for reading and setting preferences
*
* Authors:
* bulia byak <bulia@dr.com>
*
* Copyright (C) 2003 authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "inkscape.h"
/**
\brief Checks if the path exists in the preference file
*/
}
/**
\brief returns the number of sub-prefs
*/
int nb_child = 0;
while (child_repr) {
nb_child ++;
}
return nb_child;
}
/**
\brief creates a new preference and returns its key on success.
*/
}
/**
\brief gets the list of children from a pref. Please free all that stuff after use.
*/
if (! father ) return false;
while (child_repr) {
*children = g_slist_prepend(*children, g_strdup_printf("%s.%s",father_path,child_repr->attribute("id")));
}
}
/**
\brief gets the nth children of a pref, starting from one (first child <=> n=1). returns NULL if out of bounds or father does not exist. Please free all that stuff after use.
*/
if (n <= 0) return NULL;
unsigned int index = 0;
while (child_repr && (++index < n)) {
}
return NULL;
}
void
{
if (repr) {
}
}
long long int
{
if (repr) {
} else {
return def;
}
}
/**
\brief Retrieves an int attribute guarding against screwed-up data; if the value is beyond limits, default is returned
*/
long long int
prefs_get_int_attribute_limited(gchar const *path, gchar const *attr, long long int def, long long int min, long long int max)
{
if (repr) {
return v;
} else {
return def;
}
} else {
return def;
}
}
void
{
if (repr) {
}
}
double
{
if (repr) {
} else {
return def;
}
}
/**
\brief Retrieves an int attribute guarding against screwed-up data; if the value is beyond limits, default is returned
*/
double
prefs_get_double_attribute_limited(gchar const *path, gchar const *attr, double def, double min, double max)
{
if (repr) {
return v;
} else {
return def;
}
} else {
return def;
}
}
gchar const *
{
if (repr) {
}
return NULL;
}
void
{
if (repr) {
}
}
void
{
if (recent) {
// remove excess recent files
// count to the last
}
// remove all after the last
while (child) {
}
}
if (max_documents > 0) {
if (child) {
} else {
}
}
}
}
}
gchar const **
{
if (recent) {
gint i;
{
}
return datalst;
}
return NULL;
}
/*
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:encoding=utf-8:textwidth=99 :