Commit 2a5534a1 authored by Shlomi Fish's avatar Shlomi Fish

Merged.

(bzr r15100.1.31)
parents 93488a93 7be3086b
......@@ -148,6 +148,7 @@ Abhishek Sharma
Shivaken
Michael Sloan
John Smith
Sandra Snan
Boštjan Špetič
Aaron Spike
Kaushik Sridharan
......
......@@ -67,6 +67,7 @@ option(WITH_LIBCDR "Compile with support of libcdr for CorelDRAW Diagrams" ON)
option(WITH_LIBVISIO "Compile with support of libvisio for Microsoft Visio Diagrams" ON)
option(WITH_LIBWPG "Compile with support of libwpg for WordPerfect Graphics" ON)
option(WITH_NLS "Compile with Native Language Support (using gettext)" ON)
option(WITH_YAML "Compile with YAML support (enables xverbs)" ON)
option(ENABLE_BINRELOC "Enable relocatable binaries" OFF)
......@@ -255,6 +256,7 @@ message("WITH_LIBWPG: ${WITH_LIBWPG}")
message("WITH_NLS: ${WITH_NLS}")
message("WITH_OPENMP: ${WITH_OPENMP}")
message("WITH_PROFILING: ${WITH_PROFILING}")
message("WITH_YAML: ${WITH_YAML}")
if(WIN32)
message("")
......
......@@ -387,6 +387,17 @@ list(APPEND INKSCAPE_LIBS ${SIGC++_LDFLAGS})
list(APPEND INKSCAPE_CXX_FLAGS ${SIGC++_CFLAGS_OTHER})
find_package(yaml)
if(YAML_FOUND)
set (WITH_YAML ON)
list(APPEND INKSCAPE_INCS_SYS ${YAML_INCLUDE_DIRS})
list(APPEND INKSCAPE_LIBS ${YAML_LIBRARIES})
add_definitions(-DWITH_YAML)
else(YAML_FOUND)
set(WITH_YAML OFF)
message(STATUS "Could not locate the yaml library headers: xverb feature will be disabled")
endif()
list(REMOVE_DUPLICATES INKSCAPE_CXX_FLAGS)
foreach(flag ${INKSCAPE_CXX_FLAGS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}" CACHE STRING "" FORCE)
......
# - Try to find the YAML library
# Once done this will define
#
# YAML_FOUND - system has yaml
# YAML_INCLUDE_DIR - the yaml include directory
# YAML_LIBRARIES - the libraries needed to use yaml
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (YAML_INCLUDE_DIR AND YAML_LIBRARIES)
# in cache already
SET(YAML_FOUND TRUE)
else (YAML_INCLUDE_DIR AND YAML_LIBRARIES)
IF (NOT WIN32)
FIND_PACKAGE(PkgConfig)
IF (PKG_CONFIG_FOUND)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
pkg_check_modules(_YAML_PC QUIET yaml-1)
ENDIF (PKG_CONFIG_FOUND)
ENDIF (NOT WIN32)
FIND_PATH(YAML_INCLUDE_DIR yaml.h
/usr/include
/usr/local/include
)
FIND_LIBRARY(YAML_LIBRARIES NAMES yaml
PATHS)
if (YAML_INCLUDE_DIR AND YAML_LIBRARIES)
set(YAML_FOUND TRUE)
endif (YAML_INCLUDE_DIR AND YAML_LIBRARIES)
if (YAML_FOUND)
if (NOT YAML_FIND_QUIETLY)
message(STATUS "Found YAML: ${YAML_LIBRARIES}")
endif (NOT YAML_FIND_QUIETLY)
else (YAML_FOUND)
if (YAML_FIND_REQUIRED)
message(FATAL_ERROR "Could NOT find YAML")
endif (YAML_FIND_REQUIRED)
endif (YAML_FOUND)
MARK_AS_ADVANCED(YAML_INCLUDE_DIR YAML_LIBRARIES)
endif (YAML_INCLUDE_DIR AND YAML_LIBRARIES)
......@@ -154,6 +154,7 @@ src/live_effects/lpe-powerstroke.cpp
src/live_effects/lpe-rough-hatches.cpp
src/live_effects/lpe-roughen.cpp
src/live_effects/lpe-ruler.cpp
src/live_effects/lpe-measure-line.cpp
src/live_effects/lpe-show_handles.cpp
src/live_effects/lpe-simplify.cpp
src/live_effects/lpe-sketch.cpp
......@@ -171,6 +172,7 @@ src/live_effects/parameter/point.cpp
src/live_effects/parameter/powerstrokepointarray.cpp
src/live_effects/parameter/random.cpp
src/live_effects/parameter/text.cpp
src/live_effects/parameter/fontbutton.cpp
src/live_effects/parameter/togglebutton.cpp
src/live_effects/parameter/transformedpoint.cpp
src/live_effects/parameter/unit.cpp
......
......@@ -405,6 +405,24 @@ override) the bindings in the main default.xml.
<bind key="Page_Down" action="SelectionLower" display="true" />
<bind key="KP_Page_Down" action="SelectionLower" />
<bind key="comma" action="SelectionShrink" display="true" />
<bind key="less" action="SelectionShrink" />
<bind key="comma" modifiers="Alt" action="SelectionShrinkScreen" />
<bind key="less" modifiers="Alt" action="SelectionShrinkScreen" />
<bind key="comma" modifiers="Ctrl" action="SelectionShrinkHalve" />
<bind key="less" modifiers="Ctrl" action="SelectionShrinkHalve" />
<bind key="period" action="SelectionGrow" display="true" />
<bind key="greater" action="SelectionGrow" />
<bind key="period" modifiers="Alt" action="SelectionGrowScreen" />
<bind key="greater" modifiers="Alt" action="SelectionGrowScreen" />
<bind key="period" modifiers="Ctrl" action="SelectionGrowDouble" />
<bind key="greater" modifiers="Ctrl" action="SelectionGrowDouble" />
<bind key="g" modifiers="Ctrl" action="SelectionGroup" display="true" />
<bind key="G" modifiers="Ctrl" action="SelectionGroup" />
......
......@@ -297,8 +297,7 @@ override) the bindings in the main default.xml.
<bind key="z" modifiers="Ctrl" action="EditUndo" display="true" />
<bind key="Z" modifiers="Ctrl" action="EditUndo" />
<bind key="y" modifiers="Ctrl,Shift" action="EditUndo" />
<bind key="Y" modifiers="Ctrl,Shift" action="EditUndo" />
<!--Do not put in Ctrl,Shift+Y, already used-->
<bind key="z" modifiers="Ctrl,Shift" action="EditRedo" display="true" />
<bind key="Z" modifiers="Ctrl,Shift" action="EditRedo" />
......@@ -384,6 +383,9 @@ override) the bindings in the main default.xml.
<bind key="7" action="EditNextPathEffectParameter" display="true" />
<bind key="r" modifiers="Ctrl,Shift" action="FitCanvasToSelectionOrDrawing" display="true" />
<bind key="R" modifiers="Ctrl,Shift" action="FitCanvasToSelectionOrDrawing" display="true" />
<!-- Objects/selection -->
<bind key="h" action="ObjectFlipHorizontally" display="true" />
......@@ -403,6 +405,24 @@ override) the bindings in the main default.xml.
<bind key="Page_Down" action="SelectionLower" display="true" />
<bind key="KP_Page_Down" action="SelectionLower" />
<bind key="comma" action="SelectionShrink" display="true" />
<bind key="less" action="SelectionShrink" />
<bind key="comma" modifiers="Alt" action="SelectionShrinkScreen" />
<bind key="less" modifiers="Alt" action="SelectionShrinkScreen" />
<bind key="comma" modifiers="Ctrl" action="SelectionShrinkHalve" />
<bind key="less" modifiers="Ctrl" action="SelectionShrinkHalve" />
<bind key="period" action="SelectionGrow" display="true" />
<bind key="greater" action="SelectionGrow" />
<bind key="period" modifiers="Alt" action="SelectionGrowScreen" />
<bind key="greater" modifiers="Alt" action="SelectionGrowScreen" />
<bind key="period" modifiers="Ctrl" action="SelectionGrowDouble" />
<bind key="greater" modifiers="Ctrl" action="SelectionGrowDouble" />
<bind key="g" modifiers="Ctrl" action="SelectionGroup" display="true" />
<bind key="G" modifiers="Ctrl" action="SelectionGroup" />
......
......@@ -263,13 +263,13 @@ Hom/end keys-select minimum or maximum feather values
<bind key="Z" modifiers="Ctrl" action="EditUndo" display="true"/>
<bind key="y" modifiers="Ctrl,Shift" action="EditUndo" />
<bind key="Y" modifiers="Ctrl,Shift" action="EditUndo" />
<bind key="less" modifiers="Ctrl" action="EditUndo" /> <!-- FIXME: stolen by scaling, redirect that through a verb -->
<bind key="comma" modifiers="Ctrl" action="EditUndo" /> <!-- FIXME: stolen by scaling, redirect that through a verb -->
<bind key="less" modifiers="Ctrl" action="EditUndo" />
<bind key="comma" modifiers="Ctrl" action="EditUndo" />
<bind key="y" modifiers="Ctrl" action="EditRedo" display="true"/>
<bind key="Y" modifiers="Ctrl" action="EditRedo" />
<bind key="greater" modifiers="Ctrl" action="EditRedo" /> <!-- FIXME: stolen by scaling, redirect that through a verb -->
<bind key="period" modifiers="Ctrl" action="EditRedo" /> <!-- FIXME: stolen by scaling, redirect that through a verb -->
<bind key="greater" modifiers="Ctrl" action="EditRedo" />
<bind key="period" modifiers="Ctrl" action="EditRedo" />
<bind key="x" modifiers="Ctrl" action="EditCut" display="true"/>
<bind key="X" modifiers="Ctrl" action="EditCut" />
......
......@@ -221,6 +221,7 @@ set(inkscape_SRC
line-geometry.cpp
line-snapper.cpp
main-cmdlineact.cpp
main-cmdlinexact.cpp
media.cpp
message-context.cpp
message-stack.cpp
......@@ -337,6 +338,7 @@ set(inkscape_SRC
line-snapper.h
macros.h
main-cmdlineact.h
main-cmdlinexact.h
media.h
menus-skeleton.h
message-context.h
......
......@@ -434,6 +434,11 @@ SPGradient *sp_gradient_convert_to_userspace(SPGradient *gr, SPItem *item, gchar
return gr;
}
// FIXME Transforming a mesh gradient is more complicated... probably need to add function to SPMeshArray.wq
if ( gr && SP_IS_MESHGRADIENT( gr ) ) {
return gr;
}
// First, fork it if it is shared
gr = sp_gradient_fork_private_if_necessary(gr, gr->getVector(),
SP_IS_RADIALGRADIENT(gr) ? SP_GRADIENT_TYPE_RADIAL : SP_GRADIENT_TYPE_LINEAR, item);
......
......@@ -27,6 +27,7 @@ set(live_effects_SRC
lpe-lattice.cpp
lpe-lattice2.cpp
lpe-line_segment.cpp
lpe-measure-line.cpp
lpe-mirror_symmetry.cpp
lpe-offset.cpp
lpe-parallel.cpp
......@@ -68,6 +69,7 @@ set(live_effects_SRC
parameter/powerstrokepointarray.cpp
parameter/random.cpp
parameter/text.cpp
parameter/fontbutton.cpp
parameter/togglebutton.cpp
parameter/transformedpoint.cpp
parameter/unit.cpp
......@@ -105,6 +107,7 @@ set(live_effects_SRC
lpe-lattice.h
lpe-lattice2.h
lpe-line_segment.h
lpe-measure-line.h
lpe-mirror_symmetry.h
lpe-offset.h
lpe-parallel.h
......@@ -148,6 +151,7 @@ set(live_effects_SRC
parameter/powerstrokepointarray.h
parameter/random.h
parameter/text.h
parameter/fontbutton.h
parameter/togglebutton.h
parameter/transformedpoint.h
parameter/unit.h
......
......@@ -36,6 +36,7 @@ enum EffectType {
CONSTRUCT_GRID,
PERP_BISECTOR,
TANGENT_TO_CURVE,
MEASURE_LINE,
MIRROR_SYMMETRY,
CIRCLE_3PTS,
TRANSFORM_2PTS,
......
......@@ -39,6 +39,7 @@
#include "live_effects/lpe-lattice2.h"
#include "live_effects/lpe-lattice.h"
#include "live_effects/lpe-line_segment.h"
#include "live_effects/lpe-measure-line.h"
#include "live_effects/lpe-mirror_symmetry.h"
#include "live_effects/lpe-offset.h"
#include "live_effects/lpe-parallel.h"
......@@ -135,6 +136,8 @@ const Util::EnumData<EffectType> LPETypeData[] = {
{FILL_BETWEEN_MANY, N_("Fill between many"), "fill_between_many"},
{ELLIPSE_5PTS, N_("Ellipse by 5 points"), "ellipse_5pts"},
{BOUNDING_BOX, N_("Bounding Box"), "bounding_box"},
/* 9.93 */
{MEASURE_LINE, N_("Measure Line"), "measure-line"},
};
const Util::EnumDataConverter<EffectType> LPETypeConverter(LPETypeData, sizeof(LPETypeData)/sizeof(*LPETypeData));
......@@ -303,6 +306,9 @@ Effect::New(EffectType lpenr, LivePathEffectObject *lpeobj)
case TRANSFORM_2PTS:
neweffect = static_cast<Effect*> ( new LPETransform2Pts(lpeobj) );
break;
case MEASURE_LINE:
neweffect = static_cast<Effect*> ( new LPEMeasureLine(lpeobj) );
break;
default:
g_warning("LivePathEffect::Effect::New called with invalid patheffect type (%d)", lpenr);
neweffect = NULL;
......@@ -348,6 +354,7 @@ Effect::Effect(LivePathEffectObject *lpeobject)
concatenate_before_pwd2(false),
sp_lpe_item(NULL),
current_zoom(1),
upd_params(true),
sp_curve(NULL),
provides_own_flash_paths(true), // is automatically set to false if providesOwnFlashPaths() is not overridden
is_ready(false) // is automatically set to false if providesOwnFlashPaths() is not overridden
......@@ -431,7 +438,9 @@ void Effect::doAfterEffect (SPLPEItem const* /*lpeitem*/)
void Effect::doOnRemove (SPLPEItem const* /*lpeitem*/)
{
}
void Effect::doOnVisibilityToggled(SPLPEItem const* /*lpeitem*/)
{
}
//secret impl methods (shhhh!)
void Effect::doOnApply_impl(SPLPEItem const* lpeitem)
{
......@@ -690,7 +699,7 @@ Effect::newWidget()
++it;
}
upd_params = false;
return dynamic_cast<Gtk::Widget *>(vbox);
}
......
......@@ -66,7 +66,7 @@ public:
virtual void doAfterEffect (SPLPEItem const* lpeitem);
virtual void doOnRemove (SPLPEItem const* lpeitem);
virtual void doOnVisibilityToggled(SPLPEItem const* lpeitem);
void writeParamsToSVG();
virtual void acceptParamPath (SPPath const* param_path);
......@@ -123,6 +123,7 @@ public:
void editNextParamOncanvas(SPItem * item, SPDesktop * desktop);
bool apply_to_clippath_and_mask;
bool upd_params;
protected:
Effect(LivePathEffectObject *lpeobject);
......
......@@ -170,7 +170,7 @@ LPEEllipse5Pts::doEffect_path (Geom::PathVector const & path_in)
// figure out if we have a slice, guarding against rounding errors
Path p(Geom::Point(cos(0), sin(0)));
Geom::Path p(Geom::Point(cos(0), sin(0)));
double end = 2 * M_PI;
for (s = 0; s < end; s += M_PI_2) {
......
......@@ -61,7 +61,7 @@ LPEExtrude::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2
using namespace Geom;
// generate connecting lines (the 'sides' of the extrusion)
Path path(Point(0.,0.));
Geom::Path path(Point(0.,0.));
path.appendNew<Geom::LineSegment>( extrude_vector.getVector() );
Piecewise<D2<SBasis> > connector = path.toPwSb();
......
......@@ -94,7 +94,7 @@ findShadowedTime(Geom::Path const &patha, std::vector<Geom::Point> const &pt_and
Affine mat = from_basis( T, N, pt_and_dir[0] );
mat = mat.inverse();
Path p = patha * mat;
Geom::Path p = patha * mat;
std::vector<double> times;
......@@ -477,7 +477,7 @@ LPEKnot::doEffect_path (Geom::PathVector const &path_in)
// std::cout<<"fusing first and last component\n";
++beg_comp;
--end_comp;
Path first = gpaths[i0].portion(dom.back());
Geom::Path first = gpaths[i0].portion(dom.back());
//FIXME: stitching should not be necessary (?!?)
first.setStitching(true);
first.append(gpaths[i0].portion(dom.front()));
......
This diff is collapsed.
#ifndef INKSCAPE_LPE_MEASURE_LINE_H
#define INKSCAPE_LPE_MEASURE_LINE_H
/*
* Author(s):
* Jabiertxo Arraiza Cenoz <[email protected]>
*
* Copyright (C) 2014 Author(s)
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "live_effects/effect.h"
#include "live_effects/parameter/enum.h"
#include "live_effects/parameter/fontbutton.h"
#include "live_effects/parameter/text.h"
#include "live_effects/parameter/unit.h"
#include "live_effects/parameter/bool.h"
#include "live_effects/parameter/originalpath.h"
#include <libnrtype/font-lister.h>
#include <2geom/angle.h>
#include <2geom/ray.h>
#include <2geom/point.h>
namespace Inkscape {
namespace LivePathEffect {
enum OrientationMethod {
OM_HORIZONTAL,
OM_VERTICAL,
OM_PARALLEL,
OM_END
};
class LPEMeasureLine : public Effect {
public:
LPEMeasureLine(LivePathEffectObject *lpeobject);
virtual ~LPEMeasureLine();
virtual void doBeforeEffect (SPLPEItem const* lpeitem);
virtual void doOnApply(SPLPEItem const* lpeitem);
virtual void doOnRemove (SPLPEItem const* lpeitem);
virtual void doOnVisibilityToggled(SPLPEItem const* /*lpeitem*/);
virtual Geom::PathVector doEffect_path(Geom::PathVector const &path_in);
void createLine(Geom::Point start,Geom::Point end,Glib::ustring id, bool main, bool overflow, bool remove, bool arrows = false);
void createTextLabel(Geom::Point pos, double length, Geom::Coord angle, bool remove);
void onExpanderChanged();
void toObjects();
void createArrowMarker(Glib::ustring mode);
void saveDefault();
virtual Gtk::Widget *newWidget();
private:
UnitParam unit;
FontButtonParam fontbutton;
EnumParam<OrientationMethod> orientation;
ScalarParam curve_linked;
ScalarParam precision;
ScalarParam position;
ScalarParam text_top_bottom;
ScalarParam text_right_left;
ScalarParam helpline_distance;
ScalarParam helpline_overlap;
ScalarParam scale;
TextParam format;
BoolParam arrows_outside;
BoolParam flip_side;
BoolParam scale_insensitive;
BoolParam local_locale;
BoolParam line_group_05;
BoolParam rotate_anotation;
BoolParam hide_back;
TextParam dimline_format;
TextParam helperlines_format;
TextParam anotation_format;
TextParam arrows_format;
Glib::ustring display_unit;
bool expanded;
Gtk::Expander * expander;
double doc_scale;
double fontsize;
double anotation_width;
double arrow_gap;
bool erase;
/* Geom::Affine affine_over;*/
LPEMeasureLine(const LPEMeasureLine &);
LPEMeasureLine &operator=(const LPEMeasureLine &);
};
} //namespace LivePathEffect
} //namespace Inkscape
#endif
/*
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 :
......@@ -609,11 +609,12 @@ LPEPowerStroke::doEffect_path (Geom::PathVector const & path_in)
// find time values for which x lies outside path domain
// and only take portion of x and y that lies within those time values
std::vector< double > rtsmin = roots (x - pwd2_in.domain().min());
std::vector< double > rtsmax = roots (x - pwd2_in.domain().max());
std::vector< double > rtsmax = roots (x + pwd2_in.domain().max());
if ( !rtsmin.empty() && !rtsmax.empty() ) {
x = portion(x, rtsmin.at(0), rtsmax.at(0));
y = portion(y, rtsmin.at(0), rtsmax.at(0));
}
LineJoinType jointype = static_cast<LineJoinType>(linejoin_type.get_value());
Piecewise<D2<SBasis> > pwd2_out = compose(pwd2_in,x) + y*compose(n,x);
......
......@@ -87,7 +87,6 @@ LPETransform2Pts::doOnApply(SPLPEItem const* lpeitem)
{
using namespace Geom;
original_bbox(lpeitem);
point_a = Point(boundingbox_X.min(), boundingbox_Y.middle());
point_b = Point(boundingbox_X.max(), boundingbox_Y.middle());
SPLPEItem * splpeitem = const_cast<SPLPEItem *>(lpeitem);
......
......@@ -38,8 +38,14 @@ public:
/* Note that the returned pointer can be NULL in a valid LivePathEffectObject contained in a valid list of lpeobjects in an lpeitem!
* So one should always check whether the returned value is NULL or not */
Inkscape::LivePathEffect::Effect * get_lpe() { return lpe; };
Inkscape::LivePathEffect::Effect const * get_lpe() const { return lpe; };
Inkscape::LivePathEffect::Effect * get_lpe() {
if(this) return lpe;
else return NULL;
}
Inkscape::LivePathEffect::Effect const * get_lpe() const {
if(this) return lpe;
else return NULL;
};
Inkscape::LivePathEffect::Effect *lpe; // this can be NULL in a valid LivePathEffectObject
......
......@@ -36,6 +36,12 @@ BoolParam::param_set_default()
param_setValue(defvalue);
}
void
BoolParam::param_update_default(bool const default_value)
{
defvalue = default_value;
}
bool
BoolParam::param_readSVGValue(const gchar * strvalue)
{
......
......@@ -36,7 +36,7 @@ public:
void param_setValue(bool newvalue);
virtual void param_set_default();
void param_update_default(bool const default_value);
bool get_value() const { return value; };
inline operator bool() const { return value; };
......
......@@ -27,12 +27,14 @@ public:
const Util::EnumDataConverter<E>& c,
Inkscape::UI::Widget::Registry* wr,
Effect* effect,
E default_value)
E default_value,
bool sort = true)
: Parameter(label, tip, key, wr, effect)
{
enumdataconv = &c;
defvalue = default_value;
value = defvalue;
sorted = sort;
};
virtual ~EnumParam() { };
......@@ -40,12 +42,11 @@ public:
virtual Gtk::Widget * param_newWidget() {
Inkscape::UI::Widget::RegisteredEnum<E> *regenum = Gtk::manage (
new Inkscape::UI::Widget::RegisteredEnum<E>( param_label, param_tooltip,
param_key, *enumdataconv, *param_wr, param_effect->getRepr(), param_effect->getSPDoc() ) );
param_key, *enumdataconv, *param_wr, param_effect->getRepr(), param_effect->getSPDoc(), sorted ) );
regenum->set_active_by_id(value);
regenum->combobox()->setProgrammatically = false;
regenum->set_undo_parameters(SP_VERB_DIALOG_LIVE_PATH_EFFECT, _("Change enumeration parameter"));
return dynamic_cast<Gtk::Widget *> (regenum);
};
......@@ -86,6 +87,7 @@ private:
E value;
E defvalue;
bool sorted;
const Util::EnumDataConverter<E> * enumdataconv;
};
......
/*
* Authors:
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "ui/widget/registered-widget.h"
#include "live_effects/parameter/fontbutton.h"
#include "live_effects/effect.h"
#include "ui/widget/font-button.h"
#include "svg/svg.h"
#include "svg/stringstream.h"
#include "verbs.h"
#include <glibmm/i18n.h>
namespace Inkscape {
namespace LivePathEffect {
FontButtonParam::FontButtonParam( const Glib::ustring& label, const Glib::ustring& tip,
const Glib::ustring& key, Inkscape::UI::Widget::Registry* wr,
Effect* effect, const Glib::ustring default_value )
: Parameter(label, tip, key, wr, effect),
value(default_value),
defvalue(default_value)
{
}
void
FontButtonParam::param_set_default()
{
param_setValue(defvalue);
}
void
FontButtonParam::param_update_default(const Glib::ustring default_value){
defvalue = default_value;
}
bool
FontButtonParam::param_readSVGValue(const gchar * strvalue)
{
Inkscape::SVGOStringStream os;
os << strvalue;
param_setValue((Glib::ustring)os.str());
return true;
}
gchar *
FontButtonParam::param_getSVGValue() const
{
return g_strdup(value.c_str());
}
Gtk::Widget *
FontButtonParam::param_newWidget()
{
Inkscape::UI::Widget::RegisteredFontButton * fontbuttonwdg = Gtk::manage(
new Inkscape::UI::Widget::RegisteredFontButton( param_label,
param_tooltip,
param_key,
*param_wr,
param_effect->getRepr(),
param_effect->getSPDoc() ) );
Glib::ustring fontspec = param_getSVGValue();
fontbuttonwdg->setValue( fontspec);