pcb 4.1.1
An interactive printed circuit board layout editor.

gui-trackball.c File Reference

#include "global.h"
#include "gui.h"
#include "copy.h"
#include "data.h"
#include "draw.h"
#include "mymem.h"
#include "move.h"
#include "rotate.h"
#include "hid/common/trackball.h"
#include "gui-trackball.h"
Include dependency graph for gui-trackball.c:

Go to the source code of this file.

Enumerations

enum  { ROTATION_CHANGED, VIEW_2D_CHANGED, LAST_SIGNAL }

Functions

static gboolean button_press_cb (GtkWidget *widget, GdkEventButton *ev, gpointer userdata)
static gboolean button_release_cb (GtkWidget *widget, GdkEventButton *ev, gpointer userdata)
static gboolean motion_notify_cb (GtkWidget *widget, GdkEventMotion *ev, gpointer userdata)
static gboolean ghid_trackball_expose (GtkWidget *widget, GdkEventExpose *ev)
static gboolean view_2d_toggled_cb (GtkToggleButton *toggle, gpointer userdata)
static GObject * ghid_trackball_constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_properties)
 GObject constructor.
static void ghid_trackball_finalize (GObject *object)
 GObject finalise handler.
static void ghid_trackball_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
 GObject property setter function.
static void ghid_trackball_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
 GObject property getter function.
static void ghid_trackball_class_init (GhidTrackballClass *klass)
 GType class initialiser for GhidTrackball.
GType ghid_trackball_get_type ()
 Function to retrieve GhidTrackball's GType identifier.
GtkWidget * ghid_trackball_new (void)
 Convenience function to create a new trackball widget.

Variables

static guint ghid_trackball_signals [LAST_SIGNAL] = { 0 }
static GObjectClass * ghid_trackball_parent_class = NULL

Enumeration Type Documentation

anonymous enum
Enumerator:
ROTATION_CHANGED 
VIEW_2D_CHANGED 
LAST_SIGNAL 

Definition at line 48 of file gui-trackball.c.


Function Documentation

static gboolean button_press_cb ( GtkWidget *  widget,
GdkEventButton *  ev,
gpointer  userdata 
) [static]
static gboolean button_release_cb ( GtkWidget *  widget,
GdkEventButton *  ev,
gpointer  userdata 
) [static]
static void ghid_trackball_class_init ( GhidTrackballClass klass) [static]

GType class initialiser for GhidTrackball.

Function Description
GType class initialiser for GhidTrackball. We override our parent virtual class methods as needed and register our GObject properties.
Parameters:
[in]klassThe GhidTrackballClass we are initialising

Definition at line 368 of file gui-trackball.c.

References ghid_trackball_constructor(), ghid_trackball_finalize(), ghid_trackball_get_property(), ghid_trackball_parent_class, ghid_trackball_set_property(), ghid_trackball_signals, ROTATION_CHANGED, and VIEW_2D_CHANGED.

Referenced by ghid_trackball_get_type().

Here is the call graph for this function:

static GObject* ghid_trackball_constructor ( GType  type,
guint  n_construct_properties,
GObjectConstructParam *  construct_properties 
) [static]

GObject constructor.

Function Description
Chain up and construct the object, then setup the necessary state for our widget now it is constructed.
Parameters:
[in]typeThe GType of object to be constructed
[in]n_construct_propertiesNumber of construct properties
[in]contruct_paramsThe construct properties
Returns:
The GObject having just been constructed.

Definition at line 246 of file gui-trackball.c.

References _, axis_to_quat(), button_press_cb(), button_release_cb(), _GhidTrackball::drawing_area, FALSE, GHID_TRACKBALL, ghid_trackball_expose(), ghid_trackball_parent_class, motion_notify_cb(), _GhidTrackball::quart1, _GhidTrackball::quart2, TRUE, _GhidTrackball::view_2d, and view_2d_toggled_cb().

Referenced by ghid_trackball_class_init().

Here is the call graph for this function:

static gboolean ghid_trackball_expose ( GtkWidget *  widget,
GdkEventExpose *  ev 
) [static]

Definition at line 146 of file gui-trackball.c.

References FALSE, M_PI, and MIN.

Referenced by ghid_trackball_constructor().

static void ghid_trackball_finalize ( GObject *  object) [static]

GObject finalise handler.

Function Description
Just before the GhidTrackball GObject is finalized, free our allocated data, and then chain up to the parent's finalize handler.
Parameters:
[in]widgetThe GObject being finalized.

Definition at line 304 of file gui-trackball.c.

References ghid_trackball_parent_class.

Referenced by ghid_trackball_class_init().

static void ghid_trackball_get_property ( GObject *  object,
guint  property_id,
GValue *  value,
GParamSpec *  pspec 
) [static]

GObject property getter function.

Function Description
Getter function for GhidTrackball's GObject properties, "settings-name" and "toplevel".
Parameters:
[in]objectThe GObject whose properties we are getting
[in]property_idThe numeric id. under which the property was registered with g_object_class_install_property()
[out]valueThe GValue in which to return the value of the property
[in]pspecA GParamSpec describing the property being got

Definition at line 347 of file gui-trackball.c.

Referenced by ghid_trackball_class_init().

GType ghid_trackball_get_type ( void  )

Function to retrieve GhidTrackball's GType identifier.

Function Description
Function to retrieve GhidTrackball's GType identifier. Upon first call, this registers the GhidTrackball in the GType system. Subsequently it returns the saved value from its first execution.
Returns:
the GType identifier associated with GhidTrackball.

Definition at line 417 of file gui-trackball.c.

References ghid_trackball_class_init().

Here is the call graph for this function:

GtkWidget* ghid_trackball_new ( void  )

Convenience function to create a new trackball widget.

Function Description
Convenience function which creates a GhidTrackball.
Returns:
The GhidTrackball created.

Definition at line 452 of file gui-trackball.c.

References GHID_TYPE_TRACKBALL.

Referenced by ghid_build_pcb_top_window().

static void ghid_trackball_set_property ( GObject *  object,
guint  property_id,
const GValue *  value,
GParamSpec *  pspec 
) [static]

GObject property setter function.

Function Description
Setter function for GhidTrackball's GObject properties, "settings-name" and "toplevel".
Parameters:
[in]objectThe GObject whose properties we are setting
[in]property_idThe numeric id. under which the property was registered with g_object_class_install_property()
[in]valueThe GValue the property is being set from
[in]pspecA GParamSpec describing the property being set

Definition at line 323 of file gui-trackball.c.

Referenced by ghid_trackball_class_init().

static gboolean motion_notify_cb ( GtkWidget *  widget,
GdkEventMotion *  ev,
gpointer  userdata 
) [static]
static gboolean view_2d_toggled_cb ( GtkToggleButton *  toggle,
gpointer  userdata 
) [static]

Variable Documentation

GObjectClass* ghid_trackball_parent_class = NULL [static]
guint ghid_trackball_signals[LAST_SIGNAL] = { 0 } [static]