The Gnome Chemistry Utils  0.14.0
Macros | Typedefs | Functions
gcrcrystalviewer.h File Reference
#include <gtk/gtk.h>
#include <libxml/tree.h>

Go to the source code of this file.

Macros

#define GCR_TYPE_CRYSTAL_VIEWER   (gcr_crystal_viewer_get_type ())
#define GCR_CRYSTAL_VIEWER(obj)   (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCR_TYPE_CRYSTAL_VIEWER, GcrCrystalViewer))
#define GCR_CRYSTAL_VIEWER_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), GCR_TYPE_CRYSTAL_VIEWER, GcrCrystalViewerClass))
#define GCR_IS_CRYSTAL_VIEWER(obj)   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCR_TYPE_CRYSTAL_VIEWER))
#define GCR_IS_CRYSTAL_VIEWER_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GCR_TYPE_CRYSTAL_VIEWER))
#define GCR_CRYSTAL_VIEWER_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GCR_TYPE_CRYSTAL_VIEWER, GcrCrystalViewerClass))

Typedefs

typedef struct _GcrCrystalViewer GcrCrystalViewer
typedef struct
_GcrCrystalViewerClass 
GcrCrystalViewerClass

Functions

GtkWidget * gcr_crystal_viewer_new (xmlNodePtr node)
void gcr_crystal_viewer_set_data (GcrCrystalViewer *viewer, xmlNodePtr node)
GdkPixbuf * gcr_crystal_viewer_new_pixbuf (GcrCrystalViewer *viewer, guint width, guint height, gboolean use_bg)
void gcr_crystal_viewer_set_uri_with_mime_type (GcrCrystalViewer *viewer, const gchar *uri, const gchar *mime_type)
void gcr_crystal_viewer_set_uri (GcrCrystalViewer *viewer, const gchar *uri)

Detailed Description

Declaration of the GcrCrystalViewer widget.

Definition in file gcrcrystalviewer.h.

Macro Definition Documentation

#define GCR_CRYSTAL_VIEWER (   obj)    (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCR_TYPE_CRYSTAL_VIEWER, GcrCrystalViewer))

Casts obj to a GcrCrystalViewer * pointer.

Returns
a pointer to the GcrCrystalViewer * or NULL if obj does not point to a GcrCrystalViewer widget.

Definition at line 42 of file gcrcrystalviewer.h.

#define GCR_CRYSTAL_VIEWER_CLASS (   klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GCR_TYPE_CRYSTAL_VIEWER, GcrCrystalViewerClass))

Casts klass to a GcrCrystalViewerClass * pointer.

Returns
a pointer to the GcrCrystalViewerClass * or NULL if obj not point to a GcrCrystalViewerClass.

Definition at line 47 of file gcrcrystalviewer.h.

#define GCR_CRYSTAL_VIEWER_GET_CLASS (   obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GCR_TYPE_CRYSTAL_VIEWER, GcrCrystalViewerClass))
Returns
the GcrCrystalViewerClass * associated to obj if obj points to a GcrCrystalViewer widget, NULL otherwise.

Definition at line 60 of file gcrcrystalviewer.h.

#define GCR_IS_CRYSTAL_VIEWER (   obj)    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCR_TYPE_CRYSTAL_VIEWER))
Returns
TRUE if obj points to a GcrCrystalViewer widget, FALSE otherwise.

Definition at line 51 of file gcrcrystalviewer.h.

#define GCR_IS_CRYSTAL_VIEWER_CLASS (   klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), GCR_TYPE_CRYSTAL_VIEWER))
Returns
TRUE if klass points to a GcrCrystalViewerClass, FALSE otherwise.

Definition at line 55 of file gcrcrystalviewer.h.

#define GCR_TYPE_CRYSTAL_VIEWER   (gcr_crystal_viewer_get_type ())
Returns
the GType associated to GcrCrystalViewer

Definition at line 36 of file gcrcrystalviewer.h.

Typedef Documentation

typedef struct _GcrCrystalViewer GcrCrystalViewer

The GcrCrystalViewer widget.

Definition at line 63 of file gcrcrystalviewer.h.

typedef struct _GcrCrystalViewerClass GcrCrystalViewerClass

The GcrCrystalViewer widget object class.

Definition at line 65 of file gcrcrystalviewer.h.

Function Documentation

GtkWidget* gcr_crystal_viewer_new ( xmlNodePtr  node)
Parameters
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.

Returns
a pointer to the new viewer.

Referenced by main().

GdkPixbuf* gcr_crystal_viewer_new_pixbuf ( GcrCrystalViewer viewer,
guint  width,
guint  height,
gboolean  use_bg 
)
Parameters
viewera pointer to a GcrCrystalViewer widget.
widththe width of the new pixbuf.
heightthe height of the new pixbuf.
use_bgwhether to use the window background or a transparent background.

Renders the scene to a newly allocated pixbuf.

Returns
the new GdkPixbuf*.
void gcr_crystal_viewer_set_data ( GcrCrystalViewer viewer,
xmlNodePtr  node 
)
Parameters
viewer,:a pointer to a GcrCrystalViewer widget.
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_uri ( GcrCrystalViewer viewer,
const gchar *  uri 
)
Parameters
viewera pointer to a GcrCrystalViewer widget.
urithe 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_with_mime_type ( GcrCrystalViewer viewer,
const gchar *  uri,
const gchar *  mime_type 
)
Parameters
viewera pointer to a GcrCrystalViewer widget.
urithe URI of the file containing the crystal structure to display.
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.