liberregxml/src/erregtoolbar.c File Reference

liberreg - ereader toolbar registry(read only) loading and unloading functions getting functions free memory functions More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "erreglog.h"
#include "erreg.h"
#include "erregtoolbar.h"
#include "erregtypes_f.h"
#include "erregxml.h"

Go to the source code of this file.

Functions

static void tbRegInitXpathList (regRegistry_t *pRegistry)
static void tbRegDestroyXpathList (regRegistry_t *pRegistry)
regLoad_t tbRegLoad (regRegistry_t **ppRegistry)
void tbRegUnload (regRegistry_t *pRegistry)
regIconSet_ttbRegGetIconSet (regRegistry_t *pRegistry)
void tbRegFreeIconSet (regIconSet_t *theIconSet)


Detailed Description

liberreg - ereader toolbar registry(read only) loading and unloading functions getting functions free memory functions

Copyright (C) 2007 iRex Technologies B.V. All rights reserved.

Definition in file erregtoolbar.c.


Function Documentation

static void tbRegDestroyXpathList ( regRegistry_t pRegistry  )  [static]

Definition at line 54 of file erregtoolbar.c.

00055 {
00056     ERREG_TOOLBAR_LOGPRINTF("entry[%p]", pRegistry);
00057     g_assert(pRegistry);
00058 
00059     g_free(pRegistry->xpaths);
00060     pRegistry->xpaths = NULL;
00061 }

void tbRegFreeIconSet ( regIconSet_t theIconSet  ) 

Definition at line 116 of file erregtoolbar.c.

00117 {
00118     ERREG_TOOLBAR_LOGPRINTF("entry");
00119 
00120     if (theIconSet)
00121     {
00122         regFreeIconSet(theIconSet);
00123     }
00124 }

Here is the call graph for this function:

regIconSet_t* tbRegGetIconSet ( regRegistry_t pRegistry  ) 

Definition at line 102 of file erregtoolbar.c.

00103 {
00104     ERREG_TOOLBAR_LOGPRINTF("entry");
00105     
00106     regIconSet_t *theIconSet = NULL;
00107     
00108     if (pRegistry)
00109     {
00110         theIconSet = regGetIconSet(pRegistry);
00111     }
00112     
00113     return theIconSet;
00114 }

Here is the call graph for this function:

static void tbRegInitXpathList ( regRegistry_t pRegistry  )  [static]

Definition at line 40 of file erregtoolbar.c.

00041 {
00042     ERREG_TOOLBAR_LOGPRINTF("entry[%p]", pRegistry);
00043     g_assert(pRegistry);
00044 
00045     xpathList_t *xpaths = g_new0(xpathList_t, 1);
00046     g_assert(xpaths);
00047 
00048     xpaths->toolbarIcons = "/" EL_REGISTRY_ROOT "/" EL_TOOLBAR_ICONS;
00049     xpaths->toolbarIcon  = "/" EL_REGISTRY_ROOT "/" EL_TOOLBAR_ICONS "/" EL_TOOLBAR_ICON;
00050 
00051     pRegistry->xpaths = xpaths;
00052 }

regLoad_t tbRegLoad ( regRegistry_t **  ppRegistry  ) 

Definition at line 63 of file erregtoolbar.c.

00064 {
00065     ERREG_TOOLBAR_LOGPRINTF("entry");
00066 
00067     regRegistry_t* pRegistry = NULL;
00068     regLoad_t ret;
00069 
00070     pRegistry = regParseFiles(REG_TOOLBAR_XML_PATH, REG_TOOLBAR_XSD_PATH); 
00071     if (pRegistry)
00072     {
00073         ERREG_TOOLBAR_LOGPRINTF("Loading toolbar registry succeeded.");
00074         ret = loadOk_t;
00075     }
00076     else
00077     {
00078         ERREG_TOOLBAR_ERRORPRINTF("Loading toolbar registry failed.");
00079         ret = loadError_t;
00080     }
00081 
00082     if (pRegistry)
00083     {
00084         tbRegInitXpathList(pRegistry);
00085     }
00086 
00087     *ppRegistry = pRegistry;
00088      return ret;
00089 }

Here is the call graph for this function:

void tbRegUnload ( regRegistry_t pRegistry  ) 

Definition at line 91 of file erregtoolbar.c.

00092 {
00093     ERREG_TOOLBAR_LOGPRINTF("entry[%p]", pRegistry);
00094 
00095     if (pRegistry)
00096     {
00097         tbRegDestroyXpathList(pRegistry);
00098         regDestroy(pRegistry);
00099     }
00100 }

Here is the call graph for this function:


Generated on Sun Dec 14 17:12:22 2008 by  doxygen 1.5.6