aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-about-box.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2002-11-02 16:25:03 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2002-11-02 16:25:03 +0800
commit9c73777f2268b5bf2622f893e2a3ba7d0f720572 (patch)
treef81b79f19b87f84b4429d329b3fc0f9ff7946060 /shell/e-shell-about-box.c
parent236c15d106b4e740d4e3996e0649334ca8e13876 (diff)
downloadgsoc2013-evolution-9c73777f2268b5bf2622f893e2a3ba7d0f720572.tar.gz
gsoc2013-evolution-9c73777f2268b5bf2622f893e2a3ba7d0f720572.tar.zst
gsoc2013-evolution-9c73777f2268b5bf2622f893e2a3ba7d0f720572.zip
First big sync of my GNOME 2 porting work (incomplete, and still
pretty broken). Weeeeee! svn path=/trunk/; revision=18503
Diffstat (limited to 'shell/e-shell-about-box.c')
-rw-r--r--shell/e-shell-about-box.c39
1 files changed, 15 insertions, 24 deletions
diff --git a/shell/e-shell-about-box.c b/shell/e-shell-about-box.c
index 1e102fa19f..22dd0a7829 100644
--- a/shell/e-shell-about-box.c
+++ b/shell/e-shell-about-box.c
@@ -145,6 +145,7 @@ timeout_callback (void *data)
EShellAboutBoxPrivate *priv;
GdkRectangle redraw_rect;
GtkWidget *widget;
+ GdkFont *font;
int line_height;
int first_line;
int y;
@@ -155,7 +156,8 @@ timeout_callback (void *data)
widget = GTK_WIDGET (about_box);
- line_height = widget->style->font->ascent + widget->style->font->descent;
+ font = gtk_style_get_font (widget->style);
+ line_height = font->ascent + font->descent;
if (priv->text_y_offset < TEXT_HEIGHT) {
y = TEXT_Y_OFFSET + (TEXT_HEIGHT - priv->text_y_offset);
@@ -181,9 +183,9 @@ timeout_callback (void *data)
else
line = _(priv->permuted_text[first_line + i]);
- x = TEXT_X_OFFSET + (TEXT_WIDTH - gdk_string_width (widget->style->font, line)) / 2;
+ x = TEXT_X_OFFSET + (TEXT_WIDTH - gdk_string_width (font, line)) / 2;
- gdk_draw_string (priv->pixmap, widget->style->font, priv->clipped_gc, x, y, line);
+ gdk_draw_string (priv->pixmap, font, priv->clipped_gc, x, y, line);
y += line_height;
}
@@ -266,7 +268,7 @@ impl_realize (GtkWidget *widget)
about_box = E_SHELL_ABOUT_BOX (widget);
priv = about_box->priv;
- background_pixbuf = gdk_pixbuf_new_from_file (IMAGE_PATH);
+ background_pixbuf = gdk_pixbuf_new_from_file (IMAGE_PATH, NULL);
g_assert (background_pixbuf != NULL);
g_assert (gdk_pixbuf_get_width (background_pixbuf) == WIDTH);
g_assert (gdk_pixbuf_get_height (background_pixbuf) == HEIGHT);
@@ -325,32 +327,22 @@ impl_unrealize (GtkWidget *widget)
}
}
-static void
-impl_draw (GtkWidget *widget,
- GdkRectangle *area)
-{
- EShellAboutBox *about_box;
- EShellAboutBoxPrivate *priv;
-
- if (! GTK_WIDGET_DRAWABLE (widget))
- return;
-
- about_box = E_SHELL_ABOUT_BOX (widget);
- priv = about_box->priv;
-
- gdk_draw_pixmap (widget->window, widget->style->black_gc, priv->pixmap,
- area->x, area->y,
- area->x, area->y, area->width, area->height);
-}
-
static int
impl_expose_event (GtkWidget *widget,
GdkEventExpose *event)
{
+ EShellAboutBoxPrivate *priv;
+
if (! GTK_WIDGET_DRAWABLE (widget))
return FALSE;
- gtk_widget_draw (widget, &event->area);
+ priv = E_SHELL_ABOUT_BOX (widget)->priv;
+
+ gdk_draw_pixmap (widget->window, widget->style->black_gc,
+ priv->pixmap,
+ event->area.x, event->area.y,
+ event->area.x, event->area.y,
+ event->area.width, event->area.height);
return TRUE;
}
@@ -369,7 +361,6 @@ class_init (GtkObjectClass *object_class)
widget_class->size_request = impl_size_request;
widget_class->realize = impl_realize;
widget_class->unrealize = impl_unrealize;
- widget_class->draw = impl_draw;
widget_class->expose_event = impl_expose_event;
}
re>
999ef98d76
8a1eb1f24e













2831ada5a5
8a1eb1f24e


