René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback -
 

GradientFill [Ming wrapper class]

The source

GradientFill.h
#ifndef GRADIENT_FILL_H
#define GRADIENT_FILL_H


#include "Fill_.h"

/* This class defines operations on an SWFFill (=Fill_) that
   only make sense together with a Gradient */

class GradientFill : public Fill_ {
  friend class Shape;

  private:
    GradientFill(SWFFill);

  public:
    void Move     (float x, float y);
    void MoveTo   (float x, float y);
    /* TODO: degrees better named angles or angles better named degrees? */
    void Rotate   (float degrees   );
    void RotateTo (float degrees   );

    void ScaleX   (float x         );
    void ScaleXTo (float x         );
    void ScaleY   (float y         );
    void ScaleYTo (float y         );
    void ScaleXY  (float x, float y);
    void ScaleXYTo(float x, float y);
};

#endif
GradientFill.cpp
#include "GradientFill.h"


GradientFill::GradientFill(SWFFill f) : Fill_(f) {}


/* TODO:
void SWFFill_skewX(SWFFill fill, float x);
void SWFFill_skewXTo(SWFFill fill, float x);
void SWFFill_skewY(SWFFill fill, float y);
void SWFFill_skewYTo(SWFFill fill, float y);

*/


void GradientFill::ScaleX(float x) {
  SWFFill_scaleX(fill_, x);
}

void GradientFill::ScaleXTo(float x) {
  SWFFill_scaleXTo(fill_, x);
}

void GradientFill::ScaleY(float y) {
  SWFFill_scaleY(fill_, y);
}

void GradientFill::ScaleYTo(float y) {
  SWFFill_scaleYTo(fill_, y);
}

void GradientFill::ScaleXY(float x, float y) {
  SWFFill_scaleXY(fill_, x, y);
}

void GradientFill::ScaleXYTo(float x, float y) {
  SWFFill_scaleXYTo(fill_, x, y);
}

void GradientFill::Move(float x, float y) {
  SWFFill_move(fill_, x, y);
}

void GradientFill::MoveTo(float x, float y) {
  SWFFill_moveTo(fill_, x, y);
}

void GradientFill::Rotate(float degrees) {
  SWFFill_rotate(fill_, degrees);
}

void GradientFill::RotateTo(float degrees) {
  SWFFill_rotateTo(fill_, degrees);
}

Examples

The following examples demonstrate this class: