Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

nodes.c File Reference


Detailed Description

GUI filtering functions.

Author:
Raphael Manfredi

Richard Eckart

Date:
2001-2003

#include "gtk/gui.h"
#include "interface-glade.h"
#include "gtk/gtk-missing.h"
#include "gtk/misc.h"
#include "gtk/nodes_common.h"
#include "gtk/nodes.h"
#include "gtk/columns.h"
#include "gtk/notebooks.h"
#include "gtk/settings.h"
#include "gtk/statusbar.h"
#include "gtk/search_common.h"
#include "if/gui_property.h"
#include "if/gui_property_priv.h"
#include "if/bridge/ui2c.h"
#include "lib/atoms.h"
#include "lib/glib-missing.h"
#include "lib/iso3166.h"
#include "lib/utf8.h"
#include "lib/walloc.h"
#include "lib/override.h"

Data Structures

struct  node_data

Defines

#define UPDATE_MIN   300 /**< Update screen every 5 minutes at least */
 Update screen every 5 minutes at least.

#define DO_FREEZE   FALSE

Functions

 RCSID ("$Id:nodes.c, v 1.56 2005/12/27 13:05:51 cbiere Exp $")
void nodes_gui_node_removed (gnet_node_t)
 Callback: called when a node is removed from the backend.

void nodes_gui_node_added (gnet_node_t)
 Callback: called when a node is added from the backend.

void nodes_gui_node_info_changed (gnet_node_t)
 Callback: called when node information was changed by the backend.

void nodes_gui_node_flags_changed (gnet_node_t)
 Callback invoked when the node's user-visible flags are changed.

void add_column (GtkTreeView *tree, const gchar *title, GtkTreeCellDataFunc cell_data_func, gpointer udata)
 Create a column, associating the attribute ``attr'' (usually "text") of the cell_renderer to the first column of the model.

void node_data_free (gpointer value)
void nodes_handles_foreach_free (gpointer unused_key, gpointer value, gpointer unused_udata)
GtkListStore * create_nodes_model (void)
void cell_renderer_func (GtkTreeViewColumn *unused_column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer udata)
void nodes_gui_create_treeview_nodes (void)
 Sets up the treeview_nodes object for use by settings_gui.

void nodes_gui_remove_selected_helper (GtkTreeModel *model, GtkTreePath *unused_path, GtkTreeIter *iter, gpointer list_ptr)
node_datafind_node (gnet_node_t n)
 Fetches the node_data that holds the data about the given node and knows the GtkTreeIter.

void nodes_gui_update_node_info (struct node_data *data, gnet_node_info_t *info)
 Updates vendor, version and info column.

void nodes_gui_update_node_flags (struct node_data *data, gnet_node_flags_t *flags)
const gchar * peermode_to_string (node_peer_t m)
void update_tooltip (GtkTreeView *tv, GtkTreePath *path)
gboolean on_leave_notify (GtkWidget *widget, GdkEventCrossing *unused_event, gpointer unused_udata)
void host_lookup_callback (const gchar *hostname, gpointer key)
void on_cursor_changed (GtkTreeView *tv, gpointer unused_udata)
void nodes_gui_early_init (void)
 Initialized the widgets.

void nodes_gui_init (void)
 Initialize the nodes controller.

void nodes_gui_shutdown (void)
 Unregister callbacks in the backend and clean up.

void nodes_gui_remove_node (gnet_node_t n)
 Removes all references to the given node handle in the gui.

void nodes_gui_add_node (gnet_node_info_t *info)
 Adds the given node to the gui.

void update_row (gpointer key, gpointer value, gpointer user_data)
void nodes_gui_update_nodes_display (time_t now)
 Update all the nodes at the same time.

void nodes_gui_remove_selected (void)
 Removes all selected nodes from the treeview and disconnects them.

void nodes_gui_reverse_lookup_selected_helper (GtkTreeModel *model, GtkTreePath *unused_path, GtkTreeIter *iter, gpointer unused_data)
void nodes_gui_reverse_lookup_selected (void)
 Performs a reverse lookup for all selected nodes.

void nodes_gui_browse_selected_helper (GtkTreeModel *model, GtkTreePath *unused_path, GtkTreeIter *iter, gpointer unused_data)
void nodes_gui_browse_selected (void)

Variables

GHashTable * ht_node_info_changed = NULL
GHashTable * ht_node_flags_changed = NULL
GtkTreeView * treeview_nodes = NULL
GtkListStore * nodes_model = NULL
GHashTable * nodes_handles = NULL
GHashTable * ht_pending_lookups = NULL
tree_view_motion_t * tvm_nodes


Define Documentation

#define DO_FREEZE   FALSE
 

#define UPDATE_MIN   300 /**< Update screen every 5 minutes at least */
 

Update screen every 5 minutes at least.


Function Documentation

void add_column GtkTreeView *  tree,
const gchar *  title,
GtkTreeCellDataFunc  cell_data_func,
gpointer  udata
[static]
 

