~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to app/dialogs/tips-parser.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* The GIMP -- an image manipulation program
 
1
/* GIMP - The GNU Image Manipulation Program
2
2
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
3
3
 *
4
4
 * tips-parser.c -- Parse the gimp-tips.xml file.
23
23
 
24
24
#include <string.h>
25
25
 
26
 
#include <glib.h>
 
26
#include <glib-object.h>
27
27
 
28
28
#include "config/config-types.h"
29
29
#include "config/gimpxmlparser.h"
106
106
 
107
107
 
108
108
GimpTip *
109
 
gimp_tip_new  (const gchar *welcome,
110
 
               const gchar *thetip)
 
109
gimp_tip_new  (const gchar *format,
 
110
               ...)
111
111
{
112
 
  GimpTip *tip = g_new (GimpTip, 1);
113
 
 
114
 
  tip->welcome = welcome ? g_strdup (welcome) : NULL;
115
 
  tip->thetip  = thetip  ? g_strdup (thetip)  : NULL;
 
112
  GimpTip *tip;
 
113
  va_list  args;
 
114
 
 
115
  g_return_val_if_fail (format != NULL, NULL);
 
116
 
 
117
  tip = g_new0 (GimpTip, 1);
 
118
 
 
119
  va_start (args, format);
 
120
 
 
121
  tip->welcome = g_strdup_vprintf (format, args);
 
122
 
 
123
  va_end (args);
116
124
 
117
125
  return tip;
118
126
}
119
127
 
120
128
void
 
129
gimp_tip_set (GimpTip     *tip,
 
130
              const gchar *format,
 
131
              ...)
 
132
{
 
133
  va_list args;
 
134
 
 
135
  g_return_if_fail (tip != NULL);
 
136
  g_return_if_fail (format != NULL);
 
137
 
 
138
  va_start (args, format);
 
139
 
 
140
  g_free (tip->thetip);
 
141
  tip->thetip = g_strdup_vprintf (format, args);
 
142
 
 
143
  va_end (args);
 
144
}
 
145
 
 
146
void
121
147
gimp_tip_free (GimpTip *tip)
122
148
{
123
 
  if (!tip)
 
149
  if (! tip)
124
150
    return;
125
151
 
126
152
  g_free (tip->welcome);
164
190
   */
165
191
  tips_locale = _("tips-locale:C");
166
192
 
167
 
  if (strncmp (tips_locale, "tips-locale:", 12) == 0)
 
193
  if (g_str_has_prefix (tips_locale, "tips-locale:"))
168
194
    {
169
 
      tips_locale += 12;
 
195
      tips_locale += strlen ("tips-locale:");
 
196
 
170
197
      if (*tips_locale && *tips_locale != 'C')
171
198
        parser->locale = tips_locale;
172
199
    }