Evince
Evince is a document viewer capable of displaying multiple and single page document formats like PDF and Postscript.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ev-progress-message-area.c File Reference
#include <config.h>
#include <gtk/gtk.h>
#include "ev-progress-message-area.h"
+ Include dependency graph for ev-progress-message-area.c:

Go to the source code of this file.

Data Structures

struct  _EvProgressMessageAreaPrivate
 

Macros

#define EV_PROGRESS_MESSAGE_AREA_GET_PRIVATE(obj)   (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EV_TYPE_PROGRESS_MESSAGE_AREA, EvProgressMessageAreaPrivate))
 

Enumerations

enum  { PROP_0, PROP_STATUS, PROP_FRACTION }
 

Functions

static void ev_progress_message_area_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
 
static void ev_progress_message_area_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
 
static void ev_progress_message_area_class_init (EvProgressMessageAreaClass *class)
 
static void ev_progress_message_area_init (EvProgressMessageArea *area)
 
GtkWidget * ev_progress_message_area_new (const gchar *stock_id, const gchar *text, const gchar *first_button_text,...)
 
void ev_progress_message_area_set_status (EvProgressMessageArea *area, const gchar *str)
 
void ev_progress_message_area_set_fraction (EvProgressMessageArea *area, gdouble fraction)
 

Macro Definition Documentation

#define EV_PROGRESS_MESSAGE_AREA_GET_PRIVATE (   obj)    (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EV_TYPE_PROGRESS_MESSAGE_AREA, EvProgressMessageAreaPrivate))

Definition at line 27 of file ev-progress-message-area.c.

Enumeration Type Documentation

anonymous enum
Enumerator
PROP_0 
PROP_STATUS 
PROP_FRACTION 

Definition at line 35 of file ev-progress-message-area.c.

35  {
36  PROP_0,
39 };

Function Documentation

static void ev_progress_message_area_class_init ( EvProgressMessageAreaClass class)
static

Definition at line 53 of file ev-progress-message-area.c.

54 {
55  GObjectClass *gobject_class = G_OBJECT_CLASS (class);
56 
57  gobject_class->set_property = ev_progress_message_area_set_property;
58  gobject_class->get_property = ev_progress_message_area_get_property;
59 
60  g_object_class_install_property (gobject_class,
62  g_param_spec_string ("status",
63  "Status",
64  "The status text of the progress area",
65  NULL,
66  G_PARAM_READWRITE |
67  G_PARAM_STATIC_STRINGS));
68  g_object_class_install_property (gobject_class,
70  g_param_spec_double ("fraction",
71  "Fraction",
72  "The fraction of total work that has been completed",
73  0.0, 1.0, 0.0,
74  G_PARAM_READWRITE |
75  G_PARAM_STATIC_STRINGS));
76 
77  g_type_class_add_private (gobject_class, sizeof (EvProgressMessageAreaPrivate));
78 }
static void ev_progress_message_area_get_property ( GObject *  object,
guint  prop_id,
GValue *  value,
GParamSpec *  pspec 
)
static

Definition at line 130 of file ev-progress-message-area.c.

134 {
136 
137  switch (prop_id) {
138  case PROP_STATUS:
139  g_value_set_string (value, gtk_label_get_label (GTK_LABEL (area->priv->label)));
140  break;
141  case PROP_FRACTION: {
142  gdouble fraction;
143 
144  fraction = gtk_progress_bar_get_fraction (GTK_PROGRESS_BAR (area->priv->progress_bar));
145  g_value_set_double (value, fraction);
146  }
147  break;
148  default:
149  G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
150  }
151 }

+ Here is the caller graph for this function:

static void ev_progress_message_area_init ( EvProgressMessageArea area)
static

Definition at line 81 of file ev-progress-message-area.c.

82 {
83  GtkWidget *contents;
84  GtkWidget *vbox;
85 
87 
89 
90  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
91 
92  area->priv->label = gtk_label_new (NULL);
93  gtk_label_set_use_markup (GTK_LABEL (area->priv->label), TRUE);
94  gtk_label_set_ellipsize (GTK_LABEL (area->priv->label),
95  PANGO_ELLIPSIZE_END);
96  gtk_misc_set_alignment (GTK_MISC (area->priv->label), 0.0, 0.5);
97  gtk_box_pack_start (GTK_BOX (vbox), area->priv->label, TRUE, TRUE, 0);
98  gtk_widget_show (area->priv->label);
99 
100  area->priv->progress_bar = gtk_progress_bar_new ();
101  gtk_widget_set_size_request (area->priv->progress_bar, -1, 15);
102  gtk_box_pack_start (GTK_BOX (vbox), area->priv->progress_bar, TRUE, FALSE, 0);
103  gtk_widget_show (area->priv->progress_bar);
104 
105  gtk_box_pack_start (GTK_BOX (contents), vbox, TRUE, TRUE, 0);
106  gtk_widget_show (vbox);
107 }
GtkWidget* ev_progress_message_area_new ( const gchar *  stock_id,
const gchar *  text,
const gchar *  first_button_text,
  ... 
)

Definition at line 154 of file ev-progress-message-area.c.

158 {
159  GtkWidget *widget;
160 
161  widget = g_object_new (EV_TYPE_PROGRESS_MESSAGE_AREA,
162  "message-type", GTK_MESSAGE_OTHER,
163  "text", text,
164  NULL);
165  if (first_button_text) {
166  va_list args;
167 
168  va_start (args, first_button_text);
170  first_button_text,
171  args);
172  va_end (args);
173  }
174 
176 
177  return widget;
178 }

+ Here is the caller graph for this function:

void ev_progress_message_area_set_fraction ( EvProgressMessageArea area,
gdouble  fraction 
)

Definition at line 192 of file ev-progress-message-area.c.

194 {
195  g_return_if_fail (EV_IS_PROGRESS_MESSAGE_AREA (area));
196 
197  gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (area->priv->progress_bar),
198  fraction);
199  g_object_notify (G_OBJECT (area), "fraction");
200 }

+ Here is the caller graph for this function:

static void ev_progress_message_area_set_property ( GObject *  object,
guint  prop_id,
const GValue *  value,
GParamSpec *  pspec 
)
static

Definition at line 110 of file ev-progress-message-area.c.

114 {
116 
117  switch (prop_id) {
118  case PROP_STATUS:
119  ev_progress_message_area_set_status (area, g_value_get_string (value));
120  break;
121  case PROP_FRACTION:
122  ev_progress_message_area_set_fraction (area, g_value_get_double (value));
123  break;
124  default:
125  G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
126  }
127 }

+ Here is the caller graph for this function:

void ev_progress_message_area_set_status ( EvProgressMessageArea area,
const gchar *  str 
)

Definition at line 181 of file ev-progress-message-area.c.

183 {
184  g_return_if_fail (EV_IS_PROGRESS_MESSAGE_AREA (area));
185 
186  gtk_label_set_text (GTK_LABEL (area->priv->label), str);
187 
188  g_object_notify (G_OBJECT (area), "status");
189 }

+ Here is the caller graph for this function: