LunaSysMgr
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
layoutsettings.cpp File Reference
#include "Common.h"
#include "layoutsettings.h"
#include <stdio.h>
#include <string.h>
#include <glib.h>
#include <math.h>
#include <cstdlib>
#include "page.h"
Include dependency graph for layoutsettings.cpp:

Macros

#define SETTINGS_TRACE(...)   (void)0
 
#define KEY_STRING(cat, name, var)
 
#define KEY_QSTRING(cat, name, var)
 
#define KEY_MEMORY_STRING(cat, name, var)
 
#define KEY_BOOLEAN(cat, name, var)
 
#define KEY_INTEGER(cat, name, var)
 
#define KEY_DOUBLE(cat, name, var)
 
#define KEYS_SIZEF(cat, namew, nameh, var)
 
#define KEYS_SIZE(cat, namew, nameh, var)
 
#define KEYS_POINT(cat, namew, nameh, var)
 
#define KEY_COLOR(cat, name, var)
 

Functions

unsigned long _MemStringToBytes (const char *ptr)
 

Macro Definition Documentation

#define KEY_BOOLEAN (   cat,
  name,
  var 
)
Value:
{\
gboolean _vb;\
GError* _error = 0;\
_vb=g_key_file_get_boolean(keyfile,cat,name,&_error);\
if( !_error ) { var=_vb; }\
else g_error_free(_error); \
}
#define KEY_COLOR (   cat,
  name,
  var 
)
Value:
{\
gchar* _vs;\
GError* _error = 0;\
_vs=g_key_file_get_string(keyfile,cat,name,&_error);\
if( !_error && _vs ) \
{ var=QColor((const char*)_vs); \
if (!var.isValid()) { var = QColor(Qt::white);} \
g_free(_vs); \
}\
else g_error_free(_error); \
}
#define KEY_DOUBLE (   cat,
  name,
  var 
)
Value:
{\
double _v;\
GError* _error = 0;\
_v=g_key_file_get_double(keyfile,cat,name,&_error);\
if( !_error ) { var=_v; }\
else g_error_free(_error); \
}
#define KEY_INTEGER (   cat,
  name,
  var 
)
Value:
{\
int _v;\
GError* _error = 0;\
_v=g_key_file_get_integer(keyfile,cat,name,&_error);\
if( !_error ) { var=_v; }\
else g_error_free(_error); \
}
#define KEY_MEMORY_STRING (   cat,
  name,
  var 
)
Value:
{\
gchar* _vs;\
GError* _error = 0;\
_vs=g_key_file_get_string(keyfile,cat,name,&_error);\
if( !_error && _vs ) { var=::_MemStringToBytes((const char*)_vs); g_free(_vs); }\
else g_error_free(_error); \
}
#define KEY_QSTRING (   cat,
  name,
  var 
)
Value:
{\
gchar* _vs;\
GError* _error = 0;\
_vs=g_key_file_get_string(keyfile,cat,name,&_error);\
if( !_error && _vs ) { var=QString((const char*)_vs); g_free(_vs); }\
else g_error_free(_error); \
}
#define KEY_STRING (   cat,
  name,
  var 
)
Value:
{\
gchar* _vs;\
GError* _error = 0;\
_vs=g_key_file_get_string(keyfile,cat,name,&_error);\
if( !_error && _vs ) { var=(const char*)_vs; g_free(_vs); }\
else g_error_free(_error); \
}
#define KEYS_POINT (   cat,
  namew,
  nameh,
  var 
)
Value:
{ \
qint32 _v; \
GError * _error = 0;\
_v = (qint32)g_key_file_get_integer(keyfile,cat,namew,&_error);\
if (!_error) { \
var.setX(_v); \
} \
else { \
g_error_free(_error); \
} \
_error = 0; \
_v = (qint32)g_key_file_get_integer(keyfile,cat,nameh,&_error);\
if (!_error) { \
var.setY(_v); \
} \
else { \
g_error_free(_error); \
} \
}
#define KEYS_SIZE (   cat,
  namew,
  nameh,
  var 
)
Value:
{ \
qint32 _v; \
GError * _error = 0;\
_v = (qint32)g_key_file_get_integer(keyfile,cat,namew,&_error);\
if (!_error) { \
var.setWidth(_v); \
} \
else { \
g_error_free(_error); \
} \
_error = 0; \
_v = (qint32)g_key_file_get_integer(keyfile,cat,nameh,&_error);\
if (!_error) { \
var.setHeight(_v); \
} \
else { \
g_error_free(_error); \
} \
}
#define KEYS_SIZEF (   cat,
  namew,
  nameh,
  var 
)
Value:
{ \
qreal _v; \
GError * _error = 0;\
_v = (qreal)g_key_file_get_double(keyfile,cat,namew,&_error);\
if (!_error) { \
var.setWidth(_v); \
} \
else { \
g_error_free(_error); \
} \
_error = 0; \
_v = (qreal)g_key_file_get_double(keyfile,cat,nameh,&_error);\
if (!_error) { \
var.setHeight(_v); \
} \
else { \
g_error_free(_error); \
} \
}
#define SETTINGS_TRACE (   ...)    (void)0

Function Documentation

unsigned long _MemStringToBytes ( const char *  ptr)