2007-10-13 [colin] 3.0.2cvs70
authorColin Leroy <colin@colino.net>
Sat, 13 Oct 2007 08:57:29 +0000 (08:57 +0000)
committerColin Leroy <colin@colino.net>
Sat, 13 Oct 2007 08:57:29 +0000 (08:57 +0000)
* src/imap.c
* src/imap.h
* src/mainwindow.c
* src/mainwindow.h
* src/gtk/gtkutils.c
* src/gtk/gtkutils.h
Staticalise/Remove more code

ChangeLog
PATCHSETS
configure.ac
src/gtk/gtkutils.c
src/gtk/gtkutils.h
src/imap.c
src/imap.h
src/mainwindow.c
src/mainwindow.h

index 4df4f90..74ec8b2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2007-10-13 [colin]     3.0.2cvs70
+
+       * src/imap.c
+       * src/imap.h
+       * src/mainwindow.c
+       * src/mainwindow.h
+       * src/gtk/gtkutils.c
+       * src/gtk/gtkutils.h
+               Staticalise/Remove more code
+
 2007-10-13 [colin]     3.0.2cvs69
 
        * src/common/utils.c
index d5db7e0..bd354c6 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.5.2.24 -r 1.5.2.25 src/gtk/menu.c;  ) > 3.0.2cvs67.patchset
 ( cvs diff -u -r 1.115.2.171 -r 1.115.2.172 src/main.c;  cvs diff -u -r 1.7.2.13 -r 1.7.2.14 src/main.h;  ) > 3.0.2cvs68.patchset
 ( cvs diff -u -r 1.36.2.119 -r 1.36.2.120 src/common/utils.c;  cvs diff -u -r 1.20.2.53 -r 1.20.2.54 src/common/utils.h;  ) > 3.0.2cvs69.patchset
+( cvs diff -u -r 1.179.2.191 -r 1.179.2.192 src/imap.c;  cvs diff -u -r 1.34.2.17 -r 1.34.2.18 src/imap.h;  cvs diff -u -r 1.274.2.216 -r 1.274.2.217 src/mainwindow.c;  cvs diff -u -r 1.39.2.41 -r 1.39.2.42 src/mainwindow.h;  cvs diff -u -r 1.5.2.68 -r 1.5.2.69 src/gtk/gtkutils.c;  cvs diff -u -r 1.4.2.37 -r 1.4.2.38 src/gtk/gtkutils.h;  ) > 3.0.2cvs70.patchset
index 0a87523..55115a6 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=0
 MICRO_VERSION=2
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=69
+EXTRA_VERSION=70
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index a86950c..3ffa0d7 100644 (file)
@@ -206,107 +206,6 @@ void gtkut_stock_with_text_button_set_create(GtkWidget **bbox,
        }
 }
 
