~bratsche/ubuntu/maverick/gtk+2.0/menu-activation-fix

« back to all changes in this revision

Viewing changes to gdk/gdkpixbuf-render.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Ancell
  • Date: 2010-07-22 21:41:30 UTC
  • mfrom: (1.11.7 upstream) (72.1.16 experimental)
  • Revision ID: james.westby@ubuntu.com-20100722214130-5uzyvpb9g4m0ts2c
Tags: 2.21.5-1ubuntu1
* Merge with Debian experimental, Ubuntu changes:
* debian/control.in:
  - Add introspection build-depends
  - Add Vcs-Bzr link
  - Add gir1.0-gtk-2.0 package
  - libgtk2.0-dev replaces gir-repository-dev
  - Conflict with appmenu-gtk (<< 0.1.3) to prevent menu proxy breakage
* debian/rules:
  - Build with --enable-introspection
  - Add gir1.0-gtk-2.0 package to BINARY_ARCH_PKGS
  - Add dh_girepository call
  - Disable devhelp files
* debian/dh_gtkmodules.in:
  - Remove obsolete script content
* debian/libgtk2.0-0.symbols:
  - Add Ubuntu specific symbols
* debian/libgtk2.0-dev.install.in:
  - Add gir files
* debian/libgtk2.0-doc.install.in
  - Disable devhelp files
* debian/gir1.0-gtk-2.0.install.in
  - Introspection package
* debian/patches/043_menu_proxy.patch
  - Add GtkMenuProxy support for remoting menus.
* debian/patches/062_dnd_menubar.patch:
  - Allow click on menubars for dnd
* debian/patches/063_treeview_almost_fixed.patch:
  - Add an ubuntu-almost-fixed-height-mode property, (required for
    software-center)
* debian/patches/071_no_offscreen_widgets_grabbing.patch:
  - Don't let offscreen widgets do grabbing
* debian/patches/072_indicator_menu_update.patch:
  - change by Cody Russell to send an update event on menu changes,
    should make the bluetooth indicator refresh correctly
* debian/patches/091_bugzilla_tooltip_refresh.patch:
  - Upstream bugzilla change to have better looking tooltips the gtk theme
    need to set "new-tooltip-style" to use those
* debian/watch:
  - Watch for unstable versions

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
#include "config.h"
24
24
#include <gdk/gdk.h>
25
 
#include "gdk-pixbuf-private.h"
 
25
#include <gdk-pixbuf/gdk-pixbuf.h>
26
26
#include "gdkpixbuf.h"
27
27
#include "gdkscreen.h"
28
28
#include "gdkinternals.h"
63
63
  int start, start_status;
64
64
  int status;
65
65
 
66
 
  g_return_if_fail (GDK_IS_PIXBUF (pixbuf));
67
 
  g_return_if_fail (pixbuf->colorspace == GDK_COLORSPACE_RGB);
68
 
  g_return_if_fail (pixbuf->n_channels == 3 || pixbuf->n_channels == 4);
69
 
  g_return_if_fail (pixbuf->bits_per_sample == 8);
 
66
  g_return_val_if_fail (gdk_pixbuf_get_colorspace (pixbuf) == GDK_COLORSPACE_RGB, NULL);
 
67
  g_return_val_if_fail (gdk_pixbuf_get_n_channels (pixbuf) == 3 ||
 
68
                        gdk_pixbuf_get_n_channels (pixbuf) == 4, NULL);
 
69
  g_return_val_if_fail (gdk_pixbuf_get_bits_per_sample (pixbuf) == 8, NULL);
70
70
 
71
71
  if (width == -1) 
72
 
    width = pixbuf->width;
 
72
    width = gdk_pixbuf_get_width (pixbuf);
73
73
  if (height == -1)
74
 
    height = pixbuf->height;
 
74
    height = gdk_pixbuf_get_height (pixbuf);
75
75
 
76
76
  g_return_if_fail (bitmap != NULL);
77
77
  g_return_if_fail (width >= 0 && height >= 0);
78
 
  g_return_if_fail (src_x >= 0 && src_x + width <= pixbuf->width);
79
 
  g_return_if_fail (src_y >= 0 && src_y + height <= pixbuf->height);
 
78
  g_return_if_fail (src_x >= 0 && src_x + width <= gdk_pixbuf_get_width (pixbuf));
 
79
  g_return_if_fail (src_y >= 0 && src_y + height <= gdk_pixbuf_get_height (pixbuf));
80
80
 
81
81
  g_return_if_fail (alpha_threshold >= 0 && alpha_threshold <= 255);
82
82
 
85
85
 
86
86
  gc = _gdk_drawable_get_scratch_gc (bitmap, FALSE);
87
87
 
88
 
  if (!pixbuf->has_alpha)
 
88
  if (!gdk_pixbuf_get_has_alpha (pixbuf))
89
89
    {
90
90
      color.pixel = (alpha_threshold == 255) ? 0 : 1;
91
91
      gdk_gc_set_foreground (gc, &color);
102
102
 
103
103
  for (y = 0; y < height; y++)
104
104
    {
105
 
      p = (pixbuf->pixels + (y + src_y) * pixbuf->rowstride + src_x * pixbuf->n_channels
106
 
           + pixbuf->n_channels - 1);
 
105
      p = (gdk_pixbuf_get_pixels (pixbuf) + (y + src_y) * gdk_pixbuf_get_rowstride (pixbuf) + src_x * gdk_pixbuf_get_n_channels (pixbuf)
 
106
           + gdk_pixbuf_get_n_channels (pixbuf) - 1);
107
107
            
108
108
      start = 0;
109
109
      start_status = *p < alpha_threshold;
123
123
              start_status = status;
124
124
            }
125
125
          
126
 
          p += pixbuf->n_channels;
 
126
          p += gdk_pixbuf_get_n_channels (pixbuf);
127
127
        }
128
128
      
129
129
      if (!start_status)