[Commit] cairo-gtk-engine/src Makefile.am, NONE, 1.1 cge-draw.c, NONE, 1.1 cge-style.c, NONE, 1.1 cge-style.h, NONE, 1.1 cge.c, NONE, 1.1 cge.h, NONE, 1.1

Julien Boulnois commit at keithp.com
Fri Aug 1 08:56:22 PDT 2003


Committed by: jboulnois

Update of /local/src/CVS/cairo-gtk-engine/src
In directory home.keithp.com:/tmp/cvs-serv8500/src

Added Files:
	Makefile.am cge-draw.c cge-style.c cge-style.h cge.c cge.h 
Log Message:
initial import


--- NEW FILE: Makefile.am ---
INCLUDES = \
	-DGTK_DISABLE_DEPRECATED \
	-DGDK_DISABLE_DEPRECATED \
	-DG_DISABLE_DEPRECATED \
	$(CGE_CFLAGS)

enginedir = $(libdir)/gtk-2.0/$(GTK_VERSION)/engines
engine_LTLIBRARIES = libcairo-gtk-engine.la

libcairo_gtk_engine_la_SOURCES = \
	cge.c vector.h \
	cge-draw.c \
	cge-style.c cge-style.h

libcairo_gtk_engine_la_LDFLAGS = \
	-avoid-version -no-undefined -module	\
	$(CGE_LIBS)

--- NEW FILE: cge-draw.c ---
/* Cge engine for GTK+ 2.x */

#include "cge.h"


#define DETAIL(xx) ((detail) && (!strcmp(xx, detail)))


static void color_gdk_to_rgb(GdkColor  color,gdouble *r,gdouble *g,gdouble *b);
static GdkColor color_tint_black(GdkColor color,gdouble t); 
/* static GdkColor color_tint_white(GdkColor color,gdouble t); */ 
static void gdk_get_off(GdkDrawable *window,gint* x_off,gint* y_off); 
static void cge_gdk(cairo_t *xrs, GdkDrawable *window); 
static void cge_draw_line(cairo_t *xrs, GdkColor c, gdouble alpha, 
			     double x1, double y1, 
			     double x2, double y2, 
			     gboolean line_width); 

static cairo_surface_t *cge_create_gradient(cairo_t *xrs,
[...2053 lines suppressed...]
  style_class->draw_arrow = draw_arrow;
  style_class->draw_tab = draw_tab;
  style_class->draw_focus = draw_focus;  
  style_class->draw_box = draw_box;
  style_class->draw_flat_box = draw_flat_box;    
  style_class->draw_box_gap = draw_box_gap;
  style_class->draw_extension = draw_extension;
  style_class->draw_slider = draw_slider;  
  style_class->draw_handle = draw_handle;  
  style_class->draw_resize_grip = draw_resize_grip;  
  style_class->draw_shadow_gap = draw_shadow_gap;  
  
  style_class->draw_check = draw_check;
  style_class->draw_option = draw_option;  

  //style_class->draw_polygon = draw_polygon;
  //style_class->draw_diamond = draw_diamond;  
  //style_class->draw_layout = draw_layout;   
  //style_class->set_background=set_background;
}

--- NEW FILE: cge-style.c ---
#include "cge.h"

static void cge_rc_style_init (CgeRCStyle * style);

static void cge_rc_style_class_init (CgeRCStyleClass * klass);

static guint  cge_rc_style_parse (GtkRcStyle *rc_style, 
				     GtkSettings *settings,
				     GScanner *scanner);
static void cge_rc_style_merge (GtkRcStyle * dest, GtkRcStyle * src);
static GtkStyle *cge_rc_style_create_style (GtkRcStyle * rc_style);

static GtkRcStyleClass * parent_class;
GType cge_type_rc_style = 0;


enum
  {
    TOKEN_STYLE= G_TOKEN_LAST + 1,
    TOKEN_DETAIL,
    TOKEN_FILL,
    TOKEN_LINE,
    TOKEN_MODE,


    TOKEN_ROUND_WIDTH,
    TOKEN_LINE_WIDTH,

    TOKEN_GRADIENT_DIRECTION,
    TOKEN_COLOR,


  };

  
static struct
  {
    gchar       *name;
    guint        token;
  }

