~ubuntu-branches/debian/sid/geany-plugins/sid

« back to all changes in this revision

Viewing changes to geanygendoc/src/ggd-widget-frame.c

  • Committer: Bazaar Package Importer
  • Author(s): Evgeni Golov, Chow Loong Jin, Evgeni Golov
  • Date: 2010-09-04 23:05:00 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100904230500-4n99m507u6drouv5
Tags: 0.19-1
[ Chow Loong Jin ]
* New upstream release
  + Builds against geany 0.19 (Closes: #590346, #587141)
* debian/control, debian/rules:
  + Shift geany dependency to geany-plugins-common instead, since it's a
    common dependency for all plugins
* debian/control:
  + Add new packages for codenav, extrasel, gendoc, insertnum,
    prettyprinter and treebrowser plugins
  + Update build-deps:
    - Bump geany dependency to 0.19. (Closes: #573318)
    - Add libctpl-dev and python-docutils for geanygendoc
    - Add libxml2-dev for prettyprinter
  + No-change bump of Standards-Version from 3.8.3 to 3.9.0
  + Tighten dependency on geany-plugins-common (= instead of >=)
  + Add a Breaks on all geany-plugin-* packages prior to this version to
    ensure geany-plugins-common and geany-plugin-* versions match
* debian/geany-plugin-codenav.{docs,install},
  debian/geany-plugin-extrasel.{docs,install},
  geany-plugin-gendoc.{docs,install},
  geany-plugin-insertnum.{docs,install},
  geany-plugin-prettyprinter.install
  geany-plugin-treebrowser.{docs,install}:
  + Install plugin files into individual packages

[ Evgeni Golov ]
* debian/control:
  + Disable the new plugins for now.
    If you want to build them localy, just uncomment them.
  + Don't D-B on libctpl-dev (it's not in Debian yet).
  + Add myself to Uploaders.
  + Standards-Version: 3.9.1
* debian/copyright:
  + Update to include latest plugins.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  
 
3
 *  GeanyGenDoc, a Geany plugin to ease generation of source code documentation
 
4
 *  Copyright (C) 2010  Colomban Wendling <ban@herbesfolles.org>
 
5
 *  
 
6
 *  This program is free software: you can redistribute it and/or modify
 
7
 *  it under the terms of the GNU General Public License as published by
 
8
 *  the Free Software Foundation, either version 3 of the License, or
 
9
 *  (at your option) any later version.
 
10
 *  
 
11
 *  This program is distributed in the hope that it will be useful,
 
12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 *  GNU General Public License for more details.
 
15
 *  
 
16
 *  You should have received a copy of the GNU General Public License
 
17
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
18
 *  
 
19
 */
 
20
 
 
21
/*
 
22
 * A GtkFrame subclass that reproduce Glade's frames.
 
23
 */
 
24
 
 
25
#include <gtk/gtk.h>
 
26
 
 
27
#include "ggd-widget-frame.h"
 
28
 
 
29
 
 
30
struct _GgdFramePrivate
 
31
{
 
32
  PangoAttrList  *label_attr_list;
 
33
  GtkWidget      *alignment;
 
34
};
 
35
 
 
36
 
 
37
G_DEFINE_TYPE (GgdFrame, ggd_frame, GTK_TYPE_FRAME)
 
38
 
 
39
 
 
40
static void
 
41
ggd_frame_add (GtkContainer *container,
 
42
               GtkWidget    *child)
 
43
{
 
44
  GgdFrame *self = GGD_FRAME (container);
 
45
  
 
46
  /* chain additions to the alignment if we aren't adding it */
 
47
  if (child == self->priv->alignment) {
 
48
    GTK_CONTAINER_CLASS (ggd_frame_parent_class)->add (container, child);
 
49
  } else {
 
50
    container = GTK_CONTAINER (self->priv->alignment);
 
51
    GTK_CONTAINER_GET_CLASS (container)->add (container, child);
 
52
  }
 
53
}
 
54
 
 
55
static void
 
56
ggd_frame_finalize (GObject *object)
 
57
{
 
58
  GgdFrame *self = GGD_FRAME (object);
 
59
  
 
60
  pango_attr_list_unref (self->priv->label_attr_list);
 
61
  
 
62
  G_OBJECT_CLASS (ggd_frame_parent_class)->finalize (object);
 
63
}
 
64
 
 
65
static void
 
66
ggd_frame_class_init (GgdFrameClass *klass)
 
67
{
 
68
  GObjectClass       *object_class    = G_OBJECT_CLASS (klass);
 
69
  GtkContainerClass  *container_class = GTK_CONTAINER_CLASS (klass);
 
70
  
 
71
  object_class->finalize  = ggd_frame_finalize;
 
72
  container_class->add    = ggd_frame_add;
 
73
  
 
74
  g_type_class_add_private (klass, sizeof (GgdFramePrivate));
 
75
}
 
76
 
 
77
static void
 
78
ggd_frame_label_notify (GObject     *object,
 
79
                        GParamSpec  *pspec,
 
80
                        gpointer     data)
 
81
{
 
82
  GgdFrame   *self = GGD_FRAME (object);
 
83
  GtkWidget  *label;
 
84
  
 
85
  label = gtk_frame_get_label_widget (GTK_FRAME (self));
 
86
  if (label) {
 
87
    gtk_label_set_attributes (GTK_LABEL (label), self->priv->label_attr_list);
 
88
  }
 
89
}
 
90
 
 
91
static void
 
92
ggd_frame_init (GgdFrame *self)
 
93
{
 
94
  self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
 
95
                                            GGD_FRAME_TYPE,
 
96
                                            GgdFramePrivate);
 
97
  
 
98
  /* set-up the frame attributes */
 
99
  gtk_frame_set_shadow_type (GTK_FRAME (self), GTK_SHADOW_NONE);
 
100
  /* set-up fake child */
 
101
  self->priv->alignment = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
 
102
  gtk_alignment_set_padding (GTK_ALIGNMENT(self->priv->alignment), 0, 0, 12, 0);
 
103
  gtk_container_add (GTK_CONTAINER (self), self->priv->alignment);
 
104
  gtk_widget_show (self->priv->alignment);
 
105
  /* set-up the label's attributes */
 
106
  self->priv->label_attr_list = pango_attr_list_new ();
 
107
  pango_attr_list_insert (self->priv->label_attr_list,
 
108
                          pango_attr_weight_new (PANGO_WEIGHT_BOLD));
 
109
  
 
110
  g_signal_connect (self, "notify::label",
 
111
                    G_CALLBACK (ggd_frame_label_notify), NULL);
 
112
}
 
113
 
 
114
 
 
115
GtkWidget *
 
116
ggd_frame_new (const gchar *label)
 
117
{
 
118
  return g_object_new (GGD_FRAME_TYPE, "label", label, NULL);
 
119
}