From 89de2fa269e5b60cd47322bb045b450cdd68df95 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 27 Dec 2006 18:19:34 +0000 Subject: [PATCH] 2006-12-27 Emmanuele Bassi * clutter/clutter-color.h: * clutter/clutter-color.c: Add clutter_color_to_string(), which creates a hex-encoded color string from a ClutterColor. --- ChangeLog | 6 +++++ clutter/clutter-color.c | 26 +++++++++++++++++++ clutter/clutter-color.h | 1 + clutter/clutter-event.h | 4 ++- clutter/clutter-stage.c | 12 ++++++++- clutter/clutter-stage.h | 2 ++ clutter/clutter-version.h.in | 25 ++++++++++++++++++ clutter/clutter.h | 25 ++++++++++++++++++ configure.ac | 4 +-- doc/reference/clutter-sections.txt | 5 ++-- doc/reference/tmpl/clutter-color.sgml | 37 +++++++++++++++++---------- doc/reference/tmpl/clutter-event.sgml | 1 + doc/reference/tmpl/clutter-stage.sgml | 9 +++++++ 13 files changed, 137 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index c0fd1b8c0..3f4da6873 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-12-27 Emmanuele Bassi + + * clutter/clutter-color.h: + * clutter/clutter-color.c: Add clutter_color_to_string(), + which creates a hex-encoded color string from a ClutterColor. + 2006-12-20 Matthew Allum * NEWS: diff --git a/clutter/clutter-color.c b/clutter/clutter-color.c index 2f600ea01..535b6fa3f 100644 --- a/clutter/clutter-color.c +++ b/clutter/clutter-color.c @@ -416,6 +416,32 @@ clutter_color_parse (const gchar *color, return FALSE; } +/** + * clutter_color_to_string: + * @color: a #ClutterColor + * + * Returns a textual specification of @color in the hexadecimal form + * #rrrrggggbbbbaaaa, where r, + * g, b and a are + * hex digits representing the red, green, blue and alpha components + * respectively. + * + * Return value: a newly-allocated text string + * + * Since: 0.2 + */ +gchar * +clutter_color_to_string (const ClutterColor *color) +{ + g_return_val_if_fail (color != NULL, NULL); + + return g_strdup_printf ("#%04x%04x%04x%04x", + color->red, + color->green, + color->blue, + color->alpha); +} + /** * clutter_color_equal: * @a: a #ClutterColor diff --git a/clutter/clutter-color.h b/clutter/clutter-color.h index 2a128edb4..7a64b43cd 100644 --- a/clutter/clutter-color.h +++ b/clutter/clutter-color.h @@ -49,6 +49,7 @@ gboolean clutter_color_parse (const gchar *color, ClutterColor *dest); gboolean clutter_color_equal (const ClutterColor *a, const ClutterColor *b); +gchar * clutter_color_to_string (const ClutterColor *color); GType clutter_color_get_type (void) G_GNUC_CONST; diff --git a/clutter/clutter-event.h b/clutter/clutter-event.h index 59f29e56f..3a2aefaab 100644 --- a/clutter/clutter-event.h +++ b/clutter/clutter-event.h @@ -50,7 +50,8 @@ typedef enum CLUTTER_MOTION, CLUTTER_BUTTON_PRESS, CLUTTER_2BUTTON_PRESS, /* Double click */ - CLUTTER_BUTTON_RELEASE + CLUTTER_BUTTON_RELEASE, + CLUTTER_DELETE_EVENT } ClutterEventType; #define CLUTTER_TYPE_EVENT (clutter_event_get_type ()) @@ -64,6 +65,7 @@ typedef struct _ClutterMotionEvent ClutterMotionEvent; typedef struct _ClutterInputDevice ClutterInputDevice; + struct _ClutterAnyEvent { ClutterEventType type; diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c index 28020a55c..28bb2b3c5 100644 --- a/clutter/clutter-stage.c +++ b/clutter/clutter-stage.c @@ -92,6 +92,7 @@ enum KEY_PRESS_EVENT, KEY_RELEASE_EVENT, MOTION_EVENT, + DELETE_EVENT, LAST_SIGNAL }; @@ -832,7 +833,16 @@ clutter_stage_class_init (ClutterStageClass *klass) clutter_marshal_VOID__BOXED, G_TYPE_NONE, 1, CLUTTER_TYPE_EVENT); - + stage_signals[DELETE_EVENT] = + g_signal_new ("delete-event", + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ClutterStageClass, delete_event), + NULL, NULL, + clutter_marshal_VOID__BOXED, + G_TYPE_NONE, 1, + CLUTTER_TYPE_EVENT); + g_type_class_add_private (gobject_class, sizeof (ClutterStagePrivate)); } diff --git a/clutter/clutter-stage.h b/clutter/clutter-stage.h index 94937f93e..7e6f52cfe 100644 --- a/clutter/clutter-stage.h +++ b/clutter/clutter-stage.h @@ -97,6 +97,8 @@ struct _ClutterStageClass ClutterKeyEvent *event); void (*motion_event) (ClutterStage *stage, ClutterMotionEvent *event); + void (*delete_event) (ClutterStage *stage, + ClutterEvent *event); /* padding for future expansion */ void (*_clutter_stage1) (void); diff --git a/clutter/clutter-version.h.in b/clutter/clutter-version.h.in index c5076c892..2bebb82b5 100644 --- a/clutter/clutter-version.h.in +++ b/clutter/clutter-version.h.in @@ -1,3 +1,28 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Authored By Matthew Allum + * + * Copyright (C) 2006 OpenedHand + * + * This library 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 of the License, or (at your option) any later version. + * + * This library 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 library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + #ifndef __CLUTTER_VERSION_H__ #define __CLUTTER_VERSION_H__ diff --git a/clutter/clutter.h b/clutter/clutter.h index 4f4a21d41..16195ece4 100644 --- a/clutter/clutter.h +++ b/clutter/clutter.h @@ -1,3 +1,28 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Authored By Matthew Allum + * + * Copyright (C) 2006 OpenedHand + * + * This library 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 of the License, or (at your option) any later version. + * + * This library 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 library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + #ifndef _HAVE_CLUTTER_H #define _HAVE_CLUTTER_H diff --git a/configure.ac b/configure.ac index 87d916e27..f896496a4 100644 --- a/configure.ac +++ b/configure.ac @@ -2,8 +2,8 @@ # An odd micro number indicates in-progress development, (eg. from CVS) # An even micro number indicates a released version. m4_define([clutter_major_version], [0]) -m4_define([clutter_minor_version], [1]) -m4_define([clutter_micro_version], [1]) +m4_define([clutter_minor_version], [2]) +m4_define([clutter_micro_version], [0]) m4_define([clutter_version], [clutter_major_version.clutter_minor_version.clutter_micro_version]) diff --git a/doc/reference/clutter-sections.txt b/doc/reference/clutter-sections.txt index ef473b584..8d1aa39d5 100644 --- a/doc/reference/clutter-sections.txt +++ b/doc/reference/clutter-sections.txt @@ -469,6 +469,8 @@ ClutterColor clutter_color_copy clutter_color_free clutter_color_parse +clutter_color_from_hls +clutter_color_from_pixel clutter_color_add clutter_color_subtract clutter_color_equal @@ -476,9 +478,8 @@ clutter_color_lighten clutter_color_darken clutter_color_shade clutter_color_to_hls -clutter_color_from_hls clutter_color_to_pixel -clutter_color_from_pixel +clutter_color_to_string CLUTTER_TYPE_COLOR diff --git a/doc/reference/tmpl/clutter-color.sgml b/doc/reference/tmpl/clutter-color.sgml index 538c2dbdd..fce712946 100644 --- a/doc/reference/tmpl/clutter-color.sgml +++ b/doc/reference/tmpl/clutter-color.sgml @@ -54,6 +54,26 @@ clutter-color @Returns: + + + + + +@dest: +@hue: +@luminance: +@saturation: + + + + + + + +@dest: +@pixel: + + @@ -123,17 +143,6 @@ clutter-color @saturation: - - - - - -@dest: -@hue: -@luminance: -@saturation: - - @@ -143,12 +152,12 @@ clutter-color @Returns: - + -@dest: -@pixel: +@color: +@Returns: diff --git a/doc/reference/tmpl/clutter-event.sgml b/doc/reference/tmpl/clutter-event.sgml index 0447456af..2b288ccce 100644 --- a/doc/reference/tmpl/clutter-event.sgml +++ b/doc/reference/tmpl/clutter-event.sgml @@ -29,6 +29,7 @@ Windowing events handled by Clutter. @CLUTTER_BUTTON_PRESS: @CLUTTER_2BUTTON_PRESS: @CLUTTER_BUTTON_RELEASE: +@CLUTTER_DELETE_EVENT: diff --git a/doc/reference/tmpl/clutter-stage.sgml b/doc/reference/tmpl/clutter-stage.sgml index 979a5e68e..942100aef 100644 --- a/doc/reference/tmpl/clutter-stage.sgml +++ b/doc/reference/tmpl/clutter-stage.sgml @@ -53,6 +53,14 @@ Macro evaluating to the height of the #ClutterStage @clutterstage: the object which received the signal. @arg1: + + + + + +@clutterstage: the object which received the signal. +@arg1: + @@ -117,6 +125,7 @@ Macro evaluating to the height of the #ClutterStage @key_press_event: @key_release_event: @motion_event: +@delete_event: @_clutter_stage1: @_clutter_stage2: @_clutter_stage3: