Commit 46f7d09e authored by Bruno Coudoin's avatar Bruno Coudoin

removed libccc, it's not used yet and there are many problems too many problems

to solve first

svn path=/branches/gcomprixo/; revision=2821
parent e6265fcf
......@@ -518,14 +518,6 @@ fi
AC_SUBST(CFLAGS)
AC_SUBST(LIBS)
dnl libccc package dependencies
PKG_CHECK_MODULES(CCC,[
glib-2.0 >= 2.10.0
gtk+-2.0 >= 2.8.0
])
dnl disable activation code
AC_ARG_ENABLE(activation-code,
AC_HELP_STRING(
......@@ -663,9 +655,6 @@ src/imagename-activity/activity/Makefile
src/leftright-activity/Makefile
src/leftright-activity/activity/Makefile
src/libart_lgpl/Makefile
src/libccc/Makefile
src/libccc/ccc/Makefile
src/libccc/python/Makefile
src/libgnomecanvas/Makefile
src/magic_hat_minus-activity/Makefile
src/magic_hat_minus-activity/activity/Makefile
......
## Process this file with automake to produce Makefile.in
SUBDIRS = libart_lgpl libgnomecanvas libccc gcompris boards \
SUBDIRS = libart_lgpl libgnomecanvas gcompris boards \
advanced_colors-activity \
algebra_by-activity \
algebra_guesscount-activity \
......
......@@ -56,8 +56,7 @@ INCLUDES = \
$(sqlite_cflags) \
$(GNET_CFLAGS) \
$(cairo_cflags) \
$(NSBUNDLE_CPPFLAGS) \
-I$(top_srcdir)/src/libccc/
$(NSBUNDLE_CPPFLAGS)
gcompris_SOURCES = \
$(cairo_c) \
......@@ -123,8 +122,7 @@ gcompris_SOURCES = \
gcompris_LDFLAGS = \
-export-dynamic $(cairo_ldflags) \
$(top_builddir)/src/libgnomecanvas/libgnomecanvas-2.a \
$(top_builddir)/src/libart_lgpl/libart_lgpl_2.a \
$(top_builddir)/src/libccc/ccc/.libs/libccc-0.1.a
$(top_builddir)/src/libart_lgpl/libart_lgpl_2.a
gcompris_LDADD = \
......
......@@ -40,8 +40,6 @@
#include "gcompris-nsbundle.h"
#endif
#include <ccc/ccc.h>
/* get the default database name */
#define DEFAULT_DATABASE "gcompris_sqlite.db"
......@@ -57,9 +55,6 @@ static GnomeCanvas *canvas;
static GnomeCanvas *canvas_bar;
static GtkWidget *fixed;
static GtkWidget *drawing_area;
#if 0
static GtkWidget* cccanvas_root;
#endif
gchar * exec_prefix = NULL;
//static gint pause_board_cb (GtkWidget *widget, gpointer data);
......@@ -245,94 +240,6 @@ static GOptionEntry options[] = {
{ NULL }
};
/****************************************************************************/
#define N_POINTS 12
#define RADIUS 100.0
#define STEP 0.02
#define X(radius, angle) ((radius)*RADIUS*cos(M_PI*((double) angle)/N_POINTS))
#define Y(radius, angle) ((radius)*RADIUS*sin(M_PI*((double) angle)/N_POINTS))
static void
update_bounds(CcItem* moving_line, CcView* view, CcDRect* bounds, CcRectangle* rect) {
if(!bounds) {
return;
}
cc_rectangle_set_position(rect,
bounds->x1, bounds->y1,
bounds->x2 - bounds->x1,
bounds->y2 - bounds->y1);
}
static gboolean
enter_callback(CcShape* shape, CcView* view, GdkEventCrossing* ev) {
CcColor* color = cc_color_new_rgb(1.0, 0.0, 0.0);
cc_shape_set_brush_border(shape, CC_BRUSH(color));
return TRUE;
}
static gboolean
leave_callback(CcShape* shape, CcView* view, GdkEventCrossing* ev) {
CcColor* color = cc_color_new_rgb(0.0, 0.0, 1.0);
cc_shape_set_brush_border(shape, CC_BRUSH(color));
return FALSE;
}
static int ccindex = 1;
static CcItem *rounded_line = NULL;
static gboolean
timer_callback(gpointer data)
{
int i;
float angle = ccindex*STEP;
for (i=0; i < N_POINTS; i++)
cc_line_data_set_position(CC_LINE(rounded_line), 2*i+1, X(1.5 + cos(M_PI*((double) angle)/N_POINTS), 2*i + 1 + angle), Y(1.5 + cos(M_PI*((double) angle)/N_POINTS), 2*i + 1 + angle));
ccindex = (ccindex+1) % ((int) (2*N_POINTS*1/STEP));
return TRUE;
}
GtkWidget*
test_ccc()
{
GtkWidget* cccanvas_root;
CcItem* item = cc_item_new();
rounded_line = cc_line_new();
CcItem* rect = cc_rectangle_new();
CcItem* text = cc_text_new("GCompris Rulez");
g_signal_connect(G_OBJECT(rounded_line), "all-bounds-changed",
G_CALLBACK(update_bounds), rect);
cc_line_move(CC_LINE(rounded_line), X(1, 0), Y(1, 0));
int i;
for (i=0; i < N_POINTS; i++) {
cc_line_line(CC_LINE(rounded_line), X(0.5, 2*i + 1), Y(0.5, 2*i + 1));
cc_line_line(CC_LINE(rounded_line), X(1, 2*i+2), Y(1, 2*i+2));
}
cc_shape_set_brush_border(CC_SHAPE(rect), CC_BRUSH(cc_color_new_rgb(1.0, 0.0, 0.0)));
cc_shape_set_brush_border(CC_SHAPE(rounded_line), CC_BRUSH(cc_color_new_rgb(0.0, 0.0, 1.0)));
cc_item_append(item, rect);
cc_item_append(item, rounded_line);
cc_item_append(item, text);
g_signal_connect(rounded_line, "enter-notify-event",
G_CALLBACK(enter_callback), NULL);
g_signal_connect(rounded_line, "leave-notify-event",
G_CALLBACK(leave_callback), NULL);
g_timeout_add (10, (GSourceFunc) timer_callback, NULL);
cccanvas_root = cc_view_widget_new_root(item);
cc_view_set_zoom(CC_VIEW(cccanvas_root), 1.0);
return cccanvas_root;
}
/* Remove any dialog box */
static void gc_close_all_dialog() {
gc_dialog_close();
......@@ -381,14 +288,6 @@ _gc_configure_event_callback (GtkWidget *widget,
(screen_width-BOARDWIDTH*zoom_factor)/2,
(screen_height-(BOARDHEIGHT+BARHEIGHT)*zoom_factor)/2 + BOARDHEIGHT*zoom_factor);
#if 0
gtk_widget_set_usize (GTK_WIDGET(cccanvas_root),
BOARDWIDTH*zoom_factor,
BOARDHEIGHT*zoom_factor);
cc_view_set_zoom(CC_VIEW(cccanvas_root),
zoom_factor);
#endif
_expose_background_callback (drawing_area, NULL, NULL);
return FALSE;
......@@ -663,12 +562,6 @@ init_background()
0, 0,
BOARDWIDTH,
BARHEIGHT);
#if 0
cccanvas_root = test_ccc();
gtk_widget_show(GTK_WIDGET(cccanvas_root));
gtk_fixed_put (GTK_FIXED(fixed), GTK_WIDGET(cccanvas_root), 0, 0);
gtk_widget_set_usize (GTK_WIDGET(cccanvas_root), BOARDWIDTH, BOARDHEIGHT);
#endif
}
static void setup_window ()
......
## Process this file with automake to produce Makefile.in
SUBDIRS = ccc python
NULL=
noinst_LTLIBRARIES=libccc-0.1.la
main_HEADERS=\
ccc.h \
$(NULL)
maindir=$(includedir)/ccc-$(MILESTONE)
static_headers=\
cdebug.h \
cc-brush.h \
cc-brush-color.h \
cc-cairo.h \
cc-camera.h \
cc-color.h \
cc-color-rgb.c \
cc-caret.h \
cc-circle.h \
cc-d-rect.h \
cc-gradient.h \
cc-hash-map.h \
cc-item.h \
cc-item-view.h \
cc-line.h \
cc-linear-gradient.h \
cc-pixbuf.h \
cc-printer.h \
cc-radial-gradient.h \
cc-rectangle.h \
cc-rounded-rectangle.h \
cc-shape.h \
cc-simple-item.h \
cc-text.h \
cc-unit.h \
cc-utils.h \
cc-view.h \
cc-view-cell-renderer.h \
cc-view-png.h \
cc-view-widget.h \
$(NULL)
built_headers=\
cc-enumerations.h \
$(NULL)
ccc_HEADERS=\
$(static_headers) \
$(built_headers) \
$(NULL)
cccdir=$(maindir)/ccc
BUILT_SOURCES=\
cc-enumerations.c \
$(built_headers) \
cc-marshallers.c \
cc-marshallers.h \
$(NULL)
libccc_0_1_la_SOURCES=\
$(ccc_HEADERS) \
$(BUILT_SOURCES) \
cdebug.c \
cc-brush.c \
cc-brush-color.c \
cc-cairo.c \
cc-camera.c \
cc-caret.c \
cc-color.c \
cc-color-hsv.c \
cc-circle.c \
cc-d-rect.c \
cc-gradient.c \
cc-hash-map.c \
cc-item.c \
cc-item-view.c \
cc-line.c \
cc-linear-gradient.c \
cc-pixbuf.c \
cc-printer.c \
cc-radial-gradient.c \
cc-rectangle.c \
cc-rounded-rectangle.c \
cc-shape.c \
cc-simple-item.c \
cc-text.c \
cc-unit.c \
cc-utils.c \
cc-view.c \
cc-view-cell-renderer.c \
cc-view-png.c \
cc-view-widget.c \
glib-helpers.h \
glib-helpers.c \
gobject-helpers.h \
pango-helpers.h \
pango-helpers.c \
$(NULL)
libccc_0_1_la_LIBADD=\
$(CCC_LIBS) \
$(NULL)
cc-marshallers.h: $(srcdir)/marshallers.list $(srcdir)/Makefile
@( $(GLIB_GENMARSHAL) --header --prefix=cc_marshal $< ) > xgen-cmh \
&& (cmp -s xgen-cmh $@ || (echo "Creating $@..."; cp xgen-cmh $@) ) \
&& rm -f xgen-cmh
cc-marshallers.c: $(srcdir)/marshallers.list $(srcdir)/Makefile
@( echo "#include <ccc/cc-marshallers.h>"; \
$(GLIB_GENMARSHAL) --body --prefix=cc_marshal $< ) > xgen-cmc \
&& (cmp -s xgen-cmc $@ || (echo "Creating $@..."; cp xgen-cmc $@) ) \
&& rm -f xgen-cmc
cc-enumerations.h: $(static_headers) Makefile cc-enumerations.h.in
@( cd $(srcdir) && $(GLIB_MKENUMS) --template cc-enumerations.h.in \
$(ccc_HEADERS) ) > xgen-gtbh \
&& (cmp -s xgen-gtbh $@ || (echo "Creating $@..."; cp xgen-gtbh $@) ) \
&& rm -f xgen-gtbh
cc-enumerations.c: $(static_headers) Makefile cc-enumerations.c.in
@( cd $(srcdir) && $(GLIB_MKENUMS) --template cc-enumerations.c.in \
$(ccc_HEADERS) ) >> xgen-gtbc \
&& (cmp -s xgen-gtbc $@ || (echo "Creating $@..."; cp xgen-gtbc $@) ) \
&& rm -f xgen-gtbc
EXTRA_DIST=\
cc-enumerations.c.in \
cc-enumerations.h.in \
marshallers.list \
$(NULL)
CLEANFILES=\
$(BUILT_SOURCES) \
$(NULL)
AM_CPPFLAGS=\
$(CCC_CFLAGS) \
-std=c99 \
-I$(top_builddir)/src/libccc \
-I$(top_srcdir)/src/libccc \
$(NULL)
/* this file is part of libccc
*
* AUTHORS
* Sven Herzberg <herzi@gnome-de.org>
*
* Copyright (C) 2005,2007 Sven Herzberg
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/
#include <ccc/cc-brush-color.h>
static void brush_color_implement_brush (CcBrushIface* iface);
G_DEFINE_TYPE_WITH_CODE (CcBrushColor, cc_brush_color, G_TYPE_INITIALLY_UNOWNED,
G_IMPLEMENT_INTERFACE (CC_TYPE_BRUSH, brush_color_implement_brush));
/**
* cc_brush_color_new:
*
* Deprecated: #CcBrushColor is deprecated since 0.0.6. See also <xref
* linkend="ccc-Porting-0.0.6-CcBrushColor"/>.
*/
CcBrush*
cc_brush_color_new(CcColor* color) {
g_return_val_if_fail(color, NULL);
return g_object_new(CC_TYPE_BRUSH_COLOR, "color", color, NULL);
}
/**
* cc_brush_color_get_color:
*
* Deprecated: #CcBrushColor is deprecated since 0.0.6. See also <xref
* linkend="ccc-Porting-0.0.6-CcBrushColor"/>.
*/
CcColor*
cc_brush_color_get_color(CcBrushColor* self) {
g_return_val_if_fail(CC_IS_BRUSH_COLOR(self), NULL);
return self->color;
}
/**
* cc_brush_color_set_color:
*
* Deprecated: #CcBrushColor is deprecated since 0.0.6. See also <xref
* linkend="ccc-Porting-0.0.6-CcBrushColor"/>.
*/
void
cc_brush_color_set_color(CcBrushColor* self, CcColor* color) {
g_return_if_fail(CC_IS_BRUSH_COLOR(self));
g_return_if_fail(color);
if(self->color == color) {
return;
}
if(self->color) {
g_object_unref(self->color);
self->color = NULL;
}
if(color) {
self->color = g_object_ref_sink(color);
}
g_object_notify(G_OBJECT(self), "color");
}
/* GType stuff */
enum {
PROP_0,
PROP_COLOR
};
static void
cc_brush_color_init(CcBrushColor* self) {}
static void
cbc_dispose (GObject* object)
{
cc_brush_color_set_color (CC_BRUSH_COLOR (object), NULL);
G_OBJECT_CLASS(cc_brush_color_parent_class)->dispose(object);
}
static void
cbc_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) {
CcBrushColor* self = CC_BRUSH_COLOR(object);
switch(prop_id) {
case PROP_COLOR:
g_value_set_object(value, cc_brush_color_get_color(self));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
}
}
static void
cbc_set_property(GObject* object, guint prop_id, GValue const* value, GParamSpec* pspec) {
CcBrushColor* self = CC_BRUSH_COLOR(object);
switch(prop_id) {
case PROP_COLOR:
cc_brush_color_set_color(self, g_value_get_object(value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
}
}
static void
cbc_apply(CcBrush* brush,
CcView * view G_GNUC_UNUSED,
CcItem * item G_GNUC_UNUSED,
cairo_t* cr)
{
CcBrushColor* self = CC_BRUSH_COLOR(brush);
if(CC_IS_COLOR(self->color)) {
gdouble red, green, blue, alpha;
cc_color_apply(self->color, &red, &green, &blue, &alpha);
cairo_set_source_rgba(cr, red, green, blue, alpha);
}
}
static void
cc_brush_color_class_init(CcBrushColorClass* self_class) {
GObjectClass* go_class;
/* GObjectClass */
go_class = G_OBJECT_CLASS(self_class);
go_class->dispose = cbc_dispose;
go_class->get_property = cbc_get_property;
go_class->set_property = cbc_set_property;
g_object_class_install_property(go_class,
PROP_COLOR,
g_param_spec_object("color",
"Color",
"The color",
CC_TYPE_COLOR,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
}
static void
brush_color_implement_brush (CcBrushIface* iface)
{
iface->apply = cbc_apply;
}
/* this file is part of libccc
*
* AUTHORS
* Sven Herzberg <herzi@gnome-de.org>
*
* Copyright (C) 2005,2007 Sven Herzberg
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/
#ifndef CCC_DISABLE_DEPRECATED
#ifndef CC_BRUSH_COLOR_H
#define CC_BRUSH_COLOR_H
#include <ccc/cc-brush.h>
#include <ccc/cc-color.h>
G_BEGIN_DECLS
typedef struct _CcBrushColor CcBrushColor;
typedef struct _CcBrushColorClass CcBrushColorClass;
#define CC_TYPE_BRUSH_COLOR (cc_brush_color_get_type())
#define CC_BRUSH_COLOR(i) (G_TYPE_CHECK_INSTANCE_CAST((i), CC_TYPE_BRUSH_COLOR, CcBrushColor))
#define CC_BRUSH_COLOR_CLASS(c) (G_TYPE_CHECK_CLASS_CAST((c), CC_TYPE_BRUSH_COLOR, CcBrushColorClass))
#define CC_IS_BRUSH_COLOR(i) (G_TYPE_CHECK_INSTANCE_TYPE((i), CC_TYPE_BRUSH_COLOR))
#define CC_IS_BRUSH_COLOR_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE((c), CC_TYPE_BRUSH_COLOR))
#define CC_BRUSH_COLOR_GET_CLASS(i) (G_TYPE_INSTANCE_GET_CLASS((i), CC_TYPE_BRUSH_COLOR, CcBrushColorClass))
GType cc_brush_color_get_type(void);
CcBrush * cc_brush_color_new (CcColor * color);
CcColor * cc_brush_color_get_color(CcBrushColor* self);
void cc_brush_color_set_color(CcBrushColor* self,
CcColor * color);
struct _CcBrushColor {
GInitiallyUnowned base_instance;
CcColor * color;
};
struct _CcBrushColorClass {
GInitiallyUnownedClass base_class;
};
G_END_DECLS
#endif /* !CC_BRUSH_COLOR_H */
#endif /* !CCC_DISABLE_DEPRECATED */
/* this file is part of libccc, criawips' cairo-based canvas
*
* AUTHORS
* Sven Herzberg <herzi@gnome-de.org>
*
* Copyright (C) 2005 Sven Herzberg
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/
#include <ccc/cc-brush.h>
#include <ccc/cc-utils.h>
#include "gobject-helpers.h"
G_DEFINE_IFACE (CcBrush, cc_brush, G_TYPE_INTERFACE);
/**
* cc_brush_apply:
* @self: a #CcBrush
* @view: a #CcView
* @item: a #CcItem
* @cr: a cairo context
*
* Apply a brush to a cairo context. The brush will be used to display @item in
* @view.
*
* This is usually used from item implementations while rendering to a context.
*/
void
cc_brush_apply(CcBrush* self,
CcView * view,
CcItem * item,
cairo_t* cr)
{
g_return_if_fail(CC_IS_BRUSH(self));
g_return_if_fail(cr);
cc_return_if_unimplemented_code(CC_BRUSH_GET_CLASS(self), apply,
cairo_set_source_rgba(cr, 0.0, 0.0, 0.0, 0.0));
CC_BRUSH_GET_CLASS(self)->apply(self, view, item, cr);
}
/* this file is part of libccc
*
* AUTHORS
* Sven Herzberg <herzi@gnome-de.org>
*
* Copyright (C) 2005,2007 Sven Herzberg
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/
#ifndef CC_BRUSH_H
#define CC_BRUSH_H
#include <cairo.h>
#include <ccc/cc-view.h>
G_BEGIN_DECLS
typedef struct _CcBrush CcBrush;
typedef struct _CcBrushIface CcBrushIface;