Commit Graph

578 Commits

Author SHA1 Message Date
Emmanuele Bassi
83c13e52d5 docs: Mention Meson's gnome.mkenums_simple()
The mkenums_simple() function generates idiomatic GObject code, and
avoids templates and custom command line arguments.
2020-02-24 16:14:33 +00:00
Emmanuele Bassi
79cdd531d0 Add example of using glib-genmarshal with Meson
We're using Meson for GLib itself, and we recommend people to use it
for their own projects, so it would be good to have our documentation
present examples on how to use Meson with our tools.
2020-02-24 16:14:33 +00:00
Emmanuele Bassi
040803b34d Add example of using glib-mkenums with Meson
We're using Meson for GLib itself, and we recommend people to use it
for their own projects, so it would be good to have our documentation
present examples on how to use Meson with our tools.

Let's move the template example into its own section while we're at it,
since it's referenced by both Meson and Autotools examples.

Fixes: #1783
2020-02-24 15:46:35 +00:00
Emmanuele Bassi
15a4cf4d3f Ensure that we use @basename@ in the glib-mkenums docs
The documentation for @filename@ is not accurate either.
2020-02-24 15:08:49 +00:00
Xavier Claessens
09d995286b doc: Run gtkdoc-check with unit tests
This has the side effect of always rebuilding the doc at each build when
gtk_doc option is enabled (not by default). Most importantly, this will
enable doc check on our CI.
2020-01-29 15:54:53 +01:00
Benjamin Otte
276e927fd4 Revert last 4 commits
This reverts commits:
  5899c61ed2
  e994d45352
  eb20dec144
  ebec0dd359
which wer accidentally pushed to master instead of a branch
2019-11-26 00:54:15 +01:00
Benjamin Otte
eb20dec144 gtype: Add g_type_interface_instantiable_prerequisite()
There is (at most) a single GType that is instantiable and a
prerequisite for an interface. This function returns that type.

This type is necessary in particular when dealing with GValues because a
GValue contains an instance of a type.
2019-11-25 20:06:39 +01:00
Philip Withnall
ca60cd3314 tutorial: Add private members to example code in tutorial
Add the private members referred to in the property setting/getting
example, and a finalize function for them, to make the tutorial code
more self-contained.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1858
2019-08-29 09:20:01 +01:00
Philip Withnall
22b59c91ad tutorial: Stop referring to ->priv for example class
The class has used `G_DECLARE_FINAL_TYPE` for a while now, so doesn’t
have a `priv` struct. Private members are declared inline.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #1858
2019-08-29 09:19:03 +01:00
Philip Withnall
61912bffb5 tutorial: Improve type safety of property usage in GObject tutorial
This means that if you compile with `-Wswitch-enum`, the compiler will
warn you about properties which you’ve forgotten to handle in
`set_property()` or `get_property()`.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1858
2019-08-29 09:12:18 +01:00
Дилян Палаузов
512655aa12 minor typos in the documentation (a/an) 2019-08-24 19:14:05 +00:00
Simon McVittie
b76bf3ca72 gobject: Add a g_assert_finalize_object() macro
With modifications by Philip Withnall.

Fixes: #488
2019-07-25 15:23:21 +01:00
Xavier Claessens
61872d60b5 doc: Add gobject 2.62 API 2019-07-10 10:29:04 -04:00
Marco Trevisan (Treviño)
409c1522bc gisgnal: Add g_clear_signal_handler
It allows to disconnect a signal handler from GObject instance and at the same
time to nullify the signal handler.

Provided also a macro for handler type conversion.
2019-05-20 13:33:41 -05:00
Philip Withnall
192bf09529 general: Remove a few unhelpful references to ‘master’
Some of these have a negative master/slave connotation, and they add no
value. Change or drop them.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-04-25 09:25:49 +01:00
Philip Withnall
6761bb2f57 build: Factor out common gtkdoc flags
Those lists were getting very long. We can’t quite entirely automate the
list generation since Meson doesn’t have a range() function, but we can
at least combine three of them into one.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-06 11:59:03 +00:00
Philip Withnall
e7d091dec1 gversionmacros: add version macros for GLib 2.62
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-06 11:26:28 +00:00
Philip Withnall
95e00c7581 docs: Various markup improvements to glib-mkenums man page
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-04 11:14:22 +00:00
Philip Withnall
c3ac761a18 build: Rename gobjectenumtypes.[ch] to glib-enumtypes.[ch]
To reflect the fact that they contain the GObject types for various
enums defined in libglib.

