<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/gjs.git/modules/cairo-context.cpp, branch includes</title>
<subtitle>gitlab.gnome.org: GNOME/gjs.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gjs.git/'/>
<entry>
<title>CI: Fix IWYU includes</title>
<updated>2020-09-20T19:24:08+00:00</updated>
<author>
<name>Philip Chimento</name>
<email>philip.chimento@gmail.com</email>
</author>
<published>2020-09-20T05:14:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gjs.git/commit/?id=19e519aad8ffc65e39c6095575ed66ff8d257cca'/>
<id>19e519aad8ffc65e39c6095575ed66ff8d257cca</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>js: Refactor Array-related JSAPI calls.</title>
<updated>2020-08-11T20:17:38+00:00</updated>
<author>
<name>Evan Welsh</name>
<email>noreply@evanwelsh.com</email>
</author>
<published>2020-07-05T03:09:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gjs.git/commit/?id=556123617ccc7a23793dd19d32b46616c241d3c8'/>
<id>556123617ccc7a23793dd19d32b46616c241d3c8</id>
<content type='text'>
- &lt;js/Array.h&gt; and &lt;js/ValueArray.h&gt; are new headers.
- Rename JS_NewArrayObject to JS::NewArrayObject.
- Rename JS_GetArrayLength to JS::GetArrayLength.
- Rename JS_IsArrayObject to JS::IsArrayObject.
- Rename JS::AutoValueArray to JS::RootedValueArray.

See: GNOME/gjs#329
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- &lt;js/Array.h&gt; and &lt;js/ValueArray.h&gt; are new headers.
- Rename JS_NewArrayObject to JS::NewArrayObject.
- Rename JS_GetArrayLength to JS::GetArrayLength.
- Rename JS_IsArrayObject to JS::IsArrayObject.
- Rename JS::AutoValueArray to JS::RootedValueArray.

See: GNOME/gjs#329
</pre>
</div>
</content>
</entry>
<entry>
<title>maint: Use C++17 attributes</title>
<updated>2020-08-06T01:15:31+00:00</updated>
<author>
<name>Philip Chimento</name>
<email>philip.chimento@gmail.com</email>
</author>
<published>2020-08-01T20:46:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gjs.git/commit/?id=a4d40792f6b39772197137d7737b3f4daf2022f0'/>
<id>a4d40792f6b39772197137d7737b3f4daf2022f0</id>
<content type='text'>
Now that we depend on C++17, we can use these attributes that are part
of the language, instead of relying on macros to make them portable.
(GJS_USE still needs to be defined for public header files, which may be
compiled in C.)

Attributes which are new in C++17 are [[maybe_unused]], [[nodiscard]],
and [[fallthrough]].

[skip cpplint] because cpplint doesn't deal with C++ attributes:
https://github.com/google/styleguide/issues/165
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that we depend on C++17, we can use these attributes that are part
of the language, instead of relying on macros to make them portable.
(GJS_USE still needs to be defined for public header files, which may be
compiled in C.)

Attributes which are new in C++17 are [[maybe_unused]], [[nodiscard]],
and [[fallthrough]].

[skip cpplint] because cpplint doesn't deal with C++ attributes:
https://github.com/google/styleguide/issues/165
</pre>
</div>
</content>
</entry>
<entry>
<title>js: Use gjs_arg_value to get, set and access GIArgument values</title>
<updated>2020-07-28T04:58:27+00:00</updated>
<author>
<name>Marco Trevisan (Treviño)</name>
<email>mail@3v1n0.net</email>
</author>
<published>2020-05-10T19:56:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gjs.git/commit/?id=833c6459dadb1b90dc00728d9b6a707f0cd3b666'/>
<id>833c6459dadb1b90dc00728d9b6a707f0cd3b666</id>
<content type='text'>
This allows to automatically use the proper union value depending on the
type without having to do it manually.

(Philip: changed some formatting, added char32_t for GI_TYPE_TAG_UNICHAR
and changed gjs_arg_value() to gjs_arg_get() if the union member wasn't
needed)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This allows to automatically use the proper union value depending on the
type without having to do it manually.

