oop_in_c/ColoredSquare.h

45 lines
1.0 KiB
C
Raw Normal View History

2012-04-30 18:59:30 +04:00
#ifndef __COLORED_SQUARE_H__
#define __COLORED_SQUARE_H__
#include "Square.h"
typedef struct ColoredSquare_data
{
Square_data;
int color;
} ColoredSquare_data;
2012-05-01 00:55:56 +04:00
struct ColoredSquare;
2012-04-30 18:59:30 +04:00
typedef struct ColoredSquare_interface
{
Square_interface;
2012-05-01 00:55:56 +04:00
void (*set_color) (struct ColoredSquare *this, int color);
2012-04-30 18:59:30 +04:00
} ColoredSquare_interface;
2012-05-01 00:55:56 +04:00
void ColoredSquare_constructor (struct ColoredSquare *this,
2012-04-30 23:50:36 +04:00
double a,
int color);
2012-05-01 19:56:48 +04:00
void ColoredSquare_copy (struct ColoredSquare *dest, const struct ColoredSquare *src);
2012-05-01 11:30:29 +04:00
struct ColoredSquare* ColoredSquare_clone (const struct ColoredSquare *this);
const char* ColoredSquare_type (const struct ColoredSquare *this);
void ColoredSquare_draw (const struct ColoredSquare *this);
2012-05-01 00:55:56 +04:00
void ColoredSquare_set_color (struct ColoredSquare *this, int color);
2012-04-30 18:59:30 +04:00
/* public */
typedef struct ColoredSquare
{
ColoredSquare_interface *vtable;
ColoredSquare_data;
} ColoredSquare;
2012-05-01 00:55:56 +04:00
ColoredSquare* ColoredSquare_new (double a, int color);
2012-04-30 18:59:30 +04:00
#endif // __COLORED_SQUARE_H__