babl r370 - in trunk: . babl
- From: martinn svn gnome org
- To: svn-commits-list gnome org
- Subject: babl r370 - in trunk: . babl
- Date: Sat, 17 Jan 2009 13:33:49 +0000 (UTC)
Author: martinn
Date: Sat Jan 17 13:33:49 2009
New Revision: 370
URL: http://svn.gnome.org/viewvc/babl?rev=370&view=rev
Log:
Instead of having BABL_CLASS() plus variants and making the macros
expand to different things depending on if they are used in a
header or a .c file, have two versions: BABL_CLASS_DECLARE() and
BABL_CLASS_IMPLEMENT(). This enables further refactorisations of
the babl.h header.
* babl.h: Do the name changes and remove the unpleasant #undefs at
the bottom.
* babl-internal.h: Do the name changes.
* babl-component.[ch]
* babl-conversion.[ch]
* babl-extension.[ch]
* babl-fish.[ch]
* babl-format.[ch]
* babl-image.h
* babl-model.[ch]
* babl-sampling.h
* babl-type.[ch]: Adjust to changes.
Modified:
trunk/ChangeLog
trunk/babl/babl-component.c
trunk/babl/babl-component.h
trunk/babl/babl-conversion.c
trunk/babl/babl-conversion.h
trunk/babl/babl-extension.c
trunk/babl/babl-extension.h
trunk/babl/babl-fish.c
trunk/babl/babl-fish.h
trunk/babl/babl-format.c
trunk/babl/babl-format.h
trunk/babl/babl-image.h
trunk/babl/babl-internal.h
trunk/babl/babl-model.c
trunk/babl/babl-model.h
trunk/babl/babl-sampling.h
trunk/babl/babl-type.c
trunk/babl/babl-type.h
trunk/babl/babl.h
Modified: trunk/babl/babl-component.c
==============================================================================
--- trunk/babl/babl-component.c (original)
+++ trunk/babl/babl-component.c Sat Jan 17 13:33:49 2009
@@ -127,4 +127,4 @@
return babl;
}
-BABL_CLASS (component)
+BABL_CLASS_IMPLEMENT (component)
Modified: trunk/babl/babl-component.h
==============================================================================
--- trunk/babl/babl-component.h (original)
+++ trunk/babl/babl-component.h Sat Jan 17 13:33:49 2009
@@ -23,7 +23,7 @@
/****************************************************************/
/* BablComponent */
-BABL_NAMED_CLASS (component);
+BABL_NAMED_CLASS_DECLARE (component);
/*
* Babl * babl_component_new (const char *name,
* NULL);
Modified: trunk/babl/babl-conversion.c
==============================================================================
--- trunk/babl/babl-conversion.c (original)
+++ trunk/babl/babl-conversion.c Sat Jan 17 13:33:49 2009
@@ -555,4 +555,4 @@
return error;
}
-BABL_CLASS (conversion)
+BABL_CLASS_IMPLEMENT (conversion)
Modified: trunk/babl/babl-conversion.h
==============================================================================
--- trunk/babl/babl-conversion.h (original)
+++ trunk/babl/babl-conversion.h Sat Jan 17 13:33:49 2009
@@ -22,7 +22,7 @@
/****************************************************************/
/* BablConversion */
-BABL_NAMED_CLASS (conversion);
+BABL_NAMED_CLASS_DECLARE (conversion);
/*
* Babl * babl_conversion_new (<BablFormat *source, BablFormat *destination|
* BablModel *source, BablModel *destination|
Modified: trunk/babl/babl-extension.c
==============================================================================
--- trunk/babl/babl-extension.c (original)
+++ trunk/babl/babl-extension.c Sat Jan 17 13:33:49 2009
@@ -357,4 +357,4 @@
return 0; /* continue iterating */
}
-BABL_CLASS (extension)
+BABL_CLASS_IMPLEMENT (extension)
Modified: trunk/babl/babl-extension.h
==============================================================================
--- trunk/babl/babl-extension.h (original)
+++ trunk/babl/babl-extension.h Sat Jan 17 13:33:49 2009
@@ -22,7 +22,7 @@
/****************************************************************/
/* BablExtension */
-BABL_NAMED_CLASS (extension);
+BABL_NAMED_CLASS_DECLARE (extension);
/*
* BablExtension objects are only used internally in babl.
*/
Modified: trunk/babl/babl-fish.c
==============================================================================
--- trunk/babl/babl-fish.c (original)
+++ trunk/babl/babl-fish.c Sat Jan 17 13:33:49 2009
@@ -335,4 +335,4 @@
return 0; /* continue iterating */
}
-BABL_CLASS_MINIMAL (fish);
+BABL_CLASS_MINIMAL_IMPLEMENT (fish);
Modified: trunk/babl/babl-fish.h
==============================================================================
--- trunk/babl/babl-fish.h (original)
+++ trunk/babl/babl-fish.h Sat Jan 17 13:33:49 2009
@@ -22,7 +22,7 @@
/****************************************************************/
/* BablFish */
-BABL_CLASS (fish);
+BABL_CLASS_DECLARE (fish);
/* Create a babl fish capable of converting from source_format to
* destination_format, source and destination can be
* either strings with the names of the formats or BablFormat objects.
Modified: trunk/babl/babl-format.c
==============================================================================
--- trunk/babl/babl-format.c (original)
+++ trunk/babl/babl-format.c Sat Jan 17 13:33:49 2009
@@ -436,4 +436,4 @@
return loss;
}
-BABL_CLASS (format)
+BABL_CLASS_IMPLEMENT (format)
Modified: trunk/babl/babl-format.h
==============================================================================
--- trunk/babl/babl-format.h (original)
+++ trunk/babl/babl-format.h Sat Jan 17 13:33:49 2009
@@ -22,7 +22,7 @@
/****************************************************************/
/* BablFormat */
-BABL_NAMED_CLASS (format);
+BABL_NAMED_CLASS_DECLARE (format);
/*
* Babl * babl_format_new (["name", const char *name,]
* BablModel *model,
Modified: trunk/babl/babl-image.h
==============================================================================
--- trunk/babl/babl-image.h (original)
+++ trunk/babl/babl-image.h Sat Jan 17 13:33:49 2009
@@ -22,7 +22,7 @@
/****************************************************************/
/* BablImage */
-BABL_CLASS (image);
+BABL_CLASS_DECLARE (image);
/*
* Babl images can be used for planar buffers instead of linear buffers for
* babl_process(), BablImages are still experimental, for now BablImages can be
Modified: trunk/babl/babl-internal.h
==============================================================================
--- trunk/babl/babl-internal.h (original)
+++ trunk/babl/babl-internal.h Sat Jan 17 13:33:49 2009
@@ -209,7 +209,7 @@
* to be kept in sync with the C files.
*/
-#define BABL_CLASS_MINIMAL(klass) \
+#define BABL_CLASS_MINIMAL_IMPLEMENT(klass) \
void \
babl_##klass##_init (void) \
{ \
@@ -235,8 +235,8 @@
babl_db_each (db, each_fun, user_data); \
} \
-#define BABL_CLASS(klass) \
-BABL_CLASS_MINIMAL(klass) \
+#define BABL_CLASS_IMPLEMENT(klass) \
+BABL_CLASS_MINIMAL_IMPLEMENT(klass) \
\
Babl * \
babl_##klass (const char *name) \
Modified: trunk/babl/babl-model.c
==============================================================================
--- trunk/babl/babl-model.c (original)
+++ trunk/babl/babl-model.c Sat Jan 17 13:33:49 2009
@@ -327,4 +327,4 @@
return symmetric;
}
-BABL_CLASS (model)
+BABL_CLASS_IMPLEMENT (model)
Modified: trunk/babl/babl-model.h
==============================================================================
--- trunk/babl/babl-model.h (original)
+++ trunk/babl/babl-model.h Sat Jan 17 13:33:49 2009
@@ -22,7 +22,7 @@
/****************************************************************/
/* BablModel */
-BABL_NAMED_CLASS (model);
+BABL_NAMED_CLASS_DECLARE (model);
/*
* Babl * babl_model_new (["name", const char *name,]
* BablComponent *component1,
Modified: trunk/babl/babl-sampling.h
==============================================================================
--- trunk/babl/babl-sampling.h (original)
+++ trunk/babl/babl-sampling.h Sat Jan 17 13:33:49 2009
@@ -22,7 +22,7 @@
/****************************************************************/
/* BablSampling */
-BABL_CLASS (sampling);
+BABL_CLASS_DECLARE (sampling);
/**/
Babl * babl_sampling (int horizontal,
int vertical);
Modified: trunk/babl/babl-type.c
==============================================================================
--- trunk/babl/babl-type.c (original)
+++ trunk/babl/babl-type.c Sat Jan 17 13:33:49 2009
@@ -252,4 +252,4 @@
return is_symmetrical;
}
-BABL_CLASS (type)
+BABL_CLASS_IMPLEMENT (type)
Modified: trunk/babl/babl-type.h
==============================================================================
--- trunk/babl/babl-type.h (original)
+++ trunk/babl/babl-type.h Sat Jan 17 13:33:49 2009
@@ -22,7 +22,7 @@
/****************************************************************/
/* BablType */
-BABL_NAMED_CLASS (type);
+BABL_NAMED_CLASS_DECLARE (type);
/*
* A data type that babl can have in it's buffers, requires
* conversions to and from "double" to be registered before
Modified: trunk/babl/babl.h
==============================================================================
--- trunk/babl/babl.h (original)
+++ trunk/babl/babl.h Sat Jan 17 13:33:49 2009
@@ -84,7 +84,7 @@
* to be iterated over, common functionality is defined through these
* macros.
*/
-#define BABL_CLASS(klass) \
+#define BABL_CLASS_DECLARE(klass) \
\
void babl_##klass##_init (void); \
void babl_##klass##_destroy (void); \
@@ -98,9 +98,9 @@
* the means to lookup by name, as well as to create new named objects
* that later can be looked up.
*/
-#define BABL_NAMED_CLASS(klass) \
+#define BABL_NAMED_CLASS_DECLARE(klass) \
\
-BABL_CLASS (klass); \
+BABL_CLASS_DECLARE (klass); \
Babl * babl_##klass (const char *name); \
Babl * babl_##klass##_new (void *first_arg, \
...) BABL_ARG_NULL_TERMINATED
@@ -163,7 +163,4 @@
BablExtension extension;
} _Babl;
-#undef BABL_CLASS
-#undef BABL_NAMED_CLASS
-
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]