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

ui/gtk/gtk2/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.
#define DO_FREEZE   FALSE

Functions

void nodes_gui_node_removed (const node_id_t)
void nodes_gui_node_added (const node_id_t)
void nodes_gui_node_info_changed (const node_id_t)
void nodes_gui_node_flags_changed (const node_id_t)
gboolean remove_item (GHashTable *ht, const node_id_t node_id)
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)
gboolean free_node_id (gpointer key, gpointer value, gpointer unused_udata)
gboolean free_node_data (gpointer unused_key, gpointer value, gpointer unused_udata)
GtkListStore * create_nodes_model (void)
void cell_renderer_func (GtkTreeViewColumn *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 (const node_id_t node_id)
 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)
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 (const node_id_t node_id)
 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_node_removed (const node_id_t node_id)
 Callback: called when a node is removed from the backend.
void nodes_gui_node_added (const node_id_t node_id)
 Callback: called when a node is added from the backend.
void nodes_gui_node_info_changed (const node_id_t node_id)
 Callback: called when node information was changed by the backend.
void nodes_gui_node_flags_changed (const node_id_t node_id)
 Callback invoked when the node's user-visible flags are changed.
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
GHashTable * ht_node_flags_changed
GtkTreeView * treeview_nodes
GtkListStore * nodes_model
GHashTable * nodes_handles
GHashTable * ht_pending_lookups
tree_view_motion_t * tvm_nodes


Define Documentation

#define DO_FREEZE   FALSE
 

#define UPDATE_MIN   300
 

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 *  column,
GtkCellRenderer *  cell,
GtkTreeModel *  model,
GtkTreeIter *  iter,
gpointer  udata
[static]
 

GtkListStore* create_nodes_model void   )  [static]
 

struct node_data* find_node const node_id_t  node_id  )  [inline, static]
 

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

gboolean free_node_data gpointer  unused_key,
gpointer  value,
gpointer  unused_udata
[static]
 

gboolean free_node_id gpointer  key,
gpointer  value,
gpointer  unused_udata
[static]
 

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 const node_id_t  node_id  )  [static]
 

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

Adds the node to the gui.

void nodes_gui_node_added const   node_id_t  )  [static]
 

void nodes_gui_node_flags_changed const node_id_t  node_id  )  [static]
 

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

This schedules an update of the node information in the gui at the next tick.

void nodes_gui_node_flags_changed const   node_id_t  )  [static]
 

void nodes_gui_node_info_changed const node_id_t  node_id  )  [static]
 

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

This schedules an update of the node information in the gui at the next tick.

void nodes_gui_node_info_changed const   node_id_t  )  [static]
 

void nodes_gui_node_removed const node_id_t  node_id  )  [static]
 

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

Removes all references to the node from the frontend.

void nodes_gui_node_removed const   node_id_t  )  [static]
 

void nodes_gui_remove_node const node_id_t  node_id  ) 
 

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 on_cursor_changed GtkTreeView *  tv,
gpointer  unused_udata
[static]
 

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

gboolean remove_item GHashTable *  ht,
const node_id_t  node_id
[static]
 

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 [static]
 

GHashTable* ht_node_info_changed [static]
 

GHashTable* ht_pending_lookups [static]
 

GHashTable* nodes_handles [static]
 

GtkListStore* nodes_model [static]
 

GtkTreeView* treeview_nodes [static]
 

tree_view_motion_t* tvm_nodes [static]
 


Generated on Sat Jun 30 17:53:29 2007 for gtk-gnutella by  doxygen 1.3.9.1