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

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2008-11-10 16:29:56 UTC
  • mfrom: (1.2.8 upstream) (2.1.3 lenny)
  • Revision ID: james.westby@ubuntu.com-20081110162956-xue6itkuqhbza87s
Tags: 1.3.36-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Drop pike and libchicken-dev from the build-depends 
    (both are universe)
  - Use python2.5 instead of python2.4.
  - use php5
  - Clean Runtime/ as well.
  - debian/Rules (clean): Remove Lib/ocaml/swigp4.ml.
  - drop "--without-mzscheme", we don't have it in our build-depends

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* File : example.c */
2
 
 
3
 
#include "example.h"
4
 
#include <math.h>
5
 
#ifndef M_PI
6
 
#  define M_PI 3.14159265358979323846
7
 
#endif
8
 
 
9
 
/* Move the shape to a new location */
10
 
void Shape::move(double dx, double dy) {
11
 
  x += dx;
12
 
  y += dy;
13
 
}
14
 
 
15
 
int Shape::nshapes = 0;
16
 
 
17
 
double Circle::area() {
18
 
  return M_PI*radius*radius;
19
 
}
20
 
 
21
 
double Circle::perimeter() {
22
 
  return 2*M_PI*radius;
23
 
}
24
 
 
25
 
double Square::area() {
26
 
  return width*width;
27
 
}
28
 
 
29
 
double Square::perimeter() {
30
 
  return 4*width;
31
 
}