/ src / gpredict-utils.h
gpredict-utils.h
 1  #ifndef GPREDICT_UTILS_H
 2  #define GPREDICT_UTILS_H 1
 3  
 4  #include <gtk/gtk.h>
 5  
 6  #define M_TO_FT(x) (3.2808399*x)
 7  #define FT_TO_M(x) (x/3.2808399)
 8  #define KM_TO_MI(x) (x/1.609344)
 9  #define MI_TO_KM(x) (1.609344*x)
10  
11  #ifndef M_PI
12  #define M_PI 3.14159265358979323846264338327
13  #endif
14  
15  
16  GtkWidget      *gpredict_hpixmap_button(const gchar * file,
17                                          const gchar * text,
18                                          const gchar * tooltip);
19  
20  GtkWidget      *gpredict_vpixmap_button(const gchar * file,
21                                          const gchar * text,
22                                          const gchar * tooltip);
23  
24  GtkWidget      *gpredict_hstock_button(const gchar * stock_id,
25                                         const gchar * text,
26                                         const gchar * tooltip);
27  
28  GtkWidget      *gpredict_mini_mod_button(const gchar * pixmapfile,
29                                           const gchar * tooltip);
30  
31  void            gpredict_set_combo_tooltips(GtkWidget * combo, gpointer text);
32  
33  gint            gpredict_file_copy(const gchar * in, const gchar * out);
34  
35  void            rgba_from_cfg(guint cfg_rgba, GdkRGBA * gdk_rgba);
36  guint           rgba_to_cfg(const GdkRGBA * gdk_rgba);
37  void            rgb_from_cfg(guint cfg_rgb, GdkRGBA * gdk_rgba);
38  guint           rgb_to_cfg(const GdkRGBA * gdk_rgba);
39  
40  void            rgb2gdk(guint rgb, GdkColor * color);
41  void            rgba2gdk(guint rgba, GdkColor * color, guint16 * alpha);
42  void            gdk2rgb(const GdkColor * color, guint * rgb);
43  void            gdk2rgba(const GdkColor * color, guint16 alpha, guint * rgba);
44  gchar          *rgba2html(guint rgba);
45  int             gpredict_strcmp(const char *s1, const char *s2);
46  char           *gpredict_strcasestr(const char *s1, const char *s2);
47  gboolean        gpredict_save_key_file(GKeyFile * cfgdata,
48                                         const char *filename);
49  gboolean        gpredict_legal_char(int ch);
50  #endif