Commit 1204a850 authored by Matthias Clasen's avatar Matthias Clasen

Formatting cleanups

While we normally try to avoid whitespace fixes, the gtk-demo
code is shown as exemplary, so it should be in good shape,
formatting-wise.
parent c5cd4174
......@@ -25,8 +25,8 @@ activate_action (GtkAction *action)
GtkSettings *settings = gtk_settings_get_default ();
g_object_set (G_OBJECT (settings),
"gtk-application-prefer-dark-theme", value,
NULL);
"gtk-application-prefer-dark-theme", value,
NULL);
return;
}
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
......@@ -69,7 +69,7 @@ activate_radio_action (GtkAction *action, GtkRadioAction *current)
static void
about_cb (GtkAction *action,
GtkWidget *window)
GtkWidget *window)
{
GdkPixbuf *pixbuf, *transparent;
gchar *filename;
......@@ -102,21 +102,21 @@ about_cb (GtkAction *action,
}
gtk_show_about_dialog (GTK_WINDOW (window),
"program-name", "GTK+ Code Demos",
"version", g_strdup_printf ("%s,\nRunning against GTK+ %d.%d.%d",
PACKAGE_VERSION,
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ()),
"copyright", "(C) 1997-2009 The GTK+ Team",
"license-type", GTK_LICENSE_LGPL_2_1,
"website", "http://www.gtk.org",
"comments", "Program to demonstrate GTK+ functions.",
"authors", authors,
"documenters", documentors,
"logo", transparent,
"program-name", "GTK+ Code Demos",
"version", g_strdup_printf ("%s,\nRunning against GTK+ %d.%d.%d",
PACKAGE_VERSION,
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ()),
"copyright", "(C) 1997-2009 The GTK+ Team",
"license-type", GTK_LICENSE_LGPL_2_1,
"website", "http://www.gtk.org",
"comments", "Program to demonstrate GTK+ functions.",
"authors", authors,
"documenters", documentors,
"logo", transparent,
"title", "About GTK+ Code Demos",
NULL);
NULL);
g_object_unref (transparent);
}
......@@ -249,9 +249,9 @@ static const gchar *ui_info =
" <menu action='PreferencesMenu'>"
" <menuitem action='DarkTheme'/>"
" <menu action='ColorMenu'>"
" <menuitem action='Red'/>"
" <menuitem action='Green'/>"
" <menuitem action='Blue'/>"
" <menuitem action='Red'/>"
" <menuitem action='Green'/>"
" <menuitem action='Blue'/>"
" </menu>"
" <menu action='ShapeMenu'>"
" <menuitem action='Square'/>"
......@@ -317,10 +317,10 @@ register_stock_icons (void)
pixbuf = NULL;
filename = demo_find_file ("gtk-logo-rgb.gif", NULL);
if (filename)
{
pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
g_free (filename);
}
{
pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
g_free (filename);
}
/* Register icon to accompany stock item */
if (pixbuf != NULL)
......@@ -355,8 +355,8 @@ update_statusbar (GtkTextBuffer *buffer,
GtkTextIter iter;
gtk_statusbar_pop (statusbar, 0); /* clear any previous message,
* underflow is allowed
*/
* underflow is allowed
*/
count = gtk_text_buffer_get_char_count (buffer);
......@@ -407,7 +407,7 @@ do_appwindow (GtkWidget *do_widget)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Application Window");
gtk_window_set_icon_name (GTK_WINDOW (window), "document-open");
......@@ -425,42 +425,42 @@ do_appwindow (GtkWidget *do_widget)
action_group = gtk_action_group_new ("AppWindowActions");
open_action = g_object_new (tool_menu_action_get_type (),
"name", "Open",
"label", "_Open",
"tooltip", "Open a file",
"stock-id", GTK_STOCK_OPEN,
NULL);
"name", "Open",
"label", "_Open",
"tooltip", "Open a file",
"stock-id", GTK_STOCK_OPEN,
NULL);
gtk_action_group_add_action (action_group, open_action);
g_object_unref (open_action);
gtk_action_group_add_actions (action_group,
entries, n_entries,
window);
entries, n_entries,
window);
gtk_action_group_add_toggle_actions (action_group,
toggle_entries, n_toggle_entries,
NULL);
toggle_entries, n_toggle_entries,
NULL);
gtk_action_group_add_radio_actions (action_group,
color_entries, n_color_entries,
COLOR_RED,
G_CALLBACK (activate_radio_action),
NULL);
color_entries, n_color_entries,
COLOR_RED,
G_CALLBACK (activate_radio_action),
NULL);
gtk_action_group_add_radio_actions (action_group,
shape_entries, n_shape_entries,
SHAPE_SQUARE,
G_CALLBACK (activate_radio_action),
NULL);
shape_entries, n_shape_entries,
SHAPE_SQUARE,
G_CALLBACK (activate_radio_action),
NULL);
merge = gtk_ui_manager_new ();
g_object_set_data_full (G_OBJECT (window), "ui-manager", merge,
g_object_unref);
g_object_unref);
gtk_ui_manager_insert_action_group (merge, action_group, 0);
gtk_window_add_accel_group (GTK_WINDOW (window),
gtk_ui_manager_get_accel_group (merge));
gtk_ui_manager_get_accel_group (merge));
if (!gtk_ui_manager_add_ui_from_string (merge, ui_info, -1, &error))
{
g_message ("building menus failed: %s", error->message);
g_error_free (error);
}
{
g_message ("building menus failed: %s", error->message);
g_error_free (error);
}
bar = gtk_ui_manager_get_widget (merge, "/MenuBar");
gtk_widget_show (bar);
......@@ -552,4 +552,3 @@ do_appwindow (GtkWidget *do_widget)
return window;
}
......@@ -33,7 +33,7 @@ do_builder (GtkWidget *do_widget)
static GtkWidget *window = NULL;
GError *err = NULL;
gchar *filename;
if (!window)
{
builder = gtk_builder_new ();
......@@ -41,16 +41,16 @@ do_builder (GtkWidget *do_widget)
gtk_builder_add_from_file (builder, filename, &err);
g_free (filename);
if (err)
{
g_error ("ERROR: %s\n", err->message);
return NULL;
}
{
g_error ("ERROR: %s\n", err->message);
return NULL;
}
gtk_builder_connect_signals (builder, NULL);
window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_widget_get_screen (do_widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
G_CALLBACK (gtk_widget_destroyed), &window);
}
if (!gtk_widget_get_visible (window))
......@@ -58,7 +58,7 @@ do_builder (GtkWidget *do_widget)
gtk_widget_show_all (window);
}
else
{
{
gtk_widget_destroy (window);
window = NULL;
}
......
......@@ -7,14 +7,14 @@
static GtkWidget *
create_bbox (gint horizontal,
char *title,
gint spacing,
gint layout)
char *title,
gint spacing,
gint layout)
{
GtkWidget *frame;
GtkWidget *bbox;
GtkWidget *button;
frame = gtk_frame_new (title);
if (horizontal)
......@@ -27,13 +27,13 @@ create_bbox (gint horizontal,
gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), layout);
gtk_box_set_spacing (GTK_BOX (bbox), spacing);
button = gtk_button_new_from_stock (GTK_STOCK_OK);
gtk_container_add (GTK_CONTAINER (bbox), button);
button = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
gtk_container_add (GTK_CONTAINER (bbox), button);
button = gtk_button_new_from_stock (GTK_STOCK_HELP);
gtk_container_add (GTK_CONTAINER (bbox), button);
......@@ -49,68 +49,68 @@ do_button_box (GtkWidget *do_widget)
GtkWidget *hbox;
GtkWidget *frame_horz;
GtkWidget *frame_vert;
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Button Boxes");
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
&window);
G_CALLBACK (gtk_widget_destroyed),
&window);
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (window), main_vbox);
frame_horz = gtk_frame_new ("Horizontal Button Boxes");
gtk_box_pack_start (GTK_BOX (main_vbox), frame_horz, TRUE, TRUE, 10);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 10);
gtk_container_add (GTK_CONTAINER (frame_horz), vbox);
gtk_box_pack_start (GTK_BOX (vbox),
create_bbox (TRUE, "Spread", 40, GTK_BUTTONBOX_SPREAD),
TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox),
create_bbox (TRUE, "Edge", 40, GTK_BUTTONBOX_EDGE),
TRUE, TRUE, 5);
gtk_box_pack_start (GTK_BOX (vbox),
create_bbox (TRUE, "Start", 40, GTK_BUTTONBOX_START),
TRUE, TRUE, 5);
gtk_box_pack_start (GTK_BOX (vbox),
create_bbox (TRUE, "End", 40, GTK_BUTTONBOX_END),
TRUE, TRUE, 5);
gtk_box_pack_start (GTK_BOX (vbox),
create_bbox (TRUE, "Spread", 40, GTK_BUTTONBOX_SPREAD),
TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox),
create_bbox (TRUE, "Edge", 40, GTK_BUTTONBOX_EDGE),
TRUE, TRUE, 5);
gtk_box_pack_start (GTK_BOX (vbox),
create_bbox (TRUE, "Start", 40, GTK_BUTTONBOX_START),
TRUE, TRUE, 5);
gtk_box_pack_start (GTK_BOX (vbox),
create_bbox (TRUE, "End", 40, GTK_BUTTONBOX_END),
TRUE, TRUE, 5);
frame_vert = gtk_frame_new ("Vertical Button Boxes");
gtk_box_pack_start (GTK_BOX (main_vbox), frame_vert, TRUE, TRUE, 10);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 10);
gtk_container_add (GTK_CONTAINER (frame_vert), hbox);
gtk_box_pack_start (GTK_BOX (hbox),
create_bbox (FALSE, "Spread", 30, GTK_BUTTONBOX_SPREAD),
TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox),
create_bbox (FALSE, "Spread", 30, GTK_BUTTONBOX_SPREAD),
TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox),
create_bbox (FALSE, "Edge", 30, GTK_BUTTONBOX_EDGE),
TRUE, TRUE, 5);
gtk_box_pack_start (GTK_BOX (hbox),
create_bbox (FALSE, "Edge", 30, GTK_BUTTONBOX_EDGE),
TRUE, TRUE, 5);
gtk_box_pack_start (GTK_BOX (hbox),
create_bbox (FALSE, "Start", 30, GTK_BUTTONBOX_START),
TRUE, TRUE, 5);
gtk_box_pack_start (GTK_BOX (hbox),
create_bbox (FALSE, "Start", 30, GTK_BUTTONBOX_START),
TRUE, TRUE, 5);
gtk_box_pack_start (GTK_BOX (hbox),
create_bbox (FALSE, "End", 30, GTK_BUTTONBOX_END),
TRUE, TRUE, 5);
gtk_box_pack_start (GTK_BOX (hbox),
create_bbox (FALSE, "End", 30, GTK_BUTTONBOX_END),
TRUE, TRUE, 5);
}
if (!gtk_widget_get_visible (window))
......@@ -118,7 +118,7 @@ do_button_box (GtkWidget *do_widget)
gtk_widget_show_all (window);
}
else
{
{
gtk_widget_destroy (window);
window = NULL;
}
......
......@@ -95,8 +95,8 @@ find_toplevel_at_pointer (GdkDisplay *display)
static gboolean
button_release_event_cb (GtkWidget *widget,
GdkEventButton *event,
gboolean *clicked)
GdkEventButton *event,
gboolean *clicked)
{
*clicked = TRUE;
return TRUE;
......@@ -108,7 +108,7 @@ button_release_event_cb (GtkWidget *widget,
*/
static GtkWidget *
query_for_toplevel (GdkScreen *screen,
const char *prompt)
const char *prompt)
{
GdkDisplay *display = gdk_screen_get_display (screen);
GtkWidget *popup, *label, *frame;
......@@ -132,31 +132,31 @@ query_for_toplevel (GdkScreen *screen,
cursor = gdk_cursor_new_for_display (display, GDK_CROSSHAIR);
if (gdk_pointer_grab (gtk_widget_get_window (popup), FALSE,
GDK_BUTTON_RELEASE_MASK,
NULL,
cursor,
GDK_CURRENT_TIME) == GDK_GRAB_SUCCESS)
GDK_BUTTON_RELEASE_MASK,
NULL,
cursor,
GDK_CURRENT_TIME) == GDK_GRAB_SUCCESS)
{
gboolean clicked = FALSE;
g_signal_connect (popup, "button-release-event",
G_CALLBACK (button_release_event_cb), &clicked);
G_CALLBACK (button_release_event_cb), &clicked);
/* Process events until clicked is set by button_release_event_cb.
* We pass in may_block=TRUE since we want to wait if there
* are no events currently.
*/
while (!clicked)
g_main_context_iteration (NULL, TRUE);
g_main_context_iteration (NULL, TRUE);
toplevel = find_toplevel_at_pointer (gdk_screen_get_display (screen));
if (toplevel == popup)
toplevel = NULL;
toplevel = NULL;
}
g_object_unref (cursor);
gtk_widget_destroy (popup);
gdk_flush (); /* Really release the grab */
gdk_flush (); /* Really release the grab */
return toplevel;
}
......@@ -171,8 +171,8 @@ query_change_display (ChangeDisplayInfo *info)
GtkWidget *toplevel;
toplevel = query_for_toplevel (screen,
"Please select the toplevel\n"
"to move to the new screen");
"Please select the toplevel\n"
"to move to the new screen");
if (toplevel)
gtk_window_set_screen (GTK_WINDOW (toplevel), info->current_screen);
......@@ -193,19 +193,19 @@ fill_screens (ChangeDisplayInfo *info)
gint i;
for (i = 0; i < n_screens; i++)
{
GdkScreen *screen = gdk_display_get_screen (info->current_display, i);
GtkTreeIter iter;
gtk_list_store_append (GTK_LIST_STORE (info->screen_model), &iter);
gtk_list_store_set (GTK_LIST_STORE (info->screen_model), &iter,
SCREEN_COLUMN_NUMBER, i,
SCREEN_COLUMN_SCREEN, screen,
-1);
if (i == 0)
gtk_tree_selection_select_iter (info->screen_selection, &iter);
}
{
GdkScreen *screen = gdk_display_get_screen (info->current_display, i);
GtkTreeIter iter;
gtk_list_store_append (GTK_LIST_STORE (info->screen_model), &iter);
gtk_list_store_set (GTK_LIST_STORE (info->screen_model), &iter,
SCREEN_COLUMN_NUMBER, i,
SCREEN_COLUMN_SCREEN, screen,
-1);
if (i == 0)
gtk_tree_selection_select_iter (info->screen_selection, &iter);
}
}
}
......@@ -215,8 +215,8 @@ fill_screens (ChangeDisplayInfo *info)
*/
static void
response_cb (GtkDialog *dialog,
gint response_id,
ChangeDisplayInfo *info)
gint response_id,
ChangeDisplayInfo *info)
{
if (response_id == GTK_RESPONSE_OK)
query_change_display (info);
......@@ -230,7 +230,7 @@ response_cb (GtkDialog *dialog,
*/
static void
open_display_cb (GtkWidget *button,
ChangeDisplayInfo *info)
ChangeDisplayInfo *info)
{
GtkWidget *content_area;
GtkWidget *dialog;
......@@ -240,11 +240,11 @@ open_display_cb (GtkWidget *button,
GdkDisplay *result = NULL;
dialog = gtk_dialog_new_with_buttons ("Open Display",
GTK_WINDOW (info->window),
GTK_DIALOG_MODAL,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
GTK_WINDOW (info->window),
GTK_DIALOG_MODAL,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
display_entry = gtk_entry_new ();
......@@ -264,25 +264,25 @@ open_display_cb (GtkWidget *button,
{
gint response_id = gtk_dialog_run (GTK_DIALOG (dialog));
if (response_id != GTK_RESPONSE_OK)
break;
break;
new_screen_name = gtk_editable_get_chars (GTK_EDITABLE (display_entry),
0, -1);
0, -1);
if (strcmp (new_screen_name, "") != 0)
{
result = gdk_display_open (new_screen_name);
if (!result)
{
gchar *error_msg =
g_strdup_printf ("Can't open display :\n\t%s\nplease try another one\n",
new_screen_name);
gtk_label_set_text (GTK_LABEL (dialog_label), error_msg);
g_free (error_msg);
}
g_free (new_screen_name);
}
{
result = gdk_display_open (new_screen_name);
if (!result)
{
gchar *error_msg =
g_strdup_printf ("Can't open display :\n\t%s\nplease try another one\n",
new_screen_name);
gtk_label_set_text (GTK_LABEL (dialog_label), error_msg);
g_free (error_msg);
}
g_free (new_screen_name);
}
}
gtk_widget_destroy (dialog);
......@@ -293,7 +293,7 @@ open_display_cb (GtkWidget *button,
*/
static void
close_display_cb (GtkWidget *button,
ChangeDisplayInfo *info)
ChangeDisplayInfo *info)
{
if (info->current_display)
gdk_display_close (info->current_display);
......@@ -305,7 +305,7 @@ close_display_cb (GtkWidget *button,
*/
static void
display_changed_cb (GtkTreeSelection *selection,
ChangeDisplayInfo *info)
ChangeDisplayInfo *info)
{
GtkTreeModel *model;
GtkTreeIter iter;
......@@ -314,8 +314,8 @@ display_changed_cb (GtkTreeSelection *selection,
g_object_unref (info->current_display);
if (gtk_tree_selection_get_selected (selection, &model, &iter))
gtk_tree_model_get (model, &iter,
DISPLAY_COLUMN_DISPLAY, &info->current_display,
-1);
DISPLAY_COLUMN_DISPLAY, &info->current_display,
-1);
else
info->current_display = NULL;
......@@ -327,7 +327,7 @@ display_changed_cb (GtkTreeSelection *selection,
*/
static void
screen_changed_cb (GtkTreeSelection *selection,
ChangeDisplayInfo *info)
ChangeDisplayInfo *info)
{
GtkTreeModel *model;
GtkTreeIter iter;
......@@ -336,8 +336,8 @@ screen_changed_cb (GtkTreeSelection *selection,
g_object_unref (info->current_screen);
if (gtk_tree_selection_get_selected (selection, &model, &iter))
gtk_tree_model_get (model, &iter,
SCREEN_COLUMN_SCREEN, &info->current_screen,
-1);
SCREEN_COLUMN_SCREEN, &info->current_screen,
-1);
else
info->current_screen = NULL;
}
......@@ -349,10 +349,10 @@ screen_changed_cb (GtkTreeSelection *selection,
*/
static void
create_frame (ChangeDisplayInfo *info,
const char *title,
GtkWidget **frame,
GtkWidget **tree_view,
GtkWidget **button_vbox)
const char *title,
GtkWidget **frame,
GtkWidget **tree_view,
GtkWidget **button_vbox)
{
GtkTreeSelection *selection;
GtkWidget *scrollwin;
......@@ -366,9 +366,9 @@ create_frame (ChangeDisplayInfo *info,
scrollwin = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrollwin),
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrollwin),
GTK_SHADOW_IN);
GTK_SHADOW_IN);
gtk_box_pack_start (GTK_BOX (hbox), scrollwin, TRUE, TRUE, 0);
*tree_view = gtk_tree_view_new ();
......@@ -426,20 +426,20 @@ create_display_frame (ChangeDisplayInfo *info)
gtk_box_pack_start (GTK_BOX (button_vbox), button, FALSE, FALSE, 0);
info->display_model = (GtkTreeModel *)gtk_list_store_new (DISPLAY_NUM_COLUMNS,
G_TYPE_STRING,
GDK_TYPE_DISPLAY);
G_TYPE_STRING,
GDK_TYPE_DISPLAY);
gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), info->display_model);
column = gtk_tree_view_column_new_with_attributes ("Name",
gtk_cell_renderer_text_new (),
"text", DISPLAY_COLUMN_NAME,
NULL);
gtk_cell_renderer_text_new (),
"text", DISPLAY_COLUMN_NAME,
NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column);
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
g_signal_connect (selection, "changed",
G_CALLBACK (display_changed_cb), info);
G_CALLBACK (display_changed_cb), info);
return frame;
}
......@@ -457,20 +457,20 @@ create_screen_frame (ChangeDisplayInfo *info)
create_frame (info, "Screen", &frame, &tree_view, &button_vbox);
info->screen_model = (GtkTreeModel *)gtk_list_store_new (SCREEN_NUM_COLUMNS,
G_TYPE_INT,
GDK_TYPE_SCREEN);
G_TYPE_INT,
GDK_TYPE_SCREEN);
gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), info->screen_model);
column = gtk_tree_view_column_new_with_attributes ("Number",
gtk_cell_renderer_text_new (),
"text", SCREEN_COLUMN_NUMBER,
NULL);
gtk_cell_renderer_text_new (),
"text", SCREEN_COLUMN_NUMBER,
NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column);
info->screen_selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
g_signal_connect (info->screen_selection, "changed",
G_CALLBACK (screen_changed_cb), info);
G_CALLBACK (screen_changed_cb), info);
return frame;
}
......@@ -480,8 +480,8 @@ create_screen_frame (ChangeDisplayInfo *info)
*/
static void
display_closed_cb (GdkDisplay *display,
gboolean is_error,
ChangeDisplayInfo *info)
gboolean is_error,
ChangeDisplayInfo *info)
{
GtkTreeIter iter;
gboolean valid;
......@@ -493,13 +493,13 @@ display_closed_cb (GdkDisplay *display,
GdkDisplay *tmp_display;
gtk_tree_model_get (info->display_model, &iter,
DISPLAY_COLUMN_DISPLAY, &tmp_display,
-1);
DISPLAY_COLUMN_DISPLAY, &tmp_display,
-1);
if (tmp_display == display)
{
gtk_list_store_remove (GTK_LIST_STORE (info->display_model), &iter);
break;
}
{
gtk_list_store_remove (GTK_LIST_STORE (info->display_model), &iter);
break;
}
}
}
......@@ -509,27 +509,27 @@ display_closed_cb (GdkDisplay *display,
*/
static void
add_display (ChangeDisplayInfo *info,
GdkDisplay *display)
GdkDisplay *display)
{
const gchar *name = gdk_display_get_name (display);
GtkTreeIter iter;
gtk_list_store_append (GTK_LIST_STORE (info->display_model), &iter);
gtk_list_store_set (GTK_LIST_STORE (info->display_model), &iter,
DISPLAY_COLUMN_NAME, name,
DISPLAY_COLUMN_DISPLAY, display,
-1);
DISPLAY_COLUMN_NAME, name,
DISPLAY_COLUMN_DISPLAY, display,
-1);
g_signal_connect (display, "closed",
G_CALLBACK (display_closed_cb), info);
G_CALLBACK (display_closed_cb), info);
}
/* Called when a new display is opened
*/
static void
display_opened_cb (GdkDisplayManager *manager,
GdkDisplay *display,
ChangeDisplayInfo *info)
GdkDisplay *display,
ChangeDisplayInfo *info)