~ubuntu-branches/ubuntu/precise/ipe/precise

« back to all changes in this revision

Viewing changes to src/ipelib/ipefactory.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2009-12-11 21:22:35 UTC
  • mfrom: (4.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20091211212235-5iio4nzpra64snab
Tags: 7.0.10-1
* New upstream.  Closes: #551192.
  - New build-depends: libcairo2-dev, liblua5.1-0-dev, gsfonts
  - patches/config.diff: Remove.  Upstream build system replaced.
  - Runtime lib package changed to libipe7.0.10 from libipe1c2a
  - Devel package renamed to libipe-dev (from libipe1-dev)
  - Package ipe depends on lua5.1 due to ipe-update-master.

* rules: Re-write to use dh.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
/*
5
5
 
6
6
    This file is part of the extensible drawing editor Ipe.
7
 
    Copyright (C) 1993-2007  Otfried Cheong
 
7
    Copyright (C) 1993-2009  Otfried Cheong
8
8
 
9
9
    Ipe is free software; you can redistribute it and/or modify it
10
10
    under the terms of the GNU General Public License as published by
11
 
    the Free Software Foundation; either version 2 of the License, or
 
11
    the Free Software Foundation; either version 3 of the License, or
12
12
    (at your option) any later version.
13
13
 
14
14
    As a special exception, you have permission to link Ipe with the
30
30
 
31
31
#include "ipefactory.h"
32
32
#include "ipepath.h"
33
 
#include "ipemark.h"
34
33
#include "ipetext.h"
35
34
#include "ipeimage.h"
36
 
#include "iperef.h"
 
35
#include "ipereference.h"
37
36
 
38
37
// --------------------------------------------------------------------
39
38
 
40
 
/*! \class IpeObjectFactory
 
39
using namespace ipe;
 
40
 
 
41
/*! \class ipe::ObjectFactory
41
42
  \ingroup high
42
43
  \brief Factory for Ipe leaf objects.
43
44
*/
44
45
 
45
46
//! Create an Ipe object by calling the right constructor.
46
 
IpeObject *IpeObjectFactory::CreateObject(IpeRepository *rep,
47
 
                                          IpeString name,
48
 
                                          const IpeXmlAttributes &attr,
49
 
                                          IpeString data)
 
47
Object *ObjectFactory::createObject(String name, const XmlAttributes &attr,
 
48
                                    String data)
50
49
{
51
50
  if (name == "path")
52
 
    return new IpePath(rep, attr, data);
53
 
  else if (name == "mark")
54
 
    return new IpeMark(rep, attr, data);
 
51
    return Path::create(attr, data);
55
52
  else if (name == "text")
56
 
    return new IpeText(rep, attr, data);
 
53
    return new Text(attr, data);
57
54
  else if (name == "image")
58
 
    return new IpeImage(rep, attr, data);
59
 
  else if (name == "ref")
60
 
    return new IpeReference(rep, attr, data);
 
55
    return new Image(attr, data);
 
56
  else if (name == "use")
 
57
    return new Reference(attr, data);
61
58
  else
62
59
    return 0;
63
60
}
64
61
 
65
 
//! Create an IpeImage with a given bitmap.
66
 
IpeObject *IpeObjectFactory::CreateImage(IpeRepository *rep,
67
 
                                         IpeString /*name*/,
68
 
                                         const IpeXmlAttributes &attr,
69
 
                                         IpeBitmap bitmap)
 
62
//! Create an Image with a given bitmap.
 
63
Object *ObjectFactory::createImage(String /*name*/, const XmlAttributes &attr,
 
64
                                   Bitmap bitmap)
70
65
{
71
 
  return new IpeImage(rep, attr, bitmap);
 
66
  return new Image(attr, bitmap);
72
67
}
73
68
 
74
69
// --------------------------------------------------------------------