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

filter.c File Reference


Detailed Description

GUI filtering functions.

Author:
Raphael Manfredi

Richard Eckart

Date:
2001-2003

#include "gui.h"
#include "filter.h"
#include "filter_cb.h"
#include "gtk-missing.h"
#include "gtk/misc.h"
#include "if/gui_property.h"
#include "if/gui_property_priv.h"
#include "lib/glib-missing.h"
#include "lib/utf8.h"
#include "lib/override.h"

Defines

#define DEFAULT_TARGET   (filter_get_drop_target())
#define D(x)   "radiobutton_filter_" x

Enumerations

enum  {
  FILTER_NODE_GLOBAL = 0, FILTER_NODE_BOUND, FILTER_NODE_FREE, FILTER_NODE_BUILTIN,
  NUM_FILTER_NODES
}

Functions

 RCSID ("$Id:filter.c, v 1.24 2005/12/19 07:42:08 cbiere Exp $")
rule_tfilter_gui_get_text_rule (void)
 Extract information about a text rule.

rule_tfilter_gui_get_ip_rule (void)
 Extract information about a ip rule.

rule_tfilter_gui_get_size_rule (void)
 Extract information about a size rule.

rule_tfilter_gui_get_jump_rule (void)
 Extract information about a size rule.

rule_tfilter_gui_get_flag_rule (void)
 Extract information about a flag rule.

rule_tfilter_gui_get_state_rule (void)
 Extract information about a state rule.

 getFilterRoot (filter_t *f)
 Fetch the proper root node for a given filter in the filter tree.

void filter_gui_init (void)
 Initialize the contents of the dialog editor and some internal variables like the roots in the filter list etc.

void filter_gui_show_dialog (void)
 Show the dialog on screen and set position.

void filter_gui_filter_set (filter_t *f, gboolean removable, gboolean active, GList *ruleset)
 Don't use this directly.

void filter_gui_filter_set_enabled (filter_t *f, gboolean active)
 Tell the gui a given filter is enabled/disabled.

const gchar * filter_get_filter_stats (const filter_t *filter)
const gchar * filter_get_rule_stats (const rule_t *rule)
void filter_gui_rebuild_target_combos (GList *filters)
void filter_gui_edit_rule (rule_t *r)
 Load the given rule into the detail view.

void filter_gui_edit_ip_rule (rule_t *r)
 Load a ip rule into the rule edtior or clear it if the rule is NULL.

void filter_gui_edit_sha1_rule (rule_t *r)
 Load a sha1 rule into the rule edtior or clear it if the rule is NULL.

void filter_gui_edit_text_rule (rule_t *r)
 Load a text rule into the rule edtior or clear it if the rule is NULL.

void filter_gui_edit_size_rule (rule_t *r)
 Load a size rule into the rule edtior or clear it if the rule is NULL.

void filter_gui_edit_jump_rule (rule_t *r)
 Load a jump rule into the rule edtior or clear it if the rule is NULL.

void filter_gui_edit_flag_rule (rule_t *r)
 Load a flag rule into the rule edtior or clear it if the rule is NULL.

void filter_gui_edit_state_rule (rule_t *r)
 Load a state rule into the rule edtior or clear it if the rule is NULL.

void filter_gui_set_ruleset (GList *ruleset) rule_t *filter_gui_get_rule(void)
 Fetch the rule which is currently edited.

guint64 filter_update_size (GtkEntry *entry)

Variables

GtkWidget * filter_dialog = NULL
GtkWidget * popup_filter_rule = NULL
const gchar *const  rule_text_type_labels []


Define Documentation

#define D  )     "radiobutton_filter_" x
 

#define DEFAULT_TARGET   (filter_get_drop_target())
 


Enumeration Type Documentation

anonymous enum
 

Enumeration values:
FILTER_NODE_GLOBAL 
FILTER_NODE_BOUND 
FILTER_NODE_FREE 
FILTER_NODE_BUILTIN 
NUM_FILTER_NODES 


