From 180497ebb698eb02cb46317e324916b0e5aff3ae Mon Sep 17 00:00:00 2001 From: =?utf8?q?Picca=20Fr=C3=A9d=C3=A9ric-Emmanuel?= Date: Thu, 23 Jan 2014 21:30:23 +0100 Subject: [PATCH] remove more useless code --- gui/hkl-gui.c | 362 ---------------------------------------------------------- 1 file changed, 362 deletions(-) diff --git a/gui/hkl-gui.c b/gui/hkl-gui.c index a46d7428..64a769f8 100644 --- a/gui/hkl-gui.c +++ b/gui/hkl-gui.c @@ -1961,204 +1961,6 @@ static void _hkl_gui_window_on_combobox1_changed_gtk_combo_box_changed (GtkCombo hkl_gui_window_on_combobox1_changed (self); } -#define CONNECT_SPINBUTTON(name) \ - g_signal_connect_object (priv->_ ## name, \ - "value-changed", \ - (GCallback) SPINBUTTON_VALUE_CHANGED_CB(name), \ - self, 0); - -#define CONNECT_UX_UY_UZ(name) \ - g_signal_connect_object (priv->_ ## name, \ - "value-changed", \ - (GCallback) _hkl_gui_window_on_spinbutton_uxuyuz_value_changed_gtk_spin_button_value_changed, \ - self, 0); - -#define CONNECT_CHECKBUTTON(name) \ - g_signal_connect_object (priv->_ ## name, \ - "toggled", \ - (GCallback) CHECKBUTTON_TOGGLED_CB(name), \ - self, 0); -static void -hkl_gui_window_connect_all_signals (HklGuiWindow* self) -{ - HklGuiWindowPrivate *priv = self->priv; - - g_return_if_fail (self != NULL); - - CONNECT_SPINBUTTON(spinbutton_a); - CONNECT_SPINBUTTON(spinbutton_a_min); - CONNECT_SPINBUTTON(spinbutton_a_max); - CONNECT_SPINBUTTON(spinbutton_a_star); - - CONNECT_SPINBUTTON(spinbutton_b); - CONNECT_SPINBUTTON(spinbutton_b_min); - CONNECT_SPINBUTTON(spinbutton_b_max); - CONNECT_SPINBUTTON(spinbutton_b_star); - - CONNECT_SPINBUTTON(spinbutton_c); - CONNECT_SPINBUTTON(spinbutton_c_min); - CONNECT_SPINBUTTON(spinbutton_c_max); - CONNECT_SPINBUTTON(spinbutton_c_star); - - CONNECT_SPINBUTTON(spinbutton_alpha); - CONNECT_SPINBUTTON(spinbutton_alpha_min); - CONNECT_SPINBUTTON(spinbutton_alpha_max); - CONNECT_SPINBUTTON(spinbutton_alpha_star); - - CONNECT_SPINBUTTON(spinbutton_beta); - CONNECT_SPINBUTTON(spinbutton_beta_min); - CONNECT_SPINBUTTON(spinbutton_beta_max); - CONNECT_SPINBUTTON(spinbutton_beta_star); - - CONNECT_SPINBUTTON(spinbutton_alpha); - CONNECT_SPINBUTTON(spinbutton_alpha_min); - CONNECT_SPINBUTTON(spinbutton_alpha_max); - CONNECT_SPINBUTTON(spinbutton_alpha_star); - - g_signal_connect_object (priv->_spinbutton_lambda, - "value-changed", - (GCallback) _hkl_gui_window_on_spinbutton_lambda_value_changed_gtk_spin_button_value_changed, - self, 0); - - CONNECT_UX_UY_UZ(spinbutton_ux); - CONNECT_UX_UY_UZ(spinbutton_uy); - CONNECT_UX_UY_UZ(spinbutton_uz); - - g_signal_connect_object (priv->_button2, - "clicked", - (GCallback) _hkl_gui_window_on_button2_clicked_gtk_button_clicked, - self, 0); - - CONNECT_CHECKBUTTON(checkbutton_a); - CONNECT_CHECKBUTTON(checkbutton_b); - CONNECT_CHECKBUTTON(checkbutton_c); - CONNECT_CHECKBUTTON(checkbutton_alpha); - CONNECT_CHECKBUTTON(checkbutton_beta); - CONNECT_CHECKBUTTON(checkbutton_gamma); - CONNECT_CHECKBUTTON(checkbutton_Ux); - CONNECT_CHECKBUTTON(checkbutton_Uy); - CONNECT_CHECKBUTTON(checkbutton_Uz); - - g_signal_connect_object (GTK_WIDGET(priv->_treeview_reflections), - "key-press-event", - (GCallback) _hkl_gui_window_on_tree_view_reflections_key_press_event_gtk_widget_key_press_event, - self, 0); - - g_signal_connect_object (priv->_treeview_pseudo_axes, - "cursor-changed", - (GCallback) _hkl_gui_window_on_tree_view_pseudo_axes_cursor_changed_gtk_tree_view_cursor_changed, - self, 0); - - g_signal_connect_object (priv->_treeview_crystals, - "cursor-changed", - (GCallback) _hkl_gui_window_on_tree_view_crystals_cursor_changed_gtk_tree_view_cursor_changed, self, 0); - - g_signal_connect_object (GTK_WIDGET(priv->_treeview_crystals), - "key-press-event", - (GCallback) _hkl_gui_window_on_tree_view_crystals_key_press_event_gtk_widget_key_press_event, - self, 0); - - g_signal_connect_object (priv->_toolbutton_add_reflection, - "clicked", - (GCallback) _hkl_gui_window_on_toolbutton_add_reflection_clicked_gtk_tool_button_clicked, - self, 0); - - g_signal_connect_object (priv->_toolbutton_goto_reflection, - "clicked", - (GCallback) _hkl_gui_window_on_toolbutton_goto_reflection_clicked_gtk_tool_button_clicked, - self, 0); - - g_signal_connect_object (priv->_toolbutton_del_reflection, - "clicked", - (GCallback) _hkl_gui_window_on_toolbutton_del_reflection_clicked_gtk_tool_button_clicked, - self, 0); - - g_signal_connect_object (priv->_toolbutton_setUB, - "clicked", - (GCallback) _hkl_gui_window_on_toolbutton_setUB_clicked_gtk_tool_button_clicked, - self, 0); - - g_signal_connect_object (priv->_toolbutton_computeUB, - "clicked", - (GCallback) _hkl_gui_window_on_toolbutton_computeUB_clicked_gtk_tool_button_clicked, - self, 0); - - g_signal_connect_object (priv->_toolbutton_add_crystal, - "clicked", - (GCallback) _hkl_gui_window_on_toolbutton_add_crystal_clicked_gtk_tool_button_clicked, - self, 0); - - g_signal_connect_object (priv->_toolbutton_copy_crystal, - "clicked", - (GCallback) _hkl_gui_window_on_toolbutton_copy_crystal_clicked_gtk_tool_button_clicked, - self, 0); - - g_signal_connect_object (priv->_toolbutton_del_crystal, - "clicked", - (GCallback) _hkl_gui_window_on_toolbutton_del_crystal_clicked_gtk_tool_button_clicked, - self, 0); - - g_signal_connect_object (priv->_toolbutton_affiner, - "clicked", - (GCallback) _hkl_gui_window_on_toolbutton_affiner_clicked_gtk_tool_button_clicked, - self, 0); - - g_signal_connect_object (GTK_MENU_ITEM(priv->_menuitem5), - "activate", - (GCallback) _hkl_gui_window_on_menuitem5_activate_gtk_menu_item_activate, - self, 0); - - g_signal_connect_object (priv->_button1, - "clicked", - (GCallback) _hkl_gui_window_on_button1_clicked_gtk_button_clicked, - self, 0); - - g_signal_connect_object (priv->_combobox1, - "changed", - (GCallback) _hkl_gui_window_on_combobox1_changed_gtk_combo_box_changed, - self, 0); -} - - - - - -static void _hkl_gui_window_on_cell_tree_view_axes_read_edited_gtk_cell_renderer_text_edited (GtkCellRendererText* _sender, const gchar* path, const gchar* new_text, gpointer self) { - - hkl_gui_window_on_cell_tree_view_axes_read_edited (path, new_text, self); - -} - - -static void _hkl_gui_window_on_cell_tree_view_axes_write_edited_gtk_cell_renderer_text_edited (GtkCellRendererText* _sender, const gchar* path, const gchar* new_text, gpointer self) { - - hkl_gui_window_on_cell_tree_view_axes_write_edited (path, new_text, self); - -} - - -static void _hkl_gui_window_on_cell_tree_view_axes_min_edited_gtk_cell_renderer_text_edited (GtkCellRendererText* _sender, const gchar* path, const gchar* new_text, gpointer self) { - - hkl_gui_window_on_cell_tree_view_axes_min_edited (path, new_text, self); - -} - - -static void _hkl_gui_window_on_cell_tree_view_axes_max_edited_gtk_cell_renderer_text_edited (GtkCellRendererText* _sender, const gchar* path, const gchar* new_text, gpointer self) { - - hkl_gui_window_on_cell_tree_view_axes_max_edited (path, new_text, self); - -} - - - -static void _hkl_gui_window_on_cell_tree_view_pseudo_axes_write_edited_gtk_cell_renderer_text_edited (GtkCellRendererText* _sender, const gchar* path, const gchar* new_text, gpointer self) { - - hkl_gui_window_on_cell_tree_view_pseudo_axes_write_edited (path, new_text, self); - -} - - static void _hkl_gui_window_on_cell_tree_view_pseudo_axes_is_initialized_toggled_gtk_cell_renderer_toggle_toggled (GtkCellRendererToggle* _sender, const gchar* path, gpointer self) { hkl_gui_window_on_cell_tree_view_pseudo_axes_is_initialized_toggled (path, self); @@ -3211,91 +3013,6 @@ static void hkl_gui_window_on_checkbutton_Uz_toggled (HklGuiWindow* self) { } } - -static gdouble double_parse (const gchar* str) { - gdouble result = 0.0; - const gchar* _tmp0_; - gdouble _tmp1_ = 0.0; - - g_return_val_if_fail (str != NULL, 0.0); - - _tmp0_ = str; - - _tmp1_ = g_ascii_strtod (_tmp0_, NULL); - - result = _tmp1_; - - return result; - -} - - - - -static void hkl_gui_window_on_cell_tree_view_axes_write_edited (const gchar* path, const gchar* new_text, HklGuiWindow* self) { - GtkTreeIter iter = {0}; - gdouble value = 0.0; - HklAxis* axis = NULL; - GtkListStore* _tmp0_; - const gchar* _tmp1_; - GtkTreeIter _tmp2_ = {0}; - GtkListStore* _tmp3_; - GtkTreeIter _tmp4_; - const gchar* _tmp5_; - gdouble _tmp6_ = 0.0; - HklAxis _tmp7_; - HklGeometry* _tmp8_; - GtkListStore* _tmp9_; - GtkTreeIter _tmp10_; - - g_return_if_fail (self != NULL); - - g_return_if_fail (path != NULL); - - g_return_if_fail (new_text != NULL); - - _tmp0_ = priv->store_axis; - - _tmp1_ = path; - - gtk_tree_model_get_iter_from_string ((GtkTreeModel*) _tmp0_, &_tmp2_, _tmp1_); - - iter = _tmp2_; - - _tmp3_ = priv->store_axis; - - _tmp4_ = iter; - - gtk_tree_model_get ((GtkTreeModel*) _tmp3_, &_tmp4_, AXIS_COL_AXIS, &axis, -1); - - _tmp5_ = new_text; - - _tmp6_ = double_parse (_tmp5_); - - value = _tmp6_; - - _tmp7_ = *axis; - - hkl_axis_set_value_unit (&_tmp7_, value); - - _tmp8_ = priv->geometry; - hkl_geometry_update (_tmp8_); - - _tmp9_ = priv->store_axis; - - _tmp10_ = iter; - - gtk_list_store_set (_tmp9_, &_tmp10_, AXIS_COL_WRITE, value, -1); - - hkl_gui_window_update_pseudo_axes (self); - - hkl_gui_window_update_pseudo_axes_frames (self); - -} - - - - static void hkl_gui_window_on_cell_tree_view_pseudo_axes_is_initialized_toggled (const gchar* path, HklGuiWindow* self) { GtkTreeModel* model = NULL; GtkTreeIter iter = {0}; @@ -3890,77 +3607,6 @@ void hkl_gui_window_on_button1_clicked (HklGuiWindow* self) { } - -void hkl_gui_window_on_combobox1_changed (HklGuiWindow* self) { - gsize idx = 0UL; - HklGeometryConfig config = {0}; - GtkComboBox* _tmp0_; - gint _tmp1_ = 0; - HklGeometryConfig _tmp2_; - HklGeometryConfig _tmp3_; - HklGeometry* _tmp4_ = NULL; - HklGeometryConfig _tmp5_; - HklPseudoAxisEngineList* _tmp6_ = NULL; - HklPseudoAxisEngineList* _tmp7_; - HklGeometry* _tmp8_; - HklDetector* _tmp9_; - HklSampleList* _tmp10_; - HklSample* _tmp11_; - - g_return_if_fail (self != NULL); - - _tmp0_ = priv->_combobox1; - - _tmp1_ = gtk_combo_box_get_active (_tmp0_); - - idx = (gsize) _tmp1_; - - _tmp2_ = hkl_geometry_factory_configs[idx]; - - config = _tmp2_; - - _tmp3_ = config; - - _tmp4_ = hkl_geometry_factory_new (&_tmp3_, 50 * HKL_DEGTORAD); - - _hkl_geometry_free0 (priv->geometry); - - priv->geometry = _tmp4_; - - _tmp5_ = config; - - _tmp6_ = hkl_pseudo_axis_engine_list_factory (&_tmp5_); - - _hkl_pseudo_axis_engine_list_free0 (priv->engines); - - priv->engines = _tmp6_; - - _tmp7_ = priv->engines; - - _tmp8_ = priv->geometry; - - _tmp9_ = priv->detector; - - _tmp10_ = priv->samples; - - _tmp11_ = _tmp10_->current; - - hkl_pseudo_axis_engine_list_init (_tmp7_, _tmp8_, _tmp9_, _tmp11_); - - hkl_gui_window_set_up_pseudo_axes_frames (self); - - hkl_gui_window_set_up_tree_view_axes (self); - - hkl_gui_window_set_up_tree_view_pseudo_axes_parameters (self); - - hkl_gui_window_set_up_tree_view_pseudo_axes (self); - - hkl_gui_window_set_up_tree_view_treeview1 (self); - - hkl_gui_window_set_up_3D (self); - -} - */ static void @@ -3993,14 +3639,6 @@ static void hkl_gui_window_init (HklGuiWindow * self) set_up_tree_view_crystals (self); //hkl_gui_window_update_source (self); - - //hkl_gui_window_update_reciprocal_lattice (self); - - //hkl_gui_window_update_UxUyUz (self); - - //hkl_gui_window_update_UB (self); - - //hkl_gui_window_connect_all_signals (self); } int main (int argc, char ** argv) -- 2.11.4.GIT