<commit_before>/*
 * graph item implementation
 */

#include <string>

#include "array.h"
#include "convert.h"
#include "node.h"
#include "parse.h"
#include "config.h"

#include "layout.h"

__MPT_NAMESPACE_BEGIN

template class Reference<Line>;
template class Reference<Text>;
template class Reference<Axis>;
template class Reference<World>;
template class Reference<Graph>;

// line data operations
line::line()
{ mpt_line_init(this); }

Line::Line(const line *from)
{
    if (!from) return;
    line *l = this; *l = *from;
}
Line::~Line()
{ }
void Line::unref()
{
    delete this;
}
int Line::property(struct property *prop) const
{
    if (!prop) {
        return object::Type;
    }
    return mpt_line_get(this, prop);
}
int Line::setProperty(const char *name, const metatype *src)
{
    return mpt_line_set(this, name, src);
}
void *Line::toType(int type)
{
    static const char types[] = { metatype::Type, object::Type, line::Type, color::Type, lineattr::Type, 0 };
    switch (type) {
      case 0: return const_cast<char *>(types);
      case object::Type: return static_cast<object *>(this);
      case line::Type: return static_cast<line *>(this);
      case color::Type: return &color;
      case lineattr::Type: return &attr;
      default: return 0;
    }
}
// text data operations
text::text(const text *tx)
{ mpt_text_init(this, tx); }
text::~text()
{ mpt_text_fini(this); }
text & text::operator= (const text & tx)
{
    mpt_text_fini(this);
    mpt_text_init(this, &tx);
    return *this;
}

bool text::setValue(const char *v)
{ return mpt_string_set(&_value, v); }

bool text::setFont(const char *v)
{ return mpt_string_set(&_font, v); }

int text::set(metatype &src)
{ return mpt_string_pset(&_value, &src); }

Text::Text(const text *from) : text(from)
{ }
Text::~Text()
{ }
void Text::unref()
{
    delete this;
}
int Text::property(struct property *prop) const
{
    if (!prop) {
        return object::Type;
    }
    return mpt_text_get(this, prop);
}
int Text::setProperty(const char *prop, const metatype *src)
{
    return mpt_text_set(this, prop, src);
}
void *Text::toType(int type)
{
    static const char types[] = { metatype::Type, object::Type, text::Type, color::Type, 0 };
    switch (type) {
      case 0: return const_cast<char *>(types);
      case object::Type: return static_cast<object *>(this);<commit_msg>fix: layout object identification IDs<commit_after>/*
 * graph item implementation
 */

#include <string>

#include "array.h"
#include "convert.h"
#include "node.h"
#include "parse.h"
#include "config.h"

#include "layout.h"

__MPT_NAMESPACE_BEGIN

template class Reference<Line>;
template class Reference<Text>;
template class Reference<Axis>;
template class Reference<World>;
template class Reference<Graph>;

// line data operations
line::line()
{ mpt_line_init(this); }

Line::Line(const line *from)
{
    if (!from) return;
    line *l = this; *l = *from;
}
Line::~Line()
{ }
void Line::unref()
{
    delete this;
}
int Line::property(struct property *prop) const
{
    return mpt_line_get(this, prop);
}
int Line::setProperty(const char *name, const metatype *src)
{
    return mpt_line_set(this, name, src);
}
void *Line::toType(int type)
{
    static const char types[] = { metatype::Type, object::Type, line::Type, color::Type, lineattr::Type, 0 };
    switch (type) {
      case 0: return const_cast<char *>(types);
      case object::Type: return static_cast<object *>(this);
      case line::Type: return static_cast<line *>(this);
      case color::Type: return &color;
      case lineattr::Type: return &attr;
      default: return 0;
    }
}
// text data operations
text::text(const text *tx)
{ mpt_text_init(this, tx); }
text::~text()
{ mpt_text_fini(this); }
text & text::operator= (const text & tx)
{
    mpt_text_fini(this);
    mpt_text_init(this, &tx);
    return *this;
}

bool text::setValue(const char *v)
{ return mpt_string_set(&_value, v); }

bool text::setFont(const char *v)
{ return mpt_string_set(&_font, v); }

int text::set(metatype &src)
{ return mpt_string_pset(&_value, &src); }

Text::Text(const text *from) : text(from)
{ }
Text::~Text()
{ }
void Text::unref()
{
    delete this;
}
int Text::property(struct property *prop) const
{
    return mpt_text_get(this, prop);
}
int Text::setProperty(const char *prop, const metatype *src)
{
    return mpt_text_set(this, prop, src);
}
void *Text::toType(int type)
{
    static const char types[] = { metatype::Type, object::Type, text::Type, color::Type, 0 };
    switch (type) {
      case 0: return const_cast<char *>(types);
      case object::Type: return static_cast<object *>(this);
{'fraction_non_alphanumeric': 0.15872672152446946, 'fraction_numerical': 0.0021654395842356, 'mean_word_length': 4.466272189349112, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6389509', 'n_tokens_mistral': 1617, 'n_tokens_neox': 1609, 'n_words': 425}