[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: pcb.git: branch: master updated (3f09eea65bc65eeb69bf36443ce33d14b14fb4dc)
The branch, master has been updated
via 3f09eea65bc65eeb69bf36443ce33d14b14fb4dc (commit)
via d9f4e9d25110f47b750df6b4259b9c4e02e7b94f (commit)
via 09d3ccc2c43c2e1bbb8f625d39e6f587403af858 (commit)
via 3584101f67f6ca2f0a252c312cb0c6c9c4fa016f (commit)
via e04f041cfd56000414c2b167e03bcc2ed0e1a1d1 (commit)
from 8cc3e88ce5df28718eac576bc1d1f28616658a9e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/hid/gtk/ghid-main-menu.c | 58 +++++++++++++++++++++-----------------
src/hid/gtk/gui-command-window.c | 2 +-
src/hid/gtk/gui-config.c | 2 +-
src/hid/gtk/gui-pinout-preview.c | 6 ++--
4 files changed, 37 insertions(+), 31 deletions(-)
=================
Commit Messages
=================
commit 3f09eea65bc65eeb69bf36443ce33d14b14fb4dc
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
hid/gtk: Replace GTK_WIDGET_REALIZED() test with a check for window != NULL
This avoids the use of the deprecated GTK_WIDGET_REALIZED macro, without
needing to use the GTK2.20 function gtk_widget_get_realized(). The check
for a NULL window should be sufficient here I hope.
:100644 100644 c4bef20... 79fc0f2... M src/hid/gtk/gui-pinout-preview.c
commit d9f4e9d25110f47b750df6b4259b9c4e02e7b94f
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
hid/gtk: Use gtk_bin_get_child() accessor
In GTK3.0, direct access to bin->child will be impossible.
:100644 100644 310ace8... d913cae... M src/hid/gtk/gui-command-window.c
commit 09d3ccc2c43c2e1bbb8f625d39e6f587403af858
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
hid/gtk: Use gtk_notebook_get_n_pages() rather than diving in and counting
In GTK3.0, direct access to notebook->children will be impossible.
:100644 100644 851571a... 698f57a... M src/hid/gtk/gui-config.c
commit 3584101f67f6ca2f0a252c312cb0c6c9c4fa016f
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
hid/gtk: Don't access a GtkMenuShell's children directly
In GTK3.0, direct access to shell->children will be impossible.
:100644 100644 d816498... 6c0ca01... M src/hid/gtk/ghid-main-menu.c
commit e04f041cfd56000414c2b167e03bcc2ed0e1a1d1
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
hid/gtk: Free list returned from gtk_container_get_children()
We can (and should) g_list_free() the list of children returned when
we are finished with it.
Whilst we are at it, convert the while loop to a for loop and use a
tighter condition on the loop termination test. The existing test worked,
but would leave a negative number in the object counter we test against.
This would not work if the object counters were ever unsigned integers
(as they might plausibly be).
:100644 100644 9ac0367... d816498... M src/hid/gtk/ghid-main-menu.c
=========
Changes
=========
commit 3f09eea65bc65eeb69bf36443ce33d14b14fb4dc
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
hid/gtk: Replace GTK_WIDGET_REALIZED() test with a check for window != NULL
This avoids the use of the deprecated GTK_WIDGET_REALIZED macro, without
needing to use the GTK2.20 function gtk_widget_get_realized(). The check
for a NULL window should be sufficient here I hope.
diff --git a/src/hid/gtk/gui-pinout-preview.c b/src/hid/gtk/gui-pinout-preview.c
index c4bef20..79fc0f2 100644
--- a/src/hid/gtk/gui-pinout-preview.c
+++ b/src/hid/gtk/gui-pinout-preview.c
@@ -191,14 +191,14 @@ ghid_pinout_preview_set_property (GObject * object, guint property_id,
const GValue * value, GParamSpec * pspec)
{
GhidPinoutPreview *pinout = GHID_PINOUT_PREVIEW (object);
+ GdkWindow *window = gtk_widget_get_window (GTK_WIDGET (pinout));
switch (property_id)
{
case PROP_ELEMENT_DATA:
pinout_set_data (pinout, (ElementType *)g_value_get_pointer (value));
- if (GTK_WIDGET_REALIZED (GTK_WIDGET (pinout)))
- gdk_window_invalidate_rect (
- gtk_widget_get_window (GTK_WIDGET (pinout)), NULL, FALSE);
+ if (window != NULL)
+ gdk_window_invalidate_rect (window, NULL, FALSE);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
commit d9f4e9d25110f47b750df6b4259b9c4e02e7b94f
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
hid/gtk: Use gtk_bin_get_child() accessor
In GTK3.0, direct access to bin->child will be impossible.
diff --git a/src/hid/gtk/gui-command-window.c b/src/hid/gtk/gui-command-window.c
index 310ace8..d913cae 100644
--- a/src/hid/gtk/gui-command-window.c
+++ b/src/hid/gtk/gui-command-window.c
@@ -236,7 +236,7 @@ command_combo_box_entry_create (void)
{
ghidgui->command_combo_box = gtk_combo_box_entry_new_text ();
ghidgui->command_entry =
- GTK_ENTRY (GTK_BIN (ghidgui->command_combo_box)->child);
+ GTK_ENTRY (gtk_bin_get_child (GTK_BIN (ghidgui->command_combo_box)));
gtk_entry_set_width_chars (ghidgui->command_entry, 40);
gtk_entry_set_activates_default (ghidgui->command_entry, TRUE);
commit 09d3ccc2c43c2e1bbb8f625d39e6f587403af858
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
hid/gtk: Use gtk_notebook_get_n_pages() rather than diving in and counting
In GTK3.0, direct access to notebook->children will be impossible.
diff --git a/src/hid/gtk/gui-config.c b/src/hid/gtk/gui-config.c
index 851571a..698f57a 100644
--- a/src/hid/gtk/gui-config.c
+++ b/src/hid/gtk/gui-config.c
@@ -1980,7 +1980,7 @@ config_page_create (GtkTreeStore * tree, GtkTreeIter * iter,
vbox = gtk_vbox_new (FALSE, 0);
gtk_notebook_append_page (notebook, vbox, NULL);
- page = g_list_length (notebook->children) - 1;
+ page = gtk_notebook_get_n_pages (notebook) - 1;
gtk_tree_store_set (tree, iter, CONFIG_PAGE_COLUMN, page, -1);
return vbox;
}
commit 3584101f67f6ca2f0a252c312cb0c6c9c4fa016f
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
hid/gtk: Don't access a GtkMenuShell's children directly
In GTK3.0, direct access to shell->children will be impossible.
diff --git a/src/hid/gtk/ghid-main-menu.c b/src/hid/gtk/ghid-main-menu.c
index d816498..6c0ca01 100644
--- a/src/hid/gtk/ghid-main-menu.c
+++ b/src/hid/gtk/ghid-main-menu.c
@@ -343,20 +343,27 @@ ghid_main_menu_real_add_resource (GHidMainMenu *menu, GtkMenuShell *shell,
/* If we get here, the resource is "-" or "@foo" for some foo */
if (res->v[i].value[0] == '@')
{
+ GList *children;
+ int pos;
+
+ children = gtk_container_get_children (GTK_CONTAINER (shell));
+ pos = g_list_length (shell->children);
+ g_list_free (children);
+
if (strcmp (res->v[i].value, "@layerview") == 0)
{
menu->layer_view_shell = shell;
- menu->layer_view_pos = g_list_length (shell->children);
+ menu->layer_view_pos = pos;
}
else if (strcmp (res->v[i].value, "@layerpick") == 0)
{
menu->layer_pick_shell = shell;
- menu->layer_pick_pos = g_list_length (shell->children);
+ menu->layer_pick_pos = pos;
}
else if (strcmp (res->v[i].value, "@routestyles") == 0)
{
menu->route_style_shell = shell;
- menu->route_style_pos = g_list_length (shell->children);
+ menu->route_style_pos = pos;
}
else
Message (_("GTK GUI currently ignores \"%s\" in the menu\n"
commit e04f041cfd56000414c2b167e03bcc2ed0e1a1d1
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
hid/gtk: Free list returned from gtk_container_get_children()
We can (and should) g_list_free() the list of children returned when
we are finished with it.
Whilst we are at it, convert the while loop to a for loop and use a
tighter condition on the loop termination test. The existing test worked,
but would leave a negative number in the object counter we test against.
This would not work if the object counters were ever unsigned integers
(as they might plausibly be).
diff --git a/src/hid/gtk/ghid-main-menu.c b/src/hid/gtk/ghid-main-menu.c
index 9ac0367..d816498 100644
--- a/src/hid/gtk/ghid-main-menu.c
+++ b/src/hid/gtk/ghid-main-menu.c
@@ -519,7 +519,7 @@ void
ghid_main_menu_install_layer_selector (GHidMainMenu *mm,
GHidLayerSelector *ls)
{
- GList *children;
+ GList *children, *iter;
/* @layerview */
if (mm->layer_view_shell)
@@ -527,13 +527,13 @@ ghid_main_menu_install_layer_selector (GHidMainMenu *mm,
/* Remove old children */
children = gtk_container_get_children
(GTK_CONTAINER (mm->layer_view_shell));
- children = g_list_nth (children, mm->layer_view_pos);
- while (children && mm->n_layer_views--)
- {
- gtk_container_remove (GTK_CONTAINER (mm->layer_view_shell),
- children->data);
- children = g_list_next (children);
- }
+ for (iter = g_list_nth (children, mm->layer_view_pos);
+ iter != NULL && mm->n_layer_views > 0;
+ iter = g_list_next (iter), mm->n_layer_views --)
+ gtk_container_remove (GTK_CONTAINER (mm->layer_view_shell),
+ iter->data);
+ g_list_free (children);
+
/* Install new ones */
mm->n_layer_views = ghid_layer_selector_install_view_items
(ls, mm->layer_view_shell, mm->layer_view_pos);
@@ -545,13 +545,13 @@ ghid_main_menu_install_layer_selector (GHidMainMenu *mm,
/* Remove old children */
children = gtk_container_get_children
(GTK_CONTAINER (mm->layer_pick_shell));
- children = g_list_nth (children, mm->layer_pick_pos);
- while (children && mm->n_layer_picks--)
- {
- gtk_container_remove (GTK_CONTAINER (mm->layer_pick_shell),
- children->data);
- children = g_list_next (children);
- }
+ for (iter = g_list_nth (children, mm->layer_pick_pos);
+ iter != NULL && mm->n_layer_picks > 0;
+ iter = g_list_next (iter), mm->n_layer_picks --)
+ gtk_container_remove (GTK_CONTAINER (mm->layer_pick_shell),
+ iter->data);
+ g_list_free (children);
+
/* Install new ones */
mm->n_layer_picks = ghid_layer_selector_install_pick_items
(ls, mm->layer_pick_shell, mm->layer_pick_pos);
@@ -563,20 +563,19 @@ void
ghid_main_menu_install_route_style_selector (GHidMainMenu *mm,
GHidRouteStyleSelector *rss)
{
- GList *children;
+ GList *children, *iter;
/* @routestyles */
if (mm->route_style_shell)
{
/* Remove old children */
children = gtk_container_get_children
(GTK_CONTAINER (mm->route_style_shell));
- children = g_list_nth (children, mm->route_style_pos);
- while (children && mm->n_route_styles--)
- {
- gtk_container_remove (GTK_CONTAINER (mm->route_style_shell),
- children->data);
- children = g_list_next (children);
- }
+ for (iter = g_list_nth (children, mm->route_style_pos);
+ iter != NULL && mm->n_route_styles > 0;
+ iter = g_list_next (iter), mm->n_route_styles --)
+ gtk_container_remove (GTK_CONTAINER (mm->route_style_shell),
+ iter->data);
+ g_list_free (children);
/* Install new ones */
mm->n_route_styles = ghid_route_style_selector_install_items
(rss, mm->route_style_shell, mm->route_style_pos);
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs