1 /* gtkcompat.c: various compatibility bits between GTK versions
2    Copyright (c) 2012-2014 Philip Kendall
3 
4    This program is free software; you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation; either version 2 of the License, or
7    (at your option) any later version.
8 
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13 
14    You should have received a copy of the GNU General Public License along
15    with this program; if not, write to the Free Software Foundation, Inc.,
16    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 
18    Author contact information:
19 
20    E-mail: philip-fuse@shadowmagic.org.uk
21 
22 */
23 
24 #include <config.h>
25 
26 #include <gtk/gtk.h>
27 
28 #include "gtkcompat.h"
29 
30 #if !GTK_CHECK_VERSION( 3, 0, 0 )
31 
32 GtkWidget *
gtk_box_new(GtkOrientation orientation,gint spacing)33 gtk_box_new( GtkOrientation orientation, gint spacing )
34 {
35   return ( orientation == GTK_ORIENTATION_HORIZONTAL )?
36           gtk_hbox_new( FALSE, spacing ) :
37           gtk_vbox_new( FALSE, spacing );
38 }
39 
40 GtkWidget *
gtk_separator_new(GtkOrientation orientation)41 gtk_separator_new( GtkOrientation orientation )
42 {
43   return ( orientation == GTK_ORIENTATION_HORIZONTAL )?
44           gtk_hseparator_new() :
45           gtk_vseparator_new();
46 }
47 
48 GtkWidget *
gtk_scrollbar_new(GtkOrientation orientation,GtkAdjustment * adjustment)49 gtk_scrollbar_new( GtkOrientation orientation, GtkAdjustment *adjustment )
50 {
51   return ( orientation == GTK_ORIENTATION_HORIZONTAL )?
52           gtk_hscrollbar_new( adjustment ) :
53           gtk_vscrollbar_new( adjustment );
54 }
55 
56 #endif                /* #if !GTK_CHECK_VERSION( 3, 0, 0 ) */
57