![]() |
![]() |
![]() |
Grits Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Signals |
#define GRITS_SKIP_CENTER #define GRITS_SKIP_HORIZON #define GRITS_SKIP_LOD #define GRITS_SKIP_STATE struct GritsObject; struct GritsObjectClass; GritsState; #define grits_object_center (object) void grits_object_draw (GritsObject *object
,GritsOpenGL *opengl
); gboolean grits_object_event (GritsObject *object
,GdkEvent *event
); void grits_object_hide (GritsObject *object
,gboolean hidden
); void grits_object_pick (GritsObject *object
,GritsOpenGL *opengl
); void grits_object_queue_draw (GritsObject *object
); void grits_object_set_cursor (GritsObject *object
,GdkCursorType cursor
); gboolean grits_object_set_pointer (GritsObject *object
,GdkEvent *event
,gboolean selected
);
GObject +----GritsObject +----GritsCallback +----GritsLine +----GritsMarker +----GritsPoly +----GritsTile +----GritsVolume
"button-press" :Run Last
"button-release" :Run Last
"clicked" :Run Last
"enter" :Run Last
"key-press" :Run Last
"key-release" :Run Last
"leave" :Run Last
"motion" :Run Last
Objects in grits are things which can be added to the viewer and will be displayed to the user. Each object has information such as it's location and level of detail which are used by the viewer to determine which objects should be drawn.
Each GritsObject is also a GObject, but not every GObject in grits is a GritsObject. The "Object" part of the name is just coincidence.
struct GritsObjectClass { GObjectClass parent_class; /* Move some of these to GObject? */ void (*draw) (GritsObject *object, GritsOpenGL *opengl); void (*pick) (GritsObject *object, GritsOpenGL *opengl); void (*hide) (GritsObject *object, gboolean hidden); };
#define grits_object_center(object)
Get the GritsPoint representing the center of an object
|
The GritsObject to get the center of |
Returns : |
the center point |
void grits_object_draw (GritsObject *object
,GritsOpenGL *opengl
);
Perform any OpenGL commands necessasairy to draw the object.
The GL_PROJECTION and GL_MODELVIEW matricies and GL_ALL_ATTRIB_BITS will be restored to the default state after the call to draw.
|
the object |
|
the viewer the object is being displayed in |
void grits_object_queue_draw (GritsObject *object
);
Cause the widget to be redrawn on the screen at some later point
|
The GritsObject that needs drawing |
void grits_object_set_cursor (GritsObject *object
,GdkCursorType cursor
);
Causes the cursor to use a particular icon when located over a given object
|
The GritsObject to set the cursor for |
|
The cursor to use when the object is hovered over |
gboolean grits_object_set_pointer (GritsObject *object
,GdkEvent *event
,gboolean selected
);
"button-press"
signalgboolean user_function (GritsObject *gritsobject,
gpointer arg1,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"button-release"
signalgboolean user_function (GritsObject *gritsobject,
gpointer arg1,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"clicked"
signalgboolean user_function (GritsObject *gritsobject,
gpointer arg1,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"enter"
signalgboolean user_function (GritsObject *object,
gpointer arg1,
gpointer user_data) : Run Last
The ::enter signal is emitted when the pointer moves over the object
|
the object. |
|
user data set when the signal handler was connected. |
"key-press"
signalgboolean user_function (GritsObject *gritsobject,
gpointer arg1,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"key-release"
signalgboolean user_function (GritsObject *gritsobject,
gpointer arg1,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"leave"
signalgboolean user_function (GritsObject *gritsobject,
gpointer arg1,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"motion"
signalgboolean user_function (GritsObject *gritsobject,
gpointer arg1,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |