<commit_before>#ifndef _CANVAS_STYLE_H_
#define _CANVAS_STYLE_H_

#include "Attribute.h"

#include <string>
#include <map>
#include <memory>

#include "Color.h"
#include "Filter.h"

namespace canvas {
  class Style : public Attribute {
  public:
    enum StyleType {
      SOLID = 1,
      LINEAR_GRADIENT,
      RADIAL_GRADIENT,
      PATTERN,
      FILTER
    };
    Style() { }
    Style(const std::string & s);
    Style(const Color & _color);
    Style & operator=(const std::string & s);
    Style & operator=(const Color & _color);

    StyleType getType() const { return type; }
    void setType(StyleType _type) { type = _type; }

    void addColorStop(float f, const Color & c) {
      colors[f] = c;
    }
    void addColorStop(float f, const std::string & s) {
      colors[f] = s;
    }
    void setVector(double _x0, double _y0, double _x1, double _y1) {
      x0 = _x0;
      y0 = _y0;
      x1 = _x1;
      y1 = _y1;<commit_msg>add function call operators, add context<commit_after>#ifndef _CANVAS_STYLE_H_
#define _CANVAS_STYLE_H_

#include "Attribute.h"

#include <string>
#include <map>
#include <memory>

#include "Color.h"
#include "Filter.h"

namespace canvas {
  class Style : public Attribute {
  public:
    enum StyleType {
      SOLID = 1,
      LINEAR_GRADIENT,
      RADIAL_GRADIENT,
      PATTERN,
      FILTER
    };
    Style(GraphicsState * _context) : Attribute(_context) { }
    Style(GraphicsState * _context, const Style & other)
      : Attribute(_context),
      type(other.type),
      colors(other.colors),
      filter(other.filter) { }
    Style(const Style & other) = delete;
#if 0
    Style(const std::string & s);
    Style(const Color & _color);
#endif
    Style & operator=(const std::string & s);
    Style & operator=(const Color & _color);

    GraphicsState & operator()(const std::string & s);
    GraphicsState & operator()(const Color & _color);

    StyleType getType() const { return type; }
    void setType(StyleType _type) { type = _type; }

    void addColorStop(float f, const Color & c) {
      colors[f] = c;
    }
    void addColorStop(float f, const std::string & s) {
      colors[f] = s;
    }
    void setVector(double _x0, double _y0, double _x1, double _y1) {
      x0 = _x0;
      y0 = _y0;
      x1 = _x1;
      y1 = _y1;
{'fraction_non_alphanumeric': 0.12031386224934612, 'fraction_numerical': 0.011769834350479512, 'mean_word_length': 2.8313856427378963, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '6294197', 'n_tokens_mistral': 822, 'n_tokens_neox': 794, 'n_words': 208}