hi my next rename patch : libtinymailui-gtk/tny-msg* -> libtinymailui-gtk/tny-gtk-msg* have fun thi
Index: tny-gtk-msg-view.h =================================================================== --- tny-gtk-msg-view.h (Revision 855) +++ tny-gtk-msg-view.h (Arbeitskopie) @@ -1,5 +1,5 @@ -#ifndef TNY_MSG_VIEW_H -#define TNY_MSG_VIEW_H +#ifndef TNY_GTK_MSG_VIEW_H +#define TNY_GTK_MSG_VIEW_H /* libtinymailui-gtk - The Tiny Mail UI library for Gtk+ * Copyright (C) 2006-2007 Philip Van Hoof <pvanhoof gnome org> @@ -32,29 +32,29 @@ G_BEGIN_DECLS -#define TNY_TYPE_MSG_VIEW (tny_msg_view_get_type ()) -#define TNY_MSG_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TNY_TYPE_MSG_VIEW, TnyMsgView)) -#define TNY_MSG_VIEW_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), TNY_TYPE_MSG_VIEW, TnyMsgViewClass)) -#define TNY_IS_MSG_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TNY_TYPE_MSG_VIEW)) -#define TNY_IS_MSG_VIEW_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), TNY_TYPE_MSG_VIEW)) -#define TNY_MSG_VIEW_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), TNY_TYPE_MSG_VIEW, TnyMsgViewClass)) +#define TNY_TYPE_GTK_MSG_VIEW (tny_gtk_msg_view_get_type ()) +#define TNY_GTK_MSG_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TNY_TYPE_GTK_MSG_VIEW, TnyGtkMsgView)) +#define TNY_GTK_MSG_VIEW_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), TNY_TYPE_GTK_MSG_VIEW, TnyGtkMsgViewClass)) +#define TNY_IS_GTK_MSG_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TNY_TYPE_GTK_MSG_VIEW)) +#define TNY_IS_GTK_MSG_VIEW_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), TNY_TYPE_GTK_MSG_VIEW)) +#define TNY_GTK_MSG_VIEW_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), TNY_TYPE_GTK_MSG_VIEW, TnyGtkMsgViewClass)) -typedef struct _TnyMsgView TnyMsgView; -typedef struct _TnyMsgViewClass TnyMsgViewClass; +typedef struct _TnyGtkMsgView TnyGtkMsgView; +typedef struct _TnyGtkMsgViewClass TnyGtkMsgViewClass; -struct _TnyMsgView +struct _TnyGtkMsgView { GtkScrolledWindow parent; }; -struct _TnyMsgViewClass +struct _TnyGtkMsgViewClass { GtkScrolledWindowClass parent_class; }; -GType tny_msg_view_get_type (void); -TnyMsgView* tny_msg_view_new (TnySaveStrategyIface *save_strategy); +GType tny_gtk_msg_view_get_type (void); +TnyGtkMsgView* tny_gtk_msg_view_new (TnySaveStrategyIface *save_strategy); G_END_DECLS Index: tny-msg-window.c =================================================================== --- tny-msg-window.c (Revision 855) +++ tny-msg-window.c (Arbeitskopie) @@ -1,200 +0,0 @@ -/* libtinymailui-gtk - The Tiny Mail UI library for Gtk+ - * Copyright (C) 2006-2007 Philip Van Hoof <pvanhoof gnome org> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with self library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include <config.h> - -#include <tny-msg-window.h> -#include <tny-msg-view-iface.h> - -static GObjectClass *parent_class = NULL; - -typedef struct _TnyMsgWindowPriv TnyMsgWindowPriv; - -struct _TnyMsgWindowPriv -{ - TnyMsgViewIface *msg_view; -}; - -#define TNY_MSG_WINDOW_GET_PRIVATE(o) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((o), TNY_TYPE_MSG_WINDOW, TnyMsgWindowPriv)) - - -static void -tny_msg_window_set_save_strategy (TnyMsgViewIface *self, TnySaveStrategyIface *strategy) -{ - TnyMsgWindowPriv *priv = TNY_MSG_WINDOW_GET_PRIVATE (self); - - tny_msg_view_iface_set_save_strategy (priv->msg_view, strategy); - - return; -} - -static void -tny_msg_window_set_unavailable (TnyMsgViewIface *self) -{ - TnyMsgWindowPriv *priv = TNY_MSG_WINDOW_GET_PRIVATE (self); - - tny_msg_view_iface_set_unavailable (priv->msg_view); - - return; -} - - -static void -tny_msg_window_set_msg (TnyMsgViewIface *self, TnyMsgIface *msg) -{ - TnyMsgWindowPriv *priv = TNY_MSG_WINDOW_GET_PRIVATE (self); - TnyHeaderIface *header = TNY_HEADER_IFACE (tny_msg_iface_get_header (msg)); - - tny_msg_view_iface_set_msg (priv->msg_view, msg); - - gtk_window_set_title (GTK_WINDOW (self), tny_header_iface_get_subject (header)); - - g_object_unref (G_OBJECT (header)); - - return; -} - -/** - * tny_msg_window_new: - * - * - * Return value: a new #TnyMsgWindowIface instance implemented for Gtk+ - **/ -TnyMsgWindow* -tny_msg_window_new (TnyMsgViewIface *msgview) -{ - TnyMsgWindow *self = g_object_new (TNY_TYPE_MSG_WINDOW, NULL); - TnyMsgWindowPriv *priv = TNY_MSG_WINDOW_GET_PRIVATE (self); - - if (G_UNLIKELY (priv->msg_view)) - gtk_container_remove (GTK_CONTAINER (self), GTK_WIDGET (priv->msg_view)); - - priv->msg_view = msgview; - - /* This adds a reference to msgview (it's a gtkwidget) */ - gtk_container_add (GTK_CONTAINER (self), GTK_WIDGET (priv->msg_view)); - gtk_widget_show (GTK_WIDGET (priv->msg_view)); - - return self; -} - -static void -tny_msg_window_instance_init (GTypeInstance *instance, gpointer g_class) -{ - TnyMsgWindow *self = (TnyMsgWindow *)instance; - - gtk_window_set_default_size (GTK_WINDOW (self), 640, 480); - - return; -} - -static void -tny_msg_window_finalize (GObject *object) -{ - /* Finalization of a GtkWidet removes references */ - - (*parent_class->finalize) (object); - - return; -} - -static void -tny_msg_window_iface_init (gpointer g_iface, gpointer iface_data) -{ - return; -} - - -static void -tny_msg_view_iface_init (gpointer g_iface, gpointer iface_data) -{ - TnyMsgViewIfaceClass *klass = (TnyMsgViewIfaceClass *)g_iface; - - klass->set_msg_func = tny_msg_window_set_msg; - klass->set_save_strategy_func = tny_msg_window_set_save_strategy; - klass->set_unavailable_func = tny_msg_window_set_unavailable; - - return; -} - -static void -tny_msg_window_class_init (TnyMsgWindowClass *class) -{ - GObjectClass *object_class; - - parent_class = g_type_class_peek_parent (class); - object_class = (GObjectClass*) class; - - object_class->finalize = tny_msg_window_finalize; - - g_type_class_add_private (object_class, sizeof (TnyMsgWindowPriv)); - - return; -} - -GType -tny_msg_window_get_type (void) -{ - static GType type = 0; - - if (G_UNLIKELY(type == 0)) - { - static const GTypeInfo info = - { - sizeof (TnyMsgWindowClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) tny_msg_window_class_init, /* class_init */ - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (TnyMsgWindow), - 0, /* n_preallocs */ - tny_msg_window_instance_init, /* instance_init */ - NULL - }; - - static const GInterfaceInfo tny_msg_window_iface_info = - { - (GInterfaceInitFunc) tny_msg_window_iface_init, /* interface_init */ - NULL, /* interface_finalize */ - NULL /* interface_data */ - }; - - static const GInterfaceInfo tny_msg_view_iface_info = - { - (GInterfaceInitFunc) tny_msg_view_iface_init, /* interface_init */ - NULL, /* interface_finalize */ - NULL /* interface_data */ - }; - - type = g_type_register_static (GTK_TYPE_WINDOW, - "TnyMsgWindow", - &info, 0); - - g_type_add_interface_static (type, TNY_TYPE_MSG_VIEW_IFACE, - &tny_msg_view_iface_info); - - g_type_add_interface_static (type, TNY_TYPE_MSG_WINDOW_IFACE, - &tny_msg_window_iface_info); - - } - - return type; -} Index: tny-msg-view.c =================================================================== --- tny-msg-view.c (Revision 855) +++ tny-msg-view.c (Arbeitskopie) @@ -1,455 +0,0 @@ -/* libtinymailui-gtk - The Tiny Mail UI library for Gtk+ - * Copyright (C) 2006-2007 Philip Van Hoof <pvanhoof gnome org> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with self library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include <config.h> - -#include <glib/gi18n-lib.h> - -#include <unistd.h> -#include <fcntl.h> -#include <stdio.h> -#include <stdlib.h> -#include <sys/stat.h> -#include <sys/types.h> - -#include <string.h> -#include <gtk/gtk.h> - -#include <tny-list-iface.h> -#include <tny-iterator-iface.h> - -#include <tny-msg-view.h> -#include <tny-text-buffer-stream.h> -#include <tny-attach-list-model.h> -#include <tny-header-view-iface.h> -#include <tny-header-view.h> - -#ifdef GNOME -#include <tny-vfs-stream.h> -#include <libgnomevfs/gnome-vfs.h> -#include <libgnomevfs/gnome-vfs-utils.h> -#else -#include <tny-fs-stream.h> -#endif - -#include "tny-attach-list-model-priv.h" - -static GObjectClass *parent_class = NULL; - -typedef struct _TnyMsgViewPriv TnyMsgViewPriv; - -struct _TnyMsgViewPriv -{ - TnyMsgIface *msg; - GtkTextView *textview; - TnyHeaderViewIface *headerview; - GtkIconView *attachview; - GtkWidget *attachview_sw; - TnySaveStrategyIface *save_strategy; -}; - -#define TNY_MSG_VIEW_GET_PRIVATE(o) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((o), TNY_TYPE_MSG_VIEW, TnyMsgViewPriv)) - -static void -reload_msg (TnyMsgViewIface *self) -{ - TnyMsgViewPriv *priv = TNY_MSG_VIEW_GET_PRIVATE (self); - GtkTextBuffer *buffer; - TnyStreamIface *dest; - TnyHeaderIface *header; - TnyIteratorIface *iterator; - gboolean first_attach = TRUE; - TnyAttachListModel *model; - - g_return_if_fail (TNY_IS_MSG_IFACE (priv->msg)); - - header = TNY_HEADER_IFACE (tny_msg_iface_get_header (priv->msg)); - g_return_if_fail (TNY_IS_HEADER_IFACE (header)); - tny_header_view_iface_set_header (priv->headerview, header); - g_object_unref (G_OBJECT (header)); - - buffer = gtk_text_view_get_buffer (priv->textview); - dest = TNY_STREAM_IFACE (tny_text_buffer_stream_new (buffer)); - - model = tny_attach_list_model_new (); - tny_msg_iface_get_parts (priv->msg, TNY_LIST_IFACE (model)); - iterator = tny_list_iface_create_iterator (TNY_LIST_IFACE (model)); - - gtk_widget_hide (priv->attachview_sw); - gtk_text_buffer_set_text (buffer, "", 0); - - - gtk_widget_show (GTK_WIDGET (priv->headerview)); - - while (!tny_iterator_iface_is_done (iterator)) - { - TnyMimePartIface *part = (TnyMimePartIface*)tny_iterator_iface_current (iterator); - - if (G_LIKELY (tny_mime_part_iface_content_type_is (part, "text/*"))) - { - tny_stream_iface_reset (dest); - tny_mime_part_iface_write_to_stream (part, dest); - tny_stream_iface_reset (dest); - - } else if (tny_mime_part_iface_get_content_type (part) && - tny_mime_part_iface_is_attachment (part)) - { - first_attach = FALSE; - } - - g_object_unref (G_OBJECT(part)); - tny_iterator_iface_next (iterator); - } - - g_object_unref (G_OBJECT (iterator)); - - - if (G_LIKELY (!first_attach)) - { - gtk_icon_view_set_model (priv->attachview, GTK_TREE_MODEL (model)); - gtk_widget_show (priv->attachview_sw); - } - - g_object_unref (G_OBJECT (model)); - - return; -} - -void -tny_msg_view_set_save_strategy (TnyMsgViewIface *self, TnySaveStrategyIface *strategy) -{ - TnyMsgViewPriv *priv = TNY_MSG_VIEW_GET_PRIVATE (self); - - if (priv->save_strategy) - g_object_unref (G_OBJECT (priv->save_strategy)); - - g_object_ref (G_OBJECT (strategy)); - priv->save_strategy = strategy; - - return; -} - - -static void -for_each_selected_attachment (GtkIconView *icon_view, GtkTreePath *path, gpointer user_data) -{ - TnyMsgView *self = user_data; - TnyMsgViewPriv *priv = TNY_MSG_VIEW_GET_PRIVATE (self); - GtkTreeModel *model = gtk_icon_view_get_model (icon_view); - GtkTreeIter iter; - - if (!G_LIKELY (priv->save_strategy)) - { - g_warning (_("No save strategy for this message view\n")); - return; - } - - if (G_LIKELY (gtk_tree_model_get_iter(model, &iter, path))) - { - TnyMimePartIface *part; - - gtk_tree_model_get (model, &iter, - TNY_ATTACH_LIST_MODEL_INSTANCE_COLUMN, - &part, -1); - - if (G_LIKELY (part)) - tny_save_strategy_iface_save (priv->save_strategy, part); - - } - - return; -} - - -static void -tny_msg_view_save_as_activated (GtkMenuItem *menuitem, gpointer user_data) -{ - TnyMsgView *self = user_data; - TnyMsgViewPriv *priv = TNY_MSG_VIEW_GET_PRIVATE (self); - - if (!G_LIKELY (priv->save_strategy)) - { - g_warning (_("No save strategy for this message view\n")); - return; - } - - gtk_icon_view_selected_foreach (priv->attachview, - for_each_selected_attachment, self); - - return; -} - - - -static gint -tny_msg_view_popup_handler (GtkWidget *widget, GdkEvent *event) -{ - g_return_val_if_fail (event != NULL, FALSE); - - - if (G_UNLIKELY (event->type == GDK_BUTTON_PRESS)) - { - GtkMenu *menu; - GdkEventButton *event_button; - - menu = GTK_MENU (widget); - g_return_val_if_fail (widget != NULL, FALSE); - g_return_val_if_fail (GTK_IS_MENU (widget), FALSE); - - event_button = (GdkEventButton *) event; - if (G_LIKELY (event_button->button == 3)) - { - gtk_menu_popup (menu, NULL, NULL, NULL, NULL, - event_button->button, event_button->time); - return TRUE; - } - } - - return FALSE; -} - -static void -tny_msg_view_set_unavailable (TnyMsgViewIface *self) -{ - TnyMsgViewPriv *priv = TNY_MSG_VIEW_GET_PRIVATE (self); - GtkTextBuffer *buffer; - - if (G_LIKELY (priv->msg)) - { - g_object_unref (G_OBJECT (priv->msg)); - priv->msg = NULL; - } - - buffer = gtk_text_view_get_buffer (priv->textview); - gtk_widget_hide (priv->attachview_sw); - gtk_text_buffer_set_text (buffer, _("Message is unavailable"), -1); - - tny_header_view_iface_clear (priv->headerview); - gtk_widget_hide (GTK_WIDGET (priv->headerview)); - - return; -} - -static void -tny_msg_view_set_msg (TnyMsgViewIface *self, TnyMsgIface *msg) -{ - TnyMsgViewPriv *priv = TNY_MSG_VIEW_GET_PRIVATE (self); - - if (G_LIKELY (priv->msg)) - g_object_unref (G_OBJECT (priv->msg)); - - if (msg) - { - g_object_ref (G_OBJECT (msg)); - priv->msg = msg; - reload_msg (self); - } - - return; -} - -static void -tny_msg_view_clear (TnyMsgViewIface *self) -{ - TnyMsgViewPriv *priv = TNY_MSG_VIEW_GET_PRIVATE (self); - - GtkTextBuffer *buffer = gtk_text_view_get_buffer (priv->textview); - gtk_widget_hide (priv->attachview_sw); - gtk_text_buffer_set_text (buffer, "", 0); - tny_header_view_iface_set_header (priv->headerview, NULL); - gtk_widget_hide (GTK_WIDGET (priv->headerview)); - - return; -} - -/** - * tny_msg_view_new: - * @save_strategy: The save strategy to use - * - * Return value: a new #TnyMsgViewIface instance implemented for Gtk+ - **/ -TnyMsgView* -tny_msg_view_new (TnySaveStrategyIface *save_strategy) -{ - TnyMsgView *self = g_object_new (TNY_TYPE_MSG_VIEW, NULL); - - tny_msg_view_iface_set_save_strategy (TNY_MSG_VIEW_IFACE (self), save_strategy); - - return self; -} - -static void -tny_msg_view_instance_init (GTypeInstance *instance, gpointer g_class) -{ - TnyMsgView *self = (TnyMsgView *)instance; - TnyMsgViewPriv *priv = TNY_MSG_VIEW_GET_PRIVATE (self); - GtkWidget *vbox = gtk_vbox_new (FALSE, 1); - GtkMenu *menu = GTK_MENU (gtk_menu_new ()); - GtkWidget *mitem = gtk_menu_item_new_with_mnemonic ("Save _As"); - - priv->save_strategy = NULL; - - gtk_scrolled_window_set_hadjustment (GTK_SCROLLED_WINDOW (self), NULL); - gtk_scrolled_window_set_vadjustment (GTK_SCROLLED_WINDOW (self), NULL); - - gtk_widget_show (mitem); - - g_signal_connect (G_OBJECT (mitem), "activate", - G_CALLBACK (tny_msg_view_save_as_activated), self); - - gtk_menu_shell_append (GTK_MENU_SHELL (menu), mitem); - - priv->attachview_sw = gtk_scrolled_window_new (NULL, NULL); - - gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (self), - GTK_SHADOW_NONE); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (self), - GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (priv->attachview_sw), - GTK_SHADOW_NONE); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->attachview_sw), - GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); - - priv->attachview = GTK_ICON_VIEW (gtk_icon_view_new ()); - - gtk_icon_view_set_selection_mode (priv->attachview, GTK_SELECTION_SINGLE); - - g_signal_connect_swapped (G_OBJECT (priv->attachview), "button_press_event", - G_CALLBACK (tny_msg_view_popup_handler), menu); - - gtk_icon_view_set_text_column (priv->attachview, - TNY_ATTACH_LIST_MODEL_FILENAME_COLUMN); - - gtk_icon_view_set_pixbuf_column (priv->attachview, - TNY_ATTACH_LIST_MODEL_PIXBUF_COLUMN); - - gtk_icon_view_set_columns (priv->attachview, -1); - gtk_icon_view_set_item_width (priv->attachview, 100); - gtk_icon_view_set_column_spacing (priv->attachview, 10); - - priv->headerview = - TNY_HEADER_VIEW_IFACE (tny_header_view_new ()); - - priv->textview = GTK_TEXT_VIEW (gtk_text_view_new ()); - - gtk_text_view_set_editable (priv->textview, FALSE); - - gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (priv->headerview), FALSE, FALSE, 0); - gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (priv->textview), TRUE, TRUE, 0); - gtk_box_pack_start (GTK_BOX (vbox), priv->attachview_sw, FALSE, TRUE, 0); - - gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (self), - GTK_WIDGET (vbox)); - - gtk_container_add (GTK_CONTAINER (priv->attachview_sw), GTK_WIDGET (priv->attachview)); - - gtk_widget_show (GTK_WIDGET (vbox)); - - gtk_widget_hide (GTK_WIDGET (priv->headerview)); - gtk_widget_show (GTK_WIDGET (priv->textview)); - gtk_widget_show (GTK_WIDGET (priv->attachview)); - - return; -} - -static void -tny_msg_view_finalize (GObject *object) -{ - TnyMsgView *self = (TnyMsgView *)object; - TnyMsgViewPriv *priv = TNY_MSG_VIEW_GET_PRIVATE (self); - - if (G_LIKELY (priv->msg)) - g_object_unref (G_OBJECT (priv->msg)); - - if (G_LIKELY (priv->save_strategy)) - g_object_unref (G_OBJECT (priv->save_strategy)); - - (*parent_class->finalize) (object); - - return; -} - -static void -tny_msg_view_iface_init (gpointer g_iface, gpointer iface_data) -{ - TnyMsgViewIfaceClass *klass = (TnyMsgViewIfaceClass *)g_iface; - - klass->set_msg_func = tny_msg_view_set_msg; - klass->set_save_strategy_func = tny_msg_view_set_save_strategy; - klass->set_unavailable_func = tny_msg_view_set_unavailable; - klass->clear_func = tny_msg_view_clear; - - return; -} - -static void -tny_msg_view_class_init (TnyMsgViewClass *class) -{ - GObjectClass *object_class; - - parent_class = g_type_class_peek_parent (class); - object_class = (GObjectClass*) class; - - object_class->finalize = tny_msg_view_finalize; - - g_type_class_add_private (object_class, sizeof (TnyMsgViewPriv)); - - return; -} - -GType -tny_msg_view_get_type (void) -{ - static GType type = 0; - - if (G_UNLIKELY(type == 0)) - { - static const GTypeInfo info = - { - sizeof (TnyMsgViewClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) tny_msg_view_class_init, /* class_init */ - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (TnyMsgView), - 0, /* n_preallocs */ - tny_msg_view_instance_init, /* instance_init */ - NULL - }; - - static const GInterfaceInfo tny_msg_view_iface_info = - { - (GInterfaceInitFunc) tny_msg_view_iface_init, /* interface_init */ - NULL, /* interface_finalize */ - NULL /* interface_data */ - }; - - type = g_type_register_static (GTK_TYPE_SCROLLED_WINDOW, - "TnyMsgView", - &info, 0); - - g_type_add_interface_static (type, TNY_TYPE_MSG_VIEW_IFACE, - &tny_msg_view_iface_info); - - } - - return type; -} Index: tny-msg-window.h =================================================================== --- tny-msg-window.h (Revision 855) +++ tny-msg-window.h (Arbeitskopie) @@ -1,61 +0,0 @@ -#ifndef TNY_MSG_WINDOW_H -#define TNY_MSG_WINDOW_H - -/* libtinymailui-gtk - The Tiny Mail UI library for Gtk+ - * Copyright (C) 2006-2007 Philip Van Hoof <pvanhoof gnome org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with self program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include <gtk/gtk.h> -#include <glib-object.h> -#include <tny-shared.h> - -#include <tny-msg-view-iface.h> -#include <tny-msg-window-iface.h> -#include <tny-header-iface.h> -#include <tny-msg-iface.h> -#include <tny-stream-iface.h> -#include <tny-mime-part-iface.h> - -G_BEGIN_DECLS - -#define TNY_TYPE_MSG_WINDOW (tny_msg_window_get_type ()) -#define TNY_MSG_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TNY_TYPE_MSG_WINDOW, TnyMsgWindow)) -#define TNY_MSG_WINDOW_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), TNY_TYPE_MSG_WINDOW, TnyMsgWindowClass)) -#define TNY_IS_MSG_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TNY_TYPE_MSG_WINDOW)) -#define TNY_IS_MSG_WINDOW_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), TNY_TYPE_MSG_WINDOW)) -#define TNY_MSG_WINDOW_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), TNY_TYPE_MSG_WINDOW, TnyMsgWindowClass)) - -typedef struct _TnyMsgWindow TnyMsgWindow; -typedef struct _TnyMsgWindowClass TnyMsgWindowClass; - -struct _TnyMsgWindow -{ - GtkWindow parent; - -}; - -struct _TnyMsgWindowClass -{ - GtkWindowClass parent_class; -}; - -GType tny_msg_window_get_type (void); -TnyMsgWindow* tny_msg_window_new (TnyMsgViewIface *msgview); - -G_END_DECLS - -#endif Index: tny-msg-view.h =================================================================== --- tny-msg-view.h (Revision 855) +++ tny-msg-view.h (Arbeitskopie) @@ -1,61 +0,0 @@ -#ifndef TNY_MSG_VIEW_H -#define TNY_MSG_VIEW_H - -/* libtinymailui-gtk - The Tiny Mail UI library for Gtk+ - * Copyright (C) 2006-2007 Philip Van Hoof <pvanhoof gnome org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with self program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include <gtk/gtk.h> -#include <glib-object.h> -#include <tny-shared.h> - -#include <tny-msg-view-iface.h> -#include <tny-header-iface.h> -#include <tny-msg-iface.h> -#include <tny-stream-iface.h> -#include <tny-mime-part-iface.h> -#include <tny-save-strategy-iface.h> - -G_BEGIN_DECLS - -#define TNY_TYPE_MSG_VIEW (tny_msg_view_get_type ()) -#define TNY_MSG_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TNY_TYPE_MSG_VIEW, TnyMsgView)) -#define TNY_MSG_VIEW_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), TNY_TYPE_MSG_VIEW, TnyMsgViewClass)) -#define TNY_IS_MSG_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TNY_TYPE_MSG_VIEW)) -#define TNY_IS_MSG_VIEW_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), TNY_TYPE_MSG_VIEW)) -#define TNY_MSG_VIEW_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), TNY_TYPE_MSG_VIEW, TnyMsgViewClass)) - -typedef struct _TnyMsgView TnyMsgView; -typedef struct _TnyMsgViewClass TnyMsgViewClass; - -struct _TnyMsgView -{ - GtkScrolledWindow parent; - -}; - -struct _TnyMsgViewClass -{ - GtkScrolledWindowClass parent_class; -}; - -GType tny_msg_view_get_type (void); -TnyMsgView* tny_msg_view_new (TnySaveStrategyIface *save_strategy); - -G_END_DECLS - -#endif Index: tny-gtk-msg-window.c =================================================================== --- tny-gtk-msg-window.c (Revision 855) +++ tny-gtk-msg-window.c (Arbeitskopie) @@ -19,26 +19,26 @@ #include <config.h> -#include <tny-msg-window.h> +#include <tny-gtk-msg-window.h> #include <tny-msg-view-iface.h> static GObjectClass *parent_class = NULL; -typedef struct _TnyMsgWindowPriv TnyMsgWindowPriv; +typedef struct _TnyGtkMsgWindowPriv TnyGtkMsgWindowPriv; -struct _TnyMsgWindowPriv +struct _TnyGtkMsgWindowPriv { TnyMsgViewIface *msg_view; }; -#define TNY_MSG_WINDOW_GET_PRIVATE(o) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((o), TNY_TYPE_MSG_WINDOW, TnyMsgWindowPriv)) +#define TNY_GTK_MSG_WINDOW_GET_PRIVATE(o) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((o), TNY_TYPE_GTK_MSG_WINDOW, TnyGtkMsgWindowPriv)) static void -tny_msg_window_set_save_strategy (TnyMsgViewIface *self, TnySaveStrategyIface *strategy) +tny_gtk_msg_window_set_save_strategy (TnyMsgViewIface *self, TnySaveStrategyIface *strategy) { - TnyMsgWindowPriv *priv = TNY_MSG_WINDOW_GET_PRIVATE (self); + TnyGtkMsgWindowPriv *priv = TNY_GTK_MSG_WINDOW_GET_PRIVATE (self); tny_msg_view_iface_set_save_strategy (priv->msg_view, strategy); @@ -46,9 +46,9 @@ } static void -tny_msg_window_set_unavailable (TnyMsgViewIface *self) +tny_gtk_msg_window_set_unavailable (TnyMsgViewIface *self) { - TnyMsgWindowPriv *priv = TNY_MSG_WINDOW_GET_PRIVATE (self); + TnyGtkMsgWindowPriv *priv = TNY_GTK_MSG_WINDOW_GET_PRIVATE (self); tny_msg_view_iface_set_unavailable (priv->msg_view); @@ -57,9 +57,9 @@ static void -tny_msg_window_set_msg (TnyMsgViewIface *self, TnyMsgIface *msg) +tny_gtk_msg_window_set_msg (TnyMsgViewIface *self, TnyMsgIface *msg) { - TnyMsgWindowPriv *priv = TNY_MSG_WINDOW_GET_PRIVATE (self); + TnyGtkMsgWindowPriv *priv = TNY_GTK_MSG_WINDOW_GET_PRIVATE (self); TnyHeaderIface *header = TNY_HEADER_IFACE (tny_msg_iface_get_header (msg)); tny_msg_view_iface_set_msg (priv->msg_view, msg); @@ -72,16 +72,16 @@ } /** - * tny_msg_window_new: + * tny_gtk_msg_window_new: * * - * Return value: a new #TnyMsgWindowIface instance implemented for Gtk+ + * Return value: a new #TnyGtkMsgWindow instance implemented for Gtk+ **/ -TnyMsgWindow* -tny_msg_window_new (TnyMsgViewIface *msgview) +TnyGtkMsgWindow* +tny_gtk_msg_window_new (TnyMsgViewIface *msgview) { - TnyMsgWindow *self = g_object_new (TNY_TYPE_MSG_WINDOW, NULL); - TnyMsgWindowPriv *priv = TNY_MSG_WINDOW_GET_PRIVATE (self); + TnyGtkMsgWindow *self = g_object_new (TNY_TYPE_GTK_WINDOW, NULL); + TnyGtkMsgWindowPriv *priv = TNY_GTK_MSG_WINDOW_GET_PRIVATE (self); if (G_UNLIKELY (priv->msg_view)) gtk_container_remove (GTK_CONTAINER (self), GTK_WIDGET (priv->msg_view)); @@ -96,9 +96,9 @@ } static void -tny_msg_window_instance_init (GTypeInstance *instance, gpointer g_class) +tny_gtk_msg_window_instance_init (GTypeInstance *instance, gpointer g_class) { - TnyMsgWindow *self = (TnyMsgWindow *)instance; + TnyGtkMsgWindow *self = (TnyGtkMsgWindow *)instance; gtk_window_set_default_size (GTK_WINDOW (self), 640, 480); @@ -106,7 +106,7 @@ } static void -tny_msg_window_finalize (GObject *object) +tny_gtk_msg_window_finalize (GObject *object) { /* Finalization of a GtkWidet removes references */ @@ -116,41 +116,41 @@ } static void -tny_msg_window_iface_init (gpointer g_iface, gpointer iface_data) +tny_gtk_msg_window_iface_init (gpointer g_iface, gpointer iface_data) { return; } static void -tny_msg_view_iface_init (gpointer g_iface, gpointer iface_data) +tny_gtk_msg_view_iface_init (gpointer g_iface, gpointer iface_data) { TnyMsgViewIfaceClass *klass = (TnyMsgViewIfaceClass *)g_iface; - klass->set_msg_func = tny_msg_window_set_msg; - klass->set_save_strategy_func = tny_msg_window_set_save_strategy; - klass->set_unavailable_func = tny_msg_window_set_unavailable; + klass->set_msg_func = tny_gtk_msg_window_set_msg; + klass->set_save_strategy_func = tny_gtk_msg_window_set_save_strategy; + klass->set_unavailable_func = tny_gtk_msg_window_set_unavailable; return; } static void -tny_msg_window_class_init (TnyMsgWindowClass *class) +tny_gtk_msg_window_class_init (TnyGtkMsgWindowClass *class) { GObjectClass *object_class; parent_class = g_type_class_peek_parent (class); object_class = (GObjectClass*) class; - object_class->finalize = tny_msg_window_finalize; + object_class->finalize = tny_gtk_msg_window_finalize; - g_type_class_add_private (object_class, sizeof (TnyMsgWindowPriv)); + g_type_class_add_private (object_class, sizeof (TnyGtkMsgWindowPriv)); return; } GType -tny_msg_window_get_type (void) +tny_gtk_msg_window_get_type (void) { static GType type = 0; @@ -158,41 +158,41 @@ { static const GTypeInfo info = { - sizeof (TnyMsgWindowClass), + sizeof (TnyGtkMsgWindowClass), NULL, /* base_init */ NULL, /* base_finalize */ - (GClassInitFunc) tny_msg_window_class_init, /* class_init */ + (GClassInitFunc) tny_gtk_msg_window_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ - sizeof (TnyMsgWindow), + sizeof (TnyGtkMsgWindow), 0, /* n_preallocs */ - tny_msg_window_instance_init, /* instance_init */ + tny_gtk_msg_window_instance_init, /* instance_init */ NULL }; - static const GInterfaceInfo tny_msg_window_iface_info = + static const GInterfaceInfo tny_gtk_msg_window_iface_info = { - (GInterfaceInitFunc) tny_msg_window_iface_init, /* interface_init */ + (GInterfaceInitFunc) tny_gtk_msg_window_iface_init, /* interface_init */ NULL, /* interface_finalize */ NULL /* interface_data */ }; - static const GInterfaceInfo tny_msg_view_iface_info = + static const GInterfaceInfo tny_gtk_msg_view_iface_info = { - (GInterfaceInitFunc) tny_msg_view_iface_init, /* interface_init */ + (GInterfaceInitFunc) tny_gtk_msg_view_iface_init, /* interface_init */ NULL, /* interface_finalize */ NULL /* interface_data */ }; type = g_type_register_static (GTK_TYPE_WINDOW, - "TnyMsgWindow", + "TnyGtkMsgWindow", &info, 0); g_type_add_interface_static (type, TNY_TYPE_MSG_VIEW_IFACE, - &tny_msg_view_iface_info); + &tny_gtk_msg_view_iface_info); g_type_add_interface_static (type, TNY_TYPE_MSG_WINDOW_IFACE, - &tny_msg_window_iface_info); + &tny_gtk_msg_window_iface_info); } Index: tny-gtk-msg-view.c =================================================================== --- tny-gtk-msg-view.c (Revision 855) +++ tny-gtk-msg-view.c (Arbeitskopie) @@ -34,7 +34,7 @@ #include <tny-list-iface.h> #include <tny-iterator-iface.h> -#include <tny-msg-view.h> +#include <tny-gtk-msg-view.h> #include <tny-text-buffer-stream.h> #include <tny-attach-list-model.h> #include <tny-header-view-iface.h> @@ -52,9 +52,9 @@ static GObjectClass *parent_class = NULL; -typedef struct _TnyMsgViewPriv TnyMsgViewPriv; +typedef struct _TnyGtkMsgViewPriv TnyGtkMsgViewPriv; -struct _TnyMsgViewPriv +struct _TnyGtkMsgViewPriv { TnyMsgIface *msg; GtkTextView *textview; @@ -64,13 +64,13 @@ TnySaveStrategyIface *save_strategy; }; -#define TNY_MSG_VIEW_GET_PRIVATE(o) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((o), TNY_TYPE_MSG_VIEW, TnyMsgViewPriv)) +#define TNY_GTK_MSG_VIEW_GET_PRIVATE(o) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((o), TNY_TYPE_GTK_MSG_VIEW, TnyGtkMsgViewPriv)) static void reload_msg (TnyMsgViewIface *self) { - TnyMsgViewPriv *priv = TNY_MSG_VIEW_GET_PRIVATE (self); + TnyGtkMsgViewPriv *priv = TNY_GTK_MSG_VIEW_GET_PRIVATE (self); GtkTextBuffer *buffer; TnyStreamIface *dest; TnyHeaderIface *header; @@ -133,9 +133,9 @@ } void -tny_msg_view_set_save_strategy (TnyMsgViewIface *self, TnySaveStrategyIface *strategy) +tny_gtk_msg_view_set_save_strategy (TnyMsgViewIface *self, TnySaveStrategyIface *strategy) { - TnyMsgViewPriv *priv = TNY_MSG_VIEW_GET_PRIVATE (self); + TnyGtkMsgViewPriv *priv = TNY_GTK_MSG_VIEW_GET_PRIVATE (self); if (priv->save_strategy) g_object_unref (G_OBJECT (priv->save_strategy)); @@ -150,8 +150,8 @@ static void for_each_selected_attachment (GtkIconView *icon_view, GtkTreePath *path, gpointer user_data) { - TnyMsgView *self = user_data; - TnyMsgViewPriv *priv = TNY_MSG_VIEW_GET_PRIVATE (self); + TnyGtkMsgView *self = user_data; + TnyGtkMsgViewPriv *priv = TNY_GTK_MSG_VIEW_GET_PRIVATE (self); GtkTreeModel *model = gtk_icon_view_get_model (icon_view); GtkTreeIter iter; @@ -179,10 +179,10 @@ static void -tny_msg_view_save_as_activated (GtkMenuItem *menuitem, gpointer user_data) +tny_gtk_msg_view_save_as_activated (GtkMenuItem *menuitem, gpointer user_data) { - TnyMsgView *self = user_data; - TnyMsgViewPriv *priv = TNY_MSG_VIEW_GET_PRIVATE (self); + TnyGtkMsgView *self = user_data; + TnyGtkMsgViewPriv *priv = TNY_GTK_MSG_VIEW_GET_PRIVATE (self); if (!G_LIKELY (priv->save_strategy)) { @@ -199,7 +199,7 @@ static gint -tny_msg_view_popup_handler (GtkWidget *widget, GdkEvent *event) +tny_gtk_msg_view_popup_handler (GtkWidget *widget, GdkEvent *event) { g_return_val_if_fail (event != NULL, FALSE); @@ -226,9 +226,9 @@ } static void -tny_msg_view_set_unavailable (TnyMsgViewIface *self) +tny_gtk_msg_view_set_unavailable (TnyMsgViewIface *self) { - TnyMsgViewPriv *priv = TNY_MSG_VIEW_GET_PRIVATE (self); + TnyGtkMsgViewPriv *priv = TNY_GTK_MSG_VIEW_GET_PRIVATE (self); GtkTextBuffer *buffer; if (G_LIKELY (priv->msg)) @@ -248,9 +248,9 @@ } static void -tny_msg_view_set_msg (TnyMsgViewIface *self, TnyMsgIface *msg) +tny_gtk_msg_view_set_msg (TnyMsgViewIface *self, TnyMsgIface *msg) { - TnyMsgViewPriv *priv = TNY_MSG_VIEW_GET_PRIVATE (self); + TnyGtkMsgViewPriv *priv = TNY_GTK_MSG_VIEW_GET_PRIVATE (self); if (G_LIKELY (priv->msg)) g_object_unref (G_OBJECT (priv->msg)); @@ -266,9 +266,9 @@ } static void -tny_msg_view_clear (TnyMsgViewIface *self) +tny_gtk_msg_view_clear (TnyMsgViewIface *self) { - TnyMsgViewPriv *priv = TNY_MSG_VIEW_GET_PRIVATE (self); + TnyGtkMsgViewPriv *priv = TNY_GTK_MSG_VIEW_GET_PRIVATE (self); GtkTextBuffer *buffer = gtk_text_view_get_buffer (priv->textview); gtk_widget_hide (priv->attachview_sw); @@ -280,15 +280,15 @@ } /** - * tny_msg_view_new: + * tny_gtk_msg_view_new: * @save_strategy: The save strategy to use * - * Return value: a new #TnyMsgViewIface instance implemented for Gtk+ + * Return value: a new #TnyGtkMsgView instance implemented for Gtk+ **/ -TnyMsgView* -tny_msg_view_new (TnySaveStrategyIface *save_strategy) +TnyGtkMsgView* +tny_gtk_msg_view_new (TnySaveStrategyIface *save_strategy) { - TnyMsgView *self = g_object_new (TNY_TYPE_MSG_VIEW, NULL); + TnyGtkMsgView *self = g_object_new (TNY_TYPE_GTK_MSG_VIEW, NULL); tny_msg_view_iface_set_save_strategy (TNY_MSG_VIEW_IFACE (self), save_strategy); @@ -296,10 +296,10 @@ } static void -tny_msg_view_instance_init (GTypeInstance *instance, gpointer g_class) +tny_gtk_msg_view_instance_init (GTypeInstance *instance, gpointer g_class) { - TnyMsgView *self = (TnyMsgView *)instance; - TnyMsgViewPriv *priv = TNY_MSG_VIEW_GET_PRIVATE (self); + TnyGtkMsgView *self = (TnyGtkMsgView *)instance; + TnyGtkMsgViewPriv *priv = TNY_GTK_MSG_VIEW_GET_PRIVATE (self); GtkWidget *vbox = gtk_vbox_new (FALSE, 1); GtkMenu *menu = GTK_MENU (gtk_menu_new ()); GtkWidget *mitem = gtk_menu_item_new_with_mnemonic ("Save _As"); @@ -312,7 +312,7 @@ gtk_widget_show (mitem); g_signal_connect (G_OBJECT (mitem), "activate", - G_CALLBACK (tny_msg_view_save_as_activated), self); + G_CALLBACK (tny_gtk_msg_view_save_as_activated), self); gtk_menu_shell_append (GTK_MENU_SHELL (menu), mitem); @@ -332,7 +332,7 @@ gtk_icon_view_set_selection_mode (priv->attachview, GTK_SELECTION_SINGLE); g_signal_connect_swapped (G_OBJECT (priv->attachview), "button_press_event", - G_CALLBACK (tny_msg_view_popup_handler), menu); + G_CALLBACK (tny_gtk_msg_view_popup_handler), menu); gtk_icon_view_set_text_column (priv->attachview, TNY_ATTACH_LIST_MODEL_FILENAME_COLUMN); @@ -370,10 +370,10 @@ } static void -tny_msg_view_finalize (GObject *object) +tny_gtk_msg_view_finalize (GObject *object) { - TnyMsgView *self = (TnyMsgView *)object; - TnyMsgViewPriv *priv = TNY_MSG_VIEW_GET_PRIVATE (self); + TnyGtkMsgView *self = (TnyGtkMsgView *)object; + TnyGtkMsgViewPriv *priv = TNY_GTK_MSG_VIEW_GET_PRIVATE (self); if (G_LIKELY (priv->msg)) g_object_unref (G_OBJECT (priv->msg)); @@ -387,35 +387,35 @@ } static void -tny_msg_view_iface_init (gpointer g_iface, gpointer iface_data) +tny_gtk_msg_view_iface_init (gpointer g_iface, gpointer iface_data) { TnyMsgViewIfaceClass *klass = (TnyMsgViewIfaceClass *)g_iface; - klass->set_msg_func = tny_msg_view_set_msg; - klass->set_save_strategy_func = tny_msg_view_set_save_strategy; - klass->set_unavailable_func = tny_msg_view_set_unavailable; - klass->clear_func = tny_msg_view_clear; + klass->set_msg_func = tny_gtk_msg_view_set_msg; + klass->set_save_strategy_func = tny_gtk_msg_view_set_save_strategy; + klass->set_unavailable_func = tny_gtk_msg_view_set_unavailable; + klass->clear_func = tny_gtk_msg_view_clear; return; } static void -tny_msg_view_class_init (TnyMsgViewClass *class) +tny_gtk_msg_view_class_init (TnyGtkMsgViewClass *class) { GObjectClass *object_class; parent_class = g_type_class_peek_parent (class); object_class = (GObjectClass*) class; - object_class->finalize = tny_msg_view_finalize; + object_class->finalize = tny_gtk_msg_view_finalize; - g_type_class_add_private (object_class, sizeof (TnyMsgViewPriv)); + g_type_class_add_private (object_class, sizeof (TnyGtkMsgViewPriv)); return; } GType -tny_msg_view_get_type (void) +tny_gtk_msg_view_get_type (void) { static GType type = 0; @@ -423,31 +423,31 @@ { static const GTypeInfo info = { - sizeof (TnyMsgViewClass), + sizeof (TnyGtkMsgViewClass), NULL, /* base_init */ NULL, /* base_finalize */ - (GClassInitFunc) tny_msg_view_class_init, /* class_init */ + (GClassInitFunc) tny_gtk_msg_view_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ - sizeof (TnyMsgView), + sizeof (TnyGtkMsgView), 0, /* n_preallocs */ - tny_msg_view_instance_init, /* instance_init */ + tny_gtk_msg_view_instance_init, /* instance_init */ NULL }; - static const GInterfaceInfo tny_msg_view_iface_info = + static const GInterfaceInfo tny_gtk_msg_view_iface_info = { - (GInterfaceInitFunc) tny_msg_view_iface_init, /* interface_init */ + (GInterfaceInitFunc) tny_gtk_msg_view_iface_init, /* interface_init */ NULL, /* interface_finalize */ NULL /* interface_data */ }; type = g_type_register_static (GTK_TYPE_SCROLLED_WINDOW, - "TnyMsgView", + "TnyGtkMsgView", &info, 0); g_type_add_interface_static (type, TNY_TYPE_MSG_VIEW_IFACE, - &tny_msg_view_iface_info); + &tny_gtk_msg_view_iface_info); } Index: tny-gtk-msg-window.h =================================================================== --- tny-gtk-msg-window.h (Revision 855) +++ tny-gtk-msg-window.h (Arbeitskopie) @@ -1,5 +1,5 @@ -#ifndef TNY_MSG_WINDOW_H -#define TNY_MSG_WINDOW_H +#ifndef TNY_GTK_MSG_WINDOW_H +#define TNY_GTK_MSG_WINDOW_H /* libtinymailui-gtk - The Tiny Mail UI library for Gtk+ * Copyright (C) 2006-2007 Philip Van Hoof <pvanhoof gnome org> @@ -32,29 +32,29 @@ G_BEGIN_DECLS -#define TNY_TYPE_MSG_WINDOW (tny_msg_window_get_type ()) -#define TNY_MSG_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TNY_TYPE_MSG_WINDOW, TnyMsgWindow)) -#define TNY_MSG_WINDOW_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), TNY_TYPE_MSG_WINDOW, TnyMsgWindowClass)) -#define TNY_IS_MSG_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TNY_TYPE_MSG_WINDOW)) -#define TNY_IS_MSG_WINDOW_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), TNY_TYPE_MSG_WINDOW)) -#define TNY_MSG_WINDOW_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), TNY_TYPE_MSG_WINDOW, TnyMsgWindowClass)) +#define TNY_TYPE_GTK_MSG_WINDOW (tny_gtk_msg_window_get_type ()) +#define TNY_GTK_MSG_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TNY_TYPE_GTK_MSG_WINDOW, TnyGtkMsgWindow)) +#define TNY_GTK_MSG_WINDOW_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), TNY_TYPE_GTK_MSG_WINDOW, TnyGtkMsgWindowClass)) +#define TNY_IS_GTK_MSG_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TNY_TYPE_GTK_MSG_WINDOW)) +#define TNY_IS_GTK_MSG_WINDOW_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), TNY_TYPE_GTK_MSG_WINDOW)) +#define TNY_GTK_MSG_WINDOW_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), TNY_TYPE_GTK_MSG_WINDOW, TnyGtkMsgWindowClass)) -typedef struct _TnyMsgWindow TnyMsgWindow; -typedef struct _TnyMsgWindowClass TnyMsgWindowClass; +typedef struct _TnyGtkMsgWindow TnyGtkMsgWindow; +typedef struct _TnyGtkMsgWindowClass TnyGtkMsgWindowClass; -struct _TnyMsgWindow +struct _TnyGtkMsgWindow { GtkWindow parent; }; -struct _TnyMsgWindowClass +struct _TnyGtkMsgWindowClass { GtkWindowClass parent_class; }; -GType tny_msg_window_get_type (void); -TnyMsgWindow* tny_msg_window_new (TnyMsgViewIface *msgview); +GType tny_gtk_msg_window_get_type (void); +TnyGtkMsgWindow* tny_gtk_msg_window_new (TnyMsgViewIface *msgview); G_END_DECLS
Attachment:
uigtkrenamemsg.sh
Description: application/shellscript