parent
7665959f2b
commit
acc82b617d
@ -1,132 +0,0 @@
|
||||
AC_PREREQ(2.63)
|
||||
|
||||
# Package
|
||||
|
||||
AC_INIT([tdegtk],[1.0.1],[https://bugs.trinitydesktop.org],[tdegtk])
|
||||
AC_CONFIG_SRCDIR([tdegtk/tdegtk.h])
|
||||
AC_CONFIG_MACRO_DIR([build])
|
||||
AC_CONFIG_AUX_DIR([build])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AM_INIT_AUTOMAKE([1.9 foreign dist-bzip2])
|
||||
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
||||
|
||||
NANO=`echo AC_PACKAGE_VERSION | cut -d'.' -f4`
|
||||
if test x"$NANO" = x || test "x$NANO" = "x0" ; then
|
||||
TDEGTK_TRUNK="no"
|
||||
PACKAGE_VERSION_NANO="0"
|
||||
else
|
||||
TDEGTK_TRUNK="yes"
|
||||
PACKAGE_VERSION_NANO="$NANO"
|
||||
fi
|
||||
AC_SUBST(TDEGTK_TRUNK)
|
||||
AC_SUBST(PACKAGE_VERSION_NANO)
|
||||
|
||||
AC_USE_SYSTEM_EXTENSIONS
|
||||
AC_PROG_CC
|
||||
AM_PROG_CC_C_O
|
||||
AC_PROG_CXX
|
||||
LT_INIT
|
||||
AC_C_CONST
|
||||
AC_C_INLINE
|
||||
|
||||
# Build dependencies
|
||||
|
||||
AC_PATH_PROG([GLIB_MKENUMS], [glib-mkenums])
|
||||
AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
|
||||
PKG_PROG_PKG_CONFIG
|
||||
|
||||
AC_SUBST(glib_req, 2.26.0)
|
||||
AC_SUBST(gtk_req, 3.1.10)
|
||||
AC_SUBST(cairo_req, 1.10)
|
||||
|
||||
PKG_CHECK_MODULES(DEPS, glib-2.0 >= $glib_req gtk+-3.0 >= $gtk_req cairo >= $cairo_req)
|
||||
AC_SUBST(DEPS_CFLAGS)
|
||||
AC_SUBST(DEPS_LIBS)
|
||||
|
||||
# Debug flags
|
||||
|
||||
if test x$TDEGTK_TRUNK = xyes; then
|
||||
DEFAULT_DEBUG="yes"
|
||||
else
|
||||
DEFAULT_DEBUG="no"
|
||||
fi
|
||||
AC_SUBST(DEFAULT_DEBUG)
|
||||
AC_ARG_ENABLE([debug],
|
||||
[AS_HELP_STRING([--enable-debug=@<:@no/yes/full@:>@],[Control debug level @<:@default=debug_default@:>@])],
|
||||
[], [enable_debug=$DEFAULT_DEBUG])
|
||||
AS_CASE([$enable_debug],
|
||||
[yes],
|
||||
[
|
||||
test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
|
||||
DEBUG_CFLAGS="-D_DEBUG"
|
||||
],
|
||||
[no],
|
||||
[DEBUG_CFLAGS="-DNDEBUG"],
|
||||
[AC_MSG_ERROR([Unknown argument for --enable-debug])]
|
||||
)
|
||||
AC_SUBST(DEBUG_CFLAGS)
|
||||
|
||||
# Maintainer flags
|
||||
|
||||
if test x$TDEGTK_TRUNK = xyes; then
|
||||
DEFAULT_MAINTAINER_FLAGS="yes"
|
||||
else
|
||||
DEFAULT_MAINTAINER_FLAGS="no"
|
||||
fi
|
||||
AC_SUBST(DEFAULT_MAINTAINER_FLAGS)
|
||||
AC_ARG_ENABLE([maintainer-flags],
|
||||
[AS_HELP_STRING([--enable-maintainer-flags=@<:@no/yes@:>@],[Use strict compiler flags @<:@default=maintainer_flags_default@:>@])],
|
||||
[],
|
||||
[enable_maintainer_flags=$DEFAULT_MAINTAINER_FLAGS])
|
||||
AS_IF([test "x$enable_maintainer_flags" = "xyes" && test "x$GCC" = "xyes"],
|
||||
[
|
||||
AS_COMPILER_FLAGS([MAINTAINER_CFLAGS],
|
||||
["-fno-common -Wall -Wextra -Werror -Wempty-body
|
||||
-Wno-missing-field-initializers -Wstrict-aliasing=2
|
||||
-Wno-unused-parameter -Wdeclaration-after-statement
|
||||
-Wpointer-arith -Wcast-align -Wwrite-strings
|
||||
-Wformat-security -Wformat-nonliteral -Winit-self
|
||||
-Wmissing-declarations -Wnested-externs -Wundef
|
||||
-Wold-style-definition -Wswitch-default
|
||||
-Wredundant-decls"])
|
||||
]
|
||||
)
|
||||
AC_SUBST(MAINTAINER_CFLAGS)
|
||||
|
||||
# Variables
|
||||
|
||||
TDEGTK_LIBADD="\$(DEPS_LIBS)"
|
||||
AC_SUBST(TDEGTK_LIBADD)
|
||||
|
||||
TDEGTK_CFLAGS="-I\$(top_srcdir) -DTDEGTK_COMPILATION \$(DEPS_CFLAGS) \$(DEBUG_CFLAGS) \$(MAINTAINER_CFLAGS)"
|
||||
AC_SUBST(TDEGTK_CFLAGS)
|
||||
|
||||
TDEGTK_LDFLAGS="-module -avoid-version -no-undefined"
|
||||
AC_SUBST(TDEGTK_LDFLAGS)
|
||||
|
||||
GTK_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-3.0`
|
||||
AC_SUBST(GTK_VERSION)
|
||||
|
||||
# Files
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
build/Makefile
|
||||
po/Makefile
|
||||
tdegtk/Makefile
|
||||
tests/Makefile
|
||||
rc/Makefile
|
||||
])
|
||||
AC_OUTPUT
|
||||
|
||||
# Summary
|
||||
|
||||
echo ""
|
||||
echo " tdegtk $PACKAGE_VERSION"
|
||||
echo " ========================="
|
||||
echo ""
|
||||
echo " Debug: ${enable_debug}"
|
||||
echo " Prefix: ${prefix}"
|
||||
echo ""
|
||||
echo " Compiler flags: ${CPPFLAGS} ${DEBUG_CFLAGS} ${MAINTAINER_CFLAGS}"
|
||||
echo ""
|
@ -0,0 +1,153 @@
|
||||
#MIN_CONFIG(3.2.0)
|
||||
|
||||
AM_INIT_AUTOMAKE(tdegtk3, 0.1)
|
||||
AC_C_BIGENDIAN
|
||||
AC_CHECK_KDEMAXPATHLEN
|
||||
|
||||
# C support
|
||||
AM_PROG_CC_C_O
|
||||
|
||||
# --- Cairo check ---
|
||||
|
||||
KDE_FIND_PATH(pkg-config, PKGCONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/bin /usr/local/bin /opt/local/bin], [
|
||||
AC_MSG_WARN([Could not find pkg-config])
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([for Cairo])
|
||||
|
||||
if test -n "$PKGCONFIG"; then
|
||||
vers=`$PKGCONFIG cairo --modversion 2>/dev/null`
|
||||
if test -n "$vers"
|
||||
then
|
||||
CAIRO_LIBS="`$PKGCONFIG cairo --libs`"
|
||||
CAIRO_RPATH=
|
||||
for args in $CAIRO_LIBS; do
|
||||
case $args in
|
||||
-L*)
|
||||
CAIRO_RPATH="$CAIRO_RPATH $args"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
CAIRO_RPATH=`echo $CAIRO_RPATH | $SED -e "s/-L/-R/g"`
|
||||
CAIRO_CFLAGS="`$PKGCONFIG cairo --cflags`"
|
||||
|
||||
AC_DEFINE_UNQUOTED(HAVE_CAIRO, 1, [Defines if your system has the Cairo library])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test ! "$USE_RPATH" = "yes"; then
|
||||
CAIRO_RPATH=
|
||||
fi
|
||||
|
||||
if test -n "$CAIRO_LIBS"
|
||||
then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([not found])
|
||||
fi
|
||||
|
||||
AC_SUBST(CAIRO_LIBS)
|
||||
AC_SUBST(CAIRO_CFLAGS)
|
||||
AC_SUBST(CAIRO_RPATH)
|
||||
|
||||
AM_CONDITIONAL(have_openexr, test -n "$CAIRO_LIBS")
|
||||
|
||||
# --- End of Cairo check ---
|
||||
|
||||
# --- GTK3 check ---
|
||||
|
||||
KDE_FIND_PATH(pkg-config, PKGCONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/bin /usr/local/bin /opt/local/bin], [
|
||||
AC_MSG_WARN([Could not find pkg-config])
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([for GTK3])
|
||||
|
||||
if test -n "$PKGCONFIG"; then
|
||||
vers=`$PKGCONFIG gtk+-3.0 --modversion 2>/dev/null`
|
||||
if test -n "$vers"
|
||||
then
|
||||
GTK3_LIBS="`$PKGCONFIG gtk+-3.0 --libs`"
|
||||
GTK3_RPATH=
|
||||
for args in $GTK3_LIBS; do
|
||||
case $args in
|
||||
-L*)
|
||||
GTK3_RPATH="$GTK3_RPATH $args"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
GTK3_RPATH=`echo $GTK3_RPATH | $SED -e "s/-L/-R/g"`
|
||||
GTK3_CFLAGS="`$PKGCONFIG gtk+-3.0 --cflags`"
|
||||
GTK3_PREFIX=`$PKG_CONFIG --variable=prefix gtk+-3.0`
|
||||
GTK3_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-3.0`
|
||||
|
||||
AC_DEFINE_UNQUOTED(HAVE_GTK3, 1, [Defines if your system has the GTK3 library])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test ! "$USE_RPATH" = "yes"; then
|
||||
GTK3_RPATH=
|
||||
fi
|
||||
|
||||
if test -n "$GTK3_LIBS"
|
||||
then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([not found])
|
||||
fi
|
||||
|
||||
AC_SUBST(GTK3_LIBS)
|
||||
AC_SUBST(GTK3_CFLAGS)
|
||||
AC_SUBST(GTK3_RPATH)
|
||||
AC_SUBST(GTK3_PREFIX)
|
||||
AC_SUBST(GTK3_VERSION)
|
||||
|
||||
AM_CONDITIONAL(have_openexr, test -n "$GTK3_LIBS")
|
||||
|
||||
# --- End of GTK3 check ---
|
||||
|
||||
# --- Pango check ---
|
||||
|
||||
KDE_FIND_PATH(pkg-config, PKGCONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/bin /usr/local/bin /opt/local/bin], [
|
||||
AC_MSG_WARN([Could not find pkg-config])
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([for Pango])
|
||||
|
||||
if test -n "$PKGCONFIG"; then
|
||||
vers=`$PKGCONFIG pango --modversion 2>/dev/null`
|
||||
if test -n "$vers"
|
||||
then
|
||||
PANGO_LIBS="`$PKGCONFIG pango --libs`"
|
||||
PANGO_RPATH=
|
||||
for args in $PANGO_LIBS; do
|
||||
case $args in
|
||||
-L*)
|
||||
PANGO_RPATH="$PANGO_RPATH $args"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
PANGO_RPATH=`echo $PANGO_RPATH | $SED -e "s/-L/-R/g"`
|
||||
PANGO_CFLAGS="`$PKGCONFIG pango --cflags`"
|
||||
|
||||
AC_DEFINE_UNQUOTED(HAVE_PANGO, 1, [Defines if your system has the Pango library])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test ! "$USE_RPATH" = "yes"; then
|
||||
PANGO_RPATH=
|
||||
fi
|
||||
|
||||
if test -n "$PANGO_LIBS"
|
||||
then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([not found])
|
||||
fi
|
||||
|
||||
AC_SUBST(PANGO_LIBS)
|
||||
AC_SUBST(PANGO_CFLAGS)
|
||||
AC_SUBST(PANGO_RPATH)
|
||||
|
||||
AM_CONDITIONAL(have_openexr, test -n "$PANGO_LIBS")
|
||||
|
||||
# --- End of Pango check ---
|
@ -1,173 +0,0 @@
|
||||
/* The TdeGtk Theming Engine for Gtk+.
|
||||
* Copyright (C) 2009 Canonical Ltd
|
||||
*
|
||||
* 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., 51 Franklin St, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*
|
||||
* Authored by Mirco "MacSlow" Mueller <mirco.mueller@canonical.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#include "exponential-blur.h"
|
||||
#include "raico-blur.h"
|
||||
|
||||
struct _raico_blur_private_t
|
||||
{
|
||||
raico_blur_quality_t quality; /* low, medium, high */
|
||||
guint radius; /* blur-radius */
|
||||
};
|
||||
|
||||
raico_blur_t*
|
||||
raico_blur_create (void)
|
||||
{
|
||||
raico_blur_t* blur = NULL;
|
||||
raico_blur_private_t* priv = NULL;
|
||||
|
||||
blur = g_new0 (raico_blur_t, 1);
|
||||
if (!blur)
|
||||
{
|
||||
g_debug ("raico_blur_create(): could not allocate blur struct");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
priv = g_new0 (raico_blur_private_t, 1);
|
||||
if (!priv)
|
||||
{
|
||||
g_debug ("raico_blur_create(): could not allocate priv struct");
|
||||
g_free ((gpointer) blur);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
priv->quality = RAICO_BLUR_QUALITY_LOW;
|
||||
|
||||
priv->radius = 0;
|
||||
|
||||
blur->priv = priv;
|
||||
|
||||
return blur;
|
||||
}
|
||||
|
||||
raico_blur_quality_t
|
||||
raico_blur_get_quality (raico_blur_t* blur)
|
||||
{
|
||||
g_assert (blur != NULL);
|
||||
|
||||
return blur->priv->quality;
|
||||
}
|
||||
|
||||
void
|
||||
raico_blur_set_quality (raico_blur_t* blur,
|
||||
raico_blur_quality_t quality)
|
||||
{
|
||||
if (!blur)
|
||||
{
|
||||
g_debug ("raico_blur_set_quality(): NULL blur-pointer passed");
|
||||
return;
|
||||
}
|
||||
|
||||
blur->priv->quality = quality;
|
||||
}
|
||||
|
||||
guint
|
||||
raico_blur_get_radius (raico_blur_t* blur)
|
||||
{
|
||||
g_assert (blur != NULL);
|
||||
|
||||
return blur->priv->radius;
|
||||
}
|
||||
|
||||
void
|
||||
raico_blur_set_radius (raico_blur_t* blur,
|
||||
guint radius)
|
||||
{
|
||||
if (!blur)
|
||||
{
|
||||
g_debug ("raico_blur_set_radius(): NULL blur-pointer passed");
|
||||
return;
|
||||
}
|
||||
|
||||
blur->priv->radius = radius;
|
||||
}
|
||||
|
||||
void
|
||||
raico_blur_apply (raico_blur_t* blur,
|
||||
cairo_surface_t* surface)
|
||||
{
|
||||
cairo_format_t format;
|
||||
|
||||
/* sanity checks */
|
||||
if (!blur)
|
||||
{
|
||||
g_debug ("raico_blur_apply(): NULL blur-pointer passed");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!surface)
|
||||
{
|
||||
g_debug ("raico_blur_apply(): NULL surface-pointer passed");
|
||||
return;
|
||||
}
|
||||
|
||||
if (cairo_surface_status (surface) != CAIRO_STATUS_SUCCESS)
|
||||
{
|
||||
g_debug ("raico_blur_apply(): invalid surface status");
|
||||
return;
|
||||
}
|
||||
|
||||
if (cairo_surface_get_type (surface) != CAIRO_SURFACE_TYPE_IMAGE)
|
||||
{
|
||||
g_debug ("raico_blur_apply(): non-image surface passed");
|
||||
return;
|
||||
}
|
||||
|
||||
format = cairo_image_surface_get_format (surface);
|
||||
if (format != CAIRO_FORMAT_A8 &&
|
||||
format != CAIRO_FORMAT_RGB24 &&
|
||||
format != CAIRO_FORMAT_ARGB32)
|
||||
{
|
||||
g_debug ("raico_blur_apply(): unsupported image-format");
|
||||
return;
|
||||
}
|
||||
|
||||
/* stupid, but you never know */
|
||||
if (blur->priv->radius == 0)
|
||||
return;
|
||||
|
||||
/* now do the real work */
|
||||
switch (blur->priv->quality)
|
||||
{
|
||||
default:
|
||||
case RAICO_BLUR_QUALITY_HIGH:
|
||||
case RAICO_BLUR_QUALITY_MEDIUM:
|
||||
/* Not implemented yet */
|
||||
//surface_gaussian_blur (surface, blur->priv->radius);
|
||||
case RAICO_BLUR_QUALITY_LOW:
|
||||
surface_exponential_blur (surface, blur->priv->radius);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
raico_blur_destroy (raico_blur_t* blur)
|
||||
{
|
||||
if (!blur)
|
||||
{
|
||||
g_debug ("raico_blur_destroy(): invalid blur-pointer passed");
|
||||
return;
|
||||
}
|
||||
|
||||
g_free ((gpointer) blur->priv);
|
||||
g_free ((gpointer) blur);
|
||||
}
|
@ -1,67 +0,0 @@
|
||||
/* The TdeGtk Theming Engine for Gtk+.
|
||||
* Copyright (C) 2009 Canonical Ltd
|
||||
*
|
||||
* 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., 51 Franklin St, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*
|
||||
* Authored by Mirco "MacSlow" Mueller <mirco.mueller@canonical.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _RAICO_BLUR_H
|
||||
#define _RAICO_BLUR_H
|
||||
|
||||
#include <cairo.h>
|
||||
#include <glib.h>
|
||||
|
||||
typedef enum _raico_blur_quality_t
|
||||
{
|
||||
RAICO_BLUR_QUALITY_LOW = 0, /* low quality, but fast, maybe interactive */
|
||||
RAICO_BLUR_QUALITY_MEDIUM, /* compromise between speed and quality */
|
||||
RAICO_BLUR_QUALITY_HIGH /* quality before speed */
|
||||
} raico_blur_quality_t;
|
||||
|
||||
typedef struct _raico_blur_private_t raico_blur_private_t;
|
||||
|
||||
typedef struct _raico_blur_t
|
||||
{
|
||||
raico_blur_private_t* priv;
|
||||
} raico_blur_t;
|
||||
|
||||
raico_blur_t*
|
||||
raico_blur_create (void);
|
||||
|
||||
raico_blur_quality_t
|
||||
raico_blur_get_quality (raico_blur_t* blur);
|
||||
|
||||
void
|
||||
raico_blur_set_quality (raico_blur_t* blur,
|
||||
raico_blur_quality_t quality);
|
||||
|
||||
guint
|
||||
raico_blur_get_radius (raico_blur_t* blur);
|
||||
|
||||
void
|
||||
raico_blur_set_radius (raico_blur_t* blur,
|
||||
guint radius);
|
||||
|
||||
void
|
||||
raico_blur_apply (raico_blur_t* blur,
|
||||
cairo_surface_t* surface);
|
||||
|
||||
void
|
||||
raico_blur_destroy (raico_blur_t* blur);
|
||||
|
||||
#endif /* _RAICO_BLUR_H */
|
Loading…
Reference in new issue