Skip to content

Commit

Permalink
Ported to GTK+ 3.10 to fix the deprecated APIs.
Browse files Browse the repository at this point in the history
GtkWindow       -> GtkApplicationWindow and GtkApplication
GtkTable        -> GtkGrid
GtkVBox         -> GtkBox
GtkToggleButton -> GAction
Changed the static GtkBuilder file to the resource file.
Changed custom GtkSpinButton to GtkButton
  • Loading branch information
fujiwarat committed Apr 17, 2014
1 parent 09ab75d commit c3c3ea1
Show file tree
Hide file tree
Showing 19 changed files with 1,782 additions and 1,062 deletions.
8 changes: 2 additions & 6 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#
# input-pad - The input pad
#
# Copyright (c) 2010-2012 Takao Fujiwara <takao.fujiwara1@gmail.com>
# Copyright (c) 2010-2012 Red Hat, Inc.
# Copyright (c) 2010-2014 Takao Fujiwara <takao.fujiwara1@gmail.com>
# Copyright (c) 2010-2014 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand All @@ -26,10 +26,6 @@ SUBDIRS = \
input-pad \
$(NULL)

if HAVE_PYGOBJECT2
SUBDIRS += pyinput-pad
endif

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = input-pad.pc

Expand Down
89 changes: 8 additions & 81 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#
# input-pad - The input pad
#
# Copyright (c) 2010-2013 Takao Fujiwara <takao.fujiwara1@gmail.com>
# Copyright (c) 2010-2013 Red Hat, Inc.
# Copyright (c) 2010-2014 Takao Fujiwara <takao.fujiwara1@gmail.com>
# Copyright (c) 2010-2014 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -72,9 +72,9 @@ DATE_DISPLAY="pad_datedisplay"
AC_SUBST(DATE_DISPLAY)

dnl - pkgconfig
AM_PATH_GLIB_2_0
AM_PATH_GLIB_2_0(2.37.0)
PKG_CHECK_MODULES(GLIB2, [
glib-2.0 >= 2.8
glib-2.0 >= 2.37
])

PKG_CHECK_MODULES(GMODULE2,
Expand All @@ -83,35 +83,10 @@ PKG_CHECK_MODULES(GMODULE2,
[AC_MSG_NOTICE([gmodule-2.0 is required by glib-2.0 >= 2.30])]
)

dnl - check gtk
AC_ARG_WITH([gtk],
[AS_HELP_STRING([--with-gtk=2.0|3.0],
[Select GTK+ version. The default is 3.0])],
[case "$with_gtk" in
2.0|3.0) ;;
*) AC_MSG_ERROR([invalid gtk version specified]) ;;
esac],
[with_gtk=3.0]
)

case "$with_gtk" in
2.0)
PKG_CHECK_MODULES(GTK2, [
gtk+-2.0
])
AM_CONDITIONAL(HAVE_GTK3, false)
AM_CONDITIONAL(HAVE_GTK2, true)
GTK_API_VERSION=2.0
;;
3.0)
PKG_CHECK_MODULES(GTK3, [
gtk+-3.0
])
AM_CONDITIONAL(HAVE_GTK3, true)
AM_CONDITIONAL(HAVE_GTK2, false)
GTK_API_VERSION=3.0
;;
esac
PKG_CHECK_MODULES(GTK3, [
gtk+-3.0 >= 3.10
])
GTK_API_VERSION=3.0
AC_SUBST(GTK_API_VERSION)

