/home/fernape/Projects/lkmonitor/src/callbacks.c File Reference

#include <gtk/gtk.h>
#include "callbacks.h"
#include "interface.h"
#include "support.h"
#include "lkmonitor.h"
#include "lininfo.h"
#include "others.h"
#include "update.h"
#include "procupdate.h"

Go to the source code of this file.

Functions

void on_about1_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_quit1_activate (GtkMenuItem *menuitem, gpointer user_data)
gboolean on_window1_delete_event (GtkWidget *widget, GdkEvent *event, gpointer user_data)
void on_btn_load_clicked (GtkButton *button, gpointer user_data)
void on_btn_write_clicked (GtkButton *button, gpointer user_data)
void on_btn_dev_load_clicked (GtkButton *button, gpointer user_data)
void on_btn_comm_reload_clicked (GtkButton *button, gpointer user_data)
void on_gtv_processes_row_activated (GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data)
void on_tv_maps_row_activated (GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data)
void on_modules_refresh_clicked (GtkButton *button, gpointer user_data)


Function Documentation

void on_about1_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 40 of file callbacks.c.

References create_about().

00042 {
00043         gtk_widget_show(create_about());
00044 }

void on_btn_comm_reload_clicked ( GtkButton *  button,
gpointer  user_data 
)

Definition at line 94 of file callbacks.c.

References update_channels().

Referenced by create_window1().

00096 {
00097         update_channels();
00098 }

void on_btn_dev_load_clicked ( GtkButton *  button,
gpointer  user_data 
)

Definition at line 87 of file callbacks.c.

References update_devs().

Referenced by create_window1().

00089 {
00090   update_devs();
00091 }

void on_btn_load_clicked ( GtkButton *  button,
gpointer  user_data 
)

Definition at line 70 of file callbacks.c.

References update_settings().

Referenced by create_window1().

00072 {
00073         update_settings();
00074 
00075 }

void on_btn_write_clicked ( GtkButton *  button,
gpointer  user_data 
)

Definition at line 78 of file callbacks.c.

References lkmonitor_write_settings(), and update_settings().

Referenced by create_window1().

00080 {
00081   lkmonitor_write_settings();
00082   //Now, we should read settings again to properly update the data.
00083 update_settings();
00084 }

void on_gtv_processes_row_activated ( GtkTreeView *  treeview,
GtkTreePath *  path,
GtkTreeViewColumn *  column,
gpointer  user_data 
)

Definition at line 102 of file callbacks.c.

References create_window2(), and update_process_window().

Referenced by create_window1().

00106 {
00107 
00108   GtkWindow *window;
00109   GtkTreeModel *model;
00110   GtkTreeIter iter;
00111   int pid;
00112   gchar *name=NULL;
00113 
00114   window=GTK_WINDOW(create_window2());
00115 
00116   model=GTK_TREE_MODEL(gtk_tree_view_get_model(treeview));
00117   if(gtk_tree_model_get_iter(model,&iter,path)){
00118           gtk_tree_model_get(model,&iter,0,&pid,1,&name,-1);
00119 
00120           /* Call the function to collect the process information */
00121                 update_process_window(pid,name,window);
00122 
00123         gtk_widget_show(GTK_WIDGET(window));
00124   }
00125 
00126 }

void on_modules_refresh_clicked ( GtkButton *  button,
gpointer  user_data 
)

Definition at line 168 of file callbacks.c.

References update_modules_info().

Referenced by create_window1().

00170 {
00171 
00172         update_modules_info();
00173 
00174 }

void on_quit1_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 48 of file callbacks.c.

References lkmonitor_exit().

00050 {
00051   lkmonitor_exit();
00052   gtk_main_quit();
00053   
00054 }

void on_tv_maps_row_activated ( GtkTreeView *  treeview,
GtkTreePath *  path,
GtkTreeViewColumn *  column,
gpointer  user_data 
)

Definition at line 131 of file callbacks.c.

References update_mm_details().

Referenced by create_window2().

00135 {
00136         GtkWindow *window;
00137         GtkTreeModel *model;
00138         GtkTreeIter iter;
00139         GString *title=g_string_new("");
00140         gchar *address;
00141         char *p;
00142         int pid;
00143 
00144         /* Get the address interval */
00145         model=GTK_TREE_MODEL(gtk_tree_view_get_model(treeview));
00146         if(gtk_tree_model_get_iter(model,&iter,path)){
00147                 gtk_tree_model_get(model,&iter,0,&address,-1);
00148 
00149                 /* Get the PID from the window title... 
00150                 * This is a bit dirty, I guess we can do it
00151                 * in a better way...
00152                 * */
00153                 window=GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(treeview)));
00154                 g_string_printf(title,"%s",gtk_window_get_title(window));
00155 
00156                 if((p=strstr(title->str, "PID"))!=NULL){
00157                         sscanf(p,"PID: %d",&pid);
00158                         /* Get details for the selected memory region */
00159                         update_mm_details(address,window,pid);
00160                 }
00161         }
00162         /* Free the GString */
00163         g_string_free(title,TRUE);
00164 }

gboolean on_window1_delete_event ( GtkWidget *  widget,
GdkEvent *  event,
gpointer  user_data 
)

Definition at line 57 of file callbacks.c.

References is_icon.

Referenced by create_window1().

00060 {
00061         extern gboolean is_icon;
00062         
00063         is_icon=TRUE;
00064         gtk_widget_hide(widget);
00065         return TRUE; //With TRUE the signal is not propagated up.  
00066         
00067 }


Generated on Tue Apr 1 22:52:52 2008 for lkmonitor by  doxygen 1.5.1