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

« back to all changes in this revision

Viewing changes to app/core/gimpimage-pick-color.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-2001 Spencer Kimball, Peter Mattis, and others
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify
22
22
 
23
23
#include "core-types.h"
24
24
 
25
 
#include "core/gimpdrawable.h"
26
 
#include "core/gimpimage.h"
27
 
#include "core/gimpimage-pick-color.h"
28
 
#include "core/gimppickable.h"
 
25
#include "gimpdrawable.h"
 
26
#include "gimpimage.h"
 
27
#include "gimpimage-pick-color.h"
 
28
#include "gimppickable.h"
29
29
 
30
30
 
31
31
gboolean
32
 
gimp_image_pick_color (GimpImage     *gimage,
 
32
gimp_image_pick_color (GimpImage     *image,
33
33
                       GimpDrawable  *drawable,
34
34
                       gint           x,
35
35
                       gint           y,
42
42
{
43
43
  GimpPickable *pickable;
44
44
 
45
 
  g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE);
46
 
  g_return_val_if_fail (sample_merged || GIMP_IS_DRAWABLE (drawable), FALSE);
 
45
  g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
 
46
  g_return_val_if_fail (drawable == NULL || GIMP_IS_DRAWABLE (drawable), FALSE);
47
47
  g_return_val_if_fail (drawable == NULL ||
48
 
                        gimp_item_get_image (GIMP_ITEM (drawable)) == gimage,
 
48
                        gimp_item_get_image (GIMP_ITEM (drawable)) == image,
49
49
                        FALSE);
50
50
 
 
51
  if (! sample_merged)
 
52
    {
 
53
      if (! drawable)
 
54
        drawable = gimp_image_active_drawable (image);
 
55
 
 
56
      if (! drawable)
 
57
        return FALSE;
 
58
    }
 
59
 
51
60
  if (sample_merged)
52
61
    {
53
 
      pickable = GIMP_PICKABLE (gimage->projection);
 
62
      pickable = GIMP_PICKABLE (image->projection);
54
63
    }
55
64
  else
56
65
    {
63
72
      pickable = GIMP_PICKABLE (drawable);
64
73
    }
65
74
 
 
75
  /* Do *not* call gimp_pickable_flush() here because it's too expensive
 
76
   * to call it unconditionally each time e.g. the cursor view is updated.
 
77
   * Instead, call gimp_pickable_flush() in the callers if needed.
 
78
   */
 
79
 
66
80
  if (sample_type)
67
81
    *sample_type = gimp_pickable_get_image_type (pickable);
68
82