PKG_CHECK_MODULES(LIBXML2, [
Expand Down Expand Up @@ -172,51 +147,6 @@ if test x"$found_introspection" = x"yes" ; then
fi
AC_SUBST(IBUS_GIR_SCANNERFLAGS)

dnl - check pygobject2
AC_MSG_CHECKING([where you enable pygobject2])
AC_ARG_ENABLE(pygobject2,
AS_HELP_STRING([--enable-pygobject2=no/yes],
[Enable PyGObject2 default=no]),
[],
enable_pygobject2=no)
AC_MSG_RESULT($enable_pygobject2)

if test x"$enable_pygobject2" = xyes; then
AM_CONDITIONAL(HAVE_PYTHON, true)
AM_CONDITIONAL(HAVE_PYGOBJECT2, true)
AM_PATH_PYTHON([2.5], [], [])

AC_PATH_PROG(PYTHON_CONFIG, python$PYTHON_VERSION-config)
if test x"$PYTHON_CONFIG" = x""; then
AC_PATH_PROG(PYTHON_CONFIG, python-config-$PYTHON_VERSION)
fi
if test x"$PYTHON_CONFIG" != x""; then
PYTHON_CFLAGS=`$PYTHON_CONFIG --includes`
PYTHON_LIBS=`$PYTHON_CONFIG --libs`
fi
AC_MSG_NOTICE([PYTHON_CFLAGS=\"$PYTHON_CFLAGS\"])
AC_MSG_NOTICE([PYTHON_LIBS=\"$PYTHON_LIBS\"])
if test x"$PYTHON_CFLAGS" = x -o x"$PYTHON_LIBS" = x ; then
AC_MSG_ERROR([Could not find PYTHON_CFLAGS or PYTHON_LIBS])
fi

AC_PATH_PROG(SWIG, swig)
if test x"$SWIG" = x""; then
AC_MSG_ERROR([Could not find swig])
fi

AC_SUBST(PYTHON_CFLAGS)
AC_SUBST(PYTHON_LIBS)
AC_SUBST(SWIG)
else
if test x"$found_introspection" = x"yes" ; then
AM_CONDITIONAL(HAVE_PYTHON, true)
else
AM_CONDITIONAL(HAVE_PYTHON, false)
fi
AM_CONDITIONAL(HAVE_PYGOBJECT2, false)
fi

dnl - check XTest module
AC_MSG_CHECKING([whether you enable xtest module])
AC_ARG_ENABLE(xtest,
Expand Down Expand Up @@ -257,8 +187,6 @@ input-pad.pc
input-pad.spec
data/Makefile
input-pad/Makefile
pyinput-pad/Makefile
pyinput-pad/pyinput_pad.pth
])

AC_OUTPUT
Expand All @@ -270,7 +198,6 @@ libinput_pad version: $libinput_pad_VERSION
GTK+ version: $GTK_API_VERSION
Have libxklavier: $have_libxklavier
Enable EEK $enable_eek
Enable PyGObject2 $enable_pygobject2
Enable PyGObject3 $found_introspection
GIR scannerflags "$INPUT_PAD_GIR_SCANNERFLAGS"
Enable XTEST $enable_xtest
Expand Down
8 changes: 2 additions & 6 deletions data/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#
# input-pad - The input pad
#
# Copyright (c) 2010-2012 Takao Fujiwara <takao.fujiwara1@gmail.com>
# Copyright (c) 2010-2012 Red Hat, Inc.
# Copyright (c) 2010-2014 Takao Fujiwara <takao.fujiwara1@gmail.com>
# Copyright (c) 2010-2014 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand All @@ -20,9 +20,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA

ui_gtk_DATA = input-pad.ui
ui_gtkdir = $(pkgdatadir)/ui/gtk

icon_DATA = input-pad.png
icondir = $(datarootdir)/pixmaps

Expand Down Expand Up @@ -138,7 +135,6 @@ EXTRA_DIST = \
$(icon_DATA) \
$(pad_in_in_files) \
$(pad_in_files) \
$(ui_gtk_DATA) \
char2hexstr.py \
keyboard.xml.in \
w3ctostr.py \
Expand Down
2 changes: 1 addition & 1 deletion input-pad.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ xkeysenddir=@libdir@/input-pad-@libinput_pad_VERSION@/modules/xkeysend
Name: input-pad
Description: Input Pad
Version: @VERSION@
Requires: glib-2.0 gtk+-@GTK_API_VERSION@
Requires: gio-2.0 glib-2.0 gtk+-@GTK_API_VERSION@
Cflags: -I${includedir}
Libs: -L${libdir} -linput-pad
39 changes: 2 additions & 37 deletions input-pad.spec.in
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
%{!?have_pygobject3_devel: %define have_pygobject3_devel %(rpm -q --quiet gobject-introspection-devel && echo 1 || echo 0)}
%{!?have_pygobject2_devel: %define have_pygobject2_devel %(rpm -q --quiet python-devel && echo 1 || echo 0)}
%{!?have_xtest_devel: %define have_xtest_devel %(rpm -q --quiet libXtst-devel && echo 1 || echo 0)}
%{!?have_eek_devel: %define have_eek_devel %(rpm -q --quiet eekboard-devel && echo 1 || echo 0)}

%if %have_pygobject2_devel
%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5)
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%endif
%endif

%define sub_version @libinput_pad_VERSION@
%define libxklavier_version 4.0
%define libxml2_version 2.0
%define gtk3_version 3.10

%define libinput_paddir %{_libdir}/%{name}-%sub_version
%define moduledir %{_libdir}/%{name}-%sub_version/modules
Expand All @@ -31,7 +25,7 @@ Source0: http://input-pad.googlecode.com/files/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires: gettext-devel
BuildRequires: gtk2-devel
BuildRequires: gtk3-devel >= %gtk3_version
BuildRequires: libtool
BuildRequires: libxkbfile-devel
BuildRequires: libxklavier-devel >= %libxklavier_version
Expand All @@ -44,10 +38,6 @@ BuildRequires: libXtst-devel
%if %have_pygobject3_devel
BuildRequires: gobject-introspection-devel
%endif
%if %have_pygobject2_devel
BuildRequires: python2-devel
BuildRequires: swig
%endif
%if %have_eek_devel
BuildRequires: eekboard-devel
%endif
Expand All @@ -67,17 +57,6 @@ Requires: %{name} = %{version}-%{release}
%description devel
The input-pad-devel package contains the header files.

%if %have_pygobject2_devel
%package pygobject2
Summary: Input Pad for Python GObject2
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}
Requires: pygtk2

%description pygobject2
The input-pad-pygobject2 package contains the python wrapper files.
%endif

%if %have_xtest_devel
%package xtest
Summary: Input Pad with XTEST extension
Expand All @@ -103,9 +82,6 @@ The input-pad-eek package contains eekboard extension module

%build
%configure \
%if %have_pygobject2_devel
--enable-pygobject2 \
%endif
%if %have_eek_devel
--enable-eek \
%endif
Expand Down Expand Up @@ -136,10 +112,6 @@ rm -f $RPM_BUILD_ROOT%xkeysenddir/*.a
rm -f $RPM_BUILD_ROOT%kbduidir/*.la
rm -f $RPM_BUILD_ROOT%kbduidir/*.a
%endif
%if %have_pygobject2_devel
rm -f $RPM_BUILD_ROOT%python_sitearch/%{name}-%sub_version/*.la
rm -f $RPM_BUILD_ROOT%python_sitearch/%{name}-%sub_version/*.a
%endif

%find_lang %{name}

Expand Down Expand Up @@ -174,13 +146,6 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/gir-1.0/InputPad-1.0.gir
%endif

%if %have_pygobject2_devel
%files pygobject2
%defattr(-,root,root,-)
%python_sitearch/%{name}-%sub_version
%python_sitearch/pyinput_pad.pth
%endif

%if %have_xtest_devel
%files xtest
%defattr(-,root,root,-)
Expand Down
41 changes: 16 additions & 25 deletions input-pad/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#
# input-pad - The input pad
#
# Copyright (c) 2010-2013 Takao Fujiwara <takao.fujiwara1@gmail.com>
# Copyright (c) 2010-2013 Red Hat, Inc.
# Copyright (c) 2010-2014 Takao Fujiwara <takao.fujiwara1@gmail.com>
# Copyright (c) 2010-2014 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -50,6 +50,8 @@ BUILT_SOURCES = \
input-pad-marshal.h \
$(NULL)

MAINTAINERCLEANFILES = resources.c

libinput_pad_publicdir = $(includedir)/$(PACKAGE)-$(libinput_pad_VERSION)
libinput_pad_public_HEADERS = \
input-pad-group.h \
Expand All @@ -75,11 +77,13 @@ libinput_pad_la_SOURCES = \
input-pad-private.h \
kbdui-gtk.c \
parse-pad.c \
resources.c \
unicode_block.h \
window-gtk.c \
$(NULL)

libinput_pad_la_CFLAGS = \
$(GTK3_CFLAGS) \
$(GMODULE2_CFLAGS) \
$(LIBXML2_CFLAGS) \
$(X11_CFLAGS) \
Expand All @@ -88,6 +92,7 @@ libinput_pad_la_CFLAGS = \
$(NULL)

libinput_pad_la_LIBADD = \
$(GTK3_LIBS) \
$(GMODULE2_LIBS) \
$(LIBXML2_LIBS) \
$(X11_LIBS) \
Expand All @@ -101,13 +106,8 @@ libinput_pad_la_LDFLAGS = \
$(no_undefined) \
$(NULL)

if HAVE_GTK3
libinput_pad_la_CFLAGS += $(GTK3_CFLAGS)
libinput_pad_la_LIBADD += $(GTK3_LIBS)
else
libinput_pad_la_CFLAGS += $(GTK2_CFLAGS)
libinput_pad_la_LIBADD += $(GTK2_LIBS)
endif
resources.c: input-pad.gresource.xml
$(GLIB_COMPILE_RESOURCES) $< --target=$@ --generate-source

input-pad-marshal.h: input-pad-marshal.list
@$(GLIB_GENMARSHAL) $< --prefix=INPUT_PAD --header > $@ \
Expand All @@ -134,11 +134,13 @@ libinput_pad_xtest_gdk_la_SOURCES = \
$(NULL)

libinput_pad_xtest_gdk_la_CFLAGS = \
$(GTK3_CFLAGS) \
$(X11_CFLAGS) \
$(NULL)

libinput_pad_xtest_gdk_la_LIBADD = \
$(builddir)/libinput-pad.la \
$(GTK3_LIBS) \
$(X11_LIBS) \
$(XTEST_LIBS) \
$(NULL)
Expand All @@ -148,15 +150,6 @@ libinput_pad_xtest_gdk_la_LDFLAGS = \
-avoid-version \
$(no_undefined) \
$(NULL)

if HAVE_GTK3
libinput_pad_xtest_gdk_la_CFLAGS += $(GTK3_CFLAGS)
libinput_pad_xtest_gdk_la_LIBADD += $(GTK3_LIBS)
else
libinput_pad_xtest_gdk_la_CFLAGS += $(GTK2_CFLAGS)
libinput_pad_xtest_gdk_la_LIBADD += $(GTK2_LIBS)
endif

endif

if HAVE_EEK
Expand Down Expand Up @@ -214,13 +207,7 @@ InputPad_1_0_gir_SCANNERFLAGS = \
--pkg-export=input-pad \
--warn-all \
$(INPUT_PAD_GIR_SCANNERFLAGS)
InputPad_1_0_gir_INCLUDES = GLib-2.0 GObject-2.0 Gio-2.0
if HAVE_GTK3
InputPad_1_0_gir_INCLUDES += Gtk-3.0
else
InputPad_1_0_gir_INCLUDES += Gtk-2.0
InputPad_1_0_gir_SCANNERFLAGS += --pkg=gtk+-2.0
endif
InputPad_1_0_gir_INCLUDES = GLib-2.0 GObject-2.0 Gio-2.0 Gtk-3.0
InputPad_1_0_gir_LIBS = $(libinput_pad_LTLIBRARIES)
InputPad_1_0_gir_FILES = $(addprefix $(srcdir)/,$(introspection_files))
InputPad_1_0_gir_CFLAGS = -DIBUS_COMPILATION
Expand Down Expand Up @@ -254,6 +241,10 @@ CLEANFILES += \

EXTRA_DIST = \
$(man_one_in_files) \
app-menu.ui \
dialog.ui \
input-pad.gresource.xml \
input-pad-marshal.list \
unicode_block.sh \
window-gtk.ui \
$(NULL)
Loading

0 comments on commit c3c3ea1

Please sign in to comment.