Commit 2cb83c01 authored by Tristan Matthews's avatar Tristan Matthews

* #18398: gnome: drop Gtk2 support

parent 1af1d909
......@@ -38,10 +38,9 @@ AS_IF([test "x$enable_video" = "xyes"], [
AM_CONDITIONAL(SFL_VIDEO, test "x$enable_video" = "xyes")
# Check for gtk+-3.0, otherwise check for gtk+-2.0 (and gthread)
# Check for gtk+-3.0
PKG_CHECK_MODULES(GTK, gtk+-3.0, [AC_MSG_NOTICE(Using gtk+-3.0)],
[PKG_CHECK_MODULES(GTK, gtk+-2.0, [PKG_CHECK_MODULES(GTHREAD, gthread-2.0)],
[AC_MSG_ERROR(gtk-2 not found)])])
[AC_MSG_ERROR(gtk+-3.0 not found)])
AC_SUBST([GETTEXT_PACKAGE], [$PACKAGE_TARNAME])
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [GETTEXT package name])
......
......@@ -32,7 +32,6 @@ libsflphone_client_la_SOURCES = \
shortcuts.c \
str_utils.c \
seekslider.c \
gtk2_wrappers.c \
actions.h \
sflnotify.h \
mainwindow.h \
......@@ -49,7 +48,6 @@ libsflphone_client_la_SOURCES = \
logger.h \
unused.h \
str_utils.h \
gtk2_wrappers.h \
seekslider.h \
account_schema.h \
history_loader.c \
......@@ -60,19 +58,18 @@ libsflphone_client_la_LIBADD = @CLUTTER_LIBS@ @CLUTTERGTK_LIBS@ $(SFLPHONE_LIBS)
libsflphone_client_la_LDFLAGS = @CLUTTER_LDFLAGS@ @DBUSGLIB_LIBS@ @LIBNOTIFY_LIBS@ \
@X11_LIBS@ @GTK_LIBS@ @GLIB_LIBS@ \
$(DL_LIBS) @JAVASCRIPT_CORE_GTK_LIBS@ \
@GTHREAD_LIBS@ @CLUTTERGTK_LDFLAGS@
@CLUTTERGTK_LDFLAGS@
libsflphone_client_la_CFLAGS = @CLUTTER_CFLAGS@ @DBUSGLIB_CFLAGS@ @LIBNOTIFY_CFLAGS@ \
@GTK_CFLAGS@ \
@JAVASCRIPT_CORE_GTK_CFLAGS@ \
@GTHREAD_CFLAGS@ @CLUTTERGTK_CFLAGS@
@CLUTTERGTK_CFLAGS@
sflphone_client_gnome_SOURCES = main.c
sflphone_client_gnome_CFLAGS = @DBUSGLIB_CFLAGS@ @LIBNOTIFY_CFLAGS@ \
@GTK_CFLAGS@ \
@JAVASCRIPT_CORE_GTK_CFLAGS@ \
@GTHREAD_CFLAGS@
@JAVASCRIPT_CORE_GTK_CFLAGS@
sflphone_client_gnome_LDADD = libsflphone_client.la
# add symbolic link
......
......@@ -35,12 +35,8 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
/* Backward compatibility for gtk < 2.22.0 */
#if GTK_CHECK_VERSION(2,22,0)
// FIXME: use newer keysyms names
#include <gdk/gdkkeysyms-compat.h>
#else
#include <gdk/gdkkeysyms.h>
#endif
#include "str_utils.h"
#include "uimanager.h"
......
......@@ -44,7 +44,6 @@
#include <gtk/gtk.h>
#include "config.h"
#include "gtk2_wrappers.h"
#include "str_utils.h"
#include "logger.h"
#include "actions.h"
......
......@@ -40,7 +40,6 @@
#include "utils.h"
#include "unused.h"
#include "logger.h"
#include "gtk2_wrappers.h"
#include <glib/gi18n.h>
#include <string.h>
......
......@@ -29,7 +29,6 @@
*/
#include "addressbook-config.h"
#include "gtk2_wrappers.h"
#include "str_utils.h"
#include "dbus.h"
#include "unused.h"
......
......@@ -30,7 +30,6 @@
#include <string.h>
#include <glib/gi18n.h>
#include "gtk2_wrappers.h"
#include "unused.h"
#include "assistant.h"
#include "logger.h"
......
......@@ -30,7 +30,6 @@
#include <glib/gstdio.h>
#include <glib/gi18n.h>
#include "gtk2_wrappers.h"
#include "str_utils.h"
#include "codeclist.h"
#include "sflphone_const.h"
......
......@@ -29,7 +29,6 @@
*/
#include <glib/gi18n.h>
#include "gtk2_wrappers.h"
#include "str_utils.h"
#include "hooks-config.h"
#include "dbus.h"
......
......@@ -43,7 +43,6 @@
#include <string.h>
#include <assert.h>
#include "gtk2_wrappers.h"
#include "dbus.h"
#include "logger.h"
#include "statusicon.h"
......
......@@ -28,7 +28,6 @@
* as that of the covered work.
*/
#include "gtk2_wrappers.h"
#include <glib/gi18n.h>
#include <gdk/gdk.h>
#include <X11/XKBlib.h>
......
......@@ -29,7 +29,6 @@
*/
#include "tlsadvanceddialog.h"
#include "gtk2_wrappers.h"
#include "str_utils.h"
#include "account_schema.h"
#include "mainwindow.h"
......
......@@ -42,7 +42,6 @@
#include <stdlib.h>
#include <gtk/gtk.h>
#include "gtk2_wrappers.h"
#include "unused.h"
#include "dbus.h"
#include "calltab.h"
......
......@@ -32,7 +32,6 @@
*/
#include <glib/gi18n.h>
#include "gtk2_wrappers.h"
#include "searchbar.h"
#include "calltree.h"
#include "calltab.h"
......@@ -48,7 +47,6 @@ static GtkWidget * searchbox;
static GtkWidget * addressbookentry;
static SearchType HistorySearchType;
static GtkWidget * cbox;
static GtkListStore * liststore;
......
/*
* Copyright (C) 2004-2012 Savoir-Faire Linux Inc.
* Author: Tristan Matthews <tristan.matthews@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
#include "gtk2_wrappers.h"
#include "unused.h"
#if !GTK_CHECK_VERSION(3, 0, 0)
GtkWidget *gtk_box_new(GtkOrientation orientation, gint spacing)
{
if (orientation == GTK_ORIENTATION_HORIZONTAL)
return gtk_hbox_new(FALSE, spacing);
else
return gtk_vbox_new(FALSE, spacing);
}
GtkWidget *gtk_scale_new(GtkOrientation orientation, GtkAdjustment *adjustment)
{
if (orientation == GTK_ORIENTATION_HORIZONTAL)
return gtk_hscale_new(adjustment);
else
return gtk_vscale_new(adjustment);
}
GtkWidget* gtk_button_box_new(GtkOrientation orientation)
{
if (orientation == GTK_ORIENTATION_HORIZONTAL)
return gtk_hbutton_box_new();
else
return gtk_vbutton_box_new();
}
void
gtk_widget_get_preferred_size(GtkWidget* widget, GtkRequisition *min_size UNUSED, GtkRequisition *natural_size)
{
gtk_widget_size_request(widget, natural_size);
}
GdkPixbuf *
gtk_widget_render_icon_pixbuf(GtkWidget *widget, const gchar *stock_id, GtkIconSize size)
{
return gtk_widget_render_icon(widget, stock_id, size, NULL);
}
GtkWidget *
gtk_scale_new_with_range(GtkOrientation orientation, gdouble min, gdouble max,
gdouble step)
{
if (orientation == GTK_ORIENTATION_HORIZONTAL)
return gtk_hscale_new_with_range(min, max, step);
else
return gtk_vscale_new_with_range(min, max, step);
}
GtkWidget *
gtk_separator_new(GtkOrientation orientation)
{
if (orientation == GTK_ORIENTATION_HORIZONTAL)
return gtk_hseparator_new();
else
return gtk_vseparator_new();
}
#endif
/*
* Copyright (C) 2004-2012 Savoir-Faire Linux Inc.
* Author: Tristan Matthews <tristan.matthews@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
#ifndef BOX_H_
#define BOX_H_
#include <gtk/gtk.h>
/* Wrappers needed if using gtk2 */
#if !GTK_CHECK_VERSION(3, 0, 0)
GtkWidget*
gtk_box_new(GtkOrientation orientation, gint spacing);
GtkWidget*
gtk_button_box_new(GtkOrientation orientation);
void
gtk_widget_get_preferred_size(GtkWidget* widget, GtkRequisition *min_size, GtkRequisition *natural_size);
GdkPixbuf *
gtk_widget_render_icon_pixbuf(GtkWidget *widget, const gchar *stock_id, GtkIconSize size);
GtkWidget *
gtk_scale_new_with_range(GtkOrientation orientation, gdouble min, gdouble max,
gdouble step);
GtkWidget *
gtk_scale_new(GtkOrientation orientation, GtkAdjustment *adjustment);
GtkWidget *
gtk_separator_new(GtkOrientation orientation);
#endif
#endif // BOX_H_
......@@ -79,12 +79,6 @@ main(int argc, char *argv[])
* versions of GLib. */
update_schema_dir(argv[0]);
#if !GTK_CHECK_VERSION(2,32,0)
g_thread_init(NULL);
gdk_threads_init();
gdk_threads_enter();
#endif
// Start GTK application
gtk_init(&argc, &argv);
......@@ -133,7 +127,7 @@ main(int argc, char *argv[])
gtk_widget_destroy(dialog);
g_error_free(error);
goto OUT;
return 1;
}
const gboolean show_status = g_settings_get_boolean(settings, "show-status-icon");
......@@ -160,12 +154,7 @@ main(int argc, char *argv[])
g_object_unref(settings);
OUT:
#if !GTK_CHECK_VERSION(2,32,0)
gdk_threads_leave();
#endif
return error != NULL;
return 0;
}
/** @mainpage SFLphone GTK+ Client Documentation
......
......@@ -34,7 +34,6 @@
#include "config.h"
#endif
#include "gtk2_wrappers.h"
#include "account_schema.h"
#include "actions.h"
#include "dbus.h"
......
......@@ -31,7 +31,6 @@
#include "../dbus/dbus.h"
#include <glib.h>
#include "gtk2_wrappers.h"
#include "logger.h"
#include "../mainwindow.h"
#include <string.h>
......
......@@ -34,7 +34,6 @@
#include <stdlib.h>
#include <gtk/gtk.h>
#include <string.h>
#include "gtk2_wrappers.h"
#include "seekslider.h"
#include "dbus.h"
#include "logger.h"
......
......@@ -29,7 +29,6 @@
*/
#include <glib/gi18n.h>
#include "gtk2_wrappers.h"
#include "sliders.h"
#include "dbus/dbus.h"
#include "actions.h"
......
......@@ -32,7 +32,6 @@
#include "config.h"
#endif
#include "gtk2_wrappers.h"
#include "str_utils.h"
#include "preferencesdialog.h"
#include "logger.h"
......
......@@ -26,7 +26,6 @@
#include <gtk/gtk.h>
#include "unused.h"
#include "sflphone_const.h"
#include "gtk2_wrappers.h"
#include "minidialog.h"
#define HIG_BOX_SPACE 6
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment