00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __LIBS_GUI_UTILS_THROBBER_H_
00025 #define __LIBS_GUI_UTILS_THROBBER_H_
00026
00027 #include <gtkmm.h>
00028 #ifdef HAVE_GLADEMM
00029 # include <libglademm/xml.h>
00030 #endif
00031
00032 namespace fawkes {
00033
00034 class Throbber : public Gtk::Image
00035 {
00036 public:
00037 Throbber(Gtk::IconSize &icon_size);
00038 #ifdef HAVE_GLADEMM
00039 Throbber(BaseObjectType* cobject,
00040 const Glib::RefPtr<Gnome::Glade::Xml>& ref_glade);
00041 #endif
00042
00043 void set_timeout(unsigned int timeout);
00044
00045 bool anim_running();
00046
00047 void start_anim();
00048 void stop_anim();
00049
00050 void set_stock(const Gtk::StockID& stock_id);
00051
00052 private:
00053 void ctor(Gtk::IconSize icon_size);
00054 bool draw_next();
00055
00056 private:
00057 unsigned int __current;
00058 std::vector<Glib::RefPtr<Gdk::Pixbuf> > __pixbufs;
00059 Gtk::IconSize __icon_size;
00060
00061 sigc::connection __timeout_connection;
00062 unsigned int __timeout;
00063 };
00064
00065 }
00066
00067 #endif