+
+void Pump::get_in_logic_connect_position(int& _a, int& _b)
+{
+ _a = in_x;
+ _b = in_y;
+}
+
+void Pump::get_out_logic_connect_position(int& _a, int& _b)
+{
+ _a = out_x;
+ _b = out_y;
+}
+
+ConnectorType Pump::detect_click_position(int _a, int _b)
+{
+ switch (imgActual) {
+ case 0:
+ if ( (_a <=image->get_width())&&(_a>=image->get_width()-32)&&(_b<=16)&&(_b >= 0) )
+ return IN;
+ if ( (_a <= image->get_width())&&(_a>=image->get_width()-32)&&(_b<=32)&&(_b > 16) )
+ return OUT;
+ break;
+ case 1:
+ if ( (_a <= 32)&&(_a>=0)&&(_b<=16)&&(_b >= 0) )
+ return IN;
+ if ( (_a <= 32)&&(_a>=0)&&(_b<=32)&&(_b > 16) )
+ return OUT;
+ }
+ return UNDEF;
+}
+
+void Pump::update_logic_position()
+{
+ switch (imgActual) {
+ case 1:
+ in_x = x + 16;
+ in_y = y;
+ out_x = in_x;
+ out_y = y + 32;
+ break;
+ case 0:
+ in_x = x + image->get_width()-16;
+ in_y = y;
+ out_x = in_x;
+ out_y = y + 32;
+ }
+}
+
+bool Pump::on_expose_event(GdkEventExpose* event)
+{
+ CItem::on_expose_event(event);
+ Glib::RefPtr<Gdk::Window> window = get_window();
+
+ gc->set_foreground(red);
+ gc->set_background(red);
+ window->draw_rectangle(gc, 1, image->get_width()-32, 0, 32, 16);
+ gc->set_foreground(blue);
+ gc->set_background(blue);
+ window->draw_rectangle(gc, 1, image->get_width()-32, 16, 32, 16);
+ return true;
+}