Author: Carlos Lopez <[email protected]>
Date:   Wed Jul 27 21:31:39 2011 +0200

New Dash Item class files.

---

 synfig-core/src/synfig/Makefile.am  |    2 +
 synfig-core/src/synfig/dashitem.cpp |   89 +++++++++++++++++++++++++++++++++++
 synfig-core/src/synfig/dashitem.h   |   60 +++++++++++++++++++++++
 3 files changed, 151 insertions(+), 0 deletions(-)

diff --git a/synfig-core/src/synfig/Makefile.am 
b/synfig-core/src/synfig/Makefile.am
index 873411e..53d3533 100644
--- a/synfig-core/src/synfig/Makefile.am
+++ b/synfig-core/src/synfig/Makefile.am
@@ -174,12 +174,14 @@ VALUENODESOURCES = \
 VALUEHEADERS = \
        blinepoint.h \
        widthpoint.h \
+       dashitem.h \
        gradient.h \
        value.h
 
 VALUESOURCES = \
        blinepoint.cpp \
        widthpoint.cpp \
+       dashitem.cpp \
        gradient.cpp \
        value.cpp
 
diff --git a/synfig-core/src/synfig/dashitem.cpp 
b/synfig-core/src/synfig/dashitem.cpp
new file mode 100644
index 0000000..21650c7
--- /dev/null
+++ b/synfig-core/src/synfig/dashitem.cpp
@@ -0,0 +1,89 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file dashitem.cpp
+**     \brief Template File for a Dash Item implementation
+**
+**     $Id$
+**
+**     \legal
+**     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
+**     Copyright (c) 2011 Carlos López
+**
+**     This package is free software; you can redistribute it and/or
+**     modify it under the terms of the GNU General Public License as
+**     published by the Free Software Foundation; either version 2 of
+**     the License, or (at your option) any later version.
+**
+**     This package is distributed in the hope that it will be useful,
+**     but WITHOUT ANY WARRANTY; without even the implied warranty of
+**     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+**     General Public License for more details.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "dashitem.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace synfig;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+DashItem::DashItem()
+{
+       set_offset(0.1);
+       set_length(0.1);
+       set_side_type_before(TYPE_FLAT);
+       set_side_type_after(TYPE_FLAT);
+}
+
+DashItem::DashItem(Real offset, Real length, int sidebefore, int sideafter)
+{
+       set_offset(position);
+       set_width(length);
+       set_side_type_before(sidebefore);
+       set_side_type_after(sideafter);
+}
+
+
+void
+DashItem::set_length(Real x)
+{
+       set_width(x);
+}
+
+const Real&
+DashItem::get_length()const
+{
+       return get_width();
+}
+
+void
+DashItem::set_offset(Real x)
+{
+       set_position(x);
+}
+
+const Real&
+DashItem::get_offset()const
+{
+       return get_position();
+}
diff --git a/synfig-core/src/synfig/dashitem.h 
b/synfig-core/src/synfig/dashitem.h
new file mode 100644
index 0000000..5fd0a78
--- /dev/null
+++ b/synfig-core/src/synfig/dashitem.h
@@ -0,0 +1,60 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file dashitem.h
+**     \brief Template Header for the implementation of a Dash Item
+**
+**     $Id$
+**
+**     \legal
+**     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
+**     Copyright (c) 2011 Carlos López
+**
+**     This package is free software; you can redistribute it and/or
+**     modify it under the terms of the GNU General Public License as
+**     published by the Free Software Foundation; either version 2 of
+**     the License, or (at your option) any later version.
+**
+**     This package is distributed in the hope that it will be useful,
+**     but WITHOUT ANY WARRANTY; without even the implied warranty of
+**     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+**     General Public License for more details.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SYNFIG_DASHITEM_H
+#define __SYNFIG_DASHITEM_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "uniqueid.h"
+#include "widthpoint.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace synfig {
+
+class DashItem : public WidthPoint
+{
+public:
+
+       DashItem();
+       DashItem(Real position, Real length, int sidebefore=TYPE_FLAT,
+               int sideafter=TYPE_FLAT);
+
+       const Real& get_length()const;
+       void set_length(Real x);
+       const Real& get_offset()const;
+       void set_offset(Real x);
+}; // END of class DashItem
+
+}; // END of namespace synfig
+
+/* === E N D =============================================================== */
+
+#endif


------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to