~ubuntu-branches/ubuntu/raring/wxwidgets2.8/raring

« back to all changes in this revision

Viewing changes to wxPython/src/gtk/_gdi_wrap.cpp

  • Committer: Package Import Robot
  • Author(s): Stéphane Graber
  • Date: 2012-01-07 13:59:25 UTC
  • mfrom: (1.1.9) (5.1.10 sid)
  • Revision ID: package-import@ubuntu.com-20120107135925-2601miy9ullcon9j
Tags: 2.8.12.1-6ubuntu1
* Resync from Debian, changes that were kept:
  - debian/rules: re-enable mediactrl. This allows libwx_gtk2u_media-2.8 to be
    built, as this is required by some applications (LP: #632984)
  - debian/control: Build-dep on libxt-dev for mediactrl.
  - Patches
    + fix-bashism-in-example
* Add conflict on python-wxgtk2.8 (<< 2.8.12.1-6ubuntu1~) to python-wxversion
  to guarantee upgrade ordering when moving from pycentral to dh_python2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3276
3276
                
3277
3277
                CHECK_BUFFERSIZE(stride * height);
3278
3278
                
3279
 
                if (depth == 24) {
 
3279
                if (useAlpha && depth == 32) {
 
3280
                    MAKE_PIXDATA(wxAlphaPixelData);
 
3281
                    for (int y=0; y<height; y++) {
 
3282
                        p.MoveTo(pixData, 0, y);
 
3283
                        bufptr = (wxUint32*)dataRow;
 
3284
                        for (int x=0; x<width; x++) {
 
3285
                            value =
 
3286
                                (p.Alpha() << 24) |
 
3287
                                (p.Red() << 16) |
 
3288
                                (p.Green() << 8) |
 
3289
                                (p.Blue());
 
3290
                            *bufptr = value;
 
3291
                            ++p;    
 
3292
                            ++bufptr;
 
3293
                        }
 
3294
                        dataRow += stride;
 
3295
                    }
 
3296
                }
 
3297
                else // if (!useAlpha /*depth == 24*/)
 
3298
                {
3280
3299
                    MAKE_PIXDATA(wxNativePixelData);
3281
3300
                    for (int y=0; y<height; y++) {
3282
3301
                        p.MoveTo(pixData, 0, y);
3294
3313
                        dataRow += stride;
3295
3314
                    }
3296
3315
                }
3297
 
                if (depth == 32) {
3298
 
                    MAKE_PIXDATA(wxAlphaPixelData);
3299
 
                    if (useAlpha)
3300
 
                        pixData.UseAlpha();
3301
 
                    for (int y=0; y<height; y++) {
3302
 
                        p.MoveTo(pixData, 0, y);
3303
 
                        bufptr = (wxUint32*)dataRow;
3304
 
                        for (int x=0; x<width; x++) {
3305
 
                            value =
3306
 
                                (p.Alpha() << 24) |
3307
 
                                (p.Red() << 16) |
3308
 
                                (p.Green() << 8) |
3309
 
                                (p.Blue());
3310
 
                            *bufptr = value;
3311
 
                            ++p;    
3312
 
                            ++bufptr;
3313
 
                        }
3314
 
                        dataRow += stride;
3315
 
                    }
3316
 
                }
3317
3316
                break;
3318
3317
            }
3319
3318
        }
22666
22665
SWIGINTERN PyObject *_wrap_DC_GetTextBackground(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22667
22666
  PyObject *resultobj = 0;
22668
22667
  wxDC *arg1 = (wxDC *) 0 ;
22669
 
  wxColour *result = 0 ;
 
22668
  wxColour result;
22670
22669
  void *argp1 = 0 ;
22671
22670
  int res1 = 0 ;
22672
22671
  PyObject *swig_obj[1] ;
22680
22679
  arg1 = reinterpret_cast< wxDC * >(argp1);
22681
22680
  {
22682
22681
    PyThreadState* __tstate = wxPyBeginAllowThreads();
22683
 
    {
22684
 
      wxColour const &_result_ref = ((wxDC const *)arg1)->GetTextBackground();
22685
 
      result = (wxColour *) &_result_ref;
22686
 
    }
 
22682
    result = ((wxDC const *)arg1)->GetTextBackground();
22687
22683
    wxPyEndAllowThreads(__tstate);
22688
22684
    if (PyErr_Occurred()) SWIG_fail;
22689
22685
  }
22690
 
  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_wxColour, 0 |  0 );
 
22686
  resultobj = SWIG_NewPointerObj((new wxColour(static_cast< const wxColour& >(result))), SWIGTYPE_p_wxColour, SWIG_POINTER_OWN |  0 );
22691
22687
  return resultobj;
22692
22688
fail:
22693
22689
  return NULL;
22697
22693
SWIGINTERN PyObject *_wrap_DC_GetTextForeground(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22698
22694
  PyObject *resultobj = 0;
22699
22695
  wxDC *arg1 = (wxDC *) 0 ;
22700
 
  wxColour *result = 0 ;
 
22696
  wxColour result;
22701
22697
  void *argp1 = 0 ;
22702
22698
  int res1 = 0 ;
22703
22699
  PyObject *swig_obj[1] ;
22711
22707
  arg1 = reinterpret_cast< wxDC * >(argp1);
22712
22708
  {
22713
22709
    PyThreadState* __tstate = wxPyBeginAllowThreads();
22714
 
    {
22715
 
      wxColour const &_result_ref = ((wxDC const *)arg1)->GetTextForeground();
22716
 
      result = (wxColour *) &_result_ref;
22717
 
    }
 
22710
    result = ((wxDC const *)arg1)->GetTextForeground();
22718
22711
    wxPyEndAllowThreads(__tstate);
22719
22712
    if (PyErr_Occurred()) SWIG_fail;
22720
22713
  }
22721
 
  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_wxColour, 0 |  0 );
 
22714
  resultobj = SWIG_NewPointerObj((new wxColour(static_cast< const wxColour& >(result))), SWIGTYPE_p_wxColour, SWIG_POINTER_OWN |  0 );
22722
22715
  return resultobj;
22723
22716
fail:
22724
22717
  return NULL;