rllib  1
rlsvganimator.h
Go to the documentation of this file.
1 /***************************************************************************
2  rlsvganimator.h - description
3  -------------------
4  begin : Tue Apr 10 2006
5  copyright : (C) 2006 by R. Lehrig
6  email : lehrig@t-online.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This library is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as *
13  * published by the Free Software Foundation *
14  * *
15  ***************************************************************************/
16 #ifndef _RL_SVG_ANIMATOR_
17 #define _RL_SVG_ANIMATOR_
18 #include "rldefine.h"
19 #include "rlinifile.h"
20 #include "rlspreadsheet.h"
21 #include "rlstring.h"
22 
28 {
29  public:
30  rlSvgPosition();
31  rlSvgPosition(float sx_init, float a_init, float x0_init, float y0_init, float cx_init, float cy_init);
32  virtual ~rlSvgPosition();
33  float sx, alpha, x0, y0, cx, cy;
34  struct rlPositionInit {float sx, alpha, x0, y0, w, h;} init;
35  void setInit(float x0_init, float y0_init, float w_init, float h_init);
36  void move(float x, float y);
37  void moveRelative(float dx, float dy);
38  void scale(float s);
39  void scaleRelative(float ds);
40  void rotate(float alpha, float cx, float cy);
41 };
42 
49 {
50  public:
51  rlSvgAnimator();
52  virtual ~rlSvgAnimator();
53 
55  int setSocket(int *socket);
57  int setId(int Id);
61  int read(const char *infile, rlIniFile *inifile=NULL);
64  int writeSocket();
68  int svgPrintf(const char *objectname, const char *tag, const char *format, ...);
70  int svgRecursivePrintf(const char *objectname, const char *tag, const char *format, ...);
72  int svgSearchAndReplace(const char *objectname, const char *tag, const char *before, const char *after);
74  int svgRecursiveSearchAndReplace(const char *objectname, const char *tag, const char *before, const char *after);
76  int svgTextPrintf(const char *objectname, const char *format, ...);
78  int svgRemoveStyleOption(const char *objectname, const char *option);
80  int svgRecursiveRemoveStyleOption(const char *objectname, const char *option);
82  int svgChangeStyleOption(const char *objectname, const char *option, const char *value);
84  int svgRecursiveChangeStyleOption(const char *objectname, const char *option, const char *value);
86  int svgSetStyleOption(const char *objectname, const char *value);
88  int svgRecursiveSetStyleOption(const char *objectname, const char *value);
90  int show(const char *objectname, int state); // state := 0|1
92  int setMatrix(const char *objectname, float sx, float alpha, float x0, float y0, float cx, float cy);
94  int setMatrix(const char *objectname, rlSvgPosition &pos);
98  int setMainObject(const char *main_object);
99  const char *mainObject();
101  int setXY0(float x0, float y0);
102  float x0();
103  float y0();
105  int setMouseXY0(float x0, float y0);
106  float mouseX0();
107  float mouseY0();
109  int setMouseXY1(float x1, float y1);
110  float mouseX1();
111  float mouseY1();
113  int setScale(float scale);
114  float scale();
116  int zoomCenter(float newScale);
118  int zoomRect();
120  int setMainObjectMatrix();
122  int setWindowSize(int width, int height);
123  float windowWidth();
124  float windowHeight();
126  int moveMainObject(float x, float y);
127 
129 
130  private:
131  int tcpsend(const char *buf, int len);
132  int fillIniFile(rlIniFile *inifile, const char *line);
133  int fileFillIniFile(const char *infile, rlIniFile *inifile);
137  int *s;
138  int id;
139  // zoomer variables follow
142 };
143 #endif
int svgRecursiveRemoveStyleOption(const char *objectname, const char *option)
void moveRelative(float dx, float dy)
int tcpsend(const char *buf, int len)
int setId(int Id)
int setSocket(int *socket)
float svgWindowHeight
int read(const char *infile, rlIniFile *inifile=NULL)
int svgRemoveStyleOption(const char *objectname, const char *option)
void rotate(float alpha, float cx, float cy)
float windowHeight()
int svgChangeStyleOption(const char *objectname, const char *option, const char *value)
rlSpreadsheetTable inifileTable
void move(float x, float y)
virtual ~rlSvgPosition()
int setWindowSize(int width, int height)
int svgSetStyleOption(const char *objectname, const char *value)
const char * mainObject()
int setXY0(float x0, float y0)
int fillIniFile(rlIniFile *inifile, const char *line)
virtual ~rlSvgAnimator()
int svgRecursiveSearchAndReplace(const char *objectname, const char *tag, const char *before, const char *after)
int moveMainObject(float x, float y)
int svgPrintf(const char *objectname, const char *tag, const char *format,...)
int setMatrix(const char *objectname, float sx, float alpha, float x0, float y0, float cx, float cy)
int setMainObject(const char *main_object)
void scale(float s)
rlSpreadsheetCell inifileID
int svgSearchAndReplace(const char *objectname, const char *tag, const char *before, const char *after)
int zoomCenter(float newScale)
int setScale(float scale)
int svgTextPrintf(const char *objectname, const char *format,...)
float svgWindowWidth
rlString main_object_name
int svgRecursivePrintf(const char *objectname, const char *tag, const char *format,...)
int setMainObjectMatrix()
void setInit(float x0_init, float y0_init, float w_init, float h_init)
int fileFillIniFile(const char *infile, rlIniFile *inifile)
int show(const char *objectname, int state)
int svgRecursiveChangeStyleOption(const char *objectname, const char *option, const char *value)
int svgRecursiveSetStyleOption(const char *objectname, const char *value)
struct rlSvgPosition::rlPositionInit init
int writeSocket()
The following methods are for modifying a object within a SVG graphic identified by objectname...
int setMouseXY0(float x0, float y0)
int setMouseXY1(float x1, float y1)
void scaleRelative(float ds)