[Fxruby-commits] CVS: FXRuby/ext/fox/include FXMemoryBuffer.h,NONE,1.1.2.1 FXRuby.h,1.21.2.1,1.21.2.
Status: Inactive
Brought to you by:
lyle
|
From: Lyle J. <ly...@us...> - 2002-05-08 16:45:12
|
Update of /cvsroot/fxruby/FXRuby/ext/fox/include
In directory usw-pr-cvs1:/tmp/cvs-serv5170/ext/fox/include
Modified Files:
Tag: release10
FXRuby.h
Added Files:
Tag: release10
FXMemoryBuffer.h
Log Message:
Modified the interface to FXImage#data so that it returns an
FXMemoryBuffer instance instead of a string (See SF Bug #550996).
The primary difference is that FXMemoryBuffer wraps the actual
data pointer stored by the FXImage instead of making a copy; this
way you should be able to modify the buffer and re-render the image
as you can in C++.
--- NEW FILE: FXMemoryBuffer.h ---
/***********************************************************************
* FXRuby -- the Ruby language bindings for the FOX GUI toolkit.
* Copyright (c) 2001 by J. Lyle Johnson. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* For further information please contact the author by e-mail
* at "ly...@us...".
***********************************************************************/
/***********************************************************************
* $Id: FXMemoryBuffer.h,v 1.1.2.1 2002/05/08 16:45:09 lyle Exp $
***********************************************************************/
#ifndef FXMEMORYBUFFER_H
#define FXMEMORYBUFFER_H
class FXMemoryBuffer {
protected:
FXMemoryBuffer();
FXMemoryBuffer(const FXMemoryBuffer&);
FXMemoryBuffer& operator=(const FXMemoryBuffer&);
private:
FXuchar *buffer;
FXuint size;
public:
// Create an memory buffer object
FXMemoryBuffer(FXuchar *data,FXuint sz) : buffer(data),size(sz){}
// Returns a pointer to the data
FXuchar* getData() const { return buffer; }
// Returns the size (in bytes)
FXuint getSize() const { return size; }
// Destructor
~FXMemoryBuffer(){}
};
#endif
Index: FXRuby.h
===================================================================
RCS file: /cvsroot/fxruby/FXRuby/ext/fox/include/FXRuby.h,v
retrieving revision 1.21.2.1
retrieving revision 1.21.2.2
diff -C2 -d -r1.21.2.1 -r1.21.2.2
*** FXRuby.h 30 Apr 2002 01:54:47 -0000 1.21.2.1
--- FXRuby.h 8 May 2002 16:45:09 -0000 1.21.2.2
***************
*** 439,442 ****
--- 439,443 ----
#include "FXRbDrawable.h"
#include "FXRbBitmap.h"
+ #include "FXMemoryBuffer.h"
#include "FXRbImage.h"
#include "FXRbBMPImage.h"
|