theme_symbols[] =
{
  { "style",                TOKEN_STYLE },
  { "detail",                TOKEN_DETAIL },
  { "fill",                TOKEN_FILL },
  { "line",                TOKEN_LINE },
  { "mode",                TOKEN_MODE },
  { "round_width",         TOKEN_ROUND_WIDTH },
  { "line_width",          TOKEN_LINE_WIDTH },
  { "gradient_direction",          TOKEN_GRADIENT_DIRECTION },
  { "color",          TOKEN_COLOR },
};

static guint n_theme_symbols = sizeof(theme_symbols) / sizeof(theme_symbols[0]);

static gboolean 
TranslateFillStyleMode (gchar * str, gint *retval)
{
#define is_enum(XX)  (g_ascii_strncasecmp(str, XX, strlen(XX))==0)
  if is_enum("solid")
    *retval = CGE_FILL_SOLID;
  else if (is_enum("gradient"))
    *retval = CGE_FILL_GRADIENT;
  else if (is_enum("file"))
    *retval = CGE_FILL_FILE;
  else
    return FALSE; 
  return TRUE;
}

static gboolean 
TranslateLineStyleMode (gchar * str, gint *retval)
{
#define is_enum(XX)  (g_ascii_strncasecmp(str, XX, strlen(XX))==0)
  if is_enum("solid")
    *retval = CGE_LINE_SOLID;
  else if (is_enum("none"))
    *retval = CGE_LINE_NONE;
  else if (is_enum("dashed"))
    *retval = CGE_LINE_DASHED;
  else if (is_enum("bevel"))
    *retval = CGE_LINE_BEVEL;
  else if (is_enum("file"))
    *retval = CGE_LINE_FILE;
  else
    return FALSE; 
  return TRUE;
}

static gboolean 
TranslateGradientDirection (gchar * str, gint *retval)
{
#define is_enum(XX)  (g_ascii_strncasecmp(str, XX, strlen(XX))==0)
  if is_enum("vertical")
    *retval = CGE_DIRECTION_VERTICAL;
  else if (is_enum("horizontal"))
    *retval = CGE_DIRECTION_HORIZONTAL;
  else
    return FALSE; 
  return TRUE;
}

static guint 
theme_parse_custom_enum (GScanner *scanner, 
                         GTokenType wanted_token, 
			 CgeTranslateEnumFunc translate_enum,
			 guint return_default,
			 cge_fill_mode *retval)
{
  guint token;
   
  token = g_scanner_get_next_token (scanner);
  if (token != wanted_token)
    {
      return wanted_token;
    }

  token = g_scanner_get_next_token (scanner);
  if (token != G_TOKEN_EQUAL_SIGN)
    {
      return G_TOKEN_EQUAL_SIGN;
    }

  token = g_scanner_get_next_token (scanner);

  if (token != G_TOKEN_IDENTIFIER)
    *retval = return_default;
  else 
    if (!translate_enum(scanner->value.v_identifier, (gint *) retval)) *retval = return_default; 

  return G_TOKEN_NONE;
}



static guint 
theme_parse_double(GScanner *scanner, 
                 GTokenType wanted_token, 
		 gdouble return_default, 
		 gdouble *retval, 
		 gdouble lower_limit, 
		 gdouble upper_limit)
{
  guint token;

  token = g_scanner_get_next_token (scanner);
  if (token != wanted_token)
    {
      return wanted_token;
    }

  token = g_scanner_get_next_token (scanner);
  if (token != G_TOKEN_EQUAL_SIGN)
    {
      return G_TOKEN_EQUAL_SIGN;
    }

  token = g_scanner_get_next_token (scanner);

  if (token != G_TOKEN_FLOAT)
    *retval = return_default;
  else
    *retval = scanner->value.v_float;
  
  if (*retval < lower_limit) *retval = lower_limit; 
  if ((*retval > upper_limit) && (upper_limit > lower_limit)) *retval = upper_limit; 
  
  return G_TOKEN_NONE;
}

static guint 
theme_parse_char(GScanner *scanner, 
                 GTokenType wanted_token, 
		 gchar **retval)

{
  guint token;

  token = g_scanner_get_next_token (scanner);
  if (token != wanted_token)
    {
      return wanted_token;
    }

  token = g_scanner_get_next_token (scanner);
  if (token != G_TOKEN_EQUAL_SIGN)
    {
      return G_TOKEN_EQUAL_SIGN;
    }

  token = g_scanner_get_next_token (scanner);

  //printf("detail : %s\n\n",scanner->value.v_string);
  *retval = g_strdup(scanner->value.v_string);
  
  
  return G_TOKEN_NONE;
}

