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-loading-message.c File Reference
#include "config.h"
#include "ev-loading-message.h"
#include <string.h>
#include <glib/gi18n.h>
+ Include dependency graph for ev-loading-message.c:

Go to the source code of this file.

Data Structures

struct  _EvLoadingMessage
 
struct  _EvLoadingMessageClass
 

Functions

static void ev_loading_message_init (EvLoadingMessage *message)
 
static void get_widget_padding (GtkWidget *widget, GtkBorder *padding)
 
static void ev_loading_message_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
 
static void ev_loading_message_get_preferred_width (GtkWidget *widget, gint *minimum_size, gint *natural_size)
 
static void ev_loading_message_get_preferred_height (GtkWidget *widget, gint *minimum_size, gint *natural_size)
 
static gboolean ev_loading_message_draw (GtkWidget *widget, cairo_t *cr)
 
static void ev_loading_message_hide (GtkWidget *widget)
 
static void ev_loading_message_show (GtkWidget *widget)
 
static void ev_loading_message_class_init (EvLoadingMessageClass *klass)
 
GtkWidget * ev_loading_message_new (void)
 

Function Documentation

static void ev_loading_message_class_init ( EvLoadingMessageClass klass)
static

Definition at line 152 of file ev-loading-message.c.

153 {
154  GtkWidgetClass *gtk_widget_class = GTK_WIDGET_CLASS (klass);
155 
156  gtk_widget_class->size_allocate = ev_loading_message_size_allocate;
157  gtk_widget_class->get_preferred_width = ev_loading_message_get_preferred_width;
158  gtk_widget_class->get_preferred_height = ev_loading_message_get_preferred_height;
159  gtk_widget_class->draw = ev_loading_message_draw;
160  gtk_widget_class->show = ev_loading_message_show;
161  gtk_widget_class->hide = ev_loading_message_hide;
162 }
static gboolean ev_loading_message_draw ( GtkWidget *  widget,
cairo_t *  cr 
)
static

Definition at line 113 of file ev-loading-message.c.

115 {
116  GtkStyleContext *context;
117  gint width, height;
118 
119  context = gtk_widget_get_style_context (widget);
120  width = gtk_widget_get_allocated_width (widget);
121  height = gtk_widget_get_allocated_height (widget);
122 
123  gtk_render_background (context, cr, 0, 0, width, height);
124  gtk_render_frame (context, cr, 0, 0, width, height);
125 
126  GTK_WIDGET_CLASS (ev_loading_message_parent_class)->draw (widget, cr);
127 
128  return TRUE;
129 }

+ Here is the caller graph for this function:

static void ev_loading_message_get_preferred_height ( GtkWidget *  widget,
gint *  minimum_size,
gint *  natural_size 
)
static

Definition at line 99 of file ev-loading-message.c.

102 {
103  GtkBorder padding;
104 
105  GTK_WIDGET_CLASS (ev_loading_message_parent_class)->get_preferred_height (widget, minimum_size, natural_size);
106 
107  get_widget_padding (widget, &padding);
108  *minimum_size += padding.top + padding.bottom;
109  *natural_size += padding.top + padding.bottom;
110 }

+ Here is the caller graph for this function:

static void ev_loading_message_get_preferred_width ( GtkWidget *  widget,
gint *  minimum_size,
gint *  natural_size 
)
static

Definition at line 85 of file ev-loading-message.c.

88 {
89  GtkBorder padding;
90 
91  GTK_WIDGET_CLASS (ev_loading_message_parent_class)->get_preferred_width (widget, minimum_size, natural_size);
92 
93  get_widget_padding (widget, &padding);
94  *minimum_size += padding.left + padding.right;
95  *natural_size += padding.left + padding.right;
96 }

+ Here is the caller graph for this function:

static void ev_loading_message_hide ( GtkWidget *  widget)
static

Definition at line 132 of file ev-loading-message.c.

133 {
134  EvLoadingMessage *message = EV_LOADING_MESSAGE (widget);
135 
136  gtk_spinner_stop (GTK_SPINNER (message->spinner));
137 
138  GTK_WIDGET_CLASS (ev_loading_message_parent_class)->hide (widget);
139 }

+ Here is the caller graph for this function:

static void ev_loading_message_init ( EvLoadingMessage message)
static

Definition at line 40 of file ev-loading-message.c.

41 {
42  GtkWidget *label;
43 
44  gtk_container_set_border_width (GTK_CONTAINER (message), 10);
45 
46  message->spinner = gtk_spinner_new ();
47  gtk_box_pack_start (GTK_BOX (message), message->spinner, FALSE, FALSE, 0);
48  gtk_widget_show (message->spinner);
49 
50  label = gtk_label_new (_("Loading…"));
51  gtk_box_pack_start (GTK_BOX (message), label, FALSE, FALSE, 0);
52  gtk_widget_show (label);
53 }
GtkWidget* ev_loading_message_new ( void  )

Definition at line 166 of file ev-loading-message.c.

167 {
168  GtkWidget *message;
169 
170  message = g_object_new (EV_TYPE_LOADING_MESSAGE,
171  "orientation", GTK_ORIENTATION_HORIZONTAL,
172  "spacing", 12,
173  NULL);
174  return message;
175 }

+ Here is the caller graph for this function:

static void ev_loading_message_show ( GtkWidget *  widget)
static

Definition at line 142 of file ev-loading-message.c.

143 {
144  EvLoadingMessage *message = EV_LOADING_MESSAGE (widget);
145 
146  gtk_spinner_start (GTK_SPINNER (message->spinner));
147 
148  GTK_WIDGET_CLASS (ev_loading_message_parent_class)->show (widget);
149 }

+ Here is the caller graph for this function:

static void ev_loading_message_size_allocate ( GtkWidget *  widget,
GtkAllocation *  allocation 
)
static

Definition at line 68 of file ev-loading-message.c.

70 {
71  GtkAllocation child_allocation;
72  GtkBorder padding;
73 
74  get_widget_padding (widget, &padding);
75  child_allocation.y = allocation->x + padding.left;
76  child_allocation.x = allocation->y + padding.top;
77  child_allocation.width = MAX (1, allocation->width - (padding.left + padding.right));
78  child_allocation.height = MAX (1, allocation->height - (padding.top + padding.bottom));
79 
80  GTK_WIDGET_CLASS (ev_loading_message_parent_class)->size_allocate (widget, &child_allocation);
81  gtk_widget_set_allocation (widget, allocation);
82 }

+ Here is the caller graph for this function:

static void get_widget_padding ( GtkWidget *  widget,
GtkBorder *  padding 
)
static

Definition at line 56 of file ev-loading-message.c.

58 {
59  GtkStyleContext *context;
60  GtkStateFlags state;
61 
62  context = gtk_widget_get_style_context (widget);
63  state = gtk_style_context_get_state (context);
64  gtk_style_context_get_padding (context, state, padding);
65 }

+ Here is the caller graph for this function: