~om26er/ubuntu/oneiric/unity/sru-778256

« back to all changes in this revision

Viewing changes to plugins/unityshell/src/IconTexture.h

Update formatting to match style (as close as possible)

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
class IconTexture : public nux::TextureArea, public unity::Introspectable
31
31
{
32
32
public:
33
 
  IconTexture (nux::BaseTexture *texture, guint width, guint height);
34
 
  IconTexture (const char *icon_name, unsigned int size, bool defer_icon_loading=false);
35
 
  ~IconTexture ();
36
 
 
37
 
  void SetByIconName (const char *icon_name, unsigned int size);
38
 
  void SetByFilePath (const char *file_path, unsigned int size);
39
 
  void GetTextureSize (int *width, int *height);
40
 
  
41
 
  void LoadIcon ();
42
 
 
43
 
  void SetOpacity (float opacity);
44
 
  void SetTexture (nux::BaseTexture *texture);
 
33
  IconTexture(nux::BaseTexture* texture, guint width, guint height);
 
34
  IconTexture(const char* icon_name, unsigned int size, bool defer_icon_loading = false);
 
35
  ~IconTexture();
 
36
 
 
37
  void SetByIconName(const char* icon_name, unsigned int size);
 
38
  void SetByFilePath(const char* file_path, unsigned int size);
 
39
  void GetTextureSize(int* width, int* height);
 
40
 
 
41
  void LoadIcon();
 
42
 
 
43
  void SetOpacity(float opacity);
 
44
  void SetTexture(nux::BaseTexture* texture);
45
45
 
46
46
  void SetAcceptKeyNavFocus(bool accept);
47
 
  
 
47
 
48
48
protected:
49
49
  // Key navigation
50
50
  virtual bool AcceptKeyNavFocus();
51
51
  bool _accept_key_nav_focus;
52
 
  
53
 
  const gchar* GetName ();
54
 
  void AddProperties (GVariantBuilder *builder);
55
 
  virtual bool DoCanFocus ();
56
 
  
 
52
 
 
53
  const gchar* GetName();
 
54
  void AddProperties(GVariantBuilder* builder);
 
55
  virtual bool DoCanFocus();
 
56
 
57
57
private:
58
 
  void Draw (nux::GraphicsEngine& GfxContext, bool force_draw);
59
 
 
60
 
  void CreateTextureCallback (const char *texid, int width, int height, nux::BaseTexture **texture);
61
 
  void Refresh (GdkPixbuf *pixbuf);
62
 
  void IconLoaded (const char *icon_name, guint size, GdkPixbuf *pixbuf);
63
 
 
64
 
  char *_icon_name;
 
58
  void Draw(nux::GraphicsEngine& GfxContext, bool force_draw);
 
59
 
 
60
  void CreateTextureCallback(const char* texid, int width, int height, nux::BaseTexture** texture);
 
61
  void Refresh(GdkPixbuf* pixbuf);
 
62
  void IconLoaded(const char* icon_name, guint size, GdkPixbuf* pixbuf);
 
63
 
 
64
  char* _icon_name;
65
65
  unsigned int _size;
66
66
 
67
 
  GdkPixbuf        *_pixbuf_cached;
68
 
  nux::BaseTexture *_texture_cached;
 
67
  GdkPixbuf*        _pixbuf_cached;
 
68
  nux::BaseTexture* _texture_cached;
69
69
  int               _texture_width;
70
70
  int               _texture_height;
71
71