static guint theme_parse_fill (GtkSettings  *settings, GScanner *scanner, GTokenType wanted_token, cge_fill_style *retval)
{
  guint token;
  GdkColor color[5];
  gint colors_count[5]={0,0,0,0,0};
  gint i;

  token = g_scanner_get_next_token (scanner);
  if (token != wanted_token)
    {
      return wanted_token;
    }

  token = g_scanner_get_next_token (scanner);
  if (token != G_TOKEN_LEFT_CURLY)
    return G_TOKEN_LEFT_CURLY;

  token = g_scanner_peek_next_token (scanner);
  while (token != G_TOKEN_RIGHT_CURLY) {
    switch (token) {
    case TOKEN_MODE:
      token = theme_parse_custom_enum(scanner, TOKEN_MODE, TranslateFillStyleMode, CGE_FILL_SOLID,  &retval->fill_mode);
      break;
    case TOKEN_GRADIENT_DIRECTION:
      token = theme_parse_custom_enum(scanner, TOKEN_GRADIENT_DIRECTION, TranslateGradientDirection, CGE_DIRECTION_VERTICAL,  &retval->gradient_direction);
    case TOKEN_COLOR:
      {
	GtkStateType state;
      
	token = g_scanner_get_next_token (scanner);
	if (token != TOKEN_COLOR)
	  return TOKEN_COLOR;
	
	token = gtk_rc_parse_state (scanner, &state);
	if (token != G_TOKEN_NONE)
	  return token;
      
	token = g_scanner_get_next_token (scanner);
	if (token != G_TOKEN_EQUAL_SIGN)
	  return G_TOKEN_EQUAL_SIGN;
      
	token = gtk_rc_parse_color (scanner, &color[state]);
	
	retval->gradient_colors[state][colors_count[state]]=color[state];
	colors_count[state]++;
      }
      break;
      
    case TOKEN_ROUND_WIDTH:      
      token = theme_parse_double (scanner, TOKEN_ROUND_WIDTH, 4.0, &retval->round_width, 0.0, 10.0);
      break;
      
    default:
      g_scanner_get_next_token (scanner);
      token = G_TOKEN_RIGHT_CURLY;
      break;
    }

    token = g_scanner_peek_next_token (scanner);
  }

  g_scanner_get_next_token (scanner);
  token = G_TOKEN_NONE;

  for(i=0;i<5;i++)
    {
      if (colors_count[i]>0) 
	{
	  retval->gradient_colors_count[i]=colors_count[i];
	  retval->gradient_colors_default[i]=FALSE;
	  
	}
    }
  return token;
}

static guint theme_parse_line (GtkSettings  *settings, GScanner *scanner, GTokenType wanted_token, cge_line_style *retval)
{
  guint token;

  token = g_scanner_get_next_token (scanner);
  if (token != wanted_token)
    {
      return wanted_token;
    }

  token = g_scanner_get_next_token (scanner);
  if (token != G_TOKEN_LEFT_CURLY)
    return G_TOKEN_LEFT_CURLY;

  token = g_scanner_peek_next_token (scanner);
  while (token != G_TOKEN_RIGHT_CURLY) {
    switch (token) {
    case TOKEN_MODE:
      token = theme_parse_custom_enum(scanner, TOKEN_MODE, TranslateLineStyleMode, CGE_LINE_SOLID,  &retval->line_mode);
      break;
    case TOKEN_LINE_WIDTH:
      token = theme_parse_double (scanner, TOKEN_LINE_WIDTH, 1.0, &retval->line_width, 0.0, 10.0);
      break;
    case TOKEN_COLOR:
      {
	GtkStateType state;
      
	token = g_scanner_get_next_token (scanner);
	if (token != TOKEN_COLOR)
	  return TOKEN_COLOR;
	
	token = gtk_rc_parse_state (scanner, &state);
	if (token != G_TOKEN_NONE)
	  return token;
      
	token = g_scanner_get_next_token (scanner);
	if (token != G_TOKEN_EQUAL_SIGN)
	  return G_TOKEN_EQUAL_SIGN;
      
	token = gtk_rc_parse_color (scanner, &retval->color[state]);
	retval->color_default[state]=FALSE;
      }
      break;
    case TOKEN_ROUND_WIDTH:      
      token = theme_parse_double (scanner, TOKEN_ROUND_WIDTH, 4.0, &retval->round_width, 0.0, 10.0);
      break;
      
    default:
      g_scanner_get_next_token (scanner);
      token = G_TOKEN_RIGHT_CURLY;
      break;
    }

    token = g_scanner_peek_next_token (scanner);
  }

  g_scanner_get_next_token (scanner);
  token = G_TOKEN_NONE;

  return token;
}


