summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java
diff options
context:
space:
mode:
authorBogdan Gheorghe <gheorghe>2010-02-25 18:28:05 +0000
committerBogdan Gheorghe <gheorghe>2010-02-25 18:28:05 +0000
commitaef5d9b620da0da744dd6dc4a70bc367cf52e597 (patch)
treefaceb84c369d63be5c06d63e238663eb0e32136f /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java
parent8fedd770235c1344672f359ec020ce0d7bed29ea (diff)
downloadeclipse.platform.swt-aef5d9b620da0da744dd6dc4a70bc367cf52e597.tar.gz
eclipse.platform.swt-aef5d9b620da0da744dd6dc4a70bc367cf52e597.tar.xz
eclipse.platform.swt-aef5d9b620da0da744dd6dc4a70bc367cf52e597.zip
drawBackground for CTabFolder
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java
index 55354e2285..b286425f68 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java
@@ -330,7 +330,10 @@ void deregister () {
if (socketHandle != 0) display.removeWidget (socketHandle);
}
-void drawBackground (GC gc, int x, int y, int width, int height) {
+public void drawBackground (GC gc, int x, int y, int width, int height, int offsetX, int offsetY) {
+ checkWidget ();
+ if (gc == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (gc.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
Control control = findBackgroundControl ();
if (control != null) {
GCData data = gc.getGCData ();
@@ -339,9 +342,9 @@ void drawBackground (GC gc, int x, int y, int width, int height) {
Cairo.cairo_save (cairo);
if (control.backgroundImage != null) {
Point pt = display.map (this, control, 0, 0);
- Cairo.cairo_translate (cairo, -pt.x, -pt.y);
- x += pt.x;
- y += pt.y;
+ Cairo.cairo_translate (cairo, -pt.x - offsetX, -pt.y - offsetY);
+ x += pt.x + offsetX;
+ y += pt.y + offsetY;
int /*long*/ xDisplay = OS.GDK_DISPLAY ();
int /*long*/ xVisual = OS.gdk_x11_visual_get_xvisual (OS.gdk_visual_get_system());
int /*long*/ drawable = control.backgroundImage.pixmap;
@@ -374,7 +377,7 @@ void drawBackground (GC gc, int x, int y, int width, int height) {
if (control.backgroundImage != null) {
Point pt = display.map (this, control, 0, 0);
OS.gdk_gc_set_fill (gdkGC, OS.GDK_TILED);
- OS.gdk_gc_set_ts_origin (gdkGC, -pt.x, -pt.y);
+ OS.gdk_gc_set_ts_origin (gdkGC, -pt.x - offsetX, -pt.y - offsetY);
OS.gdk_gc_set_tile (gdkGC, control.backgroundImage.pixmap);
OS.gdk_draw_rectangle (data.drawable, gdkGC, 1, x, y, width, height);
OS.gdk_gc_set_fill (gdkGC, values.fill);