00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef header_component_generic
00010 #define header_component_generic
00011
00012 #include "API/GUI/component.h"
00013
00014 class CL_Component_Generic
00015 {
00016 public:
00017 CL_Component_Generic(
00018 CL_Component *self,
00019 const CL_Rect &pos,
00020 CL_Component *parent,
00021 CL_StyleManager *style);
00022
00023 ~CL_Component_Generic();
00024
00025 void on_button_press(CL_Component *, CL_InputDevice *, CL_Key);
00026 void on_button_release(CL_Component *, CL_InputDevice *, CL_Key);
00027 void on_mouse_move(CL_Component *, CL_InputDevice *, int, int);
00028
00029 void init();
00030 void begin_paint();
00031 void end_paint();
00032
00033 CL_Component *self;
00034 CL_Component *parent;
00035 CL_StyleManager *style_manager;
00036
00037 CL_Rect position;
00038
00039 CL_GUIManager *gui;
00040
00041 bool captured;
00042 bool visible;
00043 bool enabled;
00044 bool mouse_over;
00045 bool popup;
00046 bool removeflag;
00047
00048 std::list<CL_Component *> children;
00049 std::list<CL_Component *> delete_children;
00050 std::list<CL_ComponentStyle *> styles;
00051
00052 CL_Signal_v0 sig_begin_paint;
00053 CL_Signal_v0 sig_paint;
00054 CL_Signal_v0 sig_end_paint;
00055 CL_Signal_v3<CL_Component *, CL_InputDevice *, CL_Key> sig_key_down;
00056 CL_Signal_v3<CL_Component *, CL_InputDevice *, CL_Key> sig_key_up;
00057 CL_Signal_v4<CL_Component *, CL_InputDevice *, int, int> sig_mouse_moved;
00058 CL_Signal_v0 sig_got_focus;
00059 CL_Signal_v0 sig_lost_focus;
00060 CL_Signal_v2<int, int> sig_resized;
00061 CL_Signal_v0 sig_mouse_entered;
00062 CL_Signal_v0 sig_mouse_left;
00063 CL_Signal_v2<int &, int &> sig_transform_coords;
00064 CL_Signal_v1<CL_Component *> sig_child_add;
00065 CL_Signal_v1<CL_Component *> sig_child_remove;
00066
00067 CL_Slot slot_begin_paint;
00068 CL_Slot slot_end_paint;
00069 CL_Slot slot_button_press;
00070 CL_Slot slot_button_release;
00071 CL_Slot slot_mouse_move;
00072 };
00073
00074 #endif