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