(Philip: changed some formatting, added char32_t for GI_TYPE_TAG_UNICHAR
and changed gjs_arg_value() to gjs_arg_get() if the union member wasn't
needed)
</pre>
</div>
</content>
</entry>
<entry>
<title>js: Define Symbol.toStringTag names on all our custom classes</title>
<updated>2020-07-28T04:32:26+00:00</updated>
<author>
<name>Evan Welsh</name>
<email>noreply@evanwelsh.com</email>
</author>
<published>2020-07-05T23:58:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gjs.git/commit/?id=065df98260317e2e8c4b9ec843e16b9d931e22b3'/>
<id>065df98260317e2e8c4b9ec843e16b9d931e22b3</id>
<content type='text'>
SpiderMonkey 78 will stop using the JSClass.name string as the string
tag. For backwards compatibility, we should make sure the string tag
doesn't change.

See: GNOME/gjs#329
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
SpiderMonkey 78 will stop using the JSClass.name string as the string
tag. For backwards compatibility, we should make sure the string tag
doesn't change.

See: GNOME/gjs#329
</pre>
</div>
</content>
</entry>
<entry>
<title>cairo: Use cairo_t as the private pointer for Cairo.Context</title>
<updated>2020-05-23T14:38:43+00:00</updated>
<author>
<name>Philip Chimento</name>
<email>philip.chimento@gmail.com</email>
</author>
<published>2020-05-03T01:47:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gjs.git/commit/?id=a7e4702ec4b9cbad8ddd7d212b29f443fcb506e5'/>
<id>a7e4702ec4b9cbad8ddd7d212b29f443fcb506e5</id>
<content type='text'>
Instead of allocating a separate private struct that allocates a cairo_t,
use the cairo_t directly as the private struct. This makes the code
simpler and saves 8 bytes per object. The only thing to watch out for is
that the pointer can be null if it was already disposed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead of allocating a separate private struct that allocates a cairo_t,
use the cairo_t directly as the private struct. This makes the code
simpler and saves 8 bytes per object. The only thing to watch out for is
that the pointer can be null if it was already disposed.
</pre>
</div>
</content>
</entry>
<entry>
<title>js: Remove jsapi-wrapper.h</title>
<updated>2020-01-19T23:40:14+00:00</updated>
<author>
<name>Philip Chimento</name>
<email>philip.chimento@gmail.com</email>
</author>
<published>2019-11-24T07:07:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gjs.git/commit/?id=d783d40c8162ed94254bdb3762592cdbece6e5ba'/>
<id>d783d40c8162ed94254bdb3762592cdbece6e5ba</id>
<content type='text'>
With SpiderMonkey 68, it's no longer necessary to mark SpiderMonkey
header files as system headers, and it's also no longer necessary to
include &lt;js-config.h&gt; before any other header files, as SpiderMonkey
has sorted that out internally.

We remove jsapi-wrapper.h and define DEBUG directly in config.h instead
of indirectly in jsapi-wrapper.h via HAVE_SPIDERMONKEY_DEBUG.

This should reduce compile time, on average, because in most .h files
we now only need to include &lt;js/TypeDecls.h&gt;.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With SpiderMonkey 68, it's no longer necessary to mark SpiderMonkey
header files as system headers, and it's also no longer necessary to
include &lt;js-config.h&gt; before any other header files, as SpiderMonkey
has sorted that out internally.

We remove jsapi-wrapper.h and define DEBUG directly in config.h instead
of indirectly in jsapi-wrapper.h via HAVE_SPIDERMONKEY_DEBUG.