static guint theme_parse_style (GtkSettings  *settings, GScanner *scanner, GTokenType wanted_token, cge_style *retval)
{
  guint token;

  token = g_scanner_get_next_token (scanner);
  if (token != wanted_token)
    {
      return wanted_token;
    }

  token = g_scanner_get_next_token (scanner);
  if (token != G_TOKEN_LEFT_CURLY)
    return G_TOKEN_LEFT_CURLY;

  token = g_scanner_peek_next_token (scanner);
  while (token != G_TOKEN_RIGHT_CURLY) {
    switch (token) {
    case TOKEN_DETAIL:
      token = theme_parse_char(scanner, TOKEN_DETAIL, &retval->detail);
      break;
    case TOKEN_FILL :
      token = theme_parse_fill (settings, scanner, TOKEN_FILL, &retval->fill_style);
      break;
    case TOKEN_LINE:
      token = theme_parse_line (settings, scanner, TOKEN_LINE, &retval->line_style);      
      break;
    default:
      g_scanner_get_next_token (scanner);
      token = G_TOKEN_RIGHT_CURLY;
      break;
    }

    token = g_scanner_peek_next_token (scanner);
  }

  g_scanner_get_next_token (scanner);
  token = G_TOKEN_NONE;

  return token;
}


void cge_rc_style_register_type (GTypeModule * module) {

  static const GTypeInfo object_info = {
    sizeof (CgeRCStyleClass),
    (GBaseInitFunc) NULL,
    (GBaseFinalizeFunc) NULL,
    (GClassInitFunc) cge_rc_style_class_init,
    NULL,
    NULL,
    sizeof (CgeRCStyle),
    0,
    (GInstanceInitFunc) cge_rc_style_init,

  };

  cge_type_rc_style = g_type_module_register_type (module,
							GTK_TYPE_RC_STYLE,
							"CgeRCStyle",
							&object_info, 0);
}


static void cge_rc_init_fill_style(cge_fill_style* fill_style)
{
  gint i;
  fill_style->fill_mode=CGE_FILL_SOLID;
  fill_style->round_width=4;
  fill_style->gradient_direction=CGE_DIRECTION_VERTICAL;

  for(i=0;i<5;i++)
    { 
      fill_style->gradient_colors_count[i]=2;
      fill_style->gradient_colors_default[i]=TRUE;
    }
}

static void cge_rc_init_line_style(cge_line_style* line_style)
{
  gint i;
  for(i=0;i<5;i++)
    {
     line_style->color_default[i]=TRUE;
    }
  line_style->line_mode=CGE_LINE_SOLID;
  line_style->line_width=1;
  line_style->round_width=4;
}

static void cge_rc_style_init (CgeRCStyle * style) {
  gint i;

  for(i=0;i<MAX_STYLES;i++)
    {
      style->styles[i].detail=NULL;
      cge_rc_init_fill_style(&style->styles[i].fill_style);
      cge_rc_init_line_style(&style->styles[i].line_style);
    }
  
  /*  style->fill_style.fill_mode=CGE_FILL_SOLID;
  style->fill_style.round_width=4;
  style->fill_style.gradient_direction=CGE_DIRECTION_VERTICAL;

  for(i=0;i<5;i++)
    {
      //style->fill_style.gradient_colors[i]=g_array_new (FALSE, FALSE, sizeof (GdkColor));;
      style->fill_style.gradient_colors_count[i]=2;
      style->fill_style.gradient_colors_default[i]=TRUE;
      style->line_style.color_default[i]=TRUE;
    }
  style->line_style.line_mode=CGE_LINE_SOLID;
  style->line_style.line_width=1;
  style->line_style.round_width=4;
  */

}

static void cge_rc_style_class_init (CgeRCStyleClass * klass) {
  GtkRcStyleClass * rc_style_class = GTK_RC_STYLE_CLASS (klass);

  parent_class = g_type_class_peek_parent (klass);

  rc_style_class->parse        = cge_rc_style_parse;
  rc_style_class->merge = cge_rc_style_merge;
  rc_style_class->create_style = cge_rc_style_create_style;
}


