Eneboo - Documentación para desarrolladores
'defines' | Funciones
Referencia del Archivo src/plugins/styles/qtcurve/config_file.cpp
#include "common.h"
#include "config_file.h"
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <pwd.h>

'defines'

#define CONFIG_FILE   "stylerc"
#define OLD_CONFIG_FILE   "qtcurvestylerc"
#define VERSION_KEY   "version"
#define ATOH(str)   ((c2h(*str)<<4)+c2h(*(str+1)))
#define TO_LATIN1(A)   A
#define CFG_READ_COLOR(ENTRY)
#define CFG_READ_IMAGE(ENTRY)
#define CFG_READ_STRING_LIST(ENTRY)
#define CFG_READ_BOOL(ENTRY)   opts->ENTRY=readBoolEntry(cfg, #ENTRY, def->ENTRY);
#define CFG_READ_ROUND(ENTRY)   opts->ENTRY=toRound(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_INT(ENTRY)   opts->ENTRY=readNumEntry(cfg, #ENTRY, def->ENTRY);
#define CFG_READ_INT_BOOL(ENTRY, DEF)
#define CFG_READ_TB_BORDER(ENTRY)   opts->ENTRY=toTBarBorder(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_MOUSE_OVER(ENTRY)   opts->ENTRY=toMouseOver(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_APPEARANCE(ENTRY, ALLOW)   opts->ENTRY=toAppearance(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY, ALLOW, NULL, false);
#define CFG_READ_APPEARANCE_PIXMAP(ENTRY, ALLOW, PIXMAP, CHECK)   opts->ENTRY=toAppearance(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY, ALLOW, PIXMAP, CHECK);
#define CFG_READ_STRIPE(ENTRY)   opts->ENTRY=toStripe(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_SLIDER(ENTRY)   opts->ENTRY=toSlider(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_DEF_BTN(ENTRY)   opts->ENTRY=toInd(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_LINE(ENTRY)   opts->ENTRY=toLine(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_SHADE(ENTRY, AD, MENU_STRIPE, COL)   opts->ENTRY=toShade(TO_LATIN1(readStringEntry(cfg, #ENTRY)), AD, def->ENTRY, MENU_STRIPE, COL);
#define CFG_READ_SCROLLBAR(ENTRY)   opts->ENTRY=toScrollbar(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_FRAME(ENTRY)   opts->ENTRY=toFrame(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_EFFECT(ENTRY)   opts->ENTRY=toEffect(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_SHADING(ENTRY)   opts->ENTRY=toShading(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_ECOLOR(ENTRY)   opts->ENTRY=toEColor(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_FOCUS(ENTRY)   opts->ENTRY=toFocus(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_TAB_MO(ENTRY)   opts->ENTRY=toTabMo(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_GRAD_TYPE(ENTRY)   opts->ENTRY=toGradType(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_LV_LINES(ENTRY)   opts->ENTRY=toLvLines(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_GLOW(ENTRY)   opts->ENTRY=toGlow(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_TBAR_BTN(ENTRY)   opts->ENTRY=toTBarBtn(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);

Funciones

const char * qtcConfDir ()
void qtcSetRgb (color *col, const char *str)
const char * qtcGetHome ()
WindowBorders qtcGetWindowBorderSize (bool force)
bool qtcBarHidden (const char *app, const char *prefix)
void qtcSetBarHidden (const char *app, bool hidden, const char *prefix)
void qtcLoadBgndImage (QtCImage *img)
void qtcDefaultSettings (Options *opts)
void qtcCheckConfig (Options *opts)
bool qtcReadConfig (const char *file, Options *opts, Options *defOpts)

Documentación de los 'defines'