This should reduce compile time, on average, because in most .h files
we now only need to include &lt;js/TypeDecls.h&gt;.
</pre>
</div>
</content>
</entry>
<entry>
<title>cairo: Remove unused fields from private structures</title>
<updated>2019-11-30T03:42:47+00:00</updated>
<author>
<name>Philip Chimento</name>
<email>philip@endlessm.com</email>
</author>
<published>2019-11-26T02:58:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gjs.git/commit/?id=9eb5c3333fe56f645e7dbbd886c5e49e76506405'/>
<id>9eb5c3333fe56f645e7dbbd886c5e49e76506405</id>
<content type='text'>
This should save 16-24 bytes of memory per Cairo object, easy win!
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This should save 16-24 bytes of memory per Cairo object, easy win!
</pre>
</div>
</content>
</entry>
<entry>
<title>cairo: Add type checking to Path, Pattern, and Surface</title>
<updated>2019-10-31T04:29:48+00:00</updated>
<author>
<name>Philip Chimento</name>
<email>philip.chimento@gmail.com</email>
</author>
<published>2019-10-27T05:52:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gjs.git/commit/?id=e7ca4d37ed3446ede0daa0a99d5488b5c37d0f20'/>
<id>e7ca4d37ed3446ede0daa0a99d5488b5c37d0f20</id>
<content type='text'>
Previously, passing the wrong kind of object where a Cairo.Path,
Cairo.Pattern (subclass), or Cairo.Surface (subclass) was expected,
would crash. This adds type checking to avoid these crashes.

The normal way to do this would be with JS_HasInstance(), but since
Cairo.Pattern and Cairo.Surface are abstract classes, that won't work.
JS_HasInstance() takes a constructor, and abstract classes don't have a
constructor. Instead, we have to check the passed-in object's prototype
chain. It turns out there isn't a JSAPI function to do that, so we add
gjs_object_in_prototype_chain() for this purpose.

In addition we add missing error checking in a few places.

Closes: #49.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, passing the wrong kind of object where a Cairo.Path,
Cairo.Pattern (subclass), or Cairo.Surface (subclass) was expected,
would crash. This adds type checking to avoid these crashes.

The normal way to do this would be with JS_HasInstance(), but since
Cairo.Pattern and Cairo.Surface are abstract classes, that won't work.
JS_HasInstance() takes a constructor, and abstract classes don't have a
constructor. Instead, we have to check the passed-in object's prototype
chain. It turns out there isn't a JSAPI function to do that, so we add
gjs_object_in_prototype_chain() for this purpose.

In addition we add missing error checking in a few places.

Closes: #49.
</pre>
</div>
</content>
</entry>
<entry>
<title>maint: Fix header includes once and for all</title>
<updated>2019-06-09T06:11:29+00:00</updated>
<author>
<name>Philip Chimento</name>
<email>philip.chimento@gmail.com</email>
</author>
<published>2019-06-01T06:40:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gjs.git/commit/?id=01920362be26a2cb4e38b55cc211351391885d1d'/>
<id>01920362be26a2cb4e38b55cc211351391885d1d</id>
<content type='text'>
Previously #include statements were a bit of a mess across the codebase.
This commit is the result of a pass by the IWYU (Include What You Use)
tool, which suggests headers to add or remove based on what is in the
file, and can also suggest forward-declaring classes instead of
including their headers, if they are only used as a pointer in a
particular file. Cleaning this up should in general speed up compile
times.

IWYU isn't perfect, it produces a number of false positives, so we don't
try to automate this process and we don't accept all of its
recommendations. We do add a script and configuration file to the tools/
directory so that IWYU can be every so often in the future.

We also clean up all the includes according to a consistent style, which
is now described clearly in the C++ style guide.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously #include statements were a bit of a mess across the codebase.
This commit is the result of a pass by the IWYU (Include What You Use)
tool, which suggests headers to add or remove based on what is in the
file, and can also suggest forward-declaring classes instead of
including their headers, if they are only used as a pointer in a
particular file. Cleaning this up should in general speed up compile
times.

IWYU isn't perfect, it produces a number of false positives, so we don't
try to automate this process and we don't accept all of its
recommendations. We do add a script and configuration file to the tools/
directory so that IWYU can be every so often in the future.

We also clean up all the includes according to a consistent style, which
is now described clearly in the C++ style guide.
</pre>
</div>
</content>
</entry>
</feed>