-static void combo_button_size_request(GtkWidget *widget,
-                                     GtkRequisition *requisition,
-                                     gpointer data)
-{
-       ComboButton *combo = (ComboButton *)data;
-
-       if (combo->arrow->allocation.height != requisition->height)
-               gtk_widget_set_size_request(combo->arrow,
-                                           -1, requisition->height);
-}
-
-static void combo_button_enter(GtkWidget *widget, gpointer data)
-{
-       ComboButton *combo = (ComboButton *)data;
-
-       if (GTK_WIDGET_STATE(combo->arrow) != GTK_STATE_PRELIGHT) {
-               gtk_widget_set_state(combo->arrow, GTK_STATE_PRELIGHT);
-               gtk_widget_queue_draw(combo->arrow);
-       }
-       if (GTK_WIDGET_STATE(combo->button) != GTK_STATE_PRELIGHT) {
-               gtk_widget_set_state(combo->button, GTK_STATE_PRELIGHT);
-               gtk_widget_queue_draw(combo->button);
-       }
-}
-
-static void combo_button_leave(GtkWidget *widget, gpointer data)
-{
-       ComboButton *combo = (ComboButton *)data;
-
-       if (GTK_WIDGET_STATE(combo->arrow) != GTK_STATE_NORMAL) {
-               gtk_widget_set_state(combo->arrow, GTK_STATE_NORMAL);
-               gtk_widget_queue_draw(combo->arrow);
-       }
-       if (GTK_WIDGET_STATE(combo->button) != GTK_STATE_NORMAL) {
-               gtk_widget_set_state(combo->button, GTK_STATE_NORMAL);
-               gtk_widget_queue_draw(combo->button);
-       }
-}
-
-static gint combo_button_arrow_pressed(GtkWidget *widget, GdkEventButton *event,
-                                      gpointer data)
-{
-       ComboButton *combo = (ComboButton *)data;
-
-       if (!event) return FALSE;
-
-       gtk_menu_popup(GTK_MENU(combo->menu), NULL, NULL,
-                      menu_button_position, combo->button,
-                      event->button, event->time);
-
-       return FALSE;
-}
-
-static void combo_button_destroy(GtkWidget *widget, gpointer data)
-{
-       ComboButton *combo = (ComboButton *)data;
-
-       gtk_object_destroy(GTK_OBJECT(combo->factory));
-       g_free(combo);
-}
-
-ComboButton *gtkut_combo_button_create(GtkWidget *button,
-                                      GtkItemFactoryEntry *entries,
-                                      gint n_entries, const gchar *path,
-                                      gpointer data)
-{
-       ComboButton *combo;
-       GtkWidget *arrow;
-
-       combo = g_new0(ComboButton, 1);
-
-       combo->arrow = gtk_button_new();
-       arrow = gtk_arrow_new(GTK_ARROW_DOWN, GTK_SHADOW_OUT);
-       gtk_widget_set_size_request(arrow, 7, -1);
-       gtk_container_add(GTK_CONTAINER(combo->arrow), arrow);
-       GTK_WIDGET_UNSET_FLAGS(combo->arrow, GTK_CAN_FOCUS);
-       gtk_widget_show_all(combo->arrow);
-
-       combo->button = button;
-       combo->menu = menu_create_items(entries, n_entries, path,
-                                       &combo->factory, data);
-       combo->data = data;
-
-       g_signal_connect(G_OBJECT(combo->button), "size_request",
-                        G_CALLBACK(combo_button_size_request), combo);
-       g_signal_connect(G_OBJECT(combo->button), "enter",
-                        G_CALLBACK(combo_button_enter), combo);
-       g_signal_connect(G_OBJECT(combo->button), "leave",
-                        G_CALLBACK(combo_button_leave), combo);
-       g_signal_connect(G_OBJECT(combo->arrow), "enter",
-                        G_CALLBACK(combo_button_enter), combo);
-       g_signal_connect(G_OBJECT(combo->arrow), "leave",
-                        G_CALLBACK(combo_button_leave), combo);
-       g_signal_connect(G_OBJECT(combo->arrow), "button_press_event",
-                        G_CALLBACK(combo_button_arrow_pressed), combo);
-       g_signal_connect(G_OBJECT(combo->arrow), "destroy",
-                        G_CALLBACK(combo_button_destroy), combo);
-
-       return combo;
-}
-
 #define CELL_SPACING 1
 #define ROW_TOP_YPIXEL(clist, row) (((clist)->row_height * (row)) + \
                                    (((row) + 1) * CELL_SPACING) + \
@@ -492,43 +391,12 @@ void gtkut_combo_set_items(GtkCombo *combo, const gchar *str1, ...)
        g_list_free(combo_items);
 }
 
-gchar *gtkut_editable_get_selection(GtkEditable *editable)
-{
-       guint start_pos, end_pos;
-       gboolean found;
-
-       g_return_val_if_fail(GTK_IS_EDITABLE(editable), NULL);
-
-       found = gtk_editable_get_selection_bounds(editable,
-                                                 &start_pos, &end_pos);
-       if (found)
-               return gtk_editable_get_chars(editable, start_pos, end_pos);
-       else
-               return NULL;
-}
-
-void gtkut_editable_disable_im(GtkEditable *editable)
-{
-       g_return_if_fail(editable != NULL);
-
-#if USE_XIM
-       if (editable->ic) {
-               gdk_ic_destroy(editable->ic);
-               editable->ic = NULL;
-       }
-       if (editable->ic_attr) {
-               gdk_ic_attr_destroy(editable->ic_attr);
-               editable->ic_attr = NULL;
-       }
-#endif
-}
-
 void gtkut_container_remove(GtkContainer *container, GtkWidget *widget)
 {
        gtk_container_remove(container, widget);
 }
 
