Fawkes API  Fawkes Development Version
throbber.h
1 
2 /***************************************************************************
3  * throbber.h - Fawkes throbber
4  *
5  * Created: Tue Nov 04 16:36:38 2008
6  * Copyright 2008 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef __LIBS_GUI_UTILS_THROBBER_H_
25 #define __LIBS_GUI_UTILS_THROBBER_H_
26 
27 #include <gtkmm.h>
28 
29 namespace fawkes {
30 
31 class Throbber : public Gtk::Image
32 {
33  public:
34  Throbber(Gtk::IconSize &icon_size);
35  Throbber(BaseObjectType* cobject,
36  const Glib::RefPtr<Gtk::Builder> &builder);
37 
38  void set_timeout(unsigned int timeout);
39 
40  bool anim_running();
41 
42  void start_anim();
43  void stop_anim();
44 
45  void set_stock(const Gtk::StockID& stock_id);
46 
47  private:
48  void ctor(Gtk::IconSize icon_size);
49  bool draw_next();
50 
51  private:
52  unsigned int __current;
53  std::vector<Glib::RefPtr<Gdk::Pixbuf> > __pixbufs;
54  Gtk::IconSize __icon_size;
55 
56  sigc::connection __timeout_connection;
57  unsigned int __timeout;
58 };
59 
60 } // end namespace fawkes
61 
62 #endif
Fawkes library namespace.
void start_anim()
Start animation.
Definition: throbber.cpp:177
void stop_anim()
Stop animation.
Definition: throbber.cpp:187
void set_timeout(unsigned int timeout)
Set the animation timeout.
Definition: throbber.cpp:160
void set_stock(const Gtk::StockID &stock_id)
Set image from stock ID.
Definition: throbber.cpp:205
Throbber(Gtk::IconSize &icon_size)
Constructor.
Definition: throbber.cpp:71
bool anim_running()
Check if animation is running.
Definition: throbber.cpp:170
Simple Gtk Throbber/Spinner.
Definition: throbber.h:31