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;
64 # must start with wrap
68 ###########################################################
69 ### Gdk ###################################################
70 ###########################################################
72 file: gdk-General.html
77 structWrap: GdkWindow* Window
79 structWrap: GdkCursor* Cursor
94 structWrap: GdkDisplay* Display
96 structWrap: GdkScreen* Screen
98 structWrap: GList* ListG
100 structWrap: GdkEvent* Event
102 #structWrap: GdkScreen** Screen*
103 #import: gdk.ModifierType
104 #structWrap: GdkModifierType* ModifierType
106 structWrap: GdkWindow* Window
107 #import: gdk.DisplayPointerHooks
108 #structWrap: GdkDisplayPointerHooks* DisplayPointerHooks
110 #structWrap: GdkAtom* Atom
113 file: GdkDisplayManager.html
114 struct: GdkDisplayManager
115 class: DisplayManager
116 prefix: gdk_display_manager_
117 import: gdk.DisplayManager
118 structWrap: GdkDisplayManager* DisplayManager
120 structWrap: GdkDisplay* Display
122 structWrap: GSList* ListSG
124 structWrap: GdkDevice* Device
125 outFile: DisplayManager
131 import: gtkc.cairoLibtypes
134 structWrap: GdkScreen* Screen
136 structWrap: GdkColormap* Colormap
138 structWrap: GdkVisual* Visual
140 structWrap: GdkWindow* Window
142 structWrap: GdkDisplay* Display
144 structWrap: GList* ListG
145 import: gdk.Rectangle
146 structWrap: GdkRectangle* Rectangle
148 structWrap: GdkEvent* Event
149 import: gobject.Value
150 structWrap: GValue* Value
153 file: gdk-Points-Rectangles-and-Regions.html
157 prefix: gdk_rectangle_
158 noprefix: gdk_region_
159 import: gdk.Rectangle
160 structWrap: GdkRectangle* Rectangle
168 structWrap: GdkRegion* Region
170 #structWrap: GdkPoint* Point
171 import: gdk.Rectangle
172 structWrap: GdkRectangle* Rectangle
173 #import: gdk.Rectangle*
174 #structWrap: GdkRectangle** Rectangle*
176 #structWrap: GdkSpan* Span
179 file: gdk-Graphics-Contexts.html
184 structWrap: GdkDrawable* Drawable
185 #import: gdk.GCValues
186 #structWrap: GdkGCValues* GCValues
188 structWrap: GdkScreen* Screen
190 structWrap: GdkGC* GC
192 structWrap: GdkColor* Color
194 structWrap: GdkFont* Font
196 structWrap: GdkPixmap* Pixmap
198 structWrap: GdkBitmap* Bitmap
199 #import: gdk.Rectangle
200 #structWrap: GdkRectangle* Rectangle
202 structWrap: GdkRegion* Region
204 structWrap: GdkColormap* Colormap
207 file: gdk-Drawing-Primitives.html
210 prefix: gdk_drawable_
214 structWrap: GdkDrawable* Drawable
216 structWrap: GdkDisplay* Display
218 structWrap: GdkScreen* Screen
220 structWrap: GdkVisual* Visual
222 structWrap: GdkColormap* Colormap
224 structWrap: GdkRegion* Region
226 structWrap: GdkGC* GC
228 #structWrap: GdkPoint* Point
230 structWrap: GdkPixbuf* Pixbuf
232 #structWrap: GdkSegment* Segment
233 #import: gdk.Trapezoid
234 #structWrap: GdkTrapezoid* Trapezoid
236 structWrap: GdkColor* Color
238 structWrap: GdkFont* Font
240 #structWrap: GdkWChar* WChar
242 structWrap: GdkImage* ImageGdk
244 import: pango.PgContext
245 structWrap: PangoContext* PgContext
247 structWrap: PangoItem* PgItem
248 import: pango.PgLayout
249 structWrap: PangoLayout* PgLayout
250 import: pango.PgFontDescription
251 structWrap: PangoFontDescription* PgFontDescription
252 import: pango.PgFontMetrics
253 structWrap: PangoFontMetrics* PgFontMetrics
254 import: pango.PgFontFamily
255 structWrap: PangoFontFamily* PgFontFamily
256 import: pango.PgFontFace
257 structWrap: PangoFontFace* PgFontFace
258 import: pango.PgFontMap
259 structWrap: PangoFontMap* PgFontMap
260 import: pango.PgFontsetSimple
261 structWrap: PangoFontsetSimple* PgFontsetSimple
262 import: pango.PgAttribute
263 structWrap: PangoAttribute* PgAttribute
264 import: pango.PgAttributeList
265 structWrap: PangoAttributeList* PgAttributeList
266 import: pango.PgLanguage
267 structWrap: PangoLanguage* PgLanguage
268 import: pango.PgTabArray
269 structWrap: PangoTabArray* PgTabArray
270 import: pango.PgLayout
271 structWrap: PangoLayout* PgLayout
272 import: pango.PgLayoutIter
273 structWrap: PangoLayoutIter* PgLayoutIter
274 import: pango.PgScriptIter
275 structWrap: PangoScriptIter* PgScriptIter
279 * Draws an outlined or filled polygon.
281 * a GdkDrawable (a GdkWindow or a GdkPixmap).
285 * TRUE if the polygon should be filled. The polygon is closed
286 * automatically, connecting the last point to the first point if
289 * an array of GdkPoint structures specifying the points making
292 public void drawPolygon(GC gc, int filled, GdkPoint[] points)
294 // void gdk_draw_polygon (GdkDrawable *drawable, GdkGC *gc, gboolean filled, GdkPoint *points, gint npoints);
295 gdk_draw_polygon(gdkDrawable, gc.getGCStruct(), filled, points.ptr, points.length);
298 public void drawPixbuf(Pixbuf pixbuf, int destX, int destY)
300 drawPixbuf(null, pixbuf, destX, destY);
302 public void drawPixbuf(GC gc, Pixbuf pixbuf, int destX, int destY)
304 if ( pixbuf is null ) return;
305 gdk_draw_pixbuf(gdkDrawable,
306 (gc is null) ? null : gc.getGCStruct(),
307 pixbuf.getPixbufStruct(),
309 pixbuf.getWidth(), pixbuf.getHeight(),
321 file: gdk-Bitmaps-and-Pixmaps.html
326 noprefix: gdk_bitmap_
329 structWrap: GdkDrawable* Drawable
331 structWrap: GdkPixmap* Pixmap
333 structWrap: GdkColor* Color
335 #structWrap: GdkBitmap** Bitmap*
337 structWrap: GdkColormap* Colormap
346 structWrap: GdkBitmap* Bitmap
348 structWrap: GdkDrawable* Drawable
351 file: gdk-GdkRGB.html
355 structWrap: GdkDrawable* Drawable
357 structWrap: GdkGC* GC
359 #structWrap: GdkRgbCmap* RgbCmap
361 structWrap: GdkColormap* Colormap
363 structWrap: GdkColor* Color
365 structWrap: GdkVisual* Visual
368 file: gdk-Images.html
373 structWrap: GdkVisual* Visual
375 structWrap: GdkDrawable* Drawable
377 structWrap: GdkColormap* Colormap
380 ## move to GdkPixbuf? no?
381 ## extend GdkPixbuf? Yes?
385 file: gdk-Pixbufs.html
392 noprefix: gdk_pixbuf_ref
393 noprefix: gdk_pixbuf_unref
395 #structWrap: GError** Error*
396 #import: gdkpixbuf.Pixbuf
397 structWrap: GdkPixbuf* Pixbuf
398 import: gdkpixbuf.PixbufFormat
399 structWrap: GdkPixbufFormat* PixbufFormat
401 structWrap: GdkDrawable* Drawable
403 structWrap: GdkBitmap* Bitmap
405 structWrap: GdkColormap* Colormap
407 structWrap: GdkImage* ImageGdk
409 # this will create a new pixbuf but the wrapper will pass the existing pixbuf struct
410 nocode: gdk_pixbuf_get_from_drawable
414 * Transfers image data from a GdkDrawable and converts it to an RGB(A)
415 * representation inside a GdkPixbuf. In other words, copies
416 * image data from a server-side drawable to a client-side RGB(A) buffer.
417 * This allows you to efficiently read individual pixels on the client side.
418 * If the drawable src has no colormap (gdk_drawable_get_colormap()
419 * returns NULL), then a suitable colormap must be specified.
420 * Typically a GdkWindow or a pixmap created by passing a GdkWindow
421 * to gdk_pixmap_new() will already have a colormap associated with
422 * it. If the drawable has a colormap, the cmap argument will be
423 * ignored. If the drawable is a bitmap (1 bit per pixel pixmap),
424 * then a colormap is not required; pixels with a value of 1 are
425 * assumed to be white, and pixels with a value of 0 are assumed to be
426 * black. For taking screenshots, gdk_colormap_get_system() returns
427 * the correct colormap to use.
428 * If the specified destination pixbuf dest is NULL, then this
429 * function will create an RGB pixbuf with 8 bits per channel and no
430 * alpha, with the same size specified by the width and height
431 * arguments. In this case, the dest_x and dest_y arguments must be
432 * specified as 0. If the specified destination pixbuf is not NULL
433 * and it contains alpha information, then the filled pixels will be
434 * set to full opacity (alpha = 255).
435 * If the specified drawable is a pixmap, then the requested source
436 * rectangle must be completely contained within the pixmap, otherwise
437 * the function will return NULL. For pixmaps only (not for windows)
438 * passing -1 for width or height is allowed to mean the full width
439 * or height of the pixmap.
440 * If the specified drawable is a window, and the window is off the
441 * screen, then there is no image data in the obscured/offscreen
442 * regions to be placed in the pixbuf. The contents of portions of the
443 * pixbuf corresponding to the offscreen region are undefined.
444 * If the window you're obtaining data from is partially obscured by
445 * other windows, then the contents of the pixbuf areas corresponding
446 * to the obscured regions are undefined.
447 * If the target drawable is not mapped (typically because it's
448 * iconified/minimized or not on the current workspace), then NULL
450 * If memory can't be allocated for the return value, NULL will be returned
452 * (In short, there are several ways this function can fail, and if it fails
453 * it returns NULL; so check the return value.)
454 * This function calls gdk_drawable_get_image() internally and
455 * converts the resulting image to a GdkPixbuf, so the
456 * documentation for gdk_drawable_get_image() may also be relevant.
458 * Destination pixbuf, or NULL if a new pixbuf should be created.
462 * A colormap if src doesn't have one set.
464 * Source X coordinate within drawable.
466 * Source Y coordinate within drawable.
468 * Destination X coordinate in pixbuf, or 0 if dest is NULL.
470 * Destination Y coordinate in pixbuf, or 0 if dest is NULL.
472 * Width in pixels of region to get.
474 * Height in pixels of region to get.
476 * The same pixbuf as dest if it was non-NULL, or a newly-created
477 * pixbuf with a reference count of 1 if no destination pixbuf was specified, or NULL on error
479 public Pixbuf getFromDrawable(Drawable src, Colormap cmap, int srcX, int srcY, int destX, int destY, int width, int height)
481 // 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);
482 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) );
486 * SetFromDrawable is different from GetFrom Drawable as it doesn't create a new pixbuf
488 public void setFromDrawable(Drawable src, int srcX, int srcY, int width, int height)
490 gdk_pixbuf_get_from_drawable(
491 gdkPixbuf, // gdkPixbuf
492 src.getDrawableStruct(),
495 0, 0, // destination x and y
500 * Creates a new Pixbuf from a drawable.
501 * this is a simplyfied GetFromDrawable
503 this(Drawable src, int srcX, int srcY, int width, int height)
505 GdkPixbuf* pb = gdk_pixbuf_get_from_drawable(
507 src.getDrawableStruct(),
510 0, 0, // destination x and y
519 file: ../gdk-pixbuf/gdk-pixbuf-creating.html
524 gdk_pixbuf_get_type ()
526 GType gdk_pixbuf_get_type ();
532 file: ../gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html
535 file: ../gdk-pixbuf/gdk-pixbuf-refcounting.html
538 file: ../gdk-pixbuf/gdk-pixbuf-file-loading.html
539 noprefix: gdk_pixbuf_get_file_info
542 file: ../gdk-pixbuf/gdk-pixbuf-file-saving.html
545 file: ../gdk-pixbuf/gdk-pixbuf-scaling.html
548 file: ../gdk-pixbuf/gdk-pixbuf-util.html
551 file: gdk-Colormaps-and-Colors.html
555 prefix: gdk_colormap_
558 structWrap: GdkVisual* Visual
560 structWrap: GdkColormap* Colormap
562 structWrap: GdkColor* Color
564 structWrap: GdkScreen* Screen
573 structWrap: GdkColor* Color
575 structWrap: GdkColormap* Colormap
583 * Creates a new Color
590 this(ubyte red, ubyte green, ubyte blue)
593 set8(red, green, blue);
597 * Creates a new Color with RGB values
602 this(guint16 red, guint16 green, guint16 blue)
605 //printf("Color.this red , green , blue = %d %d %d\n", red, green, blue);
612 //printf("Color.this uint %X\n",rgb);
613 set( ((rgb&0xFFFF)),((rgb&0xFFFF00000000)>>32),(rgb&0xFFFF0000)>>16);
619 //printf("Color.this int %X\n",rgb);
620 set8( cast(byte)((rgb&0xFF0000)>>16),cast(byte)((rgb&0x00FF00)>>8),cast(byte)(rgb&0xFF));
627 _black = new Color(cast(ubyte)0,cast(ubyte)0,cast(ubyte)0);
635 _white = new Color(cast(ubyte)255,cast(ubyte)255,cast(ubyte)255);
641 * Sets the Color with RGB values
646 void set(guint16 red, guint16 green, guint16 blue)
648 //printf("Color.set %X %X %X\n",red,green,blue);
650 gdkColor.green = green;
651 gdkColor.blue = blue;
652 gdkColor.pixel = (red&0xFF00 << 8) | (green&0xFF00) | (blue >> 8) ;
653 //printf("Color.pixel %X \n",gdkColor.pixel);
655 //printf("set pixel = %X\n", gdkColor.pixel);
658 void set8(ubyte red, ubyte green, ubyte blue)
660 //printf("Color.set %X %X %X\n",red,green,blue);
662 gdkColor.red = red * 257;
663 gdkColor.green = green * 257;
664 gdkColor.blue = blue * 257;
665 gdkColor.pixel = (red << 16) | (green << 8 ) | blue;
666 //printf("set8 pixel = %X\n", gdkColor.pixel);
671 return (gdkColor.red <<32) | (gdkColor.green << 16) | (gdkColor.blue);
676 return ((gdkColor.red&0xFF00)<<8 ) | ((gdkColor.green&0xFF00)) | ((gdkColor.blue&0xFF00) >>8);
681 return gdkColor.pixel;
687 file: gdk-Visuals.html
691 #import: gdk.VisualType*
692 #structWrap: GdkVisualType** VisualType*
694 structWrap: GList* ListG
696 structWrap: GdkVisual* Visual
698 structWrap: GdkScreen* Screen
708 structWrap: GdkFont* Font
710 structWrap: GdkDisplay* Display
712 #structWrap: GdkWChar* WChar
716 * Create and loads a font
718 public this(char[] fontName)
720 this(gdk_font_load(Str.toStringz(fontName)));
725 file: gdk-Cursors.html
731 structWrap: GdkPixmap* Pixmap
733 structWrap: GdkColor* Color
735 structWrap: GdkDisplay* Display
737 structWrap: GdkPixbuf* Pixbuf
739 structWrap: GdkCursor* Cursor
742 file: gdk-Windows.html
746 noprefix: gdk_window_invalidate_maybe_recurse
748 #import: gdk.WindowAttr
749 #structWrap: GdkWindowAttr* WindowAttr
751 structWrap: GdkWindow* Window
753 structWrap: GdkRegion* Region
754 #import: gdk.Geometry
755 #structWrap: GdkGeometry* Geometry
756 import: gdk.Rectangle
757 structWrap: GdkRectangle* Rectangle
758 #import: gdk.Drawable*
759 #structWrap: GdkDrawable** Drawable*
761 structWrap: GdkBitmap* Bitmap
763 structWrap: GdkColor* Color
765 structWrap: GdkPixmap* Pixmap
767 structWrap: GdkCursor* Cursor
769 structWrap: GList* ListG
770 #import: gdk.ModifierType
771 #structWrap: GdkModifierType* ModifierType
772 #import: gdk.WMDecoration
773 #structWrap: GdkWMDecoration* WMDecoration
774 #import: gdk.PointerHooks
775 #structWrap: GdkPointerHooks* PointerHooks
778 file: gdk-Events.html
784 structWrap: GdkEvent* Event
786 structWrap: GdkWindow* Window
787 #import: gdk.ModifierType
788 #structWrap: GdkModifierType* ModifierType
790 structWrap: GdkDisplay* Display
792 structWrap: GdkScreen* Screen
793 import: gobject.Value
794 structWrap: GValue* Value
797 public static bool isDoubleClick(GdkEventButton* eventButton, int buttonNumber=1)
799 return eventButton.button==buttonNumber
800 && eventButton.type == EventType.DOUBLE_BUTTON_PRESS;
803 public static bool isTrippleClick(GdkEventButton* eventButton, int buttonNumber=1)
805 return eventButton.button==buttonNumber
806 && eventButton.type == EventType.TRIPPLE_BUTTON_PRESS;
813 file: gdk-Event-Structures.html
819 file: gdk-Keyboard-Handling.html
825 structWrap: GdkKeymap* Keymap
827 structWrap: GdkDisplay* Display
828 #import: gdk.KeymapKey
829 #structWrap: GdkKeymapKey* KeymapKey
830 #import: gdk.ModifierType
831 #structWrap: GdkModifierType* ModifierType
832 #import: gdk.KeymapKey*
833 #structWrap: GdkKeymapKey** KeymapKey*
836 file: gdk-Selections.html
838 prefix: gdk_selection_
840 structWrap: GdkWindow* Window
842 structWrap: GdkDisplay* Display
844 #structWrap: GdkAtom* Atom
847 file: gdk-Drag-and-Drop.html
848 struct: GdkDragContext
850 prefix: gdk-drag_context_
851 import: gdk.DragContext
852 structWrap: GdkDragContext* DragContext
854 structWrap: GdkWindow* Window
856 #structWrap: GdkWindow** Window*
857 #import: gdk.DragProtocol
858 #structWrap: GdkDragProtocol* DragProtocol
860 structWrap: GdkScreen* Screen
862 structWrap: GList* ListG
864 structWrap: GdkDisplay* Display
868 #file: gdk-Properties-and-Atoms.html
874 file: gdk-Threads.html
884 file: gdk-Input-Devices.html
889 structWrap: GList* ListG
891 structWrap: GdkDevice* Device
893 structWrap: GdkWindow* Window
896 #file: gdk-Pango-Interaction.html
904 file: gdk-X-Window-System-Interaction.html
905 #struct: GdkDrawable #we're not wrapping a struct ATM
906 #we're just putting these methods to be static.
910 structWrap: GdkDrawable* Drawable
912 structWrap: GdkDisplay* Display
914 structWrap: GdkWindow* Window
915 #more types should added here like atom, visual, image, etc...
916 #for now we just disable all the stuff with X types in them
917 #only thing left is XID which is just an uint.
918 nocode: gdkx_visual_get
919 nocode: gdkx_colormap_get
920 nocode: gdk_pixmap_foreign_new
921 nocode: gdk_pixmap_foreign_new_for_display
922 nocode: gdk_pixmap_foreign_new_for_screen
923 nocode: gdk_window_foreign_new_for_display
924 nocode: gdk_xid_table_lookup_for_display
925 nocode: gdk_window_lookup_for_display
926 nocode: gdk_pixmap_lookup_for_display
927 nocode: gdk_x11_lookup_xdisplay
928 nocode: gdk_net_wm_supports
929 nocode: gdk_x11_screen_supports_net_wm_hint
930 nocode: gdk_x11_screen_get_window_manager_name
931 nocode: gdk_x11_screen_lookup_visual
932 nocode: gdk_x11_display_get_user_time
933 nocode: gdk_x11_colormap_foreign_new
934 nocode: gdk_x11_colormap_get_xcolormap
935 nocode: gdk_x11_colormap_get_xdisplay
936 nocode: gdk_x11_cursor_get_xcursor
937 nocode: gdk_x11_cursor_get_xdisplay
938 nocode: gdk_x11_display_get_xdisplay
939 nocode: gdk_x11_display_grab
940 nocode: gdk_x11_display_ungrab
941 nocode: gdk_x11_display_set_cursor_theme
942 nocode: gdk_x11_register_standard_event_type
943 nocode: gdk_x11_drawable_get_xdisplay
944 nocode: gdk_x11_font_get_xdisplay
945 nocode: gdk_x11_gc_get_xdisplay
946 nocode: gdk_x11_gc_get_xgc
947 nocode: gdk_x11_get_default_root_xwindow
948 nocode: gdk_x11_get_default_xdisplay
949 nocode: gdk_x11_image_get_xdisplay
950 nocode: gdk_x11_image_get_ximage
951 nocode: gdk_x11_screen_get_screen_number
952 nocode: gdk_x11_screen_get_xscreen
953 nocode: gdk_x11_visual_get_xvisual
954 nocode: gdk_x11_atom_to_xatom
955 nocode: gdk_x11_atom_to_xatom_for_display
956 nocode: gdk_x11_xatom_to_atom
957 nocode: gdk_x11_xatom_to_atom_for_display
958 nocode: gdk_x11_get_xatom_by_name
959 nocode: gdk_x11_get_xatom_by_name_for_display
960 nocode: gdk_x11_get_xatom_name
961 nocode: gdk_x11_get_xatom_name_for_display
965 ############## cairo interaction ###############
968 file: gdk-Cairo-Interaction.html
971 import: cairoLib.Cairo
972 structWrap: cairo_t* Cairo
973 structWrap: GdkDrawable* Drawable
974 structWrap: GdkColor* Color
975 structWrap: GdkPixbuf* Pixbuf
976 structWrap: GdkPixmap* Pixmap
977 structWrap: GdkRectangle* Rectangle
978 structWrap: GdkRegion* Region
980 nocode: gdk_cairo_create
981 nocode: gdk_cairo_set_source_color
982 nocode: gdk_cairo_set_source_pixbuf
983 nocode: gdk_cairo_set_source_pixmap
984 nocode: gdk_cairo_rectangle
985 nocode: gdk_cairo_region
990 * This file is not used,
992 * It is here just to tell you to look at
993 * cairoLib.Cairo class for the methods that where here..