# gtkchem3dviewer.h File Reference

`#include <gtk/gtkbin.h>`
`#include <libxml/tree.h>`
`#include <libgnomeprint/gnome-print.h>`

Go to the source code of this file.

## Defines

#define | GTK_DISPLAY_3D (gtk_display3d_get_type ())
#define | GTK_TYPE_CHEM3D_VIEWER (gtk_chem3d_viewer_get_type ())
#define | GTK_CHEM3D_VIEWER(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_CHEM3D_VIEWER, GtkChem3DViewer))
#define | GTK_CHEM3D_VIEWER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_CHEM3D_VIEWER, GtkChem3DViewerClass))
#define | GTK_IS_CHEM3D_VIEWER(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_CHEM3D_VIEWER))
#define | GTK_IS_CHEM3D_VIEWER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CHEM3D_VIEWER))
#define | GTK_CHEM3D_VIEWER_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_CHEM3D_VIEWER, GtkChem3DViewerClass))

## Typedefs

typedef struct _GtkChem3DViewer | GtkChem3DViewer
typedef struct _GtkChem3DViewerClass | GtkChem3DViewerClass

## Functions

GtkWidget * | gtk_chem3d_viewer_new (const gchar *uri)
void | gtk_chem3d_viewer_set_uri_with_mime_type (GtkChem3DViewer *viewer, const gchar *uri, const gchar *mime_type)
void | gtk_chem3d_viewer_set_uri (GtkChem3DViewer *viewer, const gchar *uri)
void | gtk_chem3d_viewer_set_data (GtkChem3DViewer *viewer, const gchar *data, const gchar *mime_type)
void | gtk_chem3d_viewer_print (GtkChem3DViewer *viewer, GnomePrintContext *pc, gdouble width, gdouble height)

## Detailed Description

Declaration of the GtkChem3DViewer widget.

Definition in file gtkchem3dviewer.h.

## Define Documentation

#define GTK_CHEM3D_VIEWER | ( | obj |  | ) | (GTK_CHECK_CAST ((obj), GTK_TYPE_CHEM3D_VIEWER, GtkChem3DViewer))

Casts obj to a GtkChem3DViewer * pointer.

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

Definition at line 51 of file gtkchem3dviewer.h.

#define GTK_CHEM3D_VIEWER_CLASS | ( | klass |  | ) | (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_CHEM3D_VIEWER, GtkChem3DViewerClass))

Casts klass to a GtkChem3DViewerClass * pointer.

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

Definition at line 56 of file gtkchem3dviewer.h.

#define GTK_CHEM3D_VIEWER_GET_CLASS | ( | obj |  | ) | (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_CHEM3D_VIEWER, GtkChem3DViewerClass))

Returns:
  the GtkChem3DViewerClass * associated to obj if obj points to a GtkChem3DViewer widget, NULL otherwise.

Definition at line 69 of file gtkchem3dviewer.h.

#define GTK_DISPLAY_3D (gtk_display3d_get_type ())

Returns:
  the GType associated to the Display3D enum.

Definition at line 42 of file gtkchem3dviewer.h.

#define GTK_IS_CHEM3D_VIEWER | ( | obj |  | ) | (GTK_CHECK_TYPE ((obj), GTK_TYPE_CHEM3D_VIEWER))

Returns:
  TRUE if obj points to a GtkChem3DViewer widget, FALSE otherwise.

Definition at line 60 of file gtkchem3dviewer.h.

#define GTK_IS_CHEM3D_VIEWER_CLASS | ( | klass |  | ) | (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CHEM3D_VIEWER))

Returns:
  TRUE if klass points to a GtkChem3DViewerClass, FALSE otherwise.

Definition at line 64 of file gtkchem3dviewer.h.

#define GTK_TYPE_CHEM3D_VIEWER (gtk_chem3d_viewer_get_type ())

Returns:
  the GType associated to GtkChem3DViewer

Definition at line 45 of file gtkchem3dviewer.h.

## Typedef Documentation

typedef struct _GtkChem3DViewer GtkChem3DViewer

The GtkChem3DViewer widget.

Definition at line 95 of file gtkchem3dviewer.h.

typedef struct _GtkChem3DViewerClass GtkChem3DViewerClass

The GtkChem3DViewer widget object class.

Definition at line 97 of file gtkchem3dviewer.h.

## Function Documentation

GtkWidget* gtk_chem3d_viewer_new | ( | const gchar * | uri | ) |

Parameters:

  | uri,: | the URI of the file containing the molecular structure to display. Any file supported by OpenBabel may be used.

Creates a GtkChem3DViewer widget and fills it with the data from uri. If uri is NULL, the widget will be empty.

Referenced by main().

void gtk_chem3d_viewer_print | ( | GtkChem3DViewer * | viewer,
|  | GnomePrintContext * | pc,
|  | gdouble | width,
|  | gdouble | height |
| ) |  |  |

Parameters:

  | viewer,: | a pointer to GtkChem3DViewer widget.
  | pc,: | a pointer to the GnomePrintContext.
  | width,: | the width of the rectangle.
  | height,: | the height of the rectangle.

Prints the scene to a GnomePrintContext using a 300 dpi resolution.

void gtk_chem3d_viewer_set_data | ( | GtkChem3DViewer * | viewer,
|  | const gchar * | data,
|  | const gchar * | mime_type |
| ) |  |  |

Parameters:

  | viewer,: | a pointer to GtkChem3DViewer widget.
  | data,: | a pointer to the raw data representing a serialized version of molecule to display
  | mime_type,: | the mime_type of the data. Any type supported by OpenBabel may be used.

Changes the molecule displayed by the one described in the data. Nothing happens if data or mime-type is NULL.

void gtk_chem3d_viewer_set_uri | ( | GtkChem3DViewer * | viewer,
|  | const gchar * | uri |
| ) |  |  |

Parameters:

  | viewer,: | a pointer to GtkChem3DViewer widget.
  | uri,: | the URI of the file containing the molecular structure to display. OpenBabel may be used.

Changes the molecule displayed by the one described in the uri. Nothing happens if uri is NULL.

void gtk_chem3d_viewer_set_uri_with_mime_type | ( | GtkChem3DViewer * | viewer,
|  | const gchar * | uri,
|  | const gchar * | mime_type |
| ) |  |  |

Parameters:

  | viewer,: | a pointer to GtkChem3DViewer widget.
  | uri,: | the URI of the file containing the molecular structure to display. Any file supported by
  | mime_type,: | the mime_type of the data. Any type supported by OpenBabel may be used.

Changes the molecule displayed by the one described in the uri. Nothing happens if uri is NULL.