~ubuntu-branches/ubuntu/natty/gnome-chemistry-utils/natty-security

« back to all changes in this revision

Viewing changes to tests/testgtkchem3dviewer.c

  • Committer: Bazaar Package Importer
  • Author(s): Jordan Mantha
  • Date: 2007-12-12 20:34:25 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20071212203425-yfb4zry8fdy8iupn
Tags: 0.8.4-3ubuntu1
* Merge from Debian unstable
* debian/control: add firefox to gcu-plugin dependencies
* Modify Maintainer value to match the DebianMaintainerField
  specification.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* 
2
 
 * Gnome Chemisty Utils
3
 
 * testgtkchem3dviewer.c 
4
 
 *
5
 
 * Copyright (C) 2006 Jean Bréfort <jean.brefort@normalesup.org>
6
 
 *
7
 
 * This program is free software; you can redistribute it and/or 
8
 
 * modify it under the terms of the GNU General Public License as 
9
 
 * published by the Free Software Foundation; either version 2 of the
10
 
 * License, or (at your option) any later version.
11
 
 *
12
 
 * This program is distributed in the hope that it will be useful,
13
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 
 * GNU General Public License for more details.
16
 
 *
17
 
 * You should have received a copy of the GNU General Public License
18
 
 * along with this program; if not, write to the Free Software
19
 
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
20
 
 * USA
21
 
 */
22
 
 
23
1
#include "config.h"
24
2
#include <gcu/chemistry.h>
25
3
#include <gcu/gtkchem3dviewer.h>
31
9
/*!\file
32
10
A simple sample of the use of the GtkChem3DViewer widget.
33
11
*/
34
 
int main(int argc, char *argv[])
 
12
 
 
13
/*!
 
14
\a main function of the test program. It fulfills the following operations, in order:
 
15
- initialize Gt and GnomeVFS;
 
16
- loads atomic radii (the 3D viewer needs the van der Waals radii).
 
17
- build the widow embedding the sample GtkChem3DViewer.
 
18
- build the GtkChem3DViewer with either a file from the command line or the default
 
19
methane.xyz provided with the sources.
 
20
- shows everything and enter \a gtk_main().
 
21
*/
 
22
int main (int argc, char *argv[])
35
23
{
36
24
        GtkWidget *window;
37
25
        GtkWidget *viewer;
45
33
        gcu_element_load_databases ("radii", NULL);
46
34
 
47
35
        window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
48
 
        gtk_window_set_title(GTK_WINDOW(window), "GtkChem3dViewer test");
49
 
        g_signal_connect(GTK_OBJECT(window), "destroy",
50
 
                 GTK_SIGNAL_FUNC(gtk_main_quit),
 
36
        gtk_window_set_title (GTK_WINDOW (window), "GtkChem3dViewer test");
 
37
        g_signal_connect (G_OBJECT (window), "destroy",
 
38
                 G_CALLBACK (gtk_main_quit),
51
39
                 NULL);
52
40
 
53
 
        if (argc >= 2) uri = argv[1];
54
 
                else uri = "file://"SRCDIR"/methane.xyz";
 
41
        if (argc >= 2)
 
42
                uri = argv[1];
 
43
        else
 
44
                uri = "file://"SRCDIR"/methane.xyz";
55
45
        
56
 
        viewer = gtk_chem3d_viewer_new(uri);
57
 
        gtk_container_add(GTK_CONTAINER(window), viewer);
58
 
        gtk_widget_show_all(window);
 
46
        viewer = gtk_chem3d_viewer_new (uri);
 
47
        gtk_container_add (GTK_CONTAINER (window), viewer);
 
48
        gtk_widget_show_all (window);
59
49
 
60
 
        gtk_main();
 
50
        gtk_main ();
61
51
        
62
 
        return(0);
 
52
        return 0;
63
53
}