-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GTK] Harmonize signature of native getWidgetBounds() method
This renames the getWidgetBounds() to _gtk_widget_get_allocation() and adapts the signature to expects a GtkAllocation object. On the C layer, this Java object is converted to a C object using the JGtkAllocation struct. This struct keeps track of all fields of the Java class and used to exchange the values with the Java layer. See #871
- Loading branch information
Showing
5 changed files
with
117 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
35 changes: 35 additions & 0 deletions
35
org.eclipse.wb.os.linux/src/org/eclipse/wb/internal/os/linux/GdkRectangle.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 Patrick Ziegler and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Patrick Ziegler - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.wb.internal.os.linux; | ||
|
||
/** | ||
* A GdkRectangle data type for representing rectangles. | ||
* | ||
* GdkRectangle is identical to cairo_rectangle_t. Together with Cairo’s | ||
* cairo_region_t data type, these are the central types for representing sets | ||
* of pixels. | ||
* | ||
* The intersection of two rectangles can be computed with | ||
* gdk_rectangle_intersect(); to find the union of two rectangles use | ||
* gdk_rectangle_union(). | ||
* | ||
* The cairo_region_t type provided by Cairo is usually used for managing | ||
* non-rectangular clipping of graphical operations. | ||
* | ||
* The Graphene library has a number of other data types for regions and volumes | ||
* in 2D and 3D. | ||
*/ | ||
public sealed class GdkRectangle permits GtkAllocation { | ||
public int x; | ||
public int y; | ||
public int width; | ||
public int height; | ||
} |
19 changes: 19 additions & 0 deletions
19
org.eclipse.wb.os.linux/src/org/eclipse/wb/internal/os/linux/GtkAllocation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 Patrick Ziegler and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Patrick Ziegler - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.wb.internal.os.linux; | ||
|
||
/** | ||
* A GtkAllocation-struct of a widget represents region which has been allocated | ||
* to the widget by its parent. It is a subregion of its parents allocation. | ||
*/ | ||
public final class GtkAllocation extends GdkRectangle { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters