~ubuntu-branches/debian/sid/link-monitor-applet/sid

« back to all changes in this revision

Viewing changes to build/src/lm-about-dialog.c

  • Committer: Bazaar Package Importer
  • Author(s): Adriaan Peeters
  • Date: 2008-03-30 22:26:13 UTC
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20080330222613-5aubcuo9mgg2n7st
Tags: upstream-3.0
ImportĀ upstreamĀ versionĀ 3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Generated by GOB (v2.0.15)   (do not edit directly) */
 
2
 
 
3
/* End world hunger, donate to the World Food Programme, http://www.wfp.org */
 
4
 
 
5
#define GOB_VERSION_MAJOR 2
 
6
#define GOB_VERSION_MINOR 0
 
7
#define GOB_VERSION_PATCHLEVEL 15
 
8
 
 
9
#define selfp (self->_priv)
 
10
 
 
11
#include <string.h> /* memset() */
 
12
 
 
13
#include "lm-about-dialog.h"
 
14
 
 
15
#include "lm-about-dialog-private.h"
 
16
 
 
17
#ifdef G_LIKELY
 
18
#define ___GOB_LIKELY(expr) G_LIKELY(expr)
 
19
#define ___GOB_UNLIKELY(expr) G_UNLIKELY(expr)
 
20
#else /* ! G_LIKELY */
 
21
#define ___GOB_LIKELY(expr) (expr)
 
22
#define ___GOB_UNLIKELY(expr) (expr)
 
23
#endif /* G_LIKELY */
 
24
 
 
25
#line 24 "src/lm-about-dialog.gob"
 
26
 
 
27
#include <glib/gi18n.h>
 
28
#include <gnome.h>
 
29
#include "lm-util.h"
 
30
 
 
31
#line 32 "lm-about-dialog.c"
 
32
/* self casting macros */
 
33
#define SELF(x) LM_ABOUT_DIALOG(x)
 
34
#define SELF_CONST(x) LM_ABOUT_DIALOG_CONST(x)
 
35
#define IS_SELF(x) LM_IS_ABOUT_DIALOG(x)
 
36
#define TYPE_SELF LM_TYPE_ABOUT_DIALOG
 
37
#define SELF_CLASS(x) LM_ABOUT_DIALOG_CLASS(x)
 
38
 
 
39
#define SELF_GET_CLASS(x) LM_ABOUT_DIALOG_GET_CLASS(x)
 
40
 
 
41
/* self typedefs */
 
42
typedef LMAboutDialog Self;
 
43
typedef LMAboutDialogClass SelfClass;
 
44
 
 
45
/* here are local prototypes */
 
46
#line 32 "src/lm-about-dialog.gob"
 
47
static void lm_about_dialog_class_init (LMAboutDialogClass * class);
 
48
#line 49 "lm-about-dialog.c"
 
49
#line 38 "src/lm-about-dialog.gob"
 
50
static void lm_about_dialog_init (LMAboutDialog * self);
 
51
#line 52 "lm-about-dialog.c"
 
52
#line 66 "src/lm-about-dialog.gob"
 
53
static void lm_about_dialog_activate_link_cb (GtkAboutDialog * about, const char * link_, gpointer data);
 
54
#line 55 "lm-about-dialog.c"
 
55
 
 
56
/* pointer to the class of our parent */
 
57
static GtkAboutDialogClass *parent_class = NULL;
 
58
 
 
59
/* Short form macros */
 
60
#define self_activate_link_cb lm_about_dialog_activate_link_cb
 
61
GType
 
62
lm_about_dialog_get_type (void)
 
63
{
 
64
        static GType type = 0;
 
65
 
 
66
        if ___GOB_UNLIKELY(type == 0) {
 
67
                static const GTypeInfo info = {
 
68
                        sizeof (LMAboutDialogClass),
 
69
                        (GBaseInitFunc) NULL,
 
70
                        (GBaseFinalizeFunc) NULL,
 
71
                        (GClassInitFunc) lm_about_dialog_class_init,
 
72
                        (GClassFinalizeFunc) NULL,
 
73
                        NULL /* class_data */,
 
74
                        sizeof (LMAboutDialog),
 
75
                        0 /* n_preallocs */,
 
76
                        (GInstanceInitFunc) lm_about_dialog_init,
 
77
                        NULL
 
78
                };
 
79
 
 
80
                type = g_type_register_static (GTK_TYPE_ABOUT_DIALOG, "LMAboutDialog", &info, (GTypeFlags)0);
 
81
        }
 
82
 
 
83
        return type;
 
84
}
 
85
 
 
86
/* a macro for creating a new object of our type */
 
87
#define GET_NEW ((LMAboutDialog *)g_object_new(lm_about_dialog_get_type(), NULL))
 
88
 
 
89
/* a function for creating a new object of our type */
 
90
#include <stdarg.h>
 
