"Fossies" - the Fresh Open Source Software Archive

Member "genius-1.0.24/vte/src/vte-gtk-compat.h" (16 Aug 2011, 3072 Bytes) of package /linux/misc/genius-1.0.24.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "vte-gtk-compat.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  * Copyright (C) 2010 Saleem Abdulrasool <compnerd@compnerd.org>
    3  *
    4  * This is free software; you can redistribute it and/or modify it under the
    5  * terms of the GNU Library General Public License as published by the Free
    6  * Software Foundation; either version 2 of the License, or (at your option)
    7  * any later version.
    8  *
    9  * This program is distributed in the hope that it will be useful, but WITHOUT
   10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   12  * more details.
   13  *
   14  * You should have received a copy of the GNU Library General Public License
   15  * along with this program; if not, write to the Free Software Foundation,
   16  * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   17  */
   18 
   19 #ifndef vte_gtk_compat_h_included
   20 #define vte_gtk_compat_h_included
   21 
   22 #include <gtk/gtk.h>
   23 
   24 G_BEGIN_DECLS
   25 
   26 #if GTK_CHECK_VERSION (2, 90, 5)
   27 
   28 #define GdkRegion cairo_region_t
   29 #define VteRegionRectangle cairo_rectangle_int_t
   30 #define gdk_region_new() cairo_region_create()
   31 #define gdk_region_rectangle(r) cairo_region_create_rectangle(r)
   32 #define gdk_region_copy(r) cairo_region_copy(r)
   33 #define gdk_region_destroy cairo_region_destroy
   34 #define gdk_region_union_with_rect(r, rect) cairo_region_union_rectangle(r, rect)
   35 #define gdk_region_union(r, s) cairo_region_union(r, s)
   36 #define gdk_region_get_clipbox(r, rect) cairo_region_get_extents(r, rect)
   37 #define gdk_region_get_rectangles(r, rects, n_rects)            \
   38     do {                                \
   39         int i;                          \
   40                                     \
   41         *(n_rects) = cairo_region_num_rectangles(r);        \
   42         *(rects) = g_new(cairo_rectangle_int_t, *(n_rects));    \
   43         for (i = 0; i < *(n_rects); i++)            \
   44             cairo_region_get_rectangle ((r), i, &(*(rects))[i]); \
   45     } while (0)
   46 
   47 #else
   48 
   49 #define VteRegionRectangle GdkRectangle
   50 
   51 #endif
   52 
   53 #if !GTK_CHECK_VERSION (2, 90, 8)
   54 #define gdk_error_trap_pop_ignored gdk_error_trap_pop
   55 #endif
   56 
   57 #if !GTK_CHECK_VERSION (2, 22, 0)
   58 #define gtk_accessible_get_widget(accessible)           ((accessible)->widget)
   59 #endif
   60 
   61 #if !GTK_CHECK_VERSION (2, 20, 0)
   62 #define gtk_widget_get_mapped(widget)                   (GTK_WIDGET_MAPPED ((widget)))
   63 #define gtk_widget_get_realized(widget)                 (GTK_WIDGET_REALIZED ((widget)))
   64 #define gtk_widget_set_realized(widget, state)          ((state) ? GTK_WIDGET_SET_FLAGS ((widget), GTK_REALIZED) : GTK_WIDGET_UNSET_FLAGS ((widget), GTK_REALIZED))
   65 #endif
   66 
   67 #if !GTK_CHECK_VERSION (2, 18, 0)
   68 #define gtk_widget_has_focus(widget)                    (GTK_WIDGET_HAS_FOCUS ((widget)))
   69 #define gtk_widget_get_state(widget)                    ((widget)->state)
   70 #define gtk_widget_set_window(widget, wndw)             ((widget)->window = (wndw))
   71 #define gtk_widget_is_drawable(widget)                  (GTK_WIDGET_DRAWABLE ((widget)))
   72 #define gtk_widget_get_allocation(widget, alloc)        (*(alloc) = (widget)->allocation)
   73 #define gtk_widget_set_allocation(widget, alloc)        ((widget)->allocation = *(alloc))
   74 #define gtk_widget_get_double_buffered(widget)          (GTK_WIDGET_DOUBLE_BUFFERED ((widget)))
   75 #endif
   76 
   77 G_END_DECLS
   78 
   79 #endif
   80