diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2014-07-22 21:38:30 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2014-07-22 21:38:30 (GMT) |
commit | 250d2773aa372434b721a4e72bff5da7b4f3fb4e (patch) | |
tree | 3bbb6b75e1cc53c5aa189489e416e3dd92bb79c2 /src/gui/editem.c | |
parent | db863244b804cbf4c06399f7c6f8241d91c9ee9b (diff) |
Used in the right way some features of GLib classes in the GUI code.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@382 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/gui/editem.c')
-rw-r--r-- | src/gui/editem.c | 61 |
1 files changed, 46 insertions, 15 deletions
diff --git a/src/gui/editem.c b/src/gui/editem.c index 790ef0c..c8befec 100644 --- a/src/gui/editem.c +++ b/src/gui/editem.c @@ -210,13 +210,19 @@ void register_editor_item(GEditorItem *item) void change_editor_items_current_binary(GObject *ref, GLoadedBinary *binary) { - GEditorItem *iter; /* Boucle de parcours */ + GEditorItem *iter; /* Boucle de parcours */ + GEditorItemClass *klass; /* Classe correspondante */ g_object_set_data(ref, "current_binary", binary); editem_list_for_each(iter, _editem_list) - if (iter->update_binary != NULL) - iter->update_binary(iter, binary); + { + klass = G_EDITOR_ITEM_GET_CLASS(iter); + + if (klass->update_binary != NULL) + klass->update_binary(iter, binary); + + } } @@ -236,13 +242,20 @@ void change_editor_items_current_binary(GObject *ref, GLoadedBinary *binary) void change_editor_items_current_view(GObject *ref, GtkViewPanel *view) { - GEditorItem *iter; /* Boucle de parcours */ + GEditorItem *iter; /* Boucle de parcours */ + GEditorItemClass *klass; /* Classe correspondante */ g_object_set_data(ref, "current_view", view); editem_list_for_each(iter, _editem_list) - if (iter->update_view != NULL) - iter->update_view(iter, view); + { + klass = G_EDITOR_ITEM_GET_CLASS(iter); + + if (klass->update_view != NULL) + klass->update_view(iter, view); + + + } } @@ -262,11 +275,17 @@ void change_editor_items_current_view(GObject *ref, GtkViewPanel *view) void change_editor_items_current_view_content(GtkViewPanel *view) { - GEditorItem *iter; /* Boucle de parcours */ + GEditorItem *iter; /* Boucle de parcours */ + GEditorItemClass *klass; /* Classe correspondante */ editem_list_for_each(iter, _editem_list) - if (iter->update_content != NULL) - iter->update_content(iter, view); + { + klass = G_EDITOR_ITEM_GET_CLASS(iter); + + if (klass->update_content != NULL) + klass->update_content(iter, view); + + } } @@ -286,11 +305,17 @@ void change_editor_items_current_view_content(GtkViewPanel *view) void focus_address_in_editor_items(vmpa_t addr, GtkWidget *source) { - GEditorItem *iter; /* Boucle de parcours */ + GEditorItem *iter; /* Boucle de parcours */ + GEditorItemClass *klass; /* Classe correspondante */ editem_list_for_each(iter, _editem_list) - if (iter->focus_addr != NULL && iter->widget != source) - iter->focus_addr(iter, addr, source); + { + klass = G_EDITOR_ITEM_GET_CLASS(iter); + + if (klass->focus_addr != NULL && iter->widget != source) + klass->focus_addr(iter, addr, source); + + } } @@ -309,10 +334,16 @@ void focus_address_in_editor_items(vmpa_t addr, GtkWidget *source) void update_project_area(GStudyProject *project) { - GEditorItem *iter; /* Boucle de parcours */ + GEditorItem *iter; /* Boucle de parcours */ + GEditorItemClass *klass; /* Classe correspondante */ editem_list_for_each(iter, _editem_list) - if (iter->update_project != NULL) - iter->update_project(iter, project); + { + klass = G_EDITOR_ITEM_GET_CLASS(iter); + + if (klass->update_project != NULL) + klass->update_project(iter, project); + + } } |