Initial refactoring.
refs #35
#include "lexycal.yy.h"
#include "rptreport_priv.h"
-void yyerror (RptReport *rpt_report, gint row, gchar **ret, char const *s);
+void yyerror (RptReport *rpt_report, gchar **ret, char const *s);
/* Line 189 of yacc.c */
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint8 yyrline[] =
{
- 0, 32, 32, 33, 36, 39, 40, 41, 42, 43,
- 44, 45, 46, 47, 48, 49
+ 0, 31, 31, 32, 35, 38, 39, 40, 41, 42,
+ 43, 44, 45, 46, 47, 48
};
#endif
} \
else \
{ \
- yyerror (rpt_report, row, ret, YY_("syntax error: cannot back up")); \
+ yyerror (rpt_report, ret, YY_("syntax error: cannot back up")); \
YYERROR; \
} \
while (YYID (0))
{ \
YYFPRINTF (stderr, "%s ", Title); \
yy_symbol_print (stderr, \
- Type, Value, rpt_report, row, ret); \
+ Type, Value, rpt_report, ret); \
YYFPRINTF (stderr, "\n"); \
} \
} while (YYID (0))
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, RptReport *rpt_report, gint row, gchar **ret)
+yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, RptReport *rpt_report, gchar **ret)
#else
static void
-yy_symbol_value_print (yyoutput, yytype, yyvaluep, rpt_report, row, ret)
+yy_symbol_value_print (yyoutput, yytype, yyvaluep, rpt_report, ret)
FILE *yyoutput;
int yytype;
YYSTYPE const * const yyvaluep;
RptReport *rpt_report;
- gint row;
gchar **ret;
#endif
{
if (!yyvaluep)
return;
YYUSE (rpt_report);
- YYUSE (row);
YYUSE (ret);
# ifdef YYPRINT
if (yytype < YYNTOKENS)
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, RptReport *rpt_report, gint row, gchar **ret)
+yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, RptReport *rpt_report, gchar **ret)
#else
static void
-yy_symbol_print (yyoutput, yytype, yyvaluep, rpt_report, row, ret)
+yy_symbol_print (yyoutput, yytype, yyvaluep, rpt_report, ret)
FILE *yyoutput;
int yytype;
YYSTYPE const * const yyvaluep;
RptReport *rpt_report;
- gint row;
gchar **ret;
#endif
{
else
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
- yy_symbol_value_print (yyoutput, yytype, yyvaluep, rpt_report, row, ret);
+ yy_symbol_value_print (yyoutput, yytype, yyvaluep, rpt_report, ret);
YYFPRINTF (yyoutput, ")");
}
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
-yy_reduce_print (YYSTYPE *yyvsp, int yyrule, RptReport *rpt_report, gint row, gchar **ret)
+yy_reduce_print (YYSTYPE *yyvsp, int yyrule, RptReport *rpt_report, gchar **ret)
#else
static void
-yy_reduce_print (yyvsp, yyrule, rpt_report, row, ret)
+yy_reduce_print (yyvsp, yyrule, rpt_report, ret)
YYSTYPE *yyvsp;
int yyrule;
RptReport *rpt_report;
- gint row;
gchar **ret;
#endif
{
YYFPRINTF (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
&(yyvsp[(yyi + 1) - (yynrhs)])
- , rpt_report, row, ret);
+ , rpt_report, ret);
YYFPRINTF (stderr, "\n");
}
}
# define YY_REDUCE_PRINT(Rule) \
do { \
if (yydebug) \
- yy_reduce_print (yyvsp, Rule, rpt_report, row, ret); \
+ yy_reduce_print (yyvsp, Rule, rpt_report, ret); \
} while (YYID (0))
/* Nonzero means print parse trace. It is left uninitialized so that
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
-yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, RptReport *rpt_report, gint row, gchar **ret)
+yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, RptReport *rpt_report, gchar **ret)
#else
static void
-yydestruct (yymsg, yytype, yyvaluep, rpt_report, row, ret)
+yydestruct (yymsg, yytype, yyvaluep, rpt_report, ret)
const char *yymsg;
int yytype;
YYSTYPE *yyvaluep;
RptReport *rpt_report;
- gint row;
gchar **ret;
#endif
{
YYUSE (yyvaluep);
YYUSE (rpt_report);
- YYUSE (row);
YYUSE (ret);
if (!yymsg)
#endif
#else /* ! YYPARSE_PARAM */
#if defined __STDC__ || defined __cplusplus
-int yyparse (RptReport *rpt_report, gint row, gchar **ret);
+int yyparse (RptReport *rpt_report, gchar **ret);
#else
int yyparse ();
#endif
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
int
-yyparse (RptReport *rpt_report, gint row, gchar **ret)
+yyparse (RptReport *rpt_report, gchar **ret)
#else
int
-yyparse (rpt_report, row, ret)
+yyparse (rpt_report, ret)
RptReport *rpt_report;
- gint row;
gchar **ret;
#endif
#endif
case 4:
/* Line 1455 of yacc.c */
-#line 36 "parser.y"
+#line 35 "parser.y"
{ *ret = g_strdup ((yyvsp[(1) - (1)])); ;}
break;
case 5:
/* Line 1455 of yacc.c */
-#line 39 "parser.y"
+#line 38 "parser.y"
{ (yyval) = (yyvsp[(1) - (1)]); ;}
break;
case 6:
/* Line 1455 of yacc.c */
-#line 40 "parser.y"
+#line 39 "parser.y"
{ (yyval) = (yyvsp[(1) - (1)]); ;}
break;
case 7:
/* Line 1455 of yacc.c */
-#line 41 "parser.y"
+#line 40 "parser.y"
{ (yyval) = g_strndup ((yyvsp[(1) - (1)]) + 1, strlen ((yyvsp[(1) - (1)])) - 2) ;}
break;
case 8:
/* Line 1455 of yacc.c */
-#line 42 "parser.y"
- { (yyval) = rpt_report_get_field (rpt_report, g_strndup ((yyvsp[(1) - (1)]) + 1, strlen ((yyvsp[(1) - (1)])) - 2), row); ;}
+#line 41 "parser.y"
+ { (yyval) = rpt_report_get_field (rpt_report, g_strndup ((yyvsp[(1) - (1)]) + 1, strlen ((yyvsp[(1) - (1)])) - 2)); ;}
break;
case 9:
/* Line 1455 of yacc.c */
-#line 43 "parser.y"
- { (yyval) = rpt_report_get_special (rpt_report, (yyvsp[(1) - (1)]), row); ;}
+#line 42 "parser.y"
+ { (yyval) = rpt_report_get_special (rpt_report, (yyvsp[(1) - (1)])); ;}
break;
case 10:
/* Line 1455 of yacc.c */
-#line 44 "parser.y"
+#line 43 "parser.y"
{ (yyval) = g_strdup_printf ("%f", strtod ((yyvsp[(1) - (3)]), NULL) + strtod ((yyvsp[(3) - (3)]), NULL)); ;}
break;
case 11:
/* Line 1455 of yacc.c */
-#line 45 "parser.y"
+#line 44 "parser.y"
{ (yyval) = g_strdup_printf ("%f", strtod ((yyvsp[(1) - (3)]), NULL) - strtod ((yyvsp[(3) - (3)]), NULL)); ;}
break;
case 12:
/* Line 1455 of yacc.c */
-#line 46 "parser.y"
+#line 45 "parser.y"
{ (yyval) = g_strdup_printf ("%f", strtod ((yyvsp[(1) - (3)]), NULL) * strtod ((yyvsp[(3) - (3)]), NULL)); ;}
break;
case 13:
/* Line 1455 of yacc.c */
-#line 47 "parser.y"
+#line 46 "parser.y"
{ (yyval) = g_strdup_printf ("%f", strtod ((yyvsp[(1) - (3)]), NULL) / strtod ((yyvsp[(3) - (3)]), NULL)); ;}
break;
case 14:
/* Line 1455 of yacc.c */
-#line 48 "parser.y"
+#line 47 "parser.y"
{ (yyval) = g_strconcat ((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), NULL); ;}
break;
case 15:
/* Line 1455 of yacc.c */
-#line 49 "parser.y"
+#line 48 "parser.y"
{ (yyval) = (yyvsp[(2) - (3)]); ;}
break;
/* Line 1455 of yacc.c */
-#line 1443 "parser.tab.c"
+#line 1436 "parser.tab.c"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
{
++yynerrs;
#if ! YYERROR_VERBOSE
- yyerror (rpt_report, row, ret, YY_("syntax error"));
+ yyerror (rpt_report, ret, YY_("syntax error"));
#else
{
YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
if (0 < yysize && yysize <= yymsg_alloc)
{
(void) yysyntax_error (yymsg, yystate, yychar);
- yyerror (rpt_report, row, ret, yymsg);
+ yyerror (rpt_report, ret, yymsg);
}
else
{
- yyerror (rpt_report, row, ret, YY_("syntax error"));
+ yyerror (rpt_report, ret, YY_("syntax error"));
if (yysize != 0)
goto yyexhaustedlab;
}
else
{
yydestruct ("Error: discarding",
- yytoken, &yylval, rpt_report, row, ret);
+ yytoken, &yylval, rpt_report, ret);
yychar = YYEMPTY;
}
}
yydestruct ("Error: popping",
- yystos[yystate], yyvsp, rpt_report, row, ret);
+ yystos[yystate], yyvsp, rpt_report, ret);
YYPOPSTACK (1);
yystate = *yyssp;
YY_STACK_PRINT (yyss, yyssp);
| yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/
yyexhaustedlab:
- yyerror (rpt_report, row, ret, YY_("memory exhausted"));
+ yyerror (rpt_report, ret, YY_("memory exhausted"));
yyresult = 2;
/* Fall through. */
#endif
yyreturn:
if (yychar != YYEMPTY)
yydestruct ("Cleanup: discarding lookahead",
- yytoken, &yylval, rpt_report, row, ret);
+ yytoken, &yylval, rpt_report, ret);
/* Do not reclaim the symbols of the rule which action triggered
this YYABORT or YYACCEPT. */
YYPOPSTACK (yylen);
while (yyssp != yyss)
{
yydestruct ("Cleanup: popping",
- yystos[*yyssp], yyvsp, rpt_report, row, ret);
+ yystos[*yyssp], yyvsp, rpt_report, ret);
YYPOPSTACK (1);
}
#ifndef yyoverflow
/* Line 1675 of yacc.c */
-#line 51 "parser.y"
+#line 50 "parser.y"
/* Called by yyparse on error. */
void
-yyerror (RptReport *rpt_report, gint row, gchar **ret, char const *s)
+yyerror (RptReport *rpt_report, gchar **ret, char const *s)
{
g_warning ("Bison error: %s", s);
}
#include "lexycal.yy.h"
#include "rptreport_priv.h"
-void yyerror (RptReport *rpt_report, gint row, gchar **ret, char const *s);
+void yyerror (RptReport *rpt_report, gchar **ret, char const *s);
%}
%token INTEGER
%left '/'
%parse-param {RptReport *rpt_report}
-%parse-param {gint row}
%parse-param {gchar **ret}
%% /* Grammar rules and actions */
exp: INTEGER { $$ = $1; }
| FLOAT { $$ = $1; }
| STRING { $$ = g_strndup ($1 + 1, strlen ($1) - 2) }
- | FIELD { $$ = rpt_report_get_field (rpt_report, g_strndup ($1 + 1, strlen ($1) - 2), row); }
- | SPECIAL { $$ = rpt_report_get_special (rpt_report, $1, row); }
+ | FIELD { $$ = rpt_report_get_field (rpt_report, g_strndup ($1 + 1, strlen ($1) - 2)); }
+ | SPECIAL { $$ = rpt_report_get_special (rpt_report, $1); }
| exp '+' exp { $$ = g_strdup_printf ("%f", strtod ($1, NULL) + strtod ($3, NULL)); }
| exp '-' exp { $$ = g_strdup_printf ("%f", strtod ($1, NULL) - strtod ($3, NULL)); }
| exp '*' exp { $$ = g_strdup_printf ("%f", strtod ($1, NULL) * strtod ($3, NULL)); }
/* Called by yyparse on error. */
void
-yyerror (RptReport *rpt_report, gint row, gchar **ret, char const *s)
+yyerror (RptReport *rpt_report, gchar **ret, char const *s)
{
g_warning ("Bison error: %s", s);
}
GdaConnection *gda_conn;
GdaDataModel *gda_datamodel;
+
+ GtkTreeModel *treemodel;
} Database;
typedef struct
static void rpt_report_rptprint_section (RptReport *rpt_report,
xmlNode *xpage,
gdouble *cur_y,
- RptReportSection section,
- gint row);
+ RptReportSection section);
static void rpt_report_rptprint_parse_text_source (RptReport *rpt_report,
RptObject *rptobj,
- xmlNode *xnode,
- gint row);
+ xmlNode *xnode);
static void rpt_report_change_specials (RptReport *rpt_report, xmlDoc *xdoc);
Body *body;
guint cur_page;
+ gint cur_row;
+ GtkTreeIter *cur_iter;
};
G_DEFINE_TYPE (RptReport, rpt_report, G_TYPE_OBJECT)
priv->output_type = RPT_OUTPUT_PDF;
priv->output_filename = g_strdup ("rptreport.pdf");
priv->copies = 1;
+
+ priv->cur_row = -1;
+ priv->cur_iter = NULL;
}
/**
priv->db->sql = g_strstrip (g_strdup (sql));
priv->db->gda_conn = NULL;
priv->db->gda_datamodel = NULL;
+ priv->db->treemodel = NULL;
}
/**
{
g_free (priv->db);
}
- priv->db = (Database *)g_malloc0 (sizeof (Database));
+ priv->db = (Database *)g_new0 (Database, 1);
priv->db->provider_id = NULL;
priv->db->connection_string = NULL;
priv->db->sql = NULL;
priv->db->gda_conn = NULL;
priv->db->gda_datamodel = data_model;
+ priv->db->treemodel = NULL;
+}
+
+/**
+ * rpt_report_set_database_as_gtktreemodel:
+ * @rpt_report: an #RptReport object.
+ * @model: a #GtkTreeModel (for now only #GtkListStore is supported).
+ *
+ */
+void
+rpt_report_set_database_as_gtktreemodel (RptReport *rpt_report, GtkTreeModel *model)
+{
+ g_return_if_fail (IS_RPT_REPORT (rpt_report));
+ g_return_if_fail (GTK_IS_TREE_MODEL (rpt_report));
+
+ g_return_if_fail (GTK_IS_LIST_STORE (rpt_report));
+
+ RptReportPrivate *priv = RPT_REPORT_GET_PRIVATE (rpt_report);
+
+ if (priv->db != NULL)
+ {
+ g_free (priv->db);
+ }
+ priv->db = (Database *)g_new0 (Database, 1);
+
+ priv->db->provider_id = NULL;
+ priv->db->connection_string = NULL;
+ priv->db->sql = NULL;
+ priv->db->gda_conn = NULL;
+ priv->db->gda_datamodel = NULL;
+ priv->db->treemodel = model;
}
/**
}
rows = gda_data_model_get_n_rows (priv->db->gda_datamodel);
-
for (row = 0; row < rows; row++)
{
+ priv->cur_row = row;
if (row == 0 ||
priv->body->new_page_after ||
(priv->page_footer != NULL && (cur_y + priv->body->height > priv->page->size->height - priv->page->margin->bottom - priv->page_footer->height)) ||
priv->cur_page > 1)
{
cur_y = priv->page->size->height - priv->page->margin->bottom - priv->page_footer->height;
- rpt_report_rptprint_section (rpt_report, xpage, &cur_y, RPTREPORT_SECTION_PAGE_FOOTER, row - 1);
+ priv->cur_row = row - 1;
+ rpt_report_rptprint_section (rpt_report, xpage, &cur_y, RPTREPORT_SECTION_PAGE_FOOTER);
+ priv->cur_row = row;
}
}
if ((priv->cur_page == 1 && priv->page_header->first_page) ||
priv->cur_page > 1)
{
- rpt_report_rptprint_section (rpt_report, xpage, &cur_y, RPTREPORT_SECTION_PAGE_HEADER, row);
+ rpt_report_rptprint_section (rpt_report, xpage, &cur_y, RPTREPORT_SECTION_PAGE_HEADER);
}
}
if (priv->cur_page == 1 && priv->report_header != NULL)
{
- rpt_report_rptprint_section (rpt_report, xpage, &cur_y, RPTREPORT_SECTION_REPORT_HEADER, row);
+ rpt_report_rptprint_section (rpt_report, xpage, &cur_y, RPTREPORT_SECTION_REPORT_HEADER);
if (priv->report_header->new_page_after)
{
cur_y = 0.0;
}
}
- rpt_report_rptprint_section (rpt_report, xpage, &cur_y, RPTREPORT_SECTION_BODY, row);
+ rpt_report_rptprint_section (rpt_report, xpage, &cur_y, RPTREPORT_SECTION_BODY);
}
if (priv->cur_page > 0 && priv->report_footer != NULL)
{
if (priv->page_header != NULL)
{
- rpt_report_rptprint_section (rpt_report, xpage, &cur_y, RPTREPORT_SECTION_PAGE_HEADER, row - 1);
+ priv->cur_row = row - 1;
+ rpt_report_rptprint_section (rpt_report, xpage, &cur_y, RPTREPORT_SECTION_PAGE_HEADER);
+ priv->cur_row = row;
}
cur_y = priv->page->margin->top;
if (priv->cur_page > 0 && priv->page_footer != NULL)
{
cur_y = priv->page->size->height - priv->page->margin->bottom - priv->page_footer->height;
- rpt_report_rptprint_section (rpt_report, xpage, &cur_y, RPTREPORT_SECTION_PAGE_FOOTER, row - 1);
+ priv->cur_row = row - 1;
+ rpt_report_rptprint_section (rpt_report, xpage, &cur_y, RPTREPORT_SECTION_PAGE_FOOTER);
+ priv->cur_row = row;
}
}
- rpt_report_rptprint_section (rpt_report, xpage, &cur_y, RPTREPORT_SECTION_REPORT_FOOTER, row - 1);
+ priv->cur_row = row - 1;
+ rpt_report_rptprint_section (rpt_report, xpage, &cur_y, RPTREPORT_SECTION_REPORT_FOOTER);
+ priv->cur_row = row;
}
if (priv->cur_page > 0 && priv->page_footer != NULL && priv->page_footer->last_page)
{
cur_y = priv->page->size->height - priv->page->margin->bottom - priv->page_footer->height;
- rpt_report_rptprint_section (rpt_report, xpage, &cur_y, RPTREPORT_SECTION_PAGE_FOOTER, row - 1);
+ priv->cur_row = row - 1;
+ rpt_report_rptprint_section (rpt_report, xpage, &cur_y, RPTREPORT_SECTION_PAGE_FOOTER);
+ priv->cur_row = row;
}
/* change @Pages */
rpt_report_change_specials (rpt_report, xdoc);
+
+ priv->cur_row = -1;
}
else
{
if (priv->page_header != NULL)
{
- rpt_report_rptprint_section (rpt_report, xpage, &cur_y, RPTREPORT_SECTION_PAGE_HEADER, -1);
+ rpt_report_rptprint_section (rpt_report, xpage, &cur_y, RPTREPORT_SECTION_PAGE_HEADER);
}
if (priv->report_header != NULL)
{
- rpt_report_rptprint_section (rpt_report, xpage, &cur_y, RPTREPORT_SECTION_REPORT_HEADER, -1);
+ rpt_report_rptprint_section (rpt_report, xpage, &cur_y, RPTREPORT_SECTION_REPORT_HEADER);
}
- rpt_report_rptprint_section (rpt_report, xpage, &cur_y, RPTREPORT_SECTION_BODY, -1);
+ rpt_report_rptprint_section (rpt_report, xpage, &cur_y, RPTREPORT_SECTION_BODY);
if (priv->report_footer != NULL)
{
- rpt_report_rptprint_section (rpt_report, xpage, &cur_y, RPTREPORT_SECTION_REPORT_FOOTER, -1);
+ rpt_report_rptprint_section (rpt_report, xpage, &cur_y, RPTREPORT_SECTION_REPORT_FOOTER);
}
if (priv->page_footer != NULL)
{
cur_y = priv->page->size->height - priv->page->margin->bottom - priv->page_footer->height;
- rpt_report_rptprint_section (rpt_report, xpage, &cur_y, RPTREPORT_SECTION_PAGE_FOOTER, -1);
+ rpt_report_rptprint_section (rpt_report, xpage, &cur_y, RPTREPORT_SECTION_PAGE_FOOTER);
}
}
if (IS_RPT_OBJ_TEXT (rpt_object))
{
- rpt_report_rptprint_parse_text_source (NULL, rpt_object, xnodeobj, -1);
+ rpt_report_rptprint_parse_text_source (NULL, rpt_object, xnodeobj);
attr = xmlHasProp (xnodeobj, "source");
if (attr != NULL)
{
}
static void
-rpt_report_rptprint_section (RptReport *rpt_report, xmlNode *xpage, gdouble *cur_y, RptReportSection section, gint row)
+rpt_report_rptprint_section (RptReport *rpt_report,
+ xmlNode *xpage,
+ gdouble *cur_y,
+ RptReportSection section)
{
GList *objects;
xmlAttrPtr attr;
if (IS_RPT_OBJ_TEXT (rptobj))
{
- rpt_report_rptprint_parse_text_source (rpt_report, rptobj, xnode, row);
+ rpt_report_rptprint_parse_text_source (rpt_report, rptobj, xnode);
attr = xmlHasProp (xnode, "source");
if (attr != NULL)
{
}
static void
-rpt_report_rptprint_parse_text_source (RptReport *rpt_report, RptObject *rptobj, xmlNode *xnode, gint row)
+rpt_report_rptprint_parse_text_source (RptReport *rpt_report,
+ RptObject *rptobj,
+ xmlNode *xnode)
{
gchar *source;
gchar *ret;
+ RptReportPrivate *priv = RPT_REPORT_GET_PRIVATE (rpt_report);
+
g_object_get (G_OBJECT (rptobj), "source", &source, NULL);
yy_scan_string (source);
- yyparse (rpt_report, row, &ret);
+ yyparse (rpt_report, &ret);
if (g_strstr_len (ret, -1, " ") != NULL)
{
}
gchar
-*rpt_report_get_field (RptReport *rpt_report, const gchar *field_name, gint row)
+*rpt_report_get_field (RptReport *rpt_report,
+ const gchar *field_name)
{
GError *error;
gint col;
if (col > -1)
{
- const GValue *gval;
+ GValue *gval;
error = NULL;
- gval = gda_data_model_get_value_at (priv->db->gda_datamodel, col, row, &error);
+ gval = (GValue *)gda_data_model_get_value_at (priv->db->gda_datamodel, col, priv->cur_row, &error);
if (error != NULL)
{
g_warning ("Error on retrieving field «%s» value: %s.",
if (ret == NULL)
{
- ret = rpt_report_ask_field (rpt_report, field_name, row);
+ ret = rpt_report_ask_field (rpt_report, field_name);
}
if (ret == NULL)
{
}
gchar
-*rpt_report_ask_field (RptReport *rpt_report, const gchar *field, gint row)
+*rpt_report_ask_field (RptReport *rpt_report,
+ const gchar *field)
{
gchar *ret = NULL;
if (priv->db != NULL && priv->db->gda_datamodel != NULL)
{
g_signal_emit (rpt_report, klass->field_request_signal_id,
- 0, field, priv->db->gda_datamodel, row, &ret);
+ 0, field, priv->db->gda_datamodel, priv->cur_row, &ret);
}
else
{
g_signal_emit (rpt_report, klass->field_request_signal_id,
- 0, field, NULL, row, &ret);
+ 0, field, NULL, -1, &ret);
}
if (ret != NULL)
{
}
gchar
-*rpt_report_get_special (RptReport *rpt_report, const gchar *special, gint row)
+*rpt_report_get_special (RptReport *rpt_report, const gchar *special)
{
gchar *ret;
gchar *real_special;
#include <glib.h>
#include <glib-object.h>
+#include <gtk/gtk.h>
#include <libgda/libgda.h>
#include <libxml/tree.h>
void rpt_report_set_database_from_datamodel (RptReport *rpt_report, GdaDataModel *data_model);
+void rpt_report_set_database_as_gtktreemodel (RptReport *rpt_report, GtkTreeModel *model);
+
RptSize *rpt_report_get_page_size (RptReport *rpt_report);
void rpt_report_set_page_size (RptReport *rpt_report,
RptSize size);
/*
- * Copyright (C) 2007 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2007-2011 Andrea Zagli <azagli@libero.it>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
gchar *rpt_report_get_field (RptReport *rpt_report,
- const gchar *field_name,
- gint row);
+ const gchar *field_name);
gchar *rpt_report_ask_field (RptReport *rpt_report,
- const gchar *field,
- gint row);
+ const gchar *field);
gchar *rpt_report_get_special (RptReport *rpt_report,
- const gchar *special,
- gint row);
+ const gchar *special);
G_END_DECLS