gwenhywfar  4.3.3
g_table.c
Go to the documentation of this file.
1 /***************************************************************************
2  begin : Mon Feb 22 2010
3  copyright : (C) 2010 by Martin Preuss
4  email : martin@libchipcard.de
5 
6  ***************************************************************************
7  * Please see toplevel file COPYING for license details *
8  ***************************************************************************/
9 
10 #ifdef HAVE_CONFIG_H
11 # include <config.h>
12 #endif
13 
14 #define DISABLE_DEBUGLOG
15 
16 
17 #include "g_table_p.h"
18 #include "g_generic_l.h"
19 #include "htmlctx_l.h"
20 #include "o_grid_l.h"
21 #include "g_tablerow_l.h"
22 
23 #include <gwenhywfar/debug.h>
24 
25 
26 
27 HTML_GROUP *HtmlGroup_Table_new(const char *groupName,
28  HTML_GROUP *parent,
29  GWEN_XML_CONTEXT *ctx) {
30  HTML_GROUP *g;
31 
32  /* create base group */
33  g=HtmlGroup_Generic_new(groupName, parent, ctx);
34  assert(g);
35 
36  /* set virtual functions */
39 
40  return g;
41 }
42 
43 
44 
45 int HtmlGroup_Table_StartTag(HTML_GROUP *g, const char *tagName) {
46  HTML_GROUP *gNew=NULL;
47  GWEN_XML_CONTEXT *ctx;
48 
49  assert(g);
50 
52 
53  if (strcasecmp(tagName, "tr")==0) {
54  HTML_OBJECT *o;
55  int rows;
56 
58  assert(o);
60 
61  /* Create new parser group with new properties but use the same object */
62  gNew=HtmlGroup_TableRow_new(tagName, g, ctx);
63  HtmlGroup_TableRow_SetRow(gNew, rows);
65  HtmlObject_Grid_SetRows(o, ++rows);
66  HtmlGroup_SetObject(gNew, o);
67  }
68  else {
70  "Unexpected group [%s]", tagName);
71  return GWEN_ERROR_BAD_DATA;
72  }
73 
74  if (gNew) {
75  HtmlCtx_SetCurrentGroup(ctx, gNew);
77  }
78 
79  return 0;
80 }
81 
82 
83 
85  GWEN_XML_CONTEXT *ctx;
86  const char *s;
87 
88  assert(g);
89 
91 
93  if (strcasecmp(s, "tr")==0) {
94  HTML_OBJECT *o;
95  int i;
96  int j;
97 
101  if (j>i)
103  }
104 
105  return 0;
106 }
107 
108 
109 
110 
111 
112 
113 
114 
115