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 682840 - Deprecate much of pango-utils.h
Deprecate much of pango-utils.h
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: pango-maint
pango-maint
: 682841 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-08-28 02:08 UTC by Behdad Esfahbod
Modified: 2015-05-16 21:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Deprecate noop utility functions (3.82 KB, patch)
2015-04-13 20:17 UTC, Khaled Hosny
committed Details | Review
Deprecate unused utility functions (2.48 KB, patch)
2015-04-13 21:47 UTC, Khaled Hosny
none Details | Review

Description Behdad Esfahbod 2012-08-28 02:08:30 UTC
Pretty much all of it can go.
Comment 1 André Klapper 2012-08-28 09:46:59 UTC
*** Bug 682841 has been marked as a duplicate of this bug. ***
Comment 2 Khaled Hosny 2015-04-05 20:49:40 UTC
I was going to open a new bug for deprecating pango_get_sysconf_subdirectory() and pango_get_lib_subdirectory() as they are of no use now after bug 733882 (to help with bug 733137), but since this one is already open I’ll use it.

I’m just not sure what the function should return now, an empty string or NULL? or even some dummy path?
Comment 3 Behdad Esfahbod 2015-04-05 20:52:43 UTC
Maybe there's a glib function we can just call and return?  I don't have any preference.  NULL sounds safer.
Comment 4 Khaled Hosny 2015-04-05 21:15:49 UTC
Glib does not seem to have a direct equivalent for those, and may worry about returning NULL is that clients might not be prepared to handle it (though I have hard time finding any third party code using them). But if we just want to get rid of the DllMain thing, we can just pass NULL to g_win32_get_package_installation_directory_of_module() which makes it look up for the directory of the executable rather than process, but it hardly matters anyway.
Comment 5 Behdad Esfahbod 2015-04-05 21:19:16 UTC
I'm fine either way.  Matthias?
Comment 6 Matthias Clasen 2015-04-06 11:03:57 UTC
if you want to deprecate the functions, just leave them as they are - returning something other than what they are documented as returning is going to break potential users out there.

The alternative is to just break them outright, but then you might as well remove the functions.
Comment 7 Khaled Hosny 2015-04-06 13:33:41 UTC
But what those functions refer too just gone, pango no longer have a conf or lib dirs to return.
Comment 8 Behdad Esfahbod 2015-04-06 17:02:17 UTC
So far we haven't been removing functions for ABI reasons.  We are breaking any users that rely on modules and engines, but we don't know any users that would be affected.  We might want to do a removal at some point, but there's no rush in doing that.

Khaled: just make them return something that 1. wouldn't crash any client, and 2. is not a clear security issue.  Can't think of anything for 2.  Just return whatever is convenient.
Comment 9 Khaled Hosny 2015-04-13 20:17:52 UTC
Created attachment 301492 [details] [review]
Deprecate noop utility functions

After the removal of modules and configuration files, both
pango_get_lib_subdirectory and pango_get_sysconf_subdirectory are
meaningless now. This patch deprecates them and removes the Windows
specific behaviour as it prevents statically compiling Pango under
Windows.
Comment 10 Behdad Esfahbod 2015-04-13 20:20:29 UTC
Thanks Khaled.  Please push it out!
Comment 11 Khaled Hosny 2015-04-13 21:12:42 UTC
Comment on attachment 301492 [details] [review]
Deprecate noop utility functions

Attachment 301492 [details] pushed as d2dda8d - Deprecate noop utility functions
Comment 12 Khaled Hosny 2015-04-13 21:47:20 UTC
Created attachment 301493 [details] [review]
Deprecate unused utility functions
Comment 13 Khaled Hosny 2015-04-13 21:50:48 UTC
The last patch deprecates most of what remains in pango-utils, except the version functions (should remain I think), pango_skip_space and pango_scan_string (used in pangowin32-fontmap.c), pango_scan_int (used in pango-markup.c).
Comment 14 Khaled Hosny 2015-04-26 20:47:27 UTC
Behdad, what do you think about the last patch?
Comment 15 Behdad Esfahbod 2015-04-26 20:52:24 UTC
Looks good.  pango_skip_space, pango_scan_string, and pango_scan_int can be deprecated as well, even if they are used internally.  The point was that these are minor utilities that should have remained internal functions, not public API.

Another approach is to not leave them all intact and leave them as is.  I don't have a strong preference one way or another.
Comment 16 Behdad Esfahbod 2015-04-26 20:53:39 UTC
Make the call yourself and push out.  I'd rather we deprecate all or deprecate none.

The pango_parse_* ones are useful, so they should stay.
Comment 17 Khaled Hosny 2015-05-10 15:04:03 UTC
OK, I deprecated all but the ones I think really belong to Pango, namely pango_version*, pango_is_zero_width, pango_quantize_line_geometry, pango_units_[to|from]_double and pango_extents_to_pixels.

No code was removed, but if we decided to do it at some point, I think the useful ones that we need internally should be just made private.
Comment 18 Kalev Lember 2015-05-10 15:08:51 UTC
From https://git.gnome.org/browse/pango/commit/?id=f79b50df9d6116759cca5b043692e8d67e3c0984

+ *
+ * Deprecated: 1.37

Should it be 1.38 (the next stable version) instead?
Comment 19 Behdad Esfahbod 2015-05-11 19:20:37 UTC
(In reply to Kalev Lember from comment #18)
> From
> https://git.gnome.org/browse/pango/commit/
> ?id=f79b50df9d6116759cca5b043692e8d67e3c0984
> 
> + *
> + * Deprecated: 1.37
> 
> Should it be 1.38 (the next stable version) instead?

Correct.  That's what we've been doing so far.  Though, I have started doubting the usefulness of that practice.  But lets stick to it for now.  Thanks
Comment 20 Matthias Clasen 2015-05-16 21:08:46 UTC
Pushed the version fix