pcb 4.1.1
An interactive printed circuit board layout editor.

gui-trackball.h

Go to the documentation of this file.
00001 /*
00002  *                            COPYRIGHT
00003  *
00004  *  PCB, interactive printed circuit board design
00005  *  Copyright (C) 2009  PCB Contributors (see ChangeLog for details)
00006  *
00007  *  This program is free software; you can redistribute it and/or modify
00008  *  it under the terms of the GNU General Public License as published by
00009  *  the Free Software Foundation; either version 2 of the License, or
00010  *  (at your option) any later version.
00011  *
00012  *  This program is distributed in the hope that it will be useful,
00013  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *  GNU General Public License for more details.
00016  *
00017  *  You should have received a copy of the GNU General Public License along
00018  *  with this program; if not, write to the Free Software Foundation, Inc.,
00019  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00020  *
00021  *  Contact addresses for paper mail and Email:
00022  *  Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
00023  *  Thomas.Nau@rz.uni-ulm.de
00024  *
00025  */
00026 
00027 #ifndef __GHID_TRACKBALL_H__
00028 #define __GHID_TRACKBALL_H__
00029 
00030 
00031 #define GHID_TYPE_TRACKBALL           (ghid_trackball_get_type())
00032 #define GHID_TRACKBALL(obj)           (G_TYPE_CHECK_INSTANCE_CAST ((obj), GHID_TYPE_TRACKBALL, GhidTrackball))
00033 #define GHID_TRACKBALL_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass),  GHID_TYPE_TRACKBALL, GhidTrackballClass))
00034 #define GHID_IS_TRACKBALL(obj)        (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GHID_TYPE_TRACKBALL))
00035 #define GHID_TRACKBALL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),  GHID_TYPE_TRACKBALL, GhidTrackballClass))
00036 
00037 typedef struct _GhidTrackballClass GhidTrackballClass;
00038 typedef struct _GhidTrackball GhidTrackball;
00039 
00040 
00041 struct _GhidTrackballClass
00042 {
00043   GtkVBoxClass parent_class;
00044 
00045   void (*rotation_changed) (GhidTrackball *ball, gpointer rotation, gpointer user_data);
00046   void (*view_2d_changed) (GhidTrackball *ball, gboolean view_2d, gpointer user_data);
00047 };
00048 
00049 struct _GhidTrackball
00050 {
00051   GtkVBox parent_instance;
00052 
00053   GtkWidget *drawing_area;
00054   GtkWidget *view_2d;
00055 
00056   gboolean dragging;
00057   gdouble x1, y1;
00058 
00059   float quart1[4];
00060   float quart2[4];
00061 };
00062 
00063 
00064 GType ghid_trackball_get_type (void);
00065 
00066 GtkWidget *ghid_trackball_new (void);
00067 
00068 #endif /* __GHID_TRACKBALL_H__ */