Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. *Read more...*

Feature #647929 ยป 0005-Replace-gtk_container_set_border_width-with-modern-c.patch

Marko Lindqvist, 2017-03-26 06:49 PM

View differences:

client/gui-gtk-4.0/choice_dialog.c
gtk_grid_set_row_spacing(GTK_GRID(vbox), 5);
gtk_container_add(GTK_CONTAINER(dshell),vbox);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
gtk_widget_set_margin_start(vbox, 5);
gtk_widget_set_margin_end(vbox, 5);
gtk_widget_set_margin_top(vbox, 5);
gtk_widget_set_margin_bottom(vbox, 5);
dlabel = gtk_label_new(text);
gtk_container_add(GTK_CONTAINER(vbox), dlabel);
client/gui-gtk-4.0/citydlg.c
p = gtk_window_new(GTK_WINDOW_POPUP);
gtk_widget_set_name(p, "Freeciv");
gtk_container_set_border_width(GTK_CONTAINER(p), 2);
gtk_widget_set_margin_start(p, 2);
gtk_widget_set_margin_end(p, 2);
gtk_widget_set_margin_top(p, 2);
gtk_widget_set_margin_bottom(p, 2);
gtk_window_set_position(GTK_WINDOW(p), GTK_WIN_POS_MOUSE);
frame = gtk_frame_new(NULL);
......
page = gtk_grid_new();
gtk_orientable_set_orientation(GTK_ORIENTABLE(page),
GTK_ORIENTATION_VERTICAL);
gtk_container_set_border_width(GTK_CONTAINER(page), 8);
gtk_widget_set_margin_start(page, 8);
gtk_widget_set_margin_end(page, 8);
gtk_widget_set_margin_top(page, 8);
gtk_widget_set_margin_bottom(page, 8);
label = gtk_label_new_with_mnemonic(tab_title);
gtk_notebook_append_page(GTK_NOTEBOOK(pdialog->notebook), page, label);
......
page = gtk_grid_new();
gtk_orientable_set_orientation(GTK_ORIENTABLE(page),
GTK_ORIENTATION_VERTICAL);
gtk_container_set_border_width(GTK_CONTAINER(page), 8);
gtk_widget_set_margin_start(page, 8);
gtk_widget_set_margin_end(page, 8);
gtk_widget_set_margin_top(page, 8);
gtk_widget_set_margin_bottom(page, 8);
label = gtk_label_new_with_mnemonic(tab_title);
gtk_notebook_append_page(GTK_NOTEBOOK(pdialog->notebook), page, label);
......
page = gtk_grid_new();
gtk_orientable_set_orientation(GTK_ORIENTABLE(page),
GTK_ORIENTATION_VERTICAL);
gtk_container_set_border_width(GTK_CONTAINER(page), 8);
gtk_widget_set_margin_start(page, 8);
gtk_widget_set_margin_end(page, 8);
gtk_widget_set_margin_top(page, 8);
gtk_widget_set_margin_bottom(page, 8);
label = gtk_label_new_with_mnemonic(tab_title);
create_production_header(pdialog, GTK_CONTAINER(page));
......
page = gtk_grid_new();
gtk_orientable_set_orientation(GTK_ORIENTABLE(page),
GTK_ORIENTATION_VERTICAL);
gtk_container_set_border_width(GTK_CONTAINER(page), 8);
gtk_widget_set_margin_start(page, 8);
gtk_widget_set_margin_end(page, 8);
gtk_widget_set_margin_top(page, 8);
gtk_widget_set_margin_bottom(page, 8);
gtk_notebook_append_page(GTK_NOTEBOOK(pdialog->notebook), page, label);
/* stuff that's being currently built */
......
/* main page */
page = gtk_grid_new();
gtk_grid_set_column_spacing(GTK_GRID(page), 6);
gtk_container_set_border_width(GTK_CONTAINER(page), 8);
gtk_widget_set_margin_start(page, 8);
gtk_widget_set_margin_end(page, 8);
gtk_widget_set_margin_top(page, 8);
gtk_widget_set_margin_bottom(page, 8);
label = gtk_label_new_with_mnemonic(tab_title);
gtk_notebook_append_page(GTK_NOTEBOOK(pdialog->notebook), page, label);
......
page = gtk_grid_new();
gtk_grid_set_column_spacing(GTK_GRID(page), 18);
gtk_container_set_border_width(GTK_CONTAINER(page), 8);
gtk_widget_set_margin_start(page, 8);
gtk_widget_set_margin_end(page, 8);
gtk_widget_set_margin_top(page, 8);
gtk_widget_set_margin_bottom(page, 8);
size = gtk_size_group_new(GTK_SIZE_GROUP_BOTH);
client/gui-gtk-4.0/cma_fe.c
gtk_orientable_set_orientation(GTK_ORIENTABLE(pdialog->shell),
GTK_ORIENTATION_VERTICAL);
gtk_grid_set_row_spacing(GTK_GRID(pdialog->shell), 8);
gtk_container_set_border_width(GTK_CONTAINER(pdialog->shell), 8);
gtk_widget_set_margin_start(pdialog->shell, 8);
gtk_widget_set_margin_end(pdialog->shell, 8);
gtk_widget_set_margin_top(pdialog->shell, 8);
gtk_widget_set_margin_bottom(pdialog->shell, 8);
g_signal_connect(pdialog->shell, "destroy",
G_CALLBACK(cma_dialog_destroy_callback), pdialog);
client/gui-gtk-4.0/dialogs.c
hbox = gtk_grid_new();
gtk_grid_set_column_spacing(GTK_GRID(hbox), 18);
gtk_container_set_border_width(GTK_CONTAINER(hbox), 3);
gtk_widget_set_margin_start(hbox, 3);
gtk_widget_set_margin_end(hbox, 3);
gtk_widget_set_margin_top(hbox, 3);
gtk_widget_set_margin_bottom(hbox, 3);
gtk_container_add(GTK_CONTAINER(frame), hbox);
/* Left side: nation list */
client/gui-gtk-4.0/diplodlg.c
gtk_orientable_set_orientation(GTK_ORIENTABLE(vbox),
GTK_ORIENTATION_VERTICAL);
gtk_grid_set_row_spacing(GTK_GRID(vbox), 5);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 2);
gtk_widget_set_margin_start(vbox, 2);
gtk_widget_set_margin_end(vbox, 2);
gtk_widget_set_margin_top(vbox, 2);
gtk_widget_set_margin_bottom(vbox, 2);
gtk_container_add(GTK_CONTAINER(mainbox), vbox);
/* Our nation. */
......
gtk_orientable_set_orientation(GTK_ORIENTABLE(vbox),
GTK_ORIENTATION_VERTICAL);
gtk_grid_set_row_spacing(GTK_GRID(vbox), 5);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 2);
gtk_widget_set_margin_start(vbox, 2);
gtk_widget_set_margin_end(vbox, 2);
gtk_widget_set_margin_top(vbox, 2);
gtk_widget_set_margin_bottom(vbox, 2);
gtk_container_add(GTK_CONTAINER(mainbox), vbox);
/* Their nation. */
client/gui-gtk-4.0/editgui.c
ei = fc_calloc(1, sizeof(*ei));
frame = gtk_frame_new(_("Editor Tool"));
gtk_container_set_border_width(GTK_CONTAINER(frame), 4);
gtk_widget_set_margin_start(frame, 4);
gtk_widget_set_margin_end(frame, 4);
gtk_widget_set_margin_top(frame, 4);
gtk_widget_set_margin_bottom(frame, 4);
ei->widget = frame;
vbox = gtk_grid_new();
gtk_orientable_set_orientation(GTK_ORIENTABLE(vbox),
GTK_ORIENTATION_VERTICAL);
gtk_grid_set_row_spacing(GTK_GRID(vbox), 8);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 4);
gtk_widget_set_margin_start(vbox, 4);
gtk_widget_set_margin_end(vbox, 4);
gtk_widget_set_margin_top(vbox, 4);
gtk_widget_set_margin_bottom(vbox, 4);
gtk_container_add(GTK_CONTAINER(frame), vbox);
/* tool section */
client/gui-gtk-4.0/editprop.c
gtk_orientable_set_orientation(GTK_ORIENTABLE(vbox),
GTK_ORIENTATION_VERTICAL);
gtk_grid_set_row_spacing(GTK_GRID(vbox), 4);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 4);
gtk_widget_set_margin_start(vbox, 4);
gtk_widget_set_margin_end(vbox, 4);
gtk_widget_set_margin_top(vbox, 4);
gtk_widget_set_margin_bottom(vbox, 4);
ev->view_widget = vbox;
label = gtk_label_new(objprop_get_name(op));
......
gtk_orientable_set_orientation(GTK_ORIENTABLE(vbox),
GTK_ORIENTATION_VERTICAL);
gtk_grid_set_row_spacing(GTK_GRID(vbox), 4);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 4);
gtk_widget_set_margin_start(vbox, 4);
gtk_widget_set_margin_end(vbox, 4);
gtk_widget_set_margin_top(vbox, 4);
gtk_widget_set_margin_bottom(vbox, 4);
gtk_paned_pack1(GTK_PANED(paned), vbox, TRUE, TRUE);
scrollwin = gtk_scrolled_window_new(NULL, NULL);
......
gtk_orientable_set_orientation(GTK_ORIENTABLE(vbox),
GTK_ORIENTATION_VERTICAL);
gtk_grid_set_row_spacing(GTK_GRID(vbox), 4);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 4);
gtk_widget_set_margin_start(vbox, 4);
gtk_widget_set_margin_end(vbox, 4);
gtk_widget_set_margin_top(vbox, 4);
gtk_widget_set_margin_bottom(vbox, 4);
gtk_container_add(GTK_CONTAINER(hbox), vbox);
/* Extended property viewer to the right of the properties panel.
......
gtk_container_add(GTK_CONTAINER(vbox2), hsep);
hbox2 = gtk_grid_new();
gtk_container_set_border_width(GTK_CONTAINER(hbox2), 4);
gtk_widget_set_margin_start(hbox2, 4);
gtk_widget_set_margin_end(hbox2, 4);
gtk_widget_set_margin_top(hbox2, 4);
gtk_widget_set_margin_bottom(hbox2, 4);
gtk_container_add(GTK_CONTAINER(vbox2), hbox2);
button = gtk_button_new_with_label(_("Close"));
......
gtk_orientable_set_orientation(GTK_ORIENTABLE(vbox2),
GTK_ORIENTATION_VERTICAL);
gtk_grid_set_row_spacing(GTK_GRID(vbox2), 4);
gtk_container_set_border_width(GTK_CONTAINER(vbox2), 4);
gtk_widget_set_margin_start(vbox2, 4);
gtk_widget_set_margin_end(vbox2, 4);
gtk_widget_set_margin_top(vbox2, 4);
gtk_widget_set_margin_bottom(vbox2, 4);
gtk_container_add(GTK_CONTAINER(scrollwin), vbox2);
property_page_objprop_iterate(pp, op) {
......
gtk_window_set_transient_for(GTK_WINDOW(win), GTK_WINDOW(toplevel));
gtk_window_set_destroy_with_parent(GTK_WINDOW(win), TRUE);
gtk_window_set_type_hint(GTK_WINDOW(win), GDK_WINDOW_TYPE_HINT_DIALOG);
gtk_container_set_border_width(GTK_CONTAINER(win), 4);
gtk_widget_set_margin_start(win, 4);
gtk_widget_set_margin_end(win, 4);
gtk_widget_set_margin_top(win, 4);
gtk_widget_set_margin_bottom(win, 4);
g_signal_connect(win, "delete-event",
G_CALLBACK(gtk_widget_hide_on_delete), NULL);
pe->widget = win;
client/gui-gtk-4.0/gui_main.c
avbox = detached_widget_fill(ahbox);
overview_scrolled_window = gtk_scrolled_window_new(NULL, NULL);
gtk_container_set_border_width(GTK_CONTAINER (overview_scrolled_window), 1);
gtk_widget_set_margin_start(overview_scrolled_window, 1);
gtk_widget_set_margin_end(overview_scrolled_window, 1);
gtk_widget_set_margin_top(overview_scrolled_window, 1);
gtk_widget_set_margin_bottom(overview_scrolled_window, 1);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (overview_scrolled_window),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
......
p = gtk_window_new(GTK_WINDOW_POPUP);
gtk_widget_set_app_paintable(p, TRUE);
gtk_container_set_border_width(GTK_CONTAINER(p), 4);
gtk_widget_set_margin_start(p, 4);
gtk_widget_set_margin_end(p, 4);
gtk_widget_set_margin_top(p, 4);
gtk_widget_set_margin_bottom(p, 4);
gtk_window_set_position(GTK_WINDOW(p), GTK_WIN_POS_MOUSE);
gtk_widget_new(GTK_TYPE_LABEL, "GtkWidget::parent", p,
client/gui-gtk-4.0/gui_stuff.c
gtk_container_add(GTK_CONTAINER(vbox), action_area);
gtk_widget_show(action_area);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 2);
gtk_container_set_border_width(GTK_CONTAINER(action_area), 2);
gtk_widget_set_margin_start(vbox, 2);
gtk_widget_set_margin_end(vbox, 2);
gtk_widget_set_margin_top(vbox, 2);
gtk_widget_set_margin_bottom(vbox, 2);
gtk_widget_set_margin_start(action_area, 2);
gtk_widget_set_margin_end(action_area, 2);
gtk_widget_set_margin_top(action_area, 2);
gtk_widget_set_margin_bottom(action_area, 2);
switch (dlg->type) {
case GUI_DIALOG_WINDOW:
client/gui-gtk-4.0/happiness.c
p = gtk_window_new(GTK_WINDOW_POPUP);
gtk_widget_set_name(p, "Freeciv");
gtk_container_set_border_width(GTK_CONTAINER(p), 2);
gtk_widget_set_margin_start(p, 2);
gtk_widget_set_margin_end(p, 2);
gtk_widget_set_margin_top(p, 2);
gtk_widget_set_margin_bottom(p, 2);
gtk_window_set_position(GTK_WINDOW(p), GTK_WIN_POS_MOUSE);
frame = gtk_frame_new(NULL);
client/gui-gtk-4.0/helpdlg.c
gtk_grid_set_row_spacing(GTK_GRID(help_vbox), 1);
gtk_orientable_set_orientation(GTK_ORIENTABLE(help_vbox),
GTK_ORIENTATION_VERTICAL);
gtk_container_set_border_width(GTK_CONTAINER(help_vbox), 5);
gtk_widget_set_margin_start(help_vbox, 5);
gtk_widget_set_margin_end(help_vbox, 5);
gtk_widget_set_margin_top(help_vbox, 5);
gtk_widget_set_margin_bottom(help_vbox, 5);
gtk_container_add(GTK_CONTAINER(help_box), help_vbox);
text = gtk_text_view_new();
......
gtk_widget_set_vexpand(text, TRUE);
gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(text), FALSE);
gtk_text_view_set_editable(GTK_TEXT_VIEW(text), FALSE);
gtk_container_set_border_width(GTK_CONTAINER(text), 5);
gtk_widget_set_margin_start(text, 5);
gtk_widget_set_margin_end(text, 5);
gtk_widget_set_margin_top(text, 5);
gtk_widget_set_margin_bottom(text, 5);
gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD);
gtk_widget_set_name(text, "help_text");
help_text = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text));
......
gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(w), FALSE);
gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(w), GTK_WRAP_WORD);
gtk_widget_set_name(w, "help_text");
gtk_container_set_border_width(GTK_CONTAINER(w), 5);
gtk_widget_set_margin_start(w, 5);
gtk_widget_set_margin_end(w, 5);
gtk_widget_set_margin_top(w, 5);
gtk_widget_set_margin_bottom(w, 5);
gtk_text_view_set_editable(GTK_TEXT_VIEW(w), FALSE);
gtk_container_add(GTK_CONTAINER(help_vbox), w);
gtk_widget_show(w);
client/gui-gtk-4.0/inteldlg.c
gtk_widget_set_hexpand(view, TRUE);
gtk_widget_set_vexpand(view, TRUE);
g_object_unref(pdialog->diplstates);
gtk_container_set_border_width(GTK_CONTAINER(view), 6);
gtk_widget_set_margin_start(view, 6);
gtk_widget_set_margin_end(view, 6);
gtk_widget_set_margin_top(view, 6);
gtk_widget_set_margin_bottom(view, 6);
gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), FALSE);
rend = gtk_cell_renderer_text_new();
......
gtk_widget_set_hexpand(view, TRUE);
gtk_widget_set_vexpand(view, TRUE);
g_object_unref(pdialog->techs);
gtk_container_set_border_width(GTK_CONTAINER(view), 6);
gtk_widget_set_margin_start(view, 6);
gtk_widget_set_margin_end(view, 6);
gtk_widget_set_margin_top(view, 6);
gtk_widget_set_margin_bottom(view, 6);
gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), FALSE);
rend = gtk_cell_renderer_toggle_new();
client/gui-gtk-4.0/mapctrl.c
if (TILE_UNKNOWN != client_tile_get_known(ptile)) {
p = gtk_window_new(GTK_WINDOW_POPUP);
gtk_widget_set_app_paintable(p, TRUE);
gtk_container_set_border_width(GTK_CONTAINER(p), 4);
gtk_widget_set_margin_start(p, 4);
gtk_widget_set_margin_end(p, 4);
gtk_widget_set_margin_top(p, 4);
gtk_widget_set_margin_bottom(p, 4);
gtk_container_add(GTK_CONTAINER(p), gtk_label_new(popup_info_text(ptile)));
punit = find_visible_unit(ptile);
client/gui-gtk-4.0/pages.c
box = gtk_grid_new();
gtk_orientable_set_orientation(GTK_ORIENTABLE(box),
GTK_ORIENTATION_VERTICAL);
gtk_container_set_border_width(GTK_CONTAINER(box), 4);
gtk_widget_set_margin_start(box, 4);
gtk_widget_set_margin_end(box, 4);
gtk_widget_set_margin_top(box, 4);
gtk_widget_set_margin_bottom(box, 4);
notebook = gtk_notebook_new();
gtk_container_add(GTK_CONTAINER(box), notebook);
......
label = gtk_label_new_with_mnemonic(_("Local _Area Network"));
sw = gtk_scrolled_window_new(NULL, NULL);
gtk_container_set_border_width(GTK_CONTAINER(sw), 4);
gtk_widget_set_margin_start(sw, 4);
gtk_widget_set_margin_end(sw, 4);
gtk_widget_set_margin_top(sw, 4);
gtk_widget_set_margin_bottom(sw, 4);
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
GTK_SHADOW_ETCHED_IN);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
......
label = gtk_label_new_with_mnemonic(_("Internet _Metaserver"));
sw = gtk_scrolled_window_new(NULL, NULL);
gtk_container_set_border_width(GTK_CONTAINER(sw), 4);
gtk_widget_set_margin_start(sw, 4);
gtk_widget_set_margin_end(sw, 4);
gtk_widget_set_margin_top(sw, 4);
gtk_widget_set_margin_bottom(sw, 4);
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
GTK_SHADOW_ETCHED_IN);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
......
gtk_orientable_set_orientation(GTK_ORIENTABLE(box),
GTK_ORIENTATION_VERTICAL);
gtk_grid_set_row_spacing(GTK_GRID(box), 8);
gtk_container_set_border_width(GTK_CONTAINER(box), 4);
gtk_widget_set_margin_start(box, 4);
gtk_widget_set_margin_end(box, 4);
gtk_widget_set_margin_top(box, 4);
gtk_widget_set_margin_bottom(box, 4);
sbox = gtk_grid_new();
gtk_grid_set_column_spacing(GTK_GRID(sbox), 12);
......
gtk_orientable_set_orientation(GTK_ORIENTABLE(box),
GTK_ORIENTATION_VERTICAL);
gtk_grid_set_row_spacing(GTK_GRID(box), 18);
gtk_container_set_border_width(GTK_CONTAINER(box), 4);
gtk_widget_set_margin_start(box, 4);
gtk_widget_set_margin_end(box, 4);
gtk_widget_set_margin_top(box, 4);
gtk_widget_set_margin_bottom(box, 4);
load_store = save_dialog_store_new();
view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(load_store));
......
gtk_orientable_set_orientation(GTK_ORIENTABLE(vbox),
GTK_ORIENTATION_VERTICAL);
gtk_grid_set_row_spacing(GTK_GRID(vbox), 18);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 4);
gtk_widget_set_margin_start(vbox, 4);
gtk_widget_set_margin_end(vbox, 4);
gtk_widget_set_margin_top(vbox, 4);
gtk_widget_set_margin_bottom(vbox, 4);
scenario_store = gtk_list_store_new(5, G_TYPE_STRING,
G_TYPE_STRING,
client/gui-gtk-4.0/unitselect.c
page = gtk_grid_new();
gtk_orientable_set_orientation(GTK_ORIENTABLE(page),
GTK_ORIENTATION_VERTICAL);
gtk_container_set_border_width(GTK_CONTAINER(page), 8);
gtk_widget_set_margin_start(page, 8);
gtk_widget_set_margin_end(page, 8);
gtk_widget_set_margin_top(page, 8);
gtk_widget_set_margin_bottom(page, 8);
pdialog->tabs[loc].page = page;
label = gtk_label_new_with_mnemonic(title);
    (1-1/1)