From: Andrea Zagli Date: Sun, 26 Jul 2009 13:26:41 +0000 (+0200) Subject: Removed libform from all files names. X-Git-Tag: 0.1.0~41 X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=950681a8803398f0fdab4c3158a5de3026cc87c2;p=libgtkform Removed libform from all files names. --- diff --git a/src/Makefile.am b/src/Makefile.am index 2d70b3c..b9bc16d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(GTKFORM_CFLAGS) lib_LTLIBRARIES = libgtkform.la libgtkform_la_SOURCES = form.c \ - formkey.c \ + key.c \ field.c \ fieldboolean.c \ fielddatetime.c \ @@ -22,20 +22,20 @@ libgtkform_la_SOURCES = form.c \ libgtkform_la_LDFLAGS = -no-undefined -libgtkform_include_HEADERS = libform.h \ - libformkey.h \ - libformfield.h \ - libformfieldboolean.h \ - libformfielddatetime.h \ - libformfieldfloat.h \ - libformfieldinteger.h \ - libformfieldtext.h \ - libformwidget.h \ - libformwidgetcheck.h \ - libformwidgetcombobox.h \ - libformwidgetentry.h \ - libformwidgetlabel.h \ - libformwidgetspin.h \ - libformwidgettextview.h +libgtkform_include_HEADERS = form.h \ + key.h \ + field.h \ + fieldboolean.h \ + fielddatetime.h \ + fieldfloat.h \ + fieldinteger.h \ + fieldtext.h \ + widget.h \ + widgetcheck.h \ + widgetcombobox.h \ + widgetentry.h \ + widgetlabel.h \ + widgetspin.h \ + widgettextview.h libgtkform_includedir = $(includedir)/libgtkform diff --git a/src/field.c b/src/field.c index b05be10..f99b56e 100644 --- a/src/field.c +++ b/src/field.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2006 Andrea Zagli + * Copyright (C) 2005-2009 Andrea Zagli * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include - -#include "libformwidget.h" -#include "libformfield.h" +#include "widget.h" +#include "field.h" enum { diff --git a/src/field.h b/src/field.h new file mode 100644 index 0000000..2de6964 --- /dev/null +++ b/src/field.h @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2005-2009 Andrea Zagli + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __LIBFORM_FIELD_H__ +#define __LIBFORM_FIELD_H__ + +#include + +#include + +#include "widget.h" + + +G_BEGIN_DECLS + + +#define TYPE_FORM_FIELD (form_field_get_type ()) +#define FORM_FIELD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORM_FIELD, FormField)) +#define FORM_FIELD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORM_FIELD, FormFieldClass)) +#define IS_FORM_FIELD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORM_FIELD)) +#define IS_FORM_FIELD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORM_FIELD)) +#define FORM_FIELD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORM_FIELD, FormFieldClass)) + + +typedef struct _FormField FormField; +typedef struct _FormFieldClass FormFieldClass; + +struct _FormField + { + GObject parent; + }; + +struct _FormFieldClass + { + GObjectClass parent_class; + + const gchar *(*get_value_stringify) (FormField *field); + const GValue *(*get_value) (FormField *field); + const gchar *(*get_value_sql) (FormField *field); + + gboolean (*clear) (FormField *field); + gboolean (*is_empty) (FormField *field); + gboolean (*set_from_datamodel) (FormField *field, GdaDataModel *dm, gint row); + }; + +GType form_field_get_type (void) G_GNUC_CONST; + +FormField *form_field_new (void); +FormField *form_field_new_from_form_widget (FormWidget *fwidget); + +const gchar *form_field_get_field_name (FormField *field); +FormWidget *form_field_get_form_widget (FormField *field); + +const gchar *form_field_get_value_stringify (FormField *field); +const GValue *form_field_get_value (FormField *field); +const gchar *form_field_get_value_sql (FormField *field); + +gboolean form_field_clear (FormField *field); + +gboolean form_field_is_empty (FormField *field); + +gboolean form_field_set_from_datamodel (FormField *field, GdaDataModel *dm, gint row); + + +G_END_DECLS + + +#endif /* __LIBFORM_FIELD_H__ */ diff --git a/src/fieldboolean.c b/src/fieldboolean.c index ffa68e9..4f36f71 100644 --- a/src/fieldboolean.c +++ b/src/fieldboolean.c @@ -18,10 +18,8 @@ #include -#include - -#include "libformwidget.h" -#include "libformfieldboolean.h" +#include "widget.h" +#include "fieldboolean.h" enum { diff --git a/src/fieldboolean.h b/src/fieldboolean.h new file mode 100644 index 0000000..9d87359 --- /dev/null +++ b/src/fieldboolean.h @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2005-2009 Andrea Zagli + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __LIBFORM_FIELD_BOOLEAN_H__ +#define __LIBFORM_FIELD_BOOLEAN_H__ + +#include + +#include "field.h" + + +G_BEGIN_DECLS + + +#define TYPE_FORM_FIELD_BOOLEAN (form_field_boolean_get_type ()) +#define FORM_FIELD_BOOLEAN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORM_FIELD_BOOLEAN, FormFieldBoolean)) +#define FORM_FIELD_BOOLEAN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORM_FIELD_BOOLEAN, FormFieldBooleanClass)) +#define IS_FORM_FIELD_BOOLEAN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORM_FIELD_BOOLEAN)) +#define IS_FORM_FIELD_BOOLEAN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORM_FIELD_BOOLEAN)) +#define FORM_FIELD_BOOLEAN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORM_FIELD_BOOLEAN, FormFieldBooleanClass)) + + +typedef struct _FormFieldBoolean FormFieldBoolean; +typedef struct _FormFieldBooleanClass FormFieldBooleanClass; + +struct _FormFieldBoolean + { + FormField parent; + }; + +struct _FormFieldBooleanClass + { + FormFieldClass parent_class; + }; + +GType form_field_boolean_get_type (void) G_GNUC_CONST; + +FormField *form_field_boolean_new (void); + +const gchar *form_field_boolean_get_value_stringify (FormField *field); +const GValue *form_field_boolean_get_value (FormField *field); +const gchar *form_field_boolean_get_value_sql (FormField *field); + +gboolean form_field_boolean_clear (FormField *field); + +gboolean form_field_boolean_is_empty (FormField *field); + +gboolean form_field_boolean_set_from_datamodel (FormField *field, GdaDataModel *dm, gint row); + + +G_END_DECLS + + +#endif /* __LIBFORM_FIELD_BOOLEAN_H__ */ diff --git a/src/fielddatetime.c b/src/fielddatetime.c index 4a20580..28a006b 100644 --- a/src/fielddatetime.c +++ b/src/fielddatetime.c @@ -19,10 +19,8 @@ #include #include -#include - -#include "libformwidget.h" -#include "libformfielddatetime.h" +#include "widget.h" +#include "fielddatetime.h" enum { @@ -111,9 +109,9 @@ form_field_datetime_class_init (FormFieldDateTimeClass *klass) g_param_spec_int ("type", "Type", "Type", - G_MININT, - G_MAXINT, - FORM_FIELD_DATETIME_TYPE_DATETIME, + G_MININT, + G_MAXINT, + FORM_FIELD_DATETIME_TYPE_DATETIME, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); g_type_class_add_private (object_class, sizeof (FormFieldDateTimePrivate)); @@ -272,7 +270,7 @@ form_field_datetime_set_from_datamodel (FormField *field, GdaDataModel *dm, gint if (dm != NULL) { ret = form_field_datetime_set_value_stringify (field, - gdaex_data_model_get_field_value_stringify_at (dm, row, field_name)); + gdaex_data_model_get_field_value_stringify_at (dm, row, field_name)); } return ret; diff --git a/src/fielddatetime.h b/src/fielddatetime.h new file mode 100644 index 0000000..49c6f04 --- /dev/null +++ b/src/fielddatetime.h @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2005-2009 Andrea Zagli + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __LIBFORM_FIELD_DATETIME_H__ +#define __LIBFORM_FIELD_DATETIME_H__ + +#include + +#include "field.h" + + +G_BEGIN_DECLS + + +#define TYPE_FORM_FIELD_DATETIME (form_field_datetime_get_type ()) +#define FORM_FIELD_DATETIME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORM_FIELD_DATETIME, FormFieldDateTime)) +#define FORM_FIELD_DATETIME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORM_FIELD_DATETIME, FormFieldDateTimeClass)) +#define IS_FORM_FIELD_DATETIME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORM_FIELD_DATETIME)) +#define IS_FORM_FIELD_DATETIME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORM_FIELD_DATETIME)) +#define FORM_FIELD_DATETIME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORM_FIELD_DATETIME, FormFieldDateTimeClass)) + + +typedef struct _FormFieldDateTime FormFieldDateTime; +typedef struct _FormFieldDateTimeClass FormFieldDateTimeClass; + +struct _FormFieldDateTime + { + FormField parent; + }; + +struct _FormFieldDateTimeClass + { + FormFieldClass parent_class; + }; + +GType form_field_datetime_get_type (void) G_GNUC_CONST; + +enum +{ + FORM_FIELD_DATETIME_TYPE_DATETIME, + FORM_FIELD_DATETIME_TYPE_DATE, + FORM_FIELD_DATETIME_TYPE_TIME +}; + +FormField *form_field_datetime_new (void); + +const gchar *form_field_datetime_get_value_stringify (FormField *field); +const GValue *form_field_datetime_get_value (FormField *field); +const gchar *form_field_datetime_get_value_sql (FormField *field); + +gboolean form_field_datetime_clear (FormField *field); + +gboolean form_field_datetime_is_empty (FormField *field); + +gboolean form_field_datetime_set_from_datamodel (FormField *field, GdaDataModel *dm, gint row); + + +G_END_DECLS + + +#endif /* __LIBFORM_FIELD_DATETIME_H__ */ diff --git a/src/fieldfloat.c b/src/fieldfloat.c index 5641edc..019f01b 100644 --- a/src/fieldfloat.c +++ b/src/fieldfloat.c @@ -18,10 +18,8 @@ #include -#include - -#include "libformwidget.h" -#include "libformfieldfloat.h" +#include "widget.h" +#include "fieldfloat.h" enum { diff --git a/src/fieldfloat.h b/src/fieldfloat.h new file mode 100644 index 0000000..58801a7 --- /dev/null +++ b/src/fieldfloat.h @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2005-2009 Andrea Zagli + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __LIBFORM_FIELD_FLOAT_H__ +#define __LIBFORM_FIELD_FLOAT_H__ + +#include + +#include "field.h" + + +G_BEGIN_DECLS + + +#define TYPE_FORM_FIELD_FLOAT (form_field_float_get_type ()) +#define FORM_FIELD_FLOAT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORM_FIELD_FLOAT, FormFieldFloat)) +#define FORM_FIELD_FLOAT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORM_FIELD_FLOAT, FormFieldFloatClass)) +#define IS_FORM_FIELD_FLOAT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORM_FIELD_FLOAT)) +#define IS_FORM_FIELD_FLOAT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORM_FIELD_FLOAT)) +#define FORM_FIELD_FLOAT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORM_FIELD_FLOAT, FormFieldFloatClass)) + + +typedef struct _FormFieldFloat FormFieldFloat; +typedef struct _FormFieldFloatClass FormFieldFloatClass; + +struct _FormFieldFloat + { + FormField parent; + }; + +struct _FormFieldFloatClass + { + FormFieldClass parent_class; + }; + +GType form_field_float_get_type (void) G_GNUC_CONST; + +FormField *form_field_float_new (void); + +const gchar *form_field_float_get_value_stringify (FormField *field); +const GValue *form_field_float_get_value (FormField *field); +const gchar *form_field_float_get_value_sql (FormField *field); + +gboolean form_field_float_clear (FormField *field); + +gboolean form_field_float_is_empty (FormField *field); + +gboolean form_field_float_set_from_datamodel (FormField *field, GdaDataModel *dm, gint row); + + +G_END_DECLS + + +#endif /* __LIBFORM_FIELD_FLOAT_H__ */ diff --git a/src/fieldinteger.c b/src/fieldinteger.c index 3e9d967..32403c6 100644 --- a/src/fieldinteger.c +++ b/src/fieldinteger.c @@ -16,10 +16,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include - -#include "libformwidget.h" -#include "libformfieldinteger.h" +#include "widget.h" +#include "fieldinteger.h" enum { diff --git a/src/fieldinteger.h b/src/fieldinteger.h new file mode 100644 index 0000000..28c741e --- /dev/null +++ b/src/fieldinteger.h @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2005-2009 Andrea Zagli + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __LIBFORM_FIELD_INTEGER_H__ +#define __LIBFORM_FIELD_INTEGER_H__ + +#include + +#include "field.h" + + +G_BEGIN_DECLS + + +#define TYPE_FORM_FIELD_INTEGER (form_field_integer_get_type ()) +#define FORM_FIELD_INTEGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORM_FIELD_INTEGER, FormFieldInteger)) +#define FORM_FIELD_INTEGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORM_FIELD_INTEGER, FormFieldIntegerClass)) +#define IS_FORM_FIELD_INTEGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORM_FIELD_INTEGER)) +#define IS_FORM_FIELD_INTEGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORM_FIELD_INTEGER)) +#define FORM_FIELD_INTEGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORM_FIELD_INTEGER, FormFieldIntegerClass)) + + +typedef struct _FormFieldInteger FormFieldInteger; +typedef struct _FormFieldIntegerClass FormFieldIntegerClass; + +struct _FormFieldInteger + { + FormField parent; + }; + +struct _FormFieldIntegerClass + { + FormFieldClass parent_class; + }; + +GType form_field_integer_get_type (void) G_GNUC_CONST; + +FormField *form_field_integer_new (void); + +const gchar *form_field_integer_get_value_stringify (FormField *field); +const GValue *form_field_integer_get_value (FormField *field); +const gchar *form_field_integer_get_value_sql (FormField *field); + +gboolean form_field_integer_clear (FormField *field); + +gboolean form_field_integer_is_empty (FormField *field); + +gboolean form_field_integer_set_from_datamodel (FormField *field, GdaDataModel *dm, gint row); + + +G_END_DECLS + + +#endif /* __LIBFORM_FIELD_INTEGER_H__ */ diff --git a/src/fieldtext.c b/src/fieldtext.c index ea4abcc..c25aaf9 100644 --- a/src/fieldtext.c +++ b/src/fieldtext.c @@ -16,10 +16,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include - -#include "libformwidget.h" -#include "libformfieldtext.h" +#include "widget.h" +#include "fieldtext.h" enum { diff --git a/src/fieldtext.h b/src/fieldtext.h new file mode 100644 index 0000000..15fd909 --- /dev/null +++ b/src/fieldtext.h @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2005-2009 Andrea Zagli + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __LIBFORM_FIELD_TEXT_H__ +#define __LIBFORM_FIELD_TEXT_H__ + +#include + +#include "field.h" + + +G_BEGIN_DECLS + + +#define TYPE_FORM_FIELD_TEXT (form_field_text_get_type ()) +#define FORM_FIELD_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORM_FIELD_TEXT, FormFieldText)) +#define FORM_FIELD_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORM_FIELD_TEXT, FormFieldTextClass)) +#define IS_FORM_FIELD_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORM_FIELD_TEXT)) +#define IS_FORM_FIELD_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORM_FIELD_TEXT)) +#define FORM_FIELD_TEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORM_FIELD_TEXT, FormFieldTextClass)) + + +typedef struct _FormFieldText FormFieldText; +typedef struct _FormFieldTextClass FormFieldTextClass; + +struct _FormFieldText + { + FormField parent; + }; + +struct _FormFieldTextClass + { + FormFieldClass parent_class; + }; + +GType form_field_text_get_type (void) G_GNUC_CONST; + +FormField *form_field_text_new (void); + +const gchar *form_field_text_get_value_stringify (FormField *field); +const GValue *form_field_text_get_value (FormField *field); +const gchar *form_field_text_get_value_sql (FormField *field); + +gboolean form_field_text_clear (FormField *field); + +gboolean form_field_text_is_empty (FormField *field); + +gboolean form_field_text_set_from_datamodel (FormField *field, GdaDataModel *dm, gint row); + + +G_END_DECLS + + +#endif /* __LIBFORM_FIELD_TEXT_H__ */ diff --git a/src/form.c b/src/form.c index 935643c..60db4cc 100644 --- a/src/form.c +++ b/src/form.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2006 Andrea Zagli + * Copyright (C) 2005-2009 Andrea Zagli * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,7 +22,7 @@ #include -#include "libform.h" +#include "form.h" enum { diff --git a/src/form.h b/src/form.h new file mode 100644 index 0000000..9b16fb6 --- /dev/null +++ b/src/form.h @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2005-2009 Andrea Zagli + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __LIBFORM_H__ +#define __LIBFORM_H__ + +#include +#include + +#include "field.h" +#include "widget.h" +#include "key.h" + + +G_BEGIN_DECLS + + +#define TYPE_FORM (form_get_type ()) +#define FORM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORM, Form)) +#define FORM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORM, FormClass)) +#define IS_FORM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORM)) +#define IS_FORM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORM)) +#define FORM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORM, FormClass)) + + +typedef struct _Form Form; +typedef struct _FormClass FormClass; + +struct _Form + { + GObject parent; + }; + +struct _FormClass + { + GObjectClass parent_class; + }; + +GType form_get_type (void) G_GNUC_CONST; + + +Form *form_new (void); + +gboolean form_add_field (Form *form, FormField *field); +gboolean form_remove_field (Form *form, FormField *field); + +gboolean form_add_fields (Form *form, ...); + +FormField *form_get_field_from_name (Form *form, const gchar *field_name); +FormWidget *form_get_widget_from_name (Form *form, const gchar *widget_name); + +gboolean form_clear (Form *form); + +gboolean form_check (Form *form); + +void form_set_sensitive (Form *form, gboolean sensitive); +void form_set_editable (Form *form, gboolean editable); + +typedef enum +{ + FORM_SQL_SELECT, + FORM_SQL_INSERT, + FORM_SQL_UPDATE, + FORM_SQL_DELETE +} FormSqlType; + +gchar *form_get_sql (Form *form, FormSqlType type); + +gboolean form_fill_from_datamodel (Form *form, GdaDataModel *dm, gint row); + + +G_END_DECLS + + +#endif /* __LIBFORM_H__ */ diff --git a/src/formkey.c b/src/formkey.c deleted file mode 100644 index 8789b44..0000000 --- a/src/formkey.c +++ /dev/null @@ -1,246 +0,0 @@ -/* - * Copyright (C) 2005-2006 Andrea Zagli - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#include -#include - -#include "libformkey.h" - -static void form_key_class_init (FormKeyClass *class); -static void form_key_init (FormKey *form_key); - - -#define FORM_KEY_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TYPE_FORM_KEY, FormKeyPrivate)) - -typedef struct _FormKeyPrivate FormKeyPrivate; -struct _FormKeyPrivate - { - GList *fields; - }; - - -GType -form_key_get_type (void) -{ - static GType form_key_type = 0; - - if (!form_key_type) - { - static const GTypeInfo form_key_info = - { - sizeof (FormKeyClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) form_key_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (FormKey), - 0, /* n_preallocs */ - (GInstanceInitFunc) form_key_init, - NULL - }; - - form_key_type = g_type_register_static (G_TYPE_OBJECT, "FormKey", - &form_key_info, 0); - } - - return form_key_type; -} - -static void -form_key_class_init (FormKeyClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - - g_type_class_add_private (object_class, sizeof (FormKeyPrivate)); -} - -static void -form_key_init (FormKey *form_key) -{ - FormKeyPrivate *priv = FORM_KEY_GET_PRIVATE (form_key); - - priv->fields = NULL; -} - -/** - * form_key_new: - * - * Returns: the newly created #FormKey. - */ -FormKey -*form_key_new () -{ - return g_object_new (TYPE_FORM_KEY, NULL); -} - -/** - * form_key_add_field: - * @form_key: a #FormKey object. - * @field: a #FormField object. - * - */ -gboolean -form_key_add_field (FormKey *form_key, FormField *field) -{ - gboolean ret = FALSE; - - FormKeyPrivate *priv = FORM_KEY_GET_PRIVATE (form_key); - - g_return_val_if_fail (IS_FORM_FIELD (field), FALSE); - - priv->fields = g_list_append (priv->fields, field); - - ret = TRUE; - - return ret; -} - -/** - * form_key_remove_field: - * @form_key: a #FormKey object. - * @field: a #FormField object. - * - */ -gboolean -form_key_remove_field (FormKey *form_key, FormField *field) -{ - gboolean ret = FALSE; - - FormKeyPrivate *priv = FORM_KEY_GET_PRIVATE (form_key); - - g_return_val_if_fail (IS_FORM_FIELD (field), FALSE); - - priv->fields = g_list_remove (priv->fields, field); - - ret = TRUE; - - return ret; -} - -/** - * form_key_add_fields: - * @form_key: a #FormKey object. - * - */ -gboolean -form_key_add_fields (FormKey *form_key, ...) -{ - FormField *field; - - va_list vargs; - - va_start (vargs, form_key); - - while ((field = va_arg (vargs, FormField *)) != NULL) - { - form_key_add_field (form_key, field); - } - - va_end (vargs); -} - -/** - * form_key_check: - * @form_key: a #FormKey object. - * - * Returns: TRUE if all obligatory fields are full. - */ -gboolean -form_key_check (FormKey *form_key) -{ - FormField *field; - gboolean ret = FALSE; - - FormKeyPrivate *priv = FORM_KEY_GET_PRIVATE (form_key); - - GList *fields = g_list_first (priv->fields); - - while (fields != NULL) - { - field = (FormField *)fields->data; - - if (form_field_is_empty (field)) - { - ret = TRUE; - break; - } - - fields = g_list_next (fields); - } - - return ret; -} - -/** - * form_key_get_sql: - * @form_key: a #FormKey object. - * - */ -gchar -*form_key_get_sql (FormKey *form_key) -{ - FormField *field; - gchar *sql = ""; - gchar *field_name; - - g_return_val_if_fail (IS_FORM_KEY (form_key), NULL); - - FormKeyPrivate *priv = FORM_KEY_GET_PRIVATE (form_key); - - GList *fields = g_list_first (priv->fields); - - while (fields != NULL) - { - field = (FormField *)fields->data; - - g_object_get (G_OBJECT (field), - "field", &field_name, - NULL); - - sql = g_strconcat (sql, " AND ", field_name, " = ", - form_field_get_value_sql (field), NULL); - - fields = g_list_next (fields); - } - - if (strcmp (sql, "") != 0) - { - sql = g_strconcat (" WHERE ", g_strdup (sql + 5), NULL); - } - - return sql; -} - -/** - * form_key_field_is_key: - * @form_key: a #FormKey object. - * @field: a #FormField object. - * - * Returns: TRUE if @field is part of @form_key. - */ -gboolean -form_key_field_is_key (FormKey *form_key, FormField *field) -{ - g_return_val_if_fail (IS_FORM_KEY (form_key), FALSE); - g_return_val_if_fail (IS_FORM_FIELD (field), FALSE); - - FormKeyPrivate *priv = FORM_KEY_GET_PRIVATE (form_key); - - return (g_list_index (priv->fields, field) >= 0 ? TRUE : FALSE); -} diff --git a/src/key.c b/src/key.c new file mode 100644 index 0000000..0eda43d --- /dev/null +++ b/src/key.c @@ -0,0 +1,246 @@ +/* + * Copyright (C) 2005-2009 Andrea Zagli + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include +#include + +#include "key.h" + +static void form_key_class_init (FormKeyClass *class); +static void form_key_init (FormKey *form_key); + + +#define FORM_KEY_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TYPE_FORM_KEY, FormKeyPrivate)) + +typedef struct _FormKeyPrivate FormKeyPrivate; +struct _FormKeyPrivate + { + GList *fields; + }; + + +GType +form_key_get_type (void) +{ + static GType form_key_type = 0; + + if (!form_key_type) + { + static const GTypeInfo form_key_info = + { + sizeof (FormKeyClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) form_key_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (FormKey), + 0, /* n_preallocs */ + (GInstanceInitFunc) form_key_init, + NULL + }; + + form_key_type = g_type_register_static (G_TYPE_OBJECT, "FormKey", + &form_key_info, 0); + } + + return form_key_type; +} + +static void +form_key_class_init (FormKeyClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + g_type_class_add_private (object_class, sizeof (FormKeyPrivate)); +} + +static void +form_key_init (FormKey *form_key) +{ + FormKeyPrivate *priv = FORM_KEY_GET_PRIVATE (form_key); + + priv->fields = NULL; +} + +/** + * form_key_new: + * + * Returns: the newly created #FormKey. + */ +FormKey +*form_key_new () +{ + return g_object_new (TYPE_FORM_KEY, NULL); +} + +/** + * form_key_add_field: + * @form_key: a #FormKey object. + * @field: a #FormField object. + * + */ +gboolean +form_key_add_field (FormKey *form_key, FormField *field) +{ + gboolean ret = FALSE; + + FormKeyPrivate *priv = FORM_KEY_GET_PRIVATE (form_key); + + g_return_val_if_fail (IS_FORM_FIELD (field), FALSE); + + priv->fields = g_list_append (priv->fields, field); + + ret = TRUE; + + return ret; +} + +/** + * form_key_remove_field: + * @form_key: a #FormKey object. + * @field: a #FormField object. + * + */ +gboolean +form_key_remove_field (FormKey *form_key, FormField *field) +{ + gboolean ret = FALSE; + + FormKeyPrivate *priv = FORM_KEY_GET_PRIVATE (form_key); + + g_return_val_if_fail (IS_FORM_FIELD (field), FALSE); + + priv->fields = g_list_remove (priv->fields, field); + + ret = TRUE; + + return ret; +} + +/** + * form_key_add_fields: + * @form_key: a #FormKey object. + * + */ +gboolean +form_key_add_fields (FormKey *form_key, ...) +{ + FormField *field; + + va_list vargs; + + va_start (vargs, form_key); + + while ((field = va_arg (vargs, FormField *)) != NULL) + { + form_key_add_field (form_key, field); + } + + va_end (vargs); +} + +/** + * form_key_check: + * @form_key: a #FormKey object. + * + * Returns: TRUE if all obligatory fields are full. + */ +gboolean +form_key_check (FormKey *form_key) +{ + FormField *field; + gboolean ret = FALSE; + + FormKeyPrivate *priv = FORM_KEY_GET_PRIVATE (form_key); + + GList *fields = g_list_first (priv->fields); + + while (fields != NULL) + { + field = (FormField *)fields->data; + + if (form_field_is_empty (field)) + { + ret = TRUE; + break; + } + + fields = g_list_next (fields); + } + + return ret; +} + +/** + * form_key_get_sql: + * @form_key: a #FormKey object. + * + */ +gchar +*form_key_get_sql (FormKey *form_key) +{ + FormField *field; + gchar *sql = ""; + gchar *field_name; + + g_return_val_if_fail (IS_FORM_KEY (form_key), NULL); + + FormKeyPrivate *priv = FORM_KEY_GET_PRIVATE (form_key); + + GList *fields = g_list_first (priv->fields); + + while (fields != NULL) + { + field = (FormField *)fields->data; + + g_object_get (G_OBJECT (field), + "field", &field_name, + NULL); + + sql = g_strconcat (sql, " AND ", field_name, " = ", + form_field_get_value_sql (field), NULL); + + fields = g_list_next (fields); + } + + if (strcmp (sql, "") != 0) + { + sql = g_strconcat (" WHERE ", g_strdup (sql + 5), NULL); + } + + return sql; +} + +/** + * form_key_field_is_key: + * @form_key: a #FormKey object. + * @field: a #FormField object. + * + * Returns: TRUE if @field is part of @form_key. + */ +gboolean +form_key_field_is_key (FormKey *form_key, FormField *field) +{ + g_return_val_if_fail (IS_FORM_KEY (form_key), FALSE); + g_return_val_if_fail (IS_FORM_FIELD (field), FALSE); + + FormKeyPrivate *priv = FORM_KEY_GET_PRIVATE (form_key); + + return (g_list_index (priv->fields, field) >= 0 ? TRUE : FALSE); +} diff --git a/src/key.h b/src/key.h new file mode 100644 index 0000000..fbe4434 --- /dev/null +++ b/src/key.h @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2005-2006 Andrea Zagli + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __LIBFORM_KEY_H__ +#define __LIBFORM_KEY_H__ + +#include + +#include "field.h" + + +G_BEGIN_DECLS + + +#define TYPE_FORM_KEY (form_key_get_type ()) +#define FORM_KEY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORM_KEY, FormKey)) +#define FORM_KEY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORM_KEY, FormKeyClass)) +#define IS_FORM_KEY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORM_KEY)) +#define IS_FORM_KEY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORM_KEY)) +#define FORM_KEY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORM_KEY, FormKeyClass)) + + +typedef struct _FormKey FormKey; +typedef struct _FormKeyClass FormKeyClass; + +struct _FormKey + { + GObject parent; + }; + +struct _FormKeyClass + { + GObjectClass parent_class; + }; + +GType form_key_get_type (void) G_GNUC_CONST; + + +FormKey *form_key_new (void); + +gboolean form_key_add_field (FormKey *form_key, FormField *field); +gboolean form_key_remove_field (FormKey *form_key, FormField *field); + +gboolean form_key_add_fields (FormKey *form_key, ...); + +gboolean form_key_check (FormKey *form_key); + +gchar *form_key_get_sql (FormKey *form_key); + +gboolean form_key_field_is_key (FormKey *form_key, FormField *field); + + +G_END_DECLS + + +#endif /* __LIBFORM_KEY_H__ */ diff --git a/src/libform.h b/src/libform.h deleted file mode 100644 index 89d581e..0000000 --- a/src/libform.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (C) 2005-2009 Andrea Zagli - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef __LIBFORM_H__ -#define __LIBFORM_H__ - -#include -#include - -#include -#include -#include - - -G_BEGIN_DECLS - - -#define TYPE_FORM (form_get_type ()) -#define FORM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORM, Form)) -#define FORM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORM, FormClass)) -#define IS_FORM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORM)) -#define IS_FORM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORM)) -#define FORM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORM, FormClass)) - - -typedef struct _Form Form; -typedef struct _FormClass FormClass; - -struct _Form - { - GObject parent; - }; - -struct _FormClass - { - GObjectClass parent_class; - }; - -GType form_get_type (void) G_GNUC_CONST; - - -Form *form_new (void); - -gboolean form_add_field (Form *form, FormField *field); -gboolean form_remove_field (Form *form, FormField *field); - -gboolean form_add_fields (Form *form, ...); - -FormField *form_get_field_from_name (Form *form, const gchar *field_name); -FormWidget *form_get_widget_from_name (Form *form, const gchar *widget_name); - -gboolean form_clear (Form *form); - -gboolean form_check (Form *form); - -void form_set_sensitive (Form *form, gboolean sensitive); -void form_set_editable (Form *form, gboolean editable); - -typedef enum -{ - FORM_SQL_SELECT, - FORM_SQL_INSERT, - FORM_SQL_UPDATE, - FORM_SQL_DELETE -} FormSqlType; - -gchar *form_get_sql (Form *form, FormSqlType type); - -gboolean form_fill_from_datamodel (Form *form, GdaDataModel *dm, gint row); - - -G_END_DECLS - - -#endif /* __LIBFORM_H__ */ diff --git a/src/libformfield.h b/src/libformfield.h deleted file mode 100644 index f9d2a76..0000000 --- a/src/libformfield.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (C) 2005-2009 Andrea Zagli - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef __LIBFORM_FIELD_H__ -#define __LIBFORM_FIELD_H__ - -#include - -#include - -#include - - -G_BEGIN_DECLS - - -#define TYPE_FORM_FIELD (form_field_get_type ()) -#define FORM_FIELD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORM_FIELD, FormField)) -#define FORM_FIELD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORM_FIELD, FormFieldClass)) -#define IS_FORM_FIELD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORM_FIELD)) -#define IS_FORM_FIELD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORM_FIELD)) -#define FORM_FIELD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORM_FIELD, FormFieldClass)) - - -typedef struct _FormField FormField; -typedef struct _FormFieldClass FormFieldClass; - -struct _FormField - { - GObject parent; - }; - -struct _FormFieldClass - { - GObjectClass parent_class; - - const gchar *(*get_value_stringify) (FormField *field); - const GValue *(*get_value) (FormField *field); - const gchar *(*get_value_sql) (FormField *field); - - gboolean (*clear) (FormField *field); - gboolean (*is_empty) (FormField *field); - gboolean (*set_from_datamodel) (FormField *field, GdaDataModel *dm, gint row); - }; - -GType form_field_get_type (void) G_GNUC_CONST; - -FormField *form_field_new (void); -FormField *form_field_new_from_form_widget (FormWidget *fwidget); - -const gchar *form_field_get_field_name (FormField *field); -FormWidget *form_field_get_form_widget (FormField *field); - -const gchar *form_field_get_value_stringify (FormField *field); -const GValue *form_field_get_value (FormField *field); -const gchar *form_field_get_value_sql (FormField *field); - -gboolean form_field_clear (FormField *field); - -gboolean form_field_is_empty (FormField *field); - -gboolean form_field_set_from_datamodel (FormField *field, GdaDataModel *dm, gint row); - - -G_END_DECLS - - -#endif /* __LIBFORM_FIELD_H__ */ diff --git a/src/libformfieldboolean.h b/src/libformfieldboolean.h deleted file mode 100644 index 31fefdc..0000000 --- a/src/libformfieldboolean.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2005-2009 Andrea Zagli - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef __LIBFORM_FIELD_BOOLEAN_H__ -#define __LIBFORM_FIELD_BOOLEAN_H__ - -#include - -#include - - -G_BEGIN_DECLS - - -#define TYPE_FORM_FIELD_BOOLEAN (form_field_boolean_get_type ()) -#define FORM_FIELD_BOOLEAN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORM_FIELD_BOOLEAN, FormFieldBoolean)) -#define FORM_FIELD_BOOLEAN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORM_FIELD_BOOLEAN, FormFieldBooleanClass)) -#define IS_FORM_FIELD_BOOLEAN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORM_FIELD_BOOLEAN)) -#define IS_FORM_FIELD_BOOLEAN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORM_FIELD_BOOLEAN)) -#define FORM_FIELD_BOOLEAN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORM_FIELD_BOOLEAN, FormFieldBooleanClass)) - - -typedef struct _FormFieldBoolean FormFieldBoolean; -typedef struct _FormFieldBooleanClass FormFieldBooleanClass; - -struct _FormFieldBoolean - { - FormField parent; - }; - -struct _FormFieldBooleanClass - { - FormFieldClass parent_class; - }; - -GType form_field_boolean_get_type (void) G_GNUC_CONST; - -FormField *form_field_boolean_new (void); - -const gchar *form_field_boolean_get_value_stringify (FormField *field); -const GValue *form_field_boolean_get_value (FormField *field); -const gchar *form_field_boolean_get_value_sql (FormField *field); - -gboolean form_field_boolean_clear (FormField *field); - -gboolean form_field_boolean_is_empty (FormField *field); - -gboolean form_field_boolean_set_from_datamodel (FormField *field, GdaDataModel *dm, gint row); - - -G_END_DECLS - - -#endif /* __LIBFORM_FIELD_BOOLEAN_H__ */ diff --git a/src/libformfielddatetime.h b/src/libformfielddatetime.h deleted file mode 100644 index 84b2ecd..0000000 --- a/src/libformfielddatetime.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (C) 2005-2009 Andrea Zagli - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef __LIBFORM_FIELD_DATETIME_H__ -#define __LIBFORM_FIELD_DATETIME_H__ - -#include - -#include - - -G_BEGIN_DECLS - - -#define TYPE_FORM_FIELD_DATETIME (form_field_datetime_get_type ()) -#define FORM_FIELD_DATETIME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORM_FIELD_DATETIME, FormFieldDateTime)) -#define FORM_FIELD_DATETIME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORM_FIELD_DATETIME, FormFieldDateTimeClass)) -#define IS_FORM_FIELD_DATETIME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORM_FIELD_DATETIME)) -#define IS_FORM_FIELD_DATETIME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORM_FIELD_DATETIME)) -#define FORM_FIELD_DATETIME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORM_FIELD_DATETIME, FormFieldDateTimeClass)) - - -typedef struct _FormFieldDateTime FormFieldDateTime; -typedef struct _FormFieldDateTimeClass FormFieldDateTimeClass; - -struct _FormFieldDateTime - { - FormField parent; - }; - -struct _FormFieldDateTimeClass - { - FormFieldClass parent_class; - }; - -GType form_field_datetime_get_type (void) G_GNUC_CONST; - -enum -{ - FORM_FIELD_DATETIME_TYPE_DATETIME, - FORM_FIELD_DATETIME_TYPE_DATE, - FORM_FIELD_DATETIME_TYPE_TIME -}; - -FormField *form_field_datetime_new (void); - -const gchar *form_field_datetime_get_value_stringify (FormField *field); -const GValue *form_field_datetime_get_value (FormField *field); -const gchar *form_field_datetime_get_value_sql (FormField *field); - -gboolean form_field_datetime_clear (FormField *field); - -gboolean form_field_datetime_is_empty (FormField *field); - -gboolean form_field_datetime_set_from_datamodel (FormField *field, GdaDataModel *dm, gint row); - - -G_END_DECLS - - -#endif /* __LIBFORM_FIELD_DATETIME_H__ */ diff --git a/src/libformfieldfloat.h b/src/libformfieldfloat.h deleted file mode 100644 index 33e81ed..0000000 --- a/src/libformfieldfloat.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2005-2009 Andrea Zagli - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef __LIBFORM_FIELD_FLOAT_H__ -#define __LIBFORM_FIELD_FLOAT_H__ - -#include - -#include - - -G_BEGIN_DECLS - - -#define TYPE_FORM_FIELD_FLOAT (form_field_float_get_type ()) -#define FORM_FIELD_FLOAT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORM_FIELD_FLOAT, FormFieldFloat)) -#define FORM_FIELD_FLOAT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORM_FIELD_FLOAT, FormFieldFloatClass)) -#define IS_FORM_FIELD_FLOAT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORM_FIELD_FLOAT)) -#define IS_FORM_FIELD_FLOAT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORM_FIELD_FLOAT)) -#define FORM_FIELD_FLOAT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORM_FIELD_FLOAT, FormFieldFloatClass)) - - -typedef struct _FormFieldFloat FormFieldFloat; -typedef struct _FormFieldFloatClass FormFieldFloatClass; - -struct _FormFieldFloat - { - FormField parent; - }; - -struct _FormFieldFloatClass - { - FormFieldClass parent_class; - }; - -GType form_field_float_get_type (void) G_GNUC_CONST; - -FormField *form_field_float_new (void); - -const gchar *form_field_float_get_value_stringify (FormField *field); -const GValue *form_field_float_get_value (FormField *field); -const gchar *form_field_float_get_value_sql (FormField *field); - -gboolean form_field_float_clear (FormField *field); - -gboolean form_field_float_is_empty (FormField *field); - -gboolean form_field_float_set_from_datamodel (FormField *field, GdaDataModel *dm, gint row); - - -G_END_DECLS - - -#endif /* __LIBFORM_FIELD_FLOAT_H__ */ diff --git a/src/libformfieldinteger.h b/src/libformfieldinteger.h deleted file mode 100644 index 92ec2bf..0000000 --- a/src/libformfieldinteger.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2005-2009 Andrea Zagli - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef __LIBFORM_FIELD_INTEGER_H__ -#define __LIBFORM_FIELD_INTEGER_H__ - -#include - -#include - - -G_BEGIN_DECLS - - -#define TYPE_FORM_FIELD_INTEGER (form_field_integer_get_type ()) -#define FORM_FIELD_INTEGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORM_FIELD_INTEGER, FormFieldInteger)) -#define FORM_FIELD_INTEGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORM_FIELD_INTEGER, FormFieldIntegerClass)) -#define IS_FORM_FIELD_INTEGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORM_FIELD_INTEGER)) -#define IS_FORM_FIELD_INTEGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORM_FIELD_INTEGER)) -#define FORM_FIELD_INTEGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORM_FIELD_INTEGER, FormFieldIntegerClass)) - - -typedef struct _FormFieldInteger FormFieldInteger; -typedef struct _FormFieldIntegerClass FormFieldIntegerClass; - -struct _FormFieldInteger - { - FormField parent; - }; - -struct _FormFieldIntegerClass - { - FormFieldClass parent_class; - }; - -GType form_field_integer_get_type (void) G_GNUC_CONST; - -FormField *form_field_integer_new (void); - -const gchar *form_field_integer_get_value_stringify (FormField *field); -const GValue *form_field_integer_get_value (FormField *field); -const gchar *form_field_integer_get_value_sql (FormField *field); - -gboolean form_field_integer_clear (FormField *field); - -gboolean form_field_integer_is_empty (FormField *field); - -gboolean form_field_integer_set_from_datamodel (FormField *field, GdaDataModel *dm, gint row); - - -G_END_DECLS - - -#endif /* __LIBFORM_FIELD_INTEGER_H__ */ diff --git a/src/libformfieldtext.h b/src/libformfieldtext.h deleted file mode 100644 index fcce038..0000000 --- a/src/libformfieldtext.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2005-2009 Andrea Zagli - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef __LIBFORM_FIELD_TEXT_H__ -#define __LIBFORM_FIELD_TEXT_H__ - -#include - -#include - - -G_BEGIN_DECLS - - -#define TYPE_FORM_FIELD_TEXT (form_field_text_get_type ()) -#define FORM_FIELD_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORM_FIELD_TEXT, FormFieldText)) -#define FORM_FIELD_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORM_FIELD_TEXT, FormFieldTextClass)) -#define IS_FORM_FIELD_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORM_FIELD_TEXT)) -#define IS_FORM_FIELD_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORM_FIELD_TEXT)) -#define FORM_FIELD_TEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORM_FIELD_TEXT, FormFieldTextClass)) - - -typedef struct _FormFieldText FormFieldText; -typedef struct _FormFieldTextClass FormFieldTextClass; - -struct _FormFieldText - { - FormField parent; - }; - -struct _FormFieldTextClass - { - FormFieldClass parent_class; - }; - -GType form_field_text_get_type (void) G_GNUC_CONST; - -FormField *form_field_text_new (void); - -const gchar *form_field_text_get_value_stringify (FormField *field); -const GValue *form_field_text_get_value (FormField *field); -const gchar *form_field_text_get_value_sql (FormField *field); - -gboolean form_field_text_clear (FormField *field); - -gboolean form_field_text_is_empty (FormField *field); - -gboolean form_field_text_set_from_datamodel (FormField *field, GdaDataModel *dm, gint row); - - -G_END_DECLS - - -#endif /* __LIBFORM_FIELD_TEXT_H__ */ diff --git a/src/libformkey.h b/src/libformkey.h deleted file mode 100644 index 99e7c94..0000000 --- a/src/libformkey.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2005-2006 Andrea Zagli - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef __LIBFORM_KEY_H__ -#define __LIBFORM_KEY_H__ - -#include - -#include - - -G_BEGIN_DECLS - - -#define TYPE_FORM_KEY (form_key_get_type ()) -#define FORM_KEY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORM_KEY, FormKey)) -#define FORM_KEY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORM_KEY, FormKeyClass)) -#define IS_FORM_KEY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORM_KEY)) -#define IS_FORM_KEY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORM_KEY)) -#define FORM_KEY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORM_KEY, FormKeyClass)) - - -typedef struct _FormKey FormKey; -typedef struct _FormKeyClass FormKeyClass; - -struct _FormKey - { - GObject parent; - }; - -struct _FormKeyClass - { - GObjectClass parent_class; - }; - -GType form_key_get_type (void) G_GNUC_CONST; - - -FormKey *form_key_new (void); - -gboolean form_key_add_field (FormKey *form_key, FormField *field); -gboolean form_key_remove_field (FormKey *form_key, FormField *field); - -gboolean form_key_add_fields (FormKey *form_key, ...); - -gboolean form_key_check (FormKey *form_key); - -gchar *form_key_get_sql (FormKey *form_key); - -gboolean form_key_field_is_key (FormKey *form_key, FormField *field); - - -G_END_DECLS - - -#endif /* __LIBFORM_KEY_H__ */ diff --git a/src/libformwidget.h b/src/libformwidget.h deleted file mode 100644 index 97c5154..0000000 --- a/src/libformwidget.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2005-2006 Andrea Zagli - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef __LIBFORM_WIDGET_H__ -#define __LIBFORM_WIDGET_H__ - -#include -#include -#include - - -G_BEGIN_DECLS - - -#define TYPE_FORM_WIDGET (form_widget_get_type ()) -#define FORM_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORM_WIDGET, FormWidget)) -#define FORM_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORM_WIDGET, FormWidgetClass)) -#define IS_FORM_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORM_WIDGET)) -#define IS_FORM_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORM_WIDGET)) -#define FORM_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORM_WIDGET, FormWidgetClass)) - - -typedef struct _FormWidget FormWidget; -typedef struct _FormWidgetClass FormWidgetClass; - -struct _FormWidget - { - GObject parent; - }; - -struct _FormWidgetClass - { - GObjectClass parent_class; - - const gchar *(*get_value_stringify) (FormWidget *fwidget); - - gboolean (*set_value_stringify) (FormWidget *fwidget, const gchar *value); - - void (*set_editable) (FormWidget *fwidget, gboolean editable); - }; - -GType form_widget_get_type (void) G_GNUC_CONST; - -FormWidget *form_widget_new (void); - -gboolean form_widget_set_from_glade (FormWidget *fwidget, GladeXML *glade, const gchar *widget_name); - -GtkWidget *form_widget_get_widget (FormWidget *fwidget); - -const gchar *form_widget_get_widget_name (FormWidget *fwidget); - -const gchar *form_widget_get_value_stringify (FormWidget *fwidget); - -gboolean form_widget_set_value_stringify (FormWidget *fwidget, const gchar *value); - -void form_widget_set_editable (FormWidget *fwidget, gboolean editable); - - -G_END_DECLS - - -#endif /* __LIBFORM_WIDGET_H__ */ diff --git a/src/libformwidgetcheck.h b/src/libformwidgetcheck.h deleted file mode 100644 index 0cda388..0000000 --- a/src/libformwidgetcheck.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2005-2006 Andrea Zagli - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef __LIBFORM_WIDGET_CHECK_H__ -#define __LIBFORM_WIDGET_CHECK_H__ - -#include - - -G_BEGIN_DECLS - - -#define TYPE_FORM_WIDGET_CHECK (form_widget_check_get_type ()) -#define FORM_WIDGET_CHECK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORM_WIDGET_CHECK, FormWidgetCheck)) -#define FORM_WIDGET_CHECK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORM_WIDGET_CHECK, FormWidgetCheckClass)) -#define IS_FORM_WIDGET_CHECK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORM_WIDGET_CHECK)) -#define IS_FORM_WIDGET_CHECK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORM_WIDGET_CHECK)) -#define FORM_WIDGET_CHECK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORM_WIDGET_CHECK, FormWidgetCheckClass)) - - -typedef struct _FormWidgetCheck FormWidgetCheck; -typedef struct _FormWidgetCheckClass FormWidgetCheckClass; - -struct _FormWidgetCheck - { - FormWidget parent; - }; - -struct _FormWidgetCheckClass - { - FormWidgetClass parent_class; - }; - -GType form_widget_check_get_type (void) G_GNUC_CONST; - -FormWidget *form_widget_check_new (void); - -const gchar *form_widget_check_get_value_stringify (FormWidget *widget); - -gboolean form_widget_check_set_value_stringify (FormWidget *fwidget, const gchar *value); - -void form_widget_check_set_editable (FormWidget *fwidget, gboolean editable); - - -G_END_DECLS - - -#endif /* __LIBFORM_WIDGET_CHECK_H__ */ diff --git a/src/libformwidgetcombobox.h b/src/libformwidgetcombobox.h deleted file mode 100644 index db01d71..0000000 --- a/src/libformwidgetcombobox.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2005-2006 Andrea Zagli - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef __LIBFORM_WIDGET_COMBO_BOX_H__ -#define __LIBFORM_WIDGET_COMBO_BOX_H__ - -#include - - -G_BEGIN_DECLS - - -#define TYPE_FORM_WIDGET_COMBO_BOX (form_widget_combo_box_get_type ()) -#define FORM_WIDGET_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORM_WIDGET_COMBO_BOX, FormWidgetComboBox)) -#define FORM_WIDGET_COMBO_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORM_WIDGET_COMBO_BOX, FormWidgetComboBoxClass)) -#define IS_FORM_WIDGET_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORM_WIDGET_COMBO_BOX)) -#define IS_FORM_WIDGET_COMBO_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORM_WIDGET_COMBO_BOX)) -#define FORM_WIDGET_COMBO_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORM_WIDGET_COMBO_BOX, FormWidgetComboBoxClass)) - - -typedef struct _FormWidgetComboBox FormWidgetComboBox; -typedef struct _FormWidgetComboBoxClass FormWidgetComboBoxClass; - -struct _FormWidgetComboBox - { - FormWidget parent; - }; - -struct _FormWidgetComboBoxClass - { - FormWidgetClass parent_class; - }; - -GType form_widget_combo_box_get_type (void) G_GNUC_CONST; - -FormWidget *form_widget_combo_box_new (void); - -const gchar *form_widget_combo_box_get_value_stringify (FormWidget *widget); - -gboolean form_widget_combo_box_set_value_stringify (FormWidget *fwidget, const gchar *value); - -void form_widget_combo_box_set_editable (FormWidget *fwidget, gboolean editable); - - -G_END_DECLS - - -#endif /* __LIBFORM_WIDGET_COMBO_BOX_H__ */ diff --git a/src/libformwidgetentry.h b/src/libformwidgetentry.h deleted file mode 100644 index 891b0cb..0000000 --- a/src/libformwidgetentry.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2005-2006 Andrea Zagli - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef __LIBFORM_WIDGET_ENTRY_H__ -#define __LIBFORM_WIDGET_ENTRY_H__ - -#include - - -G_BEGIN_DECLS - - -#define TYPE_FORM_WIDGET_ENTRY (form_widget_entry_get_type ()) -#define FORM_WIDGET_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORM_WIDGET_ENTRY, FormWidgetEntry)) -#define FORM_WIDGET_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORM_WIDGET_ENTRY, FormWidgetEntryClass)) -#define IS_FORM_WIDGET_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORM_WIDGET_ENTRY)) -#define IS_FORM_WIDGET_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORM_WIDGET_ENTRY)) -#define FORM_WIDGET_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORM_WIDGET_ENTRY, FormWidgetEntryClass)) - - -typedef struct _FormWidgetEntry FormWidgetEntry; -typedef struct _FormWidgetEntryClass FormWidgetEntryClass; - -struct _FormWidgetEntry - { - FormWidget parent; - }; - -struct _FormWidgetEntryClass - { - FormWidgetClass parent_class; - }; - -GType form_widget_entry_get_type (void) G_GNUC_CONST; - -FormWidget *form_widget_entry_new (void); - -const gchar *form_widget_entry_get_value_stringify (FormWidget *widget); - -gboolean form_widget_entry_set_value_stringify (FormWidget *fwidget, const gchar *value); - -void form_widget_entry_set_editable (FormWidget *fwidget, gboolean editable); - - -G_END_DECLS - - -#endif /* __LIBFORM_WIDGET_ENTRY_H__ */ diff --git a/src/libformwidgetlabel.h b/src/libformwidgetlabel.h deleted file mode 100644 index 0ffab9a..0000000 --- a/src/libformwidgetlabel.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2005-2006 Andrea Zagli - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef __LIBFORM_WIDGET_LABEL_H__ -#define __LIBFORM_WIDGET_LABEL_H__ - -#include - - -G_BEGIN_DECLS - - -#define TYPE_FORM_WIDGET_LABEL (form_widget_label_get_type ()) -#define FORM_WIDGET_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORM_WIDGET_LABEL, FormWidgetLabel)) -#define FORM_WIDGET_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORM_WIDGET_LABEL, FormWidgetLabelClass)) -#define IS_FORM_WIDGET_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORM_WIDGET_LABEL)) -#define IS_FORM_WIDGET_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORM_WIDGET_LABEL)) -#define FORM_WIDGET_LABEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORM_WIDGET_LABEL, FormWidgetLabelClass)) - - -typedef struct _FormWidgetLabel FormWidgetLabel; -typedef struct _FormWidgetLabelClass FormWidgetLabelClass; - -struct _FormWidgetLabel - { - FormWidget parent; - }; - -struct _FormWidgetLabelClass - { - FormWidgetClass parent_class; - }; - -GType form_widget_label_get_type (void) G_GNUC_CONST; - -FormWidget *form_widget_label_new (void); - -const gchar *form_widget_label_get_value_stringify (FormWidget *widget); - -gboolean form_widget_label_set_value_stringify (FormWidget *fwidget, const gchar *value); - - -G_END_DECLS - - -#endif /* __LIBFORM_WIDGET_LABEL_H__ */ diff --git a/src/libformwidgetspin.h b/src/libformwidgetspin.h deleted file mode 100644 index ea0fcb1..0000000 --- a/src/libformwidgetspin.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2005-2006 Andrea Zagli - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef __LIBFORM_WIDGET_SPIN_H__ -#define __LIBFORM_WIDGET_SPIN_H__ - -#include - - -G_BEGIN_DECLS - - -#define TYPE_FORM_WIDGET_SPIN (form_widget_spin_get_type ()) -#define FORM_WIDGET_SPIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORM_WIDGET_SPIN, FormWidgetSpin)) -#define FORM_WIDGET_SPIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORM_WIDGET_SPIN, FormWidgetSpinClass)) -#define IS_FORM_WIDGET_SPIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORM_WIDGET_SPIN)) -#define IS_FORM_WIDGET_SPIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORM_WIDGET_SPIN)) -#define FORM_WIDGET_SPIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORM_WIDGET_SPIN, FormWidgetSpinClass)) - - -typedef struct _FormWidgetSpin FormWidgetSpin; -typedef struct _FormWidgetSpinClass FormWidgetSpinClass; - -struct _FormWidgetSpin - { - FormWidget parent; - }; - -struct _FormWidgetSpinClass - { - FormWidgetClass parent_class; - }; - -GType form_widget_spin_get_type (void) G_GNUC_CONST; - -FormWidget *form_widget_spin_new (void); - -const gchar *form_widget_spin_get_value_stringify (FormWidget *widget); - -gboolean form_widget_spin_set_value_stringify (FormWidget *fwidget, const gchar *value); - -void form_widget_spin_set_editable (FormWidget *fwidget, gboolean editable); - - -G_END_DECLS - - -#endif /* __LIBFORM_WIDGET_SPIN_H__ */ diff --git a/src/libformwidgettextview.h b/src/libformwidgettextview.h deleted file mode 100644 index 1d9b2cd..0000000 --- a/src/libformwidgettextview.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2005-2006 Andrea Zagli - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef __LIBFORM_WIDGET_TEXTVIEW_H__ -#define __LIBFORM_WIDGET_TEXTVIEW_H__ - -#include - - -G_BEGIN_DECLS - - -#define TYPE_FORM_WIDGET_TEXTVIEW (form_widget_textview_get_type ()) -#define FORM_WIDGET_TEXTVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORM_WIDGET_TEXTVIEW, FormWidgetTextview)) -#define FORM_WIDGET_TEXTVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORM_WIDGET_TEXTVIEW, FormWidgetTextviewClass)) -#define IS_FORM_WIDGET_TEXTVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORM_WIDGET_TEXTVIEW)) -#define IS_FORM_WIDGET_TEXTVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORM_WIDGET_TEXTVIEW)) -#define FORM_WIDGET_TEXTVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORM_WIDGET_TEXTVIEW, FormWidgetTextviewClass)) - - -typedef struct _FormWidgetTextview FormWidgetTextview; -typedef struct _FormWidgetTextviewClass FormWidgetTextviewClass; - -struct _FormWidgetTextview - { - FormWidget parent; - }; - -struct _FormWidgetTextviewClass - { - FormWidgetClass parent_class; - }; - -GType form_widget_textview_get_type (void) G_GNUC_CONST; - -FormWidget *form_widget_textview_new (void); - -const gchar *form_widget_textview_get_value_stringify (FormWidget *widget); - -gboolean form_widget_textview_set_value_stringify (FormWidget *fwidget, const gchar *value); - -void form_widget_textview_set_editable (FormWidget *fwidget, gboolean editable); - - -G_END_DECLS - - -#endif /* __LIBFORM_WIDGET_TEXTVIEW_H__ */ diff --git a/src/widget.c b/src/widget.c index 8c64011..b45b9c7 100644 --- a/src/widget.c +++ b/src/widget.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2006 Andrea Zagli + * Copyright (C) 2005-2009 Andrea Zagli * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,7 +18,7 @@ #include -#include "libformwidget.h" +#include "widget.h" enum { diff --git a/src/widget.h b/src/widget.h new file mode 100644 index 0000000..caf5608 --- /dev/null +++ b/src/widget.h @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2005-2009 Andrea Zagli + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __LIBFORM_WIDGET_H__ +#define __LIBFORM_WIDGET_H__ + +#include +#include +#include + + +G_BEGIN_DECLS + + +#define TYPE_FORM_WIDGET (form_widget_get_type ()) +#define FORM_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORM_WIDGET, FormWidget)) +#define FORM_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORM_WIDGET, FormWidgetClass)) +#define IS_FORM_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORM_WIDGET)) +#define IS_FORM_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORM_WIDGET)) +#define FORM_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORM_WIDGET, FormWidgetClass)) + + +typedef struct _FormWidget FormWidget; +typedef struct _FormWidgetClass FormWidgetClass; + +struct _FormWidget + { + GObject parent; + }; + +struct _FormWidgetClass + { + GObjectClass parent_class; + + const gchar *(*get_value_stringify) (FormWidget *fwidget); + + gboolean (*set_value_stringify) (FormWidget *fwidget, const gchar *value); + + void (*set_editable) (FormWidget *fwidget, gboolean editable); + }; + +GType form_widget_get_type (void) G_GNUC_CONST; + +FormWidget *form_widget_new (void); + +gboolean form_widget_set_from_glade (FormWidget *fwidget, GladeXML *glade, const gchar *widget_name); + +GtkWidget *form_widget_get_widget (FormWidget *fwidget); + +const gchar *form_widget_get_widget_name (FormWidget *fwidget); + +const gchar *form_widget_get_value_stringify (FormWidget *fwidget); + +gboolean form_widget_set_value_stringify (FormWidget *fwidget, const gchar *value); + +void form_widget_set_editable (FormWidget *fwidget, gboolean editable); + + +G_END_DECLS + + +#endif /* __LIBFORM_WIDGET_H__ */ diff --git a/src/widgetcheck.c b/src/widgetcheck.c index 5b82aa8..46c39b2 100644 --- a/src/widgetcheck.c +++ b/src/widgetcheck.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2006 Andrea Zagli + * Copyright (C) 2005-2009 Andrea Zagli * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,7 +20,7 @@ #include -#include "libformwidgetcheck.h" +#include "widgetcheck.h" enum { diff --git a/src/widgetcheck.h b/src/widgetcheck.h new file mode 100644 index 0000000..1c7b88c --- /dev/null +++ b/src/widgetcheck.h @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2005-2009 Andrea Zagli + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __LIBFORM_WIDGET_CHECK_H__ +#define __LIBFORM_WIDGET_CHECK_H__ + +#include "widget.h" + + +G_BEGIN_DECLS + + +#define TYPE_FORM_WIDGET_CHECK (form_widget_check_get_type ()) +#define FORM_WIDGET_CHECK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORM_WIDGET_CHECK, FormWidgetCheck)) +#define FORM_WIDGET_CHECK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORM_WIDGET_CHECK, FormWidgetCheckClass)) +#define IS_FORM_WIDGET_CHECK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORM_WIDGET_CHECK)) +#define IS_FORM_WIDGET_CHECK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORM_WIDGET_CHECK)) +#define FORM_WIDGET_CHECK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORM_WIDGET_CHECK, FormWidgetCheckClass)) + + +typedef struct _FormWidgetCheck FormWidgetCheck; +typedef struct _FormWidgetCheckClass FormWidgetCheckClass; + +struct _FormWidgetCheck + { + FormWidget parent; + }; + +struct _FormWidgetCheckClass + { + FormWidgetClass parent_class; + }; + +GType form_widget_check_get_type (void) G_GNUC_CONST; + +FormWidget *form_widget_check_new (void); + +const gchar *form_widget_check_get_value_stringify (FormWidget *widget); + +gboolean form_widget_check_set_value_stringify (FormWidget *fwidget, const gchar *value); + +void form_widget_check_set_editable (FormWidget *fwidget, gboolean editable); + + +G_END_DECLS + + +#endif /* __LIBFORM_WIDGET_CHECK_H__ */ diff --git a/src/widgetcombobox.c b/src/widgetcombobox.c index 7e759a4..03077c9 100644 --- a/src/widgetcombobox.c +++ b/src/widgetcombobox.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2006 Andrea Zagli + * Copyright (C) 2005-2009 Andrea Zagli * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,7 +18,7 @@ #include -#include "libformwidgetcombobox.h" +#include "widgetcombobox.h" enum { diff --git a/src/widgetcombobox.h b/src/widgetcombobox.h new file mode 100644 index 0000000..a0d48fa --- /dev/null +++ b/src/widgetcombobox.h @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2005-2009 Andrea Zagli + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __LIBFORM_WIDGET_COMBO_BOX_H__ +#define __LIBFORM_WIDGET_COMBO_BOX_H__ + +#include "widget.h" + + +G_BEGIN_DECLS + + +#define TYPE_FORM_WIDGET_COMBO_BOX (form_widget_combo_box_get_type ()) +#define FORM_WIDGET_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORM_WIDGET_COMBO_BOX, FormWidgetComboBox)) +#define FORM_WIDGET_COMBO_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORM_WIDGET_COMBO_BOX, FormWidgetComboBoxClass)) +#define IS_FORM_WIDGET_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORM_WIDGET_COMBO_BOX)) +#define IS_FORM_WIDGET_COMBO_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORM_WIDGET_COMBO_BOX)) +#define FORM_WIDGET_COMBO_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORM_WIDGET_COMBO_BOX, FormWidgetComboBoxClass)) + + +typedef struct _FormWidgetComboBox FormWidgetComboBox; +typedef struct _FormWidgetComboBoxClass FormWidgetComboBoxClass; + +struct _FormWidgetComboBox + { + FormWidget parent; + }; + +struct _FormWidgetComboBoxClass + { + FormWidgetClass parent_class; + }; + +GType form_widget_combo_box_get_type (void) G_GNUC_CONST; + +FormWidget *form_widget_combo_box_new (void); + +const gchar *form_widget_combo_box_get_value_stringify (FormWidget *widget); + +gboolean form_widget_combo_box_set_value_stringify (FormWidget *fwidget, const gchar *value); + +void form_widget_combo_box_set_editable (FormWidget *fwidget, gboolean editable); + + +G_END_DECLS + + +#endif /* __LIBFORM_WIDGET_COMBO_BOX_H__ */ diff --git a/src/widgetentry.c b/src/widgetentry.c index aceaa42..f1a4a88 100644 --- a/src/widgetentry.c +++ b/src/widgetentry.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2006 Andrea Zagli + * Copyright (C) 2005-2009 Andrea Zagli * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,7 +18,7 @@ #include -#include "libformwidgetentry.h" +#include "widgetentry.h" enum { diff --git a/src/widgetentry.h b/src/widgetentry.h new file mode 100644 index 0000000..5579493 --- /dev/null +++ b/src/widgetentry.h @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2005-2009 Andrea Zagli + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __LIBFORM_WIDGET_ENTRY_H__ +#define __LIBFORM_WIDGET_ENTRY_H__ + +#include "widget.h" + + +G_BEGIN_DECLS + + +#define TYPE_FORM_WIDGET_ENTRY (form_widget_entry_get_type ()) +#define FORM_WIDGET_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORM_WIDGET_ENTRY, FormWidgetEntry)) +#define FORM_WIDGET_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORM_WIDGET_ENTRY, FormWidgetEntryClass)) +#define IS_FORM_WIDGET_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORM_WIDGET_ENTRY)) +#define IS_FORM_WIDGET_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORM_WIDGET_ENTRY)) +#define FORM_WIDGET_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORM_WIDGET_ENTRY, FormWidgetEntryClass)) + + +typedef struct _FormWidgetEntry FormWidgetEntry; +typedef struct _FormWidgetEntryClass FormWidgetEntryClass; + +struct _FormWidgetEntry + { + FormWidget parent; + }; + +struct _FormWidgetEntryClass + { + FormWidgetClass parent_class; + }; + +GType form_widget_entry_get_type (void) G_GNUC_CONST; + +FormWidget *form_widget_entry_new (void); + +const gchar *form_widget_entry_get_value_stringify (FormWidget *widget); + +gboolean form_widget_entry_set_value_stringify (FormWidget *fwidget, const gchar *value); + +void form_widget_entry_set_editable (FormWidget *fwidget, gboolean editable); + + +G_END_DECLS + + +#endif /* __LIBFORM_WIDGET_ENTRY_H__ */ diff --git a/src/widgetlabel.c b/src/widgetlabel.c index 650a890..d53faed 100644 --- a/src/widgetlabel.c +++ b/src/widgetlabel.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2006 Andrea Zagli + * Copyright (C) 2005-2009 Andrea Zagli * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,7 +18,7 @@ #include -#include "libformwidgetlabel.h" +#include "widgetlabel.h" enum { diff --git a/src/widgetlabel.h b/src/widgetlabel.h new file mode 100644 index 0000000..7eb3218 --- /dev/null +++ b/src/widgetlabel.h @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2005-2009 Andrea Zagli + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __LIBFORM_WIDGET_LABEL_H__ +#define __LIBFORM_WIDGET_LABEL_H__ + +#include "widget.h" + + +G_BEGIN_DECLS + + +#define TYPE_FORM_WIDGET_LABEL (form_widget_label_get_type ()) +#define FORM_WIDGET_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORM_WIDGET_LABEL, FormWidgetLabel)) +#define FORM_WIDGET_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORM_WIDGET_LABEL, FormWidgetLabelClass)) +#define IS_FORM_WIDGET_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORM_WIDGET_LABEL)) +#define IS_FORM_WIDGET_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORM_WIDGET_LABEL)) +#define FORM_WIDGET_LABEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORM_WIDGET_LABEL, FormWidgetLabelClass)) + + +typedef struct _FormWidgetLabel FormWidgetLabel; +typedef struct _FormWidgetLabelClass FormWidgetLabelClass; + +struct _FormWidgetLabel + { + FormWidget parent; + }; + +struct _FormWidgetLabelClass + { + FormWidgetClass parent_class; + }; + +GType form_widget_label_get_type (void) G_GNUC_CONST; + +FormWidget *form_widget_label_new (void); + +const gchar *form_widget_label_get_value_stringify (FormWidget *widget); + +gboolean form_widget_label_set_value_stringify (FormWidget *fwidget, const gchar *value); + + +G_END_DECLS + + +#endif /* __LIBFORM_WIDGET_LABEL_H__ */ diff --git a/src/widgetspin.c b/src/widgetspin.c index 850f25d..99b6230 100644 --- a/src/widgetspin.c +++ b/src/widgetspin.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2006 Andrea Zagli + * Copyright (C) 2005-2009 Andrea Zagli * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,7 +20,7 @@ #include -#include "libformwidgetspin.h" +#include "widgetspin.h" enum { diff --git a/src/widgetspin.h b/src/widgetspin.h new file mode 100644 index 0000000..55b7245 --- /dev/null +++ b/src/widgetspin.h @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2005-2009 Andrea Zagli + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __LIBFORM_WIDGET_SPIN_H__ +#define __LIBFORM_WIDGET_SPIN_H__ + +#include "widget.h" + + +G_BEGIN_DECLS + + +#define TYPE_FORM_WIDGET_SPIN (form_widget_spin_get_type ()) +#define FORM_WIDGET_SPIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORM_WIDGET_SPIN, FormWidgetSpin)) +#define FORM_WIDGET_SPIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORM_WIDGET_SPIN, FormWidgetSpinClass)) +#define IS_FORM_WIDGET_SPIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORM_WIDGET_SPIN)) +#define IS_FORM_WIDGET_SPIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORM_WIDGET_SPIN)) +#define FORM_WIDGET_SPIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORM_WIDGET_SPIN, FormWidgetSpinClass)) + + +typedef struct _FormWidgetSpin FormWidgetSpin; +typedef struct _FormWidgetSpinClass FormWidgetSpinClass; + +struct _FormWidgetSpin + { + FormWidget parent; + }; + +struct _FormWidgetSpinClass + { + FormWidgetClass parent_class; + }; + +GType form_widget_spin_get_type (void) G_GNUC_CONST; + +FormWidget *form_widget_spin_new (void); + +const gchar *form_widget_spin_get_value_stringify (FormWidget *widget); + +gboolean form_widget_spin_set_value_stringify (FormWidget *fwidget, const gchar *value); + +void form_widget_spin_set_editable (FormWidget *fwidget, gboolean editable); + + +G_END_DECLS + + +#endif /* __LIBFORM_WIDGET_SPIN_H__ */ diff --git a/src/widgettextview.c b/src/widgettextview.c index cc80640..a8514d7 100644 --- a/src/widgettextview.c +++ b/src/widgettextview.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2006 Andrea Zagli + * Copyright (C) 2005-2009 Andrea Zagli * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,7 +18,7 @@ #include -#include "libformwidgettextview.h" +#include "widgettextview.h" enum { diff --git a/src/widgettextview.h b/src/widgettextview.h new file mode 100644 index 0000000..c374fb4 --- /dev/null +++ b/src/widgettextview.h @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2005-2009 Andrea Zagli + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __LIBFORM_WIDGET_TEXTVIEW_H__ +#define __LIBFORM_WIDGET_TEXTVIEW_H__ + +#include "widget.h" + + +G_BEGIN_DECLS + + +#define TYPE_FORM_WIDGET_TEXTVIEW (form_widget_textview_get_type ()) +#define FORM_WIDGET_TEXTVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORM_WIDGET_TEXTVIEW, FormWidgetTextview)) +#define FORM_WIDGET_TEXTVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORM_WIDGET_TEXTVIEW, FormWidgetTextviewClass)) +#define IS_FORM_WIDGET_TEXTVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORM_WIDGET_TEXTVIEW)) +#define IS_FORM_WIDGET_TEXTVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORM_WIDGET_TEXTVIEW)) +#define FORM_WIDGET_TEXTVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORM_WIDGET_TEXTVIEW, FormWidgetTextviewClass)) + + +typedef struct _FormWidgetTextview FormWidgetTextview; +typedef struct _FormWidgetTextviewClass FormWidgetTextviewClass; + +struct _FormWidgetTextview + { + FormWidget parent; + }; + +struct _FormWidgetTextviewClass + { + FormWidgetClass parent_class; + }; + +GType form_widget_textview_get_type (void) G_GNUC_CONST; + +FormWidget *form_widget_textview_new (void); + +const gchar *form_widget_textview_get_value_stringify (FormWidget *widget); + +gboolean form_widget_textview_set_value_stringify (FormWidget *fwidget, const gchar *value); + +void form_widget_textview_set_editable (FormWidget *fwidget, gboolean editable); + + +G_END_DECLS + + +#endif /* __LIBFORM_WIDGET_TEXTVIEW_H__ */ diff --git a/test/main.c b/test/main.c index 97f09ce..fb4ebe7 100644 --- a/test/main.c +++ b/test/main.c @@ -22,20 +22,20 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "form.h" +#include "field.h" +#include "fieldboolean.h" +#include "fielddatetime.h" +#include "fieldinteger.h" +#include "fieldfloat.h" +#include "fieldtext.h" +#include "widget.h" +#include "widgetcheck.h" +#include "widgetcombobox.h" +#include "widgetentry.h" +#include "widgetlabel.h" +#include "widgetspin.h" +#include "widgettextview.h" Form *form;