Commit 292e413831d0b2ad72a80fe7cd619ffaca588dc0
1 parent
05250dc8
Exists in
master
and in
4 other branches
Refactoring plugin engine.
Showing
2 changed files
with
20 additions
and
4 deletions
Show diff stats
pw3270.cbp
| ... | ... | @@ -147,9 +147,6 @@ |
| 147 | 147 | <Option compilerVar="CC" /> |
| 148 | 148 | </Unit> |
| 149 | 149 | <Unit filename="src/objects/window/private.h" /> |
| 150 | - <Unit filename="src/objects/window/rename.c"> | |
| 151 | - <Option compilerVar="CC" /> | |
| 152 | - </Unit> | |
| 153 | 150 | <Unit filename="src/objects/window/terminal.c"> |
| 154 | 151 | <Option compilerVar="CC" /> |
| 155 | 152 | </Unit> | ... | ... |
src/objects/window/page.c
| ... | ... | @@ -29,6 +29,7 @@ |
| 29 | 29 | |
| 30 | 30 | #include "private.h" |
| 31 | 31 | #include <pw3270/actions.h> |
| 32 | + #include <pw3270/application.h> | |
| 32 | 33 | #include <lib3270/toggle.h> |
| 33 | 34 | #include <v3270/settings.h> |
| 34 | 35 | #include <v3270/actions.h> |
| ... | ... | @@ -111,6 +112,7 @@ |
| 111 | 112 | static gboolean terminal_popup(GtkWidget *widget, gboolean selected, gboolean online, GdkEvent *event, pw3270ApplicationWindow * window); |
| 112 | 113 | static gboolean oia_popup(GtkWidget *widget, guint field, GdkEvent *event, pw3270ApplicationWindow * window); |
| 113 | 114 | static void label_populate_popup(GtkLabel *label, GtkMenu *menu, GtkWidget *terminal); |
| 115 | + static void plugin_start(GModule *module, GtkWidget *terminal); | |
| 114 | 116 | |
| 115 | 117 | gint pw3270_application_window_append_page(GtkWidget * window, GtkWidget * terminal) { |
| 116 | 118 | |
| ... | ... | @@ -155,6 +157,9 @@ |
| 155 | 157 | gtk_notebook_set_tab_detachable(notebook,terminal,TRUE); |
| 156 | 158 | gtk_notebook_set_tab_reorderable(notebook,terminal,TRUE); |
| 157 | 159 | |
| 160 | + // Initialize plugins | |
| 161 | + pw3270_application_plugin_foreach(G_APPLICATION(gtk_window_get_application(GTK_WINDOW(window))), (GFunc) plugin_start, terminal); | |
| 162 | + | |
| 158 | 163 | return page; |
| 159 | 164 | |
| 160 | 165 | } |
| ... | ... | @@ -214,7 +219,7 @@ |
| 214 | 219 | return; |
| 215 | 220 | } |
| 216 | 221 | |
| 217 | - debug("Default terminal %p was destroyed",__FUNCTION__); | |
| 222 | + debug("Default terminal %p was destroyed (toplevel=%p)",__FUNCTION__,gtk_widget_get_toplevel(terminal)); | |
| 218 | 223 | |
| 219 | 224 | pw3270_application_window_set_active_terminal(GTK_WIDGET(window),NULL); |
| 220 | 225 | |
| ... | ... | @@ -363,3 +368,17 @@ |
| 363 | 368 | } |
| 364 | 369 | |
| 365 | 370 | } |
| 371 | + | |
| 372 | + | |
| 373 | + void plugin_start(GModule *module, GtkWidget *terminal) { | |
| 374 | + | |
| 375 | + /* | |
| 376 | + int (*start)(GtkWidget *); | |
| 377 | + | |
| 378 | + if(g_module_symbol(module, "pw3270_plugin_insert_terminal", (gpointer *) &start)) { | |
| 379 | + start(terminal); | |
| 380 | + } | |
| 381 | + */ | |
| 382 | + | |
| 383 | + } | |
| 384 | + | ... | ... |