1. many, many, many warnings fixed (from HP-UX build log; 50% are still left)
2. attempt (failed) at compiling wxGTK with GTK+ 1.3.0 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5152 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
18
configure.in
18
configure.in
@@ -1445,6 +1445,7 @@ GUI_TK_LIBRARY=
|
|||||||
GUI_TK_LINK=
|
GUI_TK_LINK=
|
||||||
|
|
||||||
WXGTK12=
|
WXGTK12=
|
||||||
|
WXGTK13=
|
||||||
|
|
||||||
WXWINE=
|
WXWINE=
|
||||||
|
|
||||||
@@ -1488,9 +1489,17 @@ if test "$wxUSE_CYGWIN" = 1 || test "$wxUSE_MINGW" = 1 ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$wxUSE_GTK" = 1; then
|
if test "$wxUSE_GTK" = 1; then
|
||||||
dnl avoid calling AM_PATH_GTK twice, so check first for the newer version and
|
dnl avoid calling AM_PATH_GTK twice, so check first for the newer version
|
||||||
dnl only then, if it wasn't found, for an older one
|
dnl and only then, if it wasn't found, for an older one
|
||||||
AM_PATH_GTK(1.2.1, WXGTK12=1, AC_MSG_ERROR(Is gtk-config in path and GTK+ is version 1.2.1 or above?))
|
AM_PATH_GTK(1.2.1, WXGTK12=1, AC_MSG_ERROR(Is gtk-config in path and GTK+ is version 1.2.1 or above?))
|
||||||
|
dnl it doesn't really work with 1.3.0 now...
|
||||||
|
dnl AM_PATH_GTK(1.3.0,
|
||||||
|
dnl WXGTK13=1,
|
||||||
|
dnl AM_PATH_GTK(1.2.1,
|
||||||
|
dnl WXGTK12=1,
|
||||||
|
dnl AC_MSG_ERROR(Is gtk-config in path and GTK+ is version 1.2.1 or above?)
|
||||||
|
dnl )
|
||||||
|
dnl )
|
||||||
|
|
||||||
TOOLKIT_INCLUDE="$GTK_CFLAGS"
|
TOOLKIT_INCLUDE="$GTK_CFLAGS"
|
||||||
GUI_TK_LIBRARY="$GTK_LIBS -lgthread"
|
GUI_TK_LIBRARY="$GTK_LIBS -lgthread"
|
||||||
@@ -2234,6 +2243,11 @@ else
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test "$WXGTK13" = 1 ; then
|
||||||
|
AC_DEFINE_UNQUOTED(__WXGTK13__,$WXGTK13)
|
||||||
|
WXGTK12=1
|
||||||
|
fi
|
||||||
|
|
||||||
if test "$WXGTK12" = 1 ; then
|
if test "$WXGTK12" = 1 ; then
|
||||||
AC_DEFINE_UNQUOTED(__WXGTK12__,$WXGTK12)
|
AC_DEFINE_UNQUOTED(__WXGTK12__,$WXGTK12)
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -287,7 +287,8 @@ wxDateTime& wxDateTime::operator+=(const wxDateSpan& diff)
|
|||||||
wxDateTime wxDateTime::ToTimezone(const wxDateTime::TimeZone& tz,
|
wxDateTime wxDateTime::ToTimezone(const wxDateTime::TimeZone& tz,
|
||||||
bool noDST) const
|
bool noDST) const
|
||||||
{
|
{
|
||||||
return wxDateTime(*this).MakeTimezone(tz, noDST);
|
wxDateTime dt(*this);
|
||||||
|
return dt.MakeTimezone(tz, noDST);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -1794,9 +1794,15 @@ typedef struct _GdkColor GdkColor;
|
|||||||
typedef struct _GdkColormap GdkColormap;
|
typedef struct _GdkColormap GdkColormap;
|
||||||
typedef struct _GdkFont GdkFont;
|
typedef struct _GdkFont GdkFont;
|
||||||
typedef struct _GdkGC GdkGC;
|
typedef struct _GdkGC GdkGC;
|
||||||
typedef struct _GdkWindow GdkWindow;
|
#ifdef __WXGTK13__
|
||||||
typedef struct _GdkWindow GdkBitmap;
|
typedef struct _GdkDrawable GdkWindow;
|
||||||
typedef struct _GdkWindow GdkPixmap;
|
typedef struct _GdkDrawable GdkBitmap;
|
||||||
|
typedef struct _GdkDrawable GdkPixmap;
|
||||||
|
#else
|
||||||
|
typedef struct _GdkWindow GdkWindow;
|
||||||
|
typedef struct _GdkWindow GdkBitmap;
|
||||||
|
typedef struct _GdkWindow GdkPixmap;
|
||||||
|
#endif
|
||||||
typedef struct _GdkCursor GdkCursor;
|
typedef struct _GdkCursor GdkCursor;
|
||||||
typedef struct _GdkRegion GdkRegion;
|
typedef struct _GdkRegion GdkRegion;
|
||||||
typedef struct _GdkDragContext GdkDragContext;
|
typedef struct _GdkDragContext GdkDragContext;
|
||||||
|
|||||||
@@ -29,14 +29,23 @@ class wxTextCtrl: public wxTextCtrlBase
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxTextCtrl();
|
wxTextCtrl();
|
||||||
wxTextCtrl( wxWindow *parent, wxWindowID id, const wxString &value = "",
|
wxTextCtrl(wxWindow *parent,
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
wxWindowID id,
|
||||||
int style = 0, const wxValidator& validator = wxDefaultValidator,
|
const wxString &value = wxEmptyString,
|
||||||
const wxString &name = wxTextCtrlNameStr );
|
const wxPoint &pos = wxDefaultPosition,
|
||||||
bool Create( wxWindow *parent, wxWindowID id, const wxString &value = "",
|
const wxSize &size = wxDefaultSize,
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
long style = 0,
|
||||||
int style = 0, const wxValidator& validator = wxDefaultValidator,
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
const wxString &name = wxTextCtrlNameStr );
|
const wxString &name = wxTextCtrlNameStr);
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxString &value = wxEmptyString,
|
||||||
|
const wxPoint &pos = wxDefaultPosition,
|
||||||
|
const wxSize &size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString &name = wxTextCtrlNameStr);
|
||||||
|
|
||||||
// implement base class pure virtuals
|
// implement base class pure virtuals
|
||||||
// ----------------------------------
|
// ----------------------------------
|
||||||
|
|||||||
@@ -29,14 +29,23 @@ class wxTextCtrl: public wxTextCtrlBase
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxTextCtrl();
|
wxTextCtrl();
|
||||||
wxTextCtrl( wxWindow *parent, wxWindowID id, const wxString &value = "",
|
wxTextCtrl(wxWindow *parent,
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
wxWindowID id,
|
||||||
int style = 0, const wxValidator& validator = wxDefaultValidator,
|
const wxString &value = wxEmptyString,
|
||||||
const wxString &name = wxTextCtrlNameStr );
|
const wxPoint &pos = wxDefaultPosition,
|
||||||
bool Create( wxWindow *parent, wxWindowID id, const wxString &value = "",
|
const wxSize &size = wxDefaultSize,
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
long style = 0,
|
||||||
int style = 0, const wxValidator& validator = wxDefaultValidator,
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
const wxString &name = wxTextCtrlNameStr );
|
const wxString &name = wxTextCtrlNameStr);
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxString &value = wxEmptyString,
|
||||||
|
const wxPoint &pos = wxDefaultPosition,
|
||||||
|
const wxSize &size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString &name = wxTextCtrlNameStr);
|
||||||
|
|
||||||
// implement base class pure virtuals
|
// implement base class pure virtuals
|
||||||
// ----------------------------------
|
// ----------------------------------
|
||||||
|
|||||||
@@ -188,12 +188,12 @@ public:
|
|||||||
wxListItemAttr *GetAttributes() const { return m_attr; }
|
wxListItemAttr *GetAttributes() const { return m_attr; }
|
||||||
bool HasAttributes() const { return m_attr != NULL; }
|
bool HasAttributes() const { return m_attr != NULL; }
|
||||||
|
|
||||||
const wxColour& GetTextColour() const
|
wxColour GetTextColour() const
|
||||||
{ return HasAttributes() ? m_attr->GetTextColour() : wxNullColour; }
|
{ return HasAttributes() ? m_attr->GetTextColour() : wxNullColour; }
|
||||||
const wxColour& GetBackgroundColour() const
|
wxColour GetBackgroundColour() const
|
||||||
{ return HasAttributes() ? m_attr->GetBackgroundColour()
|
{ return HasAttributes() ? m_attr->GetBackgroundColour()
|
||||||
: wxNullColour; }
|
: wxNullColour; }
|
||||||
const wxFont& GetFont() const
|
wxFont GetFont() const
|
||||||
{ return HasAttributes() ? m_attr->GetFont() : wxNullFont; }
|
{ return HasAttributes() ? m_attr->GetFont() : wxNullFont; }
|
||||||
|
|
||||||
// these members are public for compatibility
|
// these members are public for compatibility
|
||||||
|
|||||||
@@ -58,7 +58,8 @@
|
|||||||
// both warning and pragma warning are not portable, but at least an
|
// both warning and pragma warning are not portable, but at least an
|
||||||
// unknown pragma should never be an error.
|
// unknown pragma should never be an error.
|
||||||
// Err, actually, Watcom C++ doesn't like it.
|
// Err, actually, Watcom C++ doesn't like it.
|
||||||
#ifndef __WATCOMC__
|
// (well, if the compilers are _that_ broken, I'm removing it (VZ))
|
||||||
|
#if 0 //ndef __WATCOMC__
|
||||||
#pragma warning "Your compiler does not appear to support 64 bit "\
|
#pragma warning "Your compiler does not appear to support 64 bit "\
|
||||||
"integers, using emulation class instead."
|
"integers, using emulation class instead."
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -58,8 +58,12 @@
|
|||||||
/* Define if lex declares yytext as a char * by default, not a char[]. */
|
/* Define if lex declares yytext as a char * by default, not a char[]. */
|
||||||
#undef YYTEXT_POINTER
|
#undef YYTEXT_POINTER
|
||||||
|
|
||||||
|
/* Define this if your version of GTK+ is greater than 1.2 */
|
||||||
#undef __WXGTK12__
|
#undef __WXGTK12__
|
||||||
|
|
||||||
|
/* Define this if your version of GTK+ is greater than 1.3 */
|
||||||
|
#undef __WXGTK13__
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Define to 1 for Unix[-like] system
|
* Define to 1 for Unix[-like] system
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1147,9 +1147,6 @@ wxDateTime& wxDateTime::ResetTime()
|
|||||||
|
|
||||||
wxDateTime::Tm wxDateTime::GetTm(const TimeZone& tz) const
|
wxDateTime::Tm wxDateTime::GetTm(const TimeZone& tz) const
|
||||||
{
|
{
|
||||||
#ifdef __VMS__
|
|
||||||
int time2;
|
|
||||||
#endif
|
|
||||||
wxASSERT_MSG( IsValid(), _T("invalid wxDateTime") );
|
wxASSERT_MSG( IsValid(), _T("invalid wxDateTime") );
|
||||||
|
|
||||||
time_t time = GetTicks();
|
time_t time = GetTicks();
|
||||||
@@ -1167,9 +1164,9 @@ wxDateTime::Tm wxDateTime::GetTm(const TimeZone& tz) const
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
time += tz.GetOffset();
|
time += (time_t)tz.GetOffset();
|
||||||
#ifdef __VMS__ // time is unsigned so avoid warning
|
#ifdef __VMS__ // time is unsigned so avoid warning
|
||||||
time2 = (int) time;
|
int time2 = (int) time;
|
||||||
if ( time2 >= 0 )
|
if ( time2 >= 0 )
|
||||||
#else
|
#else
|
||||||
if ( time >= 0 )
|
if ( time >= 0 )
|
||||||
@@ -1679,9 +1676,6 @@ wxDateTime& wxDateTime::MakeTimezone(const TimeZone& tz, bool noDST)
|
|||||||
|
|
||||||
wxString wxDateTime::Format(const wxChar *format, const TimeZone& tz) const
|
wxString wxDateTime::Format(const wxChar *format, const TimeZone& tz) const
|
||||||
{
|
{
|
||||||
#ifdef __VMS__
|
|
||||||
int time2;
|
|
||||||
#endif
|
|
||||||
wxCHECK_MSG( format, _T(""), _T("NULL format in wxDateTime::Format") );
|
wxCHECK_MSG( format, _T(""), _T("NULL format in wxDateTime::Format") );
|
||||||
|
|
||||||
time_t time = GetTicks();
|
time_t time = GetTicks();
|
||||||
@@ -1701,8 +1695,8 @@ wxString wxDateTime::Format(const wxChar *format, const TimeZone& tz) const
|
|||||||
{
|
{
|
||||||
time += tz.GetOffset();
|
time += tz.GetOffset();
|
||||||
|
|
||||||
#ifdef __VMS__ /* time is unsigned so VMS gives a warning on the original */
|
#ifdef __VMS__ // time is unsigned so avoid the warning
|
||||||
time2 = (int) time;
|
int time2 = (int) time;
|
||||||
if ( time2 >= 0 )
|
if ( time2 >= 0 )
|
||||||
#else
|
#else
|
||||||
if ( time >= 0 )
|
if ( time >= 0 )
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
// Modified by:
|
// Modified by:
|
||||||
// Created: 28/06/98
|
// Created: 28/06/98
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) Guilhem Lavaux
|
// Copyright: (c) Guilhem Lavaux
|
||||||
// Licence: wxWindows license
|
// Licence: wxWindows license
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@@ -86,22 +86,17 @@ double wxDataInputStream::ReadDouble()
|
|||||||
|
|
||||||
wxString wxDataInputStream::ReadString()
|
wxString wxDataInputStream::ReadString()
|
||||||
{
|
{
|
||||||
wxString wx_string;
|
wxString s;
|
||||||
char *string;
|
size_t len;
|
||||||
unsigned long len;
|
|
||||||
|
|
||||||
len = Read32();
|
len = Read32();
|
||||||
string = new char[len+1];
|
|
||||||
|
|
||||||
m_input->Read(string, len);
|
m_input->Read(s.GetWriteBuf(len), len);
|
||||||
|
s.UngetWriteBuf();
|
||||||
|
|
||||||
string[len] = 0;
|
return s;
|
||||||
wx_string = string;
|
|
||||||
delete string;
|
|
||||||
|
|
||||||
return wx_string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxDataInputStream& wxDataInputStream::operator>>(wxString& s)
|
wxDataInputStream& wxDataInputStream::operator>>(wxString& s)
|
||||||
{
|
{
|
||||||
s = ReadString();
|
s = ReadString();
|
||||||
@@ -285,4 +280,4 @@ wxDataOutputStream& wxDataOutputStream::operator<<(float f)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
// wxUSE_STREAMS
|
// wxUSE_STREAMS
|
||||||
|
|
||||||
|
|||||||
@@ -588,7 +588,7 @@ int wxGIFDecoder::ReadGIF()
|
|||||||
ppimg = &pimg->next;
|
ppimg = &pimg->next;
|
||||||
|
|
||||||
/* allocate memory for image and palette */
|
/* allocate memory for image and palette */
|
||||||
pimg->p = (unsigned char *) malloc(size);
|
pimg->p = (unsigned char *) malloc((size_t)size);
|
||||||
pimg->pal = (unsigned char *) malloc(768);
|
pimg->pal = (unsigned char *) malloc(768);
|
||||||
|
|
||||||
if ((!pimg->p) || (!pimg->pal))
|
if ((!pimg->p) || (!pimg->pal))
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ _tiffSeekProc(thandle_t handle, toff_t off, int whence)
|
|||||||
case SEEK_END: mode = wxFromEnd; break;
|
case SEEK_END: mode = wxFromEnd; break;
|
||||||
default: mode = wxFromCurrent; break;
|
default: mode = wxFromCurrent; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (toff_t)stream->SeekI( (off_t)off, mode );
|
return (toff_t)stream->SeekI( (off_t)off, mode );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,13 +90,17 @@ _tiffSizeProc(thandle_t handle)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_tiffMapProc(thandle_t WXUNUSED(handle), tdata_t* pbase, toff_t* psize)
|
_tiffMapProc(thandle_t WXUNUSED(handle),
|
||||||
|
tdata_t* WXUNUSED(pbase),
|
||||||
|
toff_t* WXUNUSED(psize))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_tiffUnmapProc(thandle_t WXUNUSED(handle), tdata_t base, toff_t size)
|
_tiffUnmapProc(thandle_t WXUNUSED(handle),
|
||||||
|
tdata_t WXUNUSED(base),
|
||||||
|
toff_t WXUNUSED(size))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,7 +115,7 @@ TIFFwxOpen(wxInputStream &stream, const char* name, const char* mode)
|
|||||||
|
|
||||||
if (tif)
|
if (tif)
|
||||||
tif->tif_fd = (int) &stream;
|
tif->tif_fd = (int) &stream;
|
||||||
|
|
||||||
return tif;
|
return tif;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,124 +123,124 @@ TIFFwxOpen(wxInputStream &stream, const char* name, const char* mode)
|
|||||||
bool wxTIFFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose, int index )
|
bool wxTIFFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose, int index )
|
||||||
{
|
{
|
||||||
image->Destroy();
|
image->Destroy();
|
||||||
|
|
||||||
TIFF *tif = TIFFwxOpen( stream, "image", "r" );
|
TIFF *tif = TIFFwxOpen( stream, "image", "r" );
|
||||||
|
|
||||||
if (!tif)
|
if (!tif)
|
||||||
{
|
{
|
||||||
if (verbose)
|
if (verbose)
|
||||||
wxLogError( _("TIFF: Error loading image.") );
|
wxLogError( _("TIFF: Error loading image.") );
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!TIFFSetDirectory( tif, (tdir_t)index ))
|
if (!TIFFSetDirectory( tif, (tdir_t)index ))
|
||||||
{
|
{
|
||||||
if (verbose)
|
if (verbose)
|
||||||
wxLogError( _("Invalid TIFF image index.") );
|
wxLogError( _("Invalid TIFF image index.") );
|
||||||
|
|
||||||
TIFFClose( tif );
|
TIFFClose( tif );
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 w, h;
|
uint32 w, h;
|
||||||
size_t npixels;
|
uint32 npixels;
|
||||||
uint32 *raster;
|
uint32 *raster;
|
||||||
|
|
||||||
TIFFGetField( tif, TIFFTAG_IMAGEWIDTH, &w );
|
TIFFGetField( tif, TIFFTAG_IMAGEWIDTH, &w );
|
||||||
TIFFGetField( tif, TIFFTAG_IMAGELENGTH, &h );
|
TIFFGetField( tif, TIFFTAG_IMAGELENGTH, &h );
|
||||||
|
|
||||||
npixels = w * h;
|
npixels = w * h;
|
||||||
|
|
||||||
raster = (uint32*) _TIFFmalloc( npixels * sizeof(uint32) );
|
raster = (uint32*) _TIFFmalloc( npixels * sizeof(uint32) );
|
||||||
|
|
||||||
if (!raster)
|
if (!raster)
|
||||||
{
|
{
|
||||||
if (verbose)
|
if (verbose)
|
||||||
wxLogError( _("TIFF: Couldn't allocate memory.") );
|
wxLogError( _("TIFF: Couldn't allocate memory.") );
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
image->Create( w, h );
|
image->Create( w, h );
|
||||||
if (!image->Ok())
|
if (!image->Ok())
|
||||||
{
|
{
|
||||||
if (verbose)
|
if (verbose)
|
||||||
wxLogError( _("TIFF: Couldn't allocate memory.") );
|
wxLogError( _("TIFF: Couldn't allocate memory.") );
|
||||||
|
|
||||||
_TIFFfree( raster );
|
_TIFFfree( raster );
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!TIFFReadRGBAImage( tif, w, h, raster, 0 ))
|
if (!TIFFReadRGBAImage( tif, w, h, raster, 0 ))
|
||||||
{
|
{
|
||||||
if (verbose)
|
if (verbose)
|
||||||
wxLogError( _("TIFF: Error reading image.") );
|
wxLogError( _("TIFF: Error reading image.") );
|
||||||
|
|
||||||
_TIFFfree( raster );
|
_TIFFfree( raster );
|
||||||
image->Destroy();
|
image->Destroy();
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hasmask = FALSE;
|
bool hasmask = FALSE;
|
||||||
|
|
||||||
unsigned char *ptr = image->GetData();
|
unsigned char *ptr = image->GetData();
|
||||||
uint32 pos = 0;
|
uint32 pos = 0;
|
||||||
|
|
||||||
for (uint32 i = 0; i < h; i++)
|
for (uint32 i = 0; i < h; i++)
|
||||||
{
|
{
|
||||||
for (uint32 j = 0; w < h; j++)
|
for (uint32 j = 0; w < h; j++)
|
||||||
{
|
{
|
||||||
unsigned char alpha = (unsigned char)(raster[pos] >> 24);
|
unsigned char alpha = (unsigned char)(raster[pos] >> 24);
|
||||||
if (alpha < 127)
|
if (alpha < 127)
|
||||||
{
|
{
|
||||||
hasmask = TRUE;
|
hasmask = TRUE;
|
||||||
ptr[0] = image->GetMaskRed();
|
ptr[0] = image->GetMaskRed();
|
||||||
ptr++;
|
ptr++;
|
||||||
ptr[0] = image->GetMaskGreen();
|
ptr[0] = image->GetMaskGreen();
|
||||||
ptr++;
|
ptr++;
|
||||||
ptr[0] = image->GetMaskBlue();
|
ptr[0] = image->GetMaskBlue();
|
||||||
ptr++;
|
ptr++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ptr[0] = (unsigned char)(raster[pos] >> 16);
|
ptr[0] = (unsigned char)(raster[pos] >> 16);
|
||||||
ptr++;
|
ptr++;
|
||||||
ptr[0] = (unsigned char)(raster[pos] >> 8);
|
ptr[0] = (unsigned char)(raster[pos] >> 8);
|
||||||
ptr++;
|
ptr++;
|
||||||
ptr[0] = (unsigned char)(raster[pos]);
|
ptr[0] = (unsigned char)(raster[pos]);
|
||||||
ptr++;
|
ptr++;
|
||||||
}
|
}
|
||||||
pos++;
|
pos++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_TIFFfree( raster );
|
_TIFFfree( raster );
|
||||||
|
|
||||||
TIFFClose( tif );
|
TIFFClose( tif );
|
||||||
|
|
||||||
image->SetMask( hasmask );
|
image->SetMask( hasmask );
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxTIFFHandler::GetImageCount( wxInputStream& stream )
|
int wxTIFFHandler::GetImageCount( wxInputStream& stream )
|
||||||
{
|
{
|
||||||
TIFF *tif = TIFFwxOpen( stream, "image", "r" );
|
TIFF *tif = TIFFwxOpen( stream, "image", "r" );
|
||||||
|
|
||||||
if (!tif)
|
if (!tif)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
int dircount = 0; // according to the libtiff docs, dircount should be set to 1 here???
|
int dircount = 0; // according to the libtiff docs, dircount should be set to 1 here???
|
||||||
do {
|
do {
|
||||||
dircount++;
|
dircount++;
|
||||||
} while (TIFFReadDirectory(tif));
|
} while (TIFFReadDirectory(tif));
|
||||||
|
|
||||||
TIFFClose( tif );
|
TIFFClose( tif );
|
||||||
|
|
||||||
return dircount;
|
return dircount;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -251,7 +255,7 @@ bool wxTIFFHandler::DoCanRead( wxInputStream& stream )
|
|||||||
|
|
||||||
stream.Read(&hdr, 2);
|
stream.Read(&hdr, 2);
|
||||||
stream.SeekI(-2, wxFromCurrent);
|
stream.SeekI(-2, wxFromCurrent);
|
||||||
|
|
||||||
return ((hdr[0] == 0x49 && hdr[1] == 0x49) ||
|
return ((hdr[0] == 0x49 && hdr[1] == 0x49) ||
|
||||||
(hdr[0] == 0x4D && hdr[1] == 0x4D));
|
(hdr[0] == 0x4D && hdr[1] == 0x4D));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -535,7 +535,7 @@ const wxChar *wxSysErrorMsg(unsigned long nErrCode)
|
|||||||
wxConvCurrent->MB2WC(s_szBuf, strerror(nErrCode), WXSIZEOF(s_szBuf) -1);
|
wxConvCurrent->MB2WC(s_szBuf, strerror(nErrCode), WXSIZEOF(s_szBuf) -1);
|
||||||
return s_szBuf;
|
return s_szBuf;
|
||||||
#else
|
#else
|
||||||
return strerror(nErrCode);
|
return strerror((int)nErrCode);
|
||||||
#endif
|
#endif
|
||||||
#endif // Win/Unix
|
#endif // Win/Unix
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -279,7 +279,7 @@ wxLongLongWx& wxLongLongWx::operator-=(const wxLongLongWx& ll)
|
|||||||
if (previous < ll.m_lo)
|
if (previous < ll.m_lo)
|
||||||
m_hi--;
|
m_hi--;
|
||||||
|
|
||||||
return *this;;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// pre decrement
|
// pre decrement
|
||||||
@@ -571,14 +571,14 @@ void *wxLongLongWx::asArray(void) const
|
|||||||
{
|
{
|
||||||
static unsigned char temp[8];
|
static unsigned char temp[8];
|
||||||
|
|
||||||
temp[0] = (m_hi >> 24) & 0xFF;
|
temp[0] = (char)((m_hi >> 24) & 0xFF);
|
||||||
temp[1] = (m_hi >> 16) & 0xFF;
|
temp[1] = (char)((m_hi >> 16) & 0xFF);
|
||||||
temp[2] = (m_hi >> 8) & 0xFF;
|
temp[2] = (char)((m_hi >> 8) & 0xFF);
|
||||||
temp[3] = (m_hi >> 0) & 0xFF;
|
temp[3] = (char)((m_hi >> 0) & 0xFF);
|
||||||
temp[4] = (m_lo >> 24) & 0xFF;
|
temp[4] = (char)((m_lo >> 24) & 0xFF);
|
||||||
temp[5] = (m_lo >> 16) & 0xFF;
|
temp[5] = (char)((m_lo >> 16) & 0xFF);
|
||||||
temp[6] = (m_lo >> 8) & 0xFF;
|
temp[6] = (char)((m_lo >> 8) & 0xFF);
|
||||||
temp[7] = (m_lo >> 0) & 0xFF;
|
temp[7] = (char)((m_lo >> 0) & 0xFF);
|
||||||
|
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -643,7 +643,7 @@ wxItemResource *wxResourceInterpretDialog(wxResourceTable& table, wxExpr *expr,
|
|||||||
if (useDefaults != 0)
|
if (useDefaults != 0)
|
||||||
dialogItem->SetResourceStyle(dialogItem->GetResourceStyle() | wxRESOURCE_USE_DEFAULTS);
|
dialogItem->SetResourceStyle(dialogItem->GetResourceStyle() | wxRESOURCE_USE_DEFAULTS);
|
||||||
|
|
||||||
long id = 0;
|
int id = 0;
|
||||||
expr->GetAttributeValue(wxT("id"), id);
|
expr->GetAttributeValue(wxT("id"), id);
|
||||||
dialogItem->SetId(id);
|
dialogItem->SetId(id);
|
||||||
|
|
||||||
@@ -2190,8 +2190,8 @@ wxBitmap wxResourceCreateBitmap(const wxString& resource, wxResourceTable *table
|
|||||||
return wxBitmap(item->GetValue1(), (int)item->GetValue2(), (int)item->GetValue3()) ;
|
return wxBitmap(item->GetValue1(), (int)item->GetValue2(), (int)item->GetValue3()) ;
|
||||||
#else
|
#else
|
||||||
wxLogWarning(_("No XBM facility available!"));
|
wxLogWarning(_("No XBM facility available!"));
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
case wxBITMAP_TYPE_XPM_DATA:
|
case wxBITMAP_TYPE_XPM_DATA:
|
||||||
{
|
{
|
||||||
@@ -2206,13 +2206,12 @@ wxBitmap wxResourceCreateBitmap(const wxString& resource, wxResourceTable *table
|
|||||||
return wxBitmap((char **)item->GetValue1());
|
return wxBitmap((char **)item->GetValue1());
|
||||||
#else
|
#else
|
||||||
wxLogWarning(_("No XPM facility available!"));
|
wxLogWarning(_("No XPM facility available!"));
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
return wxBitmap(name, bitmapType);
|
return wxBitmap(name, bitmapType);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return wxNullBitmap;
|
return wxNullBitmap;
|
||||||
@@ -2345,8 +2344,8 @@ wxIcon wxResourceCreateIcon(const wxString& resource, wxResourceTable *table)
|
|||||||
return wxIcon((const char **)item->GetValue1(), (int)item->GetValue2(), (int)item->GetValue3());
|
return wxIcon((const char **)item->GetValue1(), (int)item->GetValue2(), (int)item->GetValue3());
|
||||||
#else
|
#else
|
||||||
wxLogWarning(_("No XBM facility available!"));
|
wxLogWarning(_("No XBM facility available!"));
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
case wxBITMAP_TYPE_XPM_DATA:
|
case wxBITMAP_TYPE_XPM_DATA:
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ void WXSERIAL(wxList)::StoreObject(wxObjectOutputStream& s)
|
|||||||
|
|
||||||
if (lst_object->GetKeyType() == wxKEY_INTEGER) {
|
if (lst_object->GetKeyType() == wxKEY_INTEGER) {
|
||||||
while (node) {
|
while (node) {
|
||||||
data_s.Write32(node->GetKeyInteger());
|
data_s.Write32((size_t)node->GetKeyInteger());
|
||||||
node = node->Next();
|
node = node->Next();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -413,7 +413,7 @@ void wxBoxSizer::RecalcSizes()
|
|||||||
|
|
||||||
if (m_orient == wxVERTICAL)
|
if (m_orient == wxVERTICAL)
|
||||||
{
|
{
|
||||||
long height = size.y;
|
wxCoord height = size.y;
|
||||||
if (item->GetOption())
|
if (item->GetOption())
|
||||||
{
|
{
|
||||||
height = (delta * weight) + extra;
|
height = (delta * weight) + extra;
|
||||||
@@ -438,7 +438,7 @@ void wxBoxSizer::RecalcSizes()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
long width = size.x;
|
wxCoord width = size.x;
|
||||||
if (item->GetOption())
|
if (item->GetOption())
|
||||||
{
|
{
|
||||||
width = (delta * weight) + extra;
|
width = (delta * weight) + extra;
|
||||||
|
|||||||
@@ -360,8 +360,13 @@ wxString::wxString(const wchar_t *pwz)
|
|||||||
// allocates memory needed to store a C string of length nLen
|
// allocates memory needed to store a C string of length nLen
|
||||||
void wxString::AllocBuffer(size_t nLen)
|
void wxString::AllocBuffer(size_t nLen)
|
||||||
{
|
{
|
||||||
wxASSERT( nLen > 0 ); //
|
// allocating 0 sized buffer doesn't make sense, all empty strings should
|
||||||
wxASSERT( nLen <= INT_MAX-1 ); // max size (enough room for 1 extra)
|
// reuse g_strEmpty
|
||||||
|
wxASSERT( nLen > 0 );
|
||||||
|
|
||||||
|
// make sure that we don't overflow
|
||||||
|
wxASSERT( nLen < (INT_MAX / sizeof(wxChar)) -
|
||||||
|
(sizeof(wxStringData) + EXTRA_ALLOC + 1) );
|
||||||
|
|
||||||
STATISTICS_ADD(Length, nLen);
|
STATISTICS_ADD(Length, nLen);
|
||||||
|
|
||||||
|
|||||||
@@ -147,15 +147,15 @@ void wxCalendarCtrl::Init()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxCalendarCtrl::Create(wxWindow *parent,
|
bool wxCalendarCtrl::Create(wxWindow * WXUNUSED(parent),
|
||||||
wxWindowID id,
|
wxWindowID WXUNUSED(id),
|
||||||
const wxDateTime& date,
|
const wxDateTime& date,
|
||||||
const wxPoint& pos,
|
const wxPoint& WXUNUSED(pos),
|
||||||
const wxSize& size,
|
const wxSize& size,
|
||||||
long style,
|
long style,
|
||||||
const wxString& name)
|
const wxString& WXUNUSED(name))
|
||||||
{
|
{
|
||||||
SetWindowStyle(style | (wxBORDER | wxWANTS_CHARS));
|
SetWindowStyle(style | (wxRAISED_BORDER | wxWANTS_CHARS));
|
||||||
|
|
||||||
m_date = date.IsValid() ? date : wxDateTime::Today();
|
m_date = date.IsValid() ? date : wxDateTime::Today();
|
||||||
|
|
||||||
@@ -422,7 +422,7 @@ void wxCalendarCtrl::RecalcGeometry()
|
|||||||
// drawing
|
// drawing
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
void wxCalendarCtrl::OnPaint(wxPaintEvent& event)
|
void wxCalendarCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
wxPaintDC dc(this);
|
wxPaintDC dc(this);
|
||||||
|
|
||||||
@@ -614,7 +614,7 @@ void wxCalendarCtrl::OnYearChange(wxSpinEvent& event)
|
|||||||
{
|
{
|
||||||
wxDateTime::Tm tm = m_date.GetTm();
|
wxDateTime::Tm tm = m_date.GetTm();
|
||||||
|
|
||||||
int year = event.GetInt();
|
int year = (int)event.GetInt();
|
||||||
if ( tm.mday > wxDateTime::GetNumberOfDays(tm.mon, year) )
|
if ( tm.mday > wxDateTime::GetNumberOfDays(tm.mon, year) )
|
||||||
{
|
{
|
||||||
tm.mday = wxDateTime::GetNumberOfDays(tm.mon, year);
|
tm.mday = wxDateTime::GetNumberOfDays(tm.mon, year);
|
||||||
|
|||||||
@@ -431,7 +431,7 @@ void wxFileCtrl::MakeDir()
|
|||||||
wxListItem item;
|
wxListItem item;
|
||||||
item.m_itemId = 0;
|
item.m_itemId = 0;
|
||||||
item.m_col = 0;
|
item.m_col = 0;
|
||||||
int id = Add( fd, item );
|
long id = Add( fd, item );
|
||||||
|
|
||||||
if (id != -1)
|
if (id != -1)
|
||||||
{
|
{
|
||||||
@@ -450,7 +450,7 @@ void wxFileCtrl::GoToParentDir()
|
|||||||
m_dirName = wxPathOnly( m_dirName );
|
m_dirName = wxPathOnly( m_dirName );
|
||||||
if (m_dirName.IsEmpty()) m_dirName = wxT("/");
|
if (m_dirName.IsEmpty()) m_dirName = wxT("/");
|
||||||
Update();
|
Update();
|
||||||
int id = FindItem( 0, fname );
|
long id = FindItem( 0, fname );
|
||||||
if (id != -1)
|
if (id != -1)
|
||||||
{
|
{
|
||||||
SetItemState( id, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
|
SetItemState( id, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
|
||||||
@@ -715,9 +715,10 @@ wxFileDialog::~wxFileDialog()
|
|||||||
|
|
||||||
void wxFileDialog::OnChoice( wxCommandEvent &event )
|
void wxFileDialog::OnChoice( wxCommandEvent &event )
|
||||||
{
|
{
|
||||||
wxString *str = (wxString*) m_choice->GetClientData( event.GetInt() );
|
int index = (int)event.GetInt();
|
||||||
|
wxString *str = (wxString*) m_choice->GetClientData( index );
|
||||||
m_list->SetWild( *str );
|
m_list->SetWild( *str );
|
||||||
m_filterIndex = event.GetInt();
|
m_filterIndex = index;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxFileDialog::OnCheck( wxCommandEvent &event )
|
void wxFileDialog::OnCheck( wxCommandEvent &event )
|
||||||
|
|||||||
@@ -295,7 +295,7 @@ void wxListLineData::CalculateSize( wxDC *dc, int spacing )
|
|||||||
{
|
{
|
||||||
wxListItemData *item = (wxListItemData*)node->Data();
|
wxListItemData *item = (wxListItemData*)node->Data();
|
||||||
wxString s = item->GetText();
|
wxString s = item->GetText();
|
||||||
long lw,lh;
|
wxCoord lw,lh;
|
||||||
dc->GetTextExtent( s, &lw, &lh );
|
dc->GetTextExtent( s, &lw, &lh );
|
||||||
if (lw > m_spacing) m_bound_all.width = lw;
|
if (lw > m_spacing) m_bound_all.width = lw;
|
||||||
}
|
}
|
||||||
@@ -308,14 +308,14 @@ void wxListLineData::CalculateSize( wxDC *dc, int spacing )
|
|||||||
{
|
{
|
||||||
wxListItemData *item = (wxListItemData*)node->Data();
|
wxListItemData *item = (wxListItemData*)node->Data();
|
||||||
wxString s = item->GetText();
|
wxString s = item->GetText();
|
||||||
long lw,lh;
|
wxCoord lw,lh;
|
||||||
dc->GetTextExtent( s, &lw, &lh );
|
dc->GetTextExtent( s, &lw, &lh );
|
||||||
m_bound_all.width = lw;
|
m_bound_all.width = lw;
|
||||||
m_bound_all.height = lh;
|
m_bound_all.height = lh;
|
||||||
if (item->HasImage())
|
if (item->HasImage())
|
||||||
{
|
{
|
||||||
int w = 0;
|
wxCoord w = 0;
|
||||||
int h = 0;
|
wxCoord h = 0;
|
||||||
m_owner->GetImageSize( item->GetImage(), w, h );
|
m_owner->GetImageSize( item->GetImage(), w, h );
|
||||||
m_bound_all.width += 4 + w;
|
m_bound_all.width += 4 + w;
|
||||||
if (h > m_bound_all.height) m_bound_all.height = h;
|
if (h > m_bound_all.height) m_bound_all.height = h;
|
||||||
@@ -334,7 +334,7 @@ void wxListLineData::CalculateSize( wxDC *dc, int spacing )
|
|||||||
wxString s;
|
wxString s;
|
||||||
item->GetText( s );
|
item->GetText( s );
|
||||||
if (s.IsNull()) s = "H";
|
if (s.IsNull()) s = "H";
|
||||||
long lw,lh;
|
wxCoord lw,lh;
|
||||||
dc->GetTextExtent( s, &lw, &lh );
|
dc->GetTextExtent( s, &lw, &lh );
|
||||||
item->SetSize( item->GetWidth(), lh );
|
item->SetSize( item->GetWidth(), lh );
|
||||||
m_bound_all.width += lw;
|
m_bound_all.width += lw;
|
||||||
@@ -384,7 +384,7 @@ void wxListLineData::SetPosition( wxDC *dc, int x, int y, int window_width )
|
|||||||
{
|
{
|
||||||
wxString s;
|
wxString s;
|
||||||
item->GetText( s );
|
item->GetText( s );
|
||||||
long lw,lh;
|
wxCoord lw,lh;
|
||||||
dc->GetTextExtent( s, &lw, &lh );
|
dc->GetTextExtent( s, &lw, &lh );
|
||||||
if (m_bound_all.width > m_spacing)
|
if (m_bound_all.width > m_spacing)
|
||||||
m_bound_label.x = m_bound_all.x;
|
m_bound_label.x = m_bound_all.x;
|
||||||
@@ -432,7 +432,7 @@ void wxListLineData::SetPosition( wxDC *dc, int x, int y, int window_width )
|
|||||||
}
|
}
|
||||||
case wxLC_REPORT:
|
case wxLC_REPORT:
|
||||||
{
|
{
|
||||||
long lw,lh;
|
wxCoord lw,lh;
|
||||||
dc->GetTextExtent( "H", &lw, &lh );
|
dc->GetTextExtent( "H", &lw, &lh );
|
||||||
m_bound_all.x = 0;
|
m_bound_all.x = 0;
|
||||||
m_bound_all.y -= 0;
|
m_bound_all.y -= 0;
|
||||||
@@ -448,7 +448,7 @@ void wxListLineData::SetPosition( wxDC *dc, int x, int y, int window_width )
|
|||||||
wxString s;
|
wxString s;
|
||||||
item->GetText( s );
|
item->GetText( s );
|
||||||
if (s.IsEmpty()) s = wxT("H");
|
if (s.IsEmpty()) s = wxT("H");
|
||||||
long lw,lh;
|
wxCoord lw,lh;
|
||||||
dc->GetTextExtent( s, &lw, &lh );
|
dc->GetTextExtent( s, &lw, &lh );
|
||||||
m_bound_label.width = lw;
|
m_bound_label.width = lw;
|
||||||
m_bound_label.height = lh;
|
m_bound_label.height = lh;
|
||||||
@@ -1828,8 +1828,8 @@ void wxListMainWindow::GetImageSize( int index, int &width, int &height )
|
|||||||
int wxListMainWindow::GetTextLength( wxString &s )
|
int wxListMainWindow::GetTextLength( wxString &s )
|
||||||
{
|
{
|
||||||
wxClientDC dc( this );
|
wxClientDC dc( this );
|
||||||
long lw = 0;
|
wxCoord lw = 0;
|
||||||
long lh = 0;
|
wxCoord lh = 0;
|
||||||
dc.GetTextExtent( s, &lw, &lh );
|
dc.GetTextExtent( s, &lw, &lh );
|
||||||
return lw + 6;
|
return lw + 6;
|
||||||
}
|
}
|
||||||
@@ -1909,7 +1909,7 @@ void wxListMainWindow::SetColumnWidth( int col, int width )
|
|||||||
{
|
{
|
||||||
wxListItemData *item = (wxListItemData*)n->Data();
|
wxListItemData *item = (wxListItemData*)n->Data();
|
||||||
int current = 0, ix = 0, iy = 0;
|
int current = 0, ix = 0, iy = 0;
|
||||||
long lx = 0, ly = 0;
|
wxCoord lx = 0, ly = 0;
|
||||||
if (item->HasImage())
|
if (item->HasImage())
|
||||||
{
|
{
|
||||||
GetImageSize( item->GetImage(), ix, iy );
|
GetImageSize( item->GetImage(), ix, iy );
|
||||||
|
|||||||
@@ -19,7 +19,14 @@
|
|||||||
|
|
||||||
#include <gdk/gdk.h>
|
#include <gdk/gdk.h>
|
||||||
#include <gdk/gdkprivate.h>
|
#include <gdk/gdkprivate.h>
|
||||||
#include <gdk/gdkx.h>
|
|
||||||
|
// in GTK+ 1.3 gdk_root_parent was renamed into gdk_parent_root
|
||||||
|
#ifdef __WXGTK13__
|
||||||
|
#define gdk_root_parent gdk_parent_root
|
||||||
|
#else // GTK+ <= 1.2
|
||||||
|
// need to get the declaration of gdk_root_parent from private header
|
||||||
|
#include <gdk/gdkx.h>
|
||||||
|
#endif // GTK+ 1.3/1.2
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxMask
|
// wxMask
|
||||||
@@ -52,7 +59,7 @@ wxMask::wxMask( const wxBitmap& bitmap )
|
|||||||
|
|
||||||
wxMask::~wxMask()
|
wxMask::~wxMask()
|
||||||
{
|
{
|
||||||
if (m_bitmap)
|
if (m_bitmap)
|
||||||
gdk_bitmap_unref( m_bitmap );
|
gdk_bitmap_unref( m_bitmap );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,14 +71,14 @@ bool wxMask::Create( const wxBitmap& bitmap,
|
|||||||
gdk_bitmap_unref( m_bitmap );
|
gdk_bitmap_unref( m_bitmap );
|
||||||
m_bitmap = (GdkBitmap*) NULL;
|
m_bitmap = (GdkBitmap*) NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxImage image( bitmap );
|
wxImage image( bitmap );
|
||||||
if (!image.Ok()) return FALSE;
|
if (!image.Ok()) return FALSE;
|
||||||
|
|
||||||
GdkWindow *parent = (GdkWindow*) &gdk_root_parent;
|
GdkWindow *parent = (GdkWindow*) &gdk_root_parent;
|
||||||
m_bitmap = gdk_pixmap_new( parent, image.GetWidth(), image.GetHeight(), 1 );
|
m_bitmap = gdk_pixmap_new( parent, image.GetWidth(), image.GetHeight(), 1 );
|
||||||
GdkGC *gc = gdk_gc_new( m_bitmap );
|
GdkGC *gc = gdk_gc_new( m_bitmap );
|
||||||
|
|
||||||
GdkColor color;
|
GdkColor color;
|
||||||
color.red = 65000;
|
color.red = 65000;
|
||||||
color.green = 65000;
|
color.green = 65000;
|
||||||
@@ -80,14 +87,14 @@ bool wxMask::Create( const wxBitmap& bitmap,
|
|||||||
gdk_gc_set_foreground( gc, &color );
|
gdk_gc_set_foreground( gc, &color );
|
||||||
gdk_gc_set_fill( gc, GDK_SOLID );
|
gdk_gc_set_fill( gc, GDK_SOLID );
|
||||||
gdk_draw_rectangle( m_bitmap, gc, TRUE, 0, 0, image.GetWidth(), image.GetHeight() );
|
gdk_draw_rectangle( m_bitmap, gc, TRUE, 0, 0, image.GetWidth(), image.GetHeight() );
|
||||||
|
|
||||||
unsigned char *data = image.GetData();
|
unsigned char *data = image.GetData();
|
||||||
int index = 0;
|
int index = 0;
|
||||||
|
|
||||||
unsigned char red = colour.Red();
|
unsigned char red = colour.Red();
|
||||||
unsigned char green = colour.Green();
|
unsigned char green = colour.Green();
|
||||||
unsigned char blue = colour.Blue();
|
unsigned char blue = colour.Blue();
|
||||||
|
|
||||||
GdkVisual *visual = gdk_visual_get_system();
|
GdkVisual *visual = gdk_visual_get_system();
|
||||||
int bpp = visual->depth;
|
int bpp = visual->depth;
|
||||||
if ((bpp == 16) && (visual->red_mask != 0xf800)) bpp = 15;
|
if ((bpp == 16) && (visual->red_mask != 0xf800)) bpp = 15;
|
||||||
@@ -103,33 +110,33 @@ bool wxMask::Create( const wxBitmap& bitmap,
|
|||||||
blue = blue & 0xfc;
|
blue = blue & 0xfc;
|
||||||
green = green & 0xf8;
|
green = green & 0xf8;
|
||||||
}
|
}
|
||||||
|
|
||||||
color.red = 0;
|
color.red = 0;
|
||||||
color.green = 0;
|
color.green = 0;
|
||||||
color.blue = 0;
|
color.blue = 0;
|
||||||
color.pixel = 0;
|
color.pixel = 0;
|
||||||
gdk_gc_set_foreground( gc, &color );
|
gdk_gc_set_foreground( gc, &color );
|
||||||
|
|
||||||
for (int j = 0; j < image.GetHeight(); j++)
|
for (int j = 0; j < image.GetHeight(); j++)
|
||||||
{
|
{
|
||||||
int start_x = -1;
|
int start_x = -1;
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < image.GetWidth(); i++)
|
for (i = 0; i < image.GetWidth(); i++)
|
||||||
{
|
{
|
||||||
if ((data[index] == red) &&
|
if ((data[index] == red) &&
|
||||||
(data[index+1] == green) &&
|
(data[index+1] == green) &&
|
||||||
(data[index+2] == blue))
|
(data[index+2] == blue))
|
||||||
{
|
{
|
||||||
if (start_x == -1)
|
if (start_x == -1)
|
||||||
start_x = i;
|
start_x = i;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (start_x != -1)
|
if (start_x != -1)
|
||||||
{
|
{
|
||||||
gdk_draw_line( m_bitmap, gc, start_x, j, i-1, j );
|
gdk_draw_line( m_bitmap, gc, start_x, j, i-1, j );
|
||||||
start_x = -1;
|
start_x = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
index += 3;
|
index += 3;
|
||||||
}
|
}
|
||||||
@@ -387,39 +394,39 @@ void wxBitmap::SetMask( wxMask *mask )
|
|||||||
wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const
|
wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( Ok() &&
|
wxCHECK_MSG( Ok() &&
|
||||||
(rect.x >= 0) && (rect.y >= 0) &&
|
(rect.x >= 0) && (rect.y >= 0) &&
|
||||||
(rect.x+rect.width <= M_BMPDATA->m_width) && (rect.y+rect.height <= M_BMPDATA->m_height),
|
(rect.x+rect.width <= M_BMPDATA->m_width) && (rect.y+rect.height <= M_BMPDATA->m_height),
|
||||||
wxNullBitmap, wxT("invalid bitmap or bitmap region") );
|
wxNullBitmap, wxT("invalid bitmap or bitmap region") );
|
||||||
|
|
||||||
wxBitmap ret( rect.width, rect.height, M_BMPDATA->m_bpp );
|
wxBitmap ret( rect.width, rect.height, M_BMPDATA->m_bpp );
|
||||||
wxASSERT_MSG( ret.Ok(), wxT("GetSubBitmap error") );
|
wxASSERT_MSG( ret.Ok(), wxT("GetSubBitmap error") );
|
||||||
|
|
||||||
if (ret.GetPixmap())
|
if (ret.GetPixmap())
|
||||||
{
|
{
|
||||||
GdkGC *gc = gdk_gc_new( ret.GetPixmap() );
|
GdkGC *gc = gdk_gc_new( ret.GetPixmap() );
|
||||||
gdk_draw_pixmap( ret.GetPixmap(), gc, GetPixmap(), rect.x, rect.y, 0, 0, rect.width, rect.height );
|
gdk_draw_pixmap( ret.GetPixmap(), gc, GetPixmap(), rect.x, rect.y, 0, 0, rect.width, rect.height );
|
||||||
gdk_gc_destroy( gc );
|
gdk_gc_destroy( gc );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GdkGC *gc = gdk_gc_new( ret.GetBitmap() );
|
GdkGC *gc = gdk_gc_new( ret.GetBitmap() );
|
||||||
gdk_draw_bitmap( ret.GetBitmap(), gc, GetBitmap(), rect.x, rect.y, 0, 0, rect.width, rect.height );
|
gdk_draw_bitmap( ret.GetBitmap(), gc, GetBitmap(), rect.x, rect.y, 0, 0, rect.width, rect.height );
|
||||||
gdk_gc_destroy( gc );
|
gdk_gc_destroy( gc );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetMask())
|
if (GetMask())
|
||||||
{
|
{
|
||||||
wxMask *mask = new wxMask;
|
wxMask *mask = new wxMask;
|
||||||
GdkWindow *parent = (GdkWindow*) &gdk_root_parent;
|
GdkWindow *parent = (GdkWindow*) &gdk_root_parent;
|
||||||
mask->m_bitmap = gdk_pixmap_new( parent, rect.width, rect.height, 1 );
|
mask->m_bitmap = gdk_pixmap_new( parent, rect.width, rect.height, 1 );
|
||||||
|
|
||||||
GdkGC *gc = gdk_gc_new( mask->m_bitmap );
|
GdkGC *gc = gdk_gc_new( mask->m_bitmap );
|
||||||
gdk_draw_bitmap( mask->m_bitmap, gc, M_BMPDATA->m_mask->m_bitmap, 0, 0, rect.x, rect.y, rect.width, rect.height );
|
gdk_draw_bitmap( mask->m_bitmap, gc, M_BMPDATA->m_mask->m_bitmap, 0, 0, rect.x, rect.y, rect.width, rect.height );
|
||||||
gdk_gc_destroy( gc );
|
gdk_gc_destroy( gc );
|
||||||
|
|
||||||
ret.SetMask( mask );
|
ret.SetMask( mask );
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -463,7 +463,7 @@ void wxComboBox::Copy()
|
|||||||
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
||||||
|
|
||||||
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
|
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
|
||||||
#if (GTK_MINOR_VERSION > 0)
|
#if defined(__WXGTK13__) || (GTK_MINOR_VERSION > 0)
|
||||||
gtk_editable_copy_clipboard( GTK_EDITABLE(entry) );
|
gtk_editable_copy_clipboard( GTK_EDITABLE(entry) );
|
||||||
#else
|
#else
|
||||||
gtk_editable_copy_clipboard( GTK_EDITABLE(entry), 0 );
|
gtk_editable_copy_clipboard( GTK_EDITABLE(entry), 0 );
|
||||||
@@ -475,7 +475,7 @@ void wxComboBox::Cut()
|
|||||||
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
||||||
|
|
||||||
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
|
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
|
||||||
#if (GTK_MINOR_VERSION > 0)
|
#if defined(__WXGTK13__) || (GTK_MINOR_VERSION > 0)
|
||||||
gtk_editable_cut_clipboard( GTK_EDITABLE(entry) );
|
gtk_editable_cut_clipboard( GTK_EDITABLE(entry) );
|
||||||
#else
|
#else
|
||||||
gtk_editable_cut_clipboard( GTK_EDITABLE(entry), 0 );
|
gtk_editable_cut_clipboard( GTK_EDITABLE(entry), 0 );
|
||||||
@@ -487,7 +487,7 @@ void wxComboBox::Paste()
|
|||||||
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
||||||
|
|
||||||
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
|
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
|
||||||
#if (GTK_MINOR_VERSION > 0)
|
#if defined(__WXGTK13__) || (GTK_MINOR_VERSION > 0)
|
||||||
gtk_editable_paste_clipboard( GTK_EDITABLE(entry) );
|
gtk_editable_paste_clipboard( GTK_EDITABLE(entry) );
|
||||||
#else
|
#else
|
||||||
gtk_editable_paste_clipboard( GTK_EDITABLE(entry), 0 );
|
gtk_editable_paste_clipboard( GTK_EDITABLE(entry), 0 );
|
||||||
|
|||||||
@@ -792,13 +792,13 @@ void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y )
|
|||||||
properties (see wxXt implementation) */
|
properties (see wxXt implementation) */
|
||||||
if (m_font.GetUnderlined())
|
if (m_font.GetUnderlined())
|
||||||
{
|
{
|
||||||
long width = gdk_string_width( font, text.mbc_str() );
|
wxCoord width = gdk_string_width( font, text.mbc_str() );
|
||||||
long ul_y = y + font->ascent;
|
wxCoord ul_y = y + font->ascent;
|
||||||
if (font->descent > 0) ul_y++;
|
if (font->descent > 0) ul_y++;
|
||||||
gdk_draw_line( m_window, m_textGC, x, ul_y, x + width, ul_y);
|
gdk_draw_line( m_window, m_textGC, x, ul_y, x + width, ul_y);
|
||||||
}
|
}
|
||||||
|
|
||||||
long w, h;
|
wxCoord w, h;
|
||||||
GetTextExtent (text, &w, &h);
|
GetTextExtent (text, &w, &h);
|
||||||
CalcBoundingBox (x + w, y + h);
|
CalcBoundingBox (x + w, y + h);
|
||||||
CalcBoundingBox (x, y);
|
CalcBoundingBox (x, y);
|
||||||
@@ -821,8 +821,8 @@ void wxWindowDC::DoDrawRotatedText( const wxString &text, wxCoord x, wxCoord y,
|
|||||||
wxCHECK_RET( font, wxT("invalid font") );
|
wxCHECK_RET( font, wxT("invalid font") );
|
||||||
|
|
||||||
// the size of the text
|
// the size of the text
|
||||||
int w = gdk_string_width( font, text.mbc_str() );
|
wxCoord w = gdk_string_width( font, text.mbc_str() );
|
||||||
int h = font->ascent + font->descent;
|
wxCoord h = font->ascent + font->descent;
|
||||||
|
|
||||||
// draw the string normally
|
// draw the string normally
|
||||||
wxBitmap src(w, h);
|
wxBitmap src(w, h);
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto
|
|||||||
int y = (int)gdk_event->y;
|
int y = (int)gdk_event->y;
|
||||||
|
|
||||||
DrawFrame( widget, win->m_oldX, win->m_oldY, win->m_width, win->m_height );
|
DrawFrame( widget, win->m_oldX, win->m_oldY, win->m_width, win->m_height );
|
||||||
gdk_pointer_ungrab ( GDK_CURRENT_TIME );
|
gdk_pointer_ungrab ( (guint32)GDK_CURRENT_TIME );
|
||||||
int org_x = 0;
|
int org_x = 0;
|
||||||
int org_y = 0;
|
int org_y = 0;
|
||||||
gdk_window_get_origin( widget->window, &org_x, &org_y );
|
gdk_window_get_origin( widget->window, &org_x, &org_y );
|
||||||
|
|||||||
@@ -100,17 +100,27 @@ wxTextCtrl::wxTextCtrl()
|
|||||||
m_modified = FALSE;
|
m_modified = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxTextCtrl::wxTextCtrl( wxWindow *parent, wxWindowID id, const wxString &value,
|
wxTextCtrl::wxTextCtrl( wxWindow *parent,
|
||||||
const wxPoint &pos, const wxSize &size,
|
wxWindowID id,
|
||||||
int style, const wxValidator& validator, const wxString &name )
|
const wxString &value,
|
||||||
|
const wxPoint &pos,
|
||||||
|
const wxSize &size,
|
||||||
|
long style,
|
||||||
|
const wxValidator& validator,
|
||||||
|
const wxString &name )
|
||||||
{
|
{
|
||||||
m_modified = FALSE;
|
m_modified = FALSE;
|
||||||
Create( parent, id, value, pos, size, style, validator, name );
|
Create( parent, id, value, pos, size, style, validator, name );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value,
|
bool wxTextCtrl::Create( wxWindow *parent,
|
||||||
const wxPoint &pos, const wxSize &size,
|
wxWindowID id,
|
||||||
int style, const wxValidator& validator, const wxString &name )
|
const wxString &value,
|
||||||
|
const wxPoint &pos,
|
||||||
|
const wxSize &size,
|
||||||
|
long style,
|
||||||
|
const wxValidator& validator,
|
||||||
|
const wxString &name )
|
||||||
{
|
{
|
||||||
m_needParent = TRUE;
|
m_needParent = TRUE;
|
||||||
m_acceptsFocus = TRUE;
|
m_acceptsFocus = TRUE;
|
||||||
@@ -119,7 +129,7 @@ bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value,
|
|||||||
!CreateBase( parent, id, pos, size, style, validator, name ))
|
!CreateBase( parent, id, pos, size, style, validator, name ))
|
||||||
{
|
{
|
||||||
wxFAIL_MSG( wxT("wxTextCtrl creation failed") );
|
wxFAIL_MSG( wxT("wxTextCtrl creation failed") );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -247,7 +257,7 @@ bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value,
|
|||||||
SetForegroundColour( parent->GetForegroundColour() );
|
SetForegroundColour( parent->GetForegroundColour() );
|
||||||
|
|
||||||
m_cursor = wxCursor( wxCURSOR_IBEAM );
|
m_cursor = wxCursor( wxCURSOR_IBEAM );
|
||||||
|
|
||||||
Show( TRUE );
|
Show( TRUE );
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -330,7 +340,7 @@ void wxTextCtrl::WriteText( const wxString &text )
|
|||||||
{
|
{
|
||||||
/* this moves the cursor pos to behind the inserted text */
|
/* this moves the cursor pos to behind the inserted text */
|
||||||
gint len = GTK_EDITABLE(m_text)->current_pos;
|
gint len = GTK_EDITABLE(m_text)->current_pos;
|
||||||
|
|
||||||
#if wxUSE_UNICODE
|
#if wxUSE_UNICODE
|
||||||
wxWX2MBbuf buf = text.mbc_str();
|
wxWX2MBbuf buf = text.mbc_str();
|
||||||
gtk_editable_insert_text( GTK_EDITABLE(m_text), buf, strlen(buf), &len );
|
gtk_editable_insert_text( GTK_EDITABLE(m_text), buf, strlen(buf), &len );
|
||||||
@@ -781,13 +791,13 @@ void wxTextCtrl::OnChar( wxKeyEvent &key_event )
|
|||||||
wxWindow *top_frame = m_parent;
|
wxWindow *top_frame = m_parent;
|
||||||
while (top_frame->GetParent() && !(top_frame->IsTopLevel()))
|
while (top_frame->GetParent() && !(top_frame->IsTopLevel()))
|
||||||
top_frame = top_frame->GetParent();
|
top_frame = top_frame->GetParent();
|
||||||
GtkWindow *window = GTK_WINDOW(top_frame->m_widget);
|
GtkWindow *window = GTK_WINDOW(top_frame->m_widget);
|
||||||
|
|
||||||
if (window->default_widget)
|
if (window->default_widget)
|
||||||
{
|
{
|
||||||
gtk_widget_activate (window->default_widget);
|
gtk_widget_activate (window->default_widget);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
key_event.Skip();
|
key_event.Skip();
|
||||||
@@ -945,11 +955,11 @@ void wxTextCtrl::OnInternalIdle()
|
|||||||
if (cursor.Ok())
|
if (cursor.Ok())
|
||||||
{
|
{
|
||||||
GdkWindow *window = (GdkWindow*) NULL;
|
GdkWindow *window = (GdkWindow*) NULL;
|
||||||
if (HasFlag(wxTE_MULTILINE))
|
if (HasFlag(wxTE_MULTILINE))
|
||||||
window = GTK_TEXT(m_text)->text_area;
|
window = GTK_TEXT(m_text)->text_area;
|
||||||
else
|
else
|
||||||
window = GTK_ENTRY(m_text)->text_area;
|
window = GTK_ENTRY(m_text)->text_area;
|
||||||
|
|
||||||
if (window)
|
if (window)
|
||||||
gdk_window_set_cursor( window, cursor.GetCursor() );
|
gdk_window_set_cursor( window, cursor.GetCursor() );
|
||||||
|
|
||||||
|
|||||||
@@ -944,8 +944,8 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
|
|||||||
event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
|
event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
|
||||||
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
|
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
|
||||||
|
|
||||||
event.m_x = (long)gdk_event->x;
|
event.m_x = (wxCoord)gdk_event->x;
|
||||||
event.m_y = (long)gdk_event->y;
|
event.m_y = (wxCoord)gdk_event->y;
|
||||||
|
|
||||||
// Some control don't have their own X window and thus cannot get
|
// Some control don't have their own X window and thus cannot get
|
||||||
// any events.
|
// any events.
|
||||||
@@ -1071,8 +1071,8 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto
|
|||||||
event.m_leftDown = (gdk_event->state & GDK_BUTTON1_MASK);
|
event.m_leftDown = (gdk_event->state & GDK_BUTTON1_MASK);
|
||||||
event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
|
event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
|
||||||
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
|
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
|
||||||
event.m_x = (long)gdk_event->x;
|
event.m_x = (wxCoord)gdk_event->x;
|
||||||
event.m_y = (long)gdk_event->y;
|
event.m_y = (wxCoord)gdk_event->y;
|
||||||
|
|
||||||
// Some control don't have their own X window and thus cannot get
|
// Some control don't have their own X window and thus cannot get
|
||||||
// any events.
|
// any events.
|
||||||
@@ -1191,8 +1191,8 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion
|
|||||||
event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
|
event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
|
||||||
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
|
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
|
||||||
|
|
||||||
event.m_x = (long)gdk_event->x;
|
event.m_x = (wxCoord)gdk_event->x;
|
||||||
event.m_y = (long)gdk_event->y;
|
event.m_y = (wxCoord)gdk_event->y;
|
||||||
|
|
||||||
// Some control don't have their own X window and thus cannot get
|
// Some control don't have their own X window and thus cannot get
|
||||||
// any events.
|
// any events.
|
||||||
@@ -1406,8 +1406,8 @@ static gint gtk_window_enter_callback( GtkWidget *widget, GdkEventCrossing *gdk_
|
|||||||
event.m_middleDown = (state & GDK_BUTTON2_MASK);
|
event.m_middleDown = (state & GDK_BUTTON2_MASK);
|
||||||
event.m_rightDown = (state & GDK_BUTTON3_MASK);
|
event.m_rightDown = (state & GDK_BUTTON3_MASK);
|
||||||
|
|
||||||
event.m_x = (long)x;
|
event.m_x = x;
|
||||||
event.m_y = (long)y;
|
event.m_y = y;
|
||||||
|
|
||||||
if (win->GetEventHandler()->ProcessEvent( event ))
|
if (win->GetEventHandler()->ProcessEvent( event ))
|
||||||
{
|
{
|
||||||
@@ -1452,8 +1452,8 @@ static gint gtk_window_leave_callback( GtkWidget *widget, GdkEventCrossing *gdk_
|
|||||||
event.m_middleDown = (state & GDK_BUTTON2_MASK);
|
event.m_middleDown = (state & GDK_BUTTON2_MASK);
|
||||||
event.m_rightDown = (state & GDK_BUTTON3_MASK);
|
event.m_rightDown = (state & GDK_BUTTON3_MASK);
|
||||||
|
|
||||||
event.m_x = (long)x;
|
event.m_x = x;
|
||||||
event.m_y = (long)y;
|
event.m_y = y;
|
||||||
|
|
||||||
if (win->GetEventHandler()->ProcessEvent( event ))
|
if (win->GetEventHandler()->ProcessEvent( event ))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,7 +19,14 @@
|
|||||||
|
|
||||||
#include <gdk/gdk.h>
|
#include <gdk/gdk.h>
|
||||||
#include <gdk/gdkprivate.h>
|
#include <gdk/gdkprivate.h>
|
||||||
#include <gdk/gdkx.h>
|
|
||||||
|
// in GTK+ 1.3 gdk_root_parent was renamed into gdk_parent_root
|
||||||
|
#ifdef __WXGTK13__
|
||||||
|
#define gdk_root_parent gdk_parent_root
|
||||||
|
#else // GTK+ <= 1.2
|
||||||
|
// need to get the declaration of gdk_root_parent from private header
|
||||||
|
#include <gdk/gdkx.h>
|
||||||
|
#endif // GTK+ 1.3/1.2
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxMask
|
// wxMask
|
||||||
@@ -52,7 +59,7 @@ wxMask::wxMask( const wxBitmap& bitmap )
|
|||||||
|
|
||||||
wxMask::~wxMask()
|
wxMask::~wxMask()
|
||||||
{
|
{
|
||||||
if (m_bitmap)
|
if (m_bitmap)
|
||||||
gdk_bitmap_unref( m_bitmap );
|
gdk_bitmap_unref( m_bitmap );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,14 +71,14 @@ bool wxMask::Create( const wxBitmap& bitmap,
|
|||||||
gdk_bitmap_unref( m_bitmap );
|
gdk_bitmap_unref( m_bitmap );
|
||||||
m_bitmap = (GdkBitmap*) NULL;
|
m_bitmap = (GdkBitmap*) NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxImage image( bitmap );
|
wxImage image( bitmap );
|
||||||
if (!image.Ok()) return FALSE;
|
if (!image.Ok()) return FALSE;
|
||||||
|
|
||||||
GdkWindow *parent = (GdkWindow*) &gdk_root_parent;
|
GdkWindow *parent = (GdkWindow*) &gdk_root_parent;
|
||||||
m_bitmap = gdk_pixmap_new( parent, image.GetWidth(), image.GetHeight(), 1 );
|
m_bitmap = gdk_pixmap_new( parent, image.GetWidth(), image.GetHeight(), 1 );
|
||||||
GdkGC *gc = gdk_gc_new( m_bitmap );
|
GdkGC *gc = gdk_gc_new( m_bitmap );
|
||||||
|
|
||||||
GdkColor color;
|
GdkColor color;
|
||||||
color.red = 65000;
|
color.red = 65000;
|
||||||
color.green = 65000;
|
color.green = 65000;
|
||||||
@@ -80,14 +87,14 @@ bool wxMask::Create( const wxBitmap& bitmap,
|
|||||||
gdk_gc_set_foreground( gc, &color );
|
gdk_gc_set_foreground( gc, &color );
|
||||||
gdk_gc_set_fill( gc, GDK_SOLID );
|
gdk_gc_set_fill( gc, GDK_SOLID );
|
||||||
gdk_draw_rectangle( m_bitmap, gc, TRUE, 0, 0, image.GetWidth(), image.GetHeight() );
|
gdk_draw_rectangle( m_bitmap, gc, TRUE, 0, 0, image.GetWidth(), image.GetHeight() );
|
||||||
|
|
||||||
unsigned char *data = image.GetData();
|
unsigned char *data = image.GetData();
|
||||||
int index = 0;
|
int index = 0;
|
||||||
|
|
||||||
unsigned char red = colour.Red();
|
unsigned char red = colour.Red();
|
||||||
unsigned char green = colour.Green();
|
unsigned char green = colour.Green();
|
||||||
unsigned char blue = colour.Blue();
|
unsigned char blue = colour.Blue();
|
||||||
|
|
||||||
GdkVisual *visual = gdk_visual_get_system();
|
GdkVisual *visual = gdk_visual_get_system();
|
||||||
int bpp = visual->depth;
|
int bpp = visual->depth;
|
||||||
if ((bpp == 16) && (visual->red_mask != 0xf800)) bpp = 15;
|
if ((bpp == 16) && (visual->red_mask != 0xf800)) bpp = 15;
|
||||||
@@ -103,33 +110,33 @@ bool wxMask::Create( const wxBitmap& bitmap,
|
|||||||
blue = blue & 0xfc;
|
blue = blue & 0xfc;
|
||||||
green = green & 0xf8;
|
green = green & 0xf8;
|
||||||
}
|
}
|
||||||
|
|
||||||
color.red = 0;
|
color.red = 0;
|
||||||
color.green = 0;
|
color.green = 0;
|
||||||
color.blue = 0;
|
color.blue = 0;
|
||||||
color.pixel = 0;
|
color.pixel = 0;
|
||||||
gdk_gc_set_foreground( gc, &color );
|
gdk_gc_set_foreground( gc, &color );
|
||||||
|
|
||||||
for (int j = 0; j < image.GetHeight(); j++)
|
for (int j = 0; j < image.GetHeight(); j++)
|
||||||
{
|
{
|
||||||
int start_x = -1;
|
int start_x = -1;
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < image.GetWidth(); i++)
|
for (i = 0; i < image.GetWidth(); i++)
|
||||||
{
|
{
|
||||||
if ((data[index] == red) &&
|
if ((data[index] == red) &&
|
||||||
(data[index+1] == green) &&
|
(data[index+1] == green) &&
|
||||||
(data[index+2] == blue))
|
(data[index+2] == blue))
|
||||||
{
|
{
|
||||||
if (start_x == -1)
|
if (start_x == -1)
|
||||||
start_x = i;
|
start_x = i;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (start_x != -1)
|
if (start_x != -1)
|
||||||
{
|
{
|
||||||
gdk_draw_line( m_bitmap, gc, start_x, j, i-1, j );
|
gdk_draw_line( m_bitmap, gc, start_x, j, i-1, j );
|
||||||
start_x = -1;
|
start_x = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
index += 3;
|
index += 3;
|
||||||
}
|
}
|
||||||
@@ -387,39 +394,39 @@ void wxBitmap::SetMask( wxMask *mask )
|
|||||||
wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const
|
wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( Ok() &&
|
wxCHECK_MSG( Ok() &&
|
||||||
(rect.x >= 0) && (rect.y >= 0) &&
|
(rect.x >= 0) && (rect.y >= 0) &&
|
||||||
(rect.x+rect.width <= M_BMPDATA->m_width) && (rect.y+rect.height <= M_BMPDATA->m_height),
|
(rect.x+rect.width <= M_BMPDATA->m_width) && (rect.y+rect.height <= M_BMPDATA->m_height),
|
||||||
wxNullBitmap, wxT("invalid bitmap or bitmap region") );
|
wxNullBitmap, wxT("invalid bitmap or bitmap region") );
|
||||||
|
|
||||||
wxBitmap ret( rect.width, rect.height, M_BMPDATA->m_bpp );
|
wxBitmap ret( rect.width, rect.height, M_BMPDATA->m_bpp );
|
||||||
wxASSERT_MSG( ret.Ok(), wxT("GetSubBitmap error") );
|
wxASSERT_MSG( ret.Ok(), wxT("GetSubBitmap error") );
|
||||||
|
|
||||||
if (ret.GetPixmap())
|
if (ret.GetPixmap())
|
||||||
{
|
{
|
||||||
GdkGC *gc = gdk_gc_new( ret.GetPixmap() );
|
GdkGC *gc = gdk_gc_new( ret.GetPixmap() );
|
||||||
gdk_draw_pixmap( ret.GetPixmap(), gc, GetPixmap(), rect.x, rect.y, 0, 0, rect.width, rect.height );
|
gdk_draw_pixmap( ret.GetPixmap(), gc, GetPixmap(), rect.x, rect.y, 0, 0, rect.width, rect.height );
|
||||||
gdk_gc_destroy( gc );
|
gdk_gc_destroy( gc );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GdkGC *gc = gdk_gc_new( ret.GetBitmap() );
|
GdkGC *gc = gdk_gc_new( ret.GetBitmap() );
|
||||||
gdk_draw_bitmap( ret.GetBitmap(), gc, GetBitmap(), rect.x, rect.y, 0, 0, rect.width, rect.height );
|
gdk_draw_bitmap( ret.GetBitmap(), gc, GetBitmap(), rect.x, rect.y, 0, 0, rect.width, rect.height );
|
||||||
gdk_gc_destroy( gc );
|
gdk_gc_destroy( gc );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetMask())
|
if (GetMask())
|
||||||
{
|
{
|
||||||
wxMask *mask = new wxMask;
|
wxMask *mask = new wxMask;
|
||||||
GdkWindow *parent = (GdkWindow*) &gdk_root_parent;
|
GdkWindow *parent = (GdkWindow*) &gdk_root_parent;
|
||||||
mask->m_bitmap = gdk_pixmap_new( parent, rect.width, rect.height, 1 );
|
mask->m_bitmap = gdk_pixmap_new( parent, rect.width, rect.height, 1 );
|
||||||
|
|
||||||
GdkGC *gc = gdk_gc_new( mask->m_bitmap );
|
GdkGC *gc = gdk_gc_new( mask->m_bitmap );
|
||||||
gdk_draw_bitmap( mask->m_bitmap, gc, M_BMPDATA->m_mask->m_bitmap, 0, 0, rect.x, rect.y, rect.width, rect.height );
|
gdk_draw_bitmap( mask->m_bitmap, gc, M_BMPDATA->m_mask->m_bitmap, 0, 0, rect.x, rect.y, rect.width, rect.height );
|
||||||
gdk_gc_destroy( gc );
|
gdk_gc_destroy( gc );
|
||||||
|
|
||||||
ret.SetMask( mask );
|
ret.SetMask( mask );
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -463,7 +463,7 @@ void wxComboBox::Copy()
|
|||||||
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
||||||
|
|
||||||
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
|
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
|
||||||
#if (GTK_MINOR_VERSION > 0)
|
#if defined(__WXGTK13__) || (GTK_MINOR_VERSION > 0)
|
||||||
gtk_editable_copy_clipboard( GTK_EDITABLE(entry) );
|
gtk_editable_copy_clipboard( GTK_EDITABLE(entry) );
|
||||||
#else
|
#else
|
||||||
gtk_editable_copy_clipboard( GTK_EDITABLE(entry), 0 );
|
gtk_editable_copy_clipboard( GTK_EDITABLE(entry), 0 );
|
||||||
@@ -475,7 +475,7 @@ void wxComboBox::Cut()
|
|||||||
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
||||||
|
|
||||||
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
|
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
|
||||||
#if (GTK_MINOR_VERSION > 0)
|
#if defined(__WXGTK13__) || (GTK_MINOR_VERSION > 0)
|
||||||
gtk_editable_cut_clipboard( GTK_EDITABLE(entry) );
|
gtk_editable_cut_clipboard( GTK_EDITABLE(entry) );
|
||||||
#else
|
#else
|
||||||
gtk_editable_cut_clipboard( GTK_EDITABLE(entry), 0 );
|
gtk_editable_cut_clipboard( GTK_EDITABLE(entry), 0 );
|
||||||
@@ -487,7 +487,7 @@ void wxComboBox::Paste()
|
|||||||
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
||||||
|
|
||||||
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
|
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
|
||||||
#if (GTK_MINOR_VERSION > 0)
|
#if defined(__WXGTK13__) || (GTK_MINOR_VERSION > 0)
|
||||||
gtk_editable_paste_clipboard( GTK_EDITABLE(entry) );
|
gtk_editable_paste_clipboard( GTK_EDITABLE(entry) );
|
||||||
#else
|
#else
|
||||||
gtk_editable_paste_clipboard( GTK_EDITABLE(entry), 0 );
|
gtk_editable_paste_clipboard( GTK_EDITABLE(entry), 0 );
|
||||||
|
|||||||
@@ -792,13 +792,13 @@ void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y )
|
|||||||
properties (see wxXt implementation) */
|
properties (see wxXt implementation) */
|
||||||
if (m_font.GetUnderlined())
|
if (m_font.GetUnderlined())
|
||||||
{
|
{
|
||||||
long width = gdk_string_width( font, text.mbc_str() );
|
wxCoord width = gdk_string_width( font, text.mbc_str() );
|
||||||
long ul_y = y + font->ascent;
|
wxCoord ul_y = y + font->ascent;
|
||||||
if (font->descent > 0) ul_y++;
|
if (font->descent > 0) ul_y++;
|
||||||
gdk_draw_line( m_window, m_textGC, x, ul_y, x + width, ul_y);
|
gdk_draw_line( m_window, m_textGC, x, ul_y, x + width, ul_y);
|
||||||
}
|
}
|
||||||
|
|
||||||
long w, h;
|
wxCoord w, h;
|
||||||
GetTextExtent (text, &w, &h);
|
GetTextExtent (text, &w, &h);
|
||||||
CalcBoundingBox (x + w, y + h);
|
CalcBoundingBox (x + w, y + h);
|
||||||
CalcBoundingBox (x, y);
|
CalcBoundingBox (x, y);
|
||||||
@@ -821,8 +821,8 @@ void wxWindowDC::DoDrawRotatedText( const wxString &text, wxCoord x, wxCoord y,
|
|||||||
wxCHECK_RET( font, wxT("invalid font") );
|
wxCHECK_RET( font, wxT("invalid font") );
|
||||||
|
|
||||||
// the size of the text
|
// the size of the text
|
||||||
int w = gdk_string_width( font, text.mbc_str() );
|
wxCoord w = gdk_string_width( font, text.mbc_str() );
|
||||||
int h = font->ascent + font->descent;
|
wxCoord h = font->ascent + font->descent;
|
||||||
|
|
||||||
// draw the string normally
|
// draw the string normally
|
||||||
wxBitmap src(w, h);
|
wxBitmap src(w, h);
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto
|
|||||||
int y = (int)gdk_event->y;
|
int y = (int)gdk_event->y;
|
||||||
|
|
||||||
DrawFrame( widget, win->m_oldX, win->m_oldY, win->m_width, win->m_height );
|
DrawFrame( widget, win->m_oldX, win->m_oldY, win->m_width, win->m_height );
|
||||||
gdk_pointer_ungrab ( GDK_CURRENT_TIME );
|
gdk_pointer_ungrab ( (guint32)GDK_CURRENT_TIME );
|
||||||
int org_x = 0;
|
int org_x = 0;
|
||||||
int org_y = 0;
|
int org_y = 0;
|
||||||
gdk_window_get_origin( widget->window, &org_x, &org_y );
|
gdk_window_get_origin( widget->window, &org_x, &org_y );
|
||||||
|
|||||||
@@ -100,17 +100,27 @@ wxTextCtrl::wxTextCtrl()
|
|||||||
m_modified = FALSE;
|
m_modified = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxTextCtrl::wxTextCtrl( wxWindow *parent, wxWindowID id, const wxString &value,
|
wxTextCtrl::wxTextCtrl( wxWindow *parent,
|
||||||
const wxPoint &pos, const wxSize &size,
|
wxWindowID id,
|
||||||
int style, const wxValidator& validator, const wxString &name )
|
const wxString &value,
|
||||||
|
const wxPoint &pos,
|
||||||
|
const wxSize &size,
|
||||||
|
long style,
|
||||||
|
const wxValidator& validator,
|
||||||
|
const wxString &name )
|
||||||
{
|
{
|
||||||
m_modified = FALSE;
|
m_modified = FALSE;
|
||||||
Create( parent, id, value, pos, size, style, validator, name );
|
Create( parent, id, value, pos, size, style, validator, name );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value,
|
bool wxTextCtrl::Create( wxWindow *parent,
|
||||||
const wxPoint &pos, const wxSize &size,
|
wxWindowID id,
|
||||||
int style, const wxValidator& validator, const wxString &name )
|
const wxString &value,
|
||||||
|
const wxPoint &pos,
|
||||||
|
const wxSize &size,
|
||||||
|
long style,
|
||||||
|
const wxValidator& validator,
|
||||||
|
const wxString &name )
|
||||||
{
|
{
|
||||||
m_needParent = TRUE;
|
m_needParent = TRUE;
|
||||||
m_acceptsFocus = TRUE;
|
m_acceptsFocus = TRUE;
|
||||||
@@ -119,7 +129,7 @@ bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value,
|
|||||||
!CreateBase( parent, id, pos, size, style, validator, name ))
|
!CreateBase( parent, id, pos, size, style, validator, name ))
|
||||||
{
|
{
|
||||||
wxFAIL_MSG( wxT("wxTextCtrl creation failed") );
|
wxFAIL_MSG( wxT("wxTextCtrl creation failed") );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -247,7 +257,7 @@ bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value,
|
|||||||
SetForegroundColour( parent->GetForegroundColour() );
|
SetForegroundColour( parent->GetForegroundColour() );
|
||||||
|
|
||||||
m_cursor = wxCursor( wxCURSOR_IBEAM );
|
m_cursor = wxCursor( wxCURSOR_IBEAM );
|
||||||
|
|
||||||
Show( TRUE );
|
Show( TRUE );
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -330,7 +340,7 @@ void wxTextCtrl::WriteText( const wxString &text )
|
|||||||
{
|
{
|
||||||
/* this moves the cursor pos to behind the inserted text */
|
/* this moves the cursor pos to behind the inserted text */
|
||||||
gint len = GTK_EDITABLE(m_text)->current_pos;
|
gint len = GTK_EDITABLE(m_text)->current_pos;
|
||||||
|
|
||||||
#if wxUSE_UNICODE
|
#if wxUSE_UNICODE
|
||||||
wxWX2MBbuf buf = text.mbc_str();
|
wxWX2MBbuf buf = text.mbc_str();
|
||||||
gtk_editable_insert_text( GTK_EDITABLE(m_text), buf, strlen(buf), &len );
|
gtk_editable_insert_text( GTK_EDITABLE(m_text), buf, strlen(buf), &len );
|
||||||
@@ -781,13 +791,13 @@ void wxTextCtrl::OnChar( wxKeyEvent &key_event )
|
|||||||
wxWindow *top_frame = m_parent;
|
wxWindow *top_frame = m_parent;
|
||||||
while (top_frame->GetParent() && !(top_frame->IsTopLevel()))
|
while (top_frame->GetParent() && !(top_frame->IsTopLevel()))
|
||||||
top_frame = top_frame->GetParent();
|
top_frame = top_frame->GetParent();
|
||||||
GtkWindow *window = GTK_WINDOW(top_frame->m_widget);
|
GtkWindow *window = GTK_WINDOW(top_frame->m_widget);
|
||||||
|
|
||||||
if (window->default_widget)
|
if (window->default_widget)
|
||||||
{
|
{
|
||||||
gtk_widget_activate (window->default_widget);
|
gtk_widget_activate (window->default_widget);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
key_event.Skip();
|
key_event.Skip();
|
||||||
@@ -945,11 +955,11 @@ void wxTextCtrl::OnInternalIdle()
|
|||||||
if (cursor.Ok())
|
if (cursor.Ok())
|
||||||
{
|
{
|
||||||
GdkWindow *window = (GdkWindow*) NULL;
|
GdkWindow *window = (GdkWindow*) NULL;
|
||||||
if (HasFlag(wxTE_MULTILINE))
|
if (HasFlag(wxTE_MULTILINE))
|
||||||
window = GTK_TEXT(m_text)->text_area;
|
window = GTK_TEXT(m_text)->text_area;
|
||||||
else
|
else
|
||||||
window = GTK_ENTRY(m_text)->text_area;
|
window = GTK_ENTRY(m_text)->text_area;
|
||||||
|
|
||||||
if (window)
|
if (window)
|
||||||
gdk_window_set_cursor( window, cursor.GetCursor() );
|
gdk_window_set_cursor( window, cursor.GetCursor() );
|
||||||
|
|
||||||
|
|||||||
@@ -944,8 +944,8 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
|
|||||||
event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
|
event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
|
||||||
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
|
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
|
||||||
|
|
||||||
event.m_x = (long)gdk_event->x;
|
event.m_x = (wxCoord)gdk_event->x;
|
||||||
event.m_y = (long)gdk_event->y;
|
event.m_y = (wxCoord)gdk_event->y;
|
||||||
|
|
||||||
// Some control don't have their own X window and thus cannot get
|
// Some control don't have their own X window and thus cannot get
|
||||||
// any events.
|
// any events.
|
||||||
@@ -1071,8 +1071,8 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto
|
|||||||
event.m_leftDown = (gdk_event->state & GDK_BUTTON1_MASK);
|
event.m_leftDown = (gdk_event->state & GDK_BUTTON1_MASK);
|
||||||
event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
|
event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
|
||||||
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
|
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
|
||||||
event.m_x = (long)gdk_event->x;
|
event.m_x = (wxCoord)gdk_event->x;
|
||||||
event.m_y = (long)gdk_event->y;
|
event.m_y = (wxCoord)gdk_event->y;
|
||||||
|
|
||||||
// Some control don't have their own X window and thus cannot get
|
// Some control don't have their own X window and thus cannot get
|
||||||
// any events.
|
// any events.
|
||||||
@@ -1191,8 +1191,8 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion
|
|||||||
event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
|
event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
|
||||||
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
|
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
|
||||||
|
|
||||||
event.m_x = (long)gdk_event->x;
|
event.m_x = (wxCoord)gdk_event->x;
|
||||||
event.m_y = (long)gdk_event->y;
|
event.m_y = (wxCoord)gdk_event->y;
|
||||||
|
|
||||||
// Some control don't have their own X window and thus cannot get
|
// Some control don't have their own X window and thus cannot get
|
||||||
// any events.
|
// any events.
|
||||||
@@ -1406,8 +1406,8 @@ static gint gtk_window_enter_callback( GtkWidget *widget, GdkEventCrossing *gdk_
|
|||||||
event.m_middleDown = (state & GDK_BUTTON2_MASK);
|
event.m_middleDown = (state & GDK_BUTTON2_MASK);
|
||||||
event.m_rightDown = (state & GDK_BUTTON3_MASK);
|
event.m_rightDown = (state & GDK_BUTTON3_MASK);
|
||||||
|
|
||||||
event.m_x = (long)x;
|
event.m_x = x;
|
||||||
event.m_y = (long)y;
|
event.m_y = y;
|
||||||
|
|
||||||
if (win->GetEventHandler()->ProcessEvent( event ))
|
if (win->GetEventHandler()->ProcessEvent( event ))
|
||||||
{
|
{
|
||||||
@@ -1452,8 +1452,8 @@ static gint gtk_window_leave_callback( GtkWidget *widget, GdkEventCrossing *gdk_
|
|||||||
event.m_middleDown = (state & GDK_BUTTON2_MASK);
|
event.m_middleDown = (state & GDK_BUTTON2_MASK);
|
||||||
event.m_rightDown = (state & GDK_BUTTON3_MASK);
|
event.m_rightDown = (state & GDK_BUTTON3_MASK);
|
||||||
|
|
||||||
event.m_x = (long)x;
|
event.m_x = x;
|
||||||
event.m_y = (long)y;
|
event.m_y = y;
|
||||||
|
|
||||||
if (win->GetEventHandler()->ProcessEvent( event ))
|
if (win->GetEventHandler()->ProcessEvent( event ))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -313,7 +313,7 @@ wxDialUpManagerImpl::Dial(const wxString &isp,
|
|||||||
if ( async )
|
if ( async )
|
||||||
{
|
{
|
||||||
m_DialProcess = new wxDialProcess(this);
|
m_DialProcess = new wxDialProcess(this);
|
||||||
m_DialPId = wxExecute(cmd, FALSE, m_DialProcess);
|
m_DialPId = (int)wxExecute(cmd, FALSE, m_DialProcess);
|
||||||
if(m_DialPId == 0)
|
if(m_DialPId == 0)
|
||||||
{
|
{
|
||||||
delete m_DialProcess;
|
delete m_DialProcess;
|
||||||
@@ -533,6 +533,9 @@ wxDialUpManagerImpl::CheckIfconfig(void)
|
|||||||
cmd << " -a";
|
cmd << " -a";
|
||||||
#elif defined(__LINUX__) || defined (__FREEBSD__) || defined(__SGI__)
|
#elif defined(__LINUX__) || defined (__FREEBSD__) || defined(__SGI__)
|
||||||
// nothing to be added to ifconfig
|
// nothing to be added to ifconfig
|
||||||
|
#elif defined(__HPUX__)
|
||||||
|
// VZ: a wild guess (but without it, ifconfig fails completely)
|
||||||
|
cmd << _T(" ppp0");
|
||||||
#else
|
#else
|
||||||
# pragma warning "No ifconfig information for this OS."
|
# pragma warning "No ifconfig information for this OS."
|
||||||
m_CanUseIfconfig = 0;
|
m_CanUseIfconfig = 0;
|
||||||
@@ -564,6 +567,9 @@ wxDialUpManagerImpl::CheckIfconfig(void)
|
|||||||
|| strstr(output,"pl"); // plip
|
|| strstr(output,"pl"); // plip
|
||||||
#elif defined(__SGI__) // IRIX
|
#elif defined(__SGI__) // IRIX
|
||||||
rc = strstr(output, "ppp"); // PPP
|
rc = strstr(output, "ppp"); // PPP
|
||||||
|
#elif defined(__HPUX__)
|
||||||
|
// if could run ifconfig on interface, then it exists
|
||||||
|
rc = TRUE;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
file.Close();
|
file.Close();
|
||||||
@@ -575,7 +581,8 @@ wxDialUpManagerImpl::CheckIfconfig(void)
|
|||||||
m_CanUseIfconfig = 0; // don<6F>t try again
|
m_CanUseIfconfig = 0; // don<6F>t try again
|
||||||
(void) wxRemoveFile(tmpfile);
|
(void) wxRemoveFile(tmpfile);
|
||||||
}
|
}
|
||||||
return rc;
|
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
@@ -607,6 +614,8 @@ wxDialUpManagerImpl::CheckPing(void)
|
|||||||
// nothing to add to ping command
|
// nothing to add to ping command
|
||||||
#elif defined(__LINUX__)
|
#elif defined(__LINUX__)
|
||||||
cmd << "-c 1 "; // only ping once
|
cmd << "-c 1 "; // only ping once
|
||||||
|
#elif defined(__HPUX__)
|
||||||
|
cmd << "64 1 "; // only ping once (need also specify the packet size)
|
||||||
#else
|
#else
|
||||||
# pragma warning "No Ping information for this OS."
|
# pragma warning "No Ping information for this OS."
|
||||||
m_CanUsePing = 0;
|
m_CanUsePing = 0;
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ void wxUsleep(unsigned long milliseconds)
|
|||||||
{
|
{
|
||||||
#if defined(HAVE_NANOSLEEP)
|
#if defined(HAVE_NANOSLEEP)
|
||||||
timespec tmReq;
|
timespec tmReq;
|
||||||
tmReq.tv_sec = milliseconds / 1000;
|
tmReq.tv_sec = (time_t)(milliseconds / 1000);
|
||||||
tmReq.tv_nsec = (milliseconds % 1000) * 1000 * 1000;
|
tmReq.tv_nsec = (milliseconds % 1000) * 1000 * 1000;
|
||||||
|
|
||||||
// we're not interested in remaining time nor in return value
|
// we're not interested in remaining time nor in return value
|
||||||
@@ -126,7 +126,7 @@ void wxUsleep(unsigned long milliseconds)
|
|||||||
|
|
||||||
int wxKill(long pid, wxSignal sig)
|
int wxKill(long pid, wxSignal sig)
|
||||||
{
|
{
|
||||||
return kill(pid, (int)sig);
|
return kill((pid_t)pid, (int)sig);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define WXEXECUTE_NARGS 127
|
#define WXEXECUTE_NARGS 127
|
||||||
|
|||||||
Reference in New Issue
Block a user