See https://gitlab.gnome.org/GNOME/glib/merge_requests/481#note_451086.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: GNOME/gobject-introspection#267
2019-03-04 11:12:59 +00:00
Philip Withnall
5d719c782c Merge branch 'script-enum' into 'master'
Define enum types for Unicode enums

See merge request GNOME/glib!481
2019-02-04 12:28:02 +00:00
Matthias Clasen
fc6044a4b1 Define enum types for Unicode enums
We want to stop shipping PangoScript in pango, so
we need a replacement for the type that used to
be provided by pango.
2019-01-31 19:38:26 -05:00
Krzesimir Nowak
9babfecba8 docs: Ignore more version macros
Looks like we tend to forget to update the list of ignored decorators
when adding new version macros.
2019-01-31 21:52:40 +01:00
Philip Withnall
b3efef5b6f build: Drop autotools support
So long, and thanks for everything. We’re a Meson-only shop now.

glib-2-58 will remain the last stable GLib release series which is
buildable using autotools.

We continue to install autoconf macros for autotools-using projects
which depend on GLib; they are stable API.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-01-15 15:11:43 +00:00
Nirbheek Chauhan
17316b2c16 glib-mkenums: Support reading @rspfiles for arguments
This is needed on Windows where the argument list can exceed the
maximum command-line length when lots of sources are passed to
glib-mkenums.
2018-12-04 16:16:00 +05:30
Philip Withnall
a440152b2a docs: Ignore some generated header files
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-11-23 13:27:04 +00:00
eyelash
fccce84d93 docs: add a missing semicolon 2018-11-18 08:05:28 +00:00
Simon McVittie
1830ebba91 Spelling: Fix spelling of "interpreted"
Detected by Debian's Lintian tool.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-09-25 15:58:56 +01:00
Simon McVittie
214c991d5b Spelling: fix "every time"
Detected by Debian's Lintian tool.

Also fix the spelling of "linking" in one error message.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-09-25 14:34:48 +01:00
Xavier Claessens
780f7c64f9 Meson: doc: fix cross references 2018-09-23 16:09:34 -04:00
Philip Withnall
c0f8792d6b docs: Add missing API indexes for old versions
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-07-30 21:13:48 +01:00
Philip Withnall
f9705f7a0c docs: Don’t distribute generated man pages
They should either be generated at build time, or ignored completely,
depending on the presence of --[enable|disable]-man.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-07-30 20:04:13 +01:00
Xavier Claessens
124779be88 doc: Remove gobject.types since gtkdoc-scan rebuild it anyway
I'm not sure why gobject.cI was needed but that looks like hack around
old gtkdoc bug. Works fine without it.
2018-06-28 09:55:56 -04:00
Olivier Crête
8e65417c6e docs: Change Bugzilla references to GitLab
Including modifications by Philip Withnall <withnall@endlessm.com>
2018-06-15 13:04:39 +01:00
Pavlo Solntsev
9e62a425bd doc: Interface for derivable object 2018-05-25 12:50:21 -05:00
Mohammed Sadiq
abf28c71b0 docs: Fix typo in examples 2018-04-10 20:01:40 +05:30
Emmanuele Bassi
dcfa22549a docs: Small improvements to glib-mkenums man page
Clarify some typical usage of glib-mkenums and its substitutions.
2018-01-16 15:17:54 +00:00
Emmanuele Bassi
e6c3060144 docs: Drop references to Perl in glib-mkenums
The tool was ported to Python, but we should not mention the programming
language used, in case we port it to some other language in the distant
future.
2018-01-16 15:17:53 +00:00
Martin Blanchard
156d32cb80 gobject: new g_set_weak_pointer() & g_clear_weak_pointer() helpers
Weak-pointers are currently lacking g_set_object() & g_clear_object()
helpers equivalent. New functions (and macros, both are provided) are
convenient in many case, especially for the property's notify-on-set
pattern:

  if (g_set_weak_pointer (...))
    g_object_notify (...)

