[evince] shell: Use GdkRGBA for annotations



commit c523ef834e068698c5a425698e0d23e45a253320
Author: Christian Persch <chpe gnome org>
Date:   Wed Jun 13 01:13:50 2012 +0200

    shell: Use GdkRGBA for annotations
    
    Use the GdkRGBA API on EvAnnotation, and on GtkColorChooser.

 shell/ev-annotation-properties-dialog.c |   16 ++++++++--------
 shell/ev-annotation-properties-dialog.h |    4 ++--
 shell/ev-window.c                       |    6 +++---
 3 files changed, 13 insertions(+), 13 deletions(-)
---
diff --git a/shell/ev-annotation-properties-dialog.c b/shell/ev-annotation-properties-dialog.c
index 87efc40..a17bbf7 100644
--- a/shell/ev-annotation-properties-dialog.c
+++ b/shell/ev-annotation-properties-dialog.c
@@ -129,7 +129,7 @@ ev_annotation_properties_dialog_init (EvAnnotationPropertiesDialog *annot_dialog
 	GtkWidget *grid;
 	GtkWidget *hbox;
 	gchar     *markup;
-	GdkColor   color = { 0, 65535, 65535, 0 };
+        const GdkRGBA yellow = { 1., 1., 0., 1. };
 
 	gtk_window_set_title (GTK_WINDOW (annot_dialog), _("Annotation Properties"));
 	gtk_window_set_destroy_with_parent (GTK_WINDOW (annot_dialog), TRUE);
@@ -167,7 +167,7 @@ ev_annotation_properties_dialog_init (EvAnnotationPropertiesDialog *annot_dialog
 	gtk_grid_attach (GTK_GRID (grid), label, 0, 1, 1, 1);
 	gtk_widget_show (label);
 
-	annot_dialog->color = gtk_color_button_new_with_color (&color);
+	annot_dialog->color = gtk_color_button_new_with_rgba (&yellow);
 	gtk_grid_attach (GTK_GRID (grid), annot_dialog->color, 1, 1, 1, 1);
         gtk_widget_set_hexpand (annot_dialog->color, TRUE);
 	gtk_widget_show (annot_dialog->color);
@@ -252,7 +252,7 @@ ev_annotation_properties_dialog_new_with_annotation (EvAnnotation *annot)
 	const gchar                  *label;
 	gdouble                       opacity;
 	gboolean                      is_open;
-	GdkColor                      color;
+	GdkRGBA                       rgba;
 
 	dialog = (EvAnnotationPropertiesDialog *)ev_annotation_properties_dialog_new (ev_annotation_get_annotation_type (annot));
 	dialog->annot = g_object_ref (annot);
@@ -261,8 +261,8 @@ ev_annotation_properties_dialog_new_with_annotation (EvAnnotation *annot)
 	if (label)
 		gtk_entry_set_text (GTK_ENTRY (dialog->author), label);
 
-	ev_annotation_get_color (annot, &color);
-	gtk_color_button_set_color (GTK_COLOR_BUTTON (dialog->color), &color);
+	ev_annotation_get_rgba (annot, &rgba);
+	gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (dialog->color), &rgba);
 
 	opacity = ev_annotation_markup_get_opacity (EV_ANNOTATION_MARKUP (annot));
 	gtk_range_set_value (GTK_RANGE (dialog->opacity), opacity * 100);
@@ -288,10 +288,10 @@ ev_annotation_properties_dialog_get_author (EvAnnotationPropertiesDialog *dialog
 }
 
 void
-ev_annotation_properties_dialog_get_color (EvAnnotationPropertiesDialog *dialog,
-					   GdkColor                     *color)
+ev_annotation_properties_dialog_get_rgba (EvAnnotationPropertiesDialog *dialog,
+					  GdkRGBA                      *rgba)
 {
-	gtk_color_button_get_color (GTK_COLOR_BUTTON (dialog->color), color);
+	gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (dialog->color), rgba);
 }
 
 gdouble
diff --git a/shell/ev-annotation-properties-dialog.h b/shell/ev-annotation-properties-dialog.h
index e21a883..8dcec5a 100644
--- a/shell/ev-annotation-properties-dialog.h
+++ b/shell/ev-annotation-properties-dialog.h
@@ -43,8 +43,8 @@ GtkWidget           *ev_annotation_properties_dialog_new                 (EvAnno
 GtkWidget           *ev_annotation_properties_dialog_new_with_annotation (EvAnnotation                 *annot);
 
 const gchar         *ev_annotation_properties_dialog_get_author          (EvAnnotationPropertiesDialog *dialog);
-void                 ev_annotation_properties_dialog_get_color           (EvAnnotationPropertiesDialog *dialog,
-									  GdkColor                     *color);
+void                 ev_annotation_properties_dialog_get_rgba            (EvAnnotationPropertiesDialog *dialog,
+									  GdkRGBA                      *rgba);
 gdouble              ev_annotation_properties_dialog_get_opacity         (EvAnnotationPropertiesDialog *dialog);
 gboolean             ev_annotation_properties_dialog_get_popup_is_open   (EvAnnotationPropertiesDialog *dialog);
 EvAnnotationTextIcon ev_annotation_properties_dialog_get_text_icon       (EvAnnotationPropertiesDialog *dialog);
diff --git a/shell/ev-window.c b/shell/ev-window.c
index d4ac059..c8bd717 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -6705,7 +6705,7 @@ ev_view_popup_cmd_annot_properties (GtkAction *action,
 				    EvWindow  *window)
 {
 	const gchar                  *author;
-	GdkColor                      color;
+	GdkRGBA                       rgba;
 	gdouble                       opacity;
 	gboolean                      popup_is_open;
 	EvAnnotationPropertiesDialog *dialog;
@@ -6727,8 +6727,8 @@ ev_view_popup_cmd_annot_properties (GtkAction *action,
 	if (ev_annotation_markup_set_label (EV_ANNOTATION_MARKUP (annot), author))
 		mask |= EV_ANNOTATIONS_SAVE_LABEL;
 
-	ev_annotation_properties_dialog_get_color (dialog, &color);
-	if (ev_annotation_set_color (annot, &color))
+	ev_annotation_properties_dialog_get_rgba (dialog, &rgba);
+	if (ev_annotation_set_rgba (annot, &rgba))
 		mask |= EV_ANNOTATIONS_SAVE_COLOR;
 
 	opacity = ev_annotation_properties_dialog_get_opacity (dialog);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]