~ubuntu-branches/ubuntu/edgy/swig1.3/edgy

« back to all changes in this revision

Viewing changes to Examples/php4/shadow/example.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-12-05 01:16:04 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051205011604-ygx904it6413k3go
Tags: 1.3.27-1ubuntu1
Resynchronise with Debian again, for the new subversion packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
#  define M_PI 3.14159265358979323846
7
7
#endif
8
8
 
 
9
int Shape::get_nshapes() {
 
10
  return nshapes;
 
11
}
 
12
 
9
13
/* Move the shape to a new location */
10
14
void Shape::move(double dx, double dy) {
11
15
  x += dx;
14
18
 
15
19
int Shape::nshapes = 0;
16
20
 
 
21
void Circle::set_radius( double r ) {
 
22
  radius = r;
 
23
}
 
24
 
17
25
double Circle::area(void) {
18
26
  return M_PI*radius*radius;
19
27
}
29
37
double Square::perimeter(void) {
30
38
  return 4*width;
31
39
}
 
40
 
 
41
Circle *CircleFactory( double r ) {
 
42
  return new Circle(r);
 
43
}