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 740282 - 'atk_value_get_current_value' is deprecated
'atk_value_get_current_value' is deprecated
Status: RESOLVED FIXED
Product: java-atk-wrapper
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Magdalen Berns (irc magpie)
java-atk-wrapper maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-11-17 18:43 UTC by Magdalen Berns (irc magpie)
Modified: 2015-07-10 21:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to address problem (792 bytes, patch)
2014-11-17 18:47 UTC, Magdalen Berns (irc magpie)
committed Details | Review
Patch to address problem (2.25 KB, patch)
2014-11-17 23:35 UTC, Magdalen Berns (irc magpie)
none Details | Review

Description Magdalen Berns (irc magpie) 2014-11-17 18:43:27 UTC
jawvalue.c: In function 'jaw_value_get_minimum_increment':

Use 'atk_value_get_value_and_text' instead
Comment 1 Magdalen Berns (irc magpie) 2014-11-17 18:47:08 UTC
Created attachment 290874 [details] [review]
Patch to address problem
Comment 2 Joanmarie Diggs (IRC: joanie) 2014-11-17 19:17:18 UTC
Silly question:

-	atk_value_get_current_value(obj, &curValue);
+	atk_value_get_current_value_and_text(obj, &curValue);

Does java-atk-wrapper even build with that change?
Comment 3 Magdalen Berns (irc magpie) 2014-11-17 19:24:19 UTC
(In reply to comment #2)
> Silly question:
> 
> -    atk_value_get_current_value(obj, &curValue);
> +    atk_value_get_current_value_and_text(obj, &curValue);
> 
> Does java-atk-wrapper even build with that change?

Yes.
Comment 4 Joanmarie Diggs (IRC: joanie) 2014-11-17 19:34:09 UTC
Okie dokie.

Since I don't see a method named atk_value_get_current_value_and text in ATK (the new method as you stated in the opening report is atk_value_get_value_and_text), and since that new method takes three arguments instead of two, I figured it wouldn't compile. Apologies.
Comment 5 Magdalen Berns (irc magpie) 2014-11-17 19:56:39 UTC
(In reply to comment #4)
> Okie dokie.
> 
> Since I don't see a method named atk_value_get_current_value_and text in ATK
> (the new method as you stated in the opening report is
> atk_value_get_value_and_text), and since that new method takes three arguments
> instead of two, I figured it wouldn't compile. Apologies.

Ah, ok. Thanks for the explanation. It seems odd that this compiles now you mention that. I was struggling to find documents so I just went off a proposal about this method. I think it's probably better to use atk_value_get_value_and_text under the circumstances. I'll reopen this bug.


[1] https://developer.gnome.org/atk/stable/AtkValue.html#atk-value-get-value-and-text
[2] https://mail.gnome.org/archives/gnome-accessibility-devel/2013-December/msg00005.html
Comment 6 Magdalen Berns (irc magpie) 2014-11-17 23:08:47 UTC
I think the method calling this probably wants to be using atk_value_get_increment () on looking into it a bit further. It does not seem to want to do anything with the text.

The method making the call is called jaw_value_get_minimum_increment() but looking at the ATK API it seems like for ATK, this method is deprecated and urges the use of atk_value_get_increment instead[1,2]

i.e. I think that:

static void
jaw_value_get_minimum_increment (AtkValue *obj, GValue *value)
{
	if (!value) {
		return;
	}

	GValue curValue = {0,};
	atk_value_get_increment(obj);

	if (G_TYPE_IS_FUNDAMENTAL (G_VALUE_TYPE (&curValue))) {
		switch (curValue.g_type) {
			case G_TYPE_CHAR:
			case G_TYPE_INT:
			case G_TYPE_INT64:
			{
				g_value_init(value, G_TYPE_INT);
				g_value_set_int(value, 1);
				return;
			}
			default:
				break;
		}
	}

Should be something a bit more like:

static gdouble
jaw_value_get_increment (AtkValue *obj)
{ 
   return atk_value_get_increment(obj);
}


[1] https://developer.gnome.org/atk/stable/AtkValue.html#atk-value-get-minimum-increment
[2] https://developer.gnome.org/atk/stable/AtkValue.html#atk-value-get-increment
Comment 7 Magdalen Berns (irc magpie) 2014-11-17 23:35:20 UTC
Created attachment 290887 [details] [review]
Patch to address problem

I think this patch should work better with the current API.
Comment 8 André Klapper 2015-02-27 16:54:20 UTC
[Moving at-spi/java-atk-wrapper bugs to separate product. See bug 740075]
Comment 9 Magdalen Berns (irc magpie) 2015-07-10 21:07:55 UTC
I dunno what was happening in this bug, but it's safe to say atk_value_get_value_and_text is no longer implemented as recommended and the increment train relates to another issue altogether:

https://git.gnome.org/browse/atk/tree/atk/atkvalue.h#n143

Closing!