The Gnome Chemistry Utils 0.13.3
|
00001 /* 00002 * Gnome Chemisty Utils 00003 * tests/testgcuchem3dviewer.c 00004 * 00005 * Copyright (C) 2008-2011 Jean Bréfort <jean.brefort@normalesup.org> 00006 * 00007 * This program is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU General Public License as 00009 * published by the Free Software Foundation; either version 2 of the 00010 * License, or (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 00020 * USA 00021 */ 00022 00023 #include "config.h" 00024 #include <gcu/chemistry.h> 00025 #include <gcugtk/gcuchem3dviewer.h> 00026 #include <glib.h> 00027 #include <gtk/gtk.h> 00028 #include <stdio.h> 00029 00043 int main (int argc, char *argv[]) 00044 { 00045 GtkWidget *window; 00046 GtkWidget *viewer; 00047 gchar* uri; 00048 gtk_init (&argc, &argv); 00049 00050 gcu_element_load_databases ("radii", NULL); 00051 00052 window = gtk_window_new (GTK_WINDOW_TOPLEVEL); 00053 gtk_window_set_title (GTK_WINDOW (window), "GcuChem3dViewer test"); 00054 g_signal_connect (G_OBJECT (window), "destroy", 00055 G_CALLBACK (gtk_main_quit), 00056 NULL); 00057 00058 if (argc >= 2) 00059 uri = argv[1]; 00060 else 00061 uri = "file://"SRCDIR"/methane.xyz"; 00062 00063 viewer = gcu_chem3d_viewer_new (uri); 00064 gtk_container_add (GTK_CONTAINER (window), viewer); 00065 gtk_widget_show_all (window); 00066 00067 gtk_main (); 00068 00069 return 0; 00070 }