$search
00001 00002 /*************************************************************************** 00003 * throbber.h - Fawkes throbber 00004 * 00005 * Created: Tue Nov 04 16:36:38 2008 00006 * Copyright 2008-2010 Tim Niemueller [www.niemueller.de] 00007 * 2010 Carnegie Mellon University 00008 * 2010 Intel Labs Pittsburgh 00009 * 00010 ****************************************************************************/ 00011 00012 /* This program is free software; you can redistribute it and/or modify 00013 * it under the terms of the GNU General Public License as published by 00014 * the Free Software Foundation; either version 2 of the License, or 00015 * (at your option) any later version. A runtime exception applies to 00016 * this software (see LICENSE.GPL_WRE file mentioned below for details). 00017 * 00018 * This program is distributed in the hope that it will be useful, 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00021 * GNU Library General Public License for more details. 00022 * 00023 * Read the full text in the LICENSE.GPL_WRE file in the doc directory. 00024 */ 00025 00026 #ifndef __LIBS_GUI_UTILS_THROBBER_H_ 00027 #define __LIBS_GUI_UTILS_THROBBER_H_ 00028 00029 #include <gtkmm.h> 00030 #ifdef HAVE_GLADEMM 00031 # include <libglademm/xml.h> 00032 #endif 00033 00034 namespace fawkes { 00035 00036 class Throbber : public Gtk::Image 00037 { 00038 public: 00039 Throbber(Gtk::IconSize &icon_size); 00040 #ifdef HAVE_GLADEMM 00041 Throbber(BaseObjectType* cobject, 00042 const Glib::RefPtr<Gnome::Glade::Xml>& ref_glade); 00043 #endif 00044 00045 void set_timeout(unsigned int timeout); 00046 00047 bool anim_running(); 00048 00049 void start_anim(); 00050 void stop_anim(); 00051 00052 void set_stock(const Gtk::StockID& stock_id); 00053 00054 private: 00055 void ctor(Gtk::IconSize icon_size); 00056 bool draw_next(); 00057 00058 private: 00059 unsigned int __current; 00060 std::vector<Glib::RefPtr<Gdk::Pixbuf> > __pixbufs; 00061 Gtk::IconSize __icon_size; 00062 00063 sigc::connection __timeout_connection; 00064 unsigned int __timeout; 00065 }; 00066 00067 } // end namespace fawkes 00068 00069 #endif