Re: new sendmsg-window patch



Hi,

Give me another try. It turns out that one can preserve the point
position if one uses the gtk_editable_(get|set)_position functions
instead of gtk_text_get_point. I cannot say I like it, I would prefer
one wouldn't need to do this kind of workaround but...

I have also kind of philosophy-oriented problem: should we set the font
separately in balsa or rather utilize some kind of themes. First choice
is simpler but I am not sure if it goes along the GNOME philosophy. I
guess one should be able to change all the fonts in all the input
fields just by changing the theme. Is this correct?

Pawel

On  3 Feb, David Pickens wrote:
> There are a couple of other Text widgets, but none are terribly well
> suited to balsa.  (I know that an editable HTML widget is being developed
> using the version that's in gnome-fm if I recall correctly).

Index: src/sendmsg-window.c
===================================================================
RCS file: /cvs/gnome/balsa/src/sendmsg-window.c,v
retrieving revision 1.153
diff -c -r1.153 sendmsg-window.c
*** src/sendmsg-window.c	2000/01/31 06:00:32	1.153
--- src/sendmsg-window.c	2000/02/04 09:47:52
***************
*** 59,64 ****
--- 59,73 ----
  static gint toggle_fcc_cb (GtkWidget *, BalsaSendmsg *);
  static gint toggle_attachments_cb (GtkWidget *, BalsaSendmsg *);
  
+ static gint iso_font_set(BalsaSendmsg*, gint , gint );
+ static gint iso_1_cb(GtkWidget* , BalsaSendmsg *);
+ static gint iso_15_cb(GtkWidget* , BalsaSendmsg *);
+ static gint iso_2_cb(GtkWidget* , BalsaSendmsg *);
+ static gint iso_3_cb(GtkWidget* , BalsaSendmsg *);
+ static gint iso_5_cb(GtkWidget* , BalsaSendmsg *);
+ static gint iso_8_cb(GtkWidget* , BalsaSendmsg *);
+ static gint iso_9_cb(GtkWidget* , BalsaSendmsg *);
+ 
  /* Standard DnD types */
  enum
    {
***************
*** 127,173 ****
  static GnomeUIInfo view_menu[] =
  {
  #define MENU_TOGGLE_FROM_POS 0
!   {
!      GNOME_APP_UI_TOGGLEITEM, N_ ("_From"), NULL,
!     toggle_from_cb, NULL,
!     NULL, GNOME_APP_PIXMAP_NONE, NULL , GDK_VoidSymbol, 0, NULL
!   },
  #define MENU_TOGGLE_TO_POS 1
!   {
!      GNOME_APP_UI_TOGGLEITEM, N_ ("_To"), NULL,
!     toggle_to_cb, NULL,
!     NULL, GNOME_APP_PIXMAP_NONE, NULL , GDK_VoidSymbol, 0, NULL
!   },
  #define MENU_TOGGLE_SUBJECT_POS 2
!   {
!      GNOME_APP_UI_TOGGLEITEM, N_ ("_Subject"), NULL,
!     toggle_subject_cb, NULL,
!     NULL, GNOME_APP_PIXMAP_NONE, NULL , GDK_VoidSymbol, 0, NULL
!   },
  #define MENU_TOGGLE_CC_POS 3
!   {
!      GNOME_APP_UI_TOGGLEITEM, N_ ("_Cc"), NULL,
!     toggle_cc_cb, NULL,
!     NULL, GNOME_APP_PIXMAP_NONE, NULL , GDK_VoidSymbol, 0, NULL
!   },
  #define MENU_TOGGLE_BCC_POS 4
!   {
!      GNOME_APP_UI_TOGGLEITEM, N_ ("_Bcc"), NULL,
!     toggle_bcc_cb, NULL,
!     NULL, GNOME_APP_PIXMAP_NONE, NULL , GDK_VoidSymbol, 0, NULL
!   },
  #define MENU_TOGGLE_FCC_POS 5
!   {
!      GNOME_APP_UI_TOGGLEITEM, N_ ("_Fcc"), NULL,
!     toggle_fcc_cb, NULL,
!     NULL, GNOME_APP_PIXMAP_NONE, NULL , GDK_VoidSymbol, 0, NULL
!   },
  #define MENU_TOGGLE_ATTACHMENTS_POS 6
!   {
!      GNOME_APP_UI_TOGGLEITEM, N_ ("_Attachments"), NULL,
!     toggle_attachments_cb, NULL,
!     NULL, GNOME_APP_PIXMAP_NONE, NULL , GDK_VoidSymbol, 0, NULL
!   },
    GNOMEUIINFO_END
  };
  
--- 136,191 ----
  static GnomeUIInfo view_menu[] =
  {
  #define MENU_TOGGLE_FROM_POS 0
!   GNOMEUIINFO_TOGGLEITEM( N_ ("_From"), NULL, toggle_from_cb, NULL),
  #define MENU_TOGGLE_TO_POS 1
!   GNOMEUIINFO_TOGGLEITEM( N_ ("_To"), NULL, toggle_to_cb, NULL),
  #define MENU_TOGGLE_SUBJECT_POS 2
!   GNOMEUIINFO_TOGGLEITEM( N_ ("_Subject"), NULL, toggle_subject_cb, NULL),
  #define MENU_TOGGLE_CC_POS 3
!   GNOMEUIINFO_TOGGLEITEM( N_ ("_Cc"), NULL, toggle_cc_cb, NULL),
  #define MENU_TOGGLE_BCC_POS 4
!   GNOMEUIINFO_TOGGLEITEM( N_ ("_Bcc"), NULL, toggle_bcc_cb, NULL),
  #define MENU_TOGGLE_FCC_POS 5
!   GNOMEUIINFO_TOGGLEITEM( N_ ("_Fcc"), NULL, toggle_fcc_cb, NULL),
  #define MENU_TOGGLE_ATTACHMENTS_POS 6
!   GNOMEUIINFO_TOGGLEITEM( N_ ("_Attachments"),NULL,toggle_attachments_cb,NULL),
!   GNOMEUIINFO_END
! };
! 
! 
! /* ISO-8859-1 MUST BE at the first position - see set_menus */
! static GnomeUIInfo iso_charset_menu[] = {
! #define ISO_CHARSET_1_POS 0
!   GNOMEUIINFO_ITEM_NONE( N_ ("_Western (ISO-8859-1)"), NULL, iso_1_cb),
! #define ISO_CHARSET_15_POS 1
!   GNOMEUIINFO_ITEM_NONE( N_ ("W_estern (ISO-8859-15)"), NULL, iso_15_cb),
! #define ISO_CHARSET_2_POS 2
!   GNOMEUIINFO_ITEM_NONE( N_ ("_Central European (ISO-8859-2)"), NULL,iso_2_cb),
! #define ISO_CHARSET_3_POS 3
!   GNOMEUIINFO_ITEM_NONE( N_ ("_South European (ISO-8859-3)"), NULL, iso_3_cb),
! #define ISO_CHARSET_5_POS 4
!   GNOMEUIINFO_ITEM_NONE( N_ ("_Cyrylic (ISO-8859-5)"), NULL, iso_5_cb),
! #define ISO_CHARSET_8_POS 5
!   GNOMEUIINFO_ITEM_NONE( N_ ("_Hebrew (ISO-8859-8)"), NULL, iso_8_cb),
! #define ISO_CHARSET_9_POS 6
!   GNOMEUIINFO_ITEM_NONE( N_ ("_Turkish (ISO-8859-9)"), NULL, iso_9_cb),
!   GNOMEUIINFO_END
! };
! 
! /* the same sequence as in iso_charset_menu */
! static gchar* iso_charset_names[] = {
!    "ISO-8859-1",
!    "ISO-8859-15",
!    "ISO-8859-2",
!    "ISO-8859-3",
!    "ISO-8859-5",
!    "ISO-8859-8",
!    "ISO-8859-9",
! };
! 
! static GnomeUIInfo iso_menu[] = {
!   { GNOME_APP_UI_RADIOITEMS, NULL, NULL, iso_charset_menu, NULL, NULL,
!     GNOME_APP_PIXMAP_NONE, NULL, 0, 0, NULL },
    GNOMEUIINFO_END
  };
  
***************
*** 176,181 ****
--- 194,200 ----
  {
    GNOMEUIINFO_MENU_FILE_TREE(file_menu),
    GNOMEUIINFO_SUBTREE(N_("_Show"), view_menu),
+   GNOMEUIINFO_SUBTREE(N_("_ISO Charset"), iso_menu),
    GNOMEUIINFO_END
  };
  
***************
*** 268,280 ****
  				 g_basename (filename));
      gnome_icon_list_set_icon_data (iconlist, pos, filename);
    } else {
!       /*PKGW*/
!       GtkWidget *box = gnome_message_box_new( _("The attachment pixmap (balsa/attachment.png) cannot be found.\n"
! 						"This means you cannot attach any files.\n"), 
! 					      GNOME_MESSAGE_BOX_ERROR, _("OK"), NULL );
!       gtk_window_set_modal( GTK_WINDOW( box ), TRUE );
!       gnome_dialog_run( GNOME_DIALOG( box ) );
!       gtk_widget_destroy( GTK_WIDGET( box ) );
    }
  }
  
