1 /* 2 * Copyright (c) 2003-2005, 2010 by the gtk2-perl team (see the file AUTHORS) 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Library General Public 6 * License as published by the Free Software Foundation; either 7 * version 2.1 of the License, or (at your option) any later version. 8 * 9 * This library 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 GNU 12 * Library General Public License for more details. 13 * 14 * You should have received a copy of the GNU Library General Public 15 * License along with this library; if not, write to the 16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 * Boston, MA 02110-1301 USA. 18 * 19 * $Id$ 20 */ 21 22 #include "gtk2perl.h" 23 24 MODULE = Gtk2::Gdk::Cursor PACKAGE = Gtk2::Gdk::Cursor PREFIX = gdk_cursor_ 25 26 =for position DESCRIPTION 27 28 =head1 DESCRIPTION 29 30 For reference, cursors are a per-display resource and can only be used 31 with the display they were created on. 32 33 As of Gtk 2.22 a cursor doesn't keep a reference to its 34 C<Gtk2::Gdk::Display> and if the display object is destroyed before 35 the cursor then a later destroy of the cursor may get a segv. 36 Perl-Gtk2 doesn't try to do anything about this. Care may be needed 37 if keeping a cursor separate from a widget or window. (Closing the 38 display is fine, but not destroying it.) 39 40 =cut 41 42 GdkCursorType 43 gdk_cursor_type (cursor) 44 GdkCursor *cursor 45 CODE: 46 RETVAL = cursor->type; 47 OUTPUT: 48 RETVAL 49 50 #if GTK_CHECK_VERSION(2,2,0) 51 52 ## GdkCursor* gdk_cursor_new_for_display (GdkDisplay *display, GdkCursorType cursor_type) 53 GdkCursor_own* 54 gdk_cursor_new_for_display (class, display, cursor_type) 55 GdkDisplay *display 56 GdkCursorType cursor_type 57 C_ARGS: 58 display, cursor_type 59 60 ## GdkDisplay* gdk_cursor_get_display (GdkCursor *cursor) 61 GdkDisplay* 62 gdk_cursor_get_display (cursor) 63 GdkCursor *cursor 64 65 #endif 66 67 ## GdkCursor* gdk_cursor_new (GdkCursorType cursor_type) 68 GdkCursor_own* 69 gdk_cursor_new (class, cursor_type) 70 GdkCursorType cursor_type 71 C_ARGS: 72 cursor_type 73 74 ## GdkCursor* gdk_cursor_new_from_pixmap (GdkPixmap *source, GdkPixmap *mask, GdkColor *fg, GdkColor *bg, gint x, gint y) 75 GdkCursor_own* 76 gdk_cursor_new_from_pixmap (class, source, mask, fg, bg, x, y) 77 GdkPixmap *source 78 GdkPixmap *mask 79 GdkColor *fg 80 GdkColor *bg 81 gint x 82 gint y 83 C_ARGS: 84 source, mask, fg, bg, x, y 85 86 87 #if GTK_CHECK_VERSION(2, 4, 0) 88 89 ## GdkCursor * gdk_cursor_new_from_pixbuf (GdkDisplay *display, GdkPixbuf *pixbuf, gint x, gint y) 90 GdkCursor_own * 91 gdk_cursor_new_from_pixbuf (class, display, pixbuf, x, y) 92 GdkDisplay *display 93 GdkPixbuf *pixbuf 94 gint x 95 gint y 96 C_ARGS: 97 display, pixbuf, x, y 98 99 #endif 100 101 #if GTK_CHECK_VERSION (2, 8, 0) 102 103 ## GdkCursor* gdk_cursor_new_from_name (GdkDisplay *display, const gchar *name); 104 GdkCursor_own* 105 gdk_cursor_new_from_name (class, display, name) 106 GdkDisplay *display 107 const gchar *name 108 C_ARGS: 109 display, name 110 111 GdkPixbuf_noinc* gdk_cursor_get_image (GdkCursor *cursor); 112 113 #endif 114 115 #if GTK_CHECK_VERSION (2, 22, 0) 116 117 GdkCursorType gdk_cursor_get_cursor_type (GdkCursor *cursor); 118 119 #endif /* 2.22 */ 120