#define ATOH (   str)    ((c2h(*str)<<4)+c2h(*(str+1)))
#define CFG_READ_APPEARANCE (   ENTRY,
  ALLOW 
)    opts->ENTRY=toAppearance(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY, ALLOW, NULL, false);
#define CFG_READ_APPEARANCE_PIXMAP (   ENTRY,
  ALLOW,
  PIXMAP,
  CHECK 
)    opts->ENTRY=toAppearance(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY, ALLOW, PIXMAP, CHECK);
#define CFG_READ_BOOL (   ENTRY)    opts->ENTRY=readBoolEntry(cfg, #ENTRY, def->ENTRY);
#define CFG_READ_COLOR (   ENTRY)
Valor:
{ \
        const char *str=readStringEntry(cfg, #ENTRY); \
    \
        if(str && 0!=str[0]) \
            qtcSetRgb(&(opts->ENTRY), str); \
        else \
            opts->ENTRY=def->ENTRY; \
    }
#define CFG_READ_DEF_BTN (   ENTRY)    opts->ENTRY=toInd(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_ECOLOR (   ENTRY)    opts->ENTRY=toEColor(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_EFFECT (   ENTRY)    opts->ENTRY=toEffect(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_FOCUS (   ENTRY)    opts->ENTRY=toFocus(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_FRAME (   ENTRY)    opts->ENTRY=toFrame(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_GLOW (   ENTRY)    opts->ENTRY=toGlow(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_GRAD_TYPE (   ENTRY)    opts->ENTRY=toGradType(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_IMAGE (   ENTRY)
Valor:
{ \
        opts->ENTRY.type=toImageType(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY.type); \
        opts->ENTRY.loaded=false; \
        if(IMG_FILE==opts->ENTRY.type) \
        { \
            const char *file=readStringEntry(cfg, #ENTRY ".file"); \
            if(file) \
            { \
                opts->ENTRY.pixmap.file=file; \
                opts->ENTRY.width=readNumEntry(cfg, #ENTRY ".width", 0); \
                opts->ENTRY.height=readNumEntry(cfg, #ENTRY ".height", 0); \
                opts->ENTRY.onBorder=readBoolEntry(cfg, #ENTRY ".onBorder", false); \
                opts->ENTRY.pos=(EPixPos)readNumEntry(cfg, #ENTRY ".pos", (int)PP_TR); \
            } \
            else \
            { \
                opts->ENTRY.type=IMG_NONE; \
            } \
        } \
    }
#define CFG_READ_INT (   ENTRY)    opts->ENTRY=readNumEntry(cfg, #ENTRY, def->ENTRY);
#define CFG_READ_INT_BOOL (   ENTRY,
  DEF 
)
Valor:
if(readBoolEntry(cfg, #ENTRY, false)) \
        opts->ENTRY=DEF; \
    else \
        opts->ENTRY=readNumEntry(cfg, #ENTRY, def->ENTRY);
#define CFG_READ_LINE (   ENTRY)    opts->ENTRY=toLine(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_LV_LINES (   ENTRY)    opts->ENTRY=toLvLines(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_MOUSE_OVER (   ENTRY)    opts->ENTRY=toMouseOver(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_ROUND (   ENTRY)    opts->ENTRY=toRound(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_SCROLLBAR (   ENTRY)    opts->ENTRY=toScrollbar(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_SHADE (   ENTRY,
  AD,
  MENU_STRIPE,
  COL 
)    opts->ENTRY=toShade(TO_LATIN1(readStringEntry(cfg, #ENTRY)), AD, def->ENTRY, MENU_STRIPE, COL);
#define CFG_READ_SHADING (   ENTRY)    opts->ENTRY=toShading(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_SLIDER (   ENTRY)    opts->ENTRY=toSlider(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_STRING_LIST (   ENTRY)
Valor:
{ \
        const gchar *str=readStringEntry(cfg, #ENTRY); \
        if(str && 0!=str[0]) \
            opts->ENTRY=g_strsplit(str, ",", -1); \
        else if(def->ENTRY) \
        { \
            opts->ENTRY=def->ENTRY; \
            def->ENTRY=NULL; \
        } \
    }
#define CFG_READ_STRIPE (   ENTRY)    opts->ENTRY=toStripe(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_TAB_MO (   ENTRY)    opts->ENTRY=toTabMo(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_TB_BORDER (   ENTRY)    opts->ENTRY=toTBarBorder(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CFG_READ_TBAR_BTN (   ENTRY)    opts->ENTRY=toTBarBtn(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define CONFIG_FILE   "stylerc"
#define OLD_CONFIG_FILE   "qtcurvestylerc"
#define TO_LATIN1 (   A)    A
#define VERSION_KEY   "version"

Documentación de las funciones

bool qtcBarHidden ( const char *  app,
const char *  prefix 
)
void qtcCheckConfig ( Options opts)
const char * qtcConfDir ( )
void qtcDefaultSettings ( Options opts)
const char* qtcGetHome ( )
WindowBorders qtcGetWindowBorderSize ( bool  force)
void qtcLoadBgndImage ( QtCImage img)
bool qtcReadConfig ( const char *  file,
Options opts,
Options defOpts 
)
void qtcSetBarHidden ( const char *  app,
bool  hidden,
const char *  prefix 
)
void qtcSetRgb ( color col,
const char *  str 
)
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'