--- 287,300 ----
  				 g_basename (filename));
      gnome_icon_list_set_icon_data (iconlist, pos, filename);
    } else {
!      /*PKGW*/
!      GtkWidget *box = gnome_message_box_new( 
! 	_("The attachment pixmap (balsa/attachment.png) cannot be found.\n"
! 	  "This means you cannot attach any files.\n"), 
! 	GNOME_MESSAGE_BOX_ERROR, _("OK"), NULL );
!      gtk_window_set_modal( GTK_WINDOW( box ), TRUE );
!      gnome_dialog_run( GNOME_DIALOG( box ) );
!      gtk_widget_destroy( GTK_WIDGET( box ) );
    }
  }
  
***************
*** 286,299 ****
    gchar *ptr = 0;
    gint result = TRUE;
    if (stat (filename, &s)) {
!     ptr = g_strdup_printf (_ ("Cannot get info on file '%s': %s\n"), filename, strerror (errno));
      result = FALSE;
    } else if (!S_ISREG (s.st_mode)) {
!     ptr = g_strdup_printf (_ ("Attachment is not a regular file: '%s'\n"), filename);
      result = FALSE;
    }
    if (ptr) {
!     msgbox = gnome_message_box_new (ptr, GNOME_MESSAGE_BOX_ERROR, _ ("Cancel"), NULL);
      gtk_window_set_modal (GTK_WINDOW (msgbox), TRUE);
      gnome_dialog_run (GNOME_DIALOG (msgbox));
      free (ptr);
--- 306,322 ----
    gchar *ptr = 0;
    gint result = TRUE;
    if (stat (filename, &s)) {
!     ptr = g_strdup_printf (_ ("Cannot get info on file '%s': %s\n"), filename,
! 			   strerror (errno));
      result = FALSE;
    } else if (!S_ISREG (s.st_mode)) {
!     ptr = g_strdup_printf (_ ("Attachment is not a regular file: '%s'\n"), 
! 			   filename);
      result = FALSE;
    }
    if (ptr) {
!     msgbox = gnome_message_box_new (ptr, GNOME_MESSAGE_BOX_ERROR, 
! 				    _ ("Cancel"), NULL);
      gtk_window_set_modal (GTK_WINDOW (msgbox), TRUE);
      gnome_dialog_run (GNOME_DIALOG (msgbox));
      free (ptr);
***************
*** 590,623 ****
    msg->attachments[3] = frame;
  
    gtk_widget_show_all( GTK_WIDGET(table) );
-   set_menus(msg);
  
    return table;
  }
  
  static GtkWidget *
  create_text_area (BalsaSendmsg * msg)
  {
    GtkWidget *table;
    GtkWidget *hscrollbar;
    GtkWidget *vscrollbar;
-   GdkFont *font;
-   GdkColormap* colormap;
-   GtkStyle *style;
- 
-   style = gtk_style_new ();
-   font = gdk_font_load ( balsa_app.message_font );
-   colormap = gtk_widget_get_colormap (GTK_WIDGET (msg->attachments[1]));
- 
-   style->font = font;
  
    table = gtk_table_new (2, 2, FALSE);
  
    msg->text = gtk_text_new (NULL, NULL);
    gtk_text_set_editable (GTK_TEXT (msg->text), TRUE);
    gtk_text_set_word_wrap (GTK_TEXT (msg->text), TRUE);
!   gtk_widget_set_style (msg->text, style);
!   gtk_widget_set_usize (msg->text, (82 * 7) + (2 * msg->text->style->klass->xthickness), -1);
    gtk_widget_show (msg->text);
    gtk_table_attach_defaults (GTK_TABLE (table), msg->text, 0, 1, 0, 1);
    hscrollbar = gtk_hscrollbar_new (GTK_TEXT (msg->text)->hadj);
--- 613,641 ----
    msg->attachments[3] = frame;
  
    gtk_widget_show_all( GTK_WIDGET(table) );
  
    return table;
  }
  
+ /* create_text_area should not have any hard-coded assumptions about the 
+    font charset that is to be used.
+ */
  static GtkWidget *
  create_text_area (BalsaSendmsg * msg)
  {
    GtkWidget *table;
    GtkWidget *hscrollbar;
    GtkWidget *vscrollbar;
  
    table = gtk_table_new (2, 2, FALSE);
  
    msg->text = gtk_text_new (NULL, NULL);
    gtk_text_set_editable (GTK_TEXT (msg->text), TRUE);
    gtk_text_set_word_wrap (GTK_TEXT (msg->text), TRUE);
! 
!   gtk_widget_set_usize (msg->text, 
! 			(82 * 7) + (2 * msg->text->style->klass->xthickness), 
! 			-1);
    gtk_widget_show (msg->text);
    gtk_table_attach_defaults (GTK_TABLE (table), msg->text, 0, 1, 0, 1);
    hscrollbar = gtk_hscrollbar_new (GTK_TEXT (msg->text)->hadj);
***************
*** 899,906 ****
  			 signature, strlen (signature));
       g_free (signature);
      }
