Logo Search packages:      
Sourcecode: scigraphica version File versions  Download package

sg_plot.h

/*  SciGraphica - Scientific graphics and data manipulation
 *  Copyright (C) 2001 Adrian E. Feiguin <feiguin@ifir.edu.ar>
 *
 *  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 2 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., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#ifndef __SG_PLOT_H__
#define __SG_PLOT_H__

#include <gtk/gtk.h>
#include <gtkextra/gtkextra.h>
#ifdef WITH_GNOME
#include <gnome.h>
#endif

#include "sg_layer.h"

enum{
     SG_TOOL_ARROW,
     SG_TOOL_ZOOM,
     SG_TOOL_POINTER,
     SG_TOOL_MARKERS,
     SG_TOOL_DND_POINT,
     SG_TOOL_LINE,
     SG_TOOL_LINE_ARROW,
     SG_TOOL_RECTANGLE,
     SG_TOOL_ELLIPSE,
     SG_TOOL_TEXT,
};

enum{
     SG_RESCALE_NONE,
     SG_RESCALE_AUTO
};


#define SG_DPI 75.0

enum{SG_UNIT_PT,
     SG_UNIT_MM,
     SG_UNIT_CM,
     SG_UNIT_IN,
     SG_UNIT_PIXEL
};

#define GTK_TYPE_SG_PLOT                  (sg_plot_get_type ())
#define SG_PLOT(obj)                  (GTK_CHECK_CAST ((obj), GTK_TYPE_SG_PLOT, SGplot))
#define SG_PLOT_CLASS(klass)          (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_SG_PLOT, SGplotClass))
#define GTK_IS_SG_PLOT(obj)               (GTK_CHECK_TYPE ((obj), GTK_TYPE_SG_PLOT))
#define GTK_IS_SG_PLOT_CLASS(klass)       (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SG_PLOT))


typedef struct _SGplot SGplot;
typedef struct _SGplotClass SGplotClass;

struct _SGplot 
{
#ifdef WITH_GNOME
  GnomeApp window;
#else
  GtkWindow window;
#endif

  gchar *name;
  gint x, y, width, height;
  
  gint orientation;
  gint page_size;
  gint page_width, page_height;

  gint page_units;

  gboolean is_mapped;

  gdouble scale;

  gint tool;

  SGlayer *active_layer;

  GtkWidget *real_canvas;

  GtkWidget *sw;
  GtkWidget *canvas_box;
  GtkWidget *toolbox;
  GtkWidget *label;
  GtkWidget *hruler;
  GtkWidget *vruler;

  GtkIconList *iconlist;
  GtkIconListItem *icon;

  gint nlayers;
  GList *layers;
 
  gboolean antialias;
};

struct _SGplotClass
{
#ifdef WITH_GNOME
  GnomeAppClass parent_class;
#else
  GtkWindowClass parent_class;
#endif
};


GtkType         sg_plot_get_type                (void);
SGplot          *sg_plot_new                    (gchar *name);
SGplot          *sg_plot_new_with_layer         (SGlayerType layer_type,
                                                gchar *name);

gint            sg_plot_rename                  (SGplot *plot,
                                                gchar *name); 
void            sg_plot_refresh_datasets        (SGplot *plot);
void            sg_plot_set_size                (SGplot *plot,
                                                gint page_size,
                                                gint width, gint height,
                                                gint orientation);
SGplot          *sg_plot_get_from_canvas        (GtkWidget *canvas);
void            sg_plot_rescale                 (SGplot *plot, gdouble scale); 
void            sg_plot_clear                   (SGplot *plot); 
void            sg_plot_remove                  (SGplot *plot); 
void            sg_plot_fit_page                (SGplot *plot);
void            sg_plot_fit_page_h              (SGplot *plot);
void            sg_plot_fit_page_v              (SGplot *plot);
void            sg_plot_add_layer               (SGplot *plot, SGlayer *layer,
                                                 gdouble x, gdouble y);
void            sg_plot_move_layer              (SGplot *plot, SGlayer *layer,
                                                 gdouble x, gdouble y);
void            sg_plot_resize_layer            (SGplot *plot, SGlayer *layer,
                                                 gdouble width, gdouble height);
void            sg_plot_remove_layer            (SGplot *plot, SGlayer *layer);
void            sg_plot_set_active_layer        (SGplot *plot, SGlayer *layer);
void            sg_plot_put_pixmap              (SGplot *plot, 
                                                 GdkPixmap *pixmap);
void            sg_plot_antialias               (SGplot *plot,
                                                 gboolean do_art);
void            sg_plot_show_top_toolbar(SGplot *plot);
#endif /* __SG_PLOT_H__ */


Generated by  Doxygen 1.6.0   Back to index