Back to index

gcompris  8.2.2
Defines | Functions | Variables
skin.h File Reference
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "gcompris.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define gc_skin_get_gdkcolor(id, gdkcolor)   gc_skin_get_gdkcolor_default(id, 0x0D0DFA00, gdkcolor)
#define gc_skin_get_color(id)   gc_skin_get_color_default(id, 0x0D0DFA00)
#define gc_skin_get_font(id)   gc_skin_get_font_default(id, "Sans 12")
#define gc_skin_get_number(id)   gc_skin_get_number_default(id, 0)

Functions

gchar * gc_skin_image_get (gchar *imagename)
GdkPixbuf * gc_skin_pixmap_load (char *pixmapfile)
void gc_skin_load (gchar *skin)
void gc_skin_free (void)
guint32 gc_skin_get_color_default (gchar *id, guint32 def)
void gc_skin_get_gdkcolor_default (gchar *id, guint32 def, GdkColor *gdkcolor)
gchar * gc_skin_get_font_default (gchar *id, gchar *def)
guint32 gc_skin_get_number_default (gchar *id, guint32 def)

Variables

guint32 gc_skin_color_title
guint32 gc_skin_color_text_button
guint32 gc_skin_color_content
guint32 gc_skin_color_subtitle
guint32 gc_skin_color_shadow
gchar * gc_skin_font_title
gchar * gc_skin_font_subtitle
gchar * gc_skin_font_content
gchar * gc_skin_font_board_tiny
gchar * gc_skin_font_board_small
gchar * gc_skin_font_board_medium
gchar * gc_skin_font_board_big
gchar * gc_skin_font_board_big_bold
gchar * gc_skin_font_board_fixed
gchar * gc_skin_font_board_title
gchar * gc_skin_font_board_title_bold
gchar * gc_skin_font_board_huge
gchar * gc_skin_font_board_huge_bold

Define Documentation

#define gc_skin_get_color (   id)    gc_skin_get_color_default(id, 0x0D0DFA00)

Definition at line 60 of file skin.h.

#define gc_skin_get_font (   id)    gc_skin_get_font_default(id, "Sans 12")

Definition at line 61 of file skin.h.

#define gc_skin_get_gdkcolor (   id,
  gdkcolor 
)    gc_skin_get_gdkcolor_default(id, 0x0D0DFA00, gdkcolor)

Definition at line 59 of file skin.h.

#define gc_skin_get_number (   id)    gc_skin_get_number_default(id, 0)

Definition at line 62 of file skin.h.


Function Documentation

void gc_skin_free ( void  )

Definition at line 378 of file skin.c.

{
  if(gc_skin_fonts!=NULL)
    g_hash_table_destroy(gc_skin_fonts);

  if(gc_skin_colors!=NULL)
    g_hash_table_destroy(gc_skin_colors);

  if(gc_skin_numbers!= NULL)
      g_hash_table_destroy(gc_skin_numbers);
}

Here is the caller graph for this function:

guint32 gc_skin_get_color_default ( gchar *  id,
guint32  def 
)

Definition at line 394 of file skin.c.

{
  gpointer result;
  result = g_hash_table_lookup(gc_skin_colors, (gpointer)id);
  if(result!=NULL)
    return GPOINTER_TO_UINT(result);
  return def;
}

Here is the caller graph for this function:

gchar* gc_skin_get_font_default ( gchar *  id,
gchar *  def 
)

Definition at line 425 of file skin.c.

{
  gpointer result;
  result = g_hash_table_lookup(gc_skin_fonts, (gpointer)id);
  if(result!=NULL)
    return (gchar*)result;
  return def;
}

Here is the caller graph for this function:

void gc_skin_get_gdkcolor_default ( gchar *  id,
guint32  def,
GdkColor *  gdkcolor 
)

Definition at line 409 of file skin.c.

{
  gchar *tmp;
  guint32 color;

  color = gc_skin_get_color_default(id, def);

  tmp = g_strdup_printf("#%06X", gc_skin_get_color(id) >> 8);
  gdk_color_parse(tmp, gdkcolor);
  g_free(tmp);
}

Here is the call graph for this function:

guint32 gc_skin_get_number_default ( gchar *  id,
guint32  def 
)

Definition at line 438 of file skin.c.

{
  gpointer result;
  result = g_hash_table_lookup(gc_skin_numbers, (gpointer)id);
  if(result!=NULL)
    return GPOINTER_TO_UINT(result);
  return def;
}

Here is the caller graph for this function:

gchar* gc_skin_image_get ( gchar *  imagename)

Definition at line 60 of file skin.c.

{
  GcomprisProperties *properties = gc_prop_get();
  gchar *filename;

  /* First, test if pixmapfile is in the current skin dir */
  filename = g_strdup_printf("%s/skins/%s/%s",
                          properties->package_data_dir,
                          properties->skin, pixmapfile);

  if (g_file_test ((filename), G_FILE_TEST_EXISTS)) {
    g_free(filename);

    filename = g_strdup_printf("skins/%s/%s", properties->skin, pixmapfile);

    return(filename);
  }
  g_free(filename);

  /* Check it's on the server */
  filename = gc_net_get_url_from_file("boards/skins/%s/%s", properties->skin, pixmapfile);
  if(filename)
    return(filename);

  /* Return the default skin dir */
  filename = g_strdup_printf("skins/%s/%s", DEFAULT_SKIN, pixmapfile);
  return(filename);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void gc_skin_load ( gchar *  skin)

Definition at line 350 of file skin.c.

{

  if(skin==NULL)
    return;

  gc_skin_free();

  gc_skin_fonts = g_hash_table_new_full(g_str_hash, g_str_equal,
                                         gc_skin_free_string,
                                         gc_skin_free_string);
  gc_skin_colors = g_hash_table_new_full(g_str_hash, g_str_equal,
                                         gc_skin_free_string,
                                         NULL);
  gc_skin_numbers = g_hash_table_new_full(g_str_hash, g_str_equal,
                                         gc_skin_free_string,
                                         NULL);
  skin_xml_load(DEFAULT_SKIN);
  if(strcmp(skin,DEFAULT_SKIN)!=0)
    skin_xml_load(skin);

  gc_skin_setup_vars();
}

Here is the call graph for this function:

Here is the caller graph for this function:

GdkPixbuf* gc_skin_pixmap_load ( char *  pixmapfile)

Definition at line 95 of file skin.c.

{
  gchar *filename;
  GdkPixbuf *result_pixbuf;

  filename = gc_skin_image_get(pixmapfile);

  result_pixbuf = gc_pixmap_load (filename);

  g_free(filename);

  return (result_pixbuf);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 32 of file skin.c.

Definition at line 34 of file skin.c.

Definition at line 33 of file skin.c.

Definition at line 31 of file skin.c.

Definition at line 30 of file skin.c.

Definition at line 43 of file skin.c.

Definition at line 44 of file skin.c.

Definition at line 45 of file skin.c.

Definition at line 48 of file skin.c.

Definition at line 49 of file skin.c.

Definition at line 42 of file skin.c.

Definition at line 41 of file skin.c.

Definition at line 40 of file skin.c.

Definition at line 46 of file skin.c.

Definition at line 47 of file skin.c.

Definition at line 38 of file skin.c.

Definition at line 37 of file skin.c.

Definition at line 36 of file skin.c.