!   gtk_text_set_point (GTK_TEXT (msg->text), 0);
!   gtk_text_thaw (GTK_TEXT (msg->text));
  
    /* set the toolbar so we are consistant with the rest of balsa */
    {
--- 917,925 ----
  			 signature, strlen (signature));
       g_free (signature);
      }
!   gtk_text_set_point(GTK_TEXT(msg->text), 0);
!   gtk_text_insert   (GTK_TEXT(msg->text), NULL, NULL, NULL, "\n", 1);
!   gtk_text_thaw     (GTK_TEXT(msg->text));
  
    /* set the toolbar so we are consistant with the rest of balsa */
    {
***************
*** 914,923 ****
      gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), balsa_app.toolbar_style);
    }
  
!   /* display the window, but some stuff shold be hidden? */
  
    gtk_widget_show (window);
- 
  }
  
  static gchar *
--- 933,942 ----
      gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), balsa_app.toolbar_style);
    }
  
!   /* set the menus  - and charset index - and display the window */
!   set_menus(msg);
  
    gtk_widget_show (window);
  }
  
  static gchar *
***************
*** 947,952 ****
--- 966,972 ----
    Message *message;
    Body *body;
    gchar *tmp;
+   gchar *def_charset;
  
    tmp = gtk_entry_get_text (GTK_ENTRY (bsmsg->to[1]));
    {
***************
*** 1043,1048 ****
--- 1063,1073 ----
    }
  
  
