#include "procmsg.h"
#include "gtkstext.h"
#include "mimeview.h"
+#include "textview.h"
typedef enum
{
gint new_out;
GString *output;
GtkWidget *text;
+ GdkFont *msgfont;
};
/* widget creating functions */
GtkWidget *window,
GtkCTree *ctree,
GtkWidget *text,
+ GdkFont *msgfont,
+ gint body_pos,
MimeView *mimeview);
static gchar *parse_action_cmd (gchar *action,
ChildInfo *fork_child (gchar *cmd,
gint action_type,
GtkWidget *text,
+ GdkFont *msgfont,
+ gint body_pos,
Children *children);
static gint wait_for_children (gpointer data);
return;
}
- execute_actions(action, compose->window, NULL, compose->text, NULL);
+ execute_actions(action, compose->window, NULL, compose->text, NULL, 0,
+ NULL);
}
static void mainwin_actions_execute_cb(MainWindow *mainwin, guint action_nb,
GtkWidget *widget)
{
MessageView *messageview = mainwin->messageview;
- GtkWidget *text = NULL;
+ TextView *textview = NULL;
gchar *buf,
*action;
MimeView *mimeview = NULL;
switch (messageview->type) {
case MVIEW_TEXT:
if (messageview->textview && messageview->textview->text)
- text = messageview->textview->text;
+ textview = messageview->textview;
break;
case MVIEW_MIME:
if (messageview->mimeview) {
if (messageview->mimeview->type == MIMEVIEW_TEXT &&
messageview->mimeview->textview &&
messageview->mimeview->textview->text)
- text = messageview->mimeview->textview->text;
+ textview = messageview->mimeview->textview;
}
break;
}
execute_actions(action, mainwin->window,
- GTK_CTREE(mainwin->summaryview->ctree), text, mimeview);
+ GTK_CTREE(mainwin->summaryview->ctree), textview->text,
+ textview->msgfont, textview->body_pos, mimeview);
}
static gboolean execute_actions(gchar *action, GtkWidget *window,
- GtkCTree *ctree, GtkWidget *text,
+ GtkCTree *ctree, GtkWidget *text,
+ GdkFont *msgfont, gint body_pos,
MimeView *mimeview)
{
GList *cur, *selection = NULL;
break;
}
if ((child_info = fork_child(cmd, action_type, text,
+ msgfont, body_pos,
children))) {
children_list = g_slist_append(children_list,
child_info);
cmd = parse_action_cmd(action, NULL, ctree, mimeview);
if (cmd) {
if ((child_info = fork_child(cmd, action_type, text,
+ msgfont, body_pos,
children))) {
children_list = g_slist_append(children_list,
child_info);
}
ChildInfo *fork_child(gchar *cmd, gint action_type, GtkWidget *text,
- Children *children)
+ GdkFont *msgfont, gint body_pos, Children *children)
{
gint chld_in[2], chld_out[2], chld_err[2], chld_status[2];
gchar *cmdline[4];
return child_info;
child_info->text = text;
+ child_info->msgfont = msgfont;
- start = 0;
+ start = body_pos;
end = gtk_stext_get_length(GTK_STEXT(text));
if (GTK_EDITABLE(text)->has_selection) {
c = read(source, buf, PREFSBUFSIZE - 1);
if (c == 0)
break;
- gtk_stext_insert(GTK_STEXT(text), NULL, NULL, NULL,
- buf, c);
+ gtk_stext_insert(GTK_STEXT(text), child_info->msgfont,
+ NULL, NULL, buf, c);
}
if (is_selection) {
/* Using the select_region draws things. Should not.