The Gnome Chemistry Utils  0.14.0
Classes | Namespaces | Macros
item.h File Reference
#include <gcu/macros.h>
#include <cairo.h>

Go to the source code of this file.

Classes

class  gccv::Item
 The base class for the canvas contents. More...

Namespaces

namespace  gccv
 Gnome Chemistry Canvas library namespace.

Macros

#define GCCV_ITEM_PROP(type, member)
#define GCCV_ITEM_POS_PROP(type, member)

Detailed Description

Definition in file item.h.

Macro Definition Documentation

#define GCCV_ITEM_POS_PROP (   type,
  member 
)
Value:
public: \
void Set##member (type val) { \
Invalidate (); \
m_##member = val; \
BoundsChanged (); \
Invalidate (); \
} \
type Get##member (void) const {return m_##member;} \
private: \
type m_##member;

Defines a private member with appropriate get/set methods. This macro should be used when a property change might change the bounds of the item. GCCV_ITEM_POS_PROP((Type,Foo) expands to one private member:

Type m_Foo;

and three public methods:

void SetFoo(Type val);
Type GetFoo();

Calling SetFoo(val) will set the member and invalidate the item bounds.

Definition at line 74 of file item.h.

#define GCCV_ITEM_PROP (   type,
  member 
)
Value:
public: \
void Set##member (type val) { \
m_##member = val; \
Invalidate (); \
} \
type Get##member (void) const {return m_##member;} \
private: \
type m_##member;

Defines a private member with appropriate get/set methods. This macro should be used when a property change needs a redraw of the item. GCCV_ITEM_PROP((Type,Foo) expands to one private member:

Type m_Foo;

and three public methods:

void SetFoo(Type val);
Type GetFoo();

Calling SetFoo(val) will set the member and invalidate the item.

Definition at line 48 of file item.h.