+   /* not really a nice way of doing it, is it? */
+   def_charset =  balsa_app.charset;
+   balsa_app.charset = iso_charset_names[bsmsg->charset_idx];
+   printf("sending with charset: %s\n", balsa_app.charset);
+ 
    if (balsa_send_message (message)) {
      if (bsmsg->type == SEND_REPLY || bsmsg->type == SEND_REPLY_ALL)
        {
***************
*** 1064,1069 ****
--- 1089,1096 ----
        }
    }
  
+   balsa_app.charset = def_charset;
+ 
    g_list_free (message->body_list);
    message_destroy (message);
    balsa_sendmsg_destroy (bsmsg);
***************
*** 1123,1154 ****
  
    body = body_new ();
  
!   body->buffer = gtk_editable_get_chars (GTK_EDITABLE (bsmsg->text), 0,
! 			      gtk_text_get_length (GTK_TEXT (bsmsg->text)));
  
    message->body_list = g_list_append (message->body_list, body);
  
    {				/* handle attachments */
      gint i;
      Body *abody;
!     for (i = 0; i < GNOME_ICON_LIST (bsmsg->attachments[1])->icons; i++)
!       {
! 	abody = body_new ();
! 	/* PKGW: see above about why this isn't strduped. */
! 	abody->filename = (gchar *) gnome_icon_list_get_icon_data (GNOME_ICON_LIST (bsmsg->attachments[1]), i);
! 	message->body_list = g_list_append (message->body_list, abody);
!       }
    }
  
  
