faq, man, manual moved to doc/; fix automake warnings
[claws.git] / src / gtk / gtkutils.h
blob90b7eb0f0d1c4feb0fdebcc2593aea8690b6bb7b
1 /*
2 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 1999-2003 Hiroyuki Yamamoto
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #ifndef __GTKUTILS_H__
21 #define __GTKUTILS_H__
23 #ifdef HAVE_CONFIG_H
24 # include "config.h"
25 #endif
27 #include <glib.h>
28 #include <gdk/gdk.h>
29 #include <gtk/gtkmain.h>
30 #include <gtk/gtkwidget.h>
31 #include <gtk/gtkcontainer.h>
32 #include <gtk/gtkeditable.h>
33 #include <gtk/gtkctree.h>
34 #include <gtk/gtkcombo.h>
35 #include <gtk/gtktextview.h>
36 #include <stdlib.h>
37 #if HAVE_WCHAR_H
38 # include <wchar.h>
39 #endif
41 #define GTK_EVENTS_FLUSH() \
42 { \
43 while (gtk_events_pending()) \
44 gtk_main_iteration(); \
47 #define PIXMAP_CREATE(widget, pixmap, mask, xpm_d) \
48 { \
49 if (!pixmap) { \
50 GtkStyle *style = gtk_widget_get_style(widget); \
51 pixmap = gdk_pixmap_create_from_xpm_d \
52 (widget->window, &mask, \
53 &style->bg[GTK_STATE_NORMAL], xpm_d); \
54 } \
57 #define PIXMAP_CREATE_FROM_FILE(widget, pixmap, mask, filename) \
58 { \
59 if (!pixmap) { \
60 GtkStyle *style = gtk_widget_get_style(widget); \
61 pixmap = gdk_pixmap_create_from_xpm \
62 (widget->window, &mask, \
63 &style->bg[GTK_STATE_NORMAL], filename); \
64 } \
67 #define GTK_WIDGET_PTR(wid) (*(GtkWidget **)wid)
69 #define GTKUT_CTREE_NODE_SET_ROW_DATA(node, d) \
70 { \
71 GTK_CTREE_ROW(node)->row.data = d; \
74 #define GTKUT_CTREE_NODE_GET_ROW_DATA(node) \
75 (GTK_CTREE_ROW(node)->row.data)
77 #define GTKUT_CTREE_REFRESH(clist) \
78 GTK_CLIST_GET_CLASS(clist)->refresh(clist)
80 gboolean gtkut_get_font_size (GtkWidget *widget,
81 gint *width,
82 gint *height);
84 void gtkut_convert_int_to_gdk_color (gint rgbvalue,
85 GdkColor *color);
87 void gtkut_button_set_create (GtkWidget **bbox,
88 GtkWidget **button1,
89 const gchar *label1,
90 GtkWidget **button2,
91 const gchar *label2,
92 GtkWidget **button3,
93 const gchar *label3);
95 void gtkut_ctree_node_move_if_on_the_edge
96 (GtkCTree *ctree,
97 GtkCTreeNode *node);
98 gint gtkut_ctree_get_nth_from_node (GtkCTree *ctree,
99 GtkCTreeNode *node);
100 GtkCTreeNode *gtkut_ctree_node_next (GtkCTree *ctree,
101 GtkCTreeNode *node);
102 GtkCTreeNode *gtkut_ctree_node_prev (GtkCTree *ctree,
103 GtkCTreeNode *node);
104 gboolean gtkut_ctree_node_is_selected (GtkCTree *ctree,
105 GtkCTreeNode *node);
106 GtkCTreeNode *gtkut_ctree_find_collapsed_parent
107 (GtkCTree *ctree,
108 GtkCTreeNode *node);
109 void gtkut_ctree_expand_parent_all (GtkCTree *ctree,
110 GtkCTreeNode *node);
111 gboolean gtkut_ctree_node_is_parent (GtkCTreeNode *parent,
112 GtkCTreeNode *node);
113 void gtkut_ctree_set_focus_row (GtkCTree *ctree,
114 GtkCTreeNode *node);
116 void gtkut_clist_set_focus_row (GtkCList *clist,
117 gint row);
119 void gtkut_combo_set_items (GtkCombo *combo,
120 const gchar *str1, ...);
122 gchar *gtkut_editable_get_selection (GtkEditable *editable);
124 void gtkut_container_remove (GtkContainer *container,
125 GtkWidget *widget);
128 void gtkut_window_popup (GtkWidget *window);
130 void gtkut_widget_get_uposition (GtkWidget *widget,
131 gint *px,
132 gint *py);
133 void gtkut_widget_disable_theme_engine (GtkWidget *widget);
134 void gtkut_widget_wait_for_draw (GtkWidget *widget);
135 void gtkut_widget_init (void);
137 void gtkut_widget_set_app_icon (GtkWidget *widget);
138 void gtkut_widget_set_composer_icon (GtkWidget *widget);
140 GtkWidget *gtkut_account_menu_new (GList *ac_list,
141 GtkSignalFunc callback,
142 gpointer data);
144 void gtkut_set_widget_bgcolor_rgb (GtkWidget *widget,
145 guint rgbvalue);
147 gboolean gtkut_text_buffer_match_string (GtkTextBuffer *text,
148 gint pos,
149 gunichar *wcs,
150 gint len,
151 gboolean case_sens);
152 guint gtkut_text_buffer_str_compare_n (GtkTextBuffer *text,
153 guint pos1,
154 guint pos2,
155 guint len,
156 guint text_len);
157 guint gtkut_text_buffer_str_compare (GtkTextBuffer *text,
158 guint start_pos,
159 guint text_len,
160 const gchar *str);
161 gboolean gtkut_text_buffer_is_uri_string(GtkTextBuffer *text,
162 guint start_pos,
163 guint text_len);
164 gchar *gtkut_text_view_get_selection (GtkTextView *textview);
166 #endif /* __GTKUTILS_H__ */