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 732095 - rgba x color property of annotation
rgba x color property of annotation
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: pdf annotations
git master
Other Linux
: Normal minor
: ---
Assigned To: giselle
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-06-23 12:13 UTC by giselle
Modified: 2014-06-23 17:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Changing the signal used for annotation color in annotation window. (2.83 KB, patch)
2014-06-23 12:16 UTC, giselle
committed Details | Review
Annotation window uses GdkRGBA instead of GdkColor (3.75 KB, patch)
2014-06-23 15:18 UTC, giselle
none Details | Review

Description giselle 2014-06-23 12:13:05 UTC
According to documentation, the 'color' signal is deprecated and 'rgba' should be used in annotations.
Comment 1 giselle 2014-06-23 12:16:38 UTC
Created attachment 278996 [details] [review]
Changing the signal used for annotation color in annotation window.
Comment 2 José Aliste 2014-06-23 12:38:12 UTC
Review of attachment 278996 [details] [review]:

::: libview/ev-annotation-window.c
@@ -137,3 @@
         GtkStyleProperties *properties;
         GtkStyleProvider   *provider;
-	GdkRGBA             rgba;

this is wrong. you should erase the uses of set_color and get_color, plus connect only to the rgba, but you can't modify the API. so set_color and get_color must remain the same
Comment 3 giselle 2014-06-23 13:39:43 UTC
I understand. I see two solutions in this case:

1. Keep ev_annotation_window_set_color, with the same signature, and get an RGBA from the annotation, convert to Color to pass to this function and inside convert again to RGBA.

2. Implement ev_annotation_window_set_rgba and mark ev_annotation_window_set_color as deprecated.

Which one is better?
Comment 4 giselle 2014-06-23 15:18:53 UTC
Created attachment 279043 [details] [review]
Annotation window uses GdkRGBA instead of GdkColor

Using solution #2 of the previous comment.
Comment 5 Carlos Garcia Campos 2014-06-23 16:21:02 UTC
(In reply to comment #2)
> Review of attachment 278996 [details] [review]:
> 
> ::: libview/ev-annotation-window.c
> @@ -137,3 @@
>          GtkStyleProperties *properties;
>          GtkStyleProvider   *provider;
> -    GdkRGBA             rgba;
> 
> this is wrong. you should erase the uses of set_color and get_color, plus
> connect only to the rgba, but you can't modify the API. so set_color and
> get_color must remain the same

hmm, I think this patch is correct, ev_annotation_window API is private, so we don't need to deprecate anything there.
Comment 6 José Aliste 2014-06-23 16:25:29 UTC
oh, you are right, I missed the private API thing.
Comment 7 Carlos Garcia Campos 2014-06-23 16:58:04 UTC
Review of attachment 278996 [details] [review]:

LGTM
Comment 8 giselle 2014-06-23 17:21:55 UTC
Review of attachment 278996 [details] [review]:

Pushed, thank you!
Comment 9 giselle 2014-06-23 17:23:19 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.