-  if ((bsmsg->type == SEND_REPLY || bsmsg->type == SEND_REPLY_ALL)
-      && bsmsg->orig_message)
-    balsa_postpone_message (message, bsmsg->orig_message, 
-                            gtk_entry_get_text (
-                                GTK_ENTRY(GTK_COMBO(bsmsg->fcc[1])->entry)));
-  else
-    balsa_postpone_message (message, NULL, gtk_entry_get_text (
-        GTK_ENTRY(GTK_COMBO(bsmsg->fcc[1])->entry)));
   if (bsmsg->type == SEND_CONTINUE && bsmsg->orig_message)
     {
       message_delete (bsmsg->orig_message);
--- 1150,1185 ----
  
    body = body_new ();
  
!   body->buffer = gtk_editable_get_chars(GTK_EDITABLE (bsmsg->text), 0,
! 					gtk_text_get_length (
! 					   GTK_TEXT (bsmsg->text)));
  
    message->body_list = g_list_append (message->body_list, body);
  
    {				/* handle attachments */
      gint i;
      Body *abody;
! 
!     for (i = 0; i < GNOME_ICON_LIST (bsmsg->attachments[1])->icons; i++) {
!       abody = body_new ();
!       /* PKGW: see above about why this isn't strduped. */
!       abody->filename = (gchar *) 
! 	gnome_icon_list_get_icon_data(GNOME_ICON_LIST(bsmsg->attachments[1]),
! 				      i);
!       message->body_list = g_list_append (message->body_list, abody);
!     }
    }
+   
  
+   if ((bsmsg->type == SEND_REPLY || bsmsg->type == SEND_REPLY_ALL)
+       && bsmsg->orig_message)
+      balsa_postpone_message (message, bsmsg->orig_message, 
+ 			     gtk_entry_get_text (
+ 				GTK_ENTRY(GTK_COMBO(bsmsg->fcc[1])->entry)));
+   else
+      balsa_postpone_message (message, NULL, gtk_entry_get_text (
+ 	GTK_ENTRY(GTK_COMBO(bsmsg->fcc[1])->entry)));
  
   if (bsmsg->type == SEND_CONTINUE && bsmsg->orig_message)
     {
       message_delete (bsmsg->orig_message);
***************
*** 1251,1257 ****
  
  }
  
- 
  static gint 
  toggle_entry (GtkWidget *entry[], int pos, int cnt)
  {
--- 1282,1287 ----
***************
*** 1295,1300 ****
--- 1325,1331 ----
  /* note that hiding the entries must be done seperately */
  static void set_menus(BalsaSendmsg *msg)
  {
+    unsigned i;
     gtk_check_menu_item_set_active(
        GTK_CHECK_MENU_ITEM(view_menu[MENU_TOGGLE_TO_POS].widget), TRUE );
  
***************
*** 1320,1323 ****
        GTK_CHECK_MENU_ITEM(view_menu[MENU_TOGGLE_ATTACHMENTS_POS].widget),
        FALSE);
     toggle_entry(msg->attachments,  MENU_TOGGLE_ATTACHMENTS_POS,4); 
! }
--- 1351,1428 ----
        GTK_CHECK_MENU_ITEM(view_menu[MENU_TOGGLE_ATTACHMENTS_POS].widget),
        FALSE);
     toggle_entry(msg->attachments,  MENU_TOGGLE_ATTACHMENTS_POS,4); 
