2012-04-30 18:59:30 +04:00
|
|
|
#ifndef __SQUARE_H__
|
|
|
|
#define __SQUARE_H__
|
|
|
|
|
|
|
|
#include "Figure.h"
|
|
|
|
|
|
|
|
typedef struct Square_data
|
|
|
|
{
|
|
|
|
double a;
|
|
|
|
|
|
|
|
} Square_data;
|
|
|
|
|
|
|
|
typedef struct Square_interface
|
|
|
|
{
|
|
|
|
Figure_interface;
|
|
|
|
|
|
|
|
void (*resize) (void *this, double a);
|
|
|
|
double (*diag_length) (void *this);
|
|
|
|
|
|
|
|
} Square_interface;
|
|
|
|
|
2012-04-30 23:50:36 +04:00
|
|
|
void Square_constructor (void *this, double a);
|
2012-04-30 18:59:30 +04:00
|
|
|
void Square_destructor (void *this);
|
|
|
|
void Square_copy (void *to, void *from);
|
|
|
|
void* Square_clone (void *this);
|
|
|
|
void Square_destroy (void *this);
|
|
|
|
const char* Square_type (void *this);
|
|
|
|
void Square_draw (void *this);
|
|
|
|
double Square_area (void *this);
|
|
|
|
void Square_resize (void *this, double a);
|
|
|
|
double Square_diag_length (void *this);
|
|
|
|
|
|
|
|
/* public */
|
|
|
|
typedef struct Square
|
|
|
|
{
|
|
|
|
Square_interface *vtable;
|
|
|
|
|
|
|
|
Square_data;
|
|
|
|
|
|
|
|
} Square;
|
|
|
|
|
2012-04-30 23:50:36 +04:00
|
|
|
void* Square_new (double a);
|
2012-04-30 18:59:30 +04:00
|
|
|
|
|
|
|
#endif // __SQUARE_H__
|