sp-glyph-kerning.h revision 11f343b8117dbf56931f537820c2749a8232fec2
b93ce4197e7f5026a1c8deeb79cbd00aa3f86d91JazzyNico/*
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches * SVG <hkern> and <vkern> elements implementation
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches *
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches * Authors:
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches * Felipe C. da S. Sanches <juca@members.fsf.org>
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches *
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches * Copyright (C) 2008 Felipe C. da S. Sanches
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches *
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches * Released under GNU GPL, read the file 'COPYING' for more information
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches */
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches#ifndef SEEN_SP_GLYPH_KERNING_H
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches#define SEEN_SP_GLYPH_KERNING_H
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches#include "sp-object.h"
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches#include "unicoderange.h"
107e00c8104649437b9520d0ba298dba659e7cd7JazzyNico
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches#define SP_HKERN(obj) (dynamic_cast<SPHkern*>(obj))
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches#define SP_IS_HKERN(obj) (dynamic_cast<const SPHkern*>(obj) != NULL)
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches#define SP_VKERN(obj) (dynamic_cast<SPVkern*>(obj))
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches#define SP_IS_VKERN(obj) (dynamic_cast<const SPVkern*>(obj) != NULL)
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches// CPPIFY: These casting macros are buggy, as Vkern and Hkern aren't "real" classes.
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanchesclass GlyphNames {
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanchespublic:
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches GlyphNames(char const* value);
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches ~GlyphNames();
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches bool contains(char const* name);
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanchesprivate:
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches char* names;
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches};
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanchesclass SPGlyphKerning : public SPObject {
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanchespublic:
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches SPGlyphKerning();
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches virtual ~SPGlyphKerning() {}
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches // FIXME encapsulation
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches UnicodeRange* u1;
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches GlyphNames* g1;
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches UnicodeRange* u2;
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches GlyphNames* g2;
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches double k;
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanchesprotected:
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches virtual void build(SPDocument* doc, Inkscape::XML::Node* repr);
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches virtual void release();
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches virtual void set(unsigned int key, char const* value);
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches virtual void update(SPCtx* ctx, unsigned int flags);
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches virtual Inkscape::XML::Node* write(Inkscape::XML::Document* doc, Inkscape::XML::Node* repr, unsigned int flags);
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches};
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanchesclass SPHkern : public SPGlyphKerning {
virtual ~SPHkern() {}
};
class SPVkern : public SPGlyphKerning {
virtual ~SPVkern() {}
};
#endif // !SEEN_SP_GLYPH_KERNING_H
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8 :