2831ada5a5
8a1eb1f24e
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
  


                                                                
  


                                                                    
  
                                                                   
                                                                             
  



                                                        
   
                       

                        
                 











                                                                                                               






                                                         
                                                









                                                 
                                                 


                                                 
                                                

















                                          

                                                                                
 












                                                                             
 

                                                                          
 
                            
/*
 * This program 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) version 3.
 *
 * 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with the program; if not, see <http://www.gnu.org/licenses/>
 *
 *
 * Authors:
 *      Chris Toshok <toshok@ximian.com>
 *
 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
 */

#ifndef E_ASN1_OBJECT_H
#define E_ASN1_OBJECT_H

#include <glib-object.h>

#include <cert.h>

#define E_TYPE_ASN1_OBJECT            (e_asn1_object_get_type ())
#define E_ASN1_OBJECT(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_ASN1_OBJECT, EASN1Object))
#define E_ASN1_OBJECT_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_ASN1_OBJECT, EASN1ObjectClass))
#define E_IS_ASN1_OBJECT(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_ASN1_OBJECT))
#define E_IS_ASN1_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_ASN1_OBJECT))
#define E_ASN1_OBJECT_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_ASN1_OBJECT, EASN1ObjectClass))

typedef struct _EASN1Object EASN1Object;
typedef struct _EASN1ObjectClass EASN1ObjectClass;
typedef struct _EASN1ObjectPrivate EASN1ObjectPrivate;

enum {
    /*
     *  Identifiers for the possible types of object.
     */
    E_ASN1_OBJECT_TYPE_END_CONTENTS     = 0,
    E_ASN1_OBJECT_TYPE_BOOLEAN          = 1,
    E_ASN1_OBJECT_TYPE_INTEGER          = 2,
    E_ASN1_OBJECT_TYPE_BIT_STRING       = 3,
    E_ASN1_OBJECT_TYPE_OCTET_STRING     = 4,
    E_ASN1_OBJECT_TYPE_NULL             = 5,
    E_ASN1_OBJECT_TYPE_OBJECT_ID        = 6,
    E_ASN1_OBJECT_TYPE_ENUMERATED       = 10,
    E_ASN1_OBJECT_TYPE_UTF8_STRING      = 12,
    E_ASN1_OBJECT_TYPE_SEQUENCE         = 16,
    E_ASN1_OBJECT_TYPE_SET              = 17,
    E_ASN1_OBJECT_TYPE_PRINTABLE_STRING = 19,
    E_ASN1_OBJECT_TYPE_T61_STRING       = 20,
    E_ASN1_OBJECT_TYPE_IA5_STRING       = 22,
    E_ASN1_OBJECT_TYPE_UTC_TIME         = 23,
    E_ASN1_OBJECT_TYPE_GEN_TIME         = 24,
    E_ASN1_OBJECT_TYPE_VISIBLE_STRING   = 26,
    E_ASN1_OBJECT_TYPE_UNIVERSAL_STRING = 28,
    E_ASN1_OBJECT_TYPE_BMP_STRING       = 30,
    E_ASN1_OBJECT_TYPE_HIGH_TAG_NUMBER  = 31,
    E_ASN1_OBJECT_TYPE_CONTEXT_SPECIFIC = 32,
    E_ASN1_OBJECT_TYPE_APPLICATION      = 33,
    E_ASN1_OBJECT_TYPE_PRIVATE          = 34
};

struct _EASN1Object {
    GObject parent;

    EASN1ObjectPrivate *priv;
};

struct _EASN1ObjectClass {
    GObjectClass parent_class;

    /* Padding for future expansion */
    void (*_ecert_reserved0) (void);
    void (*_ecert_reserved1) (void);
    void (*_ecert_reserved2) (void);
    void (*_ecert_reserved3) (void);
    void (*_ecert_reserved4) (void);
};

GType       e_asn1_object_get_type          (void);
EASN1Object *   e_asn1_object_new           (void);
EASN1Object *   e_asn1_object_new_from_cert     (CERTCertificate *cert);

void        e_asn1_object_set_valid_container   (EASN1Object *obj,
                             gboolean flag);
gboolean    e_asn1_object_is_valid_container    (EASN1Object *obj);
PRUint32    e_asn1_object_get_asn1_type     (EASN1Object *obj);
PRUint32    e_asn1_object_get_asn1_tag      (EASN1Object *obj);
GList *     e_asn1_object_get_children      (EASN1Object *obj);
void        e_asn1_object_append_child      (EASN1Object *parent,
                             EASN1Object *child);
void        e_asn1_object_set_display_name      (EASN1Object *obj,
                             const gchar *name);
const gchar *   e_asn1_object_get_display_name      (EASN1Object *obj);
void        e_asn1_object_set_display_value     (EASN1Object *obj,
                             const gchar *value);
const gchar *   e_asn1_object_get_display_value     (EASN1Object *obj);

void        e_asn1_object_get_data          (EASN1Object *obj,
                             gchar **data,
                             guint32 *len);

#endif /* E_ASN1_OBJECT_H */