2 # This file is part of gtkD.
4 # gtkD is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU Lesser General Public License as published by
6 # the Free Software Foundation; either version 2.1 of the License, or
7 # (at your option) any later version.
9 # gtkD 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 Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public License
15 # along with gtkD; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 # Definitions for wrapping Gdk
31 public import gtkc.glibtypes;
32 public import gtkc.gobjecttypes;
33 public import gtkc.pangotypes;
34 public import gtkc.gdkpixbuftypes;
37 alias void* GdkNativeWindow;
63 # must start with wrap
67 ###########################################################
68 ### Gdk ###################################################
69 ###########################################################
71 file: gdk-General.html
76 structWrap: GdkWindow* Window
78 structWrap: GdkCursor* Cursor
93 structWrap: GdkDisplay* Display
95 structWrap: GdkScreen* Screen
97 structWrap: GList* ListG
99 structWrap: GdkEvent* Event
101 #structWrap: GdkScreen** Screen*
102 #import: gdk.ModifierType
103 #structWrap: GdkModifierType* ModifierType
105 structWrap: GdkWindow* Window
106 #import: gdk.DisplayPointerHooks
107 #structWrap: GdkDisplayPointerHooks* DisplayPointerHooks
109 #structWrap: GdkAtom* Atom
112 file: GdkDisplayManager.html
113 struct: GdkDisplayManager
114 class: DisplayManager
115 prefix: gdk_display_manager_
116 import: gdk.DisplayManager
117 structWrap: GdkDisplayManager* DisplayManager
119 structWrap: GdkDisplay* Display
121 structWrap: GSList* ListSG
123 structWrap: GdkDevice* Device
124 outFile: DisplayManager
130 import: gtkc.cairoLibtypes
133 structWrap: GdkScreen* Screen
135 structWrap: GdkColormap* Colormap
137 structWrap: GdkVisual* Visual
139 structWrap: GdkWindow* Window
141 structWrap: GdkDisplay* Display
143 structWrap: GList* ListG
144 import: gdk.Rectangle
145 structWrap: GdkRectangle* Rectangle
147 structWrap: GdkEvent* Event
148 import: gobject.Value
149 structWrap: GValue* Value
152 file: gdk-Points-Rectangles-and-Regions.html
156 prefix: gdk_rectangle_
157 noprefix: gdk_region_
158 import: gdk.Rectangle
159 structWrap: GdkRectangle* Rectangle
167 structWrap: GdkRegion* Region
169 #structWrap: GdkPoint* Point
170 import: gdk.Rectangle
171 structWrap: GdkRectangle* Rectangle
172 #import: gdk.Rectangle*
173 #structWrap: GdkRectangle** Rectangle*
175 #structWrap: GdkSpan* Span
178 file: gdk-Graphics-Contexts.html
183 structWrap: GdkDrawable* Drawable
184 #import: gdk.GCValues
185 #structWrap: GdkGCValues* GCValues
187 structWrap: GdkScreen* Screen
189 structWrap: GdkGC* GC
191 structWrap: GdkColor* Color
193 structWrap: GdkFont* Font
195 structWrap: GdkPixmap* Pixmap
197 structWrap: GdkBitmap* Bitmap
198 #import: gdk.Rectangle
199 #structWrap: GdkRectangle* Rectangle
201 structWrap: GdkRegion* Region
203 structWrap: GdkColormap* Colormap
206 file: gdk-Drawing-Primitives.html
209 prefix: gdk_drawable_
213 structWrap: GdkDrawable* Drawable
215 structWrap: GdkDisplay* Display
217 structWrap: GdkScreen* Screen
219 structWrap: GdkVisual* Visual
221 structWrap: GdkColormap* Colormap
223 structWrap: GdkRegion* Region
225 structWrap: GdkGC* GC
227 #structWrap: GdkPoint* Point
229 structWrap: GdkPixbuf* Pixbuf
231 #structWrap: GdkSegment* Segment
232 #import: gdk.Trapezoid
233 #structWrap: GdkTrapezoid* Trapezoid
235 structWrap: GdkColor* Color
237 structWrap: GdkFont* Font
239 #structWrap: GdkWChar* WChar
241 structWrap: GdkImage* ImageGdk
243 import: pango.PgContext
244 structWrap: PangoContext* PgContext
246 structWrap: PangoItem* PgItem
247 import: pango.PgLayout
248 structWrap: PangoLayout* PgLayout
249 import: pango.PgFontDescription
250 structWrap: PangoFontDescription* PgFontDescription
251 import: pango.PgFontMetrics
252 structWrap: PangoFontMetrics* PgFontMetrics
253 import: pango.PgFontFamily
254 structWrap: PangoFontFamily* PgFontFamily
255 import: pango.PgFontFace
256 structWrap: PangoFontFace* PgFontFace
257 import: pango.PgFontMap
258 structWrap: PangoFontMap* PgFontMap
259 import: pango.PgFontsetSimple
260 structWrap: PangoFontsetSimple* PgFontsetSimple
261 import: pango.PgAttribute
262 structWrap: PangoAttribute* PgAttribute
263 import: pango.PgAttributeList
264 structWrap: PangoAttributeList* PgAttributeList
265 import: pango.PgLanguage
266 structWrap: PangoLanguage* PgLanguage
267 import: pango.PgTabArray
268 structWrap: PangoTabArray* PgTabArray
269 import: pango.PgLayout
270 structWrap: PangoLayout* PgLayout
271 import: pango.PgLayoutIter
272 structWrap: PangoLayoutIter* PgLayoutIter
273 import: pango.PgScriptIter
274 structWrap: PangoScriptIter* PgScriptIter
278 * Draws an outlined or filled polygon.
280 * a GdkDrawable (a GdkWindow or a GdkPixmap).
284 * TRUE if the polygon should be filled. The polygon is closed
285 * automatically, connecting the last point to the first point if
288 * an array of GdkPoint structures specifying the points making
291 public void drawPolygon(GC gc, int filled, GdkPoint[] points)
293 // void gdk_draw_polygon (GdkDrawable *drawable, GdkGC *gc, gboolean filled, GdkPoint *points, gint npoints);
294 gdk_draw_polygon(gdkDrawable, gc.getGCStruct(), filled, points.ptr, points.length);
297 public void drawPixbuf(Pixbuf pixbuf, int destX, int destY)
299 drawPixbuf(null, pixbuf, destX, destY);
301 public void drawPixbuf(GC gc, Pixbuf pixbuf, int destX, int destY)
303 if ( pixbuf is null ) return;
304 gdk_draw_pixbuf(gdkDrawable,
305 (gc is null) ? null : gc.getGCStruct(),
306 pixbuf.getPixbufStruct(),
308 pixbuf.getWidth(), pixbuf.getHeight(),
320 file: gdk-Bitmaps-and-Pixmaps.html
325 noprefix: gdk_bitmap_
328 structWrap: GdkDrawable* Drawable
330 structWrap: GdkPixmap* Pixmap
332 structWrap: GdkColor* Color
334 #structWrap: GdkBitmap** Bitmap*
336 structWrap: GdkColormap* Colormap
345 structWrap: GdkBitmap* Bitmap
347 structWrap: GdkDrawable* Drawable
350 file: gdk-GdkRGB.html
354 structWrap: GdkDrawable* Drawable
356 structWrap: GdkGC* GC
358 #structWrap: GdkRgbCmap* RgbCmap
360 structWrap: GdkColormap* Colormap
362 structWrap: GdkColor* Color
364 structWrap: GdkVisual* Visual
367 file: gdk-Images.html
372 structWrap: GdkVisual* Visual
374 structWrap: GdkDrawable* Drawable
376 structWrap: GdkColormap* Colormap
379 ## move to GdkPixbuf? no?
380 ## extend GdkPixbuf? Yes?
384 file: gdk-Pixbufs.html
391 noprefix: gdk_pixbuf_ref
392 noprefix: gdk_pixbuf_unref
394 #structWrap: GError** Error*
395 #import: gdkpixbuf.Pixbuf
396 structWrap: GdkPixbuf* Pixbuf
397 import: gdkpixbuf.PixbufFormat
398 structWrap: GdkPixbufFormat* PixbufFormat
400 structWrap: GdkDrawable* Drawable
402 structWrap: GdkBitmap* Bitmap
404 structWrap: GdkColormap* Colormap
406 structWrap: GdkImage* ImageGdk
408 # this will create a new pixbuf but the wrapper will pass the existing pixbuf struct
409 nocode: gdk_pixbuf_get_from_drawable
413 * Transfers image data from a GdkDrawable and converts it to an RGB(A)
414 * representation inside a GdkPixbuf. In other words, copies
415 * image data from a server-side drawable to a client-side RGB(A) buffer.
416 * This allows you to efficiently read individual pixels on the client side.
417 * If the drawable src has no colormap (gdk_drawable_get_colormap()
418 * returns NULL), then a suitable colormap must be specified.
419 * Typically a GdkWindow or a pixmap created by passing a GdkWindow
420 * to gdk_pixmap_new() will already have a colormap associated with
421 * it. If the drawable has a colormap, the cmap argument will be
422 * ignored. If the drawable is a bitmap (1 bit per pixel pixmap),
423 * then a colormap is not required; pixels with a value of 1 are
424 * assumed to be white, and pixels with a value of 0 are assumed to be
425 * black. For taking screenshots, gdk_colormap_get_system() returns
426 * the correct colormap to use.
427 * If the specified destination pixbuf dest is NULL, then this
428 * function will create an RGB pixbuf with 8 bits per channel and no
429 * alpha, with the same size specified by the width and height
430 * arguments. In this case, the dest_x and dest_y arguments must be
431 * specified as 0. If the specified destination pixbuf is not NULL
432 * and it contains alpha information, then the filled pixels will be
433 * set to full opacity (alpha = 255).
434 * If the specified drawable is a pixmap, then the requested source
435 * rectangle must be completely contained within the pixmap, otherwise
436 * the function will return NULL. For pixmaps only (not for windows)
437 * passing -1 for width or height is allowed to mean the full width
438 * or height of the pixmap.
439 * If the specified drawable is a window, and the window is off the
440 * screen, then there is no image data in the obscured/offscreen
441 * regions to be placed in the pixbuf. The contents of portions of the
442 * pixbuf corresponding to the offscreen region are undefined.
443 * If the window you're obtaining data from is partially obscured by
444 * other windows, then the contents of the pixbuf areas corresponding
445 * to the obscured regions are undefined.
446 * If the target drawable is not mapped (typically because it's
447 * iconified/minimized or not on the current workspace), then NULL
449 * If memory can't be allocated for the return value, NULL will be returned
451 * (In short, there are several ways this function can fail, and if it fails
452 * it returns NULL; so check the return value.)
453 * This function calls gdk_drawable_get_image() internally and
454 * converts the resulting image to a GdkPixbuf, so the
455 * documentation for gdk_drawable_get_image() may also be relevant.
457 * Destination pixbuf, or NULL if a new pixbuf should be created.
461 * A colormap if src doesn't have one set.
463 * Source X coordinate within drawable.
465 * Source Y coordinate within drawable.
467 * Destination X coordinate in pixbuf, or 0 if dest is NULL.
469 * Destination Y coordinate in pixbuf, or 0 if dest is NULL.
471 * Width in pixels of region to get.
473 * Height in pixels of region to get.
475 * The same pixbuf as dest if it was non-NULL, or a newly-created
476 * pixbuf with a reference count of 1 if no destination pixbuf was specified, or NULL on error
478 public Pixbuf getFromDrawable(Drawable src, Colormap cmap, int srcX, int srcY, int destX, int destY, int width, int height)
480 // GdkPixbuf* gdk_pixbuf_get_from_drawable (GdkPixbuf *dest, GdkDrawable *src, GdkColormap *cmap, int src_x, int src_y, int dest_x, int dest_y, int width, int height);
481 return new Pixbuf( gdk_pixbuf_get_from_drawable(null, (src is null) ? null : src.getDrawableStruct(), (cmap is null) ? null : cmap.getColormapStruct(), srcX, srcY, destX, destY, width, height) );
485 * SetFromDrawable is different from GetFrom Drawable as it doesn't create a new pixbuf
487 public void setFromDrawable(Drawable src, int srcX, int srcY, int width, int height)
489 gdk_pixbuf_get_from_drawable(
490 gdkPixbuf, // gdkPixbuf
491 src.getDrawableStruct(),
494 0, 0, // destination x and y
499 * Creates a new Pixbuf from a drawable.
500 * this is a simplyfied GetFromDrawable
502 this(Drawable src, int srcX, int srcY, int width, int height)
504 GdkPixbuf* pb = gdk_pixbuf_get_from_drawable(
506 src.getDrawableStruct(),
509 0, 0, // destination x and y
518 file: ../gdk-pixbuf/gdk-pixbuf-creating.html
523 gdk_pixbuf_get_type ()
525 GType gdk_pixbuf_get_type ();
531 file: ../gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html
534 file: ../gdk-pixbuf/gdk-pixbuf-refcounting.html
537 file: ../gdk-pixbuf/gdk-pixbuf-file-loading.html
538 noprefix: gdk_pixbuf_get_file_info
541 file: ../gdk-pixbuf/gdk-pixbuf-file-saving.html
544 file: ../gdk-pixbuf/gdk-pixbuf-scaling.html
547 file: ../gdk-pixbuf/gdk-pixbuf-util.html
550 file: gdk-Colormaps-and-Colors.html
554 prefix: gdk_colormap_
557 structWrap: GdkVisual* Visual
559 structWrap: GdkColormap* Colormap
561 structWrap: GdkColor* Color
563 structWrap: GdkScreen* Screen
572 structWrap: GdkColor* Color
574 structWrap: GdkColormap* Colormap
582 * Creates a new Color
589 this(ubyte red, ubyte green, ubyte blue)
592 set8(red, green, blue);
596 * Creates a new Color with RGB values
601 this(guint16 red, guint16 green, guint16 blue)
604 //printf("Color.this red , green , blue = %d %d %d\n", red, green, blue);
611 //printf("Color.this uint %X\n",rgb);
612 set( ((rgb&0xFFFF)),((rgb&0xFFFF00000000)>>32),(rgb&0xFFFF0000)>>16);
618 //printf("Color.this int %X\n",rgb);
619 set8( cast(byte)((rgb&0xFF0000)>>16),cast(byte)((rgb&0x00FF00)>>8),cast(byte)(rgb&0xFF));
626 _black = new Color(cast(ubyte)0,cast(ubyte)0,cast(ubyte)0);
634 _white = new Color(cast(ubyte)255,cast(ubyte)255,cast(ubyte)255);
640 * Sets the Color with RGB values
645 void set(guint16 red, guint16 green, guint16 blue)
647 //printf("Color.set %X %X %X\n",red,green,blue);
649 gdkColor.green = green;
650 gdkColor.blue = blue;
651 gdkColor.pixel = (red&0xFF00 << 8) | (green&0xFF00) | (blue >> 8) ;
652 //printf("Color.pixel %X \n",gdkColor.pixel);
654 //printf("set pixel = %X\n", gdkColor.pixel);
657 void set8(ubyte red, ubyte green, ubyte blue)
659 //printf("Color.set %X %X %X\n",red,green,blue);
661 gdkColor.red = red * 257;
662 gdkColor.green = green * 257;
663 gdkColor.blue = blue * 257;
664 gdkColor.pixel = (red << 16) | (green << 8 ) | blue;
665 //printf("set8 pixel = %X\n", gdkColor.pixel);
670 return (gdkColor.red <<32) | (gdkColor.green << 16) | (gdkColor.blue);
675 return ((gdkColor.red&0xFF00)<<8 ) | ((gdkColor.green&0xFF00)) | ((gdkColor.blue&0xFF00) >>8);
680 return gdkColor.pixel;
686 file: gdk-Visuals.html
690 #import: gdk.VisualType*
691 #structWrap: GdkVisualType** VisualType*
693 structWrap: GList* ListG
695 structWrap: GdkVisual* Visual
697 structWrap: GdkScreen* Screen
707 structWrap: GdkFont* Font
709 structWrap: GdkDisplay* Display
711 #structWrap: GdkWChar* WChar
715 * Create and loads a font
717 public this(char[] fontName)
719 this(gdk_font_load(Str.toStringz(fontName)));
724 file: gdk-Cursors.html
730 structWrap: GdkPixmap* Pixmap
732 structWrap: GdkColor* Color
734 structWrap: GdkDisplay* Display
736 structWrap: GdkPixbuf* Pixbuf
738 structWrap: GdkCursor* Cursor
741 file: gdk-Windows.html
745 noprefix: gdk_window_invalidate_maybe_recurse
747 #import: gdk.WindowAttr
748 #structWrap: GdkWindowAttr* WindowAttr
750 structWrap: GdkWindow* Window
752 structWrap: GdkRegion* Region
753 #import: gdk.Geometry
754 #structWrap: GdkGeometry* Geometry
755 import: gdk.Rectangle
756 structWrap: GdkRectangle* Rectangle
757 #import: gdk.Drawable*
758 #structWrap: GdkDrawable** Drawable*
760 structWrap: GdkBitmap* Bitmap
762 structWrap: GdkColor* Color
764 structWrap: GdkPixmap* Pixmap
766 structWrap: GdkCursor* Cursor
768 structWrap: GList* ListG
769 #import: gdk.ModifierType
770 #structWrap: GdkModifierType* ModifierType
771 #import: gdk.WMDecoration
772 #structWrap: GdkWMDecoration* WMDecoration
773 #import: gdk.PointerHooks
774 #structWrap: GdkPointerHooks* PointerHooks
777 file: gdk-Events.html
783 structWrap: GdkEvent* Event
785 structWrap: GdkWindow* Window
786 #import: gdk.ModifierType
787 #structWrap: GdkModifierType* ModifierType
789 structWrap: GdkDisplay* Display
791 structWrap: GdkScreen* Screen
792 import: gobject.Value
793 structWrap: GValue* Value
796 public static bool isDoubleClick(GdkEventButton* eventButton, int buttonNumber=1)
798 return eventButton.button==buttonNumber
799 && eventButton.type == EventType.DOUBLE_BUTTON_PRESS;
802 public static bool isTrippleClick(GdkEventButton* eventButton, int buttonNumber=1)
804 return eventButton.button==buttonNumber
805 && eventButton.type == EventType.TRIPPLE_BUTTON_PRESS;
812 file: gdk-Event-Structures.html
818 file: gdk-Keyboard-Handling.html
824 structWrap: GdkKeymap* Keymap
826 structWrap: GdkDisplay* Display
827 #import: gdk.KeymapKey
828 #structWrap: GdkKeymapKey* KeymapKey
829 #import: gdk.ModifierType
830 #structWrap: GdkModifierType* ModifierType
831 #import: gdk.KeymapKey*
832 #structWrap: GdkKeymapKey** KeymapKey*
835 file: gdk-Selections.html
837 prefix: gdk_selection_
839 structWrap: GdkWindow* Window
841 structWrap: GdkDisplay* Display
843 #structWrap: GdkAtom* Atom
846 file: gdk-Drag-and-Drop.html
847 struct: GdkDragContext
849 prefix: gdk-drag_context_
850 import: gdk.DragContext
851 structWrap: GdkDragContext* DragContext
853 structWrap: GdkWindow* Window
855 #structWrap: GdkWindow** Window*
856 #import: gdk.DragProtocol
857 #structWrap: GdkDragProtocol* DragProtocol
859 structWrap: GdkScreen* Screen
861 structWrap: GList* ListG
863 structWrap: GdkDisplay* Display
867 #file: gdk-Properties-and-Atoms.html
873 file: gdk-Threads.html
883 file: gdk-Input-Devices.html
888 structWrap: GList* ListG
890 structWrap: GdkDevice* Device
892 structWrap: GdkWindow* Window
895 #file: gdk-Pango-Interaction.html
903 #file: gdk-X-Window-System-Interaction.html
909 ############## cairo interaction ###############
912 file: gdk-Cairo-Interaction.html
915 import: cairoLib.Cairo
916 structWrap: cairo_t* Cairo
917 structWrap: GdkDrawable* Drawable
918 structWrap: GdkColor* Color
919 structWrap: GdkPixbuf* Pixbuf
920 structWrap: GdkPixmap* Pixmap
921 structWrap: GdkRectangle* Rectangle
922 structWrap: GdkRegion* Region
924 nocode: gdk_cairo_create
925 nocode: gdk_cairo_set_source_color
926 nocode: gdk_cairo_set_source_pixbuf
927 nocode: gdk_cairo_set_source_pixmap
928 nocode: gdk_cairo_rectangle
929 nocode: gdk_cairo_region
934 * This file is not used,
936 * It is here just to tell you to look at
937 * cairoLib.Cairo class for the methods that where here..