Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

xml_Gui.c File Reference

#include <stdlib.h>
#include <string.h>
#include <xmlparse.h>
#include "debug.h"
#include "macros.h"
#include "Common.h"
#include "Memory.h"
#include "Locale.h"
#include "Skin.h"
#include "Window.h"
#include "xml_Gui.h"

Include dependency graph for xml_Gui.c:

Include dependency graph

Go to the source code of this file.

Data Structures

struct  gxml_GadgetInfo
struct  gxml_UserData

Defines

#define GXML_MAXIMUM_LEVEL   64
#define GXML_TAGLISTSIZE   32
#define ERR_NONE   0
#define ERR_OUT_OF_MEMORY   1
#define ERR_INVALID_DATATYPE   2
#define ERR_CANT_CREATE_GADGET   3
#define ERR_TOO_DEEP_HIERARCHY   4
#define ERR_ILLEGAL_CLASS   5
#define ERR_VALIDATE_ERROR   6
#define ERR_XML_ERROR   7
#define ERR_REQUIRED_MISSING   8
#define ERR_TYPE_MISMATCH   9

Functions

int gxml_HandleAttr (struct gxml_UserData *u, tag *curr_tag, char *name, char *value, gadget_Binding_t *bind)
void gxml_StartElement (void *userData, const char *name, const char **atts)
void gxml_EndElement (void *userData, const char *name)
int gxml_CheckGui (gadget_Check_t *check, List_t *gadget_list)
u32 gxml_CreateGadgetTree (u32 firsttag,...)
u32 gxml_CreateGadgetTreeTL (tag *taglist)
int gxml_Init (void)
void gxml_CleanUp (void)
u32 gxml_Call (int function, u32 firsttag,...)
u32 gxml_CallTL (int function, tag *taglist)

Variables

u32(* call_vector [GXML_FUNC_DONE-GXML_FUNCBASE+1])(tag *)
char * errstr []


Define Documentation

#define ERR_CANT_CREATE_GADGET   3
 

Definition at line 74 of file xml_Gui.c.

Referenced by gxml_StartElement.

#define ERR_ILLEGAL_CLASS   5
 

Definition at line 76 of file xml_Gui.c.

Referenced by gxml_StartElement.

#define ERR_INVALID_DATATYPE   2
 

Definition at line 73 of file xml_Gui.c.

#define ERR_NONE   0
 

Definition at line 71 of file xml_Gui.c.

#define ERR_OUT_OF_MEMORY   1
 

Definition at line 72 of file xml_Gui.c.

Referenced by gxml_CreateGadgetTreeTL, and gxml_StartElement.

#define ERR_REQUIRED_MISSING   8
 

Definition at line 79 of file xml_Gui.c.

Referenced by gxml_CheckGui.

#define ERR_TOO_DEEP_HIERARCHY   4
 

Definition at line 75 of file xml_Gui.c.

Referenced by gxml_StartElement.

#define ERR_TYPE_MISMATCH   9
 

Definition at line 80 of file xml_Gui.c.

Referenced by gxml_CheckGui.

#define ERR_VALIDATE_ERROR   6
 

Definition at line 77 of file xml_Gui.c.

#define ERR_XML_ERROR   7
 

Definition at line 78 of file xml_Gui.c.

Referenced by gxml_CreateGadgetTreeTL.

#define GXML_MAXIMUM_LEVEL   64
 

Definition at line 41 of file xml_Gui.c.

Referenced by gxml_StartElement.

#define GXML_TAGLISTSIZE   32
 

Definition at line 42 of file xml_Gui.c.

Referenced by gxml_StartElement.


Function Documentation

u32 gxml_Call int    function,
u32    firsttag,
...   
 

Definition at line 404 of file xml_Gui.c.

References gxml_CallTL, and u32.

Referenced by gxml_Init.

u32 gxml_CallTL int    function,
tag   taglist
 

Definition at line 408 of file xml_Gui.c.

References call_vector, debug_Begin, debug_End, debug_Message, debug_Warning, GXML_FUNC_DONE, GXML_FUNCBASE, and u32.

Referenced by gxml_Init.

int gxml_CheckGui gadget_Check_t   check,
List_t   gadget_list
[static]
 

Definition at line 260 of file xml_Gui.c.

References gadget_Check_t::class_name, gxml_GadgetInfo::class_name, debug_Begin, debug_End, ERR_REQUIRED_MISSING, ERR_TYPE_MISMATCH, gadget_Check_t::flags, gxml_GadgetInfo::gadget_id, gadget_Check_t::gadget_id, GADGET_ILLEGAL_ID, GADGET_REQUIRED, list_GetNodeHead, list_GetNodeNext, and NULL.

Referenced by gxml_CreateGadgetTreeTL.

void gxml_CleanUp void   
 

Definition at line 395 of file xml_Gui.c.

References debug_Begin, and debug_End.

Referenced by gui_CleanUp.

u32 gxml_CreateGadgetTree u32    firsttag,
...   
 

Parameters:
TAG_GXML_XML_FILE  char *
TAG_GXML_LOCALE  Locale_t *
TAG_GXML_TYPE  char *
TAG_GXML_LAYOUTNAME  char *
TAG_GXML_APPNAME  char *
TAG_GXML_WINDOW  Window_t *
TAG_GXML_CHECK  gadget_Check_t *