91
static LMAboutDialog * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
 
92
static LMAboutDialog *
 
93
GET_NEW_VARG (const char *first, ...)
 
94
{
 
95
        LMAboutDialog *ret;
 
96
        va_list ap;
 
97
        va_start (ap, first);
 
98
        ret = (LMAboutDialog *)g_object_new_valist (lm_about_dialog_get_type (), first, ap);
 
99
        va_end (ap);
 
100
        return ret;
 
101
}
 
102
 
 
103
#line 32 "src/lm-about-dialog.gob"
 
104
static void 
 
105
lm_about_dialog_class_init (LMAboutDialogClass * class G_GNUC_UNUSED)
 
106
{
 
107
#line 108 "lm-about-dialog.c"
 
108
#define __GOB_FUNCTION__ "LM:About:Dialog::class_init"
 
109
 
 
110
        parent_class = g_type_class_ref (GTK_TYPE_ABOUT_DIALOG);
 
111
 
 
112
 {
 
113
#line 33 "src/lm-about-dialog.gob"
 
114
 
 
115
    gtk_about_dialog_set_email_hook(self_activate_link_cb, "mailto:", NULL);
 
116
    gtk_about_dialog_set_url_hook(self_activate_link_cb, NULL, NULL);
 
117
  
 
118
#line 119 "lm-about-dialog.c"
 
119
 }
 
120
}
 
121
#undef __GOB_FUNCTION__
 
122
#line 38 "src/lm-about-dialog.gob"
 
123
static void 
 
124
lm_about_dialog_init (LMAboutDialog * self G_GNUC_UNUSED)
 
125
{
 
126
#line 127 "lm-about-dialog.c"
 
127
#define __GOB_FUNCTION__ "LM:About:Dialog::init"
 
128
 {
 
129
#line 39 "src/lm-about-dialog.gob"
 
130
 
 
131
    GtkAboutDialog *about = GTK_ABOUT_DIALOG(self);
 
132
    const char *authors[] = { "Jean-Yves Lefort <jylefort@brutele.be>", NULL };
 
133
    const char *documenters[] = { "Jean-Yves Lefort <jylefort@brutele.be>", NULL };
 
134
    GdkPixbuf *logo;
 
135
 
 
136
    /* translators: header capitalization */
 
137
    gtk_about_dialog_set_program_name(about, _("Link Monitor"));
 
138
    gtk_about_dialog_set_version(about, VERSION);
 
139
    gtk_about_dialog_set_copyright(about, "Copyright \302\251 2004-2008 Jean-Yves Lefort");
 
140
    gtk_about_dialog_set_comments(about, _("The link monitor displays the round-trip time to one or more hosts."));
 
141
    gtk_about_dialog_set_website(about, "http://www.nongnu.org/link-monitor");
 
142
    gtk_about_dialog_set_authors(about, authors);
 
143
    gtk_about_dialog_set_documenters(about, documenters);
 
144
    /*
 
145
     * translators: Your Name <your-email>
 
146
     * optionally followed by one or more: \nOther Contributor's Name <his-email>
 
147
     */
 
148
    gtk_about_dialog_set_translator_credits(about, _("translator-credits"));
 
149
 
 
150
    logo = lm_pixbuf_new(GNOMEPIXMAPSDIR G_DIR_SEPARATOR_S "link-monitor-applet.png");
 
151
    gtk_about_dialog_set_logo(about, logo);
 
152
    g_object_unref(logo);
 
153
 
 
154
    g_signal_connect(self, "response", G_CALLBACK(gtk_widget_destroy), NULL);
 
155
  
 
156
#line 157 "lm-about-dialog.c"
 
157
 }
 
158
}
 
159
#undef __GOB_FUNCTION__
 
160
 
 
161
 
 
162
 
 
163
#line 66 "src/lm-about-dialog.gob"
 
164
static void 
 
165
lm_about_dialog_activate_link_cb (GtkAboutDialog * about, const char * link_, gpointer data)
 
166
{
 
167
#line 168 "lm-about-dialog.c"
 
168
#define __GOB_FUNCTION__ "LM:About:Dialog::activate_link_cb"
 
169
{
 
170
#line 70 "src/lm-about-dialog.gob"
 
171
        
 
172
    GError *err = NULL;
 
173
    const char *prefix = data;
 
174
    char *url;
 
175
 
 
176
    url = prefix ? g_strconcat(prefix, link_, NULL) : g_strdup(link_);
 
177
    if (! gnome_url_show(url, &err))
 
178
      {
 
179
        lm_show_error_dialog(GTK_WINDOW(about), _("Unable to open link"), "%s", err->message);
 
180
        g_error_free(err);
 
181
      }
 
182
    g_free(url);
 
183
  }}
 
184
#line 185 "lm-about-dialog.c"
 
185
#undef __GOB_FUNCTION__