After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 623222 - [cairo] Bind cairo_rectangle_int_t
[cairo] Bind cairo_rectangle_int_t
Status: RESOLVED OBSOLETE
Product: gjs
Classification: Bindings
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
Depends on:
Blocks:
 
 
Reported: 2010-06-30 16:43 UTC by Colin Walters
Modified: 2016-01-24 22:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[cairo] Bind cairo_rectangle_int_t (8.75 KB, patch)
2010-06-30 16:43 UTC, Colin Walters
none Details | Review
Bind cairo_rectangle_int_t (16.72 KB, patch)
2010-07-02 00:43 UTC, Owen Taylor
needs-work Details | Review

Description Colin Walters 2010-06-30 16:43:19 UTC
see patch
Comment 1 Colin Walters 2010-06-30 16:43:22 UTC
Created attachment 164977 [details] [review]
[cairo] Bind cairo_rectangle_int_t

This is a new type added in cairo 1.9 that replaces GdkRectangle
in GTK3.  We need to bind it with exactly the same API as
exported by GdkRectangle (namely, x/y/width/height) properties.
Comment 2 Owen Taylor 2010-07-02 00:43:03 UTC
Created attachment 165066 [details] [review]
Bind cairo_rectangle_int_t

Summary of differences from Colin's version:

 - Memory management fixes
 - Doesn't try to allow ownership transfer of cairo_rectangle_int_t;
   just throws.
 - Struct-style constructor (new Cairo.RectangleInt({ x: 100, ... });
   we need to be able to create GdkRectangle, not just consume it
 - Uses property getters and setters rather than setting JS properties
   to shadow the C object
 - Working setters
 - Configure check so things still build with Cairo
 - Minimal test case
Comment 3 Colin Walters 2010-07-07 19:41:38 UTC
Review of attachment 165066 [details] [review]:

This looks good to me.
Comment 4 Johan (not receiving bugmail) Dahlin 2010-07-08 12:13:01 UTC
Review of attachment 165066 [details] [review]:

This looks pretty good, code styling is a bit inconsistent "foo ()" vs "foo()".

Lacks tests property setter tests and maybe g-i/foreign support.

::: modules/cairo-rectangle-int.c
@@ +67,3 @@
+
+    if (value == JSVAL_VOID) {
+        gjs_throw(context, "rectangle has no %s property", name);

Javascript usually return undefined here, but okay.

@@ +73,3 @@
+    if (!JS_ValueToInt32(context, value, (gint32*) &tmp)) {
+        JS_ClearPendingException(context); /* to throw a more useful exception */
+        gjs_throw(context, "%s of rectangle can't be converted to an integer", name);

%s property
Comment 5 Giovanni Campagna 2012-03-15 21:00:44 UTC
Comment on attachment 165066 [details] [review]
Bind cairo_rectangle_int_t

Two years later, we have grown Cairo.RectangleInt in the gi based cairo bindings. If this patch ever goes in, it needs to use that.

(This review is mostly to get off the acn list)
Comment 6 Philip Chimento 2016-01-24 22:59:26 UTC
Since 3.18 we now eschew Cairo.RectangleInt in favor of Gdk.Rectangle. I believe this can be closed.