|
UniWidgets
1.0.0
|
00001 #ifndef _CISTERNIMAGEBLINK_H 00002 #define _CISTERNIMAGEBLINK_H 00003 // ------------------------------------------------------------------------- 00005 // ------------------------------------------------------------------------- 00006 #include <gtkmm.h> 00007 #include <gdkmm.h> 00008 #include <uniwidgets/SBlinker.h> 00009 #include <uniwidgets/USignals.h> 00010 #include <uniwidgets/ConfirmSignal.h> 00011 #include <components/CisternImage.h> 00012 #include <plugins.h> 00013 #include <global_macros.h> 00014 // ------------------------------------------------------------------------- 00015 namespace UniWidgets 00016 { 00025 class CisternImageBlink : public CisternImage 00026 { 00027 public: 00028 CisternImageBlink(); 00029 explicit CisternImageBlink(Gtk::EventBox::BaseObjectType* gobject); 00030 virtual ~CisternImageBlink(); 00031 00032 /* Methods */ 00033 void start_blink(); 00034 void stop_blink(); 00035 void on_set_state(const long mode, const long level=0); 00036 bool is_blinking(); 00037 virtual bool can_blinking(){return true;} 00038 00039 protected: 00040 /* Event handlers */ 00041 virtual bool on_expose_event(GdkEventExpose* event); 00042 void on_map(); 00043 void on_unmap(); 00044 00045 private: 00046 /* Variables */ 00047 Glib::RefPtr<Gdk::Pixbuf> background_current_image_; 00048 Glib::RefPtr<Gdk::Pixbuf> filling_current_image_; 00049 00050 Glib::RefPtr<Gdk::Pixbuf> background_warn_image_; 00051 Glib::RefPtr<Gdk::Pixbuf> background_alarm_image_; 00052 00053 Glib::RefPtr<Gdk::Pixbuf> filling_alarm_image_; 00054 std::map<long , Glib::RefPtr<Gdk::Pixbuf> > states_; 00055 00056 static Blinker blinker; 00057 sigc::connection blink_connection_; 00058 bool is_blinking_; 00059 bool sleep_blinking_; 00060 00061 void constructor(); 00062 void blink(bool state,int time = DEFAULT_BLINK_TIME); 00063 virtual void draw_value_y(Glib::RefPtr<Gdk::Pixbuf> image, const long y1_ ,const long y2_); 00064 DISALLOW_COPY_AND_ASSIGN(CisternImageBlink); 00065 ADD_PROPERTY( property_state_, bool ) 00066 ADD_PROPERTY( image_warn_path, Glib::ustring ) 00067 ADD_PROPERTY( image_alarm_path, Glib::ustring ) 00068 ADD_PROPERTY( high_alarm_image_path, Glib::ustring ) 00069 ADD_PROPERTY( low_alarm_image_path, Glib::ustring ) 00070 ADD_PROPERTY( threshold_high, long ) 00071 }; 00072 00073 } 00074 #endif
1.7.6.1