! 
!    /* this should be read from the preferences set up. If not found, 
!       set to the 0th set.
!    */
!    i = sizeof(iso_charset_names)/sizeof(iso_charset_names[0])-1;
!    while( i>0 && g_strcasecmp (iso_charset_names[i],balsa_app.charset) !=0)
!       i--;
! 
!    if(i==0) 
!       iso_font_set(msg, 1, 0);
!    else
!       gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(
! 	 iso_charset_menu[i].widget), TRUE);
!    msg->charset_idx = i;
! }
! 
! /* hardcoded charset set :
!    text is the GtkText message edit widget, code is the iso-8859 character 
!    set encoding and pos is the menu position.
!    gtk_text_set_point doesn't work.
!    gtk_text_get_point doesn't work if the cursor pointer position was changed
!    by a mouse click
! */
! 
! static gint iso_font_set(BalsaSendmsg *msg, gint code, gint idx) {
! static const char base_mask[] = 
!    "-*-fixed-medium-r-normal--14-*-*-*-c-*-iso8859";
!    GdkFont *font;
!    guint point, txt_len;
!    gchar* str;
!    /* ten extra characters for the code only is more than sufficent */
!    gchar font_name[sizeof(base_mask)+10]; 
!    
!    msg->charset_idx = idx;
! 
!    if( ! GTK_CHECK_MENU_ITEM(iso_charset_menu[idx].widget)->active)
!       return TRUE;
!    
!    g_snprintf(font_name,sizeof(font_name),"%s-%d",base_mask,code);
!    
!    if( !( font = gdk_font_load (font_name)) ) {
!       printf("Cannot find fond: %s\n", font_name);
!       return TRUE;
!    }
!    printf("loaded font with mask: %s\n", font_name);
!    gtk_text_freeze( GTK_TEXT(msg->text) );
!    point   = gtk_editable_get_position( GTK_EDITABLE(msg->text) ); 
!    txt_len = gtk_text_get_length( GTK_TEXT(msg->text) );
!    str     = gtk_editable_get_chars( GTK_EDITABLE(msg->text), 0, txt_len);
!    
!    gtk_text_set_point( GTK_TEXT(msg->text), 0);
!    gtk_text_forward_delete ( GTK_TEXT(msg->text), txt_len); 
!    
!    gtk_text_insert(GTK_TEXT(msg->text), font, NULL, NULL, str, txt_len);
!    g_free(str);
!    gtk_text_thaw( GTK_TEXT(msg->text) );
! 
!    gtk_editable_set_position( GTK_EDITABLE(msg->text), point);
!    return FALSE;
! }
! 
! static gint iso_1_cb(GtkWidget* widget, BalsaSendmsg *bsmsg)
! {return iso_font_set(bsmsg,  1, ISO_CHARSET_1_POS); }
! static gint iso_15_cb(GtkWidget* widget, BalsaSendmsg *bsmsg)
! {return iso_font_set(bsmsg, 15, ISO_CHARSET_15_POS); }
! static gint iso_2_cb(GtkWidget* widget, BalsaSendmsg *bsmsg)
! {return iso_font_set(bsmsg,  2, ISO_CHARSET_2_POS); }
! static gint iso_3_cb(GtkWidget* widget, BalsaSendmsg *bsmsg)
! {return iso_font_set(bsmsg,  3, ISO_CHARSET_3_POS); }
! static gint iso_5_cb(GtkWidget* widget, BalsaSendmsg *bsmsg)
! {return iso_font_set(bsmsg,  5, ISO_CHARSET_5_POS); }
! static gint iso_8_cb(GtkWidget* widget, BalsaSendmsg *bsmsg)
! {return iso_font_set(bsmsg,  8, ISO_CHARSET_8_POS); }
! static gint iso_9_cb(GtkWidget* widget, BalsaSendmsg *bsmsg)
! {return iso_font_set(bsmsg,  9, ISO_CHARSET_9_POS); }
Index: src/sendmsg-window.h
===================================================================
RCS file: /cvs/gnome/balsa/src/sendmsg-window.h,v
retrieving revision 1.16
diff -c -r1.16 sendmsg-window.h
*** src/sendmsg-window.h	2000/01/31 04:52:27	1.16
--- src/sendmsg-window.h	2000/02/04 09:47:52
***************
*** 1,4 ****
- 
  /* Balsa E-Mail Client
   * Copyright (C) 1998 Jay Painter and Stuart Parmenter
   *
--- 1,3 ----
***************
*** 25,56 ****
  extern "C"
  {
  #endif				/* __cplusplus */
