Ejemplo n.º 1
0
static void
adg_projection_class_init(AdgProjectionClass *klass)
{
    GObjectClass *gobject_class;
    AdgEntityClass *entity_class;
    GParamSpec *param;
    AdgProjectionClassPrivate *data_class;

    gobject_class = (GObjectClass *) klass;
    entity_class = (AdgEntityClass *) klass;

    gobject_class->get_property = _adg_get_property;
    gobject_class->set_property = _adg_set_property;

    entity_class->arrange = _adg_arrange;
    entity_class->render = _adg_render;

    param = adg_param_spec_dress("symbol-dress",
                                 P_("Symbol Dress"),
                                 P_("The line dress to use for rendering the views of the projection"),
                                 ADG_DRESS_LINE,
                                 G_PARAM_READWRITE);
    g_object_class_install_property(gobject_class, PROP_SYMBOL_DRESS, param);

    param = adg_param_spec_dress("axis-dress",
                                 P_("Axis Dress"),
                                 P_("The line dress to use for rendering the axis of the projection scheme"),
                                 ADG_DRESS_LINE,
                                 G_PARAM_READWRITE);
    g_object_class_install_property(gobject_class, PROP_AXIS_DRESS, param);

    param = g_param_spec_enum("scheme",
                              P_("Projection Scheme"),
                              P_("The projection scheme to be represented"),
                              ADG_TYPE_PROJECTION_SCHEME,
                              ADG_PROJECTION_SCHEME_UNDEFINED,
                              G_PARAM_READWRITE);
    g_object_class_install_property(gobject_class, PROP_SCHEME, param);

    /* Initialize the private class data: the allocated struct is
     * never freed as this type is registered statically, hence
     * never destroyed. A better approach would be to use the old
     * type initialization (no G_TYPE_DEFINE and friends) that
     * allows to specify a custom class finalization method */
    data_class = g_new(AdgProjectionClassPrivate, 1);

    data_class->scheme = ADG_PROJECTION_SCHEME_UNDEFINED;
    data_class->symbol = NULL;
    data_class->axis = NULL;
    data_class->extents.is_defined = FALSE;

    klass->data_class = data_class;
}
Ejemplo n.º 2
0
Archivo: adg-logo.c Proyecto: ntd/adg
static void
adg_logo_class_init(AdgLogoClass *klass)
{
    GObjectClass *gobject_class;
    AdgEntityClass *entity_class;
    GParamSpec *param;
    AdgLogoClassPrivate *data_class;

    gobject_class = (GObjectClass *) klass;
    entity_class = (AdgEntityClass *) klass;

    gobject_class->get_property = _adg_get_property;
    gobject_class->set_property = _adg_set_property;

    entity_class->arrange = _adg_arrange;
    entity_class->render = _adg_render;

    param = adg_param_spec_dress("symbol-dress",
                                 P_("Symbol Dress"),
                                 P_("The line dress to use for rendering the symbol of the logo"),
                                 ADG_DRESS_LINE,
                                 G_PARAM_READWRITE);
    g_object_class_install_property(gobject_class, PROP_SYMBOL_DRESS, param);

    param = adg_param_spec_dress("screen-dress",
                                 P_("Screen Dress"),
                                 P_("The line dress to use for rendering the screen shape around the logo"),
                                 ADG_DRESS_LINE,
                                 G_PARAM_READWRITE);
    g_object_class_install_property(gobject_class, PROP_SCREEN_DRESS, param);

    param = adg_param_spec_dress("frame-dress",
                                 P_("Frame Dress"),
                                 P_("The line dress to use for rendering the frame"),
                                 ADG_DRESS_LINE,
                                 G_PARAM_READWRITE);
    g_object_class_install_property(gobject_class, PROP_FRAME_DRESS, param);

    /* Initialize the private class data: the allocated struct is
     * never freed as this type is registered statically, hence
     * never destroyed. A better approach would be to use the old
     * type initialization (no G_TYPE_DEFINE and friends) that
     * allows to specify a custom class finalization method */
    data_class = g_new(AdgLogoClassPrivate, 1);

    data_class->symbol = NULL;
    data_class->screen = NULL;
    data_class->frame = NULL;
    data_class->extents.is_defined = FALSE;

    klass->data_class = data_class;
}
Ejemplo n.º 3
0
static void
adg_stroke_class_init(AdgStrokeClass *klass)
{
    GObjectClass *gobject_class;
    AdgEntityClass *entity_class;
    GParamSpec *param;

    gobject_class = (GObjectClass *) klass;
    entity_class = (AdgEntityClass *) klass;

    g_type_class_add_private(klass, sizeof(AdgStrokePrivate));

    gobject_class->dispose = _adg_dispose;
    gobject_class->get_property = _adg_get_property;
    gobject_class->set_property = _adg_set_property;

    entity_class->global_changed = _adg_global_changed;
    entity_class->local_changed = _adg_local_changed;
    entity_class->arrange = _adg_arrange;
    entity_class->render = _adg_render;

    param = adg_param_spec_dress("line-dress",
                                 P_("Line Dress"),
                                 P_("The dress to use for stroking this entity"),
                                 ADG_DRESS_LINE_STROKE,
                                 G_PARAM_READWRITE);
    g_object_class_install_property(gobject_class, PROP_LINE_DRESS, param);

    param = g_param_spec_object("trail",
                                P_("Trail"),
                                P_("The trail to be stroked"),
                                ADG_TYPE_TRAIL,
                                G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
    g_object_class_install_property(gobject_class, PROP_TRAIL, param);
}
Ejemplo n.º 4
0
static void
adg_table_style_class_init(AdgTableStyleClass *klass)
{
    GObjectClass *gobject_class;
    AdgStyleClass *style_class;
    GParamSpec *param;

    gobject_class = (GObjectClass *) klass;
    style_class = (AdgStyleClass *) klass;

    g_type_class_add_private(klass, sizeof(AdgTableStylePrivate));

    gobject_class->get_property = _adg_get_property;
    gobject_class->set_property = _adg_set_property;

    style_class->apply = _adg_apply;

    param = adg_param_spec_dress("color-dress",
                                 P_("Color Dress"),
                                 P_("Fallback color dress, used when no specific dresses are selected"),
                                 ADG_DRESS_COLOR_ANNOTATION,
                                 G_PARAM_READWRITE);
    g_object_class_install_property(gobject_class, PROP_COLOR_DRESS, param);

    param = adg_param_spec_dress("grid-dress",
                                 P_("Grid Dress"),
                                 P_("Line dress to use while rendering the grid of the table"),
                                 ADG_DRESS_LINE_GRID,
                                 G_PARAM_READWRITE);
    g_object_class_install_property(gobject_class, PROP_GRID_DRESS, param);

    param = adg_param_spec_dress("frame-dress",
                                 P_("Frame Dress"),
                                 P_("Line dress to use while drawing the table frame"),
                                 ADG_DRESS_LINE_FRAME,
                                 G_PARAM_READWRITE);
    g_object_class_install_property(gobject_class, PROP_FRAME_DRESS, param);

    param = adg_param_spec_dress("title-dress",
                                 P_("Title Dress"),
                                 P_("Font dress to use for titles"),
                                 ADG_DRESS_FONT_ANNOTATION,
                                 G_PARAM_READWRITE);
    g_object_class_install_property(gobject_class, PROP_TITLE_DRESS, param);

    param = adg_param_spec_dress("value-dress",
                                 P_("Value Dress"),
                                 P_("Font dress to use for values inside the cells"),
                                 ADG_DRESS_FONT_TEXT,
                                 G_PARAM_READWRITE);
    g_object_class_install_property(gobject_class, PROP_VALUE_DRESS, param);

    param = g_param_spec_double("row-height",
                                P_("Row Height"),
                                P_("The fallback row height when not explicitely specified while creating a new row"),
                                0, G_MAXDOUBLE, 30,
                                G_PARAM_READWRITE);
    g_object_class_install_property(gobject_class, PROP_ROW_HEIGHT, param);

    param = g_param_spec_boxed("cell-padding",
                               P_("Cell Padding"),
                               P_("How much space from the bounding box must left inside every cell"),
                               CPML_TYPE_PAIR,
                               G_PARAM_READWRITE);
    g_object_class_install_property(gobject_class, PROP_CELL_PADDING, param);

    param = g_param_spec_boxed("cell-spacing",
                               P_("Cell Spacing"),
                               P_("How much space to left between the cells"),
                               CPML_TYPE_PAIR,
                               G_PARAM_READWRITE);
    g_object_class_install_property(gobject_class, PROP_CELL_SPACING, param);
}
Ejemplo n.º 5
0
Archivo: adg-dim.c Proyecto: bert/adg
static void
adg_dim_class_init(AdgDimClass *klass)
{
    GObjectClass *gobject_class;
    AdgEntityClass *entity_class;
    GParamSpec *param;

    gobject_class = (GObjectClass *) klass;
    entity_class = (AdgEntityClass *) klass;

    g_type_class_add_private(klass, sizeof(AdgDimPrivate));

    gobject_class->dispose = _adg_dispose;
    gobject_class->finalize = _adg_finalize;
    gobject_class->get_property = _adg_get_property;
    gobject_class->set_property = _adg_set_property;

    entity_class->global_changed = _adg_global_changed;
    entity_class->local_changed = _adg_local_changed;
    entity_class->invalidate = _adg_invalidate;
    entity_class->arrange = _adg_arrange;

    klass->quote_angle = _adg_quote_angle;
    klass->default_value = _adg_default_value;

    param = adg_param_spec_dress("dim-dress",
                                 P_("Dimension Dress"),
                                 P_("The dress to use for rendering this dimension"),
                                 ADG_DRESS_DIMENSION,
                                 G_PARAM_READWRITE);
    g_object_class_install_property(gobject_class, PROP_DIM_DRESS, param);

    param = g_param_spec_boxed("ref1",
                               P_("First Reference"),
                               P_("First reference point of the dimension"),
                               ADG_TYPE_POINT,
                               G_PARAM_READWRITE);
    g_object_class_install_property(gobject_class, PROP_REF1, param);

    param = g_param_spec_boxed("ref2",
                               P_("Second Reference"),
                               P_("Second reference point of the dimension"),
                               ADG_TYPE_POINT,
                               G_PARAM_READWRITE);
    g_object_class_install_property(gobject_class, PROP_REF2, param);

    param = g_param_spec_boxed("pos",
                               P_("Position"),
                               P_("The reference position of the quote: it will be combined with \"level\" to get the real quote position"),
                               ADG_TYPE_POINT,
                               G_PARAM_READWRITE);
    g_object_class_install_property(gobject_class, PROP_POS, param);

    param = g_param_spec_double("level",
                                P_("Level"),
                                P_("The dimension level, that is the factor to multiply the baseline spacing (defined in the dimension style) to get the offset from pos where the quote should be rendered"),
                                -G_MAXDOUBLE, G_MAXDOUBLE, 1.0,
                                G_PARAM_READWRITE);
    g_object_class_install_property(gobject_class, PROP_LEVEL, param);

    param = g_param_spec_enum("outside",
                              P_("Outside"),
                              P_("Whether the arrows must be inside the extension lines (ADG_THREE_STATE_OFF), must be extended outside the extension lines (ADG_THREE_STATE_ON) or should be automatically handled depending on the available space"),
                              ADG_TYPE_THREE_STATE, ADG_THREE_STATE_UNKNOWN,
                              G_PARAM_READWRITE);
    g_object_class_install_property(gobject_class, PROP_OUTSIDE, param);

    param = g_param_spec_enum("detached",
                              P_("Detached Quote"),
                              P_("Where the quote must be positioned: in the middle of the base line (ADG_THREE_STATE_OFF), near the pos point (ADG_THREE_STATE_ON) or should be automatically deducted depending on the available space"),
                              ADG_TYPE_THREE_STATE, ADG_THREE_STATE_UNKNOWN,
                              G_PARAM_READWRITE);
    g_object_class_install_property(gobject_class, PROP_DETACHED, param);

    param = g_param_spec_string("value",
                                P_("Value Template"),
                                P_("The template string to be used for generating the set value of the quote"),
                                NULL,
                                G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
    g_object_class_install_property(gobject_class, PROP_VALUE, param);

    param = g_param_spec_string("min",
                                P_("Minimum Value or Low Tolerance"),
                                P_("The minimum value allowed or the lowest tolerance from value (depending of the dimension style): set to NULL to suppress"),
                                NULL,
                                G_PARAM_READWRITE);
    g_object_class_install_property(gobject_class, PROP_MIN, param);

    param = g_param_spec_string("max",
                                P_("Maximum Value or High Tolerance"),
                                P_("The maximum value allowed or the highest tolerance from value (depending of the dimension style): set to NULL to suppress"),
                                NULL,
                                G_PARAM_READWRITE);
    g_object_class_install_property(gobject_class, PROP_MAX, param);
}
Ejemplo n.º 6
0
static void
adg_line_style_class_init(AdgLineStyleClass *klass)
{
    GObjectClass *gobject_class;
    AdgStyleClass *style_class;
    GParamSpec *param;

    gobject_class = (GObjectClass *) klass;
    style_class = (AdgStyleClass *) klass;

    g_type_class_add_private(klass, sizeof(AdgLineStylePrivate));

    gobject_class->get_property = _adg_get_property;
    gobject_class->set_property = _adg_set_property;

    style_class->apply = _adg_apply;

    param = adg_param_spec_dress("color-dress",
                                 P_("Color Dress"),
                                 P_("The color dress to bind to this line style"),
                                 ADG_DRESS_COLOR,
                                 G_PARAM_READWRITE);
    g_object_class_install_property(gobject_class, PROP_COLOR_DRESS, param);

    param = g_param_spec_double("width",
                                P_("Line Width"),
                                P_("The line thickness in device unit"),
                                0., G_MAXDOUBLE, 2., G_PARAM_READWRITE);
    g_object_class_install_property(gobject_class, PROP_WIDTH, param);

    param = g_param_spec_int("cap",
                             P_("Line Cap"),
                             P_("The line cap mode"),
                             G_MININT, G_MAXINT, CAIRO_LINE_CAP_ROUND,
                             G_PARAM_READWRITE);
    g_object_class_install_property(gobject_class, PROP_CAP, param);

    param = g_param_spec_int("join",
                             P_("Line Join"),
                             P_("The line join mode"),
                             G_MININT, G_MAXINT, CAIRO_LINE_JOIN_MITER,
                             G_PARAM_READWRITE);
    g_object_class_install_property(gobject_class, PROP_JOIN, param);

    param = g_param_spec_double("miter-limit",
                                P_("Miter Limit"),
                                P_("Whether the lines should be joined with a bevel instead of a miter"),
                                0., G_MAXDOUBLE, 10., G_PARAM_READWRITE);
    g_object_class_install_property(gobject_class, PROP_MITER_LIMIT,
                                    param);

    param = g_param_spec_int("antialias",
                             P_("Antialiasing Mode"),
                             P_("Type of antialiasing to do when rendering lines"),
                             G_MININT, G_MAXINT, CAIRO_ANTIALIAS_DEFAULT,
                             G_PARAM_READWRITE);
    g_object_class_install_property(gobject_class, PROP_ANTIALIAS, param);

    param = g_param_spec_boxed("dash",
                               P_("Dash Pattern"),
                               P_("The dash pattern to be used while stroking a path"),
                               ADG_TYPE_DASH, G_PARAM_READWRITE);
    g_object_class_install_property(gobject_class, PROP_DASH, param);
}