static guint  cge_rc_style_parse (GtkRcStyle *rc_style, 
				     GtkSettings *settings,
				     GScanner *scanner)
{

  static GQuark scope_id = 0;
  CgeRCStyle *cge_style = NEW_THEME_DATA(rc_style);
  
  guint old_scope;
  guint token;
  guint i;
  gint styles_count=1;

  /* Set up a new scope in this scanner */
  if (!scope_id)
    {
      scope_id = g_quark_from_string ("cge_theme_engine");
    }

  /* If we bail out due to errors, we don't reset the scope, so the
   * error messaging code can make sense of our tokens. */
  old_scope = g_scanner_set_scope (scanner, scope_id);

 /* Check if we already added our symbols to this scope */
  if (!g_scanner_lookup_symbol (scanner, theme_symbols[0].name))
    {
      for (i = 0; i < n_theme_symbols; i++)
	{
	  g_scanner_scope_add_symbol (scanner, scope_id, theme_symbols[i].name, 
				      GINT_TO_POINTER (theme_symbols[i].token));
	}
    }

   /* Read to go, now parse the top level */
  token = g_scanner_peek_next_token (scanner);
  while (token != G_TOKEN_RIGHT_CURLY)
    {
      switch (token)
	{
	case TOKEN_STYLE :
	  token = theme_parse_style (settings, scanner, TOKEN_STYLE, &cge_style->styles[styles_count]);
	  styles_count++;
    	  break;
	case TOKEN_FILL :
	  token = theme_parse_fill (settings, scanner, TOKEN_FILL, &cge_style->styles[0].fill_style);
	  break;
	case TOKEN_LINE:
	  token = theme_parse_line (settings, scanner, TOKEN_LINE, &cge_style->styles[0].line_style);      
	  break;
	default:
	  g_scanner_get_next_token (scanner);
	  token = G_TOKEN_RIGHT_CURLY;
	  break;
	}

      if (token != G_TOKEN_NONE)
	{
          g_free (cge_style);
	  return token;
	}

      token = g_scanner_peek_next_token (scanner);
    }

  g_scanner_get_next_token(scanner);



  SET_THEME_DATA(rc_style, cge_style);

  g_scanner_set_scope (scanner, old_scope);

  

  
  return G_TOKEN_NONE;
}


static void cge_rc_style_merge (GtkRcStyle * dest, GtkRcStyle * src) {
  gint i;
  parent_class->merge (dest, src);


  if (CGE_IS_RC_STYLE (src)) 
    {     
      CgeRCStyle *src_data = CGE_RC_DATA (src);
      CgeRCStyle *dest_data = CGE_RC_DATA (dest);

      for(i=0;i<MAX_STYLES;i++)
	{
	  dest_data->styles[i]=src_data->styles[i];
	}

      SET_THEME_DATA(dest, dest_data);

    }

}

static GtkStyle * cge_rc_style_create_style (GtkRcStyle * rc_style) {
  void * ptr;


  ptr = g_object_new (CGE_TYPE_STYLE, NULL);
  return (GtkStyle *) ptr;
}

--- NEW FILE: cge-style.h ---
#ifndef _CGE_STYLE_H_
#define _CGE_STYLE_H_

typedef struct _cge_style cge_style;
typedef struct _cge_fill_style cge_fill_style;
typedef struct _cge_line_style cge_line_style;


typedef struct _CgeStyle CgeStyle;
typedef struct _CgeStyleClass CgeStyleClass;
typedef struct _CgeRCStyle CgeRCStyle;
typedef struct _CgeRCStyleClass CgeRCStyleClass;

extern GType cge_type_style;
extern GType cge_type_rc_style;

#define CGE_TYPE_STYLE              cge_type_style
#define CGE_STYLE(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), CGE_TYPE_STYLE, CgeStyle))
#define CGE_STYLE_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), CGE_TYPE_STYLE, CgeStyleClass))
#define CGE_IS_STYLE(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), CGE_TYPE_STYLE))
#define CGE_IS_STYLE_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), CGE_TYPE_STYLE))
#define CGE_STYLE_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), CGE_TYPE_STYLE, CgeStyleClass))
#define CGE_TYPE_RC_STYLE              cge_type_rc_style
#define CGE_RC_STYLE(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), CGE_TYPE_RC_STYLE, CgeRCStyle))
#define CGE_RC_STYLE_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), CGE_TYPE_RC_STYLE, CgeRCStyleClass))
#define CGE_IS_RC_STYLE(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), CGE_TYPE_RC_STYLE))
#define CGE_IS_RC_STYLE_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), CGE_TYPE_RC_STYLE))
#define CGE_RC_STYLE_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), CGE_TYPE_RC_STYLE, CgeRCStyleClass))

