3 #include <gtksourceview/gtksourceview.h>
8 #include "psppire-dialog.h"
9 #include "psppire-selector.h"
10 #include "psppire-vbuttonbox.h"
11 #include "psppire-hbuttonbox.h"
12 #include "psppire-keypad.h"
13 #include "psppire-acr.h"
14 #include "psppire-dictview.h"
15 #include "psppire-var-view.h"
16 #include "psppire-val-chooser.h"
17 #include "psppire-checkbox-treeview.h"
19 #include "psppire-dialog-action-aggregate.h"
20 #include "psppire-dialog-action-autorecode.h"
21 #include "psppire-dialog-action-barchart.h"
22 #include "psppire-dialog-action-binomial.h"
23 #include "psppire-dialog-action-chisquare.h"
24 #include "psppire-dialog-action-compute.h"
25 #include "psppire-dialog-action-comments.h"
26 #include "psppire-dialog-action-correlation.h"
27 #include "psppire-dialog-action-count.h"
28 #include "psppire-dialog-action-crosstabs.h"
29 #include "psppire-dialog-action-descriptives.h"
30 #include "psppire-dialog-action-examine.h"
31 #include "psppire-dialog-action-flip.h"
32 #include "psppire-dialog-action-factor.h"
33 #include "psppire-dialog-action-frequencies.h"
34 #include "psppire-dialog-action-histogram.h"
35 #include "psppire-dialog-action-indep-samps.h"
36 #include "psppire-dialog-action-k-related.h"
37 #include "psppire-dialog-action-1sks.h"
38 #include "psppire-dialog-action-kmeans.h"
39 #include "psppire-dialog-action-logistic.h"
40 #include "psppire-dialog-action-means.h"
41 #include "psppire-dialog-action-paired.h"
42 #include "psppire-dialog-action-oneway.h"
43 #include "psppire-means-layer.h"
44 #include "psppire-dialog-action-rank.h"
45 #include "psppire-dialog-action-recode.h"
46 #include "psppire-dialog-action-regression.h"
47 #include "psppire-dialog-action-reliability.h"
48 #include "psppire-dialog-action-roc.h"
49 #include "psppire-dialog-action-runs.h"
50 #include "psppire-dialog-action-scatterplot.h"
51 #include "psppire-dialog-action-select.h"
52 #include "psppire-dialog-action-sort.h"
53 #include "psppire-dialog-action-split.h"
54 #include "psppire-dialog-action-tt1s.h"
55 #include "psppire-dialog-action-two-sample.h"
56 #include "psppire-dialog-action-univariate.h"
57 #include "psppire-dialog-action-var-info.h"
58 #include "psppire-dialog-action-weight.h"
59 #include "psppire-value-entry.h"
61 static volatile GType kludge;
64 typedef GType (*get_type_func)(void);
66 static const get_type_func dialog_action_types[]=
68 psppire_dialog_action_1sks_get_type,
69 psppire_dialog_action_autorecode_get_type,
70 psppire_dialog_action_aggregate_get_type,
71 psppire_dialog_action_binomial_get_type,
72 psppire_dialog_action_barchart_get_type,
73 psppire_dialog_action_chisquare_get_type,
74 psppire_dialog_action_compute_get_type,
75 psppire_dialog_action_comments_get_type,
76 psppire_dialog_action_correlation_get_type,
77 psppire_dialog_action_count_get_type,
78 psppire_dialog_action_crosstabs_get_type,
79 psppire_dialog_action_descriptives_get_type,
80 psppire_dialog_action_examine_get_type,
81 psppire_dialog_action_factor_get_type,
82 psppire_dialog_action_flip_get_type,
83 psppire_dialog_action_frequencies_get_type,
84 psppire_dialog_action_histogram_get_type,
85 psppire_dialog_action_logistic_get_type,
86 psppire_dialog_action_kmeans_get_type,
87 psppire_dialog_action_k_related_get_type,
88 psppire_dialog_action_means_get_type,
89 psppire_dialog_action_oneway_get_type,
90 psppire_dialog_action_paired_get_type,
91 psppire_dialog_action_indep_samps_get_type,
92 psppire_dialog_action_var_info_get_type,
93 psppire_dialog_action_rank_get_type,
94 psppire_dialog_action_recode_get_type,
95 psppire_dialog_action_reliability_get_type,
96 psppire_dialog_action_regression_get_type,
97 psppire_dialog_action_roc_get_type,
98 psppire_dialog_action_runs_get_type,
99 psppire_dialog_action_scatterplot_get_type,
100 psppire_dialog_action_select_get_type,
101 psppire_dialog_action_sort_get_type,
102 psppire_dialog_action_split_get_type,
103 psppire_dialog_action_tt1s_get_type,
104 psppire_dialog_action_two_sample_get_type,
105 psppire_dialog_action_weight_get_type,
106 psppire_dialog_action_univariate_get_type
111 preregister_actions (void)
114 for (i = 0; i < sizeof (dialog_action_types) / sizeof (dialog_action_types[0]); ++i)
116 get_type_func x = dialog_action_types[i];
123 tx_string_to_double (const GValue *src, GValue *dest)
125 const gchar *str = g_value_get_string (src);
126 gdouble dble = g_strtod (str, NULL);
127 g_value_set_double (dest, dble);
132 tx_string_to_int (const GValue *src, GValue *dest)
134 const gchar *str = g_value_get_string (src);
136 g_value_set_int (dest, x);
141 GType align_enum_type;
142 GType measure_enum_type;
143 GType role_enum_type;
145 extern const GEnumValue align[];
146 extern const GEnumValue measure[];
147 extern const GEnumValue role[];
150 preregister_misc (void)
152 g_value_register_transform_func (G_TYPE_STRING, G_TYPE_DOUBLE, tx_string_to_double);
153 g_value_register_transform_func (G_TYPE_STRING, G_TYPE_INT, tx_string_to_int);
155 align_enum_type = g_enum_register_static ("PsppAlignment", align);
156 measure_enum_type = g_enum_register_static ("PsppMeasure", measure);
157 role_enum_type = g_enum_register_static ("PsppRole", role);
162 /* Any custom widgets which are to be used in GtkBuilder ui files
163 need to be preregistered, otherwise GtkBuilder refuses to
164 acknowledge their existence. */
166 preregister_widgets (void)
168 psppire_val_chooser_get_type ();
169 psppire_dialog_get_type ();
170 psppire_selector_get_type ();
171 psppire_vbutton_box_get_type ();
172 psppire_hbutton_box_get_type ();
173 psppire_keypad_get_type ();
174 psppire_acr_get_type ();
175 psppire_dict_view_get_type ();
176 psppire_var_view_get_type ();
177 psppire_value_entry_get_type ();
178 psppire_checkbox_treeview_get_type ();
179 psppire_means_layer_get_type ();
181 preregister_actions ();
184 /* This seems to be necessary on Cygwin.
185 It ought not to be necessary. Having it here can't do any harm. */
186 kludge = gtk_source_view_get_type ();