testgcuchem3dviewer.c

Go to the documentation of this file.
00001 /* 
00002  * Gnome Chemisty Utils
00003  * tests/testgcuchem3dviewer.c 
00004  *
00005  * Copyright (C) 2008-2010 Jean Bréfort <jean.brefort@normalesup.org>
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2.1 of the License, or (at your option) any later version.
00011  *
00012  * This library 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 GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with this program; if not, write to the 
00019  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
00020  * Boston, MA  02110-1301, USA.
00021  */
00022 
00023 #include "config.h"
00024 #include <gcu/chemistry.h>
00025 #include <gcu/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 }

Generated on Fri Sep 24 15:58:42 2010 for The Gnome Chemistry Utils by  doxygen 1.5.9