aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'widgets')
-rw-r--r--widgets/misc/e-contact-map-window.c74
-rw-r--r--widgets/misc/e-contact-marker.c15
-rw-r--r--widgets/misc/e-web-view.c94
3 files changed, 102 insertions, 81 deletions
diff --git a/widgets/misc/e-contact-map-window.c b/widgets/misc/e-contact-map-window.c
index 1618086a1b..41570ee748 100644
--- a/widgets/misc/e-contact-map-window.c
+++ b/widgets/misc/e-contact-map-window.c
@@ -64,17 +64,23 @@ enum {
static gint signals[LAST_SIGNAL] = {0};
static void
-marker_doubleclick_cb (ClutterActor *marker,
- gpointer user_data)
+marker_doubleclick_cb (ClutterActor *actor,
+ gpointer user_data)
{
EContactMapWindow *window = user_data;
- const gchar *contact_uid = e_contact_marker_get_contact_uid (E_CONTACT_MARKER (marker));
+ EContactMarker *marker;
+ const gchar *contact_uid;
+
+ marker = E_CONTACT_MARKER (actor);
+ contact_uid = e_contact_marker_get_contact_uid (marker);
g_signal_emit (window, signals[SHOW_CONTACT_EDITOR], 0, contact_uid);
}
static void
-book_contacts_received_cb (GObject *source_object, GAsyncResult *result, gpointer user_data)
+book_contacts_received_cb (GObject *source_object,
+ GAsyncResult *result,
+ gpointer user_data)
{
EContactMapWindow *window = user_data;
EBookClient *client = E_BOOK_CLIENT (source_object);
@@ -84,14 +90,16 @@ book_contacts_received_cb (GObject *source_object, GAsyncResult *result, gpointe
if (!e_book_client_get_contacts_finish (client, result, &contacts, &error))
contacts = NULL;
- if (error) {
- g_debug ("%s: Failed to get contacts: %s", G_STRFUNC, error ? error->message : "Unknown error");
- g_clear_error (&error);
+ if (error != NULL) {
+ g_warning (
+ "%s: Failed to get contacts: %s",
+ G_STRFUNC, error->message);
+ g_error_free (error);
}
- for (p = contacts; p; p = p->next) {
- e_contact_map_add_contact (window->priv->map, (EContact*) p->data);
- }
+ for (p = contacts; p; p = p->next)
+ e_contact_map_add_contact (
+ window->priv->map, (EContact*) p->data);
e_client_util_free_object_slist (contacts);
g_object_unref (client);
@@ -99,7 +107,7 @@ book_contacts_received_cb (GObject *source_object, GAsyncResult *result, gpointe
static void
contact_map_window_zoom_in_cb (GtkButton *button,
- gpointer user_data)
+ gpointer user_data)
{
EContactMapWindow *window = user_data;
ChamplainView *view;
@@ -111,7 +119,7 @@ contact_map_window_zoom_in_cb (GtkButton *button,
static void
contact_map_window_zoom_out_cb (GtkButton *button,
- gpointer user_data)
+ gpointer user_data)
{
EContactMapWindow *window = user_data;
ChamplainView *view;
@@ -122,8 +130,8 @@ contact_map_window_zoom_out_cb (GtkButton *button,
}
static void
zoom_level_changed_cb (ChamplainView *view,
- gint bzoom_level,
- gpointer user_data)
+ gint bzoom_level,
+ gpointer user_data)
{
EContactMapWindow *window = user_data;
gint zoom_level = champlain_view_get_zoom_level (view);
@@ -141,8 +149,8 @@ zoom_level_changed_cb (ChamplainView *view,
*/
static void
map_contact_added_cb (EContactMap *map,
- ClutterActor *marker,
- gpointer user_data)
+ ClutterActor *marker,
+ gpointer user_data)
{
EContactMapWindowPrivate *priv = E_CONTACT_MAP_WINDOW (user_data)->priv;
const gchar *name;
@@ -169,8 +177,8 @@ map_contact_added_cb (EContactMap *map,
static void
map_contact_removed_cb (EContactMap *map,
- const gchar *name,
- gpointer user_data)
+ const gchar *name,
+ gpointer user_data)
{
EContactMapWindowPrivate *priv = E_CONTACT_MAP_WINDOW (user_data)->priv;
GtkTreeIter iter;
@@ -193,8 +201,8 @@ map_contact_removed_cb (EContactMap *map,
static void
map_contact_geocoding_started_cb (EContactMap *map,
- ClutterActor *marker,
- gpointer user_data)
+ ClutterActor *marker,
+ gpointer user_data)
{
EContactMapWindowPrivate *priv = E_CONTACT_MAP_WINDOW (user_data)->priv;
@@ -206,8 +214,8 @@ map_contact_geocoding_started_cb (EContactMap *map,
static void
map_contact_geocoding_failed_cb (EContactMap *map,
- const gchar *name,
- gpointer user_data)
+ const gchar *name,
+ gpointer user_data)
{
EContactMapWindowPrivate *priv = E_CONTACT_MAP_WINDOW (user_data)->priv;
@@ -221,7 +229,7 @@ map_contact_geocoding_failed_cb (EContactMap *map,
static void
contact_map_window_find_contact_cb (GtkButton *button,
- gpointer user_data)
+ gpointer user_data)
{
EContactMapWindowPrivate *priv = E_CONTACT_MAP_WINDOW (user_data)->priv;
ClutterActor *marker;
@@ -235,8 +243,8 @@ contact_map_window_find_contact_cb (GtkButton *button,
static gboolean
contact_map_window_entry_key_pressed_cb (GtkWidget *entry,
- GdkEventKey *event,
- gpointer user_data)
+ GdkEventKey *event,
+ gpointer user_data)
{
if (event->keyval == GDK_KEY_Return)
contact_map_window_find_contact_cb (NULL, user_data);
@@ -246,9 +254,9 @@ contact_map_window_entry_key_pressed_cb (GtkWidget *entry,
static gboolean
entry_completion_match_selected_cb (GtkEntryCompletion *widget,
- GtkTreeModel* model,
- GtkTreeIter *iter,
- gpointer user_data)
+ GtkTreeModel* model,
+ GtkTreeIter *iter,
+ gpointer user_data)
{
GValue name_val = {0};
EContactMapWindowPrivate *priv = E_CONTACT_MAP_WINDOW (user_data)->priv;
@@ -393,7 +401,8 @@ e_contact_map_window_init (EContactMapWindow *window)
/* Entry completion */
entry_completion = gtk_entry_completion_new ();
- gtk_entry_completion_set_model (entry_completion, GTK_TREE_MODEL (completion_model));
+ gtk_entry_completion_set_model (
+ entry_completion, GTK_TREE_MODEL (completion_model));
gtk_entry_completion_set_text_column (entry_completion, 0);
g_signal_connect (entry_completion, "match-selected",
G_CALLBACK (entry_completion_match_selected_cb), window);
@@ -438,7 +447,7 @@ e_contact_map_window_new (void)
*/
void
e_contact_map_window_load_addressbook (EContactMapWindow *map,
- EBookClient *book_client)
+ EBookClient *book_client)
{
EBookQuery *book_query;
gchar *query_string;
@@ -446,7 +455,6 @@ e_contact_map_window_load_addressbook (EContactMapWindow *map,
g_return_if_fail (E_IS_CONTACT_MAP_WINDOW (map));
g_return_if_fail (E_IS_BOOK_CLIENT (book_client));
-
/* Reference book, so that it does not get deleted before the callback is
involved. The book is unrefed in the callback */
g_object_ref (book_client);
@@ -455,7 +463,9 @@ e_contact_map_window_load_addressbook (EContactMapWindow *map,
query_string = e_book_query_to_string (book_query);
e_book_query_unref (book_query);
- e_book_client_get_contacts (book_client, query_string, NULL, book_contacts_received_cb, map);
+ e_book_client_get_contacts (
+ book_client, query_string, NULL,
+ book_contacts_received_cb, map);
g_free (query_string);
}
diff --git a/widgets/misc/e-contact-marker.c b/widgets/misc/e-contact-marker.c
index 3a871eaf6f..b5781c8c3b 100644
--- a/widgets/misc/e-contact-marker.c
+++ b/widgets/misc/e-contact-marker.c
@@ -123,7 +123,9 @@ contact_photo_to_texture (EContactPhoto *photo)
GError *error = NULL;
GdkPixbufLoader *loader = gdk_pixbuf_loader_new ();
- gdk_pixbuf_loader_write (loader, photo->data.inlined.data, photo->data.inlined.length, NULL);
+ gdk_pixbuf_loader_write (
+ loader, photo->data.inlined.data,
+ photo->data.inlined.length, NULL);
gdk_pixbuf_loader_close (loader, NULL);
pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
if (pixbuf)
@@ -295,7 +297,9 @@ draw_marker (EContactMarker *marker)
if (priv->image) {
clutter_actor_set_position (priv->image, 2*PADDING, 2*PADDING);
if (clutter_actor_get_parent (priv->image) == NULL)
- clutter_container_add_actor (CLUTTER_CONTAINER (priv->content_group), priv->image);
+ clutter_container_add_actor (
+ CLUTTER_CONTAINER (priv->content_group),
+ priv->image);
}
if (priv->text_actor == NULL) {
@@ -342,7 +346,9 @@ draw_marker (EContactMarker *marker)
champlain_marker_get_selection_text_color () :
champlain_label_get_text_color (CHAMPLAIN_LABEL (marker))));
if (clutter_actor_get_parent (priv->text_actor) == NULL)
- clutter_container_add_actor (CLUTTER_CONTAINER (priv->content_group), priv->text_actor);
+ clutter_container_add_actor (
+ CLUTTER_CONTAINER (priv->content_group),
+ priv->text_actor);
if (priv->text_actor == NULL && priv->image == NULL) {
total_width = 6 * PADDING;
@@ -552,7 +558,8 @@ e_contact_marker_init (EContactMarker *marker)
priv->content_group = CLUTTER_GROUP (clutter_group_new ());
priv->redraw_id = 0;
- clutter_actor_set_parent (CLUTTER_ACTOR (priv->content_group), CLUTTER_ACTOR (marker));
+ clutter_actor_set_parent (
+ CLUTTER_ACTOR (priv->content_group), CLUTTER_ACTOR (marker));
clutter_actor_queue_relayout (CLUTTER_ACTOR (marker));
priv->total_width = 0;
diff --git a/widgets/misc/e-web-view.c b/widgets/misc/e-web-view.c
index f0eb3a64ba..18529b603e 100644
--- a/widgets/misc/e-web-view.c
+++ b/widgets/misc/e-web-view.c
@@ -75,6 +75,8 @@ enum {
PROP_ANIMATE,
PROP_CARET_MODE,
PROP_COPY_TARGET_LIST,
+ PROP_CURSOR_IMAGE,
+ PROP_CURSOR_IMAGE_SRC,
PROP_DISABLE_PRINTING,
PROP_DISABLE_SAVE_TO_DISK,
PROP_EDITABLE,
@@ -85,9 +87,7 @@ enum {
PROP_PASTE_TARGET_LIST,
PROP_PRINT_PROXY,
PROP_SAVE_AS_PROXY,
- PROP_SELECTED_URI,
- PROP_CURSOR_IMAGE,
- PROP_CURSOR_IMAGE_SRC
+ PROP_SELECTED_URI
};
enum {
@@ -490,7 +490,8 @@ web_view_button_press_event_cb (EWebView *web_view,
if (anim != NULL)
g_object_unref (anim);
- image_src = gtk_html_get_image_src_at (frame, event->x, event->y);
+ image_src = gtk_html_get_image_src_at (
+ frame, event->x, event->y);
e_web_view_set_cursor_image_src (web_view, image_src);
g_free (image_src);
}
@@ -578,6 +579,18 @@ web_view_set_property (GObject *object,
g_value_get_boolean (value));
return;
+ case PROP_CURSOR_IMAGE:
+ e_web_view_set_cursor_image (
+ E_WEB_VIEW (object),
+ g_value_get_object (value));
+ return;
+
+ case PROP_CURSOR_IMAGE_SRC:
+ e_web_view_set_cursor_image_src (
+ E_WEB_VIEW (object),
+ g_value_get_string (value));
+ return;
+
case PROP_DISABLE_PRINTING:
e_web_view_set_disable_printing (
E_WEB_VIEW (object),
@@ -637,16 +650,6 @@ web_view_set_property (GObject *object,
E_WEB_VIEW (object),
g_value_get_string (value));
return;
- case PROP_CURSOR_IMAGE:
- e_web_view_set_cursor_image (
- E_WEB_VIEW (object),
- g_value_get_object (value));
- return;
- case PROP_CURSOR_IMAGE_SRC:
- e_web_view_set_cursor_image_src (
- E_WEB_VIEW (object),
- g_value_get_string (value));
- return;
}
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -677,6 +680,18 @@ web_view_get_property (GObject *object,
E_WEB_VIEW (object)));
return;
+ case PROP_CURSOR_IMAGE:
+ g_value_set_object (
+ value, e_web_view_get_cursor_image (
+ E_WEB_VIEW (object)));
+ return;
+
+ case PROP_CURSOR_IMAGE_SRC:
+ g_value_set_string (
+ value, e_web_view_get_cursor_image_src (
+ E_WEB_VIEW (object)));
+ return;
+
case PROP_DISABLE_PRINTING:
g_value_set_boolean (
value, e_web_view_get_disable_printing (
@@ -742,17 +757,6 @@ web_view_get_property (GObject *object,
value, e_web_view_get_selected_uri (
E_WEB_VIEW (object)));
return;
-
- case PROP_CURSOR_IMAGE:
- g_value_set_object (
- value, e_web_view_get_cursor_image (
- E_WEB_VIEW (object)));
- return;
- case PROP_CURSOR_IMAGE_SRC:
- g_value_set_string (
- value, e_web_view_get_cursor_image_src (
- E_WEB_VIEW (object)));
- return;
}
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -1406,6 +1410,26 @@ e_web_view_class_init (EWebViewClass *class)
g_object_class_install_property (
object_class,
+ PROP_CURSOR_IMAGE,
+ g_param_spec_object (
+ "cursor-image",
+ "Image animation at the mouse cursor",
+ NULL,
+ GDK_TYPE_PIXBUF_ANIMATION,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_CURSOR_IMAGE_SRC,
+ g_param_spec_string (
+ "cursor-image-src",
+ "Image source uri at the mouse cursor",
+ NULL,
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
PROP_DISABLE_PRINTING,
g_param_spec_boolean (
"disable-printing",
@@ -1512,26 +1536,6 @@ e_web_view_class_init (EWebViewClass *class)
NULL,
G_PARAM_READWRITE));
- g_object_class_install_property (
- object_class,
- PROP_CURSOR_IMAGE,
- g_param_spec_object (
- "cursor-image",
- "Image animation at the mouse cursor",
- NULL,
- GDK_TYPE_PIXBUF_ANIMATION,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (
- object_class,
- PROP_CURSOR_IMAGE_SRC,
- g_param_spec_string (
- "cursor-image-src",
- "Image source uri at the mouse cursor",
- NULL,
- NULL,
- G_PARAM_READWRITE));
-
signals[COPY_CLIPBOARD] = g_signal_new (
"copy-clipboard",
G_TYPE_FROM_CLASS (class),