Freya  0.0.1
A Gtk3 MPD Client
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Namespaces | Defines | Functions
src/Utils/Utils.hh File Reference
#include <glibmm/ustring.h>
#include <gtkmm/builder.h>
#include <gdkmm/pixbuf.h>
#include "../Log/Writer.hh"
Include dependency graph for Utils.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  Utils
 The namespace provide utility functions.

Defines

#define BUILDER_GET(builder_refp, widget_name, widget_ptr)
#define BUILDER_GET_DERIVED(builder_refp, widget_name, derived_class)
#define BUILDER_GET_NO_MANAGE(builder_refp, widget_name, widget_ptr)
#define BUILDER_ADD(builder_ref, filename)

Functions

Glib::ustring Utils::seconds_to_duration (unsigned long)
 converts a given time in seconds to a duration ustring
Glib::ustring Utils::seconds_to_timestamp (const long)
 converts a given time in seconds to a "timestamp"
std::string Utils::int_to_string (int num)
 Simply converts any integer to a std::string.
void Utils::builder_internal_fetch (Glib::RefPtr< Gtk::Builder > &ref, const char *file)
 Fetches ui definitions either from file or from compiled-in glade xml.
Glib::RefPtr< Gdk::Pixbuf > Utils::create_pixbuf_from_data (const guchar *data, gsize len, int width=150, int height=150, bool aspect=false)
Glib::RefPtr< Gdk::Pixbuf > Utils::pixbuf_internal_fetch (const char *file, int width=150, int height=150, bool aspect=false)

Define Documentation

#define BUILDER_ADD (   builder_ref,
  filename 
)
Value:
g_assert(filename);                                  \
    Utils::builder_internal_fetch(builder_ref,filename); \

Definition at line 57 of file Utils.hh.

#define BUILDER_GET (   builder_refp,
  widget_name,
  widget_ptr 
)
Value:
BUILDER_GET_NO_MANAGE(builder_refp, widget_name, widget_ptr) \
    Gtk::manage(widget_ptr);

Definition at line 42 of file Utils.hh.

#define BUILDER_GET_DERIVED (   builder_refp,
  widget_name,
  derived_class 
)
Value:
derived_class = NULL;                                             \
    builder_refp->get_widget_derived(widget_name,derived_class);      \
    g_assert(derived_class);                                          \
    Gtk::manage(derived_class);                                       \

Definition at line 46 of file Utils.hh.

#define BUILDER_GET_NO_MANAGE (   builder_refp,
  widget_name,
  widget_ptr 
)
Value:
widget_ptr = NULL;                                               \
    builder_refp->get_widget(widget_name,widget_ptr);                \
    g_assert(widget_ptr);                                            \

Definition at line 52 of file Utils.hh.