Definition at line 296 of file xml_Gui.c.

References gxml_CreateGadgetTreeTL, and u32.

u32 gxml_CreateGadgetTreeTL tag   taglist
 

Definition at line 300 of file xml_Gui.c.

References gxml_UserData::appname, gxml_UserData::check, gxml_UserData::commonbind, debug_Begin, debug_End, debug_Error, gxml_UserData::err, ERR_OUT_OF_MEMORY, ERR_XML_ERROR, errstr, gadget_DeleteSubtree, gadget_GetCommonBind, gxml_UserData::gadget_id_base, gxml_UserData::gadget_list, gxml_UserData::gadgets, gxml_CheckGui, gxml_EndElement, gxml_StartElement, gxml_UserData::layoutname, gxml_UserData::layouttype, gxml_UserData::level, list_CreateList, list_DeleteList, list_DeleteNode, list_GetNodeData, list_GetNodeHead, list_GetNodeNext, list_RemoveNode, list_SetNodeData, gxml_UserData::locale, mem_free, mem_malloc, NULL, gxml_UserData::status, TAG_DONE, TAG_GADGET_OBJECT, tag_GetTagData, TAG_GXML_APPNAME, TAG_GXML_CHECK, TAG_GXML_LAYOUTNAME, TAG_GXML_LOCALE, TAG_GXML_TYPE, TAG_GXML_WINDOW, TAG_GXML_XML_FILE, gxml_UserData::tree, TRUE, u32, and gxml_UserData::window.

Referenced by gxml_Init.

void gxml_EndElement void *    userData,
const char *    name
[static]
 

Definition at line 246 of file xml_Gui.c.

References debug_Begin, debug_End, gxml_UserData::level, and gxml_UserData::status.

Referenced by gxml_CreateGadgetTreeTL.

int gxml_HandleAttr struct gxml_UserData   u,
tag   curr_tag,
char *    name,
char *    value,
gadget_Binding_t   bind
[static]
 

Definition at line 104 of file xml_Gui.c.

References gxml_UserData::commonbind, tag::Data, debug_Begin, debug_End, gadget_Bind, gxml_UserData::locale, tag::Name, NULL, TAG_DONE, TAG_GADGET_BINDING, TAG_GADGET_LOCALE, TAG_GADGET_NAME, TAG_GADGET_TAGNAME, TAG_GADGET_TAGVALUE, TAG_GADGET_VALUE, and TAG_SKIP.

Referenced by gxml_StartElement.

int gxml_Init void   
 

Definition at line 387 of file xml_Gui.c.

References call_vector, gxml_Call, gxml_CallTL, GXML_CREATEGADGETTREE, gxml_CreateGadgetTreeTL, and GXML_FUNCBASE.

Referenced by gui_Init.

void gxml_StartElement void *    userData,
const char *    name,
const char **    atts
[static]
 

Definition at line 122 of file xml_Gui.c.

References gxml_UserData::appname, gadget_ClassData_t::class_name, gxml_GadgetInfo::class_name, gadget_Descriptor_s::class_name, common_GetAttr, tag::Data, debug_Begin, debug_End, debug_Error, gxml_UserData::err, ERR_CANT_CREATE_GADGET, ERR_ILLEGAL_CLASS, ERR_OUT_OF_MEMORY, ERR_TOO_DEEP_HIERARCHY, gadget_FindClassByName, gxml_GadgetInfo::gadget_id, gadget_Descriptor_s::gadget_id, gxml_UserData::gadget_id_base, GADGET_ILLEGAL_ID, gxml_UserData::gadget_list, gadget_LoadClass, gadget_New, GADGET_SUBGADGET_BASE, GADGET_SYSBASE, gxml_UserData::gadgets, gxml_HandleAttr, GXML_MAXIMUM_LEVEL, GXML_TAGLISTSIZE, gxml_UserData::layoutname, gxml_UserData::layouttype, gadget_Descriptor_s::level, gxml_UserData::level, list_CreateNode, list_InsertNodeTail, list_SetNodeData, mem_free, mem_malloc, tag::Name, NULL, gxml_UserData::status, TAG_DONE, TAG_GADGET_CLASS_NAME, TAG_GADGET_DESCRIPTOR, TAG_GADGET_PARENT, TAG_GADGET_WINDOW, gxml_UserData::taglist, gadget_Descriptor_s::taglist, gadget_Descriptor_s::weight, gxml_UserData::window, window_GetApp, and gadget_ClassData_t::xmlbinding.

Referenced by gxml_CreateGadgetTreeTL.


Variable Documentation

u32(* call_vector[GXML_FUNC_DONE-GXML_FUNCBASE+1])(tag *) [static]
 

Definition at line 83 of file xml_Gui.c.

Referenced by gxml_CallTL, and gxml_Init.

char* errstr[] [static]
 

Initial value:

{
  "OK",
  "Out of memory",
  "Invalid datatype",
  "Can't create gadget",
  "Too deep hierarchy",
  "Illegal class",
  "Validate error",
  "XML error",
  "Required ID missing",
  "Type mismatch",
  NULL
}

Definition at line 87 of file xml_Gui.c.

Referenced by gxml_CreateGadgetTreeTL.


Generated on Tue Jan 7 12:13:03 2003 for THEGUI by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002