Use macros instead of raw numbers for login type
[rofl0r-ixchat.git] / src / fe-gtk / fe-gtk.h
blobbd2c84807af826d1097ed8372cc2399edfaf8c16
1 #define DISPLAY_NAME "XChat"
3 #include <sys/types.h>
4 #include <regex.h>
6 #define N_(String) (String)
7 #define _(x) (x)
9 #include <gtk/gtkwidget.h>
10 #include <gtk/gtkcontainer.h>
11 #include <gtk/gtksignal.h>
13 #undef gtk_signal_connect
14 #define gtk_signal_connect g_signal_connect
16 #define flag_t flag_wid[0]
17 #define flag_n flag_wid[1]
18 #define flag_s flag_wid[2]
19 #define flag_i flag_wid[3]
20 #define flag_p flag_wid[4]
21 #define flag_m flag_wid[5]
22 #define flag_l flag_wid[6]
23 #define flag_k flag_wid[7]
24 #define flag_b flag_wid[8]
25 #define NUM_FLAG_WIDS 9
27 struct server_gui
29 GtkWidget *rawlog_window;
30 GtkWidget *rawlog_textlist;
32 /* join dialog */
33 GtkWidget *joind_win;
34 GtkWidget *joind_entry;
35 GtkWidget *joind_radio1;
36 GtkWidget *joind_radio2;
37 GtkWidget *joind_check;
39 /* chanlist variables */
40 GtkWidget *chanlist_wild; /* GtkEntry */
41 GtkWidget *chanlist_window;
42 GtkWidget *chanlist_list;
43 GtkWidget *chanlist_label;
44 GtkWidget *chanlist_min_spin; /* minusers GtkSpinButton */
45 GtkWidget *chanlist_refresh; /* buttons */
46 GtkWidget *chanlist_join;
47 GtkWidget *chanlist_savelist;
48 GtkWidget *chanlist_search;
50 GSList *chanlist_data_stored_rows; /* stored list so it can be resorted */
51 GSList *chanlist_pending_rows;
52 gint chanlist_tag;
53 gint chanlist_flash_tag;
55 gboolean chanlist_match_wants_channel; /* match in channel name */
56 gboolean chanlist_match_wants_topic; /* match in topic */
58 regex_t chanlist_match_regex; /* compiled regular expression here */
59 unsigned int have_regex;
61 guint chanlist_users_found_count; /* users total for all channels */
62 guint chanlist_users_shown_count; /* users total for displayed channels */
63 guint chanlist_channels_found_count; /* channel total for /LIST operation */
64 guint chanlist_channels_shown_count; /* total number of displayed
65 channels */
67 int chanlist_maxusers;
68 int chanlist_minusers;
69 int chanlist_minusers_downloaded; /* used by LIST IRC command */
70 int chanlist_search_type; /* 0=simple 1=pattern/wildcard 2=regexp */
71 gboolean chanlist_caption_is_stale;
74 /* this struct is persistant even when delinking/relinking */
76 typedef struct restore_gui
78 /* banlist stuff */
79 GtkWidget *banlist_window;
80 GtkWidget *banlist_treeview;
81 GtkWidget *banlist_butRefresh;
83 void *tab; /* (chan *) */
85 /* information stored when this tab isn't front-most */
86 void *user_model; /* for filling the GtkTreeView */
87 void *buffer; /* xtext_Buffer */
88 char *input_text; /* input text buffer (while not-front tab) */
89 char *topic_text; /* topic GtkEntry buffer */
90 char *key_text;
91 char *limit_text;
92 gfloat old_ul_value; /* old userlist value (for adj) */
93 gfloat lag_value; /* lag-o-meter */
94 char *lag_text; /* lag-o-meter text */
95 char *lag_tip; /* lag-o-meter tooltip */
96 gfloat queue_value; /* outbound queue meter */
97 char *queue_text; /* outbound queue text */
98 char *queue_tip; /* outbound queue tooltip */
99 short flag_wid_state[NUM_FLAG_WIDS];
100 unsigned int c_graph:1; /* connecting graph, is there one? */
101 } restore_gui;
103 typedef struct session_gui
105 GtkWidget
106 *xtext,
107 *vscrollbar,
108 *window, /* toplevel */
109 *topic_entry,
110 *note_book,
111 *main_table,
112 *user_tree, /* GtkTreeView */
113 *user_box, /* userlist box */
114 *button_box_parent,
115 *button_box, /* userlist buttons' box */
116 *dialogbutton_box,
117 *topicbutton_box,
118 *meter_box, /* all the meters inside this */
119 *lagometer,
120 *laginfo,
121 *throttlemeter,
122 *throttleinfo,
123 *topic_bar,
124 *hpane_left,
125 *hpane_right,
126 *vpane_left,
127 *vpane_right,
128 *menu,
129 *bar, /* connecting progress bar */
130 *nick_box, /* contains label to the left of input_box */
131 *nick_label,
132 *op_xpm, /* icon to the left of nickname */
133 *namelistinfo, /* label above userlist */
134 *input_box,
135 *flag_wid[NUM_FLAG_WIDS], /* channelmode buttons */
136 *limit_entry, /* +l */
137 *key_entry; /* +k */
139 #define MENU_ID_NUM 12
140 GtkWidget *menu_item[MENU_ID_NUM+1]; /* some items we may change state of */
142 void *chanview; /* chanview.h */
144 int bartag; /*connecting progressbar timeout */
146 int pane_left_size; /*last position of the pane*/
147 int pane_right_size;
149 guint16 is_tab; /* is tab or toplevel? */
150 guint16 ul_hidden; /* userlist hidden? */
152 } session_gui;
154 extern GdkPixmap *channelwin_pix;
155 extern GdkPixmap *dialogwin_pix;
158 #ifdef USE_GTKSPELL
159 char *SPELL_ENTRY_GET_TEXT (GtkWidget *entry);
160 #define SPELL_ENTRY_SET_TEXT(e,txt) gtk_text_buffer_set_text (gtk_text_view_get_buffer(GTK_TEXT_VIEW(e)),txt,-1);
161 #define SPELL_ENTRY_SET_EDITABLE(e,v) gtk_text_view_set_editable(GTK_TEXT_VIEW(e), v)
162 int SPELL_ENTRY_GET_POS (GtkWidget *entry);
163 void SPELL_ENTRY_SET_POS (GtkWidget *entry, int pos);
164 void SPELL_ENTRY_INSERT (GtkWidget *entry, const char *text, int len, int *pos);
165 #else
166 #define SPELL_ENTRY_GET_TEXT(e) (GTK_ENTRY(e)->text)
167 #define SPELL_ENTRY_SET_TEXT(e,txt) gtk_entry_set_text(GTK_ENTRY(e),txt)
168 #define SPELL_ENTRY_SET_EDITABLE(e,v) gtk_editable_set_editable(GTK_EDITABLE(e),v)
169 #define SPELL_ENTRY_GET_POS(e) gtk_editable_get_position(GTK_EDITABLE(e))
170 #define SPELL_ENTRY_SET_POS(e,p) gtk_editable_set_position(GTK_EDITABLE(e),p);
171 #define SPELL_ENTRY_INSERT(e,t,l,p) gtk_editable_insert_text(GTK_EDITABLE(e),t,l,p)
172 #endif