Heraia  0.1.8
plugin_list.c
Go to the documentation of this file.
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /*
3  * plugin_list.c
4  * manage the plugin_list_window window
5  *
6  * (C) Copyright 2007 - 2011 Olivier Delhomme
7  * e-mail : heraia@delhomme.org
8  * URL : http://heraia.tuxfamily.org
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2, or (at your option)
13  * any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23  */
24 /**
25  * @file plugin_list.c
26  * This file manage plugin list window's behavior
27  */
28 #include <libheraia.h>
29 
30 static gboolean delete_plw_window_event(GtkWidget *widget, GdkEvent *event, gpointer data);
31 static void destroy_plw_window(GtkWidget *widget, GdkEvent *event, gpointer data);
32 static void plw_close_clicked(GtkWidget *widget, gpointer data);
33 static void plw_refresh_clicked(GtkWidget *widget, gpointer data);
34 static void mw_cmi_plw_toggle(GtkWidget *widget, gpointer data);
35 static void pn_treeview_selection_changed_cb(GtkTreeSelection *selection, gpointer data);
36 static void pn_treeview_double_click(GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn *col, gpointer data);
37 
38 static void plugin_list_window_connect_signals(heraia_struct_t *main_struct);
39 
40 static void init_plugin_name_tv(heraia_struct_t *main_struct);
41 static void print_plugin_basics(GtkTextView *textview, heraia_plugin_t *plugin);
42 static void print_plugin_interface(GtkTextView *textview, heraia_plugin_t *plugin);
43 static void print_plugin_filter_structure(GtkTextView *textview, heraia_plugin_t *plugin);
44 static void print_plugin_functions(GtkTextView *textview, heraia_plugin_t *plugin);
45 static void print_plugin_info_structure(GtkTextView *textview, heraia_plugin_t *plugin);
46 static void print_plugin_extra_structure(GtkTextView *textview, heraia_plugin_t *plugin);
47 static void print_plugin_state(GtkTextView *textview, heraia_plugin_t *plugin);
48 
49 
50 /*************** call back function for the plugins_window ********************/
51 /**
52  * @fn gboolean delete_plw_window_event(GtkWidget *widget, GdkEvent *event, gpointer data)
53  * Signal handler called when the user closes the window
54  * @param widget : calling widget
55  * @param event : event associated (may be NULL as we don't use this here)
56  * @param data : MUST be heraia_struct_t *main_struct main structure and not NULL
57  * @return Always returns TRUE in order to propagate the signal
58  */
59 static gboolean delete_plw_window_event(GtkWidget *widget, GdkEvent *event, gpointer data)
60 {
61  plw_close_clicked(widget, data);
62 
63  return TRUE;
64 }
65 
66 
67 /**
68  * @fn void destroy_plw_window(GtkWidget *widget, GdkEvent *event, gpointer data)
69  * When the window is destroyed (Gtk's doc says that we may never get there)
70  * @param widget : calling widget
71  * @param event : event associated (may be NULL as we don't use this here)
72  * @param data : MUST be heraia_struct_t *main_struct main structure and not NULL
73  */
74 static void destroy_plw_window(GtkWidget *widget, GdkEvent *event, gpointer data)
75 {
76  plw_close_clicked(widget, data);
77 }
78 
79 
80 /**
81  * @fn void plw_close_clicked(GtkWidget *widget, gpointer data)
82  * Closing the window effectively
83  * @param widget : calling widget
84  * @param data : MUST be heraia_struct_t *main_struct main structure and not NULL
85  */
86 static void plw_close_clicked(GtkWidget *widget, gpointer data)
87 {
88  heraia_struct_t *main_struct = (heraia_struct_t *) data;
89  GtkCheckMenuItem *cmi = GTK_CHECK_MENU_ITEM(heraia_get_widget(main_struct->xmls->main, "mw_cmi_plugin_list"));
90 
91  record_and_hide_dialog_box(GTK_WIDGET(heraia_get_widget(main_struct->xmls->main, "plugin_list_window")), main_struct->win_prop->plugin_list);
92  gtk_check_menu_item_set_active(cmi, FALSE);
93 }
94 
95 
96 /**
97  * @fn void plw_refresh_clicked(GtkWidget *widget, gpointer data)
98  * Refreshing the window effectively
99  * @param widget : calling widget
100  * @param data : MUST be heraia_struct_t *main_struct main structure and not NULL
101  */
102 static void plw_refresh_clicked(GtkWidget *widget, gpointer data)
103 {
104  heraia_struct_t *main_struct = (heraia_struct_t *) data;
105  GtkTextView *textview = GTK_TEXT_VIEW(heraia_get_widget(main_struct->xmls->main, "plugin_info_textview"));
106 
107  init_plugin_name_tv(main_struct);
108  kill_text_from_textview(textview);
109 }
110 
111 
112 /**
113  * @fn void mw_cmi_plw_toggle(GtkWidget *widget, gpointer data)
114  * When the toggle button 'Liste des plugins' is toggled !
115  * @param widget : calling widget (may be NULL as we do not even bother here)
116  * @param data : MUST be heraia_struct_t *main_struct main structure and not NULL
117  */
118 static void mw_cmi_plw_toggle(GtkWidget *widget, gpointer data)
119 {
120  heraia_struct_t *main_struct = (heraia_struct_t *) data;
121  GtkCheckMenuItem *cmi = GTK_CHECK_MENU_ITEM(heraia_get_widget(main_struct->xmls->main, "mw_cmi_plugin_list"));
122  GtkPaned *paned = GTK_PANED(heraia_get_widget(main_struct->xmls->main, "plw_hpaned"));
123  gint pos = 0;
124 
125  if (gtk_check_menu_item_get_active(cmi) == TRUE)
126  {
127  pos = gtk_paned_get_position(paned);
128  if (pos < 15)
129  {
130  pos = 100;
131  gtk_paned_set_position(paned, pos);
132  }
133  move_and_show_dialog_box(heraia_get_widget(main_struct->xmls->main, "plugin_list_window"), main_struct->win_prop->plugin_list);
134  }
135  else
136  {
137  record_and_hide_dialog_box(heraia_get_widget(main_struct->xmls->main, "plugin_list_window"), main_struct->win_prop->plugin_list);
138  }
139 }
140 
141 
142 /**
143  * @fn void print_plugin_info_structure(GtkTextView *textview, heraia_plugin_t *plugin)
144  * adds to the textview the relevant informations about the plugin info structure !
145  * @param textview : the specified textview (the one in the window)
146  * @param plugin : the plugin we want to print information on
147  */
148 static void print_plugin_info_structure(GtkTextView *textview, heraia_plugin_t *plugin)
149 {
150  if (plugin->info != NULL)
151  {
152  switch (plugin->info->type)
153  {
155  add_text_to_textview(textview, Q_("Type : Unknown\n"));
156  break;
157 
159  add_text_to_textview(textview, Q_("Type : Filter\n"));
160  break;
161 
163  add_text_to_textview(textview, Q_("Type : Action\n"));
164  break;
165 
166  default:
167  add_text_to_textview(textview, Q_("Type : Unknown\n"));
168  }
169 
170  add_text_to_textview(textview, Q_("Priority : %d\n"), plugin->info->priority);
171  add_text_to_textview(textview, Q_("Id : %d\n"), plugin->info->id);
172 
173  if (plugin->info->name != NULL)
174  {
175  add_text_to_textview(textview, Q_("Name : %s\n"), plugin->info->name);
176  }
177 
178  if (plugin->info->version != NULL)
179  {
180  add_text_to_textview(textview, Q_("Version : %s\n"), plugin->info->version);
181  }
182 
183  if (plugin->info->summary != NULL)
184  {
185  add_text_to_textview(textview, Q_("Summary : %s\n"), plugin->info->summary);
186  }
187 
188  if (plugin->info->description != NULL)
189  {
190  add_text_to_textview(textview, Q_("Description : %s\n"), plugin->info->description);
191  }
192 
193  if (plugin->info->author != NULL)
194  {
195  add_text_to_textview(textview, Q_("Author : %s\n"), plugin->info->author);
196  }
197 
198  if (plugin->info->homepage != NULL)
199  {
200  add_text_to_textview(textview, Q_("Web site : %s\n"), plugin->info->homepage);
201  }
202  }
203  else
204  {
205  add_text_to_textview(textview, Q_("The 'info' structure is not initialized !\n"));
206  }
207 }
208 
209 
210 /**
211  * @fn void print_plugin_functions(GtkTextView *textview, heraia_plugin_t *plugin)
212  * adds to the textview the relevant informations about the plugin functions !
213  * @param textview : the specified textview (the one in the window)
214  * @param plugin : the plugin we want to print information on
215  */
216 static void print_plugin_functions(GtkTextView *textview, heraia_plugin_t *plugin)
217 {
218 
219  if (plugin->init_proc != NULL ||
220  plugin->run_proc != NULL ||
221  plugin->quit_proc != NULL ||
222  plugin->refresh_proc != NULL)
223  {
224  add_text_to_textview(textview, Q_("\nPlugin's defined functions :\n"));
225 
226  if (plugin->init_proc != NULL)
227  {
228  add_text_to_textview(textview, Q_(" - Initialization function : %p\n"), plugin->init_proc);
229  }
230 
231  if (plugin->run_proc != NULL)
232  {
233  add_text_to_textview(textview, Q_(" - Main function : %p\n"), plugin->run_proc);
234  }
235 
236  if (plugin->quit_proc != NULL)
237  {
238  add_text_to_textview(textview, Q_(" - Exit function : %p\n"), plugin->quit_proc);
239  }
240 
241  if (plugin->refresh_proc != NULL)
242  {
243  add_text_to_textview(textview, Q_(" - Refresh function : %p\n"), plugin->refresh_proc);
244  }
245  }
246  else
247  {
248  add_text_to_textview(textview, Q_("\nThis plugin does not provide any function !!\n"));
249  }
250 }
251 
252 
253 /**
254  * @fn void print_plugin_filter_structure(GtkTextView *textview, heraia_plugin_t *plugin)
255  * adds to the textview the relevant informations about the plugin filter structure !
256  * @param textview : the specified textview (the one in the window)
257  * @param plugin : the plugin we want to print information on
258  */
259 static void print_plugin_filter_structure(GtkTextView *textview, heraia_plugin_t *plugin)
260 {
261  if (plugin->filter != NULL)
262  {
263  if (plugin->filter->import != NULL ||
264  plugin->filter->export != NULL)
265  {
266  add_text_to_textview(textview, Q_("\nFilter functions :\n"));
267 
268  if (plugin->filter->import != NULL)
269  {
270  add_text_to_textview(textview, Q_(" - Import function : %p\n"), plugin->filter->import);
271  }
272 
273  if (plugin->filter->export != NULL)
274  {
275  add_text_to_textview(textview, Q_(" - Export function : %p\n"), plugin->filter->export);
276  }
277  }
278  else
279  {
280  add_text_to_textview(textview, Q_("\nThis plugin does not provide any filter function\n"));
281  }
282  }
283  else
284  {
285  add_text_to_textview(textview, Q_("\nThe structure 'filter' is not initialized !"));
286  }
287 }
288 
289 
290 /**
291  * @fn void print_plugin_interface(GtkTextView *textview, heraia_plugin_t *plugin)
292  * adds to the textview the relevant informations about the plugin interface (xml) !
293  * @param textview : the specified textview (the one in the window)
294  * @param plugin : the plugin we want to print information on
295  */
296 static void print_plugin_interface(GtkTextView *textview, heraia_plugin_t *plugin)
297 {
298  add_text_to_textview(textview, Q_("\nThis plugin provides :\n"));
299 
300  if (plugin->cmi_entry != NULL)
301  {
302  add_text_to_textview(textview, Q_(" - a menu entry in the plugins menu.\n"));
303  }
304  else
305  {
306  add_text_to_textview(textview, Q_(" - no menu entry.\n"));
307  }
308 
309  if (plugin->xml != NULL)
310  {
311  add_text_to_textview(textview, Q_(" - an xml interface.\n"));
312  }
313  else
314  {
315  add_text_to_textview(textview, Q_(" - no xml interface.\n"));
316  }
317 }
318 
319 
320 /**
321  * @fn void print_plugin_basics(GtkTextView *textview, heraia_plugin_t *plugin)
322  * adds to the textview the relevant informations about the plugin basics !
323  * @param textview : the specified textview (the one in the window)
324  * @param plugin : the plugin we want to print information on
325  */
326 static void print_plugin_basics(GtkTextView *textview, heraia_plugin_t *plugin)
327 {
328  if (plugin->info != NULL)
329  {
330  add_text_to_textview(textview, Q_("API version : %d\n"), plugin->info->api_version);
331  }
332 
333  if (plugin->filename != NULL)
334  {
335  add_text_to_textview(textview, Q_("File : %s\n"), plugin->filename);
336  }
337 
338  if (plugin->path != NULL)
339  {
340  add_text_to_textview(textview, Q_("Directory : %s\n"), plugin->path);
341  }
342 
343  if (plugin->handle != NULL)
344  {
345  add_text_to_textview(textview, Q_("Handle : %p\n"), plugin->handle);
346  }
347  else
348  {
349  add_text_to_textview(textview, Q_("Handle : NONE <-- Is there anything normal ?\n"));
350  }
351 }
352 
353 
354 /**
355  * @fn void print_plugin_extra_structure(GtkTextView *textview, heraia_plugin_t *plugin)
356  * adds to the textview the relevant informations about the plugin extra structure !
357  * @param textview : the specified textview (the one in the window)
358  * @param plugin : the plugin we want to print information on
359  */
360 static void print_plugin_extra_structure(GtkTextView *textview, heraia_plugin_t *plugin)
361 {
362 
363  if (plugin->extra != NULL)
364  {
365  add_text_to_textview(textview, Q_("\nThis plugin has an additionnal 'extra' structure (%p) sized %d bytes.\n"),
366  plugin->extra, sizeof(*(plugin->extra)));
367  }
368  else
369  {
370  add_text_to_textview(textview, Q_("\nThis plugin does not have any additionnal structure.\n"));
371  }
372 
373 }
374 
375 
376 /**
377  * @fn void print_plugin_state(GtkTextView *textview, heraia_plugin_t *plugin)
378  * adds to the textview the relevant informations about the plugin state !
379  * @param textview : the specified textview (the one in the window)
380  * @param plugin : the plugin we want to print information on
381  */
382 static void print_plugin_state(GtkTextView *textview, heraia_plugin_t *plugin)
383 {
384 
385  add_text_to_textview(textview, Q_("Plugin's state : "));
386  switch (plugin->state)
387  {
389  add_text_to_textview(textview, Q_("Running\n"));
390  break;
391 
393  add_text_to_textview(textview, Q_("Initialiazing or initialized\n"));
394  break;
395  case PLUGIN_STATE_LOADED:
396  add_text_to_textview(textview, Q_("Loaded\n"));
397  break;
398 
399  case PLUGIN_STATE_NEW:
400  add_text_to_textview(textview, Q_("Creating itself\n"));
401  break;
402 
404  add_text_to_textview(textview, Q_("Exiting\n"));
405  break;
406 
407  case PLUGIN_STATE_NONE:
408  add_text_to_textview(textview, Q_("Waiting\n"));
409  break;
410 
411  default:
412  add_text_to_textview(textview, Q_("Unknown\n"));
413  }
414 }
415 
416 
417 /**
418  * @fn void pn_treeview_selection_changed_cb(GtkTreeSelection *selection, gpointer data)
419  * Function called when the selection changes in the treeview
420  * Displays informations about the selected plugin
421  * @param selection : user selection in the treeview
422  * @param data : MUST be heraia_struct_t *main_struct main structure (must not be NULL)
423  */
424 static void pn_treeview_selection_changed_cb(GtkTreeSelection *selection, gpointer data)
425 {
426  GtkTreeIter iter;
427  GtkTreeModel *model = NULL;
428  heraia_struct_t *main_struct = (heraia_struct_t *) data;
429  gchar *name = NULL;
430  heraia_plugin_t *plugin = NULL;
431  GtkTextView *textview = GTK_TEXT_VIEW(heraia_get_widget(main_struct->xmls->main, "plugin_info_textview"));
432 
433  if (gtk_tree_selection_get_selected(selection, &model, &iter))
434  {
435  gtk_tree_model_get(model, &iter, PNTV_COLUMN_NAME, &name, -1);
436  plugin = find_plugin_by_name(main_struct->plugins_list, name);
437 
438  if (plugin != NULL)
439  {
440  kill_text_from_textview(textview);
441 
442  print_plugin_basics(textview, plugin);
443 
444  print_plugin_info_structure(textview, plugin);
445 
446  print_plugin_functions(textview, plugin);
447 
448  print_plugin_filter_structure(textview, plugin);
449 
450  print_plugin_interface(textview, plugin);
451 
452  print_plugin_extra_structure(textview, plugin);
453 
454  print_plugin_state(textview, plugin);
455  }
456  }
457 }
458 
459 
460 /**
461  * In case of a double click on a plugin name in the treeview
462  * @param treeview : concerned treeview's widget
463  * @param path : Something related to a GtkTreePath ! (not used here)
464  * @param col : concerned column (not used here)
465  * @param data : user data MUST be a pointer to the heraia_struct_t * structure
466  */
467 static void pn_treeview_double_click(GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn *col, gpointer data)
468 {
469  GtkTreeModel *model;
470  GtkTreeIter iter;
471  gchar *plugin_name;
472  heraia_struct_t *main_struct = (heraia_struct_t *) data;
473  heraia_plugin_t *plugin = NULL;
474  gboolean active = FALSE;
475 
476 
477  model = gtk_tree_view_get_model(treeview);
478 
479  if (gtk_tree_model_get_iter(model, &iter, path))
480  {
481  gtk_tree_model_get(model, &iter, PNTV_COLUMN_NAME, &plugin_name, -1);
482  plugin = find_plugin_by_name(main_struct->plugins_list, plugin_name);
483 
484  if (plugin != NULL)
485  {
486  active = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(plugin->cmi_entry));
487 
488  if (active == FALSE)
489  {
490  gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(plugin->cmi_entry), TRUE);
491  plugin->run_proc(GTK_WIDGET(treeview), main_struct);
492  }
493  }
494  }
495 }
496 /********** End of callback functions that handle the plugins window **********/
497 
498 
499 /**
500  * @fn void plugin_list_window_connect_signals(heraia_struct_t *main_struct)
501  * Connecting all signals to the right functions
502  * @param main_struct : main structure
503  */
505 {
506  GtkTreeSelection *select = NULL;
507 
508  if (main_struct != NULL)
509  {
510  /* When the plugin list window is destroyed or killed */
511  g_signal_connect(G_OBJECT(heraia_get_widget(main_struct->xmls->main, "plugin_list_window")), "delete_event",
512  G_CALLBACK(delete_plw_window_event), main_struct);
513 
514  g_signal_connect(G_OBJECT(heraia_get_widget(main_struct->xmls->main, "plugin_list_window")), "destroy",
515  G_CALLBACK(destroy_plw_window), main_struct);
516 
517  /* Close button */
518  g_signal_connect(G_OBJECT(heraia_get_widget(main_struct->xmls->main, "plw_close_b")), "clicked",
519  G_CALLBACK(plw_close_clicked), main_struct);
520 
521  /* The toogle button */
522  g_signal_connect(G_OBJECT(heraia_get_widget(main_struct->xmls->main, "mw_cmi_plugin_list")), "toggled",
523  G_CALLBACK(mw_cmi_plw_toggle), main_struct);
524 
525  /* Selection has changed for the pn_treeview */
526  select = gtk_tree_view_get_selection(GTK_TREE_VIEW(heraia_get_widget(main_struct->xmls->main, "pn_treeview")));
527  gtk_tree_selection_set_mode(select, GTK_SELECTION_SINGLE);
528  g_signal_connect(G_OBJECT(select), "changed", G_CALLBACK (pn_treeview_selection_changed_cb), main_struct);
529 
530  /* Double Click */
531  g_signal_connect(G_OBJECT(heraia_get_widget(main_struct->xmls->main, "pn_treeview")), "row-activated",
532  G_CALLBACK(pn_treeview_double_click), main_struct);
533 
534  /* Refresh button */
535  g_signal_connect(G_OBJECT(heraia_get_widget(main_struct->xmls->main, "plw_refresh_b")), "clicked",
536  G_CALLBACK(plw_refresh_clicked), main_struct);
537  }
538 }
539 
540 
541 /**
542  * @fn void init_plugin_name_tv(heraia_struct_t *main_struct)
543  * Function to init the first treeview (plugin names)
544  * @param main_struct : main structure
545  */
546 static void init_plugin_name_tv(heraia_struct_t *main_struct)
547 {
548  GtkListStore *list_store = NULL; /**< Treeview Stuff for rendering */
549  GtkTreeIter iter; /**< the text in it. */
550  GtkCellRenderer *renderer = NULL;
551 
552  GtkTreeViewColumn *column = NULL;
553  heraia_plugin_t *plugin = NULL; /**< plugin interface structure */
554  GList *p_list = NULL; /**< plugin list */
555  GtkTreeView *treeview = NULL; /**< Treeview where plugin names are to be displayed */
556 
557  if (main_struct != NULL)
558  {
559  treeview = GTK_TREE_VIEW(heraia_get_widget(main_struct->xmls->main, "pn_treeview"));
560 
561  p_list = g_list_first(main_struct->plugins_list);
562 
563  list_store = gtk_list_store_new(PNTV_N_COLUMNS, G_TYPE_STRING);
564 
565  while (p_list != NULL)
566  {
567  plugin = (heraia_plugin_t *) p_list->data;
568  log_message(main_struct, G_LOG_LEVEL_INFO, "%s", plugin->info->name);
569 
570  gtk_list_store_append(list_store, &iter);
571  gtk_list_store_set(list_store, &iter, PNTV_COLUMN_NAME, plugin->info->name, -1);
572 
573  p_list = p_list->next;
574  }
575 
576  gtk_tree_view_set_model(treeview, GTK_TREE_MODEL(list_store));
577 
578  column = gtk_tree_view_get_column(treeview, PNTV_COLUMN_NAME);
579 
580  if (column != NULL)
581  {
582  gtk_tree_view_remove_column(treeview, column);
583  }
584 
585  renderer = gtk_cell_renderer_text_new();
586  column = gtk_tree_view_column_new_with_attributes("Name", renderer, "text", PNTV_COLUMN_NAME, NULL);
587  gtk_tree_view_append_column(treeview, column);
588  }
589 }
590 
591 
592 /**
593  * @fn plugin_list_window_init_interface(heraia_struct_t *main_struct)
594  * the function to init the plugin_list_window interface
595  * @param main_struct : main structure
596  */
598 {
599 
601 
602  init_plugin_name_tv(main_struct);
603 }
604 
605 
606 
607 
608 
609 
void kill_text_from_textview(GtkTextView *textview)
Kills the text from a textview.
Definition: heraia_ui.c:2049
This is the main structure.
Definition: libheraia.h:332
void plugin_list_window_init_interface(heraia_struct_t *main_struct)
the function to init the plugin_list_window interface
Definition: plugin_list.c:597
void add_text_to_textview(GtkTextView *textview, const char *format,...)
adds a text to a textview
Definition: heraia_ui.c:2025
static void pn_treeview_double_click(GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn *col, gpointer data)
In case of a double click on a plugin name in the treeview.
Definition: plugin_list.c:467
RefreshProc refresh_proc
Called when the cursor changes it's position.
Definition: plugin.h:155
heraia_plugin_t * find_plugin_by_name(GList *plugins_list, gchar *name)
Finds the desired plugin by its name and return the plugin structure or NULL.
Definition: plugin.c:323
static void pn_treeview_selection_changed_cb(GtkTreeSelection *selection, gpointer data)
Function called when the selection changes in the treeview Displays informations about the selected p...
Definition: plugin_list.c:424
static void plw_refresh_clicked(GtkWidget *widget, gpointer data)
Refreshing the window effectively.
Definition: plugin_list.c:102
void log_message(heraia_struct_t *main_struct, GLogLevelFlags log_level, const char *format,...)
A function that helps logging a message a the specified level.
Definition: log.c:195
Filter plugin.
Definition: plugin.h:46
static void print_plugin_functions(GtkTextView *textview, heraia_plugin_t *plugin)
adds to the textview the relevant informations about the plugin functions !
Definition: plugin_list.c:216
GtkBuilder * xml
Eventually the plugin's GtkBuilder XML interface.
Definition: plugin.h:158
window_prop_t * plugin_list
plugin description window
Definition: libheraia.h:265
void record_and_hide_dialog_box(GtkWidget *dialog_box, window_prop_t *dialog_prop)
Record position and hide a dialog box.
Definition: heraia_ui.c:314
InitProc init_proc
Called when the application initialy starts up.
Definition: plugin.h:152
static void print_plugin_info_structure(GtkTextView *textview, heraia_plugin_t *plugin)
adds to the textview the relevant informations about the plugin info structure !
Definition: plugin_list.c:148
all_window_prop_t * win_prop
Keeps window properties.
Definition: libheraia.h:342
plugin_info_t * info
The plugin information.
Definition: plugin.h:147
RunProc run_proc
Called to run an interface everytime the plugin is called.
Definition: plugin.h:154
static void mw_cmi_plw_toggle(GtkWidget *widget, gpointer data)
When the toggle button 'Liste des plugins' is toggled !
Definition: plugin_list.c:118
Unknown type.
Definition: plugin.h:45
xml_t * xmls
All the xmls used in the program, loaded at running time.
Definition: libheraia.h:337
char * version
Definition: plugin.h:128
static void print_plugin_state(GtkTextView *textview, heraia_plugin_t *plugin)
adds to the textview the relevant informations about the plugin state !
Definition: plugin_list.c:382
PluginPriority priority
Definition: plugin.h:124
static void plw_close_clicked(GtkWidget *widget, gpointer data)
Closing the window effectively.
Definition: plugin_list.c:86
static void print_plugin_filter_structure(GtkTextView *textview, heraia_plugin_t *plugin)
adds to the textview the relevant informations about the plugin filter structure ! ...
Definition: plugin_list.c:259
GModule * handle
The module handle.
Definition: plugin.h:144
ImportFunction import
Definition: plugin.h:111
char * description
Definition: plugin.h:130
void * extra
Plugin-specific data.
Definition: plugin.h:150
static void plugin_list_window_connect_signals(heraia_struct_t *main_struct)
Connecting all signals to the right functions.
Definition: plugin_list.c:504
char * summary
Definition: plugin.h:129
PluginType type
Definition: plugin.h:123
char * name
Definition: plugin.h:127
ExportFunction export
Definition: plugin.h:112
static gboolean delete_plw_window_event(GtkWidget *widget, GdkEvent *event, gpointer data)
Signal handler called when the user closes the window.
Definition: plugin_list.c:59
GtkBuilder * main
the main interface xml description
Definition: libheraia.h:222
PluginState state
The state of the plugin.
Definition: plugin.h:143
void move_and_show_dialog_box(GtkWidget *dialog_box, window_prop_t *dialog_prop)
Move the dialog box to the wanted position, shows it and says it in the displayed prop...
Definition: heraia_ui.c:193
char * author
Definition: plugin.h:131
static void init_plugin_name_tv(heraia_struct_t *main_struct)
Function to init the first treeview (plugin names)
Definition: plugin_list.c:546
Complete plugin structure.
Definition: plugin.h:141
static void print_plugin_basics(GtkTextView *textview, heraia_plugin_t *plugin)
adds to the textview the relevant informations about the plugin basics !
Definition: plugin_list.c:326
GList * plugins_list
A list of plugins.
Definition: libheraia.h:340
static void print_plugin_extra_structure(GtkTextView *textview, heraia_plugin_t *plugin)
adds to the textview the relevant informations about the plugin extra structure ! ...
Definition: plugin_list.c:360
static void destroy_plw_window(GtkWidget *widget, GdkEvent *event, gpointer data)
When the window is destroyed (Gtk's doc says that we may never get there)
Definition: plugin_list.c:74
This file contains all the definitions and includes all other .h files.
GtkWidget * heraia_get_widget(GtkBuilder *xml, gchar *widget_name)
This is a wrapper to the GtkBuilder xml get widget.
Definition: heraia_ui.c:2184
char * homepage
Definition: plugin.h:132
QuitProc quit_proc
Called when the application exits.
Definition: plugin.h:153
unsigned int id
Definition: plugin.h:125
Action plugin.
Definition: plugin.h:47
plugin_filter_t * filter
The plugin filter.
Definition: plugin.h:148
static void print_plugin_interface(GtkTextView *textview, heraia_plugin_t *plugin)
adds to the textview the relevant informations about the plugin interface (xml) ! ...
Definition: plugin_list.c:296
char * filename
Filename of the plugin.
Definition: plugin.h:146
char * path
The path to the plugin.
Definition: plugin.h:145
GtkCheckMenuItem * cmi_entry
The CheckMenuItem that may be created in the heraia interface.
Definition: plugin.h:157
unsigned int api_version
Definition: plugin.h:122