34 lines
654 B
C++
34 lines
654 B
C++
/*
|
|
* Copyright 2014 (c) Anna Schumaker.
|
|
*/
|
|
#ifndef OCARINA_LIB_LIB_H
|
|
#define OCARINA_LIB_LIB_H
|
|
|
|
#include <string>
|
|
#include <gtkmm.h>
|
|
|
|
namespace lib
|
|
{
|
|
|
|
void init(int *, char ***, const std::string &);
|
|
const std::string share_file(const std::string &);
|
|
Glib::RefPtr<Gtk::Builder> &get_builder();
|
|
|
|
template <class T>
|
|
static inline T *get_widget(const std::string &name)
|
|
{
|
|
T *widget;
|
|
get_builder()->get_widget(name, widget);
|
|
return widget;
|
|
}
|
|
|
|
template <class T>
|
|
static inline Glib::RefPtr<T> get_object(const std::string &name)
|
|
{
|
|
return Glib::RefPtr<T>::cast_static(get_builder()->get_object(name));
|
|
}
|
|
|
|
}
|
|
|
|
#endif /* OCARINA_LIB_LIB_H */
|