Commit f9f82573 authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #9815: restored gtk2 support

parent ea88c480
......@@ -15,9 +15,7 @@ AC_PROG_INSTALL
AC_HEADER_STDC
LT_INIT
dnl Only need these for moving to gtk3
MIGRATION_CFLAGS="-DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGTK_DISABLE_SINGLE_INCLUDES"
CFLAGS="$CFLAGS -Wall -Wextra -Wshadow $MIGRATION_CFLAGS"
CFLAGS="$CFLAGS -Wall -Wextra -Wshadow"
dnl GCONF utilities
AM_GCONF_SOURCE_2
......@@ -32,10 +30,10 @@ if echo "$LIBNOTIFY_LIBS" | grep -q gtk+-x11-2.0; then
AC_MSG_ERROR([Your libnotify is linked with GTK+2 ! Install libnotify4-dev])
exit 1
fi
PKG_CHECK_MODULES(GTK, gtk+-3.0)
PKG_CHECK_MODULES(GTK, gtk+-3.0, , [PKG_CHECK_MODULES(GTK, gtk+-2.0)])
PKG_CHECK_MODULES(GCONF, gconf-2.0)
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.24)
PKG_CHECK_MODULES(WEBKIT, webkitgtk-3.0)
PKG_CHECK_MODULES(WEBKIT, webkitgtk-3.0,, [PKG_CHECK_MODULES(WEBKIT, webkit-1.0)])
PKG_CHECK_MODULES(X11, x11)
PKG_CHECK_MODULES(JAVASCRIPT_CORE_GTK, javascriptcoregtk-3.0, ,
AC_MSG_RESULT(javascriptcoregtk not installed))
......
......@@ -28,13 +28,14 @@ sflphone_client_gnome_SOURCES = \
reqaccount.c \
eel-gconf-extensions.c \
shortcuts.c \
str_utils.c
str_utils.c \
gtk2_wrappers.c
noinst_HEADERS = actions.h sflnotify.h mainwindow.h dialpad.h codeclist.h \
reqaccount.h sflphone_const.h uimanager.h accountlist.h \
sliders.h statusicon.h callable_obj.h conference_obj.h \
shortcuts.h eel-gconf-extensions.h logger.h imwindow.h \
unused.h str_utils.h
unused.h str_utils.h gtk2_wrappers.h
sflphone_client_gnome_LDADD = $(DBUSGLIB_LIBS) $(LIBNOTIFY_LIBS) \
$(NOTIFY_LIBS) $(SFLPHONEGTK_LIBS) $(X11_LIBS) \
......
......@@ -40,6 +40,7 @@
#include <gtk/gtk.h>
#include "config.h"
#include "gtk2_wrappers.h"
#include "str_utils.h"
#include "logger.h"
#include "actions.h"
......
......@@ -39,6 +39,7 @@
#include "utils.h"
#include "unused.h"
#include "logger.h"
#include "gtk2_wrappers.h"
#include <glib/gi18n.h>
#include <string.h>
......
......@@ -29,6 +29,7 @@
*/
#include "addressbook-config.h"
#include "gtk2_wrappers.h"
#include "str_utils.h"
#include "dbus.h"
#include "unused.h"
......
......@@ -30,6 +30,7 @@
#include <string.h>
#include <glib/gi18n.h>
#include "gtk2_wrappers.h"
#include "unused.h"
#include "assistant.h"
#include "logger.h"
......
......@@ -29,6 +29,7 @@
*/
#include <glib/gi18n.h>
#include "gtk2_wrappers.h"
#include "str_utils.h"
#include "audioconf.h"
#include "utils.h"
......
......@@ -29,6 +29,7 @@
*/
#include <glib/gi18n.h>
#include "gtk2_wrappers.h"
#include "str_utils.h"
#include "hooks-config.h"
#include "dbus.h"
......
......@@ -39,6 +39,7 @@
#include <string.h>
#include <assert.h>
#include "gtk2_wrappers.h"
#include "eel-gconf-extensions.h"
#include "dbus.h"
#include "logger.h"
......
......@@ -28,6 +28,7 @@
* as that of the covered work.
*/
#include "gtk2_wrappers.h"
#include <glib/gi18n.h>
#include <gdk/gdk.h>
#include <X11/XKBlib.h>
......
......@@ -29,6 +29,7 @@
*/
#include "tlsadvanceddialog.h"
#include "gtk2_wrappers.h"
#include "str_utils.h"
#include "sflphone_const.h"
#include "mainwindow.h"
......
......@@ -36,6 +36,7 @@
#include <string.h>
#include <stdlib.h>
#include "gtk2_wrappers.h"
#include "eel-gconf-extensions.h"
#include "unused.h"
#include "dbus.h"
......
......@@ -32,6 +32,7 @@
*/
#include <glib/gi18n.h>
#include "gtk2_wrappers.h"
#include "searchbar.h"
#include "calltree.h"
#include "calltab.h"
......@@ -46,18 +47,18 @@ static GtkWidget * searchbox;
static GtkWidget * addressbookentry;
static GtkWidget * cbox;
static GtkListStore * liststore = NULL;
static GtkListStore * liststore;
static gint cboxSignalId;
static GtkWidget *menu = NULL;
static GtkWidget *menu;
/**
* Searchbar icons
*/
static GdkPixbuf *incoming_pixbuf = NULL;
static GdkPixbuf *outgoing_pixbuf = NULL;
static GdkPixbuf *missed_pixbuf = NULL;
static GdkPixbuf *incoming_pixbuf;
static GdkPixbuf *outgoing_pixbuf;
static GdkPixbuf *missed_pixbuf;
void searchbar_addressbook_activated(GtkEntry *entry, gchar *arg1 UNUSED, gpointer data UNUSED)
{
......
/*
* 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., 675 Mass Ave, Cambridge, MA 02139, 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"
#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_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, GtkRequisition *max_size)
{
if (max_size)
gtk_widget_size_request(widget, max_size);
else if (min_size)
gtk_widget_size_request(widget, min_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);
}
void
gtk_combo_box_text_append(GtkComboBoxText *combo_box, const gchar *id, const gchar *text)
{
g_assert(!id);
gtk_combo_box_append_text(GTK_COMBO_BOX(combo_box), text);
}
#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., 675 Mass Ave, Cambridge, MA 02139, 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 *max_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);
void
gtk_combo_box_text_append(GtkComboBoxText *combo_box, const gchar *id, const gchar *text);
#endif
#endif // BOX_H_
......@@ -30,7 +30,11 @@
* as that of the covered work.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "gtk2_wrappers.h"
#include "eel-gconf-extensions.h"
#include "logger.h"
#include "imwindow.h"
......@@ -41,9 +45,8 @@
#include <sys/stat.h>
/** Local variables */
static GtkWidget *im_window = NULL;
static GtkWidget *im_notebook = NULL;
static GtkWidget *im_window;
static GtkWidget *im_notebook;
static void im_window_init();
......
......@@ -30,8 +30,11 @@
* as that of the covered work.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "str_utils.h"
#endif
#include "gtk2_wrappers.h"
#include "actions.h"
#include "dbus.h"
#include "calltree.h"
......
......@@ -29,6 +29,7 @@
*/
#include <glib/gi18n.h>
#include "gtk2_wrappers.h"
#include "sliders.h"
#include "dbus/dbus.h"
#include "actions.h"
......
......@@ -28,7 +28,11 @@
* as that of the covered work.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "gtk2_wrappers.h"
#include "str_utils.h"
#include "preferencesdialog.h"
#include "logger.h"
......
......@@ -26,6 +26,7 @@
#include <gtk/gtk.h>
#include "unused.h"
#include "sflphone_const.h"
#include "gtk2_wrappers.h"
#include "minidialog.h"
#define HIG_BOX_SPACE 6
......
Supports Markdown
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