~ubuntu-branches/ubuntu/vivid/gimp/vivid

« back to all changes in this revision

Viewing changes to libgimp/gimpimagecombobox.c

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach
  • Date: 2012-05-08 18:50:03 UTC
  • mto: (1.1.26) (0.5.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 71.
  • Revision ID: package-import@ubuntu.com-20120508185003-tltkvbaysf8d2426
ImportĀ upstreamĀ versionĀ 2.8.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 * gimpimagecombobox.c
5
5
 * Copyright (C) 2004 Sven Neumann <sven@gimp.org>
6
6
 *
7
 
 * This library is free software; you can redistribute it and/or
 
7
 * This library is free software: you can redistribute it and/or
8
8
 * modify it under the terms of the GNU Lesser General Public
9
9
 * License as published by the Free Software Foundation; either
10
 
 * version 2 of the License, or (at your option) any later version.
 
10
 * version 3 of the License, or (at your option) any later version.
11
11
 *
12
12
 * This library is distributed in the hope that it will be useful,
13
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
15
 * Lesser General Public License for more details.
16
16
 *
17
17
 * You should have received a copy of the GNU Lesser General Public
18
 
 * License along with this library; if not, write to the
19
 
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20
 
 * Boston, MA 02111-1307, USA.
 
18
 * License along with this library.  If not, see
 
19
 * <http://www.gnu.org/licenses/>.
21
20
 */
22
21
 
23
22
#include "config.h"
35
34
#include "gimppixbuf.h"
36
35
 
37
36
 
 
37
/**
 
38
 * SECTION: gimpimagecombobox
 
39
 * @title: GimpImageComboBox
 
40
 * @short_description: A widget providing a popup menu of images.
 
41
 *
 
42
 * A widget providing a popup menu of images.
 
43
 **/
 
44
 
 
45
 
38
46
#define THUMBNAIL_SIZE   24
39
47
#define WIDTH_REQUEST   200
40
48
 
102
110
 * each image and only if the function returns %TRUE, the image is
103
111
 * added to the combobox.
104
112
 *
105
 
 * You should use gimp_int_combo_connect() to initialize and connect
106
 
 * the combo. Use gimp_int_combo_box_set_active() to get the active
107
 
 * image ID and gimp_int_combo_box_get_active() to retrieve the ID of
108
 
 * the selected image.
 
113
 * You should use gimp_int_combo_box_connect() to initialize and
 
114
 * connect the combo. Use gimp_int_combo_box_set_active() to get the
 
115
 * active image ID and gimp_int_combo_box_get_active() to retrieve the
 
116
 * ID of the selected image.
109
117
 *
110
118
 * Return value: a new #GimpIntComboBox.
111
119
 *
191
199
                                         guint             info,
192
200
                                         guint             time)
193
201
{
 
202
  gint   length = gtk_selection_data_get_length (selection);
194
203
  gchar *str;
195
204
 
196
 
  if ((selection->format != 8) || (selection->length < 1))
 
205
  if (gtk_selection_data_get_format (selection) != 8 || length < 1)
197
206
    {
198
 
      g_warning ("Received invalid image ID data!");
 
207
      g_warning ("%s: received invalid image ID data", G_STRFUNC);
199
208
      return;
200
209
    }
201
210
 
202
 
  str = g_strndup ((const gchar *) selection->data, selection->length);
 
211
  str = g_strndup ((const gchar *) gtk_selection_data_get_data (selection),
 
212
                   length);
203
213
 
204
214
  if (g_utf8_validate (str, -1, NULL))
205
215
    {