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-message-area.h File Reference
#include <gtk/gtk.h>
+ Include dependency graph for ev-message-area.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _EvMessageArea
 
struct  _EvMessageAreaClass
 

Macros

#define EV_TYPE_MESSAGE_AREA   (ev_message_area_get_type ())
 
#define EV_MESSAGE_AREA(obj)   (G_TYPE_CHECK_INSTANCE_CAST ((obj), EV_TYPE_MESSAGE_AREA, EvMessageArea))
 
#define EV_MESSAGE_AREA_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), EV_TYPE_MESSAGE_AREA, EvMessageAreaClass))
 
#define EV_IS_MESSAGE_AREA(obj)   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EV_TYPE_MESSAGE_AREA))
 
#define EV_IS_MESSAGE_AREA_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), EV_TYPE_MESSAGE_AREA))
 
#define EV_MESSAGE_AREA_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), EV_TYPE_MESSAGE_AREA, EvMessageAreaClass))
 

Typedefs

typedef struct _EvMessageArea EvMessageArea
 
typedef struct _EvMessageAreaClass EvMessageAreaClass
 
typedef struct
_EvMessageAreaPrivate 
EvMessageAreaPrivate
 

Functions

GType ev_message_area_get_type (void) G_GNUC_CONST
 
GtkWidget * ev_message_area_new (GtkMessageType type, const gchar *text, const gchar *first_button_text,...)
 
void ev_message_area_set_image (EvMessageArea *area, GtkWidget *image)
 
void ev_message_area_set_image_from_stock (EvMessageArea *area, const gchar *stock_id)
 
void ev_message_area_set_text (EvMessageArea *area, const gchar *str)
 
void ev_message_area_set_secondary_text (EvMessageArea *area, const gchar *str)
 
void _ev_message_area_add_buttons_valist (EvMessageArea *area, const gchar *first_button_text, va_list args)
 
GtkWidget * _ev_message_area_get_main_box (EvMessageArea *area)
 

Macro Definition Documentation

#define EV_IS_MESSAGE_AREA (   obj)    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EV_TYPE_MESSAGE_AREA))

Definition at line 34 of file ev-message-area.h.

#define EV_IS_MESSAGE_AREA_CLASS (   klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), EV_TYPE_MESSAGE_AREA))

Definition at line 35 of file ev-message-area.h.

#define EV_MESSAGE_AREA (   obj)    (G_TYPE_CHECK_INSTANCE_CAST ((obj), EV_TYPE_MESSAGE_AREA, EvMessageArea))

Definition at line 32 of file ev-message-area.h.

#define EV_MESSAGE_AREA_CLASS (   klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), EV_TYPE_MESSAGE_AREA, EvMessageAreaClass))

Definition at line 33 of file ev-message-area.h.

#define EV_MESSAGE_AREA_GET_CLASS (   obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), EV_TYPE_MESSAGE_AREA, EvMessageAreaClass))

Definition at line 36 of file ev-message-area.h.

#define EV_TYPE_MESSAGE_AREA   (ev_message_area_get_type ())

Definition at line 31 of file ev-message-area.h.

Typedef Documentation

typedef struct _EvMessageArea EvMessageArea

Definition at line 38 of file ev-message-area.h.

Definition at line 39 of file ev-message-area.h.

Definition at line 40 of file ev-message-area.h.

Function Documentation

void _ev_message_area_add_buttons_valist ( EvMessageArea area,
const gchar *  first_button_text,
va_list  args 
)

Definition at line 232 of file ev-message-area.c.

235 {
236  const gchar* text;
237  gint response_id;
238 
239  if (first_button_text == NULL)
240  return;
241 
242  text = first_button_text;
243  response_id = va_arg (args, gint);
244 
245  while (text != NULL) {
246  gtk_info_bar_add_button (GTK_INFO_BAR (area), text, response_id);
247 
248  text = va_arg (args, gchar*);
249  if (text == NULL)
250  break;
251 
252  response_id = va_arg (args, int);
253  }
254 }

