marker.h revision 4d0239401455512530d186ecd6b5e26dda3653e8
5488N/A#ifndef __SP_MARKER_H__
5488N/A#define __SP_MARKER_H__
5488N/A
5488N/A/*
5488N/A * SVG <marker> implementation
5488N/A *
5488N/A * Authors:
5488N/A * Lauris Kaplinski <lauris@kaplinski.com>
5488N/A *
5488N/A * Copyright (C) 1999-2003 Lauris Kaplinski
5488N/A *
5488N/A * Released under GNU GPL, read the file 'COPYING' for more information
5488N/A */
5488N/A
5488N/A/*
5488N/A * This is quite similar in logic to <svg>
5488N/A * Maybe we should merge them somehow (Lauris)
5488N/A */
5488N/A
5488N/A#define SP_TYPE_MARKER (sp_marker_get_type ())
5488N/A#define SP_MARKER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), SP_TYPE_MARKER, SPMarker))
5488N/A#define SP_IS_MARKER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), SP_TYPE_MARKER))
5488N/A
5488N/Aclass SPMarker;
5488N/Aclass SPMarkerClass;
5488N/Aclass SPMarkerView;
5488N/A
5488N/A#include <libnr/nr-matrix.h>
5488N/A#include <libnr/nr-rect.h>
5488N/A#include "svg/svg-length.h"
5488N/A#include "enums.h"
5488N/A#include "sp-item-group.h"
5488N/A#include "sp-marker-loc.h"
5488N/A#include "uri-references.h"
5488N/A
5488N/Astruct SPMarker : public SPGroup {
5488N/A /* units */
5488N/A unsigned int markerUnits_set : 1;
5488N/A unsigned int markerUnits : 1;
5488N/A
5488N/A /* reference point */
5488N/A SVGLength refX;
5488N/A SVGLength refY;
5488N/A
5488N/A /* dimensions */
5488N/A SVGLength markerWidth;
5488N/A SVGLength markerHeight;
5488N/A
5488N/A /* orient */
5488N/A unsigned int orient_set : 1;
5488N/A unsigned int orient_auto : 1;
5488N/A float orient;
5488N/A
5488N/A /* viewBox; */
5488N/A unsigned int viewBox_set : 1;
5488N/A NRRect viewBox;
5488N/A
5488N/A /* preserveAspectRatio */
5488N/A unsigned int aspect_set : 1;
5488N/A unsigned int aspect_align : 4;
5488N/A unsigned int aspect_clip : 1;
5488N/A
5488N/A /* Child to parent additional transform */
5488N/A NRMatrix c2p;
5488N/A
5488N/A /* Private views */
5488N/A SPMarkerView *views;
5488N/A};
5488N/A
5488N/Astruct SPMarkerClass {
5488N/A SPGroupClass parent_class;
5488N/A};
5488N/A
5488N/AGType sp_marker_get_type (void);
5488N/A
5488N/Aclass SPMarkerReference : public Inkscape::URIReference {
5488N/A SPMarkerReference(SPObject *obj) : URIReference(obj) {}
5488N/A SPMarker *getObject() const {
5488N/A return (SPMarker *)URIReference::getObject();
5488N/A }
5488N/Aprotected:
5488N/A virtual bool _acceptObject(SPObject *obj) const {
5488N/A return SP_IS_MARKER(obj);
5488N/A }
5488N/A};
5488N/A
5488N/Avoid sp_marker_show_dimension (SPMarker *marker, unsigned int key, unsigned int size);
5488N/ANRArenaItem *sp_marker_show_instance (SPMarker *marker, NRArenaItem *parent,
5488N/A unsigned int key, unsigned int pos,
5488N/A NR::Matrix const &base, float linewidth);
5488N/Avoid sp_marker_hide (SPMarker *marker, unsigned int key);
5488N/Aconst gchar *generate_marker (GSList *reprs, NR::Rect bounds, SPDocument *document, NR::Matrix transform, NR::Matrix move);
5488N/A
5488N/A
5488N/A#endif