[Xfce4-commits] [panel-plugins/xfce4-eyes-plugin] 16/16: Fix indentation
noreply at xfce.org
noreply at xfce.org
Sun Jun 5 17:47:46 CEST 2016
This is an automated email from the git hooks/post-receive script.
andre pushed a commit to branch master
in repository panel-plugins/xfce4-eyes-plugin.
commit 55d6d233920860db372809360ac8f7bdf9b15120
Author: Andre Miranda <andre42m at gmail.com>
Date: Thu May 26 20:17:59 2016 -0300
Fix indentation
---
icons/Makefile.am | 14 +-
panel-plugin/eyes.c | 410 ++++++++++++++++++++--------------------
panel-plugin/eyes.h | 58 +++---
panel-plugin/themes.c | 31 +--
panel-plugin/themes.h | 3 +-
themes/Default-tiny/Makefile.am | 4 +-
themes/Makefile.am | 2 +-
themes/Tango/Makefile.am | 3 +-
8 files changed, 265 insertions(+), 260 deletions(-)
diff --git a/icons/Makefile.am b/icons/Makefile.am
index 571cfe4..1b26047 100644
--- a/icons/Makefile.am
+++ b/icons/Makefile.am
@@ -9,14 +9,14 @@ SUBDIRS = \
gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
install-data-hook:
- @-if test -z "$(DESTDIR)"; then \
- echo "Updating Gtk icon cache."; \
- $(gtk_update_icon_cache); \
- else \
+ @-if test -z "$(DESTDIR)"; then \
+ echo "Updating Gtk icon cache."; \
+ $(gtk_update_icon_cache); \
+ else \
echo "*** Icon cache not updated. Remember to run:"; \
- echo "***"; \
- echo "*** $(gtk_update_icon_cache)"; \
- echo "***"; \
+ echo "***"; \
+ echo "*** $(gtk_update_icon_cache)"; \
+ echo "***"; \
fi
# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
diff --git a/panel-plugin/eyes.c b/panel-plugin/eyes.c
index 7d2a6cd..7cbb2b6 100644
--- a/panel-plugin/eyes.c
+++ b/panel-plugin/eyes.c
@@ -63,72 +63,76 @@ static gboolean eyes_set_size (XfcePanelPlugin *plugin,
*****************************/
static void
calculate_pupil_xy (EyesPlugin *eyes_applet,
- gint x,
- gint y,
- gint *pupil_x,
- gint *pupil_y,
- GtkWidget *widget)
+ gint x,
+ gint y,
+ gint *pupil_x,
+ gint *pupil_y,
+ GtkWidget *widget)
{
- double nx, ny;
- double distance;
- double angle, angle_z;
- double radius_x, radius_y;
+ double nx, ny;
+ double distance;
+ double angle, angle_z;
+ double radius_x, radius_y;
- GtkAllocation allocation;
- GtkAlign halign, valign;
- gfloat xalign = 0, yalign = 0;
- gint width, height;
+ GtkAllocation allocation;
+ GtkAlign halign, valign;
+ gfloat xalign = 0, yalign = 0;
+ gint width, height;
- gtk_widget_get_allocation (GTK_WIDGET(widget), &allocation);
+ gtk_widget_get_allocation (GTK_WIDGET (widget), &allocation);
- width = allocation.width;
- height = allocation.height;
- halign = gtk_widget_get_halign (GTK_WIDGET(widget));
- valign = gtk_widget_get_valign (GTK_WIDGET(widget));
+ width = allocation.width;
+ height = allocation.height;
+ halign = gtk_widget_get_halign (GTK_WIDGET (widget));
+ valign = gtk_widget_get_valign (GTK_WIDGET (widget));
- if (halign == GTK_ALIGN_CENTER) xalign = 0.5;
- else if (halign == GTK_ALIGN_END) xalign = 1;
+ if (halign == GTK_ALIGN_CENTER)
+ xalign = 0.5;
+ else if (halign == GTK_ALIGN_END)
+ xalign = 1;
- if (valign == GTK_ALIGN_CENTER) yalign = 0.5;
- else if (valign == GTK_ALIGN_END) yalign = 1;
+ if (valign == GTK_ALIGN_CENTER)
+ yalign = 0.5;
+ else if (valign == GTK_ALIGN_END)
+ yalign = 1;
/* calculate x,y pointer offsets wrt to eye center */
- nx = x - MAX(width - eyes_applet->eye_width, 0) * xalign
- - eyes_applet->eye_width / 2 - allocation.x;
- ny = y - MAX(height - eyes_applet->eye_height, 0) * yalign
- - eyes_applet->eye_height / 2 - allocation.y;
-
- /* calculate eye sizes */
- radius_x = (eyes_applet->eye_width -
- eyes_applet->wall_thickness -
- eyes_applet->pupil_width) / 2.0;
- radius_y = (eyes_applet->eye_height -
- eyes_applet->wall_thickness -
- eyes_applet->pupil_height) / 2.0;
-
- /* by default assume the z-axis distance of 3 radius_x */
- distance = 3 * radius_x;
-
- /* correction factor for aspect ratio of the eye */
- if (radius_y != 0)
- ny *= radius_x / radius_y;
-
- /* calculate 3D rotation angles */
- angle_z = atan2 (ny, nx);
- angle = atan2 (hypot (nx, ny), distance);
-
- /* perform 3D rotation of a vector [0,0,1] (z=1) */
- *pupil_x = radius_x * sin (angle) * cos (angle_z) + eyes_applet->eye_width / 2;
- *pupil_y = radius_y * sin (angle) * sin (angle_z) + eyes_applet->eye_height / 2;
+ nx = x - MAX (width - eyes_applet->eye_width, 0) * xalign
+ - eyes_applet->eye_width / 2 - allocation.x;
+ ny = y - MAX (height - eyes_applet->eye_height, 0) * yalign
+ - eyes_applet->eye_height / 2 - allocation.y;
+
+ /* calculate eye sizes */
+ radius_x = (eyes_applet->eye_width -
+ eyes_applet->wall_thickness -
+ eyes_applet->pupil_width) / 2.0;
+ radius_y = (eyes_applet->eye_height -
+ eyes_applet->wall_thickness -
+ eyes_applet->pupil_height) / 2.0;
+
+ /* by default assume the z-axis distance of 3 radius_x */
+ distance = 3 * radius_x;
+
+ /* correction factor for aspect ratio of the eye */
+ if (radius_y != 0)
+ ny *= radius_x / radius_y;
+
+ /* calculate 3D rotation angles */
+ angle_z = atan2 (ny, nx);
+ angle = atan2 (hypot (nx, ny), distance);
+
+ /* perform 3D rotation of a vector [0,0,1] (z=1) */
+ *pupil_x = radius_x * sin (angle) * cos (angle_z) + eyes_applet->eye_width / 2;
+ *pupil_y = radius_y * sin (angle) * sin (angle_z) + eyes_applet->eye_height / 2;
}
static void
draw_eye (EyesPlugin *eyes,
- gint eye_num,
- gint pupil_x,
- gint pupil_y)
+ gint eye_num,
+ gint pupil_x,
+ gint pupil_y)
{
GdkPixbuf *pixbuf;
GdkRectangle rect, r1, r2;
@@ -144,23 +148,21 @@ draw_eye (EyesPlugin *eyes,
r2.height = eyes->eye_height;
gdk_rectangle_intersect (&r1, &r2, &rect);
gdk_pixbuf_composite (eyes->pupil_image, pixbuf,
- rect.x,
- rect.y,
- rect.width,
- rect.height,
- pupil_x - eyes->pupil_width / 2,
- pupil_y - eyes->pupil_height / 2, 1.0, 1.0,
- GDK_INTERP_BILINEAR,
- 255);
- gtk_image_set_from_pixbuf (GTK_IMAGE (eyes->eyes[eye_num]),
- pixbuf);
+ rect.x,
+ rect.y,
+ rect.width,
+ rect.height,
+ pupil_x - eyes->pupil_width / 2,
+ pupil_y - eyes->pupil_height / 2,
+ 1.0, 1.0, GDK_INTERP_BILINEAR, 255);
+ gtk_image_set_from_pixbuf (GTK_IMAGE (eyes->eyes[eye_num]), pixbuf);
g_object_unref (G_OBJECT (pixbuf));
}
static gint
-timer_cb(EyesPlugin *eyes)
+timer_cb (EyesPlugin *eyes)
{
gint x, y;
gint pupil_x, pupil_y;
@@ -168,11 +170,11 @@ timer_cb(EyesPlugin *eyes)
GdkWindow *window;
GdkDevice *mouse_device;
-#if GTK_CHECK_VERSION(3,2,0)
- GdkSeat *seat = gdk_display_get_default_seat (gdk_display_get_default());
+#if GTK_CHECK_VERSION (3,2,0)
+ GdkSeat *seat = gdk_display_get_default_seat (gdk_display_get_default ());
mouse_device = gdk_seat_get_pointer (seat);
#else
- GdkDeviceManager *devman = gdk_display_get_device_manager (gdk_display_get_default());
+ GdkDeviceManager *devman = gdk_display_get_device_manager (gdk_display_get_default ());
mouse_device = gdk_device_manager_get_client_pointer (devman);
#endif
@@ -206,91 +208,91 @@ timer_cb(EyesPlugin *eyes)
static void
-properties_load(EyesPlugin *eyes)
+properties_load (EyesPlugin *eyes)
{
gchar *path;
if (eyes->active_theme)
- path = g_build_filename(THEMESDIR, eyes->active_theme, NULL);
+ path = g_build_filename (THEMESDIR, eyes->active_theme, NULL);
else
- path = g_build_filename(THEMESDIR, DEFAULTTHEME, NULL);
+ path = g_build_filename (THEMESDIR, DEFAULTTHEME, NULL);
- load_theme(eyes, path);
+ load_theme (eyes, path);
- g_free(path);
+ g_free (path);
}
static void
-setup_eyes(EyesPlugin *eyes)
+setup_eyes (EyesPlugin *eyes)
{
int i;
if (eyes->hbox != NULL)
{
- gtk_widget_destroy(eyes->hbox);
+ gtk_widget_destroy (eyes->hbox);
eyes->hbox = NULL;
}
- eyes->hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
- gtk_container_add(GTK_CONTAINER(eyes->align), GTK_WIDGET(eyes->hbox));
+ eyes->hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+ gtk_container_add (GTK_CONTAINER (eyes->align), GTK_WIDGET (eyes->hbox));
eyes->eyes = g_new0 (GtkWidget *, eyes->num_eyes);
- eyes->pointer_last_x = g_new0 (gint, eyes->num_eyes);
- eyes->pointer_last_y = g_new0 (gint, eyes->num_eyes);
+ eyes->pointer_last_x = g_new0 (gint, eyes->num_eyes);
+ eyes->pointer_last_y = g_new0 (gint, eyes->num_eyes);
for (i = 0; i < eyes->num_eyes; i++)
{
eyes->eyes[i] = gtk_image_new ();
- gtk_widget_set_size_request(GTK_WIDGET(eyes->eyes[i]),
- eyes->eye_width,
- eyes->eye_height);
-
- gtk_widget_show(eyes->eyes[i]);
-
- gtk_box_pack_start(GTK_BOX(eyes->hbox), eyes->eyes[i],
- FALSE, FALSE, 0);
-
- if ((eyes->num_eyes != 1) && (i == 0))
- {
- gtk_widget_set_halign (GTK_WIDGET (eyes->eyes[i]), GTK_ALIGN_END);
- gtk_widget_set_valign (GTK_WIDGET (eyes->eyes[i]), GTK_ALIGN_CENTER);
- }
- else if ((eyes->num_eyes != 1) && (i == eyes->num_eyes - 1))
- {
- gtk_widget_set_halign (GTK_WIDGET (eyes->eyes[i]), GTK_ALIGN_START);
- gtk_widget_set_valign (GTK_WIDGET (eyes->eyes[i]), GTK_ALIGN_CENTER);
- }
- else
- {
- gtk_widget_set_halign (GTK_WIDGET (eyes->eyes[i]), GTK_ALIGN_CENTER);
- gtk_widget_set_valign (GTK_WIDGET (eyes->eyes[i]), GTK_ALIGN_CENTER);
- }
-
- eyes->pointer_last_x[i] = G_MAXINT;
- eyes->pointer_last_y[i] = G_MAXINT;
-
- draw_eye (eyes, i,
- eyes->eye_width / 2,
+ gtk_widget_set_size_request (GTK_WIDGET (eyes->eyes[i]),
+ eyes->eye_width,
+ eyes->eye_height);
+
+ gtk_widget_show (eyes->eyes[i]);
+
+ gtk_box_pack_start (GTK_BOX (eyes->hbox), eyes->eyes[i],
+ FALSE, FALSE, 0);
+
+ if ((eyes->num_eyes != 1) && (i == 0))
+ {
+ gtk_widget_set_halign (GTK_WIDGET (eyes->eyes[i]), GTK_ALIGN_END);
+ gtk_widget_set_valign (GTK_WIDGET (eyes->eyes[i]), GTK_ALIGN_CENTER);
+ }
+ else if ((eyes->num_eyes != 1) && (i == eyes->num_eyes - 1))
+ {
+ gtk_widget_set_halign (GTK_WIDGET (eyes->eyes[i]), GTK_ALIGN_START);
+ gtk_widget_set_valign (GTK_WIDGET (eyes->eyes[i]), GTK_ALIGN_CENTER);
+ }
+ else
+ {
+ gtk_widget_set_halign (GTK_WIDGET (eyes->eyes[i]), GTK_ALIGN_CENTER);
+ gtk_widget_set_valign (GTK_WIDGET (eyes->eyes[i]), GTK_ALIGN_CENTER);
+ }
+
+ eyes->pointer_last_x[i] = G_MAXINT;
+ eyes->pointer_last_y[i] = G_MAXINT;
+
+ draw_eye (eyes, i,
+ eyes->eye_width / 2,
eyes->eye_height / 2);
}
- gtk_widget_show(eyes->hbox);
+ gtk_widget_show (eyes->hbox);
}
static gboolean
-eyes_applet_fill(EyesPlugin *eyes)
+eyes_applet_fill (EyesPlugin *eyes)
{
- gtk_widget_show_all(GTK_WIDGET(eyes->align));
+ gtk_widget_show_all (GTK_WIDGET (eyes->align));
if (eyes->timeout_id == 0)
{
eyes->timeout_id = g_timeout_add (UPDATE_TIMEOUT,
- (GSourceFunc)timer_cb, eyes);
+ (GSourceFunc) timer_cb, eyes);
}
return TRUE;
@@ -319,20 +321,21 @@ static void
combobox_changed (GtkComboBox *combobox,
EyesPlugin *eyes)
{
- gchar *selected = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (combobox));
+ gchar *selected = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (combobox));
- if (eyes->active_theme)
- g_free (eyes->active_theme);
+ if (eyes->active_theme)
+ g_free (eyes->active_theme);
- eyes->active_theme = g_strdup (selected);
- g_free (selected);
+ eyes->active_theme = g_strdup (selected);
+ g_free (selected);
- properties_load(eyes);
- setup_eyes(eyes);
- eyes_applet_fill(eyes);
+ properties_load (eyes);
+ setup_eyes (eyes);
+ eyes_applet_fill (eyes);
- eyes_set_size(eyes->plugin, xfce_panel_plugin_get_size(eyes->plugin),
- eyes);
+ eyes_set_size (eyes->plugin,
+ xfce_panel_plugin_get_size (eyes->plugin),
+ eyes);
}
@@ -341,9 +344,10 @@ static void
check_single_row_toggled (GtkWidget *check,
EyesPlugin *eyes)
{
- eyes->single_row = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check));
- eyes_set_size(eyes->plugin, xfce_panel_plugin_get_size(eyes->plugin),
- eyes);
+ eyes->single_row = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check));
+ eyes_set_size (eyes->plugin,
+ xfce_panel_plugin_get_size (eyes->plugin),
+ eyes);
}
@@ -352,71 +356,71 @@ static void
eyes_properties_dialog (XfcePanelPlugin *plugin,
EyesPlugin *eyes)
{
- GtkWidget *dlg, *hbox, *label, *combobox, *check, *area;
- GDir *dir;
- gint i;
- gchar *current;
- const gchar *entry;
+ GtkWidget *dlg, *hbox, *label, *combobox, *check, *area;
+ GDir *dir;
+ gint i;
+ gchar *current;
+ const gchar *entry;
- xfce_panel_plugin_block_menu (plugin);
+ xfce_panel_plugin_block_menu (plugin);
- dlg = xfce_titled_dialog_new_with_buttons (_("Eyes"),
- GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (plugin))),
- GTK_DIALOG_DESTROY_WITH_PARENT,
- "gtk-close", GTK_RESPONSE_OK,
- NULL);
+ dlg = xfce_titled_dialog_new_with_buttons (_("Eyes"),
+ GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (plugin))),
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ "gtk-close", GTK_RESPONSE_OK,
+ NULL);
- gtk_window_set_position (GTK_WINDOW (dlg), GTK_WIN_POS_CENTER);
- gtk_window_set_icon_name (GTK_WINDOW (dlg), "xfce4-settings");
+ gtk_window_set_position (GTK_WINDOW (dlg), GTK_WIN_POS_CENTER);
+ gtk_window_set_icon_name (GTK_WINDOW (dlg), "xfce4-settings");
- g_signal_connect (dlg, "response", G_CALLBACK (eyes_properties_dialog_response),
+ g_signal_connect (dlg, "response",
+ G_CALLBACK (eyes_properties_dialog_response),
eyes);
- area = gtk_dialog_get_content_area (GTK_DIALOG (dlg));
- hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
- gtk_box_pack_start (GTK_BOX (area), hbox, FALSE, FALSE, 0);
- gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
+ area = gtk_dialog_get_content_area (GTK_DIALOG (dlg));
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
+ gtk_box_pack_start (GTK_BOX (area), hbox, FALSE, FALSE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
- label = gtk_label_new_with_mnemonic (_("_Select a theme:"));
- gtk_box_pack_start (GTK_BOX(hbox), label, FALSE, FALSE, 0);
+ label = gtk_label_new_with_mnemonic (_("_Select a theme:"));
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
- combobox = gtk_combo_box_text_new ();
+ combobox = gtk_combo_box_text_new ();
gtk_box_pack_start (GTK_BOX (hbox), combobox, FALSE, TRUE, 0);
if (eyes->active_theme)
- current = g_strdup (eyes->active_theme);
- else
- current = g_strdup (DEFAULTTHEME);
+ current = g_strdup (eyes->active_theme);
+ else
+ current = g_strdup (DEFAULTTHEME);
- if ((dir = g_dir_open(THEMESDIR, 0, NULL)) == NULL)
+ if ((dir = g_dir_open (THEMESDIR, 0, NULL)) == NULL)
{
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combobox), current);
}
else
{
- for (i = 0; (entry = g_dir_read_name(dir)) != NULL; i++)
+ for (i = 0; (entry = g_dir_read_name (dir)) != NULL; i++)
{
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combobox), entry);
if (strcmp (entry, current) == 0)
- gtk_combo_box_set_active (GTK_COMBO_BOX(combobox), i);
- }
+ gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), i);
+ }
- g_dir_close(dir);
- }
+ g_dir_close (dir);
+ }
- g_free (current);
+ g_free (current);
- gtk_label_set_mnemonic_widget (GTK_LABEL (label), combobox);
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label), combobox);
- g_signal_connect(G_OBJECT(combobox), "changed",
- G_CALLBACK(combobox_changed), eyes);
+ g_signal_connect (G_OBJECT (combobox), "changed",
+ G_CALLBACK (combobox_changed), eyes);
- check = gtk_check_button_new_with_mnemonic
- (_("Use single _row in multi-row panel"));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), eyes->single_row);
- gtk_box_pack_start (GTK_BOX (area), check, FALSE, FALSE, 0);
- g_signal_connect(check, "toggled", G_CALLBACK(check_single_row_toggled), eyes);
+ check = gtk_check_button_new_with_mnemonic (_("Use single _row in multi-row panel"));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), eyes->single_row);
+ gtk_box_pack_start (GTK_BOX (area), check, FALSE, FALSE, 0);
+ g_signal_connect (check, "toggled", G_CALLBACK (check_single_row_toggled), eyes);
gtk_widget_show_all (dlg);
}
@@ -427,21 +431,21 @@ eyes_properties_dialog (XfcePanelPlugin *plugin,
*** Panel Plugin Functions ***
******************************/
static void
-eyes_free_data(XfcePanelPlugin *plugin,
- EyesPlugin *eyes)
+eyes_free_data (XfcePanelPlugin *plugin,
+ EyesPlugin *eyes)
{
- g_return_if_fail(plugin != NULL);
- g_return_if_fail(eyes != NULL);
+ g_return_if_fail (plugin != NULL);
+ g_return_if_fail (eyes != NULL);
if (eyes->timeout_id != 0)
g_source_remove (eyes->timeout_id);
g_free (eyes->eyes);
- g_free (eyes->pointer_last_x);
- g_free (eyes->pointer_last_y);
+ g_free (eyes->pointer_last_x);
+ g_free (eyes->pointer_last_y);
- if (eyes->active_theme != NULL)
- g_free (eyes->active_theme);
+ if (eyes->active_theme != NULL)
+ g_free (eyes->active_theme);
if (eyes->eye_image != NULL)
g_object_unref (G_OBJECT (eyes->eye_image));
@@ -450,19 +454,19 @@ eyes_free_data(XfcePanelPlugin *plugin,
g_object_unref (G_OBJECT (eyes->pupil_image));
if (eyes->theme_dir != NULL)
- g_free(eyes->theme_dir);
+ g_free (eyes->theme_dir);
if (eyes->theme_name != NULL)
- g_free(eyes->theme_name);
+ g_free (eyes->theme_name);
if (eyes->eye_filename != NULL)
- g_free(eyes->eye_filename);
+ g_free (eyes->eye_filename);
if (eyes->pupil_filename != NULL)
- g_free(eyes->pupil_filename);
+ g_free (eyes->pupil_filename);
- gtk_widget_destroy(eyes->align);
- g_free(eyes);
+ gtk_widget_destroy (eyes->align);
+ g_free (eyes);
}
@@ -487,17 +491,17 @@ eyes_mode_changed (XfcePanelPlugin *plugin,
if (mode == XFCE_PANEL_PLUGIN_MODE_VERTICAL ||
mode == XFCE_PANEL_PLUGIN_MODE_DESKBAR)
{
- gtk_widget_set_halign(GTK_WIDGET(eyes->align), GTK_ALIGN_CENTER);
- gtk_widget_set_valign(GTK_WIDGET(eyes->align), GTK_ALIGN_CENTER);
- gtk_widget_set_hexpand(GTK_WIDGET(eyes->align), FALSE);
- gtk_widget_set_vexpand(GTK_WIDGET(eyes->align), TRUE);
+ gtk_widget_set_halign (GTK_WIDGET (eyes->align), GTK_ALIGN_CENTER);
+ gtk_widget_set_valign (GTK_WIDGET (eyes->align), GTK_ALIGN_CENTER);
+ gtk_widget_set_hexpand (GTK_WIDGET (eyes->align), FALSE);
+ gtk_widget_set_vexpand (GTK_WIDGET (eyes->align), TRUE);
}
else
{
- gtk_widget_set_halign(GTK_WIDGET(eyes->align), GTK_ALIGN_CENTER);
- gtk_widget_set_valign(GTK_WIDGET(eyes->align), GTK_ALIGN_CENTER);
- gtk_widget_set_hexpand(GTK_WIDGET(eyes->align), TRUE);
- gtk_widget_set_vexpand(GTK_WIDGET(eyes->align), FALSE);
+ gtk_widget_set_halign (GTK_WIDGET (eyes->align), GTK_ALIGN_CENTER);
+ gtk_widget_set_valign (GTK_WIDGET (eyes->align), GTK_ALIGN_CENTER);
+ gtk_widget_set_hexpand (GTK_WIDGET (eyes->align), TRUE);
+ gtk_widget_set_vexpand (GTK_WIDGET (eyes->align), FALSE);
}
eyes_set_size (plugin, xfce_panel_plugin_get_size (plugin), eyes);
@@ -541,7 +545,7 @@ eyes_read_rc_file (XfcePanelPlugin *plugin,
}
if (eyes->active_theme == NULL)
- eyes->active_theme = g_strdup (DEFAULTTHEME);
+ eyes->active_theme = g_strdup (DEFAULTTHEME);
}
@@ -575,28 +579,28 @@ eyes_write_rc_file (XfcePanelPlugin *plugin,
static EyesPlugin *
eyes_plugin_new (XfcePanelPlugin* plugin)
{
- EyesPlugin *eyes = g_new0(EyesPlugin, 1);
+ EyesPlugin *eyes = g_new0 (EyesPlugin, 1);
eyes->plugin = plugin;
eyes->ebox = gtk_event_box_new ();
gtk_event_box_set_visible_window (GTK_EVENT_BOX (eyes->ebox), FALSE);
- gtk_widget_show(eyes->ebox);
+ gtk_widget_show (eyes->ebox);
eyes->align = gtk_box_new (GTK_ORIENTATION_VERTICAL, 1);
- gtk_widget_set_halign(GTK_WIDGET(eyes->align), GTK_ALIGN_CENTER);
- gtk_widget_set_valign(GTK_WIDGET(eyes->align), GTK_ALIGN_CENTER);
- gtk_widget_set_hexpand(GTK_WIDGET(eyes->align), TRUE);
- gtk_widget_set_vexpand(GTK_WIDGET(eyes->align), TRUE);
+ gtk_widget_set_halign (GTK_WIDGET (eyes->align), GTK_ALIGN_CENTER);
+ gtk_widget_set_valign (GTK_WIDGET (eyes->align), GTK_ALIGN_CENTER);
+ gtk_widget_set_hexpand (GTK_WIDGET (eyes->align), TRUE);
+ gtk_widget_set_vexpand (GTK_WIDGET (eyes->align), TRUE);
- gtk_container_add(GTK_CONTAINER(eyes->ebox), eyes->align);
- gtk_widget_show(eyes->align);
+ gtk_container_add (GTK_CONTAINER (eyes->ebox), eyes->align);
+ gtk_widget_show (eyes->align);
eyes_read_rc_file (plugin, eyes);
- properties_load(eyes);
- setup_eyes(eyes);
- eyes_applet_fill(eyes);
+ properties_load (eyes);
+ setup_eyes (eyes);
+ eyes_applet_fill (eyes);
return eyes;
}
@@ -608,25 +612,25 @@ eyes_construct (XfcePanelPlugin *plugin)
{
EyesPlugin *eyes;
- xfce_textdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
+ xfce_textdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
eyes = eyes_plugin_new (plugin);
g_signal_connect (plugin, "mode-changed",
- G_CALLBACK (eyes_mode_changed), eyes);
+ G_CALLBACK (eyes_mode_changed), eyes);
g_signal_connect (plugin, "size-changed",
- G_CALLBACK (eyes_set_size), eyes);
+ G_CALLBACK (eyes_set_size), eyes);
g_signal_connect (plugin, "free-data",
- G_CALLBACK (eyes_free_data), eyes);
+ G_CALLBACK (eyes_free_data), eyes);
g_signal_connect (plugin, "save",
- G_CALLBACK (eyes_write_rc_file), eyes);
+ G_CALLBACK (eyes_write_rc_file), eyes);
xfce_panel_plugin_menu_show_configure (plugin);
g_signal_connect (plugin, "configure-plugin",
- G_CALLBACK (eyes_properties_dialog), eyes);
+ G_CALLBACK (eyes_properties_dialog), eyes);
gtk_container_add (GTK_CONTAINER (plugin), eyes->ebox);
diff --git a/panel-plugin/eyes.h b/panel-plugin/eyes.h
index 76e475b..1e674ba 100644
--- a/panel-plugin/eyes.h
+++ b/panel-plugin/eyes.h
@@ -24,35 +24,35 @@
typedef struct
{
- XfcePanelPlugin *plugin;
-
- GtkWidget *ebox;
-
- /* Properties */
- gchar *active_theme;
-
- /* Plugin */
- GtkWidget *align;
- GtkWidget *hbox;
- GtkWidget **eyes;
- gboolean single_row;
- guint timeout_id;
- gint *pointer_last_x;
- gint *pointer_last_y;
-
- /* Theme */
- GdkPixbuf *eye_image;
- GdkPixbuf *pupil_image;
- gchar *theme_dir;
- gchar *theme_name;
- gchar *eye_filename;
- gchar *pupil_filename;
- gint num_eyes;
- gint eye_height;
- gint eye_width;
- gint pupil_height;
- gint pupil_width;
- gint wall_thickness;
+ XfcePanelPlugin *plugin;
+
+ GtkWidget *ebox;
+
+ /* Properties */
+ gchar *active_theme;
+
+ /* Plugin */
+ GtkWidget *align;
+ GtkWidget *hbox;
+ GtkWidget **eyes;
+ gboolean single_row;
+ guint timeout_id;
+ gint *pointer_last_x;
+ gint *pointer_last_y;
+
+ /* Theme */
+ GdkPixbuf *eye_image;
+ GdkPixbuf *pupil_image;
+ gchar *theme_dir;
+ gchar *theme_name;
+ gchar *eye_filename;
+ gchar *pupil_filename;
+ gint num_eyes;
+ gint eye_height;
+ gint eye_width;
+ gint pupil_height;
+ gint pupil_width;
+ gint wall_thickness;
}
EyesPlugin;
diff --git a/panel-plugin/themes.c b/panel-plugin/themes.c
index 81b8bc7..a093369 100644
--- a/panel-plugin/themes.c
+++ b/panel-plugin/themes.c
@@ -35,11 +35,13 @@ gchar *theme_directories[] = {
#define NUM_THEME_DIRECTORIES 1
static void
-parse_theme_file (EyesPlugin *eyes, FILE *theme_file)
+parse_theme_file (EyesPlugin *eyes,
+ FILE *theme_file)
{
gchar line_buf [512]; /* prolly overkill */
gchar *token;
fgets (line_buf, 512, theme_file);
+
while (!feof (theme_file)) {
token = strtok (line_buf, "=");
if (strncmp (token, "wall-thickness",
@@ -68,20 +70,20 @@ parse_theme_file (EyesPlugin *eyes, FILE *theme_file)
if (eyes->eye_filename != NULL)
g_free (eyes->eye_filename);
eyes->eye_filename = g_strdup_printf ("%s%s",
- eyes->theme_dir,
- token);
+ eyes->theme_dir,
+ token);
}
else if (strncmp (token, "pupil-pixmap", strlen ("pupil-pixmap")) == 0)
{
token = strtok (NULL, "\"");
token = strtok (NULL, "\"");
- if (eyes->pupil_filename != NULL)
- g_free (eyes->pupil_filename);
- eyes->pupil_filename
- = g_strdup_printf ("%s%s",
- eyes->theme_dir,
- token);
+ if (eyes->pupil_filename != NULL)
+ g_free (eyes->pupil_filename);
+ eyes->pupil_filename = g_strdup_printf ("%s%s",
+ eyes->theme_dir,
+ token);
}
+
fgets (line_buf, 512, theme_file);
}
}
@@ -92,12 +94,12 @@ void
load_theme (EyesPlugin *eyes,
const gchar *theme_dir)
{
- FILE* theme_file;
+ FILE* theme_file;
gchar *file_name;
eyes->theme_dir = g_strdup_printf ("%s/", theme_dir);
- file_name = g_strdup_printf("%s%s",theme_dir,"/config");
+ file_name = g_strdup_printf ("%s%s",theme_dir,"/config");
theme_file = fopen (file_name, "r");
if (theme_file == NULL) {
g_error ("Unable to open theme file.");
@@ -109,20 +111,19 @@ load_theme (EyesPlugin *eyes,
eyes->theme_name = g_strdup (theme_dir);
if (eyes->eye_image)
- g_object_unref (eyes->eye_image);
+ g_object_unref (eyes->eye_image);
eyes->eye_image = gdk_pixbuf_new_from_file (eyes->eye_filename, NULL);
if (eyes->pupil_image)
- g_object_unref (eyes->pupil_image);
+ g_object_unref (eyes->pupil_image);
eyes->pupil_image = gdk_pixbuf_new_from_file (eyes->pupil_filename, NULL);
- eyes->eye_height = gdk_pixbuf_get_height (eyes->eye_image);
+ eyes->eye_height = gdk_pixbuf_get_height (eyes->eye_image);
eyes->eye_width = gdk_pixbuf_get_width (eyes->eye_image);
eyes->pupil_height = gdk_pixbuf_get_height (eyes->pupil_image);
eyes->pupil_width = gdk_pixbuf_get_width (eyes->pupil_image);
g_free (file_name);
-
}
diff --git a/panel-plugin/themes.h b/panel-plugin/themes.h
index affadb0..954d7c5 100644
--- a/panel-plugin/themes.h
+++ b/panel-plugin/themes.h
@@ -21,6 +21,7 @@
#include <gtk/gtk.h>
void
-load_theme (EyesPlugin *eyes, const gchar *theme_dir);
+load_theme (EyesPlugin *eyes,
+ const gchar *theme_dir);
#endif /* __THEMES_H__ */
diff --git a/themes/Default-tiny/Makefile.am b/themes/Default-tiny/Makefile.am
index ef9deb6..fe35efc 100644
--- a/themes/Default-tiny/Makefile.am
+++ b/themes/Default-tiny/Makefile.am
@@ -1,8 +1,8 @@
Default_tinydir = $(datadir)/xfce4/eyes/themes/Default-tiny
Default_tiny_DATA = \
- Default-tiny-eye.png \
- Default-tiny-pupil.png \
+ Default-tiny-eye.png \
+ Default-tiny-pupil.png \
config
EXTRA_DIST = $(Default_tiny_DATA)
diff --git a/themes/Makefile.am b/themes/Makefile.am
index a646814..23fc69c 100644
--- a/themes/Makefile.am
+++ b/themes/Makefile.am
@@ -2,7 +2,7 @@ SUBDIRS = \
Bizarre \
Bloodshot \
Default \
- Default-tiny \
+ Default-tiny \
Horrid \
Tango
diff --git a/themes/Tango/Makefile.am b/themes/Tango/Makefile.am
index 83c9dda..84a1739 100644
--- a/themes/Tango/Makefile.am
+++ b/themes/Tango/Makefile.am
@@ -5,7 +5,6 @@ Tango_DATA = \
tango-pupil.png \
config
-EXTRA_DIST = \
- $(Tango_DATA)
+EXTRA_DIST = $(Tango_DATA)
# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list