Laxkit
0.0.7.1
|
Holds a little bit of text. More...
Public Member Functions | |
virtual const char * | whattype () |
CaptionData (const char *ntext, const char *nfontname, const char *nfontstyle, int fsize, double xcenter, double ycenter) | |
virtual int | SetText (const char *newtext) |
Set new text. | |
virtual double | XCenter (double xcenter) |
Set horizontal centering, and adjust bbox. | |
virtual double | XCenter () |
virtual double | YCenter (double ycenter) |
Set vertical centering, and adjust bbox. | |
virtual double | YCenter () |
virtual void | FindBBox () |
virtual int | CharLen (int line) |
virtual int | ComputeLineLen (int line) |
Update cached pixel length of line. Also return that value. | |
virtual int | DeleteChar (int line, int pos, int after, int *newline, int *newpos) |
virtual int | InsertChar (unsigned int ch, int line, int pos, int *newline, int *newpos) |
virtual void | dump_out (FILE *f, int indent, int what, Laxkit::anObject *context) |
virtual void | dump_in_atts (LaxFiles::Attribute *att, int flag, Laxkit::anObject *context) |
See dump_out(). | |
Public Member Functions inherited from LaxInterfaces::SomeData | |
virtual void | touchContents () |
virtual Laxkit::LaxImage * | GetPreview () |
If usepreview==1 and preview, then return preview. | |
virtual void | GeneratePreview (int w, int h) |
Create a preview image with transparency for a cached screen preview. | |
virtual int | renderToBuffer (unsigned char *buffer, int bufw, int bufh, int bufstride, int bufdepth, int bufchannels) |
Render the object to a buffer. | |
virtual const char * | Id () |
virtual const char * | Id (const char *newid) |
SomeData () | |
SomeData (double nminx, double nmaxx, double nminy, double nmaxy) | |
Constructor, setting the bounds. | |
virtual flatpoint | BBoxPoint (double x, double y, bool transform_to_parent) |
virtual flatpoint | ReferencePoint (int which, bool transform_to_parent) |
virtual SomeData * | duplicate (SomeData *dup) |
Duplicate *this. | |
virtual int | pointin (flatpoint pp, int pin=1) |
Return if pp transformed to data coords is within the bounds. | |
virtual int | fitto (double *boxm, DoubleBBox *box, double alignx, double aligny, int whentoscale=2) |
Fit this data to box. | |
virtual SomeData * | GetParent () |
virtual void | dump_in (FILE *f, int indent, Laxkit::anObject *context, LaxFiles::Attribute **Att=NULL) |
Dump in an attribute, then call dump_in_atts(thatatt,0). | |
virtual LaxFiles::Attribute * | dump_out_atts (LaxFiles::Attribute *att, int what, Laxkit::anObject *savecontext) |
Public Member Functions inherited from Laxkit::anObject | |
anObject () | |
Set object_id=getUniqueNumber(). | |
virtual | ~anObject () |
Empty virtual destructor. | |
virtual anObject * | duplicate (anObject *ref=NULL) |
virtual int | inc_count () |
Increment the data's count by 1. Returns count. | |
virtual int | dec_count () |
Decrement the count of the data, deleting if count is less than or equal to 0. | |
virtual int | the_count () |
Public Member Functions inherited from Laxkit::Affine | |
Affine (const double *m) | |
If mm==NULL, set identity. | |
Affine (const Affine &m) | |
Affine (double xx, double xy, double yx, double yy, double tx, double ty) | |
Affine & | operator= (Affine const &m) |
Affine & | operator*= (Affine const &m) |
Affine | operator* (Affine const m) |
virtual void | set (Affine a) |
virtual void | setIdentity () |
virtual bool | isIdentity () |
virtual void | setRotation (double angle) |
virtual void | setScale (double sx, double sy) |
virtual void | setBasis (flatpoint o, flatpoint x, flatpoint y) |
virtual void | setBasics (double x, double y, double sx, double sy, double angle, double shear) |
virtual void | getBasics (double *x, double *y, double *sx, double *sy, double *angle, double *shear) |
virtual void | Translate (flatvector d) |
virtual void | Rotate (double angle) |
virtual void | Rotate (double angle, flatpoint around_point) |
virtual void | RotatePointed (flatpoint anchor1, flatpoint anchor2, flatpoint newanchor2) |
virtual void | RotateScale (flatpoint anchor1, flatpoint anchor2, flatpoint newanchor2) |
Rotate and scale so that anchor1 stays fixed, but anchor2 is shifted to newanchor2. | |
virtual void | Stretch (flatpoint anchor1, flatpoint anchor2, flatpoint newanchor2) |
virtual void | AnchorShear (flatpoint anchor1, flatpoint anchor2, flatpoint anchor3, flatpoint newanchor3) |
Transform so that anchor1 and 2 stay fixed, but anchor3 is shifted to newanchor3. | |
virtual void | Scale (double s) |
virtual void | Scale (flatpoint o, double s) |
Scale around point o. | |
virtual void | Scale (flatpoint o, double sx, double sy) |
virtual void | Scale (flatpoint anchor1, flatpoint anchor2, flatpoint newanchor2) |
Scale as if you move anchor2 to newanchor2, while anchor1 stays the same. | |
virtual void | FlipH () |
virtual void | FlipV () |
virtual void | Flip (flatpoint f1, flatpoint f2) |
Flip across the axis of f1 to f2. | |
virtual void | Multiply (Affine &m) |
this=this*m | |
virtual void | PreMultiply (Affine &m) |
this=m*this | |
virtual Affine | Inversion () |
Return a new matrix that is the inverse of this, if possible. | |
virtual void | Invert () |
Make this the inverse of whatever it is. | |
virtual flatpoint | transformPoint (flatpoint p) |
virtual flatpoint | transformPointInverse (flatpoint p) |
virtual flatpoint | transformVector (flatpoint p) |
Apply the transfrom, but ignore this's translation component. | |
virtual const double * | m () const |
virtual void | m (const double *mm) |
virtual void | m (double xx, double xy, double yx, double yy, double tx, double ty) |
virtual double | m (int c) |
virtual void | m (int c, double v) |
virtual void | Unshear (int preserve_x, int normalize) |
Clear shearing and unequal scaling. Null vectors stay null vectors. | |
virtual void | Normalize () |
Make x and y both be unit vectors, but point in the same direction as before. | |
virtual flatpoint | origin () |
virtual void | origin (flatpoint o) |
virtual flatpoint | xaxis () |
virtual void | xaxis (flatpoint x) |
virtual flatpoint | yaxis () |
virtual void | yaxis (flatpoint y) |
Public Member Functions inherited from Laxkit::DoubleBBox | |
DoubleBBox () | |
Create empty invalid bbox (maxx<minx and maxy<miny). | |
DoubleBBox (flatpoint p) | |
Create box whose bounds are p. | |
DoubleBBox (double mix, double max, double miy, double may) | |
Create box whose bounds are as given. | |
virtual void | clear () |
Make box invalid: set minx=miny=0 and maxx=maxy=-1. | |
virtual void | addtobounds (double x, double y) |
virtual void | addtobounds (flatpoint p) |
Expand bounds to contain p. Set the bounds to p if current bounds are invalid. | |
virtual void | addtobounds (DoubleBBox *bbox) |
Add the bbox to the bounds. Set the bounds if current bounds are invalid. | |
virtual void | addtobounds (const double *m, DoubleBBox *bbox) |
Add bbox to bounds, first transforming it by 6 element transform matrix m. | |
virtual void | setbounds (DoubleBBox *bbox) |
Just copy over the bounds. | |
virtual void | setbounds (flatpoint *pts, int n) |
Make this bbox be the bounds for the given n points. (does not add to previous bounds) | |
virtual void | setbounds (double mix, double max, double miy, double may) |
Set the bounds to the specified values. | |
virtual int | validbounds () |
Returns maxx>=minx && maxy>=miny. | |
virtual int | intersect (double mix, double max, double miy, double may, int settointersection=0) |
Intersect the given bounds with this's bounds. Return 1 for non-empty intersection. | |
virtual int | intersect (DoubleBBox *bbox, int settointersection=0) |
Just return intersect(bbox.minx,...,settointersection). | |
virtual int | intersect (double *m, DoubleBBox *bbox, int touching, int settointersection) |
Does the transformed box touch. **** incomplete implementation. | |
virtual int | boxcontains (double x, double y) |
Return whether the given point is contained within or on the bounds. | |
virtual flatpoint | BBoxPoint (double x, double y) |
Public Attributes | |
int | state |
char * | fontname |
char * | fontstyle |
char * | fontfile |
double | fontsize |
The point size of the font. | |
Laxkit::LaxFont * | font |
The filename of the font to use. | |
double | red |
double | green |
double | blue |
double | alpha |
double | xcentering |
0 is left, 100 is right, 50 is center, and other number is partial centering. | |
double | ycentering |
0 is top, 100 is bottom, 50 is center, and other number is partial centering. | |
Laxkit::PtrStack< char > | lines |
Laxkit::NumStack< double > | linelengths |
Public Attributes inherited from LaxInterfaces::SomeData | |
Laxkit::LaxImage * | preview |
A preview image potentially to be used to not have to rerender on each refresh. | |
int | usepreview |
Flag for whether to use SomeData::preview rather than rendering. | |
std::time_t | previewtime |
The time the preview was generated, if at all, as returned by time(). | |
std::time_t | modtime |
The time of last modification through a SomeData function. | |
int | bboxstyle |
flatpoint | centerpoint |
unsigned int | flags |
int | iid |
Id of the interface that should handle this data. | |
char * | nameid |
Public Attributes inherited from Laxkit::anObject | |
int | suppress_debug |
DeleteRefCountedFunc | deleteMe |
Called when the count is decremented to 0. | |
unsigned long | object_id |
char * | object_idstr |
Public Attributes inherited from Laxkit::DoubleBBox | |
double | minx |
double | maxx |
double | miny |
double | maxy |
Holds a little bit of text.
This is for very simple text labels and such. There can be multiple lines of text with variable centering. One CaptionData unit should be considered one "point" when the object is scaled same as paper.
Update cached pixel length of line. Also return that value.
If line<0 then compute for all lines, and returns maximum length.
|
virtual |
Default dump for a CaptionData.
Dumps:
font aontuhaot.ttf fontsize 10 xcentering 50 ycentering 50 text \ Blah Blah. Blah, "blah blah"
width and height are the integer pixel dimensions of the image.
Ignores what. Uses 0 for it.
Reimplemented from LaxInterfaces::SomeData.
Referenced by LaxInterfaces::CaptionInterface::LBDown().
|
virtual |
Assumes font is accurate????
Reimplemented from LaxInterfaces::SomeData.
Referenced by LaxInterfaces::CaptionInterface::Refresh().
Set new text.
Accepts multi line text, where lines are delineated with '
'.
Returns 0 for success, 1 for error.
References split().
Referenced by LaxInterfaces::CaptionInterface::newData().
double LaxInterfaces::CaptionData::fontsize |
The point size of the font.
This size is relative to the object's coordinate space which are assumed to be inches. Thus a fontsize of 1pt will be 1/72nd of 1 unit in the object's space.
Referenced by LaxInterfaces::CaptionInterface::Refresh().
double LaxInterfaces::CaptionData::xcentering |
0 is left, 100 is right, 50 is center, and other number is partial centering.
All centering is around the origin.
Referenced by LaxInterfaces::CaptionInterface::Refresh().
double LaxInterfaces::CaptionData::ycentering |
0 is top, 100 is bottom, 50 is center, and other number is partial centering.
All centering is around the origin.
Referenced by LaxInterfaces::CaptionInterface::Refresh().