~ubuntu-branches/debian/wheezy/brasero/wheezy

« back to all changes in this revision

Viewing changes to src/brasero-jacket-buffer.c

  • Committer: Bazaar Package Importer
  • Author(s): Josselin Mouette, Pedro Fragoso, Luca Bruno, Josselin Mouette, Emilio Pozuelo Monfort
  • Date: 2009-06-24 18:59:46 UTC
  • mfrom: (1.2.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20090624185946-iyxkgf3gjptir5y3
Tags: 2.26.2-1
[ Pedro Fragoso ]
* Add myself to Maintainer field
  - Thanks Ondřej Surý
* New upstream version (Closes: #528945)
  - Split package into brasero, libbrasero-media0 and libbrasero-dev
  - Add Replaces to libbrasero-media0
  - Bump libgtk to 2.14.0
  - Remove libnotify Build-dep
  - Add Build-dep libnautilus-extension-dev (>= 2.22.2)
    and install it.
  - Add Build-dep to libsm-dev
  - Add Build-dep on intltool
* Install omf files to prevent crash on Help
* Move gstreamer0.10-plugins-bad to Suggests, and add
  dvdauthor and vcdimager
* Recommends gvfs (Closes: #491827)
* Pass --disable-scrollkeeper in DEB_CONFIGURE_EXTRA_FLAGS
* debian/patches/007-fix-gnome-doc-utils-path.patch:
  - Removed, not needed anymore
* debian/patches/008-fix-volume-identifier-crash.patch:
  - Removed, merged upstream
* debian/patches/011_nautilus_menu_move.patch:
 - Move CD/DVD Creator Menu to Acessories, taken from Ubuntu

[ Luca Bruno ]
* debian/control.in:
  - Add Build-Depend gtk-doc-tools 1.9.
* debian/patches/006-fix-libdvdcss.patch:
  - Removed as applied upstream.

[ Josselin Mouette ]
* New upstream release.
* Update build-dependencies.
* Move the translations and data to a new brasero-common package.
* Rewrite the descriptions.
* Add -dev depends to the development package.
* Remove inappropriate recommends in the library package.
* Let’s not forget dvd+rw-tools so that we can write DVDs too.
* Rework dependencies accordingly.
* Put the nautilus extension in brasero.
* Conflict against nautilus-cd-burner to avoid having two burning 
  extensions.
* Include clean-la.mk and gnome-version.mk; build-depend on 
  gnome-pkg-tools 0.7.
* Don’t run dh_makeshlibs on brasero and libbrasero-plugins.
* 011_nautilus_menu_move.patch: add NoDisplay=true, this icon is 
  duplicating existing functionality (brasero icon in sound&video 
  menu, and nautilus autorun).
* Update list of copyright holders.

[ Emilio Pozuelo Monfort ]
* debian/copyright: updated.

[ Josselin Mouette ]
* copyright: improve indentation, and point to versioned LGPL.
* 090_relibtoolize.patch: add a relibtoolization patch to avoid the 
  rpath crap.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
2
2
/*
3
3
 * brasero
4
 
 * Copyright (C) Philippe Rouquier 2008 <bonfire-app@wanadoo.fr>
 
4
 * Copyright (C) Philippe Rouquier 2005-2008 <bonfire-app@wanadoo.fr>
5
5
 * 
6
6
 * brasero is free software: you can redistribute it and/or modify it
7
7
 * under the terms of the GNU General Public License as published by the
56
56
        return gtk_text_buffer_get_text (GTK_TEXT_BUFFER (self), start, end, invisible_chars);
57
57
}
58
58
 
 
59
/* As the name suggests it is copied from GTK 2.14.3
 
60
 * It was changed to use GSList * as arguments */
 
61
static void
 
62
_gtk_text_attributes_fill_from_tags (GtkTextAttributes *dest,
 
63
                                     GSList            *tags)
 
64
{
 
65
  guint left_margin_accumulative = 0;
 
66
  guint right_margin_accumulative = 0;
 
67
 
 
68
  g_return_if_fail (!dest->realized);
 
69
 
 
70
  for (; tags; tags = tags->next)
 
71
    {
 
72
      GtkTextTag *tag;
 
73
      GtkTextAttributes *vals;
 
74
 
 
75
      tag = tags->data;
 
76
      vals = tag->values;
 
77
 
 
78
      if (tag->bg_color_set)
 
79
        {
 
80
          dest->appearance.bg_color = vals->appearance.bg_color;
 
81
 
 
82
          dest->appearance.draw_bg = TRUE;
 
83
        }
 
84
      if (tag->fg_color_set)
 
85
        dest->appearance.fg_color = vals->appearance.fg_color;
 
86
      
 
87
      if (tag->pg_bg_color_set)
 
88
        {
 
89
          dest->pg_bg_color = gdk_color_copy (vals->pg_bg_color);
 
90
        }
 
91
 
 
92
      if (tag->bg_stipple_set)
 
93
        {
 
94
          g_object_ref (vals->appearance.bg_stipple);
 
95
          if (dest->appearance.bg_stipple)
 
96
            g_object_unref (dest->appearance.bg_stipple);
 
97
          dest->appearance.bg_stipple = vals->appearance.bg_stipple;
 
98
 
 
99
          dest->appearance.draw_bg = TRUE;
 
100
        }
 
101
 
 
102
      if (tag->fg_stipple_set)
 
103
        {
 
104
          g_object_ref (vals->appearance.fg_stipple);
 
105
          if (dest->appearance.fg_stipple)
 
106
            g_object_unref (dest->appearance.fg_stipple);
 
107
          dest->appearance.fg_stipple = vals->appearance.fg_stipple;
 
108
        }
 
109
 
 
110
      if (vals->font)
 
111
        {
 
112
          if (dest->font)
 
113
            pango_font_description_merge (dest->font, vals->font, TRUE);
 
114
          else
 
115
            dest->font = pango_font_description_copy (vals->font);
 
116
        }
 
117
 
 
118
      /* multiply all the scales together to get a composite */
 
119
      if (tag->scale_set)
 
120
        dest->font_scale *= vals->font_scale;
 
121
      
 
122
      if (tag->justification_set)
 
123
        dest->justification = vals->justification;
 
124
 
 
125
      if (vals->direction != GTK_TEXT_DIR_NONE)
 
126
        dest->direction = vals->direction;
 
127
 
 
128
      if (tag->left_margin_set) 
 
129
        {
 
130
          if (tag->accumulative_margin)
 
131
            left_margin_accumulative += vals->left_margin;
 
132
          else
 
133
            dest->left_margin = vals->left_margin;
 
134
        }
 
135
 
 
136
      if (tag->indent_set)
 
137
        dest->indent = vals->indent;
 
138
 
 
139
      if (tag->rise_set)
 
140
        dest->appearance.rise = vals->appearance.rise;
 
141
 
 
142
      if (tag->right_margin_set) 
 
143
        {
 
144
          if (tag->accumulative_margin)
 
145
            right_margin_accumulative += vals->right_margin;
 
146
          else
 
147
            dest->right_margin = vals->right_margin;
 
148
        }
 
149
 
 
150
      if (tag->pixels_above_lines_set)
 
151
        dest->pixels_above_lines = vals->pixels_above_lines;
 
152
 
 
153
      if (tag->pixels_below_lines_set)
 
154
        dest->pixels_below_lines = vals->pixels_below_lines;
 
155
 
 
156
      if (tag->pixels_inside_wrap_set)
 
157
        dest->pixels_inside_wrap = vals->pixels_inside_wrap;
 
158
 
 
159
      if (tag->tabs_set)
 
160
        {
 
161
          if (dest->tabs)
 
162
            pango_tab_array_free (dest->tabs);
 
163
          dest->tabs = pango_tab_array_copy (vals->tabs);
 
164
        }
 
165
 
 
166
      if (tag->wrap_mode_set)
 
167
        dest->wrap_mode = vals->wrap_mode;
 
168
 
 
169
      if (tag->underline_set)
 
170
        dest->appearance.underline = vals->appearance.underline;
 
171
 
 
172
      if (tag->strikethrough_set)
 
173
        dest->appearance.strikethrough = vals->appearance.strikethrough;
 
174
 
 
175
      if (tag->invisible_set)
 
176
        dest->invisible = vals->invisible;
 
177
 
 
178
      if (tag->editable_set)
 
179
        dest->editable = vals->editable;
 
180
 
 
181
      if (tag->bg_full_height_set)
 
182
        dest->bg_full_height = vals->bg_full_height;
 
183
 
 
184
      if (tag->language_set)
 
185
        dest->language = vals->language;
 
186
    }
 
187
 
 
188
  dest->left_margin += left_margin_accumulative;
 
189
  dest->right_margin += right_margin_accumulative;
 
190
}
 
191
 
59
192
void
60
193
brasero_jacket_buffer_add_default_tag (BraseroJacketBuffer *self,
61
194
                                       GtkTextTag *tag)
63
196
        BraseroJacketBufferPrivate *priv;
64
197
 
65
198
        priv = BRASERO_JACKET_BUFFER_PRIVATE (self);
66
 
        priv->tags = g_slist_prepend (priv->tags, tag);
 
199
 
 
200
        g_object_ref (tag);
 
201
        priv->tags = g_slist_append (priv->tags, tag);
 
202
}
 
203
 
 
204
void
 
205
brasero_jacket_buffer_get_attributes (BraseroJacketBuffer *self,
 
206
                                      GtkTextAttributes *attributes)
 
207
{
 
208
        BraseroJacketBufferPrivate *priv;
 
209
 
 
210
        priv = BRASERO_JACKET_BUFFER_PRIVATE (self);
 
211
 
 
212
        /* Now also merge changes that are 'on hold', that is non applied tags */
 
213
        if (!priv->tags)
 
214
                return;
 
215
 
 
216
        _gtk_text_attributes_fill_from_tags (attributes, priv->tags);
67
217
}
68
218
 
69
219
static void
92
242
        else
93
243
                gtk_text_buffer_get_iter_at_offset (GTK_TEXT_BUFFER (buffer), &iter, pos);
94
244
 
 
245
        g_slist_foreach (priv->tags, (GFunc) g_object_unref, NULL);
95
246
        g_slist_free (priv->tags);
 
247
        priv->tags = NULL;
 
248
 
96
249
        priv->tags = gtk_text_iter_get_tags (&iter);
 
250
        g_slist_foreach (priv->tags, (GFunc) g_object_ref, NULL);
97
251
}
98
252
 
99
253
static void