/*
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <cstring>
#include <string>
#include "attributes.h"
#include "style.h"
#include "inkscape.h"
#include "document.h"
#include "selection.h"
#include "desktop.h"
#include "sp-flowdiv.h"
#include "sp-flowregion.h"
#include "sp-flowtext.h"
#include "sp-string.h"
#include "sp-use.h"
#include "sp-rect.h"
#include "text-tag-attributes.h"
#include "text-chemistry.h"
#include "text-editing.h"
#include "sp-text.h"
#include "display/drawing-text.h"
par_indent(0),
_optimizeScaledText(false)
{
}
SPFlowtext::~SPFlowtext() {
}
}
/* fixme: hide (Lauris) */
}
if (flags & SP_OBJECT_MODIFIED_FLAG) {
}
l = g_slist_prepend(l, child);
}
l = g_slist_reverse(l);
while (l) {
l = g_slist_remove(l, child);
if (item) {
} else {
}
}
}
this->rebuildLayout();
this->_clearFlow(g);
// pass the bbox of the flowtext object as paintbox (used for paintserver fills)
}
}
if (flags & SP_OBJECT_MODIFIED_FLAG) {
}
// FIXME: the below stanza is copied over from sp_text_modified, consider factoring it out
if (flags & ( SP_OBJECT_STYLE_MODIFIED_FLAG )) {
_clearFlow(g);
}
}
if (dynamic_cast<SPFlowregion *>(o)) {
region = o;
break;
}
}
if (region) {
}
}
}
}
switch (key) {
case SP_ATTR_LAYOUT_OPTIONS: {
// deprecated attribute, read for backward compatibility only
//XML Tree being directly used while it shouldn't be.
{
} else {
}
}
}
/* no equivalent css attribute for these two (yet)
{
gchar const *val = sp_repr_css_property(opts, "layoutAlgo", NULL);
if ( val == NULL ) {
group->algo = 0;
} else {
if ( strcmp(val, "better") == 0 ) { // knuth-plass, never worked for general cases
group->algo = 2;
} else if ( strcmp(val, "simple") == 0 ) { // greedy, but allowed lines to be compressed by up to 20% if it would make them fit
group->algo = 1;
} else if ( strcmp(val, "default") == 0 ) { // the same one we use, a standard greedy
group->algo = 0;
}
}
}
*/
{ // This would probably translate to padding-left, if SPStyle had it.
this->par_indent = 0.0;
} else {
}
}
break;
}
default:
break;
}
}
Inkscape::XML::Node* SPFlowtext::write(Inkscape::XML::Document* doc, Inkscape::XML::Node* repr, guint flags) {
if ( flags & SP_OBJECT_WRITE_BUILD ) {
}
if ( dynamic_cast<SPFlowdiv *>(child) || dynamic_cast<SPFlowpara *>(child) || dynamic_cast<SPFlowregion *>(child) || dynamic_cast<SPFlowregionExclude *>(child)) {
}
if ( c_repr ) {
l = g_slist_prepend(l, c_repr);
}
}
while ( l ) {
l = g_slist_remove(l, l->data);
}
} else {
if ( dynamic_cast<SPFlowdiv *>(child) || dynamic_cast<SPFlowpara *>(child) || dynamic_cast<SPFlowregion *>(child) || dynamic_cast<SPFlowregionExclude *>(child)) {
}
}
}
this->rebuildLayout(); // copied from update(), see LP Bug 1339305
return repr;
}
// Add stroke width
// FIXME this code is incorrect
}
return bbox;
}
pbox = this->geometricBounds();
bbox = this->desktopVisualBounds();
}
if (has_internal_frame()) {
return _("Flowed Text");
} else {
return _("Linked Flowed Text");
}
}
}
void SPFlowtext::snappoints(std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape::SnapPreferences const *snapprefs) const {
// Choose a point on the baseline for snapping from or to, with the horizontal position
// of this point depending on the text alignment (left vs. right)
if (pt) {
p.push_back(Inkscape::SnapCandidatePoint((*pt) * this->i2dt_affine(), Inkscape::SNAPSOURCE_TEXT_ANCHOR, Inkscape::SNAPTARGET_TEXT_ANCHOR));
}
}
}
}
Inkscape::DrawingItem* SPFlowtext::show(Inkscape::Drawing &drawing, unsigned int /*key*/, unsigned int /*flags*/) {
flowed->setPickChildren(false);
// pass the bbox of the flowtext object as paintbox (used for paintserver fills)
return flowed;
}
this->_clearFlow(g);
}
}
}
/*
*
*/
void SPFlowtext::_buildLayoutInput(SPObject *root, Shape const *exclusion_shape, std::list<Shape> *shapes, SPObject **pending_line_break_object)
{
bool with_indent = false;
if (dynamic_cast<SPFlowpara *>(root)) {
// emulate par-indent with the first char's kern
while (t && !ft) {
ft = dynamic_cast<SPFlowtext *>(t);
t = t->parent;
}
if (ft) {
if (indent != 0) {
with_indent = true;
}
}
}
if (*pending_line_break_object) {
if (dynamic_cast<SPFlowregionbreak *>(*pending_line_break_object)) {
} else {
}
}
if (str) {
if (*pending_line_break_object) {
if (dynamic_cast<SPFlowregionbreak *>(*pending_line_break_object))
else {
}
}
if (with_indent) {
} else {
}
} else {
if (region) {
if (exclusion_shape->hasEdges()) {
} else {
}
}
}
//Xml Tree is being directly used while it shouldn't be.
else if (!dynamic_cast<SPFlowregionExclude *>(child) && !sp_repr_is_meta_element(child->getRepr())) {
}
}
}
if (dynamic_cast<SPFlowdiv *>(root) || dynamic_cast<SPFlowpara *>(root) || dynamic_cast<SPFlowregionbreak *>(root) || dynamic_cast<SPFlowline *>(root)) {
if (!root->hasChildren()) {
}
}
}
{
// RH: is it right that this shouldn't be recursive?
} else {
}
}
}
delete shape_temp;
return shape;
}
{
delete exclusion_shape;
//g_print("%s", layout.dumpAsText().c_str());
}
{
}
{
if (!this->layout.outputExists()) {
return NULL;
}
while (it != it_line_end) {
// use kerning to simulate justification and whatnot
// set x,y attributes only when we need to
bool set_x = false;
bool set_y = false;
if (!this->transform.isIdentity()) {
} else {
if (it == it_chunk_start) {
set_x = true;
// don't set y so linespacing adjustments and things will still work
}
if (it == it_shape_start)
set_y = true;
}
if (set_x)
sp_repr_set_svg_double(span_tspan, "x", anchor_point[Geom::X]); // FIXME: this will pick up the wrong end of counter-directional runs
if (set_y)
if (line_tspan->childCount() == 0) {
sp_repr_set_svg_double(line_tspan, "x", anchor_point[Geom::X]); // FIXME: this will pick up the wrong end of counter-directional runs
}
void *rawptr = 0;
Glib::ustring style_text = (dynamic_cast<SPString *>(source_obj) ? source_obj->parent : source_obj)->style->write( SP_STYLE_FLAG_IFDIFF, this->style);
if (!style_text.empty()) {
}
if (str) {
void *rawptr = 0;
if (span_end_obj != source_obj) {
for (int i = this->layout.iteratorToCharIndex(it_span_end) - this->layout.iteratorToCharIndex(it) ; i ; --i)
} else
}
if (span_text_start_iter != span_text_end_iter) {
while (span_text_start_iter != span_text_end_iter)
}
}
it = it_span_end;
}
}
return repr;
}
{
return item;
}
{
if (dynamic_cast<SPFlowregion *>(o)) {
region = o;
break;
}
}
if (region) {
bool past = false;
if (item) {
} else {
past = true;
}
}
}
}
if ( use ) {
}
}
return frame;
}
{
}
{
root_repr->setAttribute("xml:space", "preserve"); // we preserve spaces in the text objects we create
Inkscape::XML::Node *rect_repr = xml_doc->createElement("svg:rect"); // FIXME: use path!!! after rects are converted to use path
using Geom::X;
using Geom::Y;
rect->updateRepr();
return ft_item;
}
{
this->_optimizeScaledText = false;
return xform;
}
this->_optimizeScaledText = false;
if (ex == 0) {
return xform;
}
if (dynamic_cast<SPFlowregion *>(o)) {
region = o;
break;
}
}
if (region) {
if (rect) {
}
}
// Adjust font size
// Adjust stroke width
this->adjust_stroke_width_recursive (ex);
// Adjust pattern fill
// Adjust gradient fill
}
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :