1 /* MInterfaceGeom.c */
2 /**********************************************************************************************************
3 Copyright (c) 2002-2013 Abdul-Rahman Allouche. All rights reserved
4 
5 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
6 documentation files (the Gabedit), to deal in the Software without restriction, including without limitation
7 the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
8 and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9 
10   The above copyright notice and this permission notice shall be included in all copies or substantial portions
11   of the Software.
12 
13 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
14 TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
15 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
16 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
17 DEALINGS IN THE SOFTWARE.
18 ************************************************************************************************************/
19 
20 
21 #include "../../Config.h"
22 #include <stdio.h>
23 #include <stdlib.h>
24 #include <string.h>
25 #include <gtk/gtk.h>
26 
27 #include "MInterfaceGeom.h"
28 #include "../Common/Global.h"
29 #include "../Geometry/GeomGlobal.h"
30 #include "../Geometry/GeomXYZ.h"
31 #include "../Geometry/GeomZmatrix.h"
32 #include "../Gaussian/GaussGlobal.h"
33 #include "../Utils/UtilsInterface.h"
34 #include "../Geometry/InterfaceGeom.h"
35 
36 /************************************************************************************************************/
AjoutePageGeom(GtkWidget * NoteBook,GeomS * geom)37 void AjoutePageGeom(GtkWidget *NoteBook,GeomS *geom)
38 {
39   GtkWidget *hbox;
40   GtkWidget *FrameType;
41   GtkWidget *Frame;
42   GtkWidget *LabelOnglet;
43   GtkWidget *LabelMenu;
44   GtkWidget *BoiteV;
45   GtkWidget *window1;
46   GtkWidget *vbox1;
47   GtkWidget *hbox1;
48   GtkWidget *label2;
49   GtkWidget *label3;
50   GtkWidget *hseparator2;
51   GtkWidget *combo2;
52   GtkWidget *combo_entry2;
53   GtkWidget *combo3;
54   GtkWidget *combo_entry3;
55   GtkWidget *combobox;
56   GList *combo2_items = NULL;
57   GList *combo3_items = NULL;
58 
59 
60   geom_is_open();
61   geominter=g_malloc(sizeof(GeomInter));
62   geominter->window= gtk_frame_new(NULL);
63   HboxGeom = NULL;
64 
65 
66   Frame =geominter->window;
67   gtk_container_set_border_width(GTK_CONTAINER(Frame), 10);
68 
69 
70 
71   LabelOnglet = gtk_label_new(_("Geometry"));
72   LabelMenu = gtk_label_new(_("Geometry"));
73   gtk_notebook_append_page_menu(GTK_NOTEBOOK(NoteBook),
74                                 Frame,
75                                 LabelOnglet, LabelMenu);
76 
77   BoiteV = gtk_vbox_new(FALSE, 0);
78   gtk_container_add(GTK_CONTAINER(Frame), BoiteV);
79 
80   window1=Frame;
81   vbox1 = BoiteV;
82   hbox1 = gtk_hbox_new (FALSE, 0);
83   gtk_widget_show (hbox1);
84   gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
85 
86 
87   label2 = gtk_label_new (_(" Symmetry : "));
88   gtk_widget_show (label2);
89   gtk_box_pack_start (GTK_BOX (hbox1), label2, FALSE, FALSE, 0);
90 
91   combo2 = gtk_combo_box_entry_new_text ();
92   gtk_widget_set_size_request(GTK_WIDGET(combo2),100,-1);
93   gtk_widget_show (combo2);
94   gtk_box_pack_start (GTK_BOX (hbox1), combo2, FALSE, FALSE, 0);
95   combo2_items = g_list_append (combo2_items, _("default"));
96   combo2_items = g_list_append (combo2_items, "NOSYM");
97   combo2_items = g_list_append (combo2_items, "Z");
98   combo2_items = g_list_append (combo2_items, "XY");
99   combo2_items = g_list_append (combo2_items, "XYZ");
100   combo2_items = g_list_append (combo2_items, "X,Y");
101   combo2_items = g_list_append (combo2_items, "XY,Z");
102   combo2_items = g_list_append (combo2_items, "XZ,YZ");
103   combo2_items = g_list_append (combo2_items, "X,Y,Z");
104   gtk_combo_box_entry_set_popdown_strings ( (combo2), combo2_items);
105   g_list_free (combo2_items);
106 
107   combo_entry2 = GTK_BIN (combo2)->child;
108   gtk_widget_show (combo_entry2);
109 
110 
111   label3 = gtk_label_new (_("         Options :    "));
112   gtk_widget_show (label3);
113   gtk_box_pack_start (GTK_BOX (hbox1), label3, FALSE, FALSE, 0);
114 
115   combo3 = gtk_combo_box_entry_new_text ();
116   gtk_widget_set_size_request(GTK_WIDGET(combo3),100,-1);
117   gtk_widget_show (combo3);
118   gtk_box_pack_start (GTK_BOX (hbox1), combo3, FALSE, FALSE, 0);
119   combo3_items = g_list_append (combo3_items, _("none"));
120   combo3_items = g_list_append (combo3_items, "MASS");
121   combo3_items = g_list_append (combo3_items, "CHARGE");
122   combo3_items = g_list_append (combo3_items, "NOORIENT");
123   combo3_items = g_list_append (combo3_items, "PLANEXZ");
124   combo3_items = g_list_append (combo3_items, "PLANEYZ");
125   combo3_items = g_list_append (combo3_items, "PLANEXY");
126   gtk_combo_box_entry_set_popdown_strings ( (combo3), combo3_items);
127   g_list_free (combo3_items);
128 
129   combo_entry3 = GTK_BIN (combo3)->child;
130   gtk_widget_show (combo_entry3);
131 
132   hseparator2 = gtk_hseparator_new ();
133   gtk_widget_show (hseparator2);
134   gtk_box_pack_start (GTK_BOX (BoiteV), hseparator2, FALSE, FALSE, 0);
135 
136   hbox =create_hbox_false(BoiteV);
137   FrameType = create_frame(window1,hbox,_("TYPE"));
138 
139   combobox = create_geom(window1,FrameType);
140 
141   geominter->vbox=BoiteV;
142   geominter->frametitle=g_strdup(_("GEOMETRY"));
143 
144    geom->Symentry=combo_entry2;
145    geom->Optentry=combo_entry3;
146 
147  if(GeomXYZ != NULL && MethodeGeom == GEOM_IS_XYZ)
148      create_geomXYZ_interface (GABEDIT_TYPEFILEGEOM_UNKNOWN);
149  if(Geom != NULL && MethodeGeom == GEOM_IS_ZMAT)
150      create_geom_interface (GABEDIT_TYPEFILEGEOM_UNKNOWN);
151  gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), 0);
152 }
153 
154