/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * Authors: Jeffrey Stedfast * * Copyright 2001 Ximian, Inc. (www.ximian.com) * * 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 this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. * */ #ifndef _MESSAGE_BROWSER_H_ #define _MESSAGE_BROWSER_H_ #include #include #include #include "folder-browser.h" #include "mail-display.h" #include "mail-types.h" #define MESSAGE_BROWSER_TYPE (message_browser_get_type ()) #define MESSAGE_BROWSER(o) (GTK_CHECK_CAST ((o), MESSAGE_BROWSER_TYPE, MessageBrowser)) #define MESSAGE_BROWSER_CLASS(k) (GTK_CHECK_CLASS_CAST((k), MESSAGE_BROWSER_TYPE, MessageBrowserClass)) #define IS_MESSAGE_BROWSER(o) (GTK_CHECK_TYPE ((o), MESSAGE_BROWSER_TYPE)) #define IS_MESSAGE_BROWSER_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), MESSAGE_BROWSER_TYPE)) struct _MessageBrowser { BonoboWindow parent; /* * The current URI being displayed by the MessageBrowser */ FolderBrowser *fb; }; typedef struct { BonoboWindowClass parent_class; } MessageBrowserClass; GtkType message_browser_get_type (void); GtkWidget *message_browser_new (const GNOME_Evolution_Shell shell, const char *uri, const char *uid); #endif /* _MESSAGE_BROWSER_H_ */ >logtreecommitdiffstats
blob: 347398183038589648731172d05ec44c9332e80e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/*
 *  Copyright (C) 2003 Marco Pesenti Gritti
 *  Copyright (C) 2003 David Bordoley
 *
 *  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, 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 this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 *  $Id$
 */

#include "config.h"

#include "ephy-go-action.h"
#include "ephy-debug.h"

#include <glib/gi18n.h>
#include <gtk/gtktoolitem.h>
#include <gtk/gtkbutton.h>

static void ephy_go_action_class_init (EphyGoActionClass *class);

static GObjectClass *parent_class = NULL;

GType
ephy_go_action_get_type (void)
{
    static GType type = 0;

    if (G_UNLIKELY (type == 0))
    {
        static const GTypeInfo type_info =
        {
            sizeof (EphyGoActionClass),
            (GBaseInitFunc) NULL,
            (GBaseFinalizeFunc) NULL,
            (GClassInitFunc) ephy_go_action_class_init,
            (GClassFinalizeFunc) NULL,
            NULL,
            sizeof (EphyGoAction),
            0, /* n_preallocs */
            (GInstanceInitFunc) NULL,
        };

        type = g_type_register_static (EPHY_TYPE_LINK_ACTION,
                           "EphyGoAction",
                           &type_info, 0);
    }

    return type;
}

static GtkWidget *
create_tool_item (GtkAction *action)
{
    GtkWidget *button;
    GtkWidget *item;

    item = GTK_WIDGET (gtk_tool_item_new ());

    button = gtk_button_new_with_label (_("Go"));
    gtk_button_set_relief(GTK_BUTTON (button), GTK_RELIEF_NONE);
    gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE);

    gtk_container_add (GTK_CONTAINER (item), button);
    gtk_widget_show (button);

    return item;
}

static void
connect_proxy (GtkAction *action,
           GtkWidget *proxy)
{      
    GTK_ACTION_CLASS (parent_class)->connect_proxy (action, proxy);

    if (GTK_IS_TOOL_ITEM (proxy))
    {
        g_signal_connect_object (GTK_BIN (proxy)->child, "clicked",
                     G_CALLBACK (gtk_action_activate), action,
                     G_CONNECT_SWAPPED);
    }
}

static void
disconnect_proxy (GtkAction *action,
          GtkWidget *proxy)
{
    g_signal_handlers_disconnect_by_func
        (proxy, G_CALLBACK (gtk_action_activate), action);

    GTK_ACTION_CLASS (parent_class)->disconnect_proxy (action, proxy);
}

static void
ephy_go_action_class_init (EphyGoActionClass *class)
{
    GtkActionClass *action_class = GTK_ACTION_CLASS (class);

    parent_class = g_type_class_peek_parent (class);

    action_class->create_tool_item = create_tool_item;
    action_class->connect_proxy = connect_proxy;
    action_class->disconnect_proxy = disconnect_proxy;
}