-gboolean gtkut_text_buffer_match_string(GtkTextBuffer *textbuf,
+static gboolean gtkut_text_buffer_match_string(GtkTextBuffer *textbuf,
                                        const GtkTextIter *iter,
                                        gunichar *wcs, gint len,
                                        gboolean case_sens)
@@ -574,7 +442,7 @@ gboolean gtkut_text_buffer_match_string(GtkTextBuffer *textbuf,
                return FALSE;
 }
 
-gboolean gtkut_text_buffer_find(GtkTextBuffer *buffer, const GtkTextIter *iter,
+static gboolean gtkut_text_buffer_find(GtkTextBuffer *buffer, const GtkTextIter *iter,
                                const gchar *str, gboolean case_sens,
                                GtkTextIter *match_pos)
 {
@@ -609,7 +477,7 @@ gboolean gtkut_text_buffer_find(GtkTextBuffer *buffer, const GtkTextIter *iter,
        return found;
 }
 
-gboolean gtkut_text_buffer_find_backward(GtkTextBuffer *buffer,
+static gboolean gtkut_text_buffer_find_backward(GtkTextBuffer *buffer,
                                         const GtkTextIter *iter,
                                         const gchar *str, gboolean case_sens,
                                         GtkTextIter *match_pos)
@@ -1655,7 +1523,7 @@ GtkWidget *gtkut_window_new               (GtkWindowType   type,
        return window;
 }
 
-gboolean gtkut_tree_iter_comp(GtkTreeModel *model, 
+static gboolean gtkut_tree_iter_comp(GtkTreeModel *model, 
                                     GtkTreeIter *iter1, 
                                     GtkTreeIter *iter2)
 {
index 4a810e6..240eb4e 100644 (file)
@@ -125,12 +125,6 @@ void gtkut_stock_with_text_button_set_create(GtkWidget **bbox,
                                   GtkWidget **button2, const gchar *label2, const gchar *text2,
                                   GtkWidget **button3, const gchar *label3, const gchar *text3);
 
-ComboButton *gtkut_combo_button_create (GtkWidget              *button,
-                                        GtkItemFactoryEntry    *entries,
-                                        gint                    n_entries,
-                                        const gchar            *path,
-                                        gpointer                data);
-
 void gtkut_ctree_node_move_if_on_the_edge
                                        (GtkCTree       *ctree,
                                         GtkCTreeNode   *node,
@@ -159,28 +153,9 @@ void gtkut_clist_set_focus_row             (GtkCList       *clist,
 void gtkut_combo_set_items             (GtkCombo       *combo,
                                         const gchar    *str1, ...);
 
-gchar *gtkut_editable_get_selection    (GtkEditable    *editable);
-void gtkut_editable_disable_im         (GtkEditable    *editable);
-
 void gtkut_container_remove            (GtkContainer   *container,
                                         GtkWidget      *widget);
 
-gboolean gtkut_text_buffer_match_string        (GtkTextBuffer          *buffer,
-                                        const GtkTextIter      *iter,
-                                        gunichar               *wcs,
-                                        gint                    len,
-                                        gboolean                case_sens);
-gboolean gtkut_text_buffer_find                (GtkTextBuffer          *buffer,
-                                        const GtkTextIter      *iter,
-                                        const gchar            *str,
-                                        gboolean                case_sens,
-                                        GtkTextIter            *match_pos);
-gboolean gtkut_text_buffer_find_backward(GtkTextBuffer         *buffer,
-                                        const GtkTextIter      *iter,
-                                        const gchar            *str,
-                                        gboolean                case_sens,
-                                        GtkTextIter            *match_pos);
-
 gchar *gtkut_text_view_get_selection   (GtkTextView    *textview);
 void gtkut_text_view_set_position              (GtkTextView *text, gint pos);
 gboolean gtkut_text_view_search_string (GtkTextView *text, const gchar *str,
@@ -245,10 +220,6 @@ gboolean gtkut_tree_model_text_iter_prev(GtkTreeModel *model,
 gboolean gtkut_tree_model_get_iter_last(GtkTreeModel *model,
                                 GtkTreeIter *iter);
 
-gboolean gtkut_tree_iter_comp(GtkTreeModel *model, 
-                                    GtkTreeIter *iter1, 
-                                    GtkTreeIter *iter2);
-
 gint gtkut_list_view_get_selected_row(GtkWidget *list_view);
 gboolean gtkut_list_view_select_row(GtkWidget *list, gint row);
 
index a2c0137..03530c5 100644 (file)
@@ -1740,7 +1740,7 @@ static gint imap_close(Folder *folder, FolderItem *item)
        return 0;
 }
 
-gint imap_scan_tree_real(Folder *folder, gboolean subs_only)
+static gint imap_scan_tree_real(Folder *folder, gboolean subs_only)
 {
        FolderItem *item = NULL;
        IMAPSession *session;
@@ -5070,11 +5070,6 @@ void imap_disconnect_all(void)
 {
 }
 
-gint imap_scan_tree_real(Folder *folder, gboolean subs_only)
-{
-       return -1;
-}
-
 gint imap_subscribe(Folder *folder, FolderItem *item, gchar *rpath, gboolean sub)
 {
        return -1;
index 08d588d..dbcf063 100644 (file)
@@ -36,7 +36,6 @@ void imap_folder_ref(Folder *folder);
 void imap_folder_unref(Folder *folder);
 gchar imap_get_path_separator_for_item (FolderItem *item);
 void imap_disconnect_all(void);
-gint imap_scan_tree_real(Folder *folder, gboolean subs_only);
 gint imap_subscribe(Folder *folder, FolderItem *item, gchar *rpath, gboolean sub);
 GList *imap_scan_subtree(Folder *folder, FolderItem *item, gboolean unsubs_only, gboolean recursive);
 void imap_cache_msg(FolderItem *item, gint msgnum);
index cf65fe9..3bc0368 100644 (file)
@@ -1336,6 +1336,65 @@ void mainwindow_clear_error(MainWindow *mainwin)
        gtk_widget_hide(mainwin->warning_btn);
 }
 
+#define BREAK_ON_MODIFIER_KEY() \
+       if ((event->state & (GDK_MOD1_MASK|GDK_CONTROL_MASK)) != 0) break
+
+static gboolean mainwindow_key_pressed (GtkWidget *widget, GdkEventKey *event,
+                                   gpointer data)
+{
+       MainWindow *mainwin = (MainWindow*) data;
+       
+       if (!mainwin || !event) 
+               return FALSE;
+
+       if (quicksearch_has_focus(mainwin->summaryview->quicksearch))
+       {
+               lastkey = event->keyval;
+               return FALSE;
+       }
+
+       switch (event->keyval) {
+       case GDK_Q:             /* Quit */
+               BREAK_ON_MODIFIER_KEY();
+
+               app_exit_cb(mainwin, 0, NULL);
+               return FALSE;
+       case GDK_space:
+               if (mainwin->folderview && mainwin->summaryview
+                   && ((!mainwin->summaryview->displayed
+                       && !mainwin->summaryview->selected) 
+                       || (mainwin->summaryview->folder_item
+                           && mainwin->summaryview->folder_item->total_msgs == 0))) {
+                       g_signal_stop_emission_by_name(G_OBJECT(widget), 
+                                       "key_press_event");
+                       folderview_select_next_unread(mainwin->folderview, TRUE);
+               }
+               break;
+#ifdef MAEMO
+       case GDK_F6:
+               if (maemo_mainwindow_is_fullscreen(widget)) {
+                       gtk_window_unfullscreen(GTK_WINDOW(widget));
+                } else {
+                       gtk_window_fullscreen(GTK_WINDOW(widget));
+                }
+               break;
+       case GDK_Escape:
+               if (mainwin->summaryview && 
+                   mainwin->summaryview->ext_messageview && 
+                   mainwin->summaryview->ext_messageview->window && 
+                   widget == mainwin->summaryview->ext_messageview->window) {
+                       messageview_destroy(mainwin->summaryview->ext_messageview);
+               }
+               break;
+#endif
+       default:
+               break;
+       }
+       return FALSE;
+}
+
+#undef BREAK_ON_MODIFIER_KEY
+
 MainWindow *main_window_create()
 {
        MainWindow *mainwin;
@@ -1776,13 +1835,6 @@ MainWindow *main_window_create()
        return mainwin;
 }
 
-void main_window_destroy(MainWindow *mainwin)
-{
-       /* TODO : destroy other component */
-       messageview_destroy(mainwin->messageview);
-       mainwin->messageview = NULL;    
-}
-
 void main_window_update_actions_menu(MainWindow *mainwin)
 {
        GtkItemFactory *ifactory;
@@ -2394,16 +2446,6 @@ void main_window_progress_off(MainWindow *mainwin)
        gtk_progress_bar_set_text(GTK_PROGRESS_BAR(mainwin->progressbar), "");
 }
 
-void main_window_progress_set(MainWindow *mainwin, gint cur, gint total)
-{
-       gchar buf[32];
-
-       g_snprintf(buf, sizeof(buf), "%d / %d", cur, total);
-       gtk_progress_bar_set_text(GTK_PROGRESS_BAR(mainwin->progressbar), buf);
-       gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(mainwin->progressbar),
-                               (total == 0) ? 0 : (gfloat)cur / (gfloat)total);
-}
-
 void main_window_empty_trash(MainWindow *mainwin, gboolean confirm)
 {
        if (confirm && procmsg_have_trashed_mails_fast()) {
@@ -2422,7 +2464,7 @@ void main_window_empty_trash(MainWindow *mainwin, gboolean confirm)
                gtk_widget_grab_focus(mainwin->folderview->ctree);
 }
 
-void main_window_add_mailbox(MainWindow *mainwin)
+static void main_window_add_mailbox(MainWindow *mainwin)
 {
        gchar *path;
        Folder *folder;
@@ -4323,65 +4365,6 @@ gboolean mainwindow_is_obscured(void)
        return is_obscured;
 }
 
-#define BREAK_ON_MODIFIER_KEY() \
-       if ((event->state & (GDK_MOD1_MASK|GDK_CONTROL_MASK)) != 0) break
-
-gboolean mainwindow_key_pressed (GtkWidget *widget, GdkEventKey *event,
-                                   gpointer data)
-{
-       MainWindow *mainwin = (MainWindow*) data;
-       
-       if (!mainwin || !event) 
-               return FALSE;
-
-       if (quicksearch_has_focus(mainwin->summaryview->quicksearch))
-       {
-               lastkey = event->keyval;
-               return FALSE;
-       }
-
-       switch (event->keyval) {
-       case GDK_Q:             /* Quit */
-               BREAK_ON_MODIFIER_KEY();
-
-               app_exit_cb(mainwin, 0, NULL);
-               return FALSE;
-       case GDK_space:
-               if (mainwin->folderview && mainwin->summaryview
-                   && ((!mainwin->summaryview->displayed
-                       && !mainwin->summaryview->selected) 
-                       || (mainwin->summaryview->folder_item
-                           && mainwin->summaryview->folder_item->total_msgs == 0))) {
-                       g_signal_stop_emission_by_name(G_OBJECT(widget), 
-                                       "key_press_event");
-                       folderview_select_next_unread(mainwin->folderview, TRUE);
-               }
-               break;
-#ifdef MAEMO
-       case GDK_F6:
-               if (maemo_mainwindow_is_fullscreen(widget)) {
-                       gtk_window_unfullscreen(GTK_WINDOW(widget));
-                } else {
-                       gtk_window_fullscreen(GTK_WINDOW(widget));
-                }
-               break;
-       case GDK_Escape:
-               if (mainwin->summaryview && 
-                   mainwin->summaryview->ext_messageview && 
-                   mainwin->summaryview->ext_messageview->window && 
-                   widget == mainwin->summaryview->ext_messageview->window) {
-                       messageview_destroy(mainwin->summaryview->ext_messageview);
-               }
-               break;
-#endif
-       default:
-               break;
-       }
-       return FALSE;
-}
-
-#undef BREAK_ON_MODIFIER_KEY
-
 /*
  * Harvest addresses for selected folder.
  */
index 268979d..07427fa 100644 (file)
@@ -141,8 +141,6 @@ struct _MainWindow
 
 MainWindow *main_window_create         (void);
 
-void main_window_destroy                (MainWindow *mainwin);
-
 void main_window_update_actions_menu   (MainWindow     *mainwin);
 
 void main_window_cursor_wait           (MainWindow     *mainwin);
@@ -172,13 +170,8 @@ void main_window_get_position              (MainWindow     *mainwin);
 
 void main_window_progress_on           (MainWindow     *mainwin);
 void main_window_progress_off          (MainWindow     *mainwin);
-void main_window_progress_set          (MainWindow     *mainwin,
-                                        gint            cur,
-                                        gint            total);
-
 void main_window_empty_trash           (MainWindow     *mainwin,
                                         gboolean        confirm);
-void main_window_add_mailbox           (MainWindow     *mainwin);
 
 void main_window_set_menu_sensitive    (MainWindow     *mainwin);
 
@@ -197,10 +190,6 @@ void main_window_toggle_work_offline          (MainWindow        *mainwin,
                                                gboolean           offline,
                                               gboolean           ask_sync);
 
-/* public so it can be disabled from summaryview */
-gboolean mainwindow_key_pressed                      (GtkWidget         *widget, 
-                                              GdkEventKey       *event,
-                                              gpointer           data);
 MainWindow *mainwindow_get_mainwindow        (void);
 void mainwindow_learn                        (MainWindow *mainwin,
                                               gboolean is_spam);