Create a column, associating the attribute ``attr'' (usually "text") of the cell_renderer to the first column of the model.

Also associate the foreground color with the c_gnet_fg column, so that we can set the foreground color for the whole row.

void cell_renderer_func GtkTreeViewColumn *  unused_column,
GtkCellRenderer *  cell,
GtkTreeModel *  model,
GtkTreeIter *  iter,
gpointer  udata
[static]
 

GtkListStore* create_nodes_model void   )  [static]
 

struct node_data* find_node gnet_node_t  n  )  [inline, static]
 

Fetches the node_data that holds the data about the given node and knows the GtkTreeIter.

void host_lookup_callback const gchar *  hostname,
gpointer  key
[static]
 

void node_data_free gpointer  value  )  [static]
 

void nodes_gui_add_node gnet_node_info_t info  ) 
 

Adds the given node to the gui.

void nodes_gui_browse_selected void   ) 
 

void nodes_gui_browse_selected_helper GtkTreeModel *  model,
GtkTreePath *  unused_path,
GtkTreeIter *  iter,
gpointer  unused_data
[inline, static]
 

void nodes_gui_create_treeview_nodes void   )  [static]
 

Sets up the treeview_nodes object for use by settings_gui.

(Uses a default width of one; actual widths are set during nodes_gui_init. This component must be able to be initialized before width settings are initialized.)

void nodes_gui_early_init void   ) 
 

Initialized the widgets.

Include creation of the actual treeview for other init functions that manipulate it, notably settings_gui_init.

void nodes_gui_init void   ) 
 

Initialize the nodes controller.

Register callbacks in the backend.

void nodes_gui_node_added gnet_node_t  n  )  [static]
 

Callback: called when a node is added from the backend.

Adds the node to the gui.

void nodes_gui_node_flags_changed gnet_node_t  n  )  [static]
 

Callback invoked when the node's user-visible flags are changed.

void nodes_gui_node_info_changed gnet_node_t  n  )  [static]
 

Callback: called when node information was changed by the backend.

This updates the node information in the gui.

void nodes_gui_node_removed gnet_node_t  n  )  [static]
 

Callback: called when a node is removed from the backend.

Removes all references to the node from the frontend.

void nodes_gui_remove_node gnet_node_t  n  ) 
 

Removes all references to the given node handle in the gui.

void nodes_gui_remove_selected void   ) 
 

Removes all selected nodes from the treeview and disconnects them.

void nodes_gui_remove_selected_helper GtkTreeModel *  model,
GtkTreePath *  unused_path,
GtkTreeIter *  iter,
gpointer  list_ptr
[inline, static]
 

void nodes_gui_reverse_lookup_selected void   ) 
 

Performs a reverse lookup for all selected nodes.

void nodes_gui_reverse_lookup_selected_helper GtkTreeModel *  model,
GtkTreePath *  unused_path,
GtkTreeIter *  iter,
gpointer  unused_data
[inline, static]
 

void nodes_gui_shutdown void   ) 
 

Unregister callbacks in the backend and clean up.

void nodes_gui_update_node_flags struct node_data data,
gnet_node_flags_t flags
[static]
 

void nodes_gui_update_node_info struct node_data data,
gnet_node_info_t info
[static]
 

Updates vendor, version and info column.

void nodes_gui_update_nodes_display time_t  now  ) 
 

Update all the nodes at the same time.

Bug:
FIXME: We should remember for every node when it was last updated and only refresh every node at most once every second. This information should be kept in a struct pointed to by the row user_data and should be automatically freed when removing the row (see upload stats code).

void nodes_handles_foreach_free gpointer  unused_key,
gpointer  value,
gpointer  unused_udata
[static]
 

void on_cursor_changed GtkTreeView *  tv,
gpointer  unused_udata
[static]
 

gboolean on_leave_notify GtkWidget *  widget,
GdkEventCrossing *  unused_event,
gpointer  unused_udata
[static]
 

const gchar* peermode_to_string node_peer_t  m  )  [static]
 

RCSID "$Id:nodes.  c,
v 1.56 2005/12/27 13:05:51 cbiere Exp $" 
 

void update_row gpointer  key,
gpointer  value,
gpointer  user_data
[inline, static]
 

void update_tooltip GtkTreeView *  tv,
GtkTreePath *  path
[static]
 


Variable Documentation

GHashTable* ht_node_flags_changed = NULL [static]
 

GHashTable* ht_node_info_changed = NULL [static]
 

GHashTable* ht_pending_lookups = NULL [static]
 

GHashTable* nodes_handles = NULL [static]
 

GtkListStore* nodes_model = NULL [static]
 

GtkTreeView* treeview_nodes = NULL [static]
 

tree_view_motion_t* tvm_nodes [static]
 


Generated on Sun Feb 12 10:50:05 2006 for Gtk-Gnutella by doxygen 1.3.6