File: gcrcrystalviewer.h

package info (click to toggle)
gnome-chemistry-utils 0.14.9-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 17,836 kB
  • ctags: 7,337
  • sloc: cpp: 72,977; sh: 11,381; xml: 6,304; makefile: 1,663; ansic: 1,061
file content (125 lines) | stat: -rw-r--r-- 4,920 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/*
 * Gnome Chemisty Utils
 * gcr/gcrcrystalviewer.h
 *
 * Copyright (C) 2002-2012 Jean Bréfort <jean.brefort@normalesup.org>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
 * USA
 */

/*!\file
Declaration of the GcrCrystalViewer widget.
*/

#ifndef GCR_CRYSTAL_VIEWER_H
#define GCR_CRYSTAL_VIEWER_H

#include <gtk/gtk.h>
#include <libxml/tree.h>

G_BEGIN_DECLS

/*!\return the GType associated to GcrCrystalViewer */
#define GCR_TYPE_CRYSTAL_VIEWER		  (gcr_crystal_viewer_get_type ())
/*!
Casts \a obj to a GcrCrystalViewer * pointer.
\return a pointer to the GcrCrystalViewer * or NULL if \a obj does not point to
a GcrCrystalViewer widget.
*/
#define GCR_CRYSTAL_VIEWER(obj)		  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCR_TYPE_CRYSTAL_VIEWER, GcrCrystalViewer))
/*!
Casts \a klass to a GcrCrystalViewerClass * pointer.
\return a pointer to the GcrCrystalViewerClass * or NULL if \a obj not point to a GcrCrystalViewerClass.
*/
#define GCR_CRYSTAL_VIEWER_CLASS(klass)	  (G_TYPE_CHECK_CLASS_CAST ((klass), GCR_TYPE_CRYSTAL_VIEWER, GcrCrystalViewerClass))
/*!
\return TRUE if \a obj points to a GcrCrystalViewer widget, FALSE otherwise.
*/
#define GCR_IS_CRYSTAL_VIEWER(obj)	  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCR_TYPE_CRYSTAL_VIEWER))
/*!
\return TRUE if \a klass points to a GcrCrystalViewerClass, FALSE otherwise.
*/
#define GCR_IS_CRYSTAL_VIEWER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GCR_TYPE_CRYSTAL_VIEWER))
/*!
\return the GcrCrystalViewerClass * associated to \a obj if obj points to a GcrCrystalViewer widget,
NULL otherwise.
*/
#define GCR_CRYSTAL_VIEWER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GCR_TYPE_CRYSTAL_VIEWER, GcrCrystalViewerClass))

/*! The GcrCrystalViewer widget.*/
typedef struct _GcrCrystalViewer       GcrCrystalViewer;
/*! The GcrCrystalViewer widget object class.*/
typedef struct _GcrCrystalViewerClass  GcrCrystalViewerClass;

/*!\struct GcrCrystalViewer
The GcrCrystalViewer widget displays a crystal structure using an OpenGL window. A test program is available in the tests
directory of the Gnome Chemistry Utils source archive (source in testgcrcrystalviewer.c).
<hr>
<h2>Functions</h2>

Functions related to the GcrCrystalViewer Widget are described in the gcrcrystalviewer.h page.
*/

GType               gcr_crystal_viewer_get_type          (void) G_GNUC_CONST;
/*!
@param node: a pointer to an xlNode (from libxml) containing the serialized version of the crystal to display as saved by
Gnome Crystal or NULL.

Builds a new GcrCrystalViewer widget and, if node is not NULL, fills it with the Crystal structure described in node.
@return a pointer to the new viewer.
*/
GtkWidget*            gcr_crystal_viewer_new               (xmlNodePtr node);
/*!
@param viewer: a pointer to a GcrCrystalViewer widget.
@param node: a pointer to an xlNode (from libxml) containing the serialized version of the crystal to display as saved by
Gnome Crystal.

Replaces the content of viewer by the Crystal structure described in node.
*/
void	gcr_crystal_viewer_set_data	(GcrCrystalViewer * viewer, xmlNodePtr node);

/*!
@param viewer a pointer to a GcrCrystalViewer widget.
@param width the width of the new pixbuf.
@param height the height of the new pixbuf.
@param use_bg whether to use the window background or a transparent background.

Renders the scene to a newly allocated pixbuf.
\return the new GdkPixbuf*.
*/
GdkPixbuf *gcr_crystal_viewer_new_pixbuf (GcrCrystalViewer * viewer, guint width, guint height, gboolean use_bg);

/*!
@param viewer a pointer to a GcrCrystalViewer widget.
@param uri the URI of the file containing the crystal structure to display.
@param mime_type: the mime_type of the data.

Changes the crystal structure displayed by the one described in the uri.
Nothing happens if uri is NULL.
*/
void	gcr_crystal_viewer_set_uri_with_mime_type	(GcrCrystalViewer * viewer, const gchar * uri, const gchar* mime_type);
/*!
@param viewer a pointer to a GcrCrystalViewer widget.
@param uri the URI of the file containing the crystal structure to display.

Changes the crystal structure displayed by the one described in the uri.
Nothing happens if uri is NULL.
*/
void	gcr_crystal_viewer_set_uri	(GcrCrystalViewer * viewer, const gchar * uri);

G_END_DECLS

#endif //	GCR_CRYSTAL_VIEWER_H