Skip to content

Commit

Permalink
adg: removed AdgPattern
Browse files Browse the repository at this point in the history
cairo-gobject yet wraps cairo_pattern_t, so there is no need to
duplicate it (and makes bindings life easier).
  • Loading branch information
ntd committed Mar 1, 2013
1 parent 73412e2 commit 4dce10c
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 135 deletions.
6 changes: 4 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ m4_define([cpml_lt_version],[1:1:0])
m4_define([gtkdoc_prereq],[1.12])dnl Support introspection annotations
m4_define([gobject_prereq],[2.10.1])
m4_define([cairo_prereq],[1.7.4])
m4_define([cairo_gobject_prereq],cairo_prereq)
m4_define([gtk2_prereq],[2.12.0])
m4_define([gtk3_prereq],[3.0.0])
m4_define([pangocairo_prereq],[1.18.0])
Expand Down Expand Up @@ -131,6 +132,7 @@ AC_CONFIG_COMMANDS([default],
PKG_CHECK_MODULES([GLIB],[glib-2.0])
PKG_CHECK_MODULES([GOBJECT],[gobject-2.0 >= ]gobject_prereq)
PKG_CHECK_MODULES([CAIRO],[cairo >= ]cairo_prereq)
PKG_CHECK_MODULES([CAIRO_GOBJECT],[cairo-gobject >= ]cairo_gobject_prereq)


# Check for optional packages
Expand Down Expand Up @@ -341,8 +343,8 @@ AC_SUBST([CPML_CFLAGS])
AC_SUBST([CPML_LIBS])

dnl ADG compiler flags and library dependencies
ADG_CFLAGS="$GOBJECT_CFLAGS"
ADG_LIBS="$GOBJECT_LIBS"
ADG_CFLAGS="$CAIRO_GOBJECT_CFLAGS"
ADG_LIBS="$CAIRO_GOBJECT_LIBS"
AM_COND_IF([HAVE_PANGO],
[ADG_CFLAGS="$PANGO_CFLAGS $ADG_CFLAGS"
ADG_LIBS="$PANGO_LIBS $ADG_LIBS"])
Expand Down
1 change: 0 additions & 1 deletion docs/adg/adg-docs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<xi:include href="xml/adg-primitive.xml"/>
<xi:include href="xml/adg-segment.xml"/>
<xi:include href="xml/adg-matrix.xml"/>
<xi:include href="xml/adg-pattern.xml"/>
</chapter>
</part>

Expand Down
10 changes: 5 additions & 5 deletions po-properties/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: adg 1.0.x\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-02-15 20:50+0100\n"
"POT-Creation-Date: 2013-03-01 13:10+0100\n"
"PO-Revision-Date: 2013-02-15 15:37+0100\n"
"Last-Translator: Nicola Fontana <ntd@entidi.it>\n"
"Language-Team: \n"
Expand Down Expand Up @@ -607,11 +607,11 @@ msgstr ""
"Specifica come le trasformazioni locali dell'entità corrente e dei suoi "
"progenitori devono essere combinate per ottenere la matrice locale"

#: src/adg/adg-fill-style.c:107
#: src/adg/adg-fill-style.c:106
msgid "Pattern"
msgstr "Pattern"

#: src/adg/adg-fill-style.c:108
#: src/adg/adg-fill-style.c:107
msgid "The cairo pattern set for this entity"
msgstr "Il pattern cairo impostato per questa entità"

Expand Down Expand Up @@ -731,11 +731,11 @@ msgstr "Mappa di Render"
msgid "The transformation to be applied on the canvas before rendering it"
msgstr "La trasformazione da applicare al canvas prima del rendering"

#: src/adg/adg-hatch.c:93
#: src/adg/adg-hatch.c:92
msgid "Fill Dress"
msgstr "Vestito Riempimento"

#: src/adg/adg-hatch.c:94
#: src/adg/adg-hatch.c:93
msgid "The dress to use for filling this entity"
msgstr "Il vestito da usare per riempire questa entità"

Expand Down
3 changes: 1 addition & 2 deletions src/adg.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@
#ifndef __ADG_H__
#define __ADG_H__

#include <glib-object.h>
#include <cairo-gobject.h>
#include <cpml.h>

#include "adg/adg-forward-declarations.h"
#include "adg/adg-enums.h"
#include "adg/adg-utils.h"
#include "adg/adg-pair.h"
#include "adg/adg-matrix.h"
#include "adg/adg-pattern.h"
#include "adg/adg-primitive.h"
#include "adg/adg-segment.h"
#include "adg/adg-entity.h"
Expand Down
2 changes: 0 additions & 2 deletions src/adg/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ h_sources= adg-adim.h \
adg-model.h \
adg-pair.h \
adg-path.h \
adg-pattern.h \
adg-point.h \
adg-primitive.h \
adg-projection.h \
Expand Down Expand Up @@ -112,7 +111,6 @@ c_sources= adg-adim.c \
adg-model.c \
adg-pair.c \
adg-path.c \
adg-pattern.c \
adg-point.c \
adg-primitive.c \
adg-projection.c \
Expand Down
1 change: 0 additions & 1 deletion src/adg/adg-dress-builtins.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#include "adg-model.h"
#include "adg-trail.h"
#include "adg-marker.h"
#include "adg-pattern.h"
#include "adg-dress.h"
#include "adg-color-style.h"
#include "adg-dash.h"
Expand Down
4 changes: 2 additions & 2 deletions src/adg/adg-fill-style-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ G_BEGIN_DECLS
typedef struct _AdgFillStylePrivate AdgFillStylePrivate;

struct _AdgFillStylePrivate {
AdgPattern *pattern;
CpmlExtents extents;
cairo_pattern_t *pattern;
CpmlExtents extents;
};

G_END_DECLS
Expand Down
8 changes: 4 additions & 4 deletions src/adg/adg-fill-style.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@

#include "adg-internal.h"
#include "adg-style.h"
#include "adg-pattern.h"

#include "adg-fill-style.h"
#include "adg-fill-style-private.h"
Expand Down Expand Up @@ -106,7 +105,7 @@ adg_fill_style_class_init(AdgFillStyleClass *klass)
param = g_param_spec_boxed("pattern",
P_("Pattern"),
P_("The cairo pattern set for this entity"),
ADG_TYPE_PATTERN,
CAIRO_GOBJECT_TYPE_PATTERN,
G_PARAM_READWRITE);
g_object_class_install_property(gobject_class, PROP_PATTERN, param);
}
Expand Down Expand Up @@ -190,7 +189,8 @@ _adg_set_property(GObject *object, guint prop_id,
* Since: 1.0
**/
void
adg_fill_style_set_pattern(AdgFillStyle *fill_style, AdgPattern *pattern)
adg_fill_style_set_pattern(AdgFillStyle *fill_style,
cairo_pattern_t *pattern)
{
g_return_if_fail(ADG_IS_FILL_STYLE(fill_style));
g_object_set(fill_style, "pattern", pattern, NULL);
Expand All @@ -206,7 +206,7 @@ adg_fill_style_set_pattern(AdgFillStyle *fill_style, AdgPattern *pattern)
*
* Since: 1.0
**/
AdgPattern *
cairo_pattern_t *
adg_fill_style_get_pattern(AdgFillStyle *fill_style)
{
AdgFillStylePrivate *data;
Expand Down
12 changes: 6 additions & 6 deletions src/adg/adg-fill-style.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ struct _AdgFillStyleClass {


GType adg_fill_style_get_type (void) G_GNUC_CONST;
void adg_fill_style_set_pattern (AdgFillStyle *fill_style,
AdgPattern *pattern);
AdgPattern * adg_fill_style_get_pattern (AdgFillStyle *fill_style);
void adg_fill_style_set_extents (AdgFillStyle *fill_style,
const CpmlExtents *extents);
const CpmlExtents *adg_fill_style_get_extents (AdgFillStyle *fill_style);
void adg_fill_style_set_pattern (AdgFillStyle *fill_style,
cairo_pattern_t *pattern);
cairo_pattern_t * adg_fill_style_get_pattern (AdgFillStyle *fill_style);
void adg_fill_style_set_extents (AdgFillStyle *fill_style,
const CpmlExtents *extents);
const CpmlExtents *adg_fill_style_get_extents (AdgFillStyle *fill_style);

G_END_DECLS

Expand Down
1 change: 0 additions & 1 deletion src/adg/adg-hatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
#include "adg-model.h"
#include "adg-trail.h"
#include "adg-stroke.h"
#include "adg-pattern.h"
#include "adg-style.h"
#include "adg-fill-style.h"
#include "adg-dress.h"
Expand Down
2 changes: 1 addition & 1 deletion src/adg/adg-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#include <config.h>
#define G_LOG_DOMAIN PACKAGE
#include <glib-object.h>
#include <cairo-gobject.h>
#include <cpml.h>

/* The following headers are autogenerated, so they could be hosted
Expand Down
58 changes: 0 additions & 58 deletions src/adg/adg-pattern.c

This file was deleted.

44 changes: 0 additions & 44 deletions src/adg/adg-pattern.h

This file was deleted.

6 changes: 3 additions & 3 deletions src/adg/adg-ruled-fill.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@


#include "adg-internal.h"
#include "adg-pattern.h"
#include "adg-dress.h"
#include "adg-dress-builtins.h"
#include "adg-style.h"
#include "adg-fill-style.h"
#include <math.h>

#include "adg-ruled-fill.h"
#include "adg-ruled-fill-private.h"

#include <math.h>


#define _ADG_OLD_STYLE_CLASS ((AdgStyleClass *) adg_ruled_fill_parent_class)
#define _ADG_OLD_FILL_STYLE_CLASS ((AdgFillStyleClass *) adg_ruled_fill_parent_class)
Expand Down Expand Up @@ -328,7 +328,7 @@ static void
_adg_apply(AdgStyle *style, AdgEntity *entity, cairo_t *cr)
{
AdgFillStyle *fill_style;
AdgPattern *pattern;
cairo_pattern_t *pattern;
const CpmlExtents *extents;

fill_style = (AdgFillStyle *) style;
Expand Down
6 changes: 3 additions & 3 deletions src/adg/tests/test-fill-style.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ static void
_adg_test_pattern(void)
{
AdgFillStyle *fill_style;
AdgPattern *valid_pattern_1, *valid_pattern_2;
const AdgPattern *pattern;
AdgPattern *pattern_dup;
cairo_pattern_t *valid_pattern_1, *valid_pattern_2;
const cairo_pattern_t *pattern;
cairo_pattern_t *pattern_dup;

fill_style = ADG_FILL_STYLE(adg_ruled_fill_new());
valid_pattern_1 = cairo_pattern_create_rgba(0, 0, 0, 0);
Expand Down

0 comments on commit 4dce10c

Please sign in to comment.