X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/4511b619c83ef3f3589e7a76fd812561950eef99..3e56bc8be121c3896356f94709f127c97956228d:/Client/include/item.h?ds=sidebyside diff --git a/Client/include/item.h b/Client/include/item.h index dd845d4..df6d3ba 100644 --- a/Client/include/item.h +++ b/Client/include/item.h @@ -2,27 +2,59 @@ #define _ITEM_H_ #include +#include #include #include #include #include #include +/** Estructura para guardar las lineas de conexión */ +typedef struct { + std::string dst; ///< Destino de la línea + bool is_tank; ///< Define si es un tanque + bool is_tank_lower; ///< Define si esta conectado abajo +} t_Linea; + class ViewItem:public Gtk::EventBox { public: ViewItem(Glib::ustring _name); virtual ~ViewItem(); -// virtual bool on_expose_event(GdkEventExpose* event); - Glib::ustring get_name(); + + virtual bool on_image_expose_event(GdkEventExpose *e); + virtual void on_realize(); + inline Glib::ustring get_name() { return name; } void set_position(int _x, int _y); void set_name(Glib::ustring _name); - void set_actual_flow(float f) { actual_flow = f; } - std::string get_actual_flow(); + inline bool get_open() { return open; } + inline void set_actual_flow(float f) { actual_flow = f; } + inline void set_open(bool b) { open = b; } + inline void set_extra(float f) { extra = f; } + inline void set_color(const Gdk::Color &c) { color = c; } + inline Gdk::Color get_color() { return color; } + + virtual std::string get_actual_flow(); + virtual std::string get_cap_flow() { return "Flujo Actual :"; } + virtual std::string get_cap_extra() { return ""; } + virtual std::string get_extra() { return ""; } + + std::list out_lines; // lineas que salen de una compuerta + std::list in_lines; // lineas que entran a una compuerta + + // Coordenadas para los conectores + int x,y; + int in_x, in_y; + int out_x, out_y; + int offset_x, offset_y; + int item_offset_x, item_offset_y; protected: Glib::ustring name; Gtk::Image image; - int x, y; - float actual_flow; + Gdk::Color color; + Glib::RefPtr gc; + int m_or; + float actual_flow, extra; + bool open; }; #endif