+ Here is the caller graph for this function:

GtkWidget* _ev_message_area_get_main_box ( EvMessageArea area)

Definition at line 257 of file ev-message-area.c.

258 {
259  return area->priv->main_box;
260 }

+ Here is the caller graph for this function:

GType ev_message_area_get_type ( void  )
GtkWidget* ev_message_area_new ( GtkMessageType  type,
const gchar *  text,
const gchar *  first_button_text,
  ... 
)

Definition at line 263 of file ev-message-area.c.

267 {
268  GtkWidget *widget;
269 
270  widget = g_object_new (EV_TYPE_MESSAGE_AREA,
271  "message-type", type,
272  "text", text,
273  NULL);
275  if (first_button_text) {
276  va_list args;
277 
278  va_start (args, first_button_text);
280  first_button_text, args);
281  va_end (args);
282  }
283 
284  return widget;
285 }

+ Here is the caller graph for this function:

void ev_message_area_set_image ( EvMessageArea area,
GtkWidget *  image 
)

Definition at line 288 of file ev-message-area.c.

290 {
291  GtkWidget *parent;
292 
293  g_return_if_fail (EV_IS_MESSAGE_AREA (area));
294 
295  area->priv->message_type = GTK_MESSAGE_OTHER;
296 
297  parent = gtk_widget_get_parent (area->priv->image);
298  gtk_container_add (GTK_CONTAINER (parent), image);
299  gtk_container_remove (GTK_CONTAINER (parent), area->priv->image);
300  gtk_box_reorder_child (GTK_BOX (parent), image, 0);
301 
302  area->priv->image = image;
303 
304  g_object_notify (G_OBJECT (area), "image");
305 }

+ Here is the caller graph for this function:

void ev_message_area_set_image_from_stock ( EvMessageArea area,
const gchar *  stock_id 
)

Definition at line 308 of file ev-message-area.c.

310 {
311  g_return_if_fail (EV_IS_MESSAGE_AREA (area));
312  g_return_if_fail (stock_id != NULL);
313 
314  gtk_image_set_from_stock (GTK_IMAGE (area->priv->image),
315  stock_id,
316  GTK_ICON_SIZE_DIALOG);
317 }

+ Here is the caller graph for this function:

void ev_message_area_set_secondary_text ( EvMessageArea area,
const gchar *  str 
)

Definition at line 339 of file ev-message-area.c.

341 {
342  g_return_if_fail (EV_IS_MESSAGE_AREA (area));
343 
344  if (str) {
345  gchar *msg;
346 
347  msg = g_strdup_printf ("<small>%s</small>", str);
348  gtk_label_set_markup (GTK_LABEL (area->priv->secondary_label), msg);
349  g_free (msg);
350  gtk_widget_show (area->priv->secondary_label);
351  } else {
352  gtk_label_set_markup (GTK_LABEL (area->priv->secondary_label), NULL);
353  gtk_widget_hide (area->priv->secondary_label);
354  }
355 
356  g_object_notify (G_OBJECT (area), "secondary-text");
357 }

+ Here is the caller graph for this function:

void ev_message_area_set_text ( EvMessageArea area,
const gchar *  str 
)

Definition at line 320 of file ev-message-area.c.

322 {
323  g_return_if_fail (EV_IS_MESSAGE_AREA (area));
324 
325  if (str) {
326  gchar *msg;
327 
328  msg = g_strdup_printf ("<b>%s</b>", str);
329  gtk_label_set_markup (GTK_LABEL (area->priv->label), msg);
330  g_free (msg);
331  } else {
332  gtk_label_set_markup (GTK_LABEL (area->priv->label), NULL);
333  }
334 
335  g_object_notify (G_OBJECT (area), "text");
336 }

+ Here is the caller graph for this function: