X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=src%2Fobjects%2Fgrits-object.h;h=2c11cd3ba1751d9d64a35ef42ad0e4eaa4d18e7d;hb=8da8dd47ad2e642d5eaeaa852138064e5f6ed836;hp=9969278b5114891034bb9817cbd692b698d2c29c;hpb=e8af1dabca07d2b7a26369d845a81efeae3e08a0;p=grits diff --git a/src/objects/grits-object.h b/src/objects/grits-object.h index 9969278..2c11cd3 100644 --- a/src/objects/grits-object.h +++ b/src/objects/grits-object.h @@ -36,11 +36,14 @@ #define GRITS_SKIP_CENTER (1<<2) #define GRITS_SKIP_STATE (1<<3) +/* Mouse move threshold for clicking */ +#define GRITS_CLICK_THRESHOLD 8 + /* Picking states */ typedef struct { guint picked : 1; guint selected : 1; - guint clicking : 1; + guint clicking : 6; } GritsState; typedef struct _GritsObject GritsObject; @@ -98,6 +101,30 @@ void grits_object_queue_draw(GritsObject *object); */ void grits_object_set_cursor(GritsObject *object, GdkCursorType cursor); +/** + * grits_object_destroy: + * @object: The #GritsObject to destroy + * + * Removes the widget from it's current viewer (if it has one) and decrements + * it's reference count. + */ +void grits_object_destroy(GritsObject *object); + +/** + * grits_object_destroy_pointer: + * @object: The pointer to the #GritsObject to destroy + * + * This functions the same as grits_object_destroy, except that the location of + * the object is set to null before proceeding. + */ +#define grits_object_destroy_pointer(object) ({ \ + if (*object) { \ + GritsObject *tmp = GRITS_OBJECT(*object); \ + *object = NULL; \ + grits_object_destroy(tmp); \ + } \ +}) + /** * grits_object_center: * @object: The #GritsObject to get the center of