Inspired by Christian Hergert's original implementation for
gnome-builder.

https://bugzilla.gnome.org/show_bug.cgi?id=749527
2017-12-21 09:59:30 +00:00
Xavier Claessens
62c4768423 Meson: Add missing options and conform to naming guidelines
https://bugzilla.gnome.org/show_bug.cgi?id=790837
2017-12-19 14:56:11 -05:00
Xavier Claessens
fa8d42de2e Meson: Fix build of gtkdoc
This requires change added in Meson 0.44.0

https://bugzilla.gnome.org/show_bug.cgi?id=786796
2017-12-11 10:25:21 -05:00
Ivar Trygve Jarlsby
f5dba7d43c docs: Correct inconsistency in GObject tutorial
The example code defines an interface with three methods. The preceding text
reads 'This interface defines two methods'. This appears to be because the
example code was changed without updating the surrounding text.

https://bugzilla.gnome.org/show_bug.cgi?id=790830
2017-11-26 21:21:34 +00:00
Emmanuele Bassi
bc277bfcef docs: Fix typo in the GObject tutorial
The description of the instance construction does not match the example.
2017-11-25 10:24:07 +00:00
Philip Withnall
a12fbd227f docs: Add version and deprecation decorators to gtk-doc ignore list
This allows gtk-doc to recognise a whole lot more API than it could
before. Maintaining the lists between 6 build files is going to be a bit
of a pain, but they only need to be modified once a cycle.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=789087

https://bugzilla.gnome.org/show_bug.cgi?id=790015
2017-11-07 14:50:23 +00:00
Kouhei Sutou
4bdb012aae docs: Fix XML syntax error
Introduced by the following commit:

    commit cd97f93bf7
    Author: Emmanuele Bassi <ebassi@gnome.org>
    Date:   Fri Oct 13 16:05:07 2017 +0100

        docs: Update glib-mkenums man page

        We should show how to properly use glib-mkenums with Autotools, in
        the hope that fewer people will be caught cargo-culting rules written
        in the late '90s.

        https://bugzilla.gnome.org/show_bug.cgi?id=788948

https://bugzilla.gnome.org/show_bug.cgi?id=788978
2017-10-14 09:15:59 +01:00
Emmanuele Bassi
cd97f93bf7 docs: Update glib-mkenums man page
We should show how to properly use glib-mkenums with Autotools, in
the hope that fewer people will be caught cargo-culting rules written
in the late '90s.

https://bugzilla.gnome.org/show_bug.cgi?id=788948
2017-10-13 18:14:57 +01:00
Emmanuele Bassi
bf4f825e84 docs: Update glib-genmarshal man page
We should show how to properly use glib-genmarshal with Autotools, in
the hope that fewer people will be caught cargo-culting rules written
in the late '90s.

https://bugzilla.gnome.org/show_bug.cgi?id=788948
2017-10-13 18:14:56 +01:00
Philip Withnall
121b1e5215 docs: Fix incorrect macro name in GType tutorial
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=770459
2017-10-05 15:40:14 +01:00
Colomban Wendling
b090a079f7 Fix documentation about stopping signal emission from inside a hook
Stopping signal emission from an emission hook is, and always has been,
actually forbidden.  Update the documentation not to lie to the reader.

https://bugzilla.gnome.org/show_bug.cgi?id=773355
2017-10-05 15:26:08 +01:00
Tim-Philipp Müller
24ea260b4c meson: docs: make gtk-doc find the gobject.types file
Should really use files('gobject.types') instead, but that
seems to get expanded to the build path for some reason:
https://github.com/mesonbuild/meson/issues/1875
2017-07-13 19:03:39 -04:00
Nirbheek Chauhan
88e437873a meson: Detect with-docs and with-man automatically
By default, only build man pages and gtk-doc if the build-deps were
found. To force-enable, pass -Dwith-docs=yes and -Dwith-man=yes.

Also use a foreach loop for man pages instead of listing them all
manually
2017-07-13 19:03:39 -04:00