mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 07:14:56 +01:00
more gobject fixups
git-svn-id: svn://localhost/trunk/ardour2@127 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
5c776da778
commit
52eba2ccbe
7 changed files with 278 additions and 131 deletions
|
|
@ -18,28 +18,36 @@
|
|||
#include "libart_lgpl/art_rgb_pixbuf_affine.h"
|
||||
#include "canvas-imageframe.h"
|
||||
#include <libgnomecanvas/gnome-canvas-util.h>
|
||||
#include "gettext.h"
|
||||
#define _(Text) dgettext (PACKAGE,Text)
|
||||
|
||||
//GTK2FIX
|
||||
//#include <libgnomecanvas/gnome-canvastypebuiltins.h>
|
||||
|
||||
|
||||
enum {
|
||||
ARG_0,
|
||||
ARG_PIXBUF,
|
||||
ARG_X,
|
||||
ARG_Y,
|
||||
ARG_WIDTH,
|
||||
ARG_HEIGHT,
|
||||
ARG_DRAWWIDTH,
|
||||
ARG_ANCHOR
|
||||
PROP_0,
|
||||
PROP_PIXBUF,
|
||||
PROP_X,
|
||||
PROP_Y,
|
||||
PROP_WIDTH,
|
||||
PROP_HEIGHT,
|
||||
PROP_DRAWWIDTH,
|
||||
PROP_ANCHOR
|
||||
};
|
||||
|
||||
|
||||
static void gnome_canvas_imageframe_class_init(GnomeCanvasImageFrameClass* class) ;
|
||||
static void gnome_canvas_imageframe_init(GnomeCanvasImageFrame* image) ;
|
||||
static void gnome_canvas_imageframe_destroy(GtkObject* object) ;
|
||||
static void gnome_canvas_imageframe_set_arg(GtkObject* object, GtkArg* arg, guint arg_id) ;
|
||||
static void gnome_canvas_imageframe_get_arg(GtkObject* object, GtkArg* arg, guint arg_id) ;
|
||||
|
||||
static void gnome_canvas_imageframe_set_property(GObject* object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec);
|
||||
static void gnome_canvas_imageframe_get_property(GObject* object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec);
|
||||
static void gnome_canvas_imageframe_update(GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags) ;
|
||||
static void gnome_canvas_imageframe_realize(GnomeCanvasItem *item) ;
|
||||
static void gnome_canvas_imageframe_unrealize(GnomeCanvasItem *item) ;
|
||||
|
|
@ -51,10 +59,10 @@ static void gnome_canvas_imageframe_render(GnomeCanvasItem *item, GnomeCanvasBuf
|
|||
static GnomeCanvasItemClass *parent_class;
|
||||
|
||||
|
||||
GtkType
|
||||
GType
|
||||
gnome_canvas_imageframe_get_type (void)
|
||||
{
|
||||
static GtkType imageframe_type = 0;
|
||||
static GType imageframe_type = 0;
|
||||
|
||||
if (!imageframe_type) {
|
||||
GtkTypeInfo imageframe_info = {
|
||||
|
|
@ -77,25 +85,83 @@ gnome_canvas_imageframe_get_type (void)
|
|||
static void
|
||||
gnome_canvas_imageframe_class_init (GnomeCanvasImageFrameClass *class)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
GtkObjectClass *object_class;
|
||||
GnomeCanvasItemClass *item_class;
|
||||
|
||||
gobject_class = (GObjectClass *) class;
|
||||
object_class = (GtkObjectClass *) class;
|
||||
item_class = (GnomeCanvasItemClass *) class;
|
||||
|
||||
parent_class = gtk_type_class (gnome_canvas_item_get_type ());
|
||||
|
||||
gtk_object_add_arg_type ("GnomeCanvasImageFrame::pixbuf", GTK_TYPE_BOXED, GTK_ARG_WRITABLE, ARG_PIXBUF);
|
||||
gtk_object_add_arg_type ("GnomeCanvasImageFrame::x", GTK_TYPE_DOUBLE, GTK_ARG_READWRITE, ARG_X);
|
||||
gtk_object_add_arg_type ("GnomeCanvasImageFrame::y", GTK_TYPE_DOUBLE, GTK_ARG_READWRITE, ARG_Y);
|
||||
gtk_object_add_arg_type ("GnomeCanvasImageFrame::width", GTK_TYPE_DOUBLE, GTK_ARG_READWRITE, ARG_WIDTH);
|
||||
gtk_object_add_arg_type ("GnomeCanvasImageFrame::drawwidth", GTK_TYPE_DOUBLE, GTK_ARG_READWRITE, ARG_DRAWWIDTH);
|
||||
gtk_object_add_arg_type ("GnomeCanvasImageFrame::height", GTK_TYPE_DOUBLE, GTK_ARG_READWRITE, ARG_HEIGHT);
|
||||
gtk_object_add_arg_type ("GnomeCanvasImageFrame::anchor", GTK_TYPE_ANCHOR_TYPE, GTK_ARG_READWRITE, ARG_ANCHOR);
|
||||
gobject_class->set_property = gnome_canvas_imageframe_set_property;
|
||||
gobject_class->get_property = gnome_canvas_imageframe_get_property;
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_PIXBUF,
|
||||
g_param_spec_boxed ("pixbuf",
|
||||
_("pixbuf"),
|
||||
_("the pixbuf"),
|
||||
GDK_TYPE_PIXBUF,
|
||||
G_PARAM_WRITABLE));
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_X,
|
||||
g_param_spec_double ("x",
|
||||
_("x"),
|
||||
_("x coordinate of upper left corner of rect"),
|
||||
-G_MAXDOUBLE,
|
||||
G_MAXDOUBLE,
|
||||
0.0,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_Y,
|
||||
g_param_spec_double ("y",
|
||||
_("y"),
|
||||
_("y coordinate of upper left corner of rect "),
|
||||
-G_MAXDOUBLE,
|
||||
G_MAXDOUBLE,
|
||||
0.0,
|
||||
G_PARAM_READWRITE));
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_WIDTH,
|
||||
g_param_spec_double ("width",
|
||||
_("width"),
|
||||
_("the width"),
|
||||
-G_MAXDOUBLE,
|
||||
G_MAXDOUBLE,
|
||||
0.0,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_DRAWWIDTH,
|
||||
g_param_spec_double ("drawwidth",
|
||||
_("drawwidth"),
|
||||
_("drawn width"),
|
||||
-G_MAXDOUBLE,
|
||||
G_MAXDOUBLE,
|
||||
0.0,
|
||||
G_PARAM_READWRITE));
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_HEIGHT,
|
||||
g_param_spec_double ("height",
|
||||
_("height"),
|
||||
_("the height"),
|
||||
-G_MAXDOUBLE,
|
||||
G_MAXDOUBLE,
|
||||
0.0,
|
||||
G_PARAM_READWRITE));
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_ANCHOR,
|
||||
g_param_spec_enum ("anchor",
|
||||
_("anchor"),
|
||||
_("the anchor"),
|
||||
GTK_TYPE_ANCHOR_TYPE,
|
||||
GTK_ANCHOR_NW,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
object_class->destroy = gnome_canvas_imageframe_destroy;
|
||||
object_class->set_arg = gnome_canvas_imageframe_set_arg;
|
||||
object_class->get_arg = gnome_canvas_imageframe_get_arg;
|
||||
|
||||
item_class->update = gnome_canvas_imageframe_update;
|
||||
item_class->realize = gnome_canvas_imageframe_realize;
|
||||
|
|
@ -207,7 +273,10 @@ get_bounds_item_relative (GnomeCanvasImageFrame *image, double *px1, double *py1
|
|||
}
|
||||
|
||||
static void
|
||||
gnome_canvas_imageframe_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
|
||||
gnome_canvas_imageframe_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GnomeCanvasItem *item;
|
||||
GnomeCanvasImageFrame *image;
|
||||
|
|
@ -220,43 +289,43 @@ gnome_canvas_imageframe_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
|
|||
update = FALSE;
|
||||
calc_bounds = FALSE;
|
||||
|
||||
switch (arg_id) {
|
||||
case ARG_PIXBUF:
|
||||
if (item->canvas->aa && GTK_VALUE_BOXED (*arg)) {
|
||||
switch (prop_id) {
|
||||
case PROP_PIXBUF:
|
||||
if (item->canvas->aa && g_value_get_boxed (value)) {
|
||||
if (image->pixbuf != NULL)
|
||||
art_pixbuf_free (image->pixbuf);
|
||||
image->pixbuf = GTK_VALUE_BOXED (*arg);
|
||||
image->pixbuf = g_value_get_boxed (value);
|
||||
}
|
||||
update = TRUE;
|
||||
break;
|
||||
|
||||
case ARG_X:
|
||||
image->x = GTK_VALUE_DOUBLE (*arg);
|
||||
case PROP_X:
|
||||
image->x = g_value_get_double (value);
|
||||
update = TRUE;
|
||||
break;
|
||||
|
||||
case ARG_Y:
|
||||
image->y = GTK_VALUE_DOUBLE (*arg);
|
||||
case PROP_Y:
|
||||
image->y = g_value_get_double (value);
|
||||
update = TRUE;
|
||||
break;
|
||||
|
||||
case ARG_WIDTH:
|
||||
image->width = fabs (GTK_VALUE_DOUBLE (*arg));
|
||||
case PROP_WIDTH:
|
||||
image->width = fabs (g_value_get_double (value));
|
||||
update = TRUE;
|
||||
break;
|
||||
|
||||
case ARG_HEIGHT:
|
||||
image->height = fabs (GTK_VALUE_DOUBLE (*arg));
|
||||
case PROP_HEIGHT:
|
||||
image->height = fabs (g_value_get_double (value));
|
||||
update = TRUE;
|
||||
break;
|
||||
|
||||
case ARG_DRAWWIDTH:
|
||||
image->drawwidth = fabs (GTK_VALUE_DOUBLE (*arg));
|
||||
case PROP_DRAWWIDTH:
|
||||
image->drawwidth = fabs (g_value_get_double (value));
|
||||
update = TRUE;
|
||||
break;
|
||||
|
||||
case ARG_ANCHOR:
|
||||
image->anchor = GTK_VALUE_ENUM (*arg);
|
||||
case PROP_ANCHOR:
|
||||
image->anchor = g_value_get_enum (value);
|
||||
update = TRUE;
|
||||
break;
|
||||
|
||||
|
|
@ -269,40 +338,43 @@ gnome_canvas_imageframe_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
|
|||
}
|
||||
|
||||
static void
|
||||
gnome_canvas_imageframe_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
|
||||
gnome_canvas_imageframe_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GnomeCanvasImageFrame *image;
|
||||
|
||||
image = GNOME_CANVAS_IMAGEFRAME (object);
|
||||
|
||||
switch (arg_id) {
|
||||
switch (prop_id) {
|
||||
|
||||
case ARG_X:
|
||||
GTK_VALUE_DOUBLE (*arg) = image->x;
|
||||
case PROP_X:
|
||||
g_value_set_double (value, image->x);
|
||||
break;
|
||||
|
||||
case ARG_Y:
|
||||
GTK_VALUE_DOUBLE (*arg) = image->y;
|
||||
case PROP_Y:
|
||||
g_value_set_double (value, image->y);
|
||||
break;
|
||||
|
||||
case ARG_WIDTH:
|
||||
GTK_VALUE_DOUBLE (*arg) = image->width;
|
||||
case PROP_WIDTH:
|
||||
g_value_set_double (value, image->width);
|
||||
break;
|
||||
|
||||
case ARG_HEIGHT:
|
||||
GTK_VALUE_DOUBLE (*arg) = image->height;
|
||||
|
||||
case PROP_HEIGHT:
|
||||
g_value_set_double (value, image->height);
|
||||
break;
|
||||
|
||||
case ARG_DRAWWIDTH:
|
||||
GTK_VALUE_DOUBLE (*arg) = image->drawwidth;
|
||||
case PROP_DRAWWIDTH:
|
||||
g_value_set_double (value, image->drawwidth);
|
||||
break;
|
||||
|
||||
case ARG_ANCHOR:
|
||||
GTK_VALUE_ENUM (*arg) = image->anchor;
|
||||
case PROP_ANCHOR:
|
||||
g_value_set_enum (value, image->anchor);
|
||||
break;
|
||||
|
||||
default:
|
||||
arg->type = GTK_TYPE_INVALID;
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,26 +6,27 @@
|
|||
#include "rgb_macros.h"
|
||||
|
||||
enum {
|
||||
ARG_0,
|
||||
ARG_X1,
|
||||
ARG_Y1,
|
||||
ARG_X2,
|
||||
ARG_Y2,
|
||||
ARG_FRAMES_PER_UNIT,
|
||||
ARG_FILL_COLOR,
|
||||
ARG_TICK_COLOR
|
||||
PROP_0,
|
||||
PROP_X1,
|
||||
PROP_Y1,
|
||||
PROP_X2,
|
||||
PROP_Y2,
|
||||
PROP_FRAMES_PER_UNIT,
|
||||
PROP_FILL_COLOR,
|
||||
PROP_TICK_COLOR
|
||||
|
||||
};
|
||||
|
||||
static void gnome_canvas_ruler_class_init (GnomeCanvasRulerClass *class);
|
||||
static void gnome_canvas_ruler_init (GnomeCanvasRuler *ruler);
|
||||
static void gnome_canvas_ruler_set_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
static void gnome_canvas_ruler_get_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
|
||||
static void gnome_canvas_ruler_set_arg (GObject *object,
|
||||
guint prop_id
|
||||
const GValue *value,
|
||||
GParamSpec *pspec);
|
||||
static void gnome_canvas_ruler_get_arg (GObject *object,
|
||||
guint prop_id
|
||||
GValue *value,
|
||||
GParamSpec *pspec);
|
||||
static void gnome_canvas_ruler_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags);
|
||||
static void gnome_canvas_ruler_bounds (GnomeCanvasItem *item, double *x1, double *y1, double *x2, double *y2);
|
||||
static double gnome_canvas_ruler_point (GnomeCanvasItem *item, double x, double y, int cx, int cy, GnomeCanvasItem **actual_item);
|
||||
|
|
@ -64,22 +65,87 @@ gnome_canvas_ruler_class_init (GnomeCanvasRulerClass *class)
|
|||
GtkObjectClass *object_class;
|
||||
GnomeCanvasItemClass *item_class;
|
||||
|
||||
object_class = (GtkObjectClass *) class;
|
||||
object_class = G_OBJECT_CLASS (class);
|
||||
item_class = (GnomeCanvasItemClass *) class;
|
||||
|
||||
parent_class = gtk_type_class (gnome_canvas_item_get_type ());
|
||||
|
||||
gtk_object_add_arg_type ("GnomeCanvasRuler::x1", GTK_TYPE_DOUBLE, GTK_ARG_READWRITE, ARG_X1);
|
||||
gtk_object_add_arg_type ("GnomeCanvasRuler::y1", GTK_TYPE_DOUBLE, GTK_ARG_READWRITE, ARG_Y1);
|
||||
gtk_object_add_arg_type ("GnomeCanvasRuler::x2", GTK_TYPE_DOUBLE, GTK_ARG_READWRITE, ARG_X2);
|
||||
gtk_object_add_arg_type ("GnomeCanvasRuler::y2", GTK_TYPE_DOUBLE, GTK_ARG_READWRITE, ARG_Y2);
|
||||
gtk_object_add_arg_type ("GnomeCanvasRuler::frames_per_unit", GTK_TYPE_LONG, GTK_ARG_READWRITE, ARG_FRAMES_PER_UNIT);
|
||||
gtk_object_add_arg_type ("GnomeCanvasRuler::fill_color", GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_FILL_COLOR);
|
||||
gtk_object_add_arg_type ("GnomeCanvasRuler::tick_color", GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_TICK_COLOR);
|
||||
|
||||
object_class->set_arg = gnome_canvas_ruler_set_arg;
|
||||
object_class->get_arg = gnome_canvas_ruler_get_arg;
|
||||
object_class->set_property = gnome_canvas_ruler_set_property;
|
||||
object_class->get_property = gnome_canvas_ruler_get_property;
|
||||
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_X1,
|
||||
g_param_spec_double ("x1",
|
||||
_("x1"),
|
||||
_("x coordinate of upper left corner of rect"),
|
||||
-G_MAXDOUBLE,
|
||||
G_MAXDOUBLE,
|
||||
0.0,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_Y1,
|
||||
g_param_spec_double ("y1",
|
||||
_("y1"),
|
||||
_("y coordinate of upper left corner of rect "),
|
||||
-G_MAXDOUBLE,
|
||||
G_MAXDOUBLE,
|
||||
0.0,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_X2,
|
||||
g_param_spec_double ("x2",
|
||||
_("x2"),
|
||||
_("x coordinate of lower right corner of rect"),
|
||||
-G_MAXDOUBLE,
|
||||
G_MAXDOUBLE,
|
||||
0.0,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_Y2,
|
||||
g_param_spec_double ("y2",
|
||||
_("y2"),
|
||||
_("y coordinate of lower right corner of rect "),
|
||||
-G_MAXDOUBLE,
|
||||
G_MAXDOUBLE,
|
||||
0.0,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_FRAMES_PER_UNIT,
|
||||
g_param_spec_long ("frames_per_unit",
|
||||
_("frames_per_unit"),
|
||||
_("frames_per_unit of ruler"),
|
||||
-G_MAXLONG,
|
||||
G_MAXLONG,
|
||||
0,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_FILL_COLOR,
|
||||
g_param_spec_uint ("fill_color",
|
||||
_("fill color"),
|
||||
_("color of fill"),
|
||||
0,
|
||||
G_MAXINT,
|
||||
0,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_TICK_COLOR,
|
||||
g_param_spec_uint ("tick_color",
|
||||
_("tick color"),
|
||||
_("color of tick"),
|
||||
0,
|
||||
G_MAXINT,
|
||||
0,
|
||||
G_PARAM_READWRITE));
|
||||
item_class->update = gnome_canvas_ruler_update;
|
||||
item_class->bounds = gnome_canvas_ruler_bounds;
|
||||
item_class->point = gnome_canvas_ruler_point;
|
||||
|
|
@ -136,7 +202,10 @@ gnome_canvas_ruler_reset_bounds (GnomeCanvasItem *item)
|
|||
*/
|
||||
|
||||
static void
|
||||
gnome_canvas_ruler_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
|
||||
gnome_canvas_ruler_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GnomeCanvasItem *item;
|
||||
GnomeCanvasRuler *ruler;
|
||||
|
|
@ -149,52 +218,52 @@ gnome_canvas_ruler_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
|
|||
redraw = FALSE;
|
||||
calc_bounds = FALSE;
|
||||
|
||||
switch (arg_id) {
|
||||
case ARG_X1:
|
||||
if (ruler->x1 != GTK_VALUE_DOUBLE (*arg)) {
|
||||
ruler->x1 = GTK_VALUE_DOUBLE (*arg);
|
||||
switch (prop_id) {
|
||||
case PROP_X1:
|
||||
if (ruler->x1 != g_value_get_double (value)) {
|
||||
ruler->x1 = g_value_get_double (value);
|
||||
calc_bounds = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case ARG_Y1:
|
||||
if (ruler->y1 != GTK_VALUE_DOUBLE (*arg)) {
|
||||
ruler->y1 = GTK_VALUE_DOUBLE (*arg);
|
||||
case PROP_Y1:
|
||||
if (ruler->y1 != g_value_get_double (value)) {
|
||||
ruler->y1 = g_value_get_double (value);
|
||||
calc_bounds = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case ARG_X2:
|
||||
if (ruler->x2 != GTK_VALUE_DOUBLE (*arg)) {
|
||||
ruler->x2 = GTK_VALUE_DOUBLE (*arg);
|
||||
case PROP_X2:
|
||||
if (ruler->x2 != g_value_get_double (value)) {
|
||||
ruler->x2 = g_value_get_double (value);
|
||||
calc_bounds = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case ARG_Y2:
|
||||
if (ruler->y2 != GTK_VALUE_DOUBLE (*arg)) {
|
||||
ruler->y2 = GTK_VALUE_DOUBLE (*arg);
|
||||
case PROP_Y2:
|
||||
if (ruler->y2 != g_value_get_double (value)) {
|
||||
ruler->y2 = g_value_get_double (value);
|
||||
calc_bounds = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case ARG_FRAMES_PER_UNIT:
|
||||
if (ruler->frames_per_unit != GTK_VALUE_LONG(*arg)) {
|
||||
ruler->frames_per_unit = GTK_VALUE_LONG(*arg);
|
||||
case PROP_FRAMES_PER_UNIT:
|
||||
if (ruler->frames_per_unit != g_value_get_long(value)) {
|
||||
ruler->frames_per_unit = g_value_get_long(value);
|
||||
redraw = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case ARG_FILL_COLOR:
|
||||
if (ruler->fill_color != GTK_VALUE_INT(*arg)) {
|
||||
ruler->fill_color = GTK_VALUE_INT(*arg);
|
||||
case PROP_FILL_COLOR:
|
||||
if (ruler->fill_color != g_value_get_uint(value)) {
|
||||
ruler->fill_color = g_value_get_uint(value);
|
||||
redraw = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case ARG_TICK_COLOR:
|
||||
if (ruler->tick_color != GTK_VALUE_INT(*arg)) {
|
||||
ruler->tick_color = GTK_VALUE_INT(*arg);
|
||||
case PROP_TICK_COLOR:
|
||||
if (ruler->tick_color != g_value_get_uint(value)) {
|
||||
ruler->tick_color = g_value_get_uint(value);
|
||||
redraw = TRUE;
|
||||
}
|
||||
break;
|
||||
|
|
@ -214,33 +283,37 @@ gnome_canvas_ruler_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
|
|||
}
|
||||
|
||||
static void
|
||||
gnome_canvas_ruler_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
|
||||
gnome_canvas_ruler_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
|
||||
{
|
||||
GnomeCanvasRuler *ruler;
|
||||
|
||||
ruler = GNOME_CANVAS_RULER (object);
|
||||
|
||||
switch (arg_id) {
|
||||
case ARG_X1:
|
||||
GTK_VALUE_DOUBLE (*arg) = ruler->x1;
|
||||
switch (prop_id) {
|
||||
case PROP_X1:
|
||||
g_value_set_double (value, ruler->x1);
|
||||
break;
|
||||
case ARG_Y1:
|
||||
GTK_VALUE_DOUBLE (*arg) = ruler->y1;
|
||||
case PROP_Y1:
|
||||
g_value_set_double (value, ruler->y1);
|
||||
break;
|
||||
case ARG_X2:
|
||||
GTK_VALUE_DOUBLE (*arg) = ruler->x2;
|
||||
case PROP_X2:
|
||||
g_value_set_double (value, ruler->x2);
|
||||
break;
|
||||
case ARG_Y2:
|
||||
GTK_VALUE_DOUBLE (*arg) = ruler->y2;
|
||||
case PROP_Y2:
|
||||
g_value_set_double (value, ruler->y2);
|
||||
break;
|
||||
case ARG_FRAMES_PER_UNIT:
|
||||
GTK_VALUE_LONG (*arg) = ruler->frames_per_unit;
|
||||
case PROP_FRAMES_PER_UNIT:
|
||||
g_value_set_long (value, ruler->frames_per_unit);
|
||||
break;
|
||||
case ARG_FILL_COLOR:
|
||||
GTK_VALUE_INT (*arg) = ruler->fill_color;
|
||||
case PROP_FILL_COLOR:
|
||||
g_value_set_uint (value, ruler->fill_color);
|
||||
break;
|
||||
case ARG_TICK_COLOR:
|
||||
GTK_VALUE_INT (*arg) = ruler->tick_color;
|
||||
case PROP_TICK_COLOR:
|
||||
g_value_set_uint (value, ruler->tick_color);
|
||||
break;
|
||||
default:
|
||||
arg->type = GTK_TYPE_INVALID;
|
||||
|
|
|
|||
|
|
@ -484,6 +484,8 @@ gnome_canvas_simplerect_update (GnomeCanvasItem *item, double *affine, ArtSVP *c
|
|||
GnomeCanvasSimpleRect *simplerect;
|
||||
unsigned char foo;
|
||||
|
||||
g_return_if_fail (clip_path != NULL);
|
||||
|
||||
simplerect = GNOME_CANVAS_SIMPLERECT (item);
|
||||
|
||||
if (parent_class->update)
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ static gint gtk_custom_hruler_motion_notify (GtkWidget * widget, GdkEventMotion
|
|||
static void gtk_custom_hruler_draw_ticks (GtkCustomRuler * ruler);
|
||||
static void gtk_custom_hruler_draw_pos (GtkCustomRuler * ruler);
|
||||
|
||||
guint gtk_custom_hruler_get_type (void)
|
||||
GType gtk_custom_hruler_get_type (void)
|
||||
{
|
||||
static GType hruler_type = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ struct _GtkCustomHRulerClass
|
|||
};
|
||||
|
||||
|
||||
guint gtk_custom_hruler_get_type (void);
|
||||
GType gtk_custom_hruler_get_type (void);
|
||||
GtkWidget* gtk_custom_hruler_new (void);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ static const GtkCustomMetric default_metric = {
|
|||
|
||||
static GtkWidgetClass *parent_class;
|
||||
|
||||
GtkType gtk_custom_ruler_get_type (void)
|
||||
GType gtk_custom_ruler_get_type (void)
|
||||
{
|
||||
static GType ruler_type = 0;
|
||||
|
||||
|
|
@ -81,10 +81,10 @@ GtkType gtk_custom_ruler_get_type (void)
|
|||
static const GTypeInfo ruler_info =
|
||||
{
|
||||
sizeof (GtkCustomRulerClass),
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GBaseInitFunc) NULL, /* base_init */
|
||||
(GBaseFinalizeFunc) NULL, /* base_finalize */
|
||||
(GClassInitFunc) gtk_custom_ruler_class_init,
|
||||
NULL, /* class_finalize */
|
||||
(GClassFinalizeFunc) NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GtkCustomRuler),
|
||||
0, /* n_preallocs */
|
||||
|
|
@ -104,7 +104,7 @@ gtk_custom_ruler_class_init (GtkCustomRulerClass * class)
|
|||
GObjectClass *gobject_class;
|
||||
GtkWidgetClass *widget_class;
|
||||
|
||||
gobject_class = G_OBJECT_CLASS (class);
|
||||
gobject_class = (GObjectClass *) class;
|
||||
widget_class = (GtkWidgetClass*) class;
|
||||
|
||||
parent_class = g_type_class_peek_parent (class);
|
||||
|
|
@ -334,11 +334,11 @@ gtk_custom_ruler_get_range (GtkCustomRuler *ruler,
|
|||
void
|
||||
gtk_custom_ruler_draw_ticks (GtkCustomRuler * ruler)
|
||||
{
|
||||
GtkCustomRulerClass *klass;
|
||||
GtkCustomRulerClass *klass;
|
||||
g_return_if_fail (ruler != NULL);
|
||||
g_return_if_fail (GTK_IS_CUSTOM_RULER (ruler));
|
||||
|
||||
klass = GTK_CUSTOM_RULER_CLASS (GTK_OBJECT (ruler));
|
||||
klass = GTK_CUSTOM_RULER_CLASS (GTK_OBJECT_CLASS (ruler));
|
||||
if (klass->draw_ticks)
|
||||
klass->draw_ticks (ruler);
|
||||
}
|
||||
|
|
@ -350,7 +350,7 @@ gtk_custom_ruler_draw_pos (GtkCustomRuler * ruler)
|
|||
g_return_if_fail (ruler != NULL);
|
||||
g_return_if_fail (GTK_IS_CUSTOM_RULER (ruler));
|
||||
|
||||
klass = GTK_CUSTOM_RULER_CLASS (GTK_OBJECT (ruler));
|
||||
klass = GTK_CUSTOM_RULER_CLASS (GTK_OBJECT_CLASS (ruler));
|
||||
if (klass->draw_pos && ruler->show_position)
|
||||
klass->draw_pos (ruler);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ struct _GtkCustomMetric {
|
|||
gint (* get_marks) (GtkCustomRulerMark **marks, gdouble lower, gdouble upper, gint maxchars);
|
||||
};
|
||||
|
||||
GtkType gtk_custom_ruler_get_type (void);
|
||||
GType gtk_custom_ruler_get_type (void);
|
||||
void gtk_custom_ruler_set_metric (GtkCustomRuler *ruler, GtkCustomMetric *metric);
|
||||
void gtk_custom_ruler_set_range (GtkCustomRuler *ruler,
|
||||
gdouble lower,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue