#ifndef util_h #define util_h #include #include #include #include "types.h" bool test_gl_support(void); void gl_check_realize(GtkWidget *w, gpointer user_data_ptr); void replace_extension(const char *src, size_t length, char *dest, const char *ext); double clamp_double(double min, double max, double value); double max_double(double a, double b); double min_double(double a, double b); uint32_t convert_color(uint16_t color); uint32_t rgb_encode(GB_gameboy_t *gb, uint8_t r, uint8_t g, uint8_t b); GB_model_t config_get_model_type(GuiData *gui_data); GtkWidget *menubar_to_menu(GtkMenuBar *menubar); gboolean is_separator(GtkTreeModel *model, GtkTreeIter *iter, gpointer data); void set_combo_box_row_separator_func(GtkContainer *container); gboolean scroll_to_bottom(GtkTextView *textview, GtkTextMark *mark); gchar* format_scale_value_pct(GtkScale *scale, gdouble value); gchar* format_scale_color_temperature(GtkScale *scale, gdouble value); #endif