! 
!   typedef enum
!     {
        SEND_NORMAL,
        SEND_REPLY,
        SEND_REPLY_ALL,
        SEND_FORWARD,
        SEND_CONTINUE
!     }
!   SendType;
! 
  
-   typedef struct _BalsaSendmsg BalsaSendmsg;
- 
-   struct _BalsaSendmsg
-     {
-       GtkWidget *window;
-       GtkWidget* to[3], *from[3], *subject[2], *cc[3], *bcc[3], *fcc[3];
-       GtkWidget *attachments[4];
-       GtkWidget *text;
-       Message *orig_message;
-       SendType type;
-     };
- 
    void sendmsg_window_new (GtkWidget *, Message *, SendType);
! 
  #ifdef __cplusplus
  }
  #endif				/* __cplusplus */
--- 24,56 ----
  extern "C"
  {
  #endif				/* __cplusplus */
!    
!    typedef enum
!    {
        SEND_NORMAL,
        SEND_REPLY,
        SEND_REPLY_ALL,
        SEND_FORWARD,
        SEND_CONTINUE
!    }
!    SendType;
!    
!    
!    typedef struct _BalsaSendmsg BalsaSendmsg;
!    
!    struct _BalsaSendmsg
!    {
! 	 GtkWidget *window;
! 	 GtkWidget* to[3], *from[3], *subject[2], *cc[3], *bcc[3], *fcc[3];
! 	 GtkWidget *attachments[4];
! 	 GtkWidget *text;
! 	 Message *orig_message;
! 	 SendType type;
! 	 guint charset_idx;
!    };
  
    void sendmsg_window_new (GtkWidget *, Message *, SendType);
!    
  #ifdef __cplusplus
  }
  #endif				/* __cplusplus */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]