...
 
Commits (2)
......@@ -47,22 +47,22 @@ AM_CPPFLAGS = \
-DDATADIR=\""$(datadir)"\" \
-DLIBDIR=\""$(libdir)"\"
bin_PROGRAMS = gdaui-demo-6.0
bin_PROGRAMS = org.gnome.gda.Demoui
BUILT_SOURCES = demos.h
demos.h: $(demos) geninclude.pl
(here=`pwd` ; cd $(srcdir) && $(PERL) $$here/geninclude.pl $(demos)) > demos.h
gdaui_demo_6_0_SOURCES = \
org_gnome_gda_Demoui_SOURCES = \
$(demos) \
demo-common.h \
main.c \
demos.h
gdaui_demo_6_0_DEPENDENCIES = $(DEPS)
gdaui_demo_6_0_LDFLAGS = $(EXTRALDFLAGS)
gdaui_demo_6_0_LDADD = \
org_gnome_gda_Demoui_DEPENDENCIES = $(DEPS)
org_gnome_gda_Demoui_LDFLAGS = $(EXTRALDFLAGS)
org_gnome_gda_Demoui_LDADD = \
$(top_builddir)/libgda/libgda-6.0.la \
$(top_builddir)/libgda-ui/libgda-ui-6.0.la \
$(COREDEPS_LIBS) $(GTK_LIBS)
......
......@@ -46,8 +46,7 @@ do_data_model_dir (GtkWidget *do_widget)
GdaSet *data_set;
GdaHolder *param;
gchar *path;
GValue *value;
window = gtk_dialog_new_with_buttons ("GdaDataModelDir data model",
GTK_WINDOW (do_widget),
0,
......@@ -90,9 +89,7 @@ do_data_model_dir (GtkWidget *do_widget)
data_set = GDA_SET (gdaui_data_selector_get_data_set (GDAUI_DATA_SELECTOR (grid)));
param = gda_set_get_holder (data_set, "data");
value = gda_value_new_from_string ("picture", G_TYPE_STRING);
gda_holder_set_attribute_static (param, GDAUI_ATTRIBUTE_PLUGIN, value);
gda_value_free (value);
g_object_set (param, "plugin", "picture", NULL);
}
gboolean visible;
......
......@@ -22,8 +22,7 @@ do_form_pict (GtkWidget *do_widget)
GtkWidget *form;
GdaSet *data_set;
GdaHolder *param;
GValue *value;
window = gtk_dialog_new_with_buttons ("Form with the 'picture' plugin",
GTK_WINDOW (do_widget),
0,
......@@ -61,9 +60,7 @@ do_form_pict (GtkWidget *do_widget)
/* specify that we want to use the 'picture' plugin */
data_set = GDA_SET (gdaui_data_selector_get_data_set (GDAUI_DATA_SELECTOR (form)));
param = gda_set_get_holder (data_set, "pict");
value = gda_value_new_from_string ("picture", G_TYPE_STRING);
gda_holder_set_attribute_static (param, GDAUI_ATTRIBUTE_PLUGIN, value);
gda_value_free (value);
g_object_set (param, "plugin", "pict", NULL);
gtk_box_pack_start (GTK_BOX (vbox), form, TRUE, TRUE, 0);
}
......
......@@ -15,21 +15,25 @@ struct _Demo
EOT
use File::Basename;
for $file (@ARGV) {
my %demo;
($basename = $file) =~ s/\.c$//;
open INFO_FILE, $file or die "Cannot open '$file'\n";
$title = <INFO_FILE>;
$title =~ s@^\s*/\*\s*@@;
$title =~ s@\s*$@@;
my($filename,$dirs,$prefix) = fileparse($file);
($basename = $filename) =~ s/\.c$//;
close INFO_FILE;
print "GtkWidget *do_$basename (GtkWidget *do_widget);\n";
push @demos, {"title" => $title, "file" => $file,
push @demos, {"title" => $title, "file" => $filename,
"func" => "do_$basename"};
}
......@@ -160,4 +164,4 @@ print ",\n";
print qq ( { NULL, NULL, NULL, NULL } );
print "\n};\n";
exit 0;
exit 0;
\ No newline at end of file
......@@ -22,8 +22,7 @@ do_grid_pict (GtkWidget *do_widget)
GtkWidget *grid;
GdaSet *data_set;
GdaHolder *param;
GValue *value;
window = gtk_dialog_new_with_buttons ("Grid with the 'picture' plugin",
GTK_WINDOW (do_widget),
0,
......@@ -59,9 +58,7 @@ do_grid_pict (GtkWidget *do_widget)
/* specify that we want to use the 'picture' plugin */
data_set = GDA_SET (gdaui_data_selector_get_data_set (GDAUI_DATA_SELECTOR (grid)));
param = gda_set_get_holder (data_set, "pict");
value = gda_value_new_from_string ("picture", G_TYPE_STRING);
gda_holder_set_attribute_static (param, GDAUI_ATTRIBUTE_PLUGIN, value);
gda_value_free (value);
g_object_set (param, "plugin", "picture", NULL);
gtk_box_pack_start (GTK_BOX (vbox), grid, TRUE, TRUE, 0);
......
perl = find_program('perl')
if perl.found ()
democonf = configuration_data()
democonf.set('PERL', perl.path ())
geninclude = configure_file(
configuration: democonf,
input: 'geninclude.pl.in',
output: 'genincluide.pl')
demos = [
'basic_form.c',
'data_model_dir.c',
'form.c',
'form_rw.c',
'form_pict.c',
'form_data_layout.c',
'form_model_change.c',
'grid.c',
'grid_rw.c',
'grid_pict.c',
'grid_data_layout.c',
'grid_model_change.c',
'linked_grid_form.c',
'linked_model_param.c',
'ddl_queries.c',
'login.c',
'provider_sel.c',
'tree.c',
'cloud.c',
'combo.c',
]
demosh = custom_target('demos.h',
command: [
perl, '@INPUT@',
],
input: [geninclude, demos],
output: 'demos.h',
capture: true,
)
demosh_dep = declare_dependency (sources: demosh)
demo_deps = [
libgda_dep,
gtk_dep,
gtksourceview_dep,
inc_rooth_dep,
inc_libgdah_dep,
inc_sqliteh_dep,
demosh_dep,
]
install_data('demo_db.db',
install_dir: join_paths(get_option('datadir'), project_package, 'demo')
)
install_data('custom_layout.xml',
install_dir: join_paths(get_option('datadir'), project_package, 'demo')
)
demo_sources = [
'main.c',
'demo-common.h',
demos
]
gdaui_demo = executable('org.gnome.gda.Demoui',
demo_sources,
link_with: [
libgda,
libgdaui
],
dependencies: demo_deps,
c_args: [
libgda_ui_cargs,
],
)
endif
\ No newline at end of file
......@@ -140,7 +140,9 @@ libgdaui = library('gda-ui-'+project_api_version,
libgda_ui_deps,
inc_rooth_dep
],
c_args: libgda_ui_cargs,
c_args: [
libgda_ui_cargs
],
link_with: [ libgda ],
link_args: [
'-export-dynamic'
......@@ -210,3 +212,5 @@ libgdaui_vapi = custom_target('gdaui'+project_api_version+'_vapi',
install_dir: join_paths(get_option('datadir'),'vala','vapi')
)
endif
subdir('demos')
\ No newline at end of file
......@@ -611,9 +611,8 @@ gda_data_model_iter_get_property (GObject *object,
case PROP_DATA_MODEL:
{
GObject *obj = g_weak_ref_get (&priv->data_model);
g_value_set_object (value, obj);
if (obj != NULL) {
g_object_unref (obj);
g_value_take_object (value, obj);
}
}
break;
......@@ -621,9 +620,8 @@ gda_data_model_iter_get_property (GObject *object,
{
g_warning ("Deprecated property, not to be used");
GObject *obj = g_weak_ref_get (&priv->data_model);
g_value_set_object (value, obj);
if (obj != NULL) {
g_object_unref (obj);
g_value_take_object (value, obj);
}
}
break;
......