Function Documentation

const gchar* filter_get_filter_stats const filter_t filter  )  [static]
 

const gchar* filter_get_rule_stats const rule_t rule  )  [static]
 

void filter_gui_edit_flag_rule rule_t r  ) 
 

Load a flag rule into the rule edtior or clear it if the rule is NULL.

void filter_gui_edit_ip_rule rule_t r  ) 
 

Load a ip rule into the rule edtior or clear it if the rule is NULL.

void filter_gui_edit_jump_rule rule_t r  ) 
 

Load a jump rule into the rule edtior or clear it if the rule is NULL.

void filter_gui_edit_rule rule_t r  ) 
 

Load the given rule into the detail view.

void filter_gui_edit_sha1_rule rule_t r  ) 
 

Load a sha1 rule into the rule edtior or clear it if the rule is NULL.

void filter_gui_edit_size_rule rule_t r  ) 
 

Load a size rule into the rule edtior or clear it if the rule is NULL.

void filter_gui_edit_state_rule rule_t r  ) 
 

Load a state rule into the rule edtior or clear it if the rule is NULL.

void filter_gui_edit_text_rule rule_t r  ) 
 

Load a text rule into the rule edtior or clear it if the rule is NULL.

void filter_gui_filter_set filter_t f,
gboolean  removable,
gboolean  active,
GList *  ruleset
 

Don't use this directly.

Better use filter_set from filter.c. Tell the gui to set itself up to work on the given filter. The information about removeable/active state and ruleset are not taken from the filter!

Note:
This does not rebuild the target combos.

void filter_gui_filter_set_enabled filter_t f,
gboolean  active
 

Tell the gui a given filter is enabled/disabled.

If the filter given is NULL, then the widget will be set insensitive and inactive.

rule_t * filter_gui_get_flag_rule void   )  [static]
 

Extract information about a flag rule.

Warning:
NEVER CALL DIRECTLY!!! Use filter_gui_get_rule().

rule_t * filter_gui_get_ip_rule void   )  [static]
 

Extract information about a ip rule.

Warning:
NEVER CALL DIRECTLY!!! Use filter_gui_get_rule().

rule_t * filter_gui_get_jump_rule void   )  [static]
 

Extract information about a size rule.

Warning:
NEVER CALL DIRECTLY!!! Use filter_gui_get_rule().

rule_t * filter_gui_get_size_rule void   )  [static]
 

Extract information about a size rule.

Warning:
NEVER CALL DIRECTLY!!! Use filter_gui_get_rule().

rule_t * filter_gui_get_state_rule void   )  [static]
 

Extract information about a state rule.

Warning:
NEVER CALL DIRECTLY!!! Use filter_gui_get_rule().

rule_t * filter_gui_get_text_rule void   )  [static]
 

Extract information about a text rule.

Warning:
NEVER CALL DIRECTLY!!! Use filter_gui_get_rule().

void filter_gui_init void   ) 
 

Initialize the contents of the dialog editor and some internal variables like the roots in the filter list etc.

void filter_gui_rebuild_target_combos GList *  filters  ) 
 

void filter_gui_set_ruleset GList *  ruleset  ) 
 

Fetch the rule which is currently edited.

Returns:
a completely new rule_t item in new memory.

void filter_gui_show_dialog void   ) 
 

Show the dialog on screen and set position.

guint64 filter_update_size GtkEntry *  entry  ) 
 

getFilterRoot filter_t f  ) 
 

Fetch the proper root node for a given filter in the filter tree.

RCSID "$Id:filter.  c,
v 1.24 2005/12/19 07:42:08 cbiere Exp $" 
 


Variable Documentation

GtkWidget* filter_dialog = NULL
 

GtkWidget* popup_filter_rule = NULL
 

const gchar* const rule_text_type_labels[] [static]
 

Initial value:

 {
    N_("starts with"),
    N_("contains the words"),
    N_("ends with"),
    N_("contains the substring"),
    N_("matches the regex pattern"),

}


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