#define CGE_RC_DATA(rc_style)          (CGE_RC_STYLE (rc_style))

#define THEME_DATA(style)                 (CGE_RC_STYLE (style->rc_style))
#define NEW_THEME_DATA(rc_style)          (CGE_RC_STYLE (rc_style))
#define SET_THEME_DATA(rc_style, data)    (CGE_RC_DATA (rc_style))


typedef gboolean (*CgeTranslateEnumFunc) (gchar * str, gint *retval);

#define CGE_TYPE_COUNT 6

typedef enum 
  {
    CGE_FILL_SOLID=0,
    CGE_FILL_GRADIENT,    
    CGE_FILL_FILE    
  }cge_fill_mode;

typedef enum 
  {
    CGE_LINE_SOLID=0,
    CGE_LINE_NONE,
    CGE_LINE_DASHED,
    CGE_LINE_BEVEL,
    CGE_LINE_FILE
  }cge_line_mode;


typedef enum
  {
    CGE_DIRECTION_VERTICAL=0,
    CGE_DIRECTION_HORIZONTAL    
  }cge_direction;



#define MAX_GRADIENT_COLORS 10
#define MAX_STYLES 10



struct _cge_fill_style
{
  cge_fill_mode fill_mode;
  
  cge_direction gradient_direction;
  gint gradient_colors_count[5];
  gboolean gradient_colors_default[5];
  GdkColor gradient_colors[5][MAX_GRADIENT_COLORS];
  gdouble round_width;
};

struct _cge_line_style
{
  cge_line_mode line_mode;

  gdouble line_width;
  gdouble round_width;

  gboolean color_default[5];
  GdkColor color[5];
};

struct _cge_style
{
  gchar *detail;

  cge_fill_style fill_style;
  cge_line_style line_style;
};



struct _CgeStyle {
  GtkStyle parent_instance;

};

struct _CgeStyleClass {
  GtkStyleClass parent_class;
};

struct _CgeRCStyle {
  GtkRcStyle parent_instance;

  cge_style styles[MAX_STYLES];

};

struct _CgeRCStyleClass {
  GtkRcStyleClass parent_class;
};

void cge_style_register_type (GTypeModule * module);
void cge_rc_style_register_type (GTypeModule * module);

#endif

--- NEW FILE: cge.c ---
#include <gmodule.h>

#include "cge.h"


G_MODULE_EXPORT void theme_init (GTypeModule * module);

G_MODULE_EXPORT void theme_exit (GTypeModule * module);

G_MODULE_EXPORT GtkRcStyle * theme_create_rc_style (void); 



G_MODULE_EXPORT void theme_init (GTypeModule * module) {
  cge_rc_style_register_type (module);
  cge_style_register_type (module);
}

G_MODULE_EXPORT void theme_exit (GTypeModule * module) {
}

G_MODULE_EXPORT GtkRcStyle * theme_create_rc_style (void) {
  void *ptr;

  ptr = GTK_RC_STYLE (g_object_new (CGE_TYPE_RC_STYLE, NULL));
  return (GtkRcStyle *) ptr;
}

/* The following function will be called by GTK+ when the module
 * is loaded and checks to see if we are compatible with the
 * version of GTK+ that loads us.
 */
#if 0
G_MODULE_EXPORT const gchar * g_module_check_init (GModule * module);

const gchar * g_module_check_init (GModule * module) {
  return gtk_check_version (GTK_MAJOR_VERSION, GTK_MINOR_VERSION,
			    GTK_MICRO_VERSION - GTK_INTERFACE_AGE);
}
#endif

--- NEW FILE: cge.h ---
#ifndef _CGE_H_
#define _CGE_H_

#include <math.h>
#include <string.h>

#include <gtk/gtk.h>
#include <gdk/gdkx.h>
#include <cairo.h>



#include "cge-style.h"

#endif




More information about the Commit mailing list