remove wx and libelf/libdwarf code which wasnt going anywhere

This commit is contained in:
zeromus 2013-09-11 20:47:16 +00:00
parent bb40b69791
commit baaddef970
822 changed files with 9 additions and 168431 deletions

View File

@ -8,7 +8,7 @@ SUBDIRS = . gdbstub $(UI_DIR)
else
SUBDIRS = . $(UI_DIR)
endif
DIST_SUBDIRS = . gdbstub cli gtk gtk-glade wx
DIST_SUBDIRS = . gdbstub cli gtk gtk-glade
noinst_LIBRARIES = libdesmume.a
libdesmume_a_SOURCES = \
armcpu.cpp armcpu.h \

View File

@ -290,7 +290,7 @@ void BackupDevice::reset_command()
}
u8 BackupDevice::data_command(u8 val, int cpu)
{
//printf("MC CMD: %02X\n",val);
printf("MC CMD: (%02X) %02X\n",com,val);
//motion: some guessing here... hope it doesn't break anything
if(com == BM_CMD_READLOW && motionInitState == MOTION_INIT_STATE_RECEIVED_4_B && val == 0)
@ -365,7 +365,7 @@ u8 BackupDevice::data_command(u8 val, int cpu)
else if(com == BM_CMD_READSTATUS)
{
//handle request to read status
LOG("Backup Memory Read Status: %02X\n", write_enable << 1);
//LOG("Backup Memory Read Status: %02X\n", write_enable << 1);
return (write_enable << 1) | (3<<2);
}
else

View File

@ -55,7 +55,7 @@
FavorSizeOrSpeed="0"
EnableFiberSafeOptimizations="false"
WholeProgramOptimization="false"
AdditionalIncludeDirectories=".;..;lua\include;&quot;glib-2.20.1\build&quot;;&quot;glib-2.20.1\build\glib&quot;;.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;.\wx\include;directx"
AdditionalIncludeDirectories=".;..;lua\include;&quot;glib-2.20.1\build&quot;;&quot;glib-2.20.1\build\glib&quot;;.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;directx"
PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;DEBUG;_CRT_SECURE_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;HAVE_LIBZ;NOMINMAX;_WIN32_WINNT=0x0501;_CRTDBG_MAPALLOC "
ExceptionHandling="1"
BasicRuntimeChecks="0"
@ -247,7 +247,7 @@
OmitFramePointers="true"
EnableFiberSafeOptimizations="true"
WholeProgramOptimization="true"
AdditionalIncludeDirectories=".;..;lua\include;&quot;glib-2.20.1\build&quot;;&quot;glib-2.20.1\build\glib&quot;;.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;.\wx\include;directx"
AdditionalIncludeDirectories=".;..;lua\include;&quot;glib-2.20.1\build&quot;;&quot;glib-2.20.1\build\glib&quot;;.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;directx"
PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;HAVE_LIBZ;NOMINMAX;NDEBUG;RELEASE;_WIN32_WINNT=0x0501"
StringPooling="true"
ExceptionHandling="1"
@ -446,7 +446,7 @@
OmitFramePointers="true"
EnableFiberSafeOptimizations="true"
WholeProgramOptimization="false"
AdditionalIncludeDirectories=".;..;lua\include;&quot;glib-2.20.1\build&quot;;&quot;glib-2.20.1\build\glib&quot;;.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;.\wx\include;directx"
AdditionalIncludeDirectories=".;..;lua\include;&quot;glib-2.20.1\build&quot;;&quot;glib-2.20.1\build\glib&quot;;.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;directx"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;HAVE_LIBZ;NOMINMAX;NDEBUG;RELEASE;_WIN32_WINNT=0x0501;FASTBUILD"
StringPooling="true"
ExceptionHandling="1"
@ -1360,70 +1360,6 @@
/>
</FileConfiguration>
</File>
<File
RelativePath=".\libelf_libdwarf\libelf_libdwarf.7z"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
CommandLine="un7z_and_touch.bat libelf_libdwarf\libelf_libdwarf.7z .libs\libelf_libdwarf*&#x0D;&#x0A;"
AdditionalDependencies="7z.exe;un7z_and_touch.bat"
Outputs=".libs\libelf_libdwarf.tag"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCustomBuildTool"
CommandLine="un7z_and_touch.bat libelf_libdwarf\libelf_libdwarf.7z .libs\libelf_libdwarf*&#x0D;&#x0A;"
AdditionalDependencies="7z.exe;un7z_and_touch.bat"
Outputs=".libs\libelf_libdwarf.tag"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
CommandLine="un7z_and_touch.bat libelf_libdwarf\libelf_libdwarf.7z .libs\libelf_libdwarf*&#x0D;&#x0A;"
AdditionalDependencies="7z.exe;un7z_and_touch.bat"
Outputs=".libs\libelf_libdwarf.tag"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCustomBuildTool"
CommandLine="un7z_and_touch.bat libelf_libdwarf\libelf_libdwarf.7z .libs\libelf_libdwarf*&#x0D;&#x0A;"
AdditionalDependencies="7z.exe;un7z_and_touch.bat"
Outputs=".libs\libelf_libdwarf.tag"
/>
</FileConfiguration>
<FileConfiguration
Name="Release FastBuild|Win32"
>
<Tool
Name="VCCustomBuildTool"
CommandLine="un7z_and_touch.bat libelf_libdwarf\libelf_libdwarf.7z .libs\libelf_libdwarf*&#x0D;&#x0A;"
AdditionalDependencies="7z.exe;un7z_and_touch.bat"
Outputs=".libs\libelf_libdwarf.tag"
/>
</FileConfiguration>
<FileConfiguration
Name="Release FastBuild|x64"
>
<Tool
Name="VCCustomBuildTool"
CommandLine="un7z_and_touch.bat libelf_libdwarf\libelf_libdwarf.7z .libs\libelf_libdwarf*&#x0D;&#x0A;"
AdditionalDependencies="7z.exe;un7z_and_touch.bat"
Outputs=".libs\libelf_libdwarf.tag"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\lua\lua.7z"
>
@ -1488,70 +1424,6 @@
/>
</FileConfiguration>
</File>
<File
RelativePath=".\wx\wx.7z"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
CommandLine="un7z_and_touch.bat wx\wx.7z .libs\wx*&#x0D;&#x0A;"
AdditionalDependencies="7z.exe;un7z_and_touch.bat"
Outputs=".libs\wx.tag"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCustomBuildTool"
CommandLine="un7z_and_touch.bat wx\wx.7z .libs\wx*&#x0D;&#x0A;"
AdditionalDependencies="7z.exe;un7z_and_touch.bat"
Outputs=".libs\wx.tag"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
CommandLine="un7z_and_touch.bat wx\wx.7z .libs\wx*&#x0D;&#x0A;"
AdditionalDependencies="7z.exe;un7z_and_touch.bat"
Outputs=".libs\wx.tag"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCustomBuildTool"
CommandLine="un7z_and_touch.bat wx\wx.7z .libs\wx*&#x0D;&#x0A;"
AdditionalDependencies="7z.exe;un7z_and_touch.bat"
Outputs=".libs\wx.tag"
/>
</FileConfiguration>
<FileConfiguration
Name="Release FastBuild|Win32"
>
<Tool
Name="VCCustomBuildTool"
CommandLine="un7z_and_touch.bat wx\wx.7z .libs\wx*&#x0D;&#x0A;"
AdditionalDependencies="7z.exe;un7z_and_touch.bat"
Outputs=".libs\wx.tag"
/>
</FileConfiguration>
<FileConfiguration
Name="Release FastBuild|x64"
>
<Tool
Name="VCCustomBuildTool"
CommandLine="un7z_and_touch.bat wx\wx.7z .libs\wx*&#x0D;&#x0A;"
AdditionalDependencies="7z.exe;un7z_and_touch.bat"
Outputs=".libs\wx.tag"
/>
</FileConfiguration>
</File>
</Filter>
</Filter>
<Filter
@ -2416,26 +2288,6 @@
</File>
</Filter>
</Filter>
<Filter
Name="wxdlg"
>
<File
RelativePath="..\wxdlg\wxdlg3dViewer.cpp"
>
<FileConfiguration
Name="Release FastBuild|Win32"
>
<Tool
Name="VCCLCompilerTool"
GeneratePreprocessedFile="0"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\wxdlg\wxdlg3dViewer.h"
>
</File>
</Filter>
<Filter
Name="filter"
>

View File

@ -56,7 +56,7 @@
FavorSizeOrSpeed="0"
EnableFiberSafeOptimizations="false"
WholeProgramOptimization="false"
AdditionalIncludeDirectories=".;..;lua\include;&quot;glib-2.20.1\build&quot;;&quot;glib-2.20.1\build\glib&quot;;.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;.\wx\include;directx"
AdditionalIncludeDirectories=".;..;lua\include;&quot;glib-2.20.1\build&quot;;&quot;glib-2.20.1\build\glib&quot;;.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;directx"
PreprocessorDefinitions="DEBUG;_CRT_SECURE_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;BETA_VERSION;NOMINMAX;HAVE_LIBZ"
ExceptionHandling="1"
BasicRuntimeChecks="3"
@ -238,7 +238,7 @@
OmitFramePointers="true"
EnableFiberSafeOptimizations="true"
WholeProgramOptimization="true"
AdditionalIncludeDirectories=".;..;lua\include;&quot;glib-2.20.1\build&quot;;&quot;glib-2.20.1\build\glib&quot;;.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;.\wx\include;directx"
AdditionalIncludeDirectories=".;..;lua\include;&quot;glib-2.20.1\build&quot;;&quot;glib-2.20.1\build\glib&quot;;.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;directx"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;HAVE_LIBZ;NOMINMAX;RELEASE;NDEBUG"
StringPooling="true"
ExceptionHandling="1"
@ -428,7 +428,7 @@
OmitFramePointers="true"
EnableFiberSafeOptimizations="true"
WholeProgramOptimization="false"
AdditionalIncludeDirectories=".;..;lua\include;&quot;glib-2.20.1\build&quot;;&quot;glib-2.20.1\build\glib&quot;;.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;.\wx\include;directx"
AdditionalIncludeDirectories=".;..;lua\include;&quot;glib-2.20.1\build&quot;;&quot;glib-2.20.1\build\glib&quot;;.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;directx"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;HAVE_LIBZ;NOMINMAX;RELEASE;NDEBUG;FASTBUILD;DEVELOPER"
StringPooling="true"
ExceptionHandling="1"
@ -2601,70 +2601,6 @@
/>
</FileConfiguration>
</File>
<File
RelativePath=".\libelf_libdwarf\libelf_libdwarf.7z"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
CommandLine="un7z_and_touch.bat libelf_libdwarf\libelf_libdwarf.7z .libs\libelf_libdwarf*&#x0D;&#x0A;"
AdditionalDependencies="7z.exe;un7z_and_touch.bat"
Outputs=".libs\libelf_libdwarf.tag"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCustomBuildTool"
CommandLine="un7z_and_touch.bat libelf_libdwarf\libelf_libdwarf.7z .libs\libelf_libdwarf*&#x0D;&#x0A;"
AdditionalDependencies="7z.exe;un7z_and_touch.bat"
Outputs=".libs\libelf_libdwarf.tag"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
CommandLine="un7z_and_touch.bat libelf_libdwarf\libelf_libdwarf.7z .libs\libelf_libdwarf*&#x0D;&#x0A;"
AdditionalDependencies="7z.exe;un7z_and_touch.bat"
Outputs=".libs\libelf_libdwarf.tag"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCustomBuildTool"
CommandLine="un7z_and_touch.bat libelf_libdwarf\libelf_libdwarf.7z .libs\libelf_libdwarf*&#x0D;&#x0A;"
AdditionalDependencies="7z.exe;un7z_and_touch.bat"
Outputs=".libs\libelf_libdwarf.tag"
/>
</FileConfiguration>
<FileConfiguration
Name="Dev+|Win32"
>
<Tool
Name="VCCustomBuildTool"
CommandLine="un7z_and_touch.bat libelf_libdwarf\libelf_libdwarf.7z .libs\libelf_libdwarf*&#x0D;&#x0A;"
AdditionalDependencies="7z.exe;un7z_and_touch.bat"
Outputs=".libs\libelf_libdwarf.tag"
/>
</FileConfiguration>
<FileConfiguration
Name="Dev+|x64"
>
<Tool
Name="VCCustomBuildTool"
CommandLine="un7z_and_touch.bat libelf_libdwarf\libelf_libdwarf.7z .libs\libelf_libdwarf*&#x0D;&#x0A;"
AdditionalDependencies="7z.exe;un7z_and_touch.bat"
Outputs=".libs\libelf_libdwarf.tag"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\lua\lua.7z"
>
@ -2738,70 +2674,6 @@
/>
</FileConfiguration>
</File>
<File
RelativePath=".\wx\wx.7z"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
CommandLine="un7z_and_touch.bat wx\wx.7z .libs\wx*&#x0D;&#x0A;"
AdditionalDependencies="7z.exe;un7z_and_touch.bat"
Outputs=".libs\wx.tag"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCustomBuildTool"
CommandLine="un7z_and_touch.bat wx\wx.7z .libs\wx*&#x0D;&#x0A;"
AdditionalDependencies="7z.exe;un7z_and_touch.bat"
Outputs=".libs\wx.tag"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
CommandLine="un7z_and_touch.bat wx\wx.7z .libs\wx*&#x0D;&#x0A;"
AdditionalDependencies="7z.exe;un7z_and_touch.bat"
Outputs=".libs\wx.tag"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCustomBuildTool"
CommandLine="un7z_and_touch.bat wx\wx.7z .libs\wx*&#x0D;&#x0A;"
AdditionalDependencies="7z.exe;un7z_and_touch.bat"
Outputs=".libs\wx.tag"
/>
</FileConfiguration>
<FileConfiguration
Name="Dev+|Win32"
>
<Tool
Name="VCCustomBuildTool"
CommandLine="un7z_and_touch.bat wx\wx.7z .libs\wx*&#x0D;&#x0A;"
AdditionalDependencies="7z.exe;un7z_and_touch.bat"
Outputs=".libs\wx.tag"
/>
</FileConfiguration>
<FileConfiguration
Name="Release FastBuild|x64"
>
<Tool
Name="VCCustomBuildTool"
CommandLine="un7z_and_touch.bat wx\wx.7z .libs\wx*"
AdditionalDependencies="7z.exe;un7z_and_touch.bat"
Outputs=".libs\wx.tag"
/>
</FileConfiguration>
</File>
</Filter>
</Filter>
<File

View File

@ -1,47 +0,0 @@
/*
Copyright (C) 2009-2010 SN Systems. All Rights Reserved.
Portions Copyright (C) 2009-2010 David Anderson. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
#ifndef common_INCLUDED
#define common_INCLUDED
#include <stdio.h>
void print_args(int argc, char *argv[]);
void print_usage_message(const char *options[]);
void print_version(const char * name);
#endif /* common_INCLUDED */

File diff suppressed because it is too large Load Diff

View File

@ -1,55 +0,0 @@
/*
Copyright (C) 2000 Silicon Graphics, Inc. All Rights Reserved.
Portions Copyright (C) 2008-2010 David Anderson. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
/* In a given CU, one of these is (eventually) set up
for every abbreviation we need to find (and for all.
those ealier in the abbreviations for that CU).
So we don't want elements needlessly big.
*/
struct Dwarf_Abbrev_s {
/* No TAG should exceed DW_TAG_hi_user, 0xffff, but
we do allow a larger value here. */
Dwarf_Word ab_tag;
/* Abbreviations are numbered (normally sequentially from
1 and so 16 bits is not enough! */
Dwarf_Word ab_code;
Dwarf_Small ab_has_child;
Dwarf_Byte_Ptr ab_abbrev_ptr;
Dwarf_Debug ab_dbg;
};

View File

@ -1,55 +0,0 @@
/*
dwarf_addr_finder.h
$Source: /plroot/cmplrs.src/v7.4.5m/.RCS/PL/include/cmplrs/RCS/dwarf_addr_finder.h,v $
$Date: 2002/06/11 17:49:06 $
Defines user interface.
*/
/* return codes for functions
*/
#define DW_DLV_NO_ENTRY -1
#define DW_DLV_OK 0
#define DW_DLV_ERROR 1
/* the following are the 'section' number passed to the called-back
function.
The called-back application must translate this to the
appropriate elf section number/pointer.
Putting this burden on the application avoids having to store
the numbers in the Dwarf_Debug structure (thereby saving space
for most consumers).
*/
#define DW_SECTION_INFO 0
#define DW_SECTION_FRAME 1
#define DW_SECTION_ARANGES 2
#define DW_SECTION_LINE 3
#define DW_SECTION_LOC 4 /* .debug_loc */
/* section is one of the above codes: it specifies a section.
secoff is the offset in the dwarf section.
existingAddr is the value at the specified offset (so the
called back routine can sanity check the proceedings).
It's up to the caller to know the size of an address (4 or 8)
and update the right number of bytes.
*/
typedef int (*Dwarf_addr_callback_func) (int /*section*/,
Dwarf_Off /*secoff*/, Dwarf_Addr /*existingAddr*/);
/* call this to do the work: it calls back thru cb_func
once per each address to be modified.
Once this returns you are done.
Returns DW_DLV_OK if finished ok.
Returns DW_DLV_ERROR if there was some kind of error, in which
the dwarf error number was passed back thu the dwerr ptr.
Returns DW_DLV_NO_ENTRY if there are no relevant dwarf sections,
so there were no addresses to be modified (and none
called back).
*/
int _dwarf_addr_finder(dwarf_elf_handle elf_file_ptr,
Dwarf_addr_callback_func cb_func,
int *dwerr);

View File

@ -1,177 +0,0 @@
/*
Copyright (C) 2000,2005 Silicon Graphics, Inc. All Rights Reserved.
Portions Copyright (C) 2008-2010 David Anderson. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
/* #define DWARF_SIMPLE_MALLOC 1 */
Dwarf_Ptr _dwarf_get_alloc(Dwarf_Debug, Dwarf_Small, Dwarf_Unsigned);
Dwarf_Debug _dwarf_get_debug(void);
Dwarf_Debug _dwarf_setup_debug(Dwarf_Debug);
int _dwarf_free_all_of_one_debug(Dwarf_Debug);
typedef struct Dwarf_Alloc_Area_s *Dwarf_Alloc_Area;
typedef struct Dwarf_Free_List_s *Dwarf_Free_List;
/* ALLOC_AREA_INDEX_TABLE_MAX is the size of the
struct ial_s index_into_allocated array in dwarf_alloc.c
*/
#define ALLOC_AREA_INDEX_TABLE_MAX 45
/* ALLOC_AREA_REAL_TABLE_MAX is the size of the array needed
to hold pointers to dwarf alloc chunk areas.
It's smaller as some of the index_into_allocated
entries (they look like {0,1,1,0,0} )
are treated specially and don't use 'chunks'.
*/
#define ALLOC_AREA_REAL_TABLE_MAX 32
/*
This struct is used to chain all the deallocated
structs on the free list of each chain. The structs
are chained internally, by using the memory they
contain.
*/
struct Dwarf_Free_List_s {
Dwarf_Free_List fl_next;
};
/*
This struct is used to manage all the chunks malloc'ed
for a particular alloc_type. Many of the fields are
initialized by dwarf_init().
*/
struct Dwarf_Alloc_Hdr_s {
/* Count of actual number of structs user app holds pointers to
currently. */
Dwarf_Sword ah_struct_user_holds;
/*
Size of each struct that will be allocated for this alloc_type.
Initialized by dwarf_init(). */
Dwarf_Half ah_bytes_one_struct;
/*
Number of structs of this alloc_type that will be contained in
each chunk that is malloc'ed. Initialized by dwarf_init(). */
Dwarf_Word ah_structs_per_chunk;
/*
Number of bytes malloc'ed per chunk which is basically
(ah_bytes_one_struct+_DWARF_RESERVE) * ah_alloc_num. */
Dwarf_Word ah_bytes_malloc_per_chunk;
/* Count of chunks currently allocated for type. */
Dwarf_Sword ah_chunks_allocated;
/*
Points to a chain of Dwarf_Alloc_Area_s structs that represent
all the chunks currently allocated for the alloc_type. */
Dwarf_Alloc_Area ah_alloc_area_head;
/* Last Alloc Area that was allocated by malloc. The
free-space-search area looks here first and only if it is full
goes thru the list pointed to by ah_alloc_area_head. */
Dwarf_Alloc_Area ah_last_alloc_area;
};
/*
This struct is used to manage each chunk that is
malloc'ed for a particular alloc_type. For each
allocation type, the allocation header points to
a list of all the chunks malloc'ed for that type.
*/
struct Dwarf_Alloc_Area_s {
/* Points to the free list of structs in the chunk. */
Dwarf_Ptr aa_free_list;
/*
Count of the number of free structs in the chunk. This includes
both those on the free list, and in the blob. */
Dwarf_Sword aa_free_structs_in_chunk;
/*
Points to the first byte of the blob from which struct will be
allocated. A struct is put on the free_list only when it
dwarf_deallocated. Initial allocations are from the blob. */
Dwarf_Small *aa_blob_start;
/* Points just past the last byte of the blob. */
Dwarf_Small *aa_blob_end;
/* Points to alloc_hdr this alloc_area is linked to: The owner, in
other words. */
Dwarf_Alloc_Hdr aa_alloc_hdr;
/*
Used for chaining Dwarf_Alloc_Area_s atructs. Alloc areas are
doubly linked to enable deletion from the list in constant time. */
Dwarf_Alloc_Area aa_next;
Dwarf_Alloc_Area aa_prev;
};
struct Dwarf_Error_s *_dwarf_special_no_dbg_error_malloc(void);
#ifdef DWARF_SIMPLE_MALLOC
/*
DWARF_SIMPLE_MALLOC is for testing the hypothesis that the existing
complex malloc scheme in libdwarf is pointless complexity.
DWARF_SIMPLE_MALLOC also makes it easy for a malloc-tracing
tool to verify libdwarf malloc has no botches (though of course
such does not test the complicated standard-libdwarf-alloc code).
*/
struct simple_malloc_entry_s {
Dwarf_Small *se_addr;
unsigned long se_size;
short se_type;
};
#define DSM_BLOCK_COUNT (1000)
#define DSM_BLOCK_SIZE (sizeof(struct simple_malloc_entry_s)*DSM_BLOCK_COUNT)
/* we do this so dwarf_dealloc can really free everything */
struct simple_malloc_record_s {
struct simple_malloc_record_s *sr_next;
int sr_used;
struct simple_malloc_entry_s sr_entry[DSM_BLOCK_COUNT];
};
#endif /* DWARF_SIMPLE_MALLOC */

View File

@ -1,71 +0,0 @@
/*
Copyright (C) 2000 Silicon Graphics, Inc. All Rights Reserved.
Portions Copyright (C) 2010 David Anderson. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
/* This structure is used to read an arange into. */
struct Dwarf_Arange_s {
/* The segment selector. Only non-zero if Dwarf4, only
meaningful if ar_segment_selector_size non-zero */
Dwarf_Unsigned ar_segment_selector;
/* Starting address of the arange, ie low-pc. */
Dwarf_Addr ar_address;
/* Length of the arange. */
Dwarf_Unsigned ar_length;
/*
Offset into .debug_info of the start of the compilation-unit
containing this set of aranges. */
Dwarf_Off ar_info_offset;
/* Corresponding Dwarf_Debug. */
Dwarf_Debug ar_dbg;
Dwarf_Half ar_segment_selector_size;
};
int
_dwarf_get_aranges_addr_offsets(Dwarf_Debug dbg,
Dwarf_Addr ** addrs,
Dwarf_Off ** offsets,
Dwarf_Signed * count,
Dwarf_Error * error);

View File

@ -1,123 +0,0 @@
/*
Copyright (C) 2000,2005 Silicon Graphics, Inc. All Rights Reserved.
Portions Copyright (C) 2008-2010 David Anderson. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
#include "libdwarfdefs.h"
#define true 1
#define false 0
/* to identify a cie */
#define DW_CIE_ID ~(0x0)
#define DW_CIE_VERSION 1 /* DWARF2 */
#define DW_CIE_VERSION3 3 /* DWARF3 */
#define DW_CIE_VERSION4 4 /* DWARF4 */
#define DW_CU_VERSION2 2
#define DW_CU_VERSION3 3
#define DW_CU_VERSION4 4
/* DWARF2,3 and 4 */
#define DW_ARANGES_VERSION2 2
#define DW_LINE_VERSION2 2
#define DW_LINE_VERSION3 3
#define DW_LINE_VERSION4 4
/*
These are allocation type codes for structs that
are internal to the Libdwarf Consumer library.
*/
#define DW_DLA_ABBREV_LIST DW_DLA_RANGES + 1
#define DW_DLA_CHAIN DW_DLA_RANGES + 2
#define DW_DLA_CU_CONTEXT DW_DLA_RANGES + 3
#define DW_DLA_FRAME DW_DLA_RANGES + 4
#define DW_DLA_GLOBAL_CONTEXT DW_DLA_RANGES + 5
#define DW_DLA_FILE_ENTRY DW_DLA_RANGES + 6
#define DW_DLA_LINE_CONTEXT DW_DLA_RANGES + 7
#define DW_DLA_LOC_CHAIN DW_DLA_RANGES + 8
#define DW_DLA_HASH_TABLE DW_DLA_RANGES + 9
#define DW_DLA_FUNC_CONTEXT DW_DLA_RANGES + 10
#define DW_DLA_TYPENAME_CONTEXT DW_DLA_RANGES + 11
#define DW_DLA_VAR_CONTEXT DW_DLA_RANGES + 12
#define DW_DLA_WEAK_CONTEXT DW_DLA_RANGES + 13
#define DW_DLA_PUBTYPES_CONTEXT DW_DLA_RANGES + 14 /* DWARF3 */
#define DW_DLA_HASH_TABLE_ENTRY DW_DLA_RANGES + 15
/* Maximum number of allocation types for allocation routines. */
#define MAX_DW_DLA DW_DLA_HASH_TABLE_ENTRY
/*Dwarf_Word is unsigned word usable for index, count in memory */
/*Dwarf_Sword is signed word usable for index, count in memory */
/* The are 32 or 64 bits depending if 64 bit longs or not, which
** fits the ILP32 and LP64 models
** These work equally well with ILP64.
*/
typedef unsigned long Dwarf_Word;
typedef signed long Dwarf_Sword;
typedef signed char Dwarf_Sbyte;
typedef unsigned char Dwarf_Ubyte;
typedef signed short Dwarf_Shalf;
typedef Dwarf_Small *Dwarf_Byte_Ptr;
/* these 2 are fixed sizes which must not vary with the
** ILP32/LP64 model. Between these two, stay at 32 bit.
*/
typedef __uint32_t Dwarf_ufixed;
typedef __int32_t Dwarf_sfixed;
/*
In various places the code mistakenly associates
forms 8 bytes long with Dwarf_Signed or Dwarf_Unsigned
This is not a very portable assumption.
The following should be used instead for 64 bit integers.
*/
typedef __uint64_t Dwarf_ufixed64;
typedef __int64_t Dwarf_sfixed64;
typedef struct Dwarf_Abbrev_List_s *Dwarf_Abbrev_List;
typedef struct Dwarf_File_Entry_s *Dwarf_File_Entry;
typedef struct Dwarf_CU_Context_s *Dwarf_CU_Context;
typedef struct Dwarf_Hash_Table_s *Dwarf_Hash_Table;
typedef struct Dwarf_Hash_Table_Entry_s *Dwarf_Hash_Table_Entry;
typedef struct Dwarf_Alloc_Hdr_s *Dwarf_Alloc_Hdr;

View File

@ -1,57 +0,0 @@
/*
Copyright (C) 2000 Silicon Graphics, Inc. All Rights Reserved.
Portions Copyright (C) 2008-2010 David Anderson. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
/*
This struct holds information about a abbreviation.
It is put in the hash table for abbreviations for
a compile-unit.
*/
struct Dwarf_Abbrev_List_s {
Dwarf_Unsigned ab_code;
Dwarf_Half ab_tag;
Dwarf_Half ab_has_child;
/*
Points to start of attribute and form pairs in the .debug_abbrev
section for the abbrev. */
Dwarf_Byte_Ptr ab_abbrev_ptr;
struct Dwarf_Abbrev_List_s *ab_next;
};

View File

@ -1,55 +0,0 @@
#ifndef _DWARF_ELF_PORT_H
#define _DWARF_ELF_PORT_H
/*
Copyright (C) 2008-2010 David Anderson. All rights reserved.
Portions Copyright 2008-2010 Arxan Technologies, Inc. All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
/* ELF (usually libelf) object access for the generic object file interface */
int
dwarf_elf_object_access_init(dwarf_elf_handle elf ,
int libdwarf_owns_elf,
Dwarf_Obj_Access_Interface** ret_obj,
int *err );
void
dwarf_elf_object_access_finish(Dwarf_Obj_Access_Interface* obj );
/* End ELF object access for the generic object file interface */
#endif

View File

@ -1,43 +0,0 @@
/*
Copyright (C) 2000 Silicon Graphics, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
void _dwarf_error(Dwarf_Debug dbg, Dwarf_Error * error,
Dwarf_Sword errval);
struct Dwarf_Error_s {
Dwarf_Sword er_errval;
};

View File

@ -1,421 +0,0 @@
/*
Copyright (C) 2000, 2004, 2006 Silicon Graphics, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
/* The dwarf 2.0 standard dictates that only the following
* fields can be read when an unexpected augmentation string
* (in the cie) is encountered: CIE length, CIE_id, version and
* augmentation; FDE: length, CIE pointer, initial location and
* address range. Unfortunately, with the above restrictions, it
* is impossible to read the instruction table from a CIE or a FDE
* when a new augmentation string is encountered.
* To fix this problem, the following layout is used, if the
* augmentation string starts with the string "z".
* CIE FDE
* length length
* CIE_id CIE_pointer
* version initial_location
* augmentation address_range
* length_of_augmented_fields (*NEW*)
* code_alignment_factor Any new fields as necessary
* data_alignment_factor instruction_table
* return_address
* length_of_augmented fields
* Any new fields as necessary
* initial_instructions
*
* The type of all the old data items are the same as what is
* described in dwarf 2.0 standard. The length_of_augmented_fields
* is an LEB128 data item that denotes the size (in bytes) of
* the augmented fields (not including the size of
* "length_of_augmented_fields" itself).
* Handling of cie augmentation strings is necessarly a heuristic.
* See dwarf_frame.c for the currently known augmentation strings.
---START SGI-ONLY COMMENT:
* SGI-IRIX versions of cie or fde were intended to use "z1", "z2" as the
* augmenter strings if required for new augmentation.
* However, that never happened (as of March 2005).
*
* The fde's augmented by the string "z" have a new field
* (signed constant, 4 byte field)
* called offset_into_exception_tables, following the
* length_of_augmented field. This field contains an offset
* into the "_MIPS_eh_region", which describes
* the IRIX CC exception handling tables.
---END SGI-ONLY COMMENT
* GNU .eh_frame has an augmentation string of z[RLP]* (gcc 3.4)
* The similarity to IRIX 'z' (and proposed but never
* implemented IRIX z1, z2 etc) was confusing things.
* If the section is .eh_frame then 'z' means GNU exception
* information 'Augmentation Data' not IRIX 'z'.
* See The Linux Standard Base Core Specification version 3.0
*/
#define DW_DEBUG_FRAME_VERSION 1 /* DWARF2 */
#define DW_DEBUG_FRAME_VERSION3 3 /* DWARF3 */
#define DW_DEBUG_FRAME_VERSION4 4 /* DWARF4 */
/* The following is SGI/IRIX specific, and probably no longer
in use anywhere. */
#define DW_DEBUG_FRAME_AUGMENTER_STRING "mti v1"
/* The value of the offset field for Cie's. */
#define DW_CIE_OFFSET ~(0x0)
/* The augmentation string may be NULL. */
#define DW_EMPTY_STRING ""
#define DW_FRAME_INSTR_OPCODE_SHIFT 6
#define DW_FRAME_INSTR_OFFSET_MASK 0x3f
/*
This struct denotes the rule for a register in a row of
the frame table. In other words, it is one element of
the table.
*/
struct Dwarf_Reg_Rule_s {
/*
Is a flag indicating whether the rule includes the offset
field, ie whether the ru_offset field is valid or not.
Applies only if DW_EXPR_OFFSET or DW_EXPR_VAL_OFFSET.
It is important, since reg+offset (offset of 0) is different from
just 'register' since the former means 'read memory at address
given by the sum of register contents plus offset to get the
value'. whereas the latter means 'the value is in the register'.
The 'register' numbers are either real registers (ie, table
columns defined as real registers) or defined entries that are
not really hardware registers, such as DW_FRAME_SAME_VAL or
DW_FRAME_CFA_COL.
*/
Dwarf_Sbyte ru_is_off;
/* DW_EXPR_OFFSET (0, DWARF2)
DW_EXPR_VAL_OFFSET 1 (dwarf2/3)
DW_EXPR_EXPRESSION 2 (dwarf2/3)
DW_EXPR_VAL_EXPRESSION 3 (dwarf2/3)
See dwarf_frame.h. */
Dwarf_Sbyte ru_value_type;
/* Register involved in this rule. */
Dwarf_Half ru_register;
/* Offset to add to register, if indicated by ru_is_offset
and if DW_EXPR_OFFSET or DW_EXPR_VAL_OFFSET.
If DW_EXPR_EXPRESSION or DW_EXPR_VAL_EXPRESSION
this is DW_FORM_block block-length, not offset. */
Dwarf_Unsigned ru_offset_or_block_len;
/* For DW_EXPR_EXPRESSION DW_EXPR_VAL_EXPRESSION these is set,
else 0. */
Dwarf_Small *ru_block;
};
typedef struct Dwarf_Frame_s *Dwarf_Frame;
/*
This structure represents a row of the frame table.
Fr_loc is the pc value for this row, and Fr_reg
contains the rule for each column.
Entry DW_FRAME_CFA_COL of fr_reg was the tradional MIPS
way of setting CFA. cfa_rule is the new one.
*/
struct Dwarf_Frame_s {
/* Pc value corresponding to this row of the frame table. */
Dwarf_Addr fr_loc;
/* Rules for all the registers in this row. */
struct Dwarf_Reg_Rule_s fr_cfa_rule;
/* fr_reg_count is the the number of
entries of the fr_reg array. */
unsigned long fr_reg_count;
struct Dwarf_Reg_Rule_s *fr_reg;
Dwarf_Frame fr_next;
};
typedef struct Dwarf_Frame_Op_List_s *Dwarf_Frame_Op_List;
/* This is used to chain together Dwarf_Frame_Op structures. */
struct Dwarf_Frame_Op_List_s {
Dwarf_Frame_Op *fl_frame_instr;
Dwarf_Frame_Op_List fl_next;
};
/* See dwarf_frame.c for the heuristics used to set the
Dwarf_Cie ci_augmentation_type.
This succinctly helps interpret the size and meaning of .debug_frame
and (for gcc) .eh_frame.
In the case of gcc .eh_frame (gcc 3.3, 3.4)
z may be followed by one or more of
L R P.
*/
enum Dwarf_augmentation_type {
aug_empty_string, /* Default empty augmentation string. */
aug_irix_exception_table, /* IRIX plain "z",
for exception handling, IRIX CC compiler.
Proposed z1 z2 ... never implemented. */
aug_gcc_eh_z, /* gcc z augmentation, (including
L R P variations). gcc 3.3 3.4 exception
handling in eh_frame. */
aug_irix_mti_v1, /* IRIX "mti v1" augmentation string. Probably
never in any released SGI-IRIX compiler. */
aug_eh, /* For gcc .eh_frame, "eh" is the string.,
gcc 1,2, egcs. Older values. */
aug_armcc, /* "armcc+" meaning the cfa calculation
is corrected to be standard (output by
Arm C RVCT 3.0 SP1 and later). See
http://sourceware.org/ml/gdb-patches/2006-12/msg00249.html
for details. */
aug_unknown, /* Unknown augmentation, we cannot do much. */
aug_past_last
};
/*
This structure contains all the pertinent info for a Cie. Most
of the fields are taken straight from the definition of a Cie.
Ci_cie_start points to the address (in .debug_frame) where this
Cie begins. Ci_cie_instr_start points to the first byte of the
frame instructions for this Cie. Ci_dbg points to the associated
Dwarf_Debug structure. Ci_initial_table is a pointer to the table
row generated by the instructions for this Cie.
*/
struct Dwarf_Cie_s {
Dwarf_Unsigned ci_length;
char *ci_augmentation;
Dwarf_Small ci_code_alignment_factor;
Dwarf_Sbyte ci_data_alignment_factor;
Dwarf_Small ci_return_address_register;
Dwarf_Small *ci_cie_start;
Dwarf_Small *ci_cie_instr_start;
Dwarf_Debug ci_dbg;
Dwarf_Frame ci_initial_table;
Dwarf_Cie ci_next;
Dwarf_Small ci_length_size;
Dwarf_Small ci_extension_size;
Dwarf_Half ci_cie_version_number;
enum Dwarf_augmentation_type ci_augmentation_type;
/* The following 2 for GNU .eh_frame exception handling
Augmentation Data. Set if ci_augmentation_type
is aug_gcc_eh_z. Zero if unused. */
Dwarf_Unsigned ci_gnu_eh_augmentation_len;
Dwarf_Ptr ci_gnu_eh_augmentation_bytes;
/* These are extracted from the gnu eh_frame
augmentation if the
augmentation begins with 'z'. See Linux LSB documents.
Otherwize these are zero. */
unsigned char ci_gnu_personality_handler_encoding;
unsigned char ci_gnu_lsda_encoding;
unsigned char ci_gnu_fde_begin_encoding;
/* If 'P' augmentation present, is handler addr. Else
is zero. */
Dwarf_Addr ci_gnu_personality_handler_addr;
/* In creating list of cie's (which will become an array)
record the position so fde can get it on fde creation. */
Dwarf_Unsigned ci_index;
Dwarf_Small * ci_section_ptr;
/* DWARF4 adds address size and segment size to the CIE: the .debug_info
section may not always be present to allow libdwarf to
find address_size from the compilation-unit. */
Dwarf_Half ci_address_size;
Dwarf_Half ci_segment_size;
};
/*
This structure contains all the pertinent info for a Fde.
Most of the fields are taken straight from the definition.
fd_cie_index is the index of the Cie associated with this
Fde in the list of Cie's for this debug_frame. Fd_cie
points to the corresponsing Dwarf_Cie structure. Fd_fde_start
points to the start address of the Fde. Fd_fde_instr_start
points to the start of the instructions for this Fde. Fd_dbg
points to the associated Dwarf_Debug structure.
*/
struct Dwarf_Fde_s {
Dwarf_Unsigned fd_length;
Dwarf_Addr fd_cie_offset;
Dwarf_Unsigned fd_cie_index;
Dwarf_Cie fd_cie;
Dwarf_Addr fd_initial_location;
Dwarf_Small *fd_initial_loc_pos;
Dwarf_Addr fd_address_range;
Dwarf_Small *fd_fde_start;
Dwarf_Small *fd_fde_instr_start;
Dwarf_Debug fd_dbg;
/* fd_offset_into_exception_tables is SGI/IRIX exception table
offset. Unused and zero if not IRIX .debug_frame. */
Dwarf_Signed fd_offset_into_exception_tables;
Dwarf_Fde fd_next;
Dwarf_Small fd_length_size;
Dwarf_Small fd_extension_size;
/* So we know from an fde which 'count' of fde-s in
Dwarf_Debug applies: eh or standard. */
Dwarf_Small fd_is_eh;
/* The following 2 for GNU .eh_frame exception handling
Augmentation Data. Set if CIE ci_augmentation_type
is aug_gcc_eh_z. Zero if unused. */
Dwarf_Unsigned fd_gnu_eh_augmentation_len;
Dwarf_Ptr fd_gnu_eh_augmentation_bytes;
Dwarf_Addr fd_gnu_eh_lsda; /* If 'L' augmentation letter
present: is address of the
Language Specific Data Area (LSDA). If not 'L" is zero. */
/* The following 3 are about the Elf section the FDEs come from. */
Dwarf_Small * fd_section_ptr;
Dwarf_Unsigned fd_section_length;
Dwarf_Unsigned fd_section_index;
};
int
_dwarf_frame_address_offsets(Dwarf_Debug dbg, Dwarf_Addr ** addrlist,
Dwarf_Off ** offsetlist,
Dwarf_Signed * returncount,
Dwarf_Error * err);
int
_dwarf_get_fde_list_internal(Dwarf_Debug dbg,
Dwarf_Cie ** cie_data,
Dwarf_Signed * cie_element_count,
Dwarf_Fde ** fde_data,
Dwarf_Signed * fde_element_count,
Dwarf_Small * section_ptr,
Dwarf_Unsigned section_index,
Dwarf_Unsigned section_length,
Dwarf_Unsigned cie_id_value,
int use_gnu_cie_calc, /* If non-zero,
this is gcc eh_frame. */
Dwarf_Error * error);
enum Dwarf_augmentation_type
_dwarf_get_augmentation_type(Dwarf_Debug dbg,
Dwarf_Small *augmentation_string,
int is_gcc_eh_frame);
Dwarf_Unsigned _dwarf_get_return_address_reg(Dwarf_Small *frame_ptr,
int version,
unsigned long *size);
/* Temporary recording of crucial cie/fde prefix data.
* Vastly simplifies some argument lists.
*/
struct cie_fde_prefix_s {
/* cf_start_addr is a pointer to the first byte of this fde/cie
we are reading now. */
Dwarf_Small * cf_start_addr;
Dwarf_Small * cf_addr_after_prefix;
Dwarf_Unsigned cf_length;
int cf_local_length_size;
int cf_local_extension_size;
Dwarf_Unsigned cf_cie_id;
Dwarf_Small * cf_cie_id_addr; /* used for eh_frame calculations. */
/* Simplifies passing around these values to create fde having
these here. */
/* cf_section_ptr is a pointer to the first byte
of the object section the prefix is read from. */
Dwarf_Small * cf_section_ptr;
Dwarf_Unsigned cf_section_index;
Dwarf_Unsigned cf_section_length;
};
int
_dwarf_exec_frame_instr(Dwarf_Bool make_instr,
Dwarf_Frame_Op ** ret_frame_instr,
Dwarf_Bool search_pc,
Dwarf_Addr search_pc_val,
Dwarf_Addr initial_loc,
Dwarf_Small * start_instr_ptr,
Dwarf_Small * final_instr_ptr,
Dwarf_Frame table,
Dwarf_Cie cie,
Dwarf_Debug dbg,
Dwarf_Half reg_num_of_cfa,
Dwarf_Sword * returned_count,
int *returned_error);
int dwarf_read_cie_fde_prefix(Dwarf_Debug dbg,
Dwarf_Small *frame_ptr_in,
Dwarf_Small *section_ptr_in,
Dwarf_Unsigned section_index_in,
Dwarf_Unsigned section_length_in,
struct cie_fde_prefix_s *prefix_out,
Dwarf_Error *error);
int dwarf_create_fde_from_after_start(Dwarf_Debug dbg,
struct cie_fde_prefix_s * prefix,
Dwarf_Small *section_pointer,
Dwarf_Small *frame_ptr,
int use_gnu_cie_calc,
Dwarf_Cie cie_ptr_in,
Dwarf_Fde *fde_ptr_out,
Dwarf_Error *error);
int dwarf_create_cie_from_after_start(Dwarf_Debug dbg,
struct cie_fde_prefix_s *prefix,
Dwarf_Small* section_pointer,
Dwarf_Small* frame_ptr,
Dwarf_Unsigned cie_count,
int use_gnu_cie_calc,
Dwarf_Cie *cie_ptr_out,
Dwarf_Error *error);
int _dwarf_frame_constructor(Dwarf_Debug dbg,void * );
void _dwarf_frame_destructor (void *);

View File

@ -1,42 +0,0 @@
/*
Copyright (C) 2000, 2004 Silicon Graphics, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
typedef struct Dwarf_Func_Context_s *Dwarf_Func_Context;
/* struct never completed: see dwarf_global.h */

View File

@ -1,124 +0,0 @@
/*
Copyright (C) 2000,2004,2005 Silicon Graphics, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
typedef struct Dwarf_Global_Context_s *Dwarf_Global_Context;
/*
This struct contains header information for a set of pubnames.
Essentially, they contain the context for a set of pubnames
belonging to a compilation-unit.
This is also used for the sgi-specific
weaknames, typenames, varnames, funcnames data:
the structs for those are incomplete and
instances of this are used instead.
Also used for DWARF3 .debug_pubtypes.
*/
struct Dwarf_Global_Context_s {
/* Length in .debug_pubnames (etc) of a set of names for a
compilation-unit. Dwarf_Word pu_length; The value is not made
available outside libdwarf and not used inside, so no need to
record it. */
/* For this context, size of a length. 4 or 8 */
unsigned char pu_length_size;
/* For this CU, size of the extension 0 except for dwarf2 extension
64bit, in which case is 4. */
unsigned char pu_extension_size;
/*
Offset into .debug_info of the compilation-unit header (not DIE)
for this set of pubnames. */
Dwarf_Off pu_offset_of_cu_header;
/* Size of compilation-unit that these pubnames are in. */
Dwarf_Unsigned pu_info_length;
Dwarf_Debug pu_dbg;
};
/* This struct contains information for a single pubname. */
struct Dwarf_Global_s {
/*
Offset from the start of the corresponding compilation-unit of
the DIE for the given pubname CU. */
Dwarf_Off gl_named_die_offset_within_cu;
/* Points to the given pubname. */
Dwarf_Small *gl_name;
/* Context for this pubname. */
Dwarf_Global_Context gl_context;
};
int _dwarf_internal_get_pubnames_like_data(Dwarf_Debug dbg,
Dwarf_Small *
section_data_ptr,
Dwarf_Unsigned
section_length,
Dwarf_Global ** globals,
Dwarf_Signed * return_count,
Dwarf_Error * error,
int context_code,
int global_code,
int length_err_num,
int version_err_num);
void
_dwarf_internal_globals_dealloc( Dwarf_Debug dbg, Dwarf_Global *dwgl,
Dwarf_Signed count,
int context_code,
int global_code,
int list_code);
#ifdef __sgi /* __sgi should only be defined for IRIX/MIPS. */
void _dwarf_fix_up_offset_irix(Dwarf_Debug dbg,
Dwarf_Unsigned *varp,
char *caller_site_name);
#define FIX_UP_OFFSET_IRIX_BUG(ldbg,var,name) _dwarf_fix_up_offset_irix(ldbg,&var,name)
#else
#define FIX_UP_OFFSET_IRIX_BUG(ldbg,var,name)
#endif

View File

@ -1,31 +0,0 @@
/*
Copyright (C) 2010 David Anderson. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
*/
void dwarf_harmless_init(struct Dwarf_Harmless_s *dhp,unsigned size);
void dwarf_harmless_cleanout(struct Dwarf_Harmless_s *dhp);

View File

@ -1,66 +0,0 @@
/*
Copyright (C) 2000, 2002, 2004 Silicon Graphics, Inc. All Rights Reserved.
Portions Copyright 2008-2010 David Anderson. All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
#ifndef DWARF_INCL_H
#define DWARF_INCL_H
#if (!defined(HAVE_RAW_LIBELF_OK) && defined(HAVE_LIBELF_OFF64_OK) )
/* At a certain point libelf.h requires _GNU_SOURCE.
here we assume the criteria in configure determine that
usefully.
*/
#define _GNU_SOURCE 1
#endif
#include "libdwarfdefs.h"
#include <string.h>
#ifdef HAVE_ELF_H
#include <elf.h>
#endif
#include <limits.h>
#include <dwarf.h>
#include <libdwarf.h>
#include "dwarf_base_types.h"
#include "dwarf_alloc.h"
#include "dwarf_opaque.h"
#include "dwarf_error.h"
#include "dwarf_util.h"
#endif /* DWARF_INCL_H */

View File

@ -1,331 +0,0 @@
/*
Copyright (C) 2000, 2004, 2006 Silicon Graphics, Inc. All Rights Reserved.
Portions Copyright (C) 2009-2010 David Anderson. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
#define DW_EXTENDED_OPCODE 0
/*
This is used as the starting value for an algorithm
to get the minimum difference between 2 values.
UINT_MAX is used as our approximation to infinity.
*/
#define MAX_LINE_DIFF UINT_MAX
/* This is for a sanity check on line
table extended opcodes.
It is entirely arbitrary, and 100 is surely too small if
someone was inserting strings in the opcode. */
#define DW_LNE_LEN_MAX 100
/*
This structure is used to build a list of all the
files that are used in the current compilation unit.
All of the fields execpt fi_next have meanings that
are obvious from section 6.2.4 of the Libdwarf Doc.
*/
struct Dwarf_File_Entry_s {
/* Points to string naming the file. */
Dwarf_Small *fi_file_name;
/*
Index into the list of directories of the directory in which
this file exits. */
Dwarf_Sword fi_dir_index;
/* Time of last modification of the file. */
Dwarf_Unsigned fi_time_last_mod;
/* Length in bytes of the file. */
Dwarf_Unsigned fi_file_length;
/* Pointer for chaining file entries. */
Dwarf_File_Entry fi_next;
};
typedef struct Dwarf_Line_Context_s *Dwarf_Line_Context;
/*
This structure provides the context in which the fields of
a Dwarf_Line structure are interpreted. They come from the
statement program prologue. **Updated by dwarf_srclines in
dwarf_line.c.
*/
struct Dwarf_Line_Context_s {
/*
Points to a chain of entries providing info about source files
for the current set of Dwarf_Line structures. File number
'li_file 1' is last on the list, the first list entry is the
file numbered lc_file_entry_count. The numbering of the file
names matches the dwarf2/3 line table specification file table
and DW_LNE_define_file numbering rules. */
Dwarf_File_Entry lc_file_entries;
/*
Count of number of source files for this set of Dwarf_Line
structures. */
Dwarf_Sword lc_file_entry_count;
/*
Points to the portion of .debug_line section that contains a
list of strings naming the included directories. */
Dwarf_Small *lc_include_directories;
/* Count of the number of included directories. */
Dwarf_Sword lc_include_directories_count;
/* Count of the number of lines for this cu. */
Dwarf_Sword lc_line_count;
/* Points to name of compilation directory. */
Dwarf_Small *lc_compilation_directory;
Dwarf_Debug lc_dbg;
Dwarf_Half lc_version_number; /* DWARF2/3 version number, 2
for DWARF2, 3 for DWARF3. */
};
/*
This structure defines a row of the line table.
All of the fields except li_offset have the exact
same meaning that is defined in Section 6.2.2
of the Libdwarf Document.
li_offset is used by _dwarf_addr_finder() which is called
by rqs(1), an sgi utility for 'moving' shared libraries
as if the static linker (ld) had linked the shared library
at the newly-specified address. Most libdwarf-using
apps will ignore li_offset and _dwarf_addr_finder().
*/
struct Dwarf_Line_s {
Dwarf_Addr li_address; /* pc value of machine instr */
union addr_or_line_s {
struct li_inner_s {
Dwarf_Sword li_file; /* int identifying src file */
/* li_file is a number 1-N, indexing into a conceptual
source file table as described in dwarf2/3 spec line
table doc. (see Dwarf_File_Entry lc_file_entries; and
Dwarf_Sword lc_file_entry_count;) */
Dwarf_Sword li_line; /* source file line number. */
Dwarf_Half li_column; /* source file column number */
Dwarf_Small li_isa;
/* To save space, use bit flags. */
/* indicate start of stmt */
unsigned char li_is_stmt:1;
/* indicate start basic block */
unsigned char li_basic_block:1;
/* first post sequence instr */
unsigned char li_end_sequence:1;
unsigned char li_prologue_end:1;
unsigned char li_epilogue_begin:1;
} li_l_data;
Dwarf_Off li_offset; /* for rqs */
} li_addr_line;
Dwarf_Line_Context li_context; /* assoc Dwarf_Line_Context_s */
};
int _dwarf_line_address_offsets(Dwarf_Debug dbg,
Dwarf_Die die,
Dwarf_Addr ** addrs,
Dwarf_Off ** offs,
Dwarf_Unsigned * returncount,
Dwarf_Error * err);
int _dwarf_internal_srclines(Dwarf_Die die,
Dwarf_Line ** linebuf,
Dwarf_Signed * count,
Dwarf_Bool doaddrs,
Dwarf_Bool dolines, Dwarf_Error * error);
/* The LOP, WHAT_IS_OPCODE stuff is here so it can
be reused in 3 places. Seemed hard to keep
the 3 places the same without an inline func or
a macro.
Handling the line section where the header and the
file being processed do not match (unusual, but
planned for in the design of .debug_line)
is too tricky to recode this several times and keep
it right.
As it is the code starting up line-reading is duplicated
and that is just wrong to do. FIXME!
*/
#define LOP_EXTENDED 1
#define LOP_DISCARD 2
#define LOP_STANDARD 3
#define LOP_SPECIAL 4
#define WHAT_IS_OPCODE(type,opcode,base,opcode_length,line_ptr,highest_std) \
if( (opcode) < (base) ) { \
/* we know we must treat as a standard op \
or a special case. \
*/ \
if((opcode) == DW_EXTENDED_OPCODE) { \
type = LOP_EXTENDED; \
} else if( ((highest_std)+1) >= (base)) { \
/* == Standard case: compile of \
dwarf_line.c and object \
have same standard op codes set. \
\
> Special case: compile of dwarf_line.c\
has things in standard op codes list \
in dwarf.h header not \
in the object: handle this as a standard\
op code in switch below. \
The header special ops overlap the \
object standard ops. \
The new standard op codes will not \
appear in the object. \
*/ \
type = LOP_STANDARD; \
} else { \
/* These are standard opcodes in the object\
** that were not defined in the header \
** at the time dwarf_line.c \
** was compiled. Provides the ability of \
** out-of-date dwarf reader to read newer \
** line table data transparently. \
*/ \
type = LOP_DISCARD; \
} \
\
} else { \
/* Is a special op code. \
*/ \
type = LOP_SPECIAL; \
}
/* The following is from the dwarf definition of 'ubyte'
and is specifically mentioned in section 6.2.5.1, page 54
of the Rev 2.0.0 dwarf specification.
*/
#define MAX_LINE_OP_CODE 255
/* The following structs (Line_Table_File_Entry_s,Line_Table_Prefix_s)
and functions allow refactoring common code into a single
reader routine.
*/
/* There can be zero of more of these needed for 1 line prologue. */
struct Line_Table_File_Entry_s {
Dwarf_Small *lte_filename;
Dwarf_Unsigned lte_directory_index;
Dwarf_Unsigned lte_last_modification_time;
Dwarf_Unsigned lte_length_of_file;
};
/* Data picked up from the line table prologue for a single
CU. */
struct Line_Table_Prefix_s {
/* pf_total_length is the value of the length field for the line
table of this CU. So it does not count the length of itself (the
length value) for consistency with the say lenghts recorded in
DWARF2/3. */
Dwarf_Unsigned pf_total_length;
/* Length of the initial length field itself. */
Dwarf_Half pf_length_field_length;
/* The version is 2 for DWARF2, 3 for DWARF3 */
Dwarf_Half pf_version;
Dwarf_Unsigned pf_prologue_length;
Dwarf_Small pf_minimum_instruction_length;
/* Start and end of this CU line area. pf_line_ptr_start +
pf_total_length + pf_length_field_length == pf_line_ptr_end.
Meaning pf_line_ptr_start is before the length info. */
Dwarf_Small *pf_line_ptr_start;
Dwarf_Small *pf_line_ptr_end;
/* Used to check that decoding of the line prologue is done right. */
Dwarf_Small *pf_line_prologue_start;
Dwarf_Small pf_default_is_stmt;
Dwarf_Sbyte pf_line_base;
Dwarf_Small pf_line_range;
/* Highest std opcode (+1). */
Dwarf_Small pf_opcode_base;
/* pf_opcode_base -1 entries (each a count, normally the value of
each entry is 0 or 1). */
Dwarf_Small *pf_opcode_length_table;
Dwarf_Unsigned pf_include_directories_count;
/* Array of pointers to dir strings. pf_include_directories_count
entriesin the array. */
Dwarf_Small **pf_include_directories;
/* Count of entries in line_table_file_entries array. */
Dwarf_Unsigned pf_files_count;
struct Line_Table_File_Entry_s *pf_line_table_file_entries;
/* The number to treat as standard ops. This is a special
accomodation of gcc using the new standard opcodes but not
updating the version number. It's legal dwarf2, but much better
for the user to understand as dwarf3 when 'it looks ok'. */
Dwarf_Bool pf_std_op_count;
};
void dwarf_init_line_table_prefix(struct Line_Table_Prefix_s *pf);
void dwarf_free_line_table_prefix(struct Line_Table_Prefix_s *pf);
int dwarf_read_line_table_prefix(Dwarf_Debug dbg,
Dwarf_Small * data_start,
Dwarf_Unsigned data_length,
Dwarf_Small ** updated_data_start_out,
struct Line_Table_Prefix_s *prefix_out,
/* The following 2 arguments are solely for warning users
* when there is a surprising 'gap' in the .debug_line info. */
Dwarf_Small ** bogus_bytes_ptr,
Dwarf_Unsigned * bogus_bytes_count,
Dwarf_Error * err,
int * err_count_out);

View File

@ -1,46 +0,0 @@
/*
Copyright (C) 2000, 2004 Silicon Graphics, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
typedef struct Dwarf_Loc_Chain_s *Dwarf_Loc_Chain;
struct Dwarf_Loc_Chain_s {
Dwarf_Small lc_atom;
Dwarf_Unsigned lc_number;
Dwarf_Unsigned lc_number2;
Dwarf_Unsigned lc_offset;
Dwarf_Loc_Chain lc_next;
};

View File

@ -1,44 +0,0 @@
/*
Copyright (C) 2000, 2004 Silicon Graphics, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
/*
dwarf_macro.h
$Revision: 1.4 $ $Date: 2004/10/28 22:19:14 $
*/

View File

@ -1,339 +0,0 @@
/*
Copyright (C) 2000-2005 Silicon Graphics, Inc. All Rights Reserved.
Portions Copyright (C) 2007-2010 David Anderson. All Rights Reserved.
Portions Copyright (C) 2008-2010 Arxan Technologies, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
/* The versions applicable by section are:
DWARF2 DWARF3 DWARF4
.debug_abbrev - - -
.debug_aranges 2 2 2
.debug_frame 1 3 4
.debug_info 2 3 4
.debug_line 2 3 4
.debug_loc - - -
.debug_macinfo - - -
.debug_pubtypes x 2 2
.debug_pubnames 2 2 2
.debug_ranges x - -
.debug_str - - -
.debug_types x x 4
*/
#include <stddef.h>
struct Dwarf_Die_s {
Dwarf_Byte_Ptr di_debug_info_ptr;
Dwarf_Abbrev_List di_abbrev_list;
Dwarf_CU_Context di_cu_context;
int di_abbrev_code;
};
struct Dwarf_Attribute_s {
Dwarf_Half ar_attribute; /* Attribute Value. */
Dwarf_Half ar_attribute_form; /* Attribute Form. */
Dwarf_Half ar_attribute_form_direct;
/* Identical to ar_attribute_form except that if
the original form uleb was DW_FORM_indirect,
ar_attribute_form_direct contains DW_FORM_indirect
but ar_attribute_form contains the true form. */
Dwarf_CU_Context ar_cu_context;
Dwarf_Small *ar_debug_info_ptr;
Dwarf_Attribute ar_next;
};
/*
This structure provides the context for a compilation unit.
Thus, it contains the Dwarf_Debug, cc_dbg, that this cu
belongs to. It contains the information in the compilation
unit header, cc_length, cc_version_stamp, cc_abbrev_offset,
and cc_address_size, in the .debug_info section for that cu.
In addition, it contains the count, cc_count_cu, of the cu
number of that cu in the list of cu's in the .debug_info.
The count starts at 1, ie cc_count_cu is 1 for the first cu,
2 for the second and so on. This struct also contains a
pointer, cc_abbrev_table, to a list of pairs of abbrev code
and a pointer to the start of that abbrev
in the .debug_abbrev section.
Each die will also contain a pointer to such a struct to
record the context for that die.
Notice that a pointer to the CU DIE itself is
Dwarf_Off off2 = cu_context->cc_debug_info_offset;
cu_die_info_ptr = dbg->de_debug_info.dss_data +
off2 + _dwarf_length_of_cu_header(dbg, off2);
**Updated by dwarf_next_cu_header in dwarf_die_deliv.c
*/
struct Dwarf_CU_Context_s {
Dwarf_Debug cc_dbg;
/* The sum of cc_length, cc_length_size, and cc_extension_size
is the total length of the CU including its header. */
Dwarf_Word cc_length;
/* cc_length_size is the size in bytes of an offset.
4 for 32bit dwarf, 8 for 64bit dwarf (whether MIPS/IRIX
64bit dwarf or standard 64bit dwarf using the extension
mechanism). */
Dwarf_Small cc_length_size;
/* cc_extension_size is zero unless this is standard
DWARF3 and later 64bit dwarf using the extension mechanism.
If it is the DWARF3 and later 64bit dwarf cc_extension
size is 4. So for 32bit dwarf and MIPS/IRIX 64bit dwarf
cc_extension_size is zero. */
Dwarf_Small cc_extension_size;
Dwarf_Half cc_version_stamp;
Dwarf_Sword cc_abbrev_offset;
Dwarf_Small cc_address_size;
/* cc_debug_info_offset is the offset in the section
of the CU header of this CU. Dwarf_Word
should be large enough. */
Dwarf_Word cc_debug_info_offset;
Dwarf_Byte_Ptr cc_last_abbrev_ptr;
Dwarf_Hash_Table cc_abbrev_hash_table;
Dwarf_CU_Context cc_next;
/*unsigned char cc_offset_length; */
};
/* Consolidates section-specific data in one place.
Section is an Elf specific term, intended as a general
term (for non-Elf objects some code must synthesize the
values somehow).
Makes adding more section-data much simpler. */
struct Dwarf_Section_s {
Dwarf_Small * dss_data;
Dwarf_Unsigned dss_size;
Dwarf_Word dss_index;
/* dss_addr is the 'section address' which is only
non-zero for a GNU eh section.
Purpose: to handle DW_EH_PE_pcrel encoding. Leaving
it zero is fine for non-elf. */
Dwarf_Addr dss_addr;
Dwarf_Small dss_data_was_malloc;
/* For non-elf, leaving the following fields zero
will mean they are ignored. */
/* dss_link should be zero unless a section has a link
to another (sh_link). Used to access relocation data for
a section (and for symtab section, access its strtab). */
Dwarf_Word dss_link;
/* The following is used when reading .rela sections
(such sections appear in some .o files). */
Dwarf_Half dss_reloc_index; /* Zero means ignore the reloc fields. */
Dwarf_Small * dss_reloc_data;
Dwarf_Unsigned dss_reloc_size;
Dwarf_Addr dss_reloc_addr;
/* dss_reloc_symtab is the sh_link of a .rela to its .symtab, leave
it 0 if non-meaningful. */
Dwarf_Addr dss_reloc_symtab;
/* dss_reloc_link should be zero unless a reloc section has a link
to another (sh_link). Used to access the symtab for relocations
a section. */
Dwarf_Word dss_reloc_link;
/* Pointer to the elf symtab, used for elf .rela. Leave it 0
if not relevant. */
struct Dwarf_Section_s *dss_symtab;
};
/* Overview: if next_to_use== first, no error slots are used.
If next_to_use+1 (mod maxcount) == first the slots are all used
*/
struct Dwarf_Harmless_s {
unsigned dh_maxcount;
unsigned dh_next_to_use;
unsigned dh_first;
unsigned dh_errs_count;
char ** dh_errors;
};
struct Dwarf_Debug_s {
/* All file access methods and support data
are hidden in this structure.
We get a pointer, callers control the lifetime of the
structure and contents. */
struct Dwarf_Obj_Access_Interface_s *de_obj_file;
Dwarf_Handler de_errhand;
Dwarf_Ptr de_errarg;
/*
Context for the compilation_unit just read by a call to
dwarf_next_cu_header. **Updated by dwarf_next_cu_header in
dwarf_die_deliv.c */
Dwarf_CU_Context de_cu_context;
/*
Points to linked list of CU Contexts for the CU's already read.
These are only CU's read by dwarf_next_cu_header(). */
Dwarf_CU_Context de_cu_context_list;
/*
Points to the last CU Context added to the list by
dwarf_next_cu_header(). */
Dwarf_CU_Context de_cu_context_list_end;
/*
This is the list of CU contexts read for dwarf_offdie(). These
may read ahead of dwarf_next_cu_header(). */
Dwarf_CU_Context de_offdie_cu_context;
Dwarf_CU_Context de_offdie_cu_context_end;
/* Offset of last byte of last CU read. */
Dwarf_Word de_info_last_offset;
/*
Number of bytes in the length, and offset field in various
.debug_* sections. It's not very meaningful, and is
only used in one 'approximate' calculation. */
Dwarf_Small de_length_size;
/* number of bytes in a pointer of the target in various .debug_
sections. 4 in 32bit, 8 in MIPS 64, ia64. */
Dwarf_Small de_pointer_size;
/* set at creation of a Dwarf_Debug to say if form_string should be
checked for valid length at every call. 0 means do the check.
non-zero means do not do the check. */
Dwarf_Small de_assume_string_in_bounds;
/*
Dwarf_Alloc_Hdr_s structs used to manage chunks that are
malloc'ed for each allocation type for structs. */
struct Dwarf_Alloc_Hdr_s de_alloc_hdr[ALLOC_AREA_REAL_TABLE_MAX];
#ifdef DWARF_SIMPLE_MALLOC
struct simple_malloc_record_s * de_simple_malloc_base;
#endif
/*
These fields are used to process debug_frame section. **Updated
by dwarf_get_fde_list in dwarf_frame.h */
/*
Points to contiguous block of pointers to Dwarf_Cie_s structs. */
Dwarf_Cie *de_cie_data;
/* Count of number of Dwarf_Cie_s structs. */
Dwarf_Signed de_cie_count;
/* Keep eh (GNU) separate!. */
Dwarf_Cie *de_cie_data_eh;
Dwarf_Signed de_cie_count_eh;
/*
Points to contiguous block of pointers to Dwarf_Fde_s structs. */
Dwarf_Fde *de_fde_data;
/* Count of number of Dwarf_Fde_s structs. */
Dwarf_Signed de_fde_count;
/* Keep eh (GNU) separate!. */
Dwarf_Fde *de_fde_data_eh;
Dwarf_Signed de_fde_count_eh;
struct Dwarf_Section_s de_debug_info;
struct Dwarf_Section_s de_debug_abbrev;
struct Dwarf_Section_s de_debug_line;
struct Dwarf_Section_s de_debug_loc;
struct Dwarf_Section_s de_debug_aranges;
struct Dwarf_Section_s de_debug_macinfo;
struct Dwarf_Section_s de_debug_pubnames;
struct Dwarf_Section_s de_debug_str;
struct Dwarf_Section_s de_debug_frame;
/* gnu: the g++ eh_frame section */
struct Dwarf_Section_s de_debug_frame_eh_gnu;
struct Dwarf_Section_s de_debug_pubtypes; /* DWARF3 .debug_pubtypes */
struct Dwarf_Section_s de_debug_funcnames;
struct Dwarf_Section_s de_debug_typenames; /* SGI IRIX extension essentially
identical to DWARF3 .debug_pubtypes. */
struct Dwarf_Section_s de_debug_varnames;
struct Dwarf_Section_s de_debug_weaknames;
struct Dwarf_Section_s de_debug_ranges;
/* For non-elf, simply leave the following two structs zeroed and
they will be ignored. */
struct Dwarf_Section_s de_elf_symtab;
struct Dwarf_Section_s de_elf_strtab;
void *(*de_copy_word) (void *, const void *, size_t);
unsigned char de_same_endian;
unsigned char de_elf_must_close; /* if non-zero, then
it was dwarf_init (not dwarf_elf_init)
so must elf_end() */
/* Default is DW_FRAME_INITIAL_VALUE from header. */
Dwarf_Half de_frame_rule_initial_value;
/* Default is DW_FRAME_LAST_REG_NUM. */
Dwarf_Half de_frame_reg_rules_entry_count;
Dwarf_Half de_frame_cfa_col_number;
Dwarf_Half de_frame_same_value_number;
Dwarf_Half de_frame_undefined_value_number;
unsigned char de_big_endian_object; /* non-zero if big-endian
object opened. */
struct Dwarf_Harmless_s de_harmless_errors;
};
typedef struct Dwarf_Chain_s *Dwarf_Chain;
struct Dwarf_Chain_s {
void *ch_item;
Dwarf_Chain ch_next;
};
#define CURRENT_VERSION_STAMP 2 /* DWARF2 */
#define CURRENT_VERSION_STAMP3 3 /* DWARF3 */
#define CURRENT_VERSION_STAMP4 4 /* DWARF4 */
/* Size of cu header version stamp field. */
#define CU_VERSION_STAMP_SIZE sizeof(Dwarf_Half)
/* Size of cu header address size field. */
#define CU_ADDRESS_SIZE_SIZE sizeof(Dwarf_Small)
void *_dwarf_memcpy_swap_bytes(void *s1, const void *s2, size_t len);
#define ORIGINAL_DWARF_OFFSET_SIZE 4
#define DISTINGUISHED_VALUE 0xffffffff
#define DISTINGUISHED_VALUE_OFFSET_SIZE 8
/*
We don't load the sections until they are needed. This function is
used to load the section.
*/
int _dwarf_load_section(Dwarf_Debug,
struct Dwarf_Section_s *,
Dwarf_Error *);

View File

@ -1,41 +0,0 @@
/*
Copyright (C) 2000,2004 Silicon Graphics, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
typedef struct Dwarf_Type_Context_s *Dwarf_Type_Context;
/* type never completed see dwarf_global.h */

View File

@ -1,311 +0,0 @@
#ifndef DWARF_UTIL_H
#define DWARF_UTIL_H
/*
Copyright (C) 2000,2003,2004 Silicon Graphics, Inc. All Rights Reserved.
Portions Copyright (C) 2007-2010 David Anderson. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
/* The address of the Free Software Foundation is
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
Boston, MA 02110-1301, USA.
SGI has moved from the Crittenden Lane address.
*/
/*
Decodes unsigned leb128 encoded numbers.
Make sure ptr is a pointer to a 1-byte type.
In 2003 and earlier this was a hand-inlined
version of _dwarf_decode_u_leb128() which did
not work correctly if Dwarf_Word was 64 bits.
*/
#define DECODE_LEB128_UWORD(ptr, value) \
do { \
Dwarf_Word uleblen; \
value = _dwarf_decode_u_leb128(ptr,&uleblen); \
ptr += uleblen; \
} while (0)
/*
Decodes signed leb128 encoded numbers.
Make sure ptr is a pointer to a 1-byte type.
In 2003 and earlier this was a hand-inlined
version of _dwarf_decode_s_leb128() which did
not work correctly if Dwarf_Word was 64 bits.
*/
#define DECODE_LEB128_SWORD(ptr, value) \
do { \
Dwarf_Word sleblen; \
value = _dwarf_decode_s_leb128(ptr,&sleblen); \
ptr += sleblen; \
} while(0)
/*
Skips leb128_encoded numbers that are guaranteed
to be no more than 4 bytes long. Same for both
signed and unsigned numbers.
*/
#define SKIP_LEB128_WORD(ptr) \
do{ if ((*(ptr++) & 0x80) != 0) { \
if ((*(ptr++) & 0x80) != 0) { \
if ((*(ptr++) & 0x80) != 0) { \
if ((*(ptr++) & 0x80) != 0) { \
} \
} \
} \
} } while (0)
#define CHECK_DIE(die, error_ret_value) \
do {if (die == NULL) { \
_dwarf_error(NULL, error, DW_DLE_DIE_NULL); \
return(error_ret_value); \
} \
if (die->di_cu_context == NULL) { \
_dwarf_error(NULL, error, DW_DLE_DIE_NO_CU_CONTEXT); \
return(error_ret_value); \
} \
if (die->di_cu_context->cc_dbg == NULL) { \
_dwarf_error(NULL, error, DW_DLE_DBG_NULL); \
return(error_ret_value); \
} \
} while (0)
/*
Reads 'source' for 'length' bytes from unaligned addr.
Avoids any constant-in-conditional warnings and
avoids a test in the generated code (for non-const cases,
which are in the majority.)
Uses a temp to avoid the test.
The decl here should avoid any problem of size in the temp.
This code is ENDIAN DEPENDENT
The memcpy args are the endian issue.
*/
typedef Dwarf_Unsigned BIGGEST_UINT;
#ifdef WORDS_BIGENDIAN
#define READ_UNALIGNED(dbg,dest,desttype, source, length) \
do { \
BIGGEST_UINT _ltmp = 0; \
dbg->de_copy_word( (((char *)(&_ltmp)) + sizeof(_ltmp) - length), \
source, length) ; \
dest = (desttype)_ltmp; \
} while (0)
/*
This macro sign-extends a variable depending on the length.
It fills the bytes between the size of the destination and
the length with appropriate padding.
This code is ENDIAN DEPENDENT but dependent only
on host endianness, not object file endianness.
The memcpy args are the issue.
*/
#define SIGN_EXTEND(dest, length) \
do {if (*(Dwarf_Sbyte *)((char *)&dest + sizeof(dest) - length) < 0) {\
memcpy((char *)&dest, "\xff\xff\xff\xff\xff\xff\xff\xff", \
sizeof(dest) - length); \
} \
} while (0)
#else /* LITTLE ENDIAN */
#define READ_UNALIGNED(dbg,dest,desttype, source, length) \
do { \
BIGGEST_UINT _ltmp = 0; \
dbg->de_copy_word( (char *)(&_ltmp) , \
source, length) ; \
dest = (desttype)_ltmp; \
} while (0)
/*
This macro sign-extends a variable depending on the length.
It fills the bytes between the size of the destination and
the length with appropriate padding.
This code is ENDIAN DEPENDENT but dependent only
on host endianness, not object file endianness.
The memcpy args are the issue.
*/
#define SIGN_EXTEND(dest, length) \
do {if (*(Dwarf_Sbyte *)((char *)&dest + (length-1)) < 0) {\
memcpy((char *)&dest+length, \
"\xff\xff\xff\xff\xff\xff\xff\xff", \
sizeof(dest) - length); \
} \
} while (0)
#endif /* ! LITTLE_ENDIAN */
/*
READ_AREA LENGTH reads the length (the older way
of pure 32 or 64 bit
or the new proposed dwarfv2.1 64bit-extension way)
It reads the bits from where rw_src_data_p points to
and updates the rw_src_data_p to point past what was just read.
It updates w_length_size (to the size of an offset, either 4 or 8)
and w_exten_size (set 0 unless this frame has the DWARF3,4 64bit
extension, in which case w_exten_size is set to 4).
r_dbg is just the current dbg pointer.
w_target is the output length field.
r_targtype is the output type. Always Dwarf_Unsigned so far.
*/
/* This one handles the v2.1 64bit extension
and 32bit (and MIPS fixed 64 bit via the
dwarf_init-set r_dbg->de_length_size)..
It does not recognize any but the one distingushed value
(the only one with defined meaning).
It assumes that no CU will have a length
0xffffffxx (32bit length)
or
0xffffffxx xxxxxxxx (64bit length)
which makes possible auto-detection of the extension.
This depends on knowing that only a non-zero length
is legitimate (AFAICT), and for IRIX non-standard -64
dwarf that the first 32 bits of the 64bit offset will be
zero (because the compiler could not handle a truly large
value as of Jan 2003 and because no app has that much debug
info anyway, at least not in the IRIX case).
At present not testing for '64bit elf' here as that
does not seem necessary (none of the 64bit length seems
appropriate unless it's ident[EI_CLASS] == ELFCLASS64).
*/
# define READ_AREA_LENGTH(r_dbg,w_target,r_targtype, \
rw_src_data_p,w_length_size,w_exten_size) \
do { READ_UNALIGNED(r_dbg,w_target,r_targtype, \
rw_src_data_p, ORIGINAL_DWARF_OFFSET_SIZE); \
if(w_target == DISTINGUISHED_VALUE) { \
/* dwarf3 64bit extension */ \
w_length_size = DISTINGUISHED_VALUE_OFFSET_SIZE; \
rw_src_data_p += ORIGINAL_DWARF_OFFSET_SIZE; \
w_exten_size = ORIGINAL_DWARF_OFFSET_SIZE; \
READ_UNALIGNED(r_dbg,w_target,r_targtype, \
rw_src_data_p, DISTINGUISHED_VALUE_OFFSET_SIZE);\
rw_src_data_p += DISTINGUISHED_VALUE_OFFSET_SIZE; \
} else { \
if(w_target == 0 && r_dbg->de_big_endian_object) { \
/* IRIX 64 bit, big endian. This test */ \
/* is not a truly precise test, a precise test */ \
/* would check if the target was IRIX. */ \
READ_UNALIGNED(r_dbg,w_target,r_targtype, \
rw_src_data_p, DISTINGUISHED_VALUE_OFFSET_SIZE); \
w_length_size = DISTINGUISHED_VALUE_OFFSET_SIZE; \
rw_src_data_p += DISTINGUISHED_VALUE_OFFSET_SIZE; \
w_exten_size = 0; \
} else { \
/* standard 32 bit dwarf2/dwarf3 */ \
w_exten_size = 0; \
w_length_size = ORIGINAL_DWARF_OFFSET_SIZE; \
rw_src_data_p += w_length_size; \
} \
} } while(0)
Dwarf_Unsigned
_dwarf_decode_u_leb128(Dwarf_Small * leb128,
Dwarf_Word * leb128_length);
Dwarf_Signed
_dwarf_decode_s_leb128(Dwarf_Small * leb128,
Dwarf_Word * leb128_length);
Dwarf_Unsigned
_dwarf_get_size_of_val(Dwarf_Debug dbg,
Dwarf_Unsigned form,
Dwarf_Half address_size,
Dwarf_Small * val_ptr,
int v_length_size);
struct Dwarf_Hash_Table_Entry_s;
/* This single struct is the base for the hash table.
The intent is that once the total_abbrev_count across
all the entries is greater than 10*current_table_entry_count
one should build a new Dwarf_Hash_Table_Base_s, rehash
all the existing entries, and delete the old table and entries.
(10 is a heuristic, nothing magic about it, but once the
count gets to 30 or 40 times current_table_entry_count
things really slow down a lot. One (500MB) application had
127000 abbreviations in one compilation unit)
The incoming 'code' is an abbrev number and those simply
increase linearly so the hashing is perfect always.
*/
struct Dwarf_Hash_Table_s {
unsigned long tb_table_entry_count;
unsigned long tb_total_abbrev_count;
/* Each table entry is a list of abbreviations. */
struct Dwarf_Hash_Table_Entry_s *tb_entries;
};
/*
This struct is used to build a hash table for the
abbreviation codes for a compile-unit.
*/
struct Dwarf_Hash_Table_Entry_s {
Dwarf_Abbrev_List at_head;
};
Dwarf_Abbrev_List
_dwarf_get_abbrev_for_code(Dwarf_CU_Context cu_context,
Dwarf_Unsigned code);
/* return 1 if string ends before 'endptr' else
** return 0 meaning string is not properly terminated.
** Presumption is the 'endptr' pts to end of some dwarf section data.
*/
int _dwarf_string_valid(void *startptr, void *endptr);
Dwarf_Unsigned _dwarf_length_of_cu_header(Dwarf_Debug,
Dwarf_Unsigned offset);
Dwarf_Unsigned _dwarf_length_of_cu_header_simple(Dwarf_Debug);
int _dwarf_load_debug_info(Dwarf_Debug dbg, Dwarf_Error *error);
void _dwarf_free_abbrev_hash_table_contents(Dwarf_Debug dbg,
struct Dwarf_Hash_Table_s* hash_table);
int _dwarf_get_address_size(Dwarf_Debug dbg, Dwarf_Die die);
#endif /* DWARF_UTIL_H */

View File

@ -1,41 +0,0 @@
/*
Copyright (C) 2000,2004 Silicon Graphics, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
typedef struct Dwarf_Var_Context_s *Dwarf_Var_Context;
/* struct never completed: see dwarf_global.h */

View File

@ -1,41 +0,0 @@
/*
Copyright (C) 2000,2004 Silicon Graphics, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
typedef struct Dwarf_Weak_Context_s *Dwarf_Weak_Context;
/* struct never completed: see dwarf_global.h */

File diff suppressed because it is too large Load Diff

View File

@ -1,91 +0,0 @@
/*
Copyright (C) 2000,2004 Silicon Graphics, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
/* libdwarfdefs.h
*/
#ifndef LIBDWARFDEFS_H
#define LIBDWARFDEFS_H
/* We want __uint32_t and __uint64_t and __int32_t __int64_t
properly defined but not duplicated, since duplicate typedefs
are not legal C.
*/
/*
HAVE___UINT32_T
HAVE___UINT64_T will be set by configure if
our 4 types are predefined in compiler
*/
#if (!defined(HAVE___UINT32_T)) && defined(HAVE___UINT32_T_IN_SGIDEFS_H)
#include <sgidefs.h> /* sgidefs.h defines them */
#define HAVE___UINT32_T 1
#endif
#if (!defined(HAVE___UINT64_T)) && defined(HAVE___UINT64_T_IN_SGIDEFS_H)
#include <sgidefs.h> /* sgidefs.h defines them */
#define HAVE___UINT64_T 1
#endif
#if (!defined(HAVE___UINT32_T)) && \
defined(HAVE_SYS_TYPES_H) && \
defined(HAVE___UINT32_T_IN_SYS_TYPES_H)
# include <sys/types.h>
#define HAVE___UINT32_T 1
#endif
#if (!defined(HAVE___UINT64_T)) && \
defined(HAVE_SYS_TYPES_H) && \
defined(HAVE___UINT64_T_IN_SYS_TYPES_H)
# include <sys/types.h>
#define HAVE___UINT64_T 1
#endif
#ifndef HAVE___UINT32_T
typedef int __int32_t;
typedef unsigned __uint32_t;
#define HAVE___UINT32_T 1
#endif
#ifndef HAVE___UINT64_T
typedef long long __int64_t;
typedef unsigned long long __uint64_t;
#define HAVE___UINT64_T 1
#endif
#endif /* LIBDWARFDEFS_H */

View File

@ -1,62 +0,0 @@
/*
Copyright (C) 2005 Silicon Graphics, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
/* malloc_check.h */
/* A simple libdwarf-aware malloc checker.
define WANT_LIBBDWARF_MALLOC_CHECK and rebuild libdwarf
do make a checking-for-alloc-mistakes libdwarf.
NOT recommended for production use.
When defined, also add malloc_check.c to the list of
files in Makefile.
*/
#undef WANT_LIBBDWARF_MALLOC_CHECK
/*#define WANT_LIBBDWARF_MALLOC_CHECK 1 */
#ifdef WANT_LIBBDWARF_MALLOC_CHECK
void dwarf_malloc_check_alloc_data(void * addr,unsigned char code);
void dwarf_malloc_check_dealloc_data(void * addr,unsigned char code);
void dwarf_malloc_check_complete(char *wheremsg); /* called at exit of app */
#else /* !WANT_LIBBDWARF_MALLOC_CHECK */
#define dwarf_malloc_check_alloc_data(a,b) /* nothing */
#define dwarf_malloc_check_dealloc_data(a,b) /* nothing */
#define dwarf_malloc_check_complete(a) /* nothing */
#endif /* WANT_LIBBDWARF_MALLOC_CHECK */

View File

@ -1,42 +0,0 @@
/*
Copyright (C) 2000,2004 Silicon Graphics, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
Dwarf_Ptr _dwarf_p_get_alloc(Dwarf_P_Debug, Dwarf_Unsigned);
void _dwarf_p_dealloc(Dwarf_P_Debug dbg, Dwarf_Small * ptr);
void _dwarf_p_dealloc_all(Dwarf_P_Debug dbg);

View File

@ -1,62 +0,0 @@
/*
Copyright (C) 2000,2004 Silicon Graphics, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
/*
If ag_end_symbol_index is zero,
ag_length must be known and non-zero.
Deals with length being known costant or fr
assembler output, not known.
*/
struct Dwarf_P_Arange_s {
Dwarf_Addr ag_begin_address; /* known address or for
symbolic assem output,
offset of symbol */
Dwarf_Addr ag_length; /* zero or address or offset */
Dwarf_Unsigned ag_symbol_index;
Dwarf_P_Arange ag_next;
Dwarf_Unsigned ag_end_symbol_index; /* zero or index/id of end
symbol */
Dwarf_Addr ag_end_symbol_offset; /* known address or for
symbolic assem output,
offset of end symbol */
};

View File

@ -1,68 +0,0 @@
/*
Copyright (C) 2000,2004 Silicon Graphics, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
/*
This struct holds the abbreviation table, before they are written
on disk. Holds a linked list of abbreviations, each consisting of
a bitmap for attributes and a bitmap for forms
*/
typedef struct Dwarf_P_Abbrev_s *Dwarf_P_Abbrev;
struct Dwarf_P_Abbrev_s {
Dwarf_Unsigned abb_idx; /* index of abbreviation */
Dwarf_Tag abb_tag; /* tag of die */
Dwarf_Ubyte abb_children; /* if children are present */
Dwarf_ufixed *abb_attrs; /* holds names of attrs */
Dwarf_ufixed *abb_forms; /* forms of attributes */
int abb_n_attr; /* num of attrs = # of forms */
Dwarf_P_Abbrev abb_next;
};
/* used in pro_section.c */
int _dwarf_pro_add_AT_fde(Dwarf_P_Debug dbg, Dwarf_P_Die die,
Dwarf_Unsigned offset, Dwarf_Error * error);
int _dwarf_pro_add_AT_stmt_list(Dwarf_P_Debug dbg,
Dwarf_P_Die first_die,
Dwarf_Error * error);
int _dwarf_pro_add_AT_macro_info(Dwarf_P_Debug dbg,
Dwarf_P_Die first_die,
Dwarf_Unsigned offset,
Dwarf_Error * error);

View File

@ -1,48 +0,0 @@
/*
Copyright (C) 2000,2004 Silicon Graphics, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
/* Bytes needed to encode a number.
Not a tight bound, just a reasonable bound.
*/
#define ENCODE_SPACE_NEEDED (2*sizeof(Dwarf_Unsigned))
int _dwarf_pro_encode_leb128_nm(Dwarf_Unsigned val, int *nbytes,
char *space, int splen);
int _dwarf_pro_encode_signed_leb128_nm(Dwarf_Signed value, int *nbytes,
char *space, int splen);

View File

@ -1,52 +0,0 @@
/*
Copyright (C) 2000,2004 Silicon Graphics, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
/* Handle error passing in the name of the Dwarf_P_Debug
User must supply {} around the macro.
Putting the {} here leads to macro uses that don't look like C.
The error argument to dwarf_error is hard coded here as 'error'
*/
#define DWARF_P_DBG_ERROR(dbg,errval,retval) \
_dwarf_p_error(dbg,error,errval); return(retval);
struct Dwarf_Error_s {
Dwarf_Sword er_errval;
};
void _dwarf_p_error(Dwarf_P_Debug dbg, Dwarf_Error * error,
Dwarf_Word errval);

View File

@ -1,45 +0,0 @@
/*
Copyright (C) 2000,2004 Silicon Graphics, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
#define MAXIMUM_LOC_EXPR_LENGTH 20
struct Dwarf_P_Expr_s {
Dwarf_Small ex_byte_stream[MAXIMUM_LOC_EXPR_LENGTH];
Dwarf_P_Debug ex_dbg;
Dwarf_Unsigned ex_next_byte_offset;
Dwarf_Unsigned ex_reloc_sym_index;
Dwarf_Unsigned ex_reloc_offset;
};

View File

@ -1,132 +0,0 @@
/*
Copyright (C) 2000,2004 Silicon Graphics, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
/*
Largest register value that can be coded into
the opcode since there are only 6 bits in the
register field.
*/
#define MAX_6_BIT_VALUE 0x3f
/*
This struct holds debug_frame instructions
*/
typedef struct Dwarf_P_Frame_Pgm_s *Dwarf_P_Frame_Pgm;
struct Dwarf_P_Frame_Pgm_s {
Dwarf_Ubyte dfp_opcode; /* opcode - includes reg # */
char *dfp_args; /* operands */
int dfp_nbytes; /* number of bytes in args */
#if 0
Dwarf_Unsigned dfp_sym_index; /* 0 unless reloc needed */
#endif
Dwarf_P_Frame_Pgm dfp_next;
};
/*
This struct has cie related information. Used to gather data
from user program, and later to transform to disk form
*/
struct Dwarf_P_Cie_s {
Dwarf_Ubyte cie_version;
char *cie_aug; /* augmentation */
Dwarf_Ubyte cie_code_align; /* alignment of code */
Dwarf_Sbyte cie_data_align;
Dwarf_Ubyte cie_ret_reg; /* return register # */
char *cie_inst; /* initial instruction */
long cie_inst_bytes;
/* no of init_inst */
Dwarf_P_Cie cie_next;
};
/* producer fields */
struct Dwarf_P_Fde_s {
Dwarf_Unsigned fde_unused1;
/* function/subr die for this fde */
Dwarf_P_Die fde_die;
/* index to asso. cie */
Dwarf_Word fde_cie;
/* Address of first location of the code this frame applies to If
fde_end_symbol non-zero, this represents the offset from the
symbol indicated by fde_r_symidx */
Dwarf_Addr fde_initloc;
/* Relocation symbol for address of the code this frame applies to.
*/
Dwarf_Unsigned fde_r_symidx;
/* Bytes of instr for this fde, if known */
Dwarf_Unsigned fde_addr_range;
/* linked list of instructions we will put in fde. */
Dwarf_P_Frame_Pgm fde_inst;
/* number of instructions in fde */
long fde_n_inst;
/* number of bytes of inst in fde */
long fde_n_bytes;
/* offset into exception table for this function. */
Dwarf_Signed fde_offset_into_exception_tables;
/* The symbol for the exception table elf section. */
Dwarf_Unsigned fde_exception_table_symbol;
/* pointer to last inst */
Dwarf_P_Frame_Pgm fde_last_inst;
Dwarf_P_Fde fde_next;
/* The symbol and offset of the end symbol. When fde_end_symbol is
non-zero we must represent the */
Dwarf_Addr fde_end_symbol_offset;
Dwarf_Unsigned fde_end_symbol;
int fde_uwordb_size;
Dwarf_P_Debug fde_dbg;
/* If fde_block is non-null, then it is the set of instructions.
so we should use it rather than fde_inst. */
Dwarf_Unsigned fde_inst_block_size;
void *fde_block;
};

View File

@ -1,94 +0,0 @@
/*
Copyright (C) 2000,2002,2004 Silicon Graphics, Inc. All Rights Reserved.
Portions Copyright 2002-2010 Sun Microsystems, Inc. All rights reserved.
Portions Copyright 2008-2010 David Anderson. All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
#ifdef HAVE_ELF_H
#include <elf.h>
#elif defined(HAVE_LIBELF_H)
/* On one platform without elf.h this gets Elf32_Rel
type defined (a required type). */
#include <libelf.h>
#elif defined(HAVE_LIBELF_LIBELF_H)
#include <libelf/libelf.h>
#endif
#if defined(sun)
#include <sys/elf_SPARC.h>
#include <sys/elf_386.h>
#endif
/* The target address is given: the place in the source integer
is to be determined.
*/
#ifdef WORDS_BIGENDIAN
#define WRITE_UNALIGNED(dbg,dest,source, srclength,len_out) \
{ \
dbg->de_copy_word(dest, \
((char *)source) +srclength-len_out, \
len_out) ; \
}
#else /* LITTLE ENDIAN */
#define WRITE_UNALIGNED(dbg,dest,source, srclength,len_out) \
{ \
dbg->de_copy_word( (dest) , \
((char *)source) , \
len_out) ; \
}
#endif
#if defined(sparc) && defined(sun)
#define REL32 Elf32_Rela
#define REL64 Elf64_Rela
#define REL_SEC_PREFIX ".rela"
#else
#define REL32 Elf32_Rel
#define REL64 Elf64_Rel
#define REL_SEC_PREFIX ".rel"
#endif
#include "dwarf.h"
#include "libdwarf.h"
#include "pro_opaque.h"
#include "pro_error.h"
#include "pro_util.h"
#include "pro_encode_nm.h"
#include "pro_alloc.h"

View File

@ -1,116 +0,0 @@
/*
Copyright (C) 2000,2004 Silicon Graphics, Inc. All Rights Reserved.
Portions Copyright 2007-2010 Sun Microsystems, Inc. All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
#define VERSION 2
#ifdef __i386
#define MIN_INST_LENGTH 1
#else
#define MIN_INST_LENGTH 4
#endif
#define DEFAULT_IS_STMT false
/* line base and range are temporarily defines.
They need to be calculated later */
#define LINE_BASE -1
#define LINE_RANGE 4
#define OPCODE_BASE 10
#define MAX_OPCODE 255
/*
This struct is used to hold entries in the include directories
part of statement prologue.
*/
struct Dwarf_P_Inc_Dir_s {
char *did_name; /* name of directory */
Dwarf_P_Inc_Dir did_next;
};
/*
This struct holds file entries for the statement prologue.
Defined in pro_line.h
*/
struct Dwarf_P_F_Entry_s {
char *dfe_name;
char *dfe_args; /* has dir index, time of modification,
length in bytes. Encodes as leb128 */
int dfe_nbytes; /* number of bytes in args */
Dwarf_P_F_Entry dfe_next;
};
/*
Struct holding line number information for each of the producer
line entries
*/
struct Dwarf_P_Line_s {
/* code address */
Dwarf_Addr dpl_address;
/* file index, index into file entry */
Dwarf_Word dpl_file;
/* line number */
Dwarf_Word dpl_line;
/* column number */
Dwarf_Word dpl_column;
/* whether its a beginning of a stmt */
Dwarf_Ubyte dpl_is_stmt;
/* whether its a beginning of basic blk */
Dwarf_Ubyte dpl_basic_block;
/* used to store opcodes set_address, and end_seq */
Dwarf_Ubyte dpl_opc;
/*
Used only for relocations. Has index of symbol relative to
which relocation has to be done (the S part in S + A) */
Dwarf_Unsigned dpl_r_symidx;
Dwarf_P_Line dpl_next;
};
/*
to initialize state machine registers, definition in
pro_line.c
*/
void _dwarf_pro_reg_init(Dwarf_P_Line);

View File

@ -1,40 +0,0 @@
/*
Copyright (C) 2000,2004 Silicon Graphics, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
int _dwarf_pro_transform_macro_info_to_disk(Dwarf_P_Debug dbg,
Dwarf_Error * error);

View File

@ -1,484 +0,0 @@
/*
Copyright (C) 2000,2002,2004 Silicon Graphics, Inc. All Rights Reserved.
Portions Copyright 2002-2010 Sun Microsystems, Inc. All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
#include <stddef.h>
/*
Sgidefs included to define __uint32_t,
a guaranteed 4-byte quantity.
*/
#include "libdwarfdefs.h"
#define true 1
#define false 0
/* to identify a cie */
#define DW_CIE_ID ~(0x0)
#define DW_CIE_VERSION 1
/*Dwarf_Word is unsigned word usable for index, count in memory */
/*Dwarf_Sword is signed word usable for index, count in memory */
/* The are 32 or 64 bits depending if 64 bit longs or not, which
** fits the ILP32 and LP64 models
** These work equally well with ILP64.
*/
typedef unsigned long Dwarf_Word;
typedef long Dwarf_Sword;
typedef signed char Dwarf_Sbyte;
typedef unsigned char Dwarf_Ubyte;
typedef signed short Dwarf_Shalf;
/*
On any change that makes libdwarf producer
incompatible, increment this number.
1->2->3 ...
*/
#define PRO_VERSION_MAGIC 0xdead1
/* these 2 are fixed sizes which must not vary with the
** ILP32/LP64 model. These two stay at 32 bit.
*/
typedef __uint32_t Dwarf_ufixed;
typedef __int32_t Dwarf_sfixed;
/*
producer:
This struct is used to hold information about all
debug* sections. On creating a new section, section
names and indices are added to this struct
definition in pro_section.h
*/
typedef struct Dwarf_P_Section_Data_s *Dwarf_P_Section_Data;
/*
producer:
This struct is used to hold entries in the include directories
part of statement prologue. Definition in pro_line.h
*/
typedef struct Dwarf_P_Inc_Dir_s *Dwarf_P_Inc_Dir;
/*
producer:
This struct holds file entries for the statement prologue.
Defined in pro_line.h
*/
typedef struct Dwarf_P_F_Entry_s *Dwarf_P_F_Entry;
/*
producer:
This struct holds information for each cie. Defn in pro_frame.h
*/
typedef struct Dwarf_P_Cie_s *Dwarf_P_Cie;
/*
producer:
Struct to hold line number information, different from
Dwarf_Line opaque type.
*/
typedef struct Dwarf_P_Line_s *Dwarf_P_Line;
/*
producer:
Struct to hold information about address ranges.
*/
typedef struct Dwarf_P_Simple_nameentry_s *Dwarf_P_Simple_nameentry;
typedef struct Dwarf_P_Simple_name_header_s *Dwarf_P_Simple_name_header;
typedef struct Dwarf_P_Arange_s *Dwarf_P_Arange;
typedef struct Dwarf_P_Per_Reloc_Sect_s *Dwarf_P_Per_Reloc_Sect;
typedef struct Dwarf_P_Per_Sect_String_Attrs_s *Dwarf_P_Per_Sect_String_Attrs;
/* Defined to get at the elf section numbers and section name
indices in symtab for the dwarf sections
Must match .rel.* names in _dwarf_rel_section_names
exactly.
*/
#define DEBUG_INFO 0
#define DEBUG_LINE 1
#define DEBUG_ABBREV 2
#define DEBUG_FRAME 3
#define DEBUG_ARANGES 4
#define DEBUG_PUBNAMES 5
#define DEBUG_STR 6
#define DEBUG_FUNCNAMES 7
#define DEBUG_TYPENAMES 8
#define DEBUG_VARNAMES 9
#define DEBUG_WEAKNAMES 10
#define DEBUG_MACINFO 11
#define DEBUG_LOC 12
/* number of debug_* sections not including the relocations */
#define NUM_DEBUG_SECTIONS DEBUG_LOC + 1
struct Dwarf_P_Die_s {
Dwarf_Unsigned di_offset; /* offset in debug info */
char *di_abbrev; /* abbreviation */
Dwarf_Word di_abbrev_nbytes; /* # of bytes in abbrev */
Dwarf_Tag di_tag;
Dwarf_P_Die di_parent; /* parent of current die */
Dwarf_P_Die di_child; /* first child */
/* The last child field makes linking up children an O(1) operation,
See pro_die.c. */
Dwarf_P_Die di_last_child;
Dwarf_P_Die di_left; /* left sibling */
Dwarf_P_Die di_right; /* right sibling */
Dwarf_P_Attribute di_attrs; /* list of attributes */
Dwarf_P_Attribute di_last_attr; /* last attribute */
int di_n_attr; /* number of attributes */
Dwarf_P_Debug di_dbg; /* For memory management */
Dwarf_Unsigned di_marker; /* used to attach symbols to dies */
};
/* producer fields */
struct Dwarf_P_Attribute_s {
Dwarf_Half ar_attribute; /* Attribute Value. */
Dwarf_Half ar_attribute_form; /* Attribute Form. */
Dwarf_P_Die ar_ref_die; /* die pointer if form ref */
char *ar_data; /* data, format given by form */
Dwarf_Unsigned ar_nbytes; /* no. of bytes of data */
Dwarf_Unsigned ar_rel_symidx; /* when attribute has a
relocatable value, holds
index of symbol in SYMTAB */
Dwarf_Ubyte ar_rel_type; /* relocation type */
Dwarf_Word ar_rel_offset; /* Offset of relocation within block */
char ar_reloc_len; /* Number of bytes that relocation
applies to. 4 or 8. Unused and may
be 0 if if ar_rel_type is
R_MIPS_NONE */
Dwarf_P_Attribute ar_next;
};
/* A block of .debug_macinfo data: this forms a series of blocks.
** Each macinfo input is compressed immediately and put into
** the current block if room, else a newblock allocated.
** The space allocation is such that the block and the macinfo
** data are one malloc block: free with a pointer to this and the
** mb_data is freed automatically.
** Like the struct hack, but legal ANSI C.
*/
struct dw_macinfo_block_s {
struct dw_macinfo_block_s *mb_next;
unsigned long mb_avail_len;
unsigned long mb_used_len;
unsigned long mb_macinfo_data_space_len;
char *mb_data; /* original malloc ptr. */
};
/* dwarf_sn_kind is for the array of similarly-treated
name -> cu ties
*/
enum dwarf_sn_kind { dwarf_snk_pubname, dwarf_snk_funcname,
dwarf_snk_weakname, dwarf_snk_typename,
dwarf_snk_varname,
dwarf_snk_entrycount /* this one must be last */
};
/* The calls to add a varname etc use a list of
these as the list.
*/
struct Dwarf_P_Simple_nameentry_s {
Dwarf_P_Die sne_die;
char *sne_name;
int sne_name_len;
Dwarf_P_Simple_nameentry sne_next;
};
/* An array of these, each of which heads a list
of Dwarf_P_Simple_nameentry
*/
struct Dwarf_P_Simple_name_header_s {
Dwarf_P_Simple_nameentry sn_head;
Dwarf_P_Simple_nameentry sn_tail;
Dwarf_Signed sn_count;
/* length that will be generated, not counting fixed header or
trailer */
Dwarf_Signed sn_net_len;
};
typedef int (*_dwarf_pro_reloc_name_func_ptr) (Dwarf_P_Debug dbg,
int sec_index,
Dwarf_Unsigned offset,/* r_offset */
Dwarf_Unsigned symidx,
enum Dwarf_Rel_Type type,
int reltarget_length);
typedef int (*_dwarf_pro_reloc_length_func_ptr) (Dwarf_P_Debug dbg,
int sec_index, Dwarf_Unsigned offset,/* r_offset */
Dwarf_Unsigned start_symidx,
Dwarf_Unsigned end_symidx,
enum Dwarf_Rel_Type type,
int reltarget_length);
typedef int (*_dwarf_pro_transform_relocs_func_ptr) (Dwarf_P_Debug dbg,
Dwarf_Signed *
new_sec_count);
/*
Each slot in a block of slots could be:
a binary stream relocation entry (32 or 64bit relocation data)
a SYMBOLIC relocation entry.
During creation sometimes we create multiple chained blocks,
but sometimes we create a single long block.
Before returning reloc data to caller,
we switch to a single, long-enough,
block.
We make counters here Dwarf_Unsigned so that we
get sufficient alignment. Since we use space after
the struct (at malloc time) for user data which
must have Dwarf_Unsigned alignment, this
struct must have that alignment too.
*/
struct Dwarf_P_Relocation_Block_s {
Dwarf_Unsigned rb_slots_in_block; /* slots in block, as created */
Dwarf_Unsigned rb_next_slot_to_use; /* counter, start at 0. */
struct Dwarf_P_Relocation_Block_s *rb_next;
char *rb_where_to_add_next; /* pointer to next slot (might be past
end, depending on
rb_next_slot_to_use) */
char *rb_data; /* data area */
};
/* One of these per potential relocation section
So one per actual dwarf section.
Left zeroed when not used (some sections have
no relocations).
*/
struct Dwarf_P_Per_Reloc_Sect_s {
unsigned long pr_reloc_total_count; /* total number of entries
across all blocks */
unsigned long pr_slots_per_block_to_alloc; /* at Block alloc, this
is the default number of slots to use */
int pr_sect_num_of_reloc_sect; /* sect number returned by
de_callback_func() or de_callback_func_b() call, this is the sect
number of the relocation section. */
/* singly-linked list. add at and ('last') with count of blocks */
struct Dwarf_P_Relocation_Block_s *pr_first_block;
struct Dwarf_P_Relocation_Block_s *pr_last_block;
unsigned long pr_block_count;
};
#define DEFAULT_SLOTS_PER_BLOCK 3
typedef struct memory_list_s {
struct memory_list_s *prev;
struct memory_list_s *next;
} memory_list_t;
struct Dwarf_P_Per_Sect_String_Attrs_s {
int sect_sa_section_number;
unsigned sect_sa_n_alloc;
unsigned sect_sa_n_used;
Dwarf_P_String_Attr sect_sa_list;
};
/* Fields used by producer */
struct Dwarf_P_Debug_s {
/* used to catch dso passing dbg to another DSO with incompatible
version of libdwarf See PRO_VERSION_MAGIC */
int de_version_magic_number;
Dwarf_Handler de_errhand;
Dwarf_Ptr de_errarg;
/* Call back function, used to create .debug* sections. Provided
by user. Only of these used per dbg. */
Dwarf_Callback_Func de_callback_func;
Dwarf_Callback_Func_b de_callback_func_b;
/* Flags from producer_init call */
Dwarf_Unsigned de_flags;
/* This holds information on debug section stream output, including
the stream data */
Dwarf_P_Section_Data de_debug_sects;
/* Pointer to the 'current active' section */
Dwarf_P_Section_Data de_current_active_section;
/* Number of debug data streams globs. */
Dwarf_Word de_n_debug_sect;
/* File entry information, null terminated singly-linked list */
Dwarf_P_F_Entry de_file_entries;
Dwarf_P_F_Entry de_last_file_entry;
Dwarf_Unsigned de_n_file_entries;
/* Has the directories used to search for source files */
Dwarf_P_Inc_Dir de_inc_dirs;
Dwarf_P_Inc_Dir de_last_inc_dir;
Dwarf_Unsigned de_n_inc_dirs;
/* Has all the line number info for the stmt program */
Dwarf_P_Line de_lines;
Dwarf_P_Line de_last_line;
/* List of cie's for the debug unit */
Dwarf_P_Cie de_frame_cies;
Dwarf_P_Cie de_last_cie;
Dwarf_Unsigned de_n_cie;
/* Singly-linked list of fde's for the debug unit */
Dwarf_P_Fde de_frame_fdes;
Dwarf_P_Fde de_last_fde;
Dwarf_Unsigned de_n_fde;
/* First die, leads to all others */
Dwarf_P_Die de_dies;
/* Pointer to list of strings */
char *de_strings;
/* Pointer to chain of aranges */
Dwarf_P_Arange de_arange;
Dwarf_P_Arange de_last_arange;
Dwarf_Sword de_arange_count;
/* macinfo controls. */
/* first points to beginning of the list during creation */
struct dw_macinfo_block_s *de_first_macinfo;
/* current points to the current, unfilled, block */
struct dw_macinfo_block_s *de_current_macinfo;
/* Pointer to the first section, to support reset_section_bytes */
Dwarf_P_Section_Data de_first_debug_sect;
/* handles pubnames, weaknames, etc. See dwarf_sn_kind in
pro_opaque.h */
struct Dwarf_P_Simple_name_header_s
de_simple_name_headers[dwarf_snk_entrycount];
/* relocation data. not all sections will actally have relocation
info, of course */
struct Dwarf_P_Per_Reloc_Sect_s de_reloc_sect[NUM_DEBUG_SECTIONS];
int de_reloc_next_to_return; /* iterator on reloc sections
(SYMBOLIC output) */
/* used in remembering sections */
int de_elf_sects[NUM_DEBUG_SECTIONS]; /* elf sect number of
the section itself, DEBUG_LINE for example */
Dwarf_Unsigned de_sect_name_idx[NUM_DEBUG_SECTIONS]; /* section
name index or handle for the name of the symbol for
DEBUG_LINE for example */
int de_offset_reloc; /* offset reloc type, R_MIPS_32 for
example. Specific to the ABI being
produced. Relocates offset size
field */
int de_exc_reloc; /* reloc type specific to exception
table relocs. */
int de_ptr_reloc; /* standard reloc type, R_MIPS_32 for
example. Specific to the ABI being
produced. relocates pointer size
field */
unsigned char de_offset_size; /* section offset. Here to
avoid test of abi in macro
at run time MIPS -n32 4,
-64 8. */
unsigned char de_pointer_size; /* size of pointer in target.
Here to avoid test of abi in
macro at run time MIPS -n32
4, -64 is 8. */
unsigned char de_is_64bit; /* non-zero if is 64bit. Else 32 bit:
used for passing this info as a flag
*/
unsigned char de_relocation_record_size; /* reloc record size
varies by ABI and
relocation-output
method (stream or
symbolic) */
unsigned char de_64bit_extension; /* non-zero if creating 64 bit
offsets using dwarf2-99
extension proposal */
int de_ar_data_attribute_form; /* data8, data4 abi dependent */
int de_ar_ref_attr_form; /* ref8 ref4 , abi dependent */
/* simple name relocations */
_dwarf_pro_reloc_name_func_ptr de_reloc_name;
/* relocations for a length, requiring a pair of symbols */
_dwarf_pro_reloc_length_func_ptr de_reloc_pair;
_dwarf_pro_transform_relocs_func_ptr de_transform_relocs_to_disk;
/* following used for macro buffers */
unsigned long de_compose_avail;
unsigned long de_compose_used_len;
unsigned char de_same_endian;
void *(*de_copy_word) (void *, const void *, size_t);
/* Add new fields at the END of this struct to preserve some hope
of sensible behavior on dbg passing between DSOs linked with
mismatched libdwarf producer versions. */
Dwarf_P_Marker de_markers; /* pointer to array of markers */
unsigned de_marker_n_alloc;
unsigned de_marker_n_used;
int de_sect_sa_next_to_return; /* Iterator on sring attrib sects */
/* String attributes data of each section. */
struct Dwarf_P_Per_Sect_String_Attrs_s de_sect_string_attr[NUM_DEBUG_SECTIONS];
};
#define CURRENT_VERSION_STAMP 2
Dwarf_Unsigned _dwarf_add_simple_name_entry(Dwarf_P_Debug dbg,
Dwarf_P_Die die,
char *entry_name,
enum dwarf_sn_kind
entrykind,
Dwarf_Error * error);
#define DISTINGUISHED_VALUE 0xffffffff /* 64bit extension flag */

View File

@ -1,47 +0,0 @@
/*
Copyright (C) 2000,2004 Silicon Graphics, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
int _dwarf_pro_pre_alloc_n_reloc_slots(Dwarf_P_Debug dbg,
int rel_sec_index,
Dwarf_Unsigned newslots);
int _dwarf_pro_alloc_reloc_slots(Dwarf_P_Debug dbg, int rel_sec_index);
int _dwarf_pro_reloc_get_a_slot(Dwarf_P_Debug dbg,
int base_sec_index,
void **relrec_to_fill);

View File

@ -1,63 +0,0 @@
/*
Copyright (C) 2000,2004 Silicon Graphics, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
int _dwarf_pro_reloc_name_stream64(Dwarf_P_Debug dbg, int base_sec_index, Dwarf_Unsigned offset, /* r_offset
of
reloc
*/
Dwarf_Unsigned symidx,
enum Dwarf_Rel_Type,
int reltarget_length);
int _dwarf_pro_reloc_name_stream32(Dwarf_P_Debug dbg, int base_sec_index, Dwarf_Unsigned offset, /* r_offset
of
reloc
*/
Dwarf_Unsigned symidx,
enum Dwarf_Rel_Type,
int reltarget_length);
int _dwarf_pro_reloc_length_stream(Dwarf_P_Debug dbg, int base_sec_index, Dwarf_Unsigned offset, /* r_offset
of
reloc
*/
Dwarf_Unsigned start_symidx,
Dwarf_Unsigned end_symidx,
enum Dwarf_Rel_Type,
int reltarget_length);
int _dwarf_stream_relocs_to_disk(Dwarf_P_Debug dbg,
Dwarf_Signed * new_sec_count);

View File

@ -1,55 +0,0 @@
/*
Copyright (C) 2000,2004 Silicon Graphics, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
int _dwarf_pro_reloc_name_symbolic(Dwarf_P_Debug dbg, int base_sec_index, Dwarf_Unsigned offset, /* r_offset
of
reloc
*/
Dwarf_Unsigned symidx,
enum Dwarf_Rel_Type,
int reltarget_length);
int
_dwarf_pro_reloc_length_symbolic(Dwarf_P_Debug dbg, int base_sec_index, Dwarf_Unsigned offset, /* r_offset
of
reloc
*/
Dwarf_Unsigned start_symidx,
Dwarf_Unsigned end_symidx,
enum Dwarf_Rel_Type,
int reltarget_length);
int _dwarf_symbolic_relocs_to_disk(Dwarf_P_Debug dbg,
Dwarf_Signed * new_sec_count);

View File

@ -1,112 +0,0 @@
/*
Copyright (C) 2000,2004 Silicon Graphics, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
/* relocation section names */
extern char *_dwarf_rel_section_names[];
/* section names */
extern char *_dwarf_sectnames[];
/* struct to hold relocation entries. Its mantained as a linked
list of relocation structs, and will then be written at as a
whole into the relocation section. Whether its 32 bit or
64 bit will be obtained from Dwarf_Debug pointer.
*/
/*
struct stores a chunk of data pertaining to a section
*/
struct Dwarf_P_Section_Data_s {
int ds_elf_sect_no; /* elf section number */
char *ds_data; /* data contained in section */
unsigned long ds_nbytes; /* bytes of data used so far */
unsigned long ds_orig_alloc; /* bytes allocated originally */
Dwarf_P_Section_Data ds_next; /* next on the list */
};
/* Used to allow a dummy initial struct (which we
drop before it gets used
This must not match any legitimate 'section' number.
*/
#define MAGIC_SECT_NO -3
/* Size of chunk of data allocated in one alloc
Not clear if this is the best size.
Used to be just 4096 for user data, the section data struct
was a separate malloc.
*/
#define CHUNK_SIZE (4096 - sizeof (struct Dwarf_P_Section_Data_s))
/*
chunk alloc routine -
if chunk->ds_data is nil, it will alloc CHUNK_SIZE bytes,
and return pointer to the beginning. If chunk is not nil,
it will see if there's enoungh space for nbytes in current
chunk, if not, add new chunk to linked list, and return
a char * pointer to it. Return null if unsuccessful.
*/
Dwarf_Small *_dwarf_pro_buffer(Dwarf_P_Debug dbg, int sectno,
unsigned long nbytes);
#define GET_CHUNK(dbg,sectno,ptr,nbytes,error) \
{ \
(ptr) = _dwarf_pro_buffer((dbg),(sectno),(nbytes)); \
if ((ptr) == NULL) { \
DWARF_P_DBG_ERROR(dbg,DW_DLE_CHUNK_ALLOC,-1); \
} \
}
int
_dwarf_transform_arange_to_disk(Dwarf_P_Debug dbg,
Dwarf_Error * error);
/* These are for creating ELF section type codes.
*/
#if defined(linux) || defined(__BEOS__) || !defined(SHT_MIPS_DWARF)
/* Intel's SoftSdv accepts only this */
#define SECTION_TYPE SHT_PROGBITS
#else
#define SECTION_TYPE SHT_MIPS_DWARF
#endif

View File

@ -1,44 +0,0 @@
/*
Copyright (C) 2000,2004 Silicon Graphics, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
/* pro_types.h */
int _dwarf_transform_simplename_to_disk(Dwarf_P_Debug dbg, enum dwarf_sn_kind entrykind, int section_index, /* in
de_elf_sects
etc
*/
Dwarf_Error * error);

View File

@ -1,148 +0,0 @@
/*
Copyright (C) 2000,2004 Silicon Graphics, Inc. All Rights Reserved.
Portions Copyright 2002-2010 Sun Microsystems, Inc. All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
#define IS_64BIT(dbg) ((dbg)->de_flags & DW_DLC_SIZE_64 ? 1 : 0)
#define ISA_IA64(dbg) ((dbg)->de_flags & DW_DLC_ISA_IA64 ? 1 : 0)
/* definition of sizes of types, given target machine */
#define sizeof_sbyte(dbg) sizeof(Dwarf_Sbyte)
#define sizeof_ubyte(dbg) sizeof(Dwarf_Ubyte)
#define sizeof_uhalf(dbg) sizeof(Dwarf_Half)
/* certain sizes not defined here, but set in dbg record.
See pro_init.c
*/
/* Computes amount of padding necessary to align n to a k-boundary. */
/* Important: Assumes n, k both GREATER than zero. */
#define PADDING(n, k) ( (k)-1 - ((n)-1)%(k) )
/* The following defines are only important for users of the
** producer part of libdwarf, and such should have these
** defined correctly (as necessary)
** by the #include <elf.h> done in pro_incl.h
** before the #include "pro_util.h".
** For others producer macros do not matter so 0 is a usable value, and
** zero values let compilation succeed on more non-MIPS architectures.
** A better approach would be welcome.
*/
/* R_MIPS* are #define so #ifndef works */
/* R_IA_64* are not necessarily #define (might be enum) so #ifndef
is useless, we use the configure script generating
HAVE_R_IA_64_DIR32LSB and HAVE_R_IA64_DIR32LSB.
*/
#ifndef R_MIPS_64
#define R_MIPS_64 0
#endif
#ifndef R_MIPS_32
#define R_MIPS_32 0
#endif
#ifndef R_MIPS_SCN_DISP
#define R_MIPS_SCN_DISP 0
#endif
/* R_IA_64_DIR32LSB came before the now-standard R_IA64_DIR32LSB
(etc) was defined. This now deals with either form,
preferring the new form if available. */
#ifdef HAVE_R_IA64_DIR32LSB
#define DWARF_PRO_R_IA64_DIR32LSB R_IA64_DIR32LSB
#define DWARF_PRO_R_IA64_DIR64LSB R_IA64_DIR64LSB
#define DWARF_PRO_R_IA64_SEGREL64LSB R_IA64_SEGREL64LSB
#define DWARF_PRO_R_IA64_SEGREL32LSB R_IA64_SEGREL32LSB
#endif
#if defined(HAVE_R_IA_64_DIR32LSB) && !defined(HAVE_R_IA64_DIR32LSB)
#define DWARF_PRO_R_IA64_DIR32LSB R_IA_64_DIR32LSB
#define DWARF_PRO_R_IA64_DIR64LSB R_IA_64_DIR64LSB
#define DWARF_PRO_R_IA64_SEGREL64LSB R_IA_64_SEGREL64LSB
#define DWARF_PRO_R_IA64_SEGREL32LSB R_IA_64_SEGREL32LSB
#endif
#if !defined(HAVE_R_IA_64_DIR32LSB) && !defined(HAVE_R_IA64_DIR32LSB)
#define DWARF_PRO_R_IA64_DIR32LSB 0
#define DWARF_PRO_R_IA64_DIR64LSB 0
#define DWARF_PRO_R_IA64_SEGREL64LSB 0
#define DWARF_PRO_R_IA64_SEGREL32LSB 0
#endif
/*
* The default "I don't know" value can't be zero.
* Because that's the sentinel value that means "no relocation".
* In order to use this library in 'symbolic relocation mode we
* don't care if this value is the right relocation value,
* only that it's non-NULL. So at the end, we define it
* to something sensible.
*/
#if defined(sun)
#if defined(sparc)
#define Get_REL64_isa(dbg) (R_SPARC_UA64)
#define Get_REL32_isa(dbg) (R_SPARC_UA32)
#define Get_REL_SEGREL_isa(dbg) (R_SPARC_NONE) /* I don't know! */
#else /* i386 */
#define Get_REL64_isa(dbg) (R_386_32) /* Any non-zero value is ok */
#define Get_REL32_isa(dbg) (R_386_32)
#define Get_REL_SEGREL_isa(dbg) (R_386_NONE) /* I don't know! */
#endif /* sparc || i386 */
#else /* !sun */
#ifdef HAVE_SYS_IA64_ELF_H
#define Get_REL64_isa(dbg) (ISA_IA64(dbg) ? \
DWARF_PRO_R_IA64_DIR64LSB : R_MIPS_64)
#define Get_REL32_isa(dbg) (ISA_IA64(dbg) ? \
DWARF_PRO_R_IA64_DIR32LSB : R_MIPS_32)
/* ia64 uses 32bit dwarf offsets for sections */
#define Get_REL_SEGREL_isa(dbg) (ISA_IA64(dbg) ? \
DWARF_PRO_R_IA64_SEGREL32LSB : R_MIPS_SCN_DISP)
#else /* HAVE_SYS_IA64_ELF_H */
#if !defined(linux) && !defined(__BEOS__)
#define Get_REL64_isa(dbg) (R_MIPS_64)
#define Get_REL32_isa(dbg) (R_MIPS_32)
#define Get_REL_SEGREL_isa(dbg) (R_MIPS_SCN_DISP)
#else
#define Get_REL64_isa(dbg) (1)
#define Get_REL32_isa(dbg) (1) /* these are used on linux */
#define Get_REL_SEGREL_isa(dbg) (1) /* non zero values, see comments above */
#endif
#endif /* HAVE_SYS_IA64_ELF_H */
#endif /* !sun */

View File

@ -1,95 +0,0 @@
/*
byteswap.h - functions and macros for byte swapping.
Copyright (C) 1995 - 2001 Michael Riepe
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/* @(#) $Id: byteswap.h,v 1.7 2008/05/23 08:15:34 michael Exp $ */
#ifndef _BYTESWAP_H
#define _BYTESWAP_H
#define lu(from,i,s) (((__libelf_u32_t)((unsigned char*)(from))[i])<<(s))
#define li(from,i,s) (((__libelf_i32_t)(( signed char*)(from))[i])<<(s))
#define __load_u16L(from) ((__libelf_u32_t) \
(lu(from,1,8) | lu(from,0,0)))
#define __load_u16M(from) ((__libelf_u32_t) \
(lu(from,0,8) | lu(from,1,0)))
#define __load_i16L(from) ((__libelf_i32_t) \
(li(from,1,8) | lu(from,0,0)))
#define __load_i16M(from) ((__libelf_i32_t) \
(li(from,0,8) | lu(from,1,0)))
#define __load_u32L(from) ((__libelf_u32_t) \
(lu(from,3,24) | lu(from,2,16) | lu(from,1,8) | lu(from,0,0)))
#define __load_u32M(from) ((__libelf_u32_t) \
(lu(from,0,24) | lu(from,1,16) | lu(from,2,8) | lu(from,3,0)))
#define __load_i32L(from) ((__libelf_i32_t) \
(li(from,3,24) | lu(from,2,16) | lu(from,1,8) | lu(from,0,0)))
#define __load_i32M(from) ((__libelf_i32_t) \
(li(from,0,24) | lu(from,1,16) | lu(from,2,8) | lu(from,3,0)))
#define su(to,i,v,s) (((char*)(to))[i]=((__libelf_u32_t)(v)>>(s)))
#define si(to,i,v,s) (((char*)(to))[i]=((__libelf_i32_t)(v)>>(s)))
#define __store_u16L(to,v) \
(su(to,1,v,8), su(to,0,v,0))
#define __store_u16M(to,v) \
(su(to,0,v,8), su(to,1,v,0))
#define __store_i16L(to,v) \
(si(to,1,v,8), si(to,0,v,0))
#define __store_i16M(to,v) \
(si(to,0,v,8), si(to,1,v,0))
#define __store_u32L(to,v) \
(su(to,3,v,24), su(to,2,v,16), su(to,1,v,8), su(to,0,v,0))
#define __store_u32M(to,v) \
(su(to,0,v,24), su(to,1,v,16), su(to,2,v,8), su(to,3,v,0))
#define __store_i32L(to,v) \
(si(to,3,v,24), si(to,2,v,16), si(to,1,v,8), si(to,0,v,0))
#define __store_i32M(to,v) \
(si(to,0,v,24), si(to,1,v,16), si(to,2,v,8), si(to,3,v,0))
#if __LIBELF64
/*
* conversion functions from swap64.c
*/
extern __libelf_u64_t _elf_load_u64L(const unsigned char *from);
extern __libelf_u64_t _elf_load_u64M(const unsigned char *from);
extern __libelf_i64_t _elf_load_i64L(const unsigned char *from);
extern __libelf_i64_t _elf_load_i64M(const unsigned char *from);
extern void _elf_store_u64L(unsigned char *to, __libelf_u64_t v);
extern void _elf_store_u64M(unsigned char *to, __libelf_u64_t v);
extern void _elf_store_i64L(unsigned char *to, __libelf_u64_t v);
extern void _elf_store_i64M(unsigned char *to, __libelf_u64_t v);
/*
* aliases for existing conversion code
*/
#define __load_u64L _elf_load_u64L
#define __load_u64M _elf_load_u64M
#define __load_i64L _elf_load_i64L
#define __load_i64M _elf_load_i64M
#define __store_u64L _elf_store_u64L
#define __store_u64M _elf_store_u64M
#define __store_i64L _elf_store_i64L
#define __store_i64M _elf_store_i64M
#endif /* __LIBELF64 */
#endif /* _BYTESWAP_H */

View File

@ -1,996 +0,0 @@
/*
* elf_repl.h - public header file for systems that lack it.
* Copyright (C) 1995 - 2006 Michael Riepe
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/* @(#) $Id: elf_repl.h,v 1.22 2009/11/01 13:04:19 michael Exp $ */
/*
* NEVER INCLUDE THIS FILE DIRECTLY - USE <libelf.h> INSTEAD!
*/
#ifndef _ELF_REPL_H
#define _ELF_REPL_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*
* Scalar data types
*/
typedef __libelf_u32_t Elf32_Addr;
typedef __libelf_u16_t Elf32_Half;
typedef __libelf_u32_t Elf32_Off;
typedef __libelf_i32_t Elf32_Sword;
typedef __libelf_u32_t Elf32_Word;
#define ELF32_FSZ_ADDR 4
#define ELF32_FSZ_HALF 2
#define ELF32_FSZ_OFF 4
#define ELF32_FSZ_SWORD 4
#define ELF32_FSZ_WORD 4
#if __LIBELF64
typedef __libelf_u64_t Elf64_Addr;
typedef __libelf_u16_t Elf64_Half;
typedef __libelf_u64_t Elf64_Off;
typedef __libelf_i32_t Elf64_Sword;
typedef __libelf_u32_t Elf64_Word;
typedef __libelf_i64_t Elf64_Sxword;
typedef __libelf_u64_t Elf64_Xword;
#define ELF64_FSZ_ADDR 8
#define ELF64_FSZ_HALF 2
#define ELF64_FSZ_OFF 8
#define ELF64_FSZ_SWORD 4
#define ELF64_FSZ_WORD 4
#define ELF64_FSZ_SXWORD 8
#define ELF64_FSZ_XWORD 8
/*
* Blame Sun for this...
*/
typedef __libelf_u64_t Elf64_Lword;
typedef __libelf_u64_t Elf32_Lword;
#endif /* __LIBELF64 */
/*
* ELF header
*/
#define EI_NIDENT 16
typedef struct {
unsigned char e_ident[EI_NIDENT];
Elf32_Half e_type;
Elf32_Half e_machine;
Elf32_Word e_version;
Elf32_Addr e_entry;
Elf32_Off e_phoff;
Elf32_Off e_shoff;
Elf32_Word e_flags;
Elf32_Half e_ehsize;
Elf32_Half e_phentsize;
Elf32_Half e_phnum;
Elf32_Half e_shentsize;
Elf32_Half e_shnum;
Elf32_Half e_shstrndx;
} Elf32_Ehdr;
#if __LIBELF64
typedef struct {
unsigned char e_ident[EI_NIDENT];
Elf64_Half e_type;
Elf64_Half e_machine;
Elf64_Word e_version;
Elf64_Addr e_entry;
Elf64_Off e_phoff;
Elf64_Off e_shoff;
Elf64_Word e_flags;
Elf64_Half e_ehsize;
Elf64_Half e_phentsize;
Elf64_Half e_phnum;
Elf64_Half e_shentsize;
Elf64_Half e_shnum;
Elf64_Half e_shstrndx;
} Elf64_Ehdr;
#endif /* __LIBELF64 */
/*
* e_ident
*/
#define EI_MAG0 0
#define EI_MAG1 1
#define EI_MAG2 2
#define EI_MAG3 3
#define EI_CLASS 4
#define EI_DATA 5
#define EI_VERSION 6
#define EI_OSABI 7
#define EI_ABIVERSION 8
#define EI_PAD 9
#define ELFMAG0 0x7f
#define ELFMAG1 'E'
#define ELFMAG2 'L'
#define ELFMAG3 'F'
#define ELFMAG "\177ELF"
#define SELFMAG 4
/*
* e_ident[EI_CLASS]
*/
#define ELFCLASSNONE 0
#define ELFCLASS32 1
#define ELFCLASS64 2
#define ELFCLASSNUM 3
/*
* e_ident[EI_DATA]
*/
#define ELFDATANONE 0
#define ELFDATA2LSB 1
#define ELFDATA2MSB 2
#define ELFDATANUM 3
/*
* e_ident[EI_OSABI]
*/
#define ELFOSABI_NONE 0 /* No extensions or unspecified */
#define ELFOSABI_SYSV ELFOSABI_NONE
#define ELFOSABI_HPUX 1 /* Hewlett-Packard HP-UX */
#define ELFOSABI_NETBSD 2 /* NetBSD */
#define ELFOSABI_LINUX 3 /* Linux */
#define ELFOSABI_SOLARIS 6 /* Sun Solaris */
#define ELFOSABI_AIX 7 /* AIX */
#define ELFOSABI_IRIX 8 /* IRIX */
#define ELFOSABI_FREEBSD 9 /* FreeBSD */
#define ELFOSABI_TRU64 10 /* Compaq TRU64 UNIX */
#define ELFOSABI_MODESTO 11 /* Novell Modesto */
#define ELFOSABI_OPENBSD 12 /* Open BSD */
#define ELFOSABI_OPENVMS 13 /* Open VMS */
#define ELFOSABI_NSK 14 /* Hewlett-Packard Non-Stop Kernel */
#define ELFOSABI_AROS 15 /* Amiga Research OS */
/* these are probably obsolete: */
#define ELFOSABI_ARM 97 /* ARM */
#define ELFOSABI_STANDALONE 255 /* standalone (embedded) application */
/*
* e_type
*/
#define ET_NONE 0
#define ET_REL 1
#define ET_EXEC 2
#define ET_DYN 3
#define ET_CORE 4
#define ET_NUM 5
#define ET_LOOS 0xfe00
#define ET_HIOS 0xfeff
#define ET_LOPROC 0xff00
#define ET_HIPROC 0xffff
/*
* e_machine
*/
#define EM_NONE 0 /* No machine */
#define EM_M32 1 /* AT&T WE 32100 */
#define EM_SPARC 2 /* SPARC */
#define EM_386 3 /* Intel 80386 */
#define EM_68K 4 /* Motorola 68000 */
#define EM_88K 5 /* Motorola 88000 */
#define EM_486 6 /* Intel i486 (DO NOT USE THIS ONE) */
#define EM_860 7 /* Intel 80860 */
#define EM_MIPS 8 /* MIPS I Architecture */
#define EM_S370 9 /* IBM System/370 Processor */
#define EM_MIPS_RS3_LE 10 /* MIPS RS3000 Little-endian */
#define EM_SPARC64 11 /* SPARC 64-bit */
#define EM_PARISC 15 /* Hewlett-Packard PA-RISC */
#define EM_VPP500 17 /* Fujitsu VPP500 */
#define EM_SPARC32PLUS 18 /* Enhanced instruction set SPARC */
#define EM_960 19 /* Intel 80960 */
#define EM_PPC 20 /* PowerPC */
#define EM_PPC64 21 /* 64-bit PowerPC */
#define EM_S390 22 /* IBM System/390 Processor */
#define EM_V800 36 /* NEC V800 */
#define EM_FR20 37 /* Fujitsu FR20 */
#define EM_RH32 38 /* TRW RH-32 */
#define EM_RCE 39 /* Motorola RCE */
#define EM_ARM 40 /* Advanced RISC Machines ARM */
#define EM_ALPHA 41 /* Digital Alpha */
#define EM_SH 42 /* Hitachi SH */
#define EM_SPARCV9 43 /* SPARC Version 9 */
#define EM_TRICORE 44 /* Siemens TriCore embedded processor */
#define EM_ARC 45 /* Argonaut RISC Core, Argonaut Technologies Inc. */
#define EM_H8_300 46 /* Hitachi H8/300 */
#define EM_H8_300H 47 /* Hitachi H8/300H */
#define EM_H8S 48 /* Hitachi H8S */
#define EM_H8_500 49 /* Hitachi H8/500 */
#define EM_IA_64 50 /* Intel IA-64 processor architecture */
#define EM_MIPS_X 51 /* Stanford MIPS-X */
#define EM_COLDFIRE 52 /* Motorola ColdFire */
#define EM_68HC12 53 /* Motorola M68HC12 */
#define EM_MMA 54 /* Fujitsu MMA Multimedia Accelerator */
#define EM_PCP 55 /* Siemens PCP */
#define EM_NCPU 56 /* Sony nCPU embedded RISC processor */
#define EM_NDR1 57 /* Denso NDR1 microprocessor */
#define EM_STARCORE 58 /* Motorola Star*Core processor */
#define EM_ME16 59 /* Toyota ME16 processor */
#define EM_ST100 60 /* STMicroelectronics ST100 processor */
#define EM_TINYJ 61 /* Advanced Logic Corp. TinyJ embedded processor family */
#define EM_X86_64 62 /* AMD x86-64 architecture */
#define EM_AMD64 EM_X86_64
#define EM_PDSP 63 /* Sony DSP Processor */
#define EM_FX66 66 /* Siemens FX66 microcontroller */
#define EM_ST9PLUS 67 /* STMicroelectronics ST9+ 8/16 bit microcontroller */
#define EM_ST7 68 /* STMicroelectronics ST7 8-bit microcontroller */
#define EM_68HC16 69 /* Motorola MC68HC16 Microcontroller */
#define EM_68HC11 70 /* Motorola MC68HC11 Microcontroller */
#define EM_68HC08 71 /* Motorola MC68HC08 Microcontroller */
#define EM_68HC05 72 /* Motorola MC68HC05 Microcontroller */
#define EM_SVX 73 /* Silicon Graphics SVx */
#define EM_ST19 74 /* STMicroelectronics ST19 8-bit microcontroller */
#define EM_VAX 75 /* Digital VAX */
#define EM_CRIS 76 /* Axis Communications 32-bit embedded processor */
#define EM_JAVELIN 77 /* Infineon Technologies 32-bit embedded processor */
#define EM_FIREPATH 78 /* Element 14 64-bit DSP Processor */
#define EM_ZSP 79 /* LSI Logic 16-bit DSP Processor */
#define EM_MMIX 80 /* Donald Knuth's educational 64-bit processor */
#define EM_HUANY 81 /* Harvard University machine-independent object files */
#define EM_PRISM 82 /* SiTera Prism */
#define EM_AVR 83 /* Atmel AVR 8-bit microcontroller */
#define EM_FR30 84 /* Fujitsu FR30 */
#define EM_D10V 85 /* Mitsubishi D10V */
#define EM_D30V 86 /* Mitsubishi D30V */
#define EM_V850 87 /* NEC v850 */
#define EM_M32R 88 /* Mitsubishi M32R */
#define EM_MN10300 89 /* Matsushita MN10300 */
#define EM_MN10200 90 /* Matsushita MN10200 */
#define EM_PJ 91 /* picoJava */
#define EM_OPENRISC 92 /* OpenRISC 32-bit embedded processor */
#define EM_ARC_A5 93 /* ARC Cores Tangent-A5 */
#define EM_XTENSA 94 /* Tensilica Xtensa Architecture */
#define EM_VIDEOCORE 95 /* Alphamosaic VideoCore processor */
#define EM_TMM_GPP 96 /* Thompson Multimedia General Purpose Processor */
#define EM_NS32K 97 /* National Semiconductor 32000 series */
#define EM_TPC 98 /* Tenor Network TPC processor */
#define EM_SNP1K 99 /* Trebia SNP 1000 processor */
#define EM_ST200 100 /* STMicroelectronics (www.st.com) ST200 microcontroller */
#define EM_IP2K 101 /* Ubicom IP2xxx microcontroller family */
#define EM_MAX 102 /* MAX Processor */
#define EM_CR 103 /* National Semiconductor CompactRISC microprocessor */
#define EM_F2MC16 104 /* Fujitsu F2MC16 */
#define EM_MSP430 105 /* Texas Instruments embedded microcontroller msp430 */
#define EM_BLACKFIN 106 /* Analog Devices Blackfin (DSP) processor */
#define EM_SE_C33 107 /* S1C33 Family of Seiko Epson processors */
#define EM_SEP 108 /* Sharp embedded microprocessor */
#define EM_ARCA 109 /* Arca RISC Microprocessor */
#define EM_UNICORE 110 /* Microprocessor series from PKU-Unity Ltd. and MPRC of Peking University */
#define EM_NUM 111
/*
* e_ident[EI_VERSION], e_version
*/
#define EV_NONE 0
#define EV_CURRENT 1
#define EV_NUM 2
/*
* Section header
*/
typedef struct {
Elf32_Word sh_name;
Elf32_Word sh_type;
Elf32_Word sh_flags;
Elf32_Addr sh_addr;
Elf32_Off sh_offset;
Elf32_Word sh_size;
Elf32_Word sh_link;
Elf32_Word sh_info;
Elf32_Word sh_addralign;
Elf32_Word sh_entsize;
} Elf32_Shdr;
#if __LIBELF64
typedef struct {
Elf64_Word sh_name;
Elf64_Word sh_type;
Elf64_Xword sh_flags;
Elf64_Addr sh_addr;
Elf64_Off sh_offset;
Elf64_Xword sh_size;
Elf64_Word sh_link;
Elf64_Word sh_info;
Elf64_Xword sh_addralign;
Elf64_Xword sh_entsize;
} Elf64_Shdr;
#endif /* __LIBELF64 */
/*
* Special section indices
*/
#define SHN_UNDEF 0
#define SHN_LORESERVE 0xff00
#define SHN_LOPROC 0xff00
#define SHN_HIPROC 0xff1f
#define SHN_LOOS 0xff20
#define SHN_HIOS 0xff3f
#define SHN_ABS 0xfff1
#define SHN_COMMON 0xfff2
#define SHN_XINDEX 0xffff
#define SHN_HIRESERVE 0xffff
/*
* sh_type
*/
#define SHT_NULL 0
#define SHT_PROGBITS 1
#define SHT_SYMTAB 2
#define SHT_STRTAB 3
#define SHT_RELA 4
#define SHT_HASH 5
#define SHT_DYNAMIC 6
#define SHT_NOTE 7
#define SHT_NOBITS 8
#define SHT_REL 9
#define SHT_SHLIB 10
#define SHT_DYNSYM 11
#define SHT_INIT_ARRAY 14
#define SHT_FINI_ARRAY 15
#define SHT_PREINIT_ARRAY 16
#define SHT_GROUP 17
#define SHT_SYMTAB_SHNDX 18
#define SHT_NUM 19
#define SHT_LOOS 0x60000000
#define SHT_HIOS 0x6fffffff
#define SHT_LOPROC 0x70000000
#define SHT_HIPROC 0x7fffffff
#define SHT_LOUSER 0x80000000
#define SHT_HIUSER 0xffffffff
/*
* Solaris extensions
*/
#define SHT_LOSUNW 0x6ffffff4
#define SHT_SUNW_dof 0x6ffffff4
#define SHT_SUNW_cap 0x6ffffff5
#define SHT_SUNW_SIGNATURE 0x6ffffff6
#define SHT_SUNW_ANNOTATE 0x6ffffff7
#define SHT_SUNW_DEBUGSTR 0x6ffffff8
#define SHT_SUNW_DEBUG 0x6ffffff9
#define SHT_SUNW_move 0x6ffffffa
#define SHT_SUNW_COMDAT 0x6ffffffb
#define SHT_SUNW_syminfo 0x6ffffffc
#define SHT_SUNW_verdef 0x6ffffffd
#define SHT_SUNW_verneed 0x6ffffffe
#define SHT_SUNW_versym 0x6fffffff
#define SHT_HISUNW 0x6fffffff
#define SHT_SPARC_GOTDATA 0x70000000
#define SHT_AMD64_UNWIND 0x70000001
/*
* GNU extensions
*/
#define SHT_GNU_verdef 0x6ffffffd
#define SHT_GNU_verneed 0x6ffffffe
#define SHT_GNU_versym 0x6fffffff
/*
* sh_flags
*/
#define SHF_WRITE 0x1
#define SHF_ALLOC 0x2
#define SHF_EXECINSTR 0x4
#define SHF_MERGE 0x10
#define SHF_STRINGS 0x20
#define SHF_INFO_LINK 0x40
#define SHF_LINK_ORDER 0x80
#define SHF_OS_NONCONFORMING 0x100
#define SHF_GROUP 0x200
#define SHF_TLS 0x400
#define SHF_MASKOS 0x0ff00000
#define SHF_MASKPROC 0xf0000000
/*
* Solaris extensions
*/
#define SHF_AMD64_LARGE 0x10000000
#define SHF_ORDERED 0x40000000
#define SHF_EXCLUDE 0x80000000
/*
* Section group flags
*/
#define GRP_COMDAT 0x1
#define GRP_MASKOS 0x0ff00000
#define GRP_MASKPROC 0xf0000000
/*
* Symbol table
*/
typedef struct {
Elf32_Word st_name;
Elf32_Addr st_value;
Elf32_Word st_size;
unsigned char st_info;
unsigned char st_other;
Elf32_Half st_shndx;
} Elf32_Sym;
#if __LIBELF64
typedef struct {
Elf64_Word st_name;
unsigned char st_info;
unsigned char st_other;
Elf64_Half st_shndx;
Elf64_Addr st_value;
Elf64_Xword st_size;
} Elf64_Sym;
#endif /* __LIBELF64 */
/*
* Special symbol indices
*/
#define STN_UNDEF 0
/*
* Macros for manipulating st_info
*/
#define ELF32_ST_BIND(i) ((i)>>4)
#define ELF32_ST_TYPE(i) ((i)&0xf)
#define ELF32_ST_INFO(b,t) (((b)<<4)+((t)&0xf))
#if __LIBELF64
#define ELF64_ST_BIND(i) ((i)>>4)
#define ELF64_ST_TYPE(i) ((i)&0xf)
#define ELF64_ST_INFO(b,t) (((b)<<4)+((t)&0xf))
#endif /* __LIBELF64 */
/*
* Symbol binding
*/
#define STB_LOCAL 0
#define STB_GLOBAL 1
#define STB_WEAK 2
#define STB_NUM 3
#define STB_LOOS 10
#define STB_HIOS 12
#define STB_LOPROC 13
#define STB_HIPROC 15
/*
* Symbol types
*/
#define STT_NOTYPE 0
#define STT_OBJECT 1
#define STT_FUNC 2
#define STT_SECTION 3
#define STT_FILE 4
#define STT_COMMON 5
#define STT_TLS 6
#define STT_NUM 7
#define STT_LOOS 10
#define STT_HIOS 12
#define STT_LOPROC 13
#define STT_HIPROC 15
/*
* Macros for manipulating st_other
*/
#define ELF32_ST_VISIBILITY(o) ((o)&0x3)
#if __LIBELF64
#define ELF64_ST_VISIBILITY(o) ((o)&0x3)
#endif /* __LIBELF64 */
/*
* Symbol visibility
*/
#define STV_DEFAULT 0
#define STV_INTERNAL 1
#define STV_HIDDEN 2
#define STV_PROTECTED 3
/*
* Relocation
*/
typedef struct {
Elf32_Addr r_offset;
Elf32_Word r_info;
} Elf32_Rel;
typedef struct {
Elf32_Addr r_offset;
Elf32_Word r_info;
Elf32_Sword r_addend;
} Elf32_Rela;
#if __LIBELF64
typedef struct {
Elf64_Addr r_offset;
Elf64_Xword r_info;
} Elf64_Rel;
typedef struct {
Elf64_Addr r_offset;
Elf64_Xword r_info;
Elf64_Sxword r_addend;
} Elf64_Rela;
#endif /* __LIBELF64 */
/*
* Macros for manipulating r_info
*/
#define ELF32_R_SYM(i) ((i)>>8)
#define ELF32_R_TYPE(i) ((unsigned char)(i))
#define ELF32_R_INFO(s,t) (((s)<<8)+(unsigned char)(t))
#if __LIBELF64
#define ELF64_R_SYM(i) ((Elf64_Xword)(i)>>32)
#define ELF64_R_TYPE(i) ((i)&0xffffffffL)
#define ELF64_R_INFO(s,t) (((Elf64_Xword)(s)<<32)+((t)&0xffffffffL))
#endif /* __LIBELF64 */
/*
* Note entry header
*/
typedef struct {
Elf32_Word n_namesz; /* name size */
Elf32_Word n_descsz; /* descriptor size */
Elf32_Word n_type; /* descriptor type */
} Elf32_Nhdr;
#if __LIBELF64
/* Solaris and GNU use this layout. Be compatible. */
/* XXX: Latest ELF specs say it's 64-bit!!! */
typedef struct {
Elf64_Word n_namesz; /* name size */
Elf64_Word n_descsz; /* descriptor size */
Elf64_Word n_type; /* descriptor type */
} Elf64_Nhdr;
#endif /* __LIBELF64 */
/*
* Well-known descriptor types for ET_CORE files
*/
#define NT_PRSTATUS 1
#define NT_PRFPREG 2
#define NT_PRPSINFO 3
/*
* Program header
*/
typedef struct {
Elf32_Word p_type;
Elf32_Off p_offset;
Elf32_Addr p_vaddr;
Elf32_Addr p_paddr;
Elf32_Word p_filesz;
Elf32_Word p_memsz;
Elf32_Word p_flags;
Elf32_Word p_align;
} Elf32_Phdr;
#if __LIBELF64
typedef struct {
Elf64_Word p_type;
Elf64_Word p_flags;
Elf64_Off p_offset;
Elf64_Addr p_vaddr;
Elf64_Addr p_paddr;
Elf64_Xword p_filesz;
Elf64_Xword p_memsz;
Elf64_Xword p_align;
} Elf64_Phdr;
#endif /* __LIBELF64 */
/*
* Special numbers
*/
#define PN_XNUM 0xffff
/*
* p_type
*/
#define PT_NULL 0
#define PT_LOAD 1
#define PT_DYNAMIC 2
#define PT_INTERP 3
#define PT_NOTE 4
#define PT_SHLIB 5
#define PT_PHDR 6
#define PT_TLS 7
#define PT_NUM 8
#define PT_LOOS 0x60000000
#define PT_HIOS 0x6fffffff
#define PT_LOPROC 0x70000000
#define PT_HIPROC 0x7fffffff
/*
* Solaris extensions
*/
#define PT_SUNW_UNWIND 0x6464e550
#define PT_LOSUNW 0x6ffffffa
#define PT_SUNWBSS 0x6ffffffa
#define PT_SUNWSTACK 0x6ffffffb
#define PT_SUNWDTRACE 0x6ffffffc
#define PT_SUNWCAP 0x6ffffffd
#define PT_HISUNW 0x6fffffff
/*
* p_flags
*/
#define PF_X 0x1
#define PF_W 0x2
#define PF_R 0x4
#define PF_MASKOS 0x0ff00000
#define PF_MASKPROC 0xf0000000
/*
* Dynamic structure
*/
typedef struct {
Elf32_Sword d_tag;
union {
Elf32_Word d_val;
Elf32_Addr d_ptr;
} d_un;
} Elf32_Dyn;
#if __LIBELF64
typedef struct {
Elf64_Sxword d_tag;
union {
Elf64_Xword d_val;
Elf64_Addr d_ptr;
} d_un;
} Elf64_Dyn;
#endif /* __LIBELF64 */
/*
* Dynamic array tags
*/
/* d_un exec shared */
#define DT_NULL 0 /* ign. mand. mand. */
#define DT_NEEDED 1 /* d_val opt. opt. */
#define DT_PLTRELSZ 2 /* d_val opt. opt. */
#define DT_PLTGOT 3 /* d_ptr opt. opt. */
#define DT_HASH 4 /* d_ptr mand. mand. */
#define DT_STRTAB 5 /* d_ptr mand. mand. */
#define DT_SYMTAB 6 /* d_ptr mand. mand. */
#define DT_RELA 7 /* d_ptr mand. opt. */
#define DT_RELASZ 8 /* d_val mand. opt. */
#define DT_RELAENT 9 /* d_val mand. opt. */
#define DT_STRSZ 10 /* d_val mand. mand. */
#define DT_SYMENT 11 /* d_val mand. mand. */
#define DT_INIT 12 /* d_ptr opt. opt. */
#define DT_FINI 13 /* d_ptr opt. opt. */
#define DT_SONAME 14 /* d_val ign. opt. */
#define DT_RPATH 15 /* d_val opt. ign. */
#define DT_SYMBOLIC 16 /* ign. ign. opt. */
#define DT_REL 17 /* d_ptr mand. opt. */
#define DT_RELSZ 18 /* d_val mand. opt. */
#define DT_RELENT 19 /* d_val mand. opt. */
#define DT_PLTREL 20 /* d_val opt. opt. */
#define DT_DEBUG 21 /* d_ptr opt. ign. */
#define DT_TEXTREL 22 /* ign. opt. opt. */
#define DT_JMPREL 23 /* d_ptr opt. opt. */
#define DT_BIND_NOW 24 /* ign. opt. opt. */
#define DT_INIT_ARRAY 25 /* d_ptr opt. opt. */
#define DT_FINI_ARRAY 26 /* d_ptr opt. opt. */
#define DT_INIT_ARRAYSZ 27 /* d_val opt. opt. */
#define DT_FINI_ARRAYSZ 28 /* d_val opt. opt. */
#define DT_RUNPATH 29 /* d_val opt. opt. */
#define DT_FLAGS 30 /* d_val opt. opt. */
#define DT_ENCODING 32 /* odd/even encoding rule starts here */
#define DT_PREINIT_ARRAY 32 /* d_ptr opt. ign. */
#define DT_PREINIT_ARRAYSZ 33 /* d_val opt. ign. */
#define DT_NUM 34
#define DT_LOOS 0x6000000D
#define DT_HIOS 0x6ffff000
#define DT_LOPROC 0x70000000
#define DT_HIPROC 0x7fffffff
/*
* DT_FLAGS values
*/
#define DF_ORIGIN 0x1
#define DF_SYMBOLIC 0x2
#define DF_TEXTREL 0x4
#define DF_BIND_NOW 0x8
#define DF_STATIC_TLS 0x10
/*
* Solaris extensions
*/
#define DT_VALRNGLO 0x6ffffd00
#define DT_CHECKSUM 0x6ffffdf8
#define DT_PLTPADSZ 0x6ffffdf9
#define DT_MOVEENT 0x6ffffdfa
#define DT_MOVESZ 0x6ffffdfb
#define DT_FEATURE_1 0x6ffffdfc
#define DT_POSFLAG_1 0x6ffffdfd
#define DT_SYMINSZ 0x6ffffdfe
#define DT_SYMINENT 0x6ffffdff
#define DT_VALRNGHI 0x6ffffdff
#define DT_ADDRRNGLO 0x6ffffe00
#define DT_CONFIG 0x6ffffefa
#define DT_DEPAUDIT 0x6ffffefb
#define DT_AUDIT 0x6ffffefc
#define DT_PLTPAD 0x6ffffefd
#define DT_MOVETAB 0x6ffffefe
#define DT_SYMINFO 0x6ffffeff
#define DT_ADDRRNGHI 0x6ffffeff
#define DT_RELACOUNT 0x6ffffff9
#define DT_RELCOUNT 0x6ffffffa
#define DT_FLAGS_1 0x6ffffffb
#define DT_VERDEF 0x6ffffffc
#define DT_VERDEFNUM 0x6ffffffd
#define DT_VERNEED 0x6ffffffe
#define DT_VERNEEDNUM 0x6fffffff
#define DT_AUXILIARY 0x7ffffffd
#define DT_USED 0x7ffffffe
#define DT_FILTER 0x7fffffff
/*
* GNU extensions
*/
#define DT_VERSYM 0x6ffffff0
/*
* DT_FEATURE_1 values
*/
#define DTF_1_PARINIT 0x1
#define DTF_1_CONFEXP 0x2
/*
* DT_POSFLAG_1 values
*/
#define DF_P1_LAZYLOAD 0x1
#define DF_P1_GROUPPERM 0x2
/*
* DT_FLAGS_1 values
*/
#define DF_1_NOW 0x00000001
#define DF_1_GLOBAL 0x00000002
#define DF_1_GROUP 0x00000004
#define DF_1_NODELETE 0x00000008
#define DF_1_LOADFLTR 0x00000010
#define DF_1_INITFIRST 0x00000020
#define DF_1_NOOPEN 0x00000040
#define DF_1_ORIGIN 0x00000080
#define DF_1_DIRECT 0x00000100
#define DF_1_TRANS 0x00000200
#define DF_1_INTERPOSE 0x00000400
#define DF_1_NODEFLIB 0x00000800
#define DF_1_NODUMP 0x00001000
#define DF_1_CONFALT 0x00002000
#define DF_1_ENDFILTEE 0x00004000
#define DF_1_DISPRELDNE 0x00008000
#define DF_1_DISPRELPND 0x00010000
/*
* Syminfo structure
*/
typedef struct {
Elf32_Half si_boundto;
Elf32_Half si_flags;
} Elf32_Syminfo;
#if __LIBELF64
typedef struct {
Elf64_Half si_boundto;
Elf64_Half si_flags;
} Elf64_Syminfo;
#endif /* __LIBELF64 */
/*
* Syminfo version (stored in unused first entry)
*/
#define SYMINFO_NONE 0
#define SYMINFO_CURRENT 1
#define SYMINFO_NUM 2
/*
* si_boundto special values
*/
#define SYMINFO_BT_LOWRESERVE 0xff00
#define SYMINFO_BT_PARENT 0xfffe /* bound to parent */
#define SYMINFO_BT_SELF 0xffff /* bound to self */
/*
* si_flags
*/
#define SYMINFO_FLG_DIRECT 0x01 /* bound to an object */
#define SYMINFO_FLG_PASSTHRU 0x02 /* pass-thru symbol */
#define SYMINFO_FLG_COPY 0x04 /* result of a copy relocation */
#define SYMINFO_FLG_LAZYLOAD 0x08 /* bound to lazy-loaded object */
/*
* Version definitions
*/
typedef struct {
Elf32_Half vd_version;
Elf32_Half vd_flags;
Elf32_Half vd_ndx;
Elf32_Half vd_cnt;
Elf32_Word vd_hash;
Elf32_Word vd_aux;
Elf32_Word vd_next;
} Elf32_Verdef;
typedef struct {
Elf32_Word vda_name;
Elf32_Word vda_next;
} Elf32_Verdaux;
typedef struct {
Elf32_Half vn_version;
Elf32_Half vn_cnt;
Elf32_Word vn_file;
Elf32_Word vn_aux;
Elf32_Word vn_next;
} Elf32_Verneed;
typedef struct {
Elf32_Word vna_hash;
Elf32_Half vna_flags;
Elf32_Half vna_other;
Elf32_Word vna_name;
Elf32_Word vna_next;
} Elf32_Vernaux;
typedef Elf32_Half Elf32_Versym;
#if __LIBELF64
typedef struct {
Elf64_Half vd_version;
Elf64_Half vd_flags;
Elf64_Half vd_ndx;
Elf64_Half vd_cnt;
Elf64_Word vd_hash;
Elf64_Word vd_aux;
Elf64_Word vd_next;
} Elf64_Verdef;
typedef struct {
Elf64_Word vda_name;
Elf64_Word vda_next;
} Elf64_Verdaux;
typedef struct {
Elf64_Half vn_version;
Elf64_Half vn_cnt;
Elf64_Word vn_file;
Elf64_Word vn_aux;
Elf64_Word vn_next;
} Elf64_Verneed;
typedef struct {
Elf64_Word vna_hash;
Elf64_Half vna_flags;
Elf64_Half vna_other;
Elf64_Word vna_name;
Elf64_Word vna_next;
} Elf64_Vernaux;
typedef Elf64_Half Elf64_Versym;
#endif /* __LIBELF64 */
/*
* vd_version
*/
#define VER_DEF_NONE 0
#define VER_DEF_CURRENT 1
#define VER_DEF_NUM 2
/*
* vn_version
*/
#define VER_NEED_NONE 0
#define VER_NEED_CURRENT 1
#define VER_NEED_NUM 2
/*
* vd_flags / vna_flags
*/
#define VER_FLG_BASE 0x1 /* vd_flags only */
#define VER_FLG_WEAK 0x2
/*
* Elf*_Versym special values
*/
#define VER_NDX_LOCAL 0
#define VER_NDX_GLOBAL 1
/*
* Solaris extensions
*/
/*
* Move section
*/
#if __LIBELF64
typedef struct {
Elf32_Lword m_value;
Elf32_Word m_info;
Elf32_Word m_poffset;
Elf32_Half m_repeat;
Elf32_Half m_stride;
} Elf32_Move;
typedef struct {
Elf64_Lword m_value;
Elf64_Xword m_info;
Elf64_Xword m_poffset;
Elf64_Half m_repeat;
Elf64_Half m_stride;
} Elf64_Move;
#define ELF32_M_SYM(info) ((info)>>8)
#define ELF32_M_SIZE(info) ((unsigned char)(info))
#define ELF32_M_INFO(sym, sz) (((sym)<<8)+(unsigned char)(sz))
#define ELF64_M_SYM(info) ((Elf64_Xword)(info)>>8)
#define ELF64_M_SIZE(info) ((unsigned char)(info))
#define ELF64_M_INFO(sym, sz) (((Elf64_Xword)(sym)<<8)+(unsigned char)(sz))
#endif /* __LIBELF64 */
/*
* Capabilities
*/
typedef struct {
Elf32_Word c_tag;
union {
Elf32_Word c_val;
Elf32_Addr c_ptr;
} c_un;
} Elf32_Cap;
#if __LIBELF64
typedef struct {
Elf64_Xword c_tag;
union {
Elf64_Xword c_val;
Elf64_Addr c_ptr;
} c_un;
} Elf64_Cap;
#endif /* __LIBELF64 */
#define CA_SUNW_NULL 0 /* c_un ignored */
#define CA_SUNW_HW_1 1 /* c_un.c_val */
#define CA_SUNW_SF_1 2 /* c_un.c_val */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* _ELF_REPL_H */

View File

@ -1,100 +0,0 @@
/*
* errors.h - exhaustive list of all error codes and messages for libelf.
* Copyright (C) 1995 - 2003, 2006 Michael Riepe
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/* @(#) $Id: errors.h,v 1.18 2008/05/23 08:15:34 michael Exp $ */
/* dummy for xgettext */
#define _(str) str
__err__(ERROR_OK, _("no error"))
__err__(ERROR_UNKNOWN, _("unknown error"))
__err__(ERROR_INTERNAL, _("Internal error: unknown reason"))
__err__(ERROR_UNIMPLEMENTED, _("Internal error: not implemented"))
__err__(ERROR_WRONLY, _("Request error: cntl(ELF_C_FDREAD) on write-only file"))
__err__(ERROR_INVALID_CMD, _("Request error: invalid ELF_C_* argument"))
__err__(ERROR_FDDISABLED, _("Request error: file descriptor disabled"))
__err__(ERROR_NOTARCHIVE, _("Request error: not an archive"))
__err__(ERROR_BADOFF, _("Request error: offset out of range"))
__err__(ERROR_UNKNOWN_VERSION, _("Request error: unknown ELF version"))
__err__(ERROR_CMDMISMATCH, _("Request error: ELF_C_* argument does not match"))
__err__(ERROR_MEMBERWRITE, _("Request error: archive member begin() for writing"))
__err__(ERROR_FDMISMATCH, _("Request error: archive/member file descriptor mismatch"))
__err__(ERROR_NOTELF, _("Request error: not an ELF file"))
__err__(ERROR_CLASSMISMATCH, _("Request error: class file/memory mismatch"))
__err__(ERROR_UNKNOWN_TYPE, _("Request error: invalid ELF_T_* argument"))
__err__(ERROR_UNKNOWN_ENCODING, _("Request error: unknown data encoding"))
__err__(ERROR_DST2SMALL, _("Request error: destination buffer too small"))
__err__(ERROR_NULLBUF, _("Request error: d_buf is NULL"))
__err__(ERROR_UNKNOWN_CLASS, _("Request error: unknown ELF class"))
__err__(ERROR_ELFSCNMISMATCH, _("Request error: section does not belong to file"))
__err__(ERROR_NOSUCHSCN, _("Request error: no section at index"))
__err__(ERROR_NULLSCN, _("Request error: can't manipulate null section"))
__err__(ERROR_SCNDATAMISMATCH, _("Request error: data does not belong to section"))
__err__(ERROR_NOSTRTAB, _("Request error: no string table"))
__err__(ERROR_BADSTROFF, _("Request error: string table offset out of range"))
__err__(ERROR_RDONLY, _("Request error: update(ELF_C_WRITE) on read-only file"))
__err__(ERROR_IO_SEEK, _("I/O error: seek"))
__err__(ERROR_IO_2BIG, _("I/O error: file too big for memory"))
__err__(ERROR_IO_READ, _("I/O error: raw read"))
__err__(ERROR_IO_GETSIZE, _("I/O error: get file size"))
__err__(ERROR_IO_WRITE, _("I/O error: output write"))
__err__(ERROR_IO_TRUNC, _("I/O error: can't truncate output file"))
__err__(ERROR_VERSION_UNSET, _("Sequence error: must set ELF version first"))
__err__(ERROR_NOEHDR, _("Sequence error: must create ELF header first"))
__err__(ERROR_OUTSIDE, _("Format error: reference outside file"))
__err__(ERROR_TRUNC_ARHDR, _("Format error: archive header truncated"))
__err__(ERROR_ARFMAG, _("Format error: archive fmag"))
__err__(ERROR_ARHDR, _("Format error: archive header"))
__err__(ERROR_TRUNC_MEMBER, _("Format error: archive member truncated"))
__err__(ERROR_SIZE_ARSYMTAB, _("Format error: archive symbol table size"))
__err__(ERROR_ARSTRTAB, _("Format error: archive string table"))
__err__(ERROR_ARSPECIAL, _("Format error: archive special name unknown"))
__err__(ERROR_TRUNC_EHDR, _("Format error: ELF header truncated"))
__err__(ERROR_TRUNC_PHDR, _("Format error: program header table truncated"))
__err__(ERROR_TRUNC_SHDR, _("Format error: section header table truncated"))
__err__(ERROR_TRUNC_SCN, _("Format error: data region truncated"))
__err__(ERROR_ALIGN_PHDR, _("Format error: program header table alignment"))
__err__(ERROR_ALIGN_SHDR, _("Format error: section header table alignment"))
__err__(ERROR_VERDEF_FORMAT, _("Format error: bad parameter in Verdef record"))
__err__(ERROR_VERDEF_VERSION, _("Format error: unknown Verdef version"))
__err__(ERROR_VERNEED_FORMAT, _("Format error: bad parameter in Verneed record"))
__err__(ERROR_VERNEED_VERSION, _("Format error: unknown Verneed version"))
__err__(ERROR_EHDR_SHNUM, _("Format error: bad e_shnum value"))
__err__(ERROR_EHDR_SHENTSIZE, _("Format error: bad e_shentsize value"))
__err__(ERROR_EHDR_PHENTSIZE, _("Format error: bad e_phentsize value"))
__err__(ERROR_UNTERM, _("Format error: unterminated string in string table"))
__err__(ERROR_SCN2SMALL, _("Layout error: section size too small for data"))
__err__(ERROR_SCN_OVERLAP, _("Layout error: overlapping sections"))
__err__(ERROR_MEM_ELF, _("Memory error: elf descriptor"))
__err__(ERROR_MEM_ARSYMTAB, _("Memory error: archive symbol table"))
__err__(ERROR_MEM_ARHDR, _("Memory error: archive member header"))
__err__(ERROR_MEM_EHDR, _("Memory error: ELF header"))
__err__(ERROR_MEM_PHDR, _("Memory error: program header table"))
__err__(ERROR_MEM_SHDR, _("Memory error: section header table"))
__err__(ERROR_MEM_SCN, _("Memory error: section descriptor"))
__err__(ERROR_MEM_SCNDATA, _("Memory error: section data"))
__err__(ERROR_MEM_OUTBUF, _("Memory error: output file space"))
__err__(ERROR_MEM_TEMPORARY, _("Memory error: temporary buffer"))
__err__(ERROR_BADVALUE, _("GElf error: value out of range"))
__err__(ERROR_BADINDEX, _("GElf error: index out of range"))
__err__(ERROR_BADTYPE, _("GElf error: type mismatch"))
__err__(ERROR_MEM_SYM, _("GElf error: not enough memory for GElf_Sym"))
__err__(ERROR_MEM_DYN, _("GElf error: not enough memory for GElf_Dyn"))
__err__(ERROR_MEM_RELA, _("GElf error: not enough memory for GElf_Rela"))
__err__(ERROR_MEM_REL, _("GElf error: not enough memory for GElf_Rel"))

View File

@ -1,334 +0,0 @@
/*
ext_types.h - external representation of ELF data types.
Copyright (C) 1995 - 1998 Michael Riepe
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/* @(#) $Id: ext_types.h,v 1.9 2008/05/23 08:15:34 michael Exp $ */
#ifndef _EXT_TYPES_H
#define _EXT_TYPES_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*
* Scalar data types
*/
typedef unsigned char __ext_Elf32_Addr [ELF32_FSZ_ADDR];
typedef unsigned char __ext_Elf32_Half [ELF32_FSZ_HALF];
typedef unsigned char __ext_Elf32_Off [ELF32_FSZ_OFF];
typedef unsigned char __ext_Elf32_Sword [ELF32_FSZ_SWORD];
typedef unsigned char __ext_Elf32_Word [ELF32_FSZ_WORD];
#if __LIBELF64
typedef unsigned char __ext_Elf32_Lword [8];
typedef unsigned char __ext_Elf64_Addr [ELF64_FSZ_ADDR];
typedef unsigned char __ext_Elf64_Half [ELF64_FSZ_HALF];
typedef unsigned char __ext_Elf64_Off [ELF64_FSZ_OFF];
typedef unsigned char __ext_Elf64_Sword [ELF64_FSZ_SWORD];
typedef unsigned char __ext_Elf64_Word [ELF64_FSZ_WORD];
typedef unsigned char __ext_Elf64_Sxword[ELF64_FSZ_SXWORD];
typedef unsigned char __ext_Elf64_Xword [ELF64_FSZ_XWORD];
typedef unsigned char __ext_Elf64_Lword [8];
#endif /* __LIBELF64 */
/*
* ELF header
*/
typedef struct {
unsigned char e_ident[EI_NIDENT];
__ext_Elf32_Half e_type;
__ext_Elf32_Half e_machine;
__ext_Elf32_Word e_version;
__ext_Elf32_Addr e_entry;
__ext_Elf32_Off e_phoff;
__ext_Elf32_Off e_shoff;
__ext_Elf32_Word e_flags;
__ext_Elf32_Half e_ehsize;
__ext_Elf32_Half e_phentsize;
__ext_Elf32_Half e_phnum;
__ext_Elf32_Half e_shentsize;
__ext_Elf32_Half e_shnum;
__ext_Elf32_Half e_shstrndx;
} __ext_Elf32_Ehdr;
#if __LIBELF64
typedef struct {
unsigned char e_ident[EI_NIDENT];
__ext_Elf64_Half e_type;
__ext_Elf64_Half e_machine;
__ext_Elf64_Word e_version;
__ext_Elf64_Addr e_entry;
__ext_Elf64_Off e_phoff;
__ext_Elf64_Off e_shoff;
__ext_Elf64_Word e_flags;
__ext_Elf64_Half e_ehsize;
__ext_Elf64_Half e_phentsize;
__ext_Elf64_Half e_phnum;
__ext_Elf64_Half e_shentsize;
__ext_Elf64_Half e_shnum;
__ext_Elf64_Half e_shstrndx;
} __ext_Elf64_Ehdr;
#endif /* __LIBELF64 */
/*
* Section header
*/
typedef struct {
__ext_Elf32_Word sh_name;
__ext_Elf32_Word sh_type;
__ext_Elf32_Word sh_flags;
__ext_Elf32_Addr sh_addr;
__ext_Elf32_Off sh_offset;
__ext_Elf32_Word sh_size;
__ext_Elf32_Word sh_link;
__ext_Elf32_Word sh_info;
__ext_Elf32_Word sh_addralign;
__ext_Elf32_Word sh_entsize;
} __ext_Elf32_Shdr;
#if __LIBELF64
typedef struct {
__ext_Elf64_Word sh_name;
__ext_Elf64_Word sh_type;
__ext_Elf64_Xword sh_flags;
__ext_Elf64_Addr sh_addr;
__ext_Elf64_Off sh_offset;
__ext_Elf64_Xword sh_size;
__ext_Elf64_Word sh_link;
__ext_Elf64_Word sh_info;
__ext_Elf64_Xword sh_addralign;
__ext_Elf64_Xword sh_entsize;
} __ext_Elf64_Shdr;
#endif /* __LIBELF64 */
/*
* Symbol table
*/
typedef struct {
__ext_Elf32_Word st_name;
__ext_Elf32_Addr st_value;
__ext_Elf32_Word st_size;
unsigned char st_info;
unsigned char st_other;
__ext_Elf32_Half st_shndx;
} __ext_Elf32_Sym;
#if __LIBELF64
typedef struct {
__ext_Elf64_Word st_name;
unsigned char st_info;
unsigned char st_other;
__ext_Elf64_Half st_shndx;
__ext_Elf64_Addr st_value;
__ext_Elf64_Xword st_size;
} __ext_Elf64_Sym;
#endif /* __LIBELF64 */
/*
* Relocation
*/
typedef struct {
__ext_Elf32_Addr r_offset;
__ext_Elf32_Word r_info;
} __ext_Elf32_Rel;
typedef struct {
__ext_Elf32_Addr r_offset;
__ext_Elf32_Word r_info;
__ext_Elf32_Sword r_addend;
} __ext_Elf32_Rela;
#if __LIBELF64
typedef struct {
__ext_Elf64_Addr r_offset;
#if __LIBELF64_IRIX
__ext_Elf64_Word r_sym;
unsigned char r_ssym;
unsigned char r_type3;
unsigned char r_type2;
unsigned char r_type;
#else /* __LIBELF64_IRIX */
__ext_Elf64_Xword r_info;
#endif /* __LIBELF64_IRIX */
} __ext_Elf64_Rel;
typedef struct {
__ext_Elf64_Addr r_offset;
#if __LIBELF64_IRIX
__ext_Elf64_Word r_sym;
unsigned char r_ssym;
unsigned char r_type3;
unsigned char r_type2;
unsigned char r_type;
#else /* __LIBELF64_IRIX */
__ext_Elf64_Xword r_info;
#endif /* __LIBELF64_IRIX */
__ext_Elf64_Sxword r_addend;
} __ext_Elf64_Rela;
#endif /* __LIBELF64 */
/*
* Program header
*/
typedef struct {
__ext_Elf32_Word p_type;
__ext_Elf32_Off p_offset;
__ext_Elf32_Addr p_vaddr;
__ext_Elf32_Addr p_paddr;
__ext_Elf32_Word p_filesz;
__ext_Elf32_Word p_memsz;
__ext_Elf32_Word p_flags;
__ext_Elf32_Word p_align;
} __ext_Elf32_Phdr;
#if __LIBELF64
typedef struct {
__ext_Elf64_Word p_type;
__ext_Elf64_Word p_flags;
__ext_Elf64_Off p_offset;
__ext_Elf64_Addr p_vaddr;
__ext_Elf64_Addr p_paddr;
__ext_Elf64_Xword p_filesz;
__ext_Elf64_Xword p_memsz;
__ext_Elf64_Xword p_align;
} __ext_Elf64_Phdr;
#endif /* __LIBELF64 */
/*
* Dynamic structure
*/
typedef struct {
__ext_Elf32_Sword d_tag;
union {
__ext_Elf32_Word d_val;
__ext_Elf32_Addr d_ptr;
} d_un;
} __ext_Elf32_Dyn;
#if __LIBELF64
typedef struct {
__ext_Elf64_Sxword d_tag;
union {
__ext_Elf64_Xword d_val;
__ext_Elf64_Addr d_ptr;
} d_un;
} __ext_Elf64_Dyn;
#endif /* __LIBELF64 */
/*
* Version definitions
*/
typedef struct {
__ext_Elf32_Half vd_version;
__ext_Elf32_Half vd_flags;
__ext_Elf32_Half vd_ndx;
__ext_Elf32_Half vd_cnt;
__ext_Elf32_Word vd_hash;
__ext_Elf32_Word vd_aux;
__ext_Elf32_Word vd_next;
} __ext_Elf32_Verdef;
typedef struct {
__ext_Elf32_Word vda_name;
__ext_Elf32_Word vda_next;
} __ext_Elf32_Verdaux;
typedef struct {
__ext_Elf32_Half vn_version;
__ext_Elf32_Half vn_cnt;
__ext_Elf32_Word vn_file;
__ext_Elf32_Word vn_aux;
__ext_Elf32_Word vn_next;
} __ext_Elf32_Verneed;
typedef struct {
__ext_Elf32_Word vna_hash;
__ext_Elf32_Half vna_flags;
__ext_Elf32_Half vna_other;
__ext_Elf32_Word vna_name;
__ext_Elf32_Word vna_next;
} __ext_Elf32_Vernaux;
#if __LIBELF64
typedef struct {
__ext_Elf64_Half vd_version;
__ext_Elf64_Half vd_flags;
__ext_Elf64_Half vd_ndx;
__ext_Elf64_Half vd_cnt;
__ext_Elf64_Word vd_hash;
__ext_Elf64_Word vd_aux;
__ext_Elf64_Word vd_next;
} __ext_Elf64_Verdef;
typedef struct {
__ext_Elf64_Word vda_name;
__ext_Elf64_Word vda_next;
} __ext_Elf64_Verdaux;
typedef struct {
__ext_Elf64_Half vn_version;
__ext_Elf64_Half vn_cnt;
__ext_Elf64_Word vn_file;
__ext_Elf64_Word vn_aux;
__ext_Elf64_Word vn_next;
} __ext_Elf64_Verneed;
typedef struct {
__ext_Elf64_Word vna_hash;
__ext_Elf64_Half vna_flags;
__ext_Elf64_Half vna_other;
__ext_Elf64_Word vna_name;
__ext_Elf64_Word vna_next;
} __ext_Elf64_Vernaux;
#endif /* __LIBELF64 */
/*
* Move section
*/
#if __LIBELF64
typedef struct {
__ext_Elf32_Lword m_value;
__ext_Elf32_Word m_info;
__ext_Elf32_Word m_poffset;
__ext_Elf32_Half m_repeat;
__ext_Elf32_Half m_stride;
} __ext_Elf32_Move;
typedef struct {
__ext_Elf64_Lword m_value;
__ext_Elf64_Xword m_info;
__ext_Elf64_Xword m_poffset;
__ext_Elf64_Half m_repeat;
__ext_Elf64_Half m_stride;
} __ext_Elf64_Move;
#endif /* __LIBELF64 */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* _EXT_TYPES_H */

View File

@ -1,155 +0,0 @@
/*
* gelf.h - public header file for libelf.
* Copyright (C) 2000 - 2006 Michael Riepe
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/* @(#) $Id: gelf.h,v 1.16 2008/05/23 08:15:34 michael Exp $ */
#ifndef _GELF_H
#define _GELF_H
#if __LIBELF_INTERNAL__
#include <libelf.h>
#else /* __LIBELF_INTERNAL__ */
#include <libelf/libelf.h>
#endif /* __LIBELF_INTERNAL__ */
#if __LIBELF_NEED_LINK_H
#include <link.h>
#elif __LIBELF_NEED_SYS_LINK_H
#include <sys/link.h>
#endif /* __LIBELF_NEED_LINK_H */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#ifndef __P
# if (__STDC__ + 0) || defined(__cplusplus) || defined(_WIN32)
# define __P(args) args
# else /* __STDC__ || defined(__cplusplus) */
# define __P(args) ()
# endif /* __STDC__ || defined(__cplusplus) */
#endif /* __P */
#if !__LIBELF64
#error "GElf is not supported on this system."
#else /* __LIBELF64 */
typedef Elf64_Addr GElf_Addr;
typedef Elf64_Half GElf_Half;
typedef Elf64_Off GElf_Off;
typedef Elf64_Sword GElf_Sword;
typedef Elf64_Word GElf_Word;
typedef Elf64_Sxword GElf_Sxword;
typedef Elf64_Xword GElf_Xword;
typedef Elf64_Ehdr GElf_Ehdr;
typedef Elf64_Phdr GElf_Phdr;
typedef Elf64_Shdr GElf_Shdr;
typedef Elf64_Dyn GElf_Dyn;
typedef Elf64_Rel GElf_Rel;
typedef Elf64_Rela GElf_Rela;
typedef Elf64_Sym GElf_Sym;
/*
* Symbol versioning
*/
#if __LIBELF_SYMBOL_VERSIONS
typedef Elf64_Verdef GElf_Verdef;
typedef Elf64_Verneed GElf_Verneed;
typedef Elf64_Verdaux GElf_Verdaux;
typedef Elf64_Vernaux GElf_Vernaux;
#endif /* __LIBELF_SYMBOL_VERSIONS */
/*
* These types aren't implemented (yet)
*
typedef Elf64_Move GElf_Move;
typedef Elf64_Syminfo GElf_Syminfo;
*/
/*
* Generic macros
*/
#define GELF_ST_BIND ELF64_ST_BIND
#define GELF_ST_TYPE ELF64_ST_TYPE
#define GELF_ST_INFO ELF64_ST_INFO
#define GELF_R_TYPE ELF64_R_TYPE
#define GELF_R_SYM ELF64_R_SYM
#define GELF_R_INFO ELF64_R_INFO
/*
* Function declarations
*/
extern int gelf_getclass __P((Elf *__elf));
extern size_t gelf_fsize __P((Elf *__elf, Elf_Type __type, size_t __count, unsigned __ver));
extern Elf_Data *gelf_xlatetof __P((Elf *__elf, Elf_Data *__dst, const Elf_Data *__src, unsigned __encode));
extern Elf_Data *gelf_xlatetom __P((Elf *__elf, Elf_Data *__dst, const Elf_Data *__src, unsigned __encode));
extern GElf_Ehdr *gelf_getehdr __P((Elf *__elf, GElf_Ehdr *__dst));
extern int gelf_update_ehdr __P((Elf *__elf, GElf_Ehdr *__src));
extern unsigned long gelf_newehdr __P((Elf *__elf, int __elfclass));
extern GElf_Phdr *gelf_getphdr __P((Elf *__elf, int ndx, GElf_Phdr *__dst));
extern int gelf_update_phdr __P((Elf *__elf, int ndx, GElf_Phdr *__src));
extern unsigned long gelf_newphdr __P((Elf *__elf, size_t __phnum));
extern GElf_Shdr *gelf_getshdr __P((Elf_Scn *__scn, GElf_Shdr *__dst));
extern int gelf_update_shdr __P((Elf_Scn *__scn, GElf_Shdr *__src));
extern GElf_Dyn *gelf_getdyn __P((Elf_Data *__src, int __ndx, GElf_Dyn *__dst));
extern int gelf_update_dyn __P((Elf_Data *__dst, int __ndx, GElf_Dyn *__src));
extern GElf_Rel *gelf_getrel __P((Elf_Data *__src, int __ndx, GElf_Rel *__dst));
extern int gelf_update_rel __P((Elf_Data *__dst, int __ndx, GElf_Rel *__src));
extern GElf_Rela *gelf_getrela __P((Elf_Data *__src, int __ndx, GElf_Rela *__dst));
extern int gelf_update_rela __P((Elf_Data *__dst, int __ndx, GElf_Rela *__src));
extern GElf_Sym *gelf_getsym __P((Elf_Data *__src, int __ndx, GElf_Sym *__dst));
extern int gelf_update_sym __P((Elf_Data *__dst, int __ndx, GElf_Sym *__src));
extern long gelf_checksum __P((Elf *__elf));
/*
* These functions aren't implemented (yet)
*
extern GElf_Move *gelf_getmove __P((Elf_Data *__src, int __ndx, GElf_Move *__src));
extern int gelf_update_move __P((Elf_Data *__dst, int __ndx, GElf_Move *__src));
*
extern GElf_Syminfo* gelf_getsyminfo __P((Elf_Data *__src, int __ndx, GElf_Syminfo *__dst));
extern int gelf_update_syminfo __P((Elf_Data *__dst, int __ndx, GElf_Syminfo *__src));
*/
/*
* Extensions (not available in other versions of libelf)
*/
extern size_t gelf_msize __P((Elf *__elf, Elf_Type __type, size_t __count, unsigned __ver));
#endif /* __LIBELF64 */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* _GELF_H */

View File

@ -1,305 +0,0 @@
/*
* libelf.h - public header file for libelf.
* Copyright (C) 1995 - 2008 Michael Riepe
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/* @(#) $Id: libelf.h,v 1.29 2009/07/07 17:57:43 michael Exp $ */
#ifndef _LIBELF_H
#define _LIBELF_H
#include <stddef.h> /* for size_t */
#include <sys/types.h>
#if __LIBELF_INTERNAL__
#include <sys_elf.h>
#else /* __LIBELF_INTERNAL__ */
#include <libelf/sys_elf.h>
#endif /* __LIBELF_INTERNAL__ */
#if defined __GNUC__ && !defined __cplusplus
#define DEPRECATED __attribute__((deprecated))
#else
#define DEPRECATED /* nothing */
#endif
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#ifndef __P
# if (__STDC__ + 0) || defined(__cplusplus) || defined(_WIN32)
# define __P(args) args
# else /* __STDC__ || defined(__cplusplus) */
# define __P(args) ()
# endif /* __STDC__ || defined(__cplusplus) */
#endif /* __P */
/*
* Commands
*/
typedef enum {
ELF_C_NULL = 0, /* must be first, 0 */
ELF_C_READ,
ELF_C_WRITE,
ELF_C_CLR,
ELF_C_SET,
ELF_C_FDDONE,
ELF_C_FDREAD,
ELF_C_RDWR,
ELF_C_NUM /* must be last */
} Elf_Cmd;
/*
* Flags
*/
#define ELF_F_DIRTY 0x1
#define ELF_F_LAYOUT 0x4
/*
* Allow sections to overlap when ELF_F_LAYOUT is in effect.
* Note that this flag ist NOT portable, and that it may render
* the output file unusable. Use with extreme caution!
*/
#define ELF_F_LAYOUT_OVERLAP 0x10000000
/*
* File types
*/
typedef enum {
ELF_K_NONE = 0, /* must be first, 0 */
ELF_K_AR,
ELF_K_COFF,
ELF_K_ELF,
ELF_K_NUM /* must be last */
} Elf_Kind;
/*
* Data types
*/
typedef enum {
ELF_T_BYTE = 0, /* must be first, 0 */
ELF_T_ADDR,
ELF_T_DYN,
ELF_T_EHDR,
ELF_T_HALF,
ELF_T_OFF,
ELF_T_PHDR,
ELF_T_RELA,
ELF_T_REL,
ELF_T_SHDR,
ELF_T_SWORD,
ELF_T_SYM,
ELF_T_WORD,
/*
* New stuff for 64-bit.
*
* Most implementations add ELF_T_SXWORD after ELF_T_SWORD
* which breaks binary compatibility with earlier versions.
* If this causes problems for you, contact me.
*/
ELF_T_SXWORD,
ELF_T_XWORD,
/*
* Symbol versioning. Sun broke binary compatibility (again!),
* but I won't.
*/
ELF_T_VDEF,
ELF_T_VNEED,
ELF_T_NUM /* must be last */
} Elf_Type;
/*
* Elf descriptor
*/
typedef struct Elf Elf;
/*
* Section descriptor
*/
typedef struct Elf_Scn Elf_Scn;
/*
* Archive member header
*/
typedef struct {
char* ar_name;
time_t ar_date;
long ar_uid;
long ar_gid;
unsigned long ar_mode;
off_t ar_size;
char* ar_rawname;
} Elf_Arhdr;
/*
* Archive symbol table
*/
typedef struct {
char* as_name;
size_t as_off;
unsigned long as_hash;
} Elf_Arsym;
/*
* Data descriptor
*/
typedef struct {
void* d_buf;
Elf_Type d_type;
size_t d_size;
off_t d_off;
size_t d_align;
unsigned d_version;
} Elf_Data;
/*
* Function declarations
*/
extern Elf *elf_begin __P((int __fd, Elf_Cmd __cmd, Elf *__ref));
extern Elf *elf_memory __P((char *__image, size_t __size));
extern int elf_cntl __P((Elf *__elf, Elf_Cmd __cmd));
extern int elf_end __P((Elf *__elf));
extern const char *elf_errmsg __P((int __err));
extern int elf_errno __P((void));
extern void elf_fill __P((int __fill));
extern unsigned elf_flagdata __P((Elf_Data *__data, Elf_Cmd __cmd,
unsigned __flags));
extern unsigned elf_flagehdr __P((Elf *__elf, Elf_Cmd __cmd,
unsigned __flags));
extern unsigned elf_flagelf __P((Elf *__elf, Elf_Cmd __cmd,
unsigned __flags));
extern unsigned elf_flagphdr __P((Elf *__elf, Elf_Cmd __cmd,
unsigned __flags));
extern unsigned elf_flagscn __P((Elf_Scn *__scn, Elf_Cmd __cmd,
unsigned __flags));
extern unsigned elf_flagshdr __P((Elf_Scn *__scn, Elf_Cmd __cmd,
unsigned __flags));
extern size_t elf32_fsize __P((Elf_Type __type, size_t __count,
unsigned __ver));
extern Elf_Arhdr *elf_getarhdr __P((Elf *__elf));
extern Elf_Arsym *elf_getarsym __P((Elf *__elf, size_t *__ptr));
extern off_t elf_getbase __P((Elf *__elf));
extern Elf_Data *elf_getdata __P((Elf_Scn *__scn, Elf_Data *__data));
extern Elf32_Ehdr *elf32_getehdr __P((Elf *__elf));
extern char *elf_getident __P((Elf *__elf, size_t *__ptr));
extern Elf32_Phdr *elf32_getphdr __P((Elf *__elf));
extern Elf_Scn *elf_getscn __P((Elf *__elf, size_t __index));
extern Elf32_Shdr *elf32_getshdr __P((Elf_Scn *__scn));
extern unsigned long elf_hash __P((const unsigned char *__name));
extern Elf_Kind elf_kind __P((Elf *__elf));
extern size_t elf_ndxscn __P((Elf_Scn *__scn));
extern Elf_Data *elf_newdata __P((Elf_Scn *__scn));
extern Elf32_Ehdr *elf32_newehdr __P((Elf *__elf));
extern Elf32_Phdr *elf32_newphdr __P((Elf *__elf, size_t __count));
extern Elf_Scn *elf_newscn __P((Elf *__elf));
extern Elf_Cmd elf_next __P((Elf *__elf));
extern Elf_Scn *elf_nextscn __P((Elf *__elf, Elf_Scn *__scn));
extern size_t elf_rand __P((Elf *__elf, size_t __offset));
extern Elf_Data *elf_rawdata __P((Elf_Scn *__scn, Elf_Data *__data));
extern char *elf_rawfile __P((Elf *__elf, size_t *__ptr));
extern char *elf_strptr __P((Elf *__elf, size_t __section, size_t __offset));
extern off_t elf_update __P((Elf *__elf, Elf_Cmd __cmd));
extern unsigned elf_version __P((unsigned __ver));
extern Elf_Data *elf32_xlatetof __P((Elf_Data *__dst, const Elf_Data *__src,
unsigned __encode));
extern Elf_Data *elf32_xlatetom __P((Elf_Data *__dst, const Elf_Data *__src,
unsigned __encode));
/*
* Additional functions found on Solaris
*/
extern long elf32_checksum __P((Elf *__elf));
#if __LIBELF64
/*
* 64-bit ELF functions
* Not available on all platforms
*/
extern Elf64_Ehdr *elf64_getehdr __P((Elf *__elf));
extern Elf64_Ehdr *elf64_newehdr __P((Elf *__elf));
extern Elf64_Phdr *elf64_getphdr __P((Elf *__elf));
extern Elf64_Phdr *elf64_newphdr __P((Elf *__elf, size_t __count));
extern Elf64_Shdr *elf64_getshdr __P((Elf_Scn *__scn));
extern size_t elf64_fsize __P((Elf_Type __type, size_t __count,
unsigned __ver));
extern Elf_Data *elf64_xlatetof __P((Elf_Data *__dst, const Elf_Data *__src,
unsigned __encode));
extern Elf_Data *elf64_xlatetom __P((Elf_Data *__dst, const Elf_Data *__src,
unsigned __encode));
/*
* Additional functions found on Solaris
*/
extern long elf64_checksum __P((Elf *__elf));
#endif /* __LIBELF64 */
/*
* ELF format extensions
*
* These functions return 0 on failure, 1 on success. Since other
* implementations of libelf may behave differently (there was quite
* some confusion about the correct values), they are now officially
* deprecated and should be replaced with the three new functions below.
*/
DEPRECATED extern int elf_getphnum __P((Elf *__elf, size_t *__resultp));
DEPRECATED extern int elf_getshnum __P((Elf *__elf, size_t *__resultp));
DEPRECATED extern int elf_getshstrndx __P((Elf *__elf, size_t *__resultp));
/*
* Replacement functions (return -1 on failure, 0 on success).
*/
extern int elf_getphdrnum __P((Elf *__elf, size_t *__resultp));
extern int elf_getshdrnum __P((Elf *__elf, size_t *__resultp));
extern int elf_getshdrstrndx __P((Elf *__elf, size_t *__resultp));
/*
* Convenience functions
*
* elfx_update_shstrndx is elf_getshstrndx's counterpart.
* It should be used to set the e_shstrndx member.
* There is no update function for e_shnum or e_phnum
* because libelf handles them internally.
*/
extern int elfx_update_shstrndx __P((Elf *__elf, size_t __index));
/*
* Experimental extensions:
*
* elfx_movscn() moves section `__scn' directly after section `__after'.
* elfx_remscn() removes section `__scn'. Both functions update
* the section indices; elfx_remscn() also adjusts the ELF header's
* e_shnum member. The application is responsible for updating other
* data (in particular, e_shstrndx and the section headers' sh_link and
* sh_info members).
*
* elfx_movscn() returns the new index of the moved section.
* elfx_remscn() returns the original index of the removed section.
* A return value of zero indicates an error.
*/
extern size_t elfx_movscn __P((Elf *__elf, Elf_Scn *__scn, Elf_Scn *__after));
extern size_t elfx_remscn __P((Elf *__elf, Elf_Scn *__scn));
/*
* elf_delscn() is obsolete. Please use elfx_remscn() instead.
*/
extern size_t elf_delscn __P((Elf *__elf, Elf_Scn *__scn));
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* _LIBELF_H */

View File

@ -1,48 +0,0 @@
/*
* nlist.h - public header file for nlist(3).
* Copyright (C) 1995 - 2006 Michael Riepe
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/* @(#) $Id: nlist.h,v 1.10 2008/05/23 08:15:35 michael Exp $ */
#ifndef _NLIST_H
#define _NLIST_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
struct nlist {
char* n_name;
long n_value;
short n_scnum;
unsigned short n_type;
char n_sclass;
char n_numaux;
};
#if (__STDC__ + 0) || defined(__cplusplus) || defined(_WIN32)
extern int nlist(const char *__filename, struct nlist *__nl);
#else /* __STDC__ || defined(__cplusplus) */
extern int nlist();
#endif /* __STDC__ || defined(__cplusplus) */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* _NLIST_H */

View File

@ -1,130 +0,0 @@
/*
* lib/sys_elf.h.w32 - internal configuration file for W32 port
* Copyright (C) 2004 - 2006 Michael Riepe
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library 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
*
* @(#) $Id: sys_elf.h.w32,v 1.2 2006/09/07 15:55:42 michael Exp $
*/
/*
* DO NOT USE THIS IN APPLICATIONS - #include <libelf.h> INSTEAD!
*/
/* Define to `<elf.h>' or `<sys/elf.h>' if one of them is present */
#undef __LIBELF_HEADER_ELF_H
/* Define if Elf32_Dyn is declared in <link.h> */
#undef __LIBELF_NEED_LINK_H
/* Define if Elf32_Dyn is declared in <sys/link.h> */
#undef __LIBELF_NEED_SYS_LINK_H
/* Define if you want 64-bit support (and your system supports it) */
#define __LIBELF64 1
/* Define if you want 64-bit support, and are running IRIX */
#undef __LIBELF64_IRIX
/* Define if you want 64-bit support, and are running Linux */
#undef __LIBELF64_LINUX
/* Define if you want symbol versioning (and your system supports it) */
#define __LIBELF_SYMBOL_VERSIONS 1
/* Define to a 64-bit signed integer type if one exists */
#define __libelf_i64_t __int64
/* Define to a 64-bit unsigned integer type if one exists */
#define __libelf_u64_t unsigned __int64
/* Define to a 32-bit signed integer type if one exists */
#define __libelf_i32_t int
/* Define to a 32-bit unsigned integer type if one exists */
#define __libelf_u32_t unsigned int
/* Define to a 16-bit signed integer type if one exists */
#define __libelf_i16_t short int
/* Define to a 16-bit unsigned integer type if one exists */
#define __libelf_u16_t unsigned short int
/*
* Ok, now get the correct instance of elf.h...
*/
#ifdef __LIBELF_HEADER_ELF_H
# include __LIBELF_HEADER_ELF_H
#else /* __LIBELF_HEADER_ELF_H */
# if __LIBELF_INTERNAL__
# include <elf_repl.h>
# else /* __LIBELF_INTERNAL__ */
# include <libelf/elf_repl.h>
# endif /* __LIBELF_INTERNAL__ */
#endif /* __LIBELF_HEADER_ELF_H */
/*
* On some systems, <elf.h> is severely broken. Try to fix it.
*/
#ifdef __LIBELF_HEADER_ELF_H
# ifndef ELF32_FSZ_ADDR
# define ELF32_FSZ_ADDR 4
# define ELF32_FSZ_HALF 2
# define ELF32_FSZ_OFF 4
# define ELF32_FSZ_SWORD 4
# define ELF32_FSZ_WORD 4
# endif /* ELF32_FSZ_ADDR */
# ifndef STN_UNDEF
# define STN_UNDEF 0
# endif /* STN_UNDEF */
# if __LIBELF64
# ifndef ELF64_FSZ_ADDR
# define ELF64_FSZ_ADDR 8
# define ELF64_FSZ_HALF 2
# define ELF64_FSZ_OFF 8
# define ELF64_FSZ_SWORD 4
# define ELF64_FSZ_WORD 4
# define ELF64_FSZ_SXWORD 8
# define ELF64_FSZ_XWORD 8
# endif /* ELF64_FSZ_ADDR */
# ifndef ELF64_ST_BIND
# define ELF64_ST_BIND(i) ((i)>>4)
# define ELF64_ST_TYPE(i) ((i)&0xf)
# define ELF64_ST_INFO(b,t) (((b)<<4)+((t)&0xf))
# endif /* ELF64_ST_BIND */
# ifndef ELF64_R_SYM
# define ELF64_R_SYM(i) ((Elf64_Xword)(i)>>32)
# define ELF64_R_TYPE(i) ((i)&0xffffffffL)
# define ELF64_R_INFO(s,t) (((Elf64_Xword)(s)<<32)+((t)&0xffffffffL))
# endif /* ELF64_R_SYM */
# if __LIBELF64_LINUX
typedef __libelf_u64_t Elf64_Addr;
typedef __libelf_u16_t Elf64_Half;
typedef __libelf_u64_t Elf64_Off;
typedef __libelf_i32_t Elf64_Sword;
typedef __libelf_u32_t Elf64_Word;
typedef __libelf_i64_t Elf64_Sxword;
typedef __libelf_u64_t Elf64_Xword;
# endif /* __LIBELF64_LINUX */
# endif /* __LIBELF64 */
#endif /* __LIBELF_HEADER_ELF_H */

View File

@ -1,241 +0,0 @@
/*
* verdef.h - copy versioning information.
* Copyright (C) 2001 - 2006 Michael Riepe
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef lint
static const char verdef_h_rcsid[] = "@(#) $Id: verdef.h,v 1.13 2008/05/23 08:15:35 michael Exp $";
#endif /* lint */
#if VER_DEF_CURRENT != 1
#error libelf currently does not support VER_DEF_CURRENT != 1
#endif /* VER_DEF_CURRENT != 1 */
#if TOFILE
static void
__store_verdaux(verdaux_ftype *dst, const verdaux_mtype *src, unsigned enc) {
if (enc == ELFDATA2LSB) {
__store_u32L(dst->vda_name, src->vda_name);
__store_u32L(dst->vda_next, src->vda_next);
}
else {
__store_u32M(dst->vda_name, src->vda_name);
__store_u32M(dst->vda_next, src->vda_next);
}
}
static void
__store_verdef(verdef_ftype *dst, const verdef_mtype *src, unsigned enc) {
if (enc == ELFDATA2LSB) {
__store_u16L(dst->vd_version, src->vd_version);
__store_u16L(dst->vd_flags, src->vd_flags);
__store_u16L(dst->vd_ndx, src->vd_ndx);
__store_u16L(dst->vd_cnt, src->vd_cnt);
__store_u32L(dst->vd_hash, src->vd_hash);
__store_u32L(dst->vd_aux, src->vd_aux);
__store_u32L(dst->vd_next, src->vd_next);
}
else {
__store_u16M(dst->vd_version, src->vd_version);
__store_u16M(dst->vd_flags, src->vd_flags);
__store_u16M(dst->vd_ndx, src->vd_ndx);
__store_u16M(dst->vd_cnt, src->vd_cnt);
__store_u32M(dst->vd_hash, src->vd_hash);
__store_u32M(dst->vd_aux, src->vd_aux);
__store_u32M(dst->vd_next, src->vd_next);
}
}
typedef verdaux_mtype verdaux_stype;
typedef verdaux_ftype verdaux_dtype;
typedef verdef_mtype verdef_stype;
typedef verdef_ftype verdef_dtype;
typedef align_mtype verdef_atype;
#define copy_verdaux_srctotmp(d, s, e) (*(d) = *(s))
#define copy_verdaux_tmptodst(d, s, e) __store_verdaux((d), (s), (e))
#define copy_verdef_srctotmp(d, s, e) (*(d) = *(s))
#define copy_verdef_tmptodst(d, s, e) __store_verdef((d), (s), (e))
#define translator_suffix _tof
#else /* TOFILE */
static void
__load_verdaux(verdaux_mtype *dst, const verdaux_ftype *src, unsigned enc) {
if (enc == ELFDATA2LSB) {
dst->vda_name = __load_u32L(src->vda_name);
dst->vda_next = __load_u32L(src->vda_next);
}
else {
dst->vda_name = __load_u32M(src->vda_name);
dst->vda_next = __load_u32M(src->vda_next);
}
}
static void
__load_verdef(verdef_mtype *dst, const verdef_ftype *src, unsigned enc) {
if (enc == ELFDATA2LSB) {
dst->vd_version = __load_u16L(src->vd_version);
dst->vd_flags = __load_u16L(src->vd_flags);
dst->vd_ndx = __load_u16L(src->vd_ndx);
dst->vd_cnt = __load_u16L(src->vd_cnt);
dst->vd_hash = __load_u32L(src->vd_hash);
dst->vd_aux = __load_u32L(src->vd_aux);
dst->vd_next = __load_u32L(src->vd_next);
}
else {
dst->vd_version = __load_u16M(src->vd_version);
dst->vd_flags = __load_u16M(src->vd_flags);
dst->vd_ndx = __load_u16M(src->vd_ndx);
dst->vd_cnt = __load_u16M(src->vd_cnt);
dst->vd_hash = __load_u32M(src->vd_hash);
dst->vd_aux = __load_u32M(src->vd_aux);
dst->vd_next = __load_u32M(src->vd_next);
}
}
typedef verdaux_ftype verdaux_stype;
typedef verdaux_mtype verdaux_dtype;
typedef verdef_ftype verdef_stype;
typedef verdef_mtype verdef_dtype;
typedef align_ftype verdef_atype;
#define copy_verdaux_srctotmp(d, s, e) __load_verdaux((d), (s), (e))
#define copy_verdaux_tmptodst(d, s, e) (*(d) = *(s))
#define copy_verdef_srctotmp(d, s, e) __load_verdef((d), (s), (e))
#define copy_verdef_tmptodst(d, s, e) (*(d) = *(s))
#define translator_suffix _tom
#endif /* TOFILE */
#define cat3(a,b,c) a##b##c
#define xlt3(p,e,s) cat3(p,e,s)
#define xltprefix(x) xlt3(x,_,class_suffix)
#define translator(x,e) xlt3(xltprefix(_elf_##x),e,translator_suffix)
static size_t
xlt_verdef(unsigned char *dst, const unsigned char *src, size_t n, unsigned enc) {
size_t off;
if (sizeof(verdef_stype) != sizeof(verdef_dtype)
|| sizeof(verdaux_stype) != sizeof(verdaux_dtype)) {
/* never happens for ELF v1 and Verneed v1 */
seterr(ERROR_UNIMPLEMENTED);
return (size_t)-1;
}
/* size translation shortcut */
if (dst == NULL) {
return n;
}
if (src == NULL) {
seterr(ERROR_NULLBUF);
return (size_t)-1;
}
off = 0;
while (off + sizeof(verdef_stype) <= n) {
const verdef_stype *svd;
verdef_dtype *dvd;
verdef_mtype vd;
size_t acount;
size_t aoff;
/*
* check for proper alignment
*/
if (off % sizeof(verdef_atype)) {
seterr(ERROR_VERDEF_FORMAT);
return (size_t)-1;
}
/*
* copy and check src
*/
svd = (verdef_stype*)(src + off);
dvd = (verdef_dtype*)(dst + off);
copy_verdef_srctotmp(&vd, svd, enc);
if (vd.vd_version < 1
|| vd.vd_version > VER_DEF_CURRENT) {
seterr(ERROR_VERDEF_VERSION);
return (size_t)-1;
}
if (vd.vd_cnt < 1
|| vd.vd_aux == 0) {
seterr(ERROR_VERDEF_FORMAT);
return (size_t)-1;
}
copy_verdef_tmptodst(dvd, &vd, enc);
/*
* copy aux array
*/
aoff = off + vd.vd_aux;
for (acount = 0; acount < vd.vd_cnt; acount++) {
const verdaux_stype *svda;
verdaux_dtype *dvda;
verdaux_mtype vda;
/*
* are we still inside the buffer limits?
*/
if (aoff + sizeof(verdaux_stype) > n) {
break;
}
/*
* check for proper alignment
*/
if (aoff % sizeof(verdef_atype)) {
seterr(ERROR_VERDEF_FORMAT);
return (size_t)-1;
}
/*
* copy and check src
*/
svda = (verdaux_stype*)(src + aoff);
dvda = (verdaux_dtype*)(dst + aoff);
copy_verdaux_srctotmp(&vda, svda, enc);
copy_verdaux_tmptodst(dvda, &vda, enc);
/*
* advance to next verdaux
*/
if (vda.vda_next == 0) {
/* end of list */
break;
}
aoff += vda.vda_next;
}
/*
* advance to next verdef
*/
if (vd.vd_next == 0) {
/* end of list */
break;
}
off += vd.vd_next;
}
return n;
}
size_t
translator(verdef,L11)(unsigned char *dst, const unsigned char *src, size_t n) {
return xlt_verdef(dst, src, n, ELFDATA2LSB);
}
size_t
translator(verdef,M11)(unsigned char *dst, const unsigned char *src, size_t n) {
return xlt_verdef(dst, src, n, ELFDATA2MSB);
}

View File

@ -1,245 +0,0 @@
/*
* verneed.h - copy versioning information.
* Copyright (C) 2001 - 2006 Michael Riepe
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef lint
static const char verneed_h_rcsid[] = "@(#) $Id: verneed.h,v 1.13 2008/05/23 08:15:35 michael Exp $";
#endif /* lint */
#if VER_NEED_CURRENT != 1
#error libelf currently does not support VER_NEED_CURRENT != 1
#endif /* VER_NEED_CURRENT != 1 */
#if TOFILE
static void
__store_vernaux(vernaux_ftype *dst, const vernaux_mtype *src, unsigned enc) {
if (enc == ELFDATA2LSB) {
__store_u32L(dst->vna_hash, src->vna_hash);
__store_u16L(dst->vna_flags, src->vna_flags);
__store_u16L(dst->vna_other, src->vna_other);
__store_u32L(dst->vna_name, src->vna_name);
__store_u32L(dst->vna_next, src->vna_next);
}
else {
__store_u32M(dst->vna_hash, src->vna_hash);
__store_u16M(dst->vna_flags, src->vna_flags);
__store_u16M(dst->vna_other, src->vna_other);
__store_u32M(dst->vna_name, src->vna_name);
__store_u32M(dst->vna_next, src->vna_next);
}
}
static void
__store_verneed(verneed_ftype *dst, const verneed_mtype *src, unsigned enc) {
if (enc == ELFDATA2LSB) {
__store_u16L(dst->vn_version, src->vn_version);
__store_u16L(dst->vn_cnt, src->vn_cnt);
__store_u32L(dst->vn_file, src->vn_file);
__store_u32L(dst->vn_aux, src->vn_aux);
__store_u32L(dst->vn_next, src->vn_next);
}
else {
__store_u16M(dst->vn_version, src->vn_version);
__store_u16M(dst->vn_cnt, src->vn_cnt);
__store_u32M(dst->vn_file, src->vn_file);
__store_u32M(dst->vn_aux, src->vn_aux);
__store_u32M(dst->vn_next, src->vn_next);
}
}
typedef vernaux_mtype vernaux_stype;
typedef vernaux_ftype vernaux_dtype;
typedef verneed_mtype verneed_stype;
typedef verneed_ftype verneed_dtype;
typedef align_mtype verneed_atype;
#define copy_vernaux_srctotmp(d, s, e) (*(d) = *(s))
#define copy_vernaux_tmptodst(d, s, e) __store_vernaux((d), (s), (e))
#define copy_verneed_srctotmp(d, s, e) (*(d) = *(s))
#define copy_verneed_tmptodst(d, s, e) __store_verneed((d), (s), (e))
#define translator_suffix _tof
#else /* TOFILE */
static void
__load_vernaux(vernaux_mtype *dst, const vernaux_ftype *src, unsigned enc) {
if (enc == ELFDATA2LSB) {
dst->vna_hash = __load_u32L(src->vna_hash);
dst->vna_flags = __load_u16L(src->vna_flags);
dst->vna_other = __load_u16L(src->vna_other);
dst->vna_name = __load_u32L(src->vna_name);
dst->vna_next = __load_u32L(src->vna_next);
}
else {
dst->vna_hash = __load_u32M(src->vna_hash);
dst->vna_flags = __load_u16M(src->vna_flags);
dst->vna_other = __load_u16M(src->vna_other);
dst->vna_name = __load_u32M(src->vna_name);
dst->vna_next = __load_u32M(src->vna_next);
}
}
static void
__load_verneed(verneed_mtype *dst, const verneed_ftype *src, unsigned enc) {
if (enc == ELFDATA2LSB) {
dst->vn_version = __load_u16L(src->vn_version);
dst->vn_cnt = __load_u16L(src->vn_cnt);
dst->vn_file = __load_u32L(src->vn_file);
dst->vn_aux = __load_u32L(src->vn_aux);
dst->vn_next = __load_u32L(src->vn_next);
}
else {
dst->vn_version = __load_u16M(src->vn_version);
dst->vn_cnt = __load_u16M(src->vn_cnt);
dst->vn_file = __load_u32M(src->vn_file);
dst->vn_aux = __load_u32M(src->vn_aux);
dst->vn_next = __load_u32M(src->vn_next);
}
}
typedef vernaux_ftype vernaux_stype;
typedef vernaux_mtype vernaux_dtype;
typedef verneed_ftype verneed_stype;
typedef verneed_mtype verneed_dtype;
typedef align_ftype verneed_atype;
#define copy_vernaux_srctotmp(d, s, e) __load_vernaux((d), (s), (e))
#define copy_vernaux_tmptodst(d, s, e) (*(d) = *(s))
#define copy_verneed_srctotmp(d, s, e) __load_verneed((d), (s), (e))
#define copy_verneed_tmptodst(d, s, e) (*(d) = *(s))
#define translator_suffix _tom
#endif /* TOFILE */
#define cat3(a,b,c) a##b##c
#define xlt3(p,e,s) cat3(p,e,s)
#define xltprefix(x) xlt3(x,_,class_suffix)
#define translator(x,e) xlt3(xltprefix(_elf_##x),e,translator_suffix)
static size_t
xlt_verneed(unsigned char *dst, const unsigned char *src, size_t n, unsigned enc) {
size_t off;
if (sizeof(verneed_stype) != sizeof(verneed_dtype)
|| sizeof(vernaux_stype) != sizeof(vernaux_dtype)) {
/* never happens for ELF v1 and Verneed v1 */
seterr(ERROR_UNIMPLEMENTED);
return (size_t)-1;
}
/* size translation shortcut */
if (dst == NULL) {
return n;
}
if (src == NULL) {
seterr(ERROR_NULLBUF);
return (size_t)-1;
}
off = 0;
while (off + sizeof(verneed_stype) <= n) {
const verneed_stype *svn;
verneed_dtype *dvn;
verneed_mtype vn;
size_t acount;
size_t aoff;
/*
* check for proper alignment
*/
if (off % sizeof(verneed_atype)) {
seterr(ERROR_VERNEED_FORMAT);
return (size_t)-1;
}
/*
* copy and check src
*/
svn = (verneed_stype*)(src + off);
dvn = (verneed_dtype*)(dst + off);
copy_verneed_srctotmp(&vn, svn, enc);
if (vn.vn_version < 1
|| vn.vn_version > VER_NEED_CURRENT) {
seterr(ERROR_VERNEED_VERSION);
return (size_t)-1;
}
if (vn.vn_cnt < 1
|| vn.vn_aux == 0) {
seterr(ERROR_VERNEED_FORMAT);
return (size_t)-1;
}
copy_verneed_tmptodst(dvn, &vn, enc);
/*
* copy aux array
*/
aoff = off + vn.vn_aux;
for (acount = 0; acount < vn.vn_cnt; acount++) {
const vernaux_stype *svna;
vernaux_dtype *dvna;
vernaux_mtype vna;
/*
* are we still inside the buffer limits?
*/
if (aoff + sizeof(vernaux_stype) > n) {
break;
}
/*
* check for proper alignment
*/
if (aoff % sizeof(verneed_atype)) {
seterr(ERROR_VERNEED_FORMAT);
return (size_t)-1;
}
/*
* copy and check src
*/
svna = (vernaux_stype*)(src + aoff);
dvna = (vernaux_dtype*)(dst + aoff);
copy_vernaux_srctotmp(&vna, svna, enc);
copy_vernaux_tmptodst(dvna, &vna, enc);
/*
* advance to next vernaux
*/
if (vna.vna_next == 0) {
/* end of list */
break;
}
aoff += vna.vna_next;
}
/*
* advance to next verneed
*/
if (vn.vn_next == 0) {
/* end of list */
break;
}
off += vn.vn_next;
}
return n;
}
size_t
translator(verneed,L11)(unsigned char *dst, const unsigned char *src, size_t n) {
return xlt_verneed(dst, src, n, ELFDATA2LSB);
}
size_t
translator(verneed,M11)(unsigned char *dst, const unsigned char *src, size_t n) {
return xlt_verneed(dst, src, n, ELFDATA2MSB);
}

View File

@ -295,44 +295,6 @@ bool bSocketsAvailable = false;
VideoInfo video;
#ifdef HAVE_WX
#include "wx/wxprec.h"
#ifdef _M_X64
#ifdef __WXDEBUG__
#pragma comment(lib,"wxmsw28d_core-x64.lib")
#pragma comment(lib,"wxbase28d-x64.lib")
#else
#pragma comment(lib,"wxmsw28_core-x64.lib")
#pragma comment(lib,"wxbase28-x64.lib")
#endif
#else
#ifdef __WXDEBUG__
#pragma comment(lib,"wxmsw28d_core.lib")
#pragma comment(lib,"wxbase28d.lib")
#else
#pragma comment(lib,"wxmsw28_core.lib")
#pragma comment(lib,"wxbase28.lib")
#endif
#endif
#pragma comment(lib,"comctl32.lib")
#include "../wxdlg/wxdlg3dViewer.h"
class wxDesmumeApp : public wxApp
{
public:
//call me each frame or something.
//sort of an idle routine
static void frameUpdate()
{
if(!wxTheApp) return;
wxDesmumeApp* self = ((wxDesmumeApp*)wxTheApp);
self->DeletePendingObjects();
}
};
IMPLEMENT_APP_NO_MAIN( wxDesmumeApp )
#endif //HAVE_WX
#ifndef PUBLIC_RELEASE
#define DEVELOPER_MENU_ITEMS
#endif
@ -2058,10 +2020,6 @@ void CheckMessages()
MSG msg;
HWND hwnd = MainWindow->getHWnd();
#ifdef WX_STUB
wxDesmumeApp::frameUpdate();
#endif
while( PeekMessage( &msg, 0, 0, 0, PM_NOREMOVE ) )
{
if( GetMessage( &msg, 0, 0, 0)>0 )
@ -2936,10 +2894,6 @@ int _main()
OGLCreateRenderer_3_2_Func = OGLCreateRenderer_3_2;
#ifdef HAVE_WX
wxInitialize();
#endif
#ifdef EXPERIMENTAL_WIFI_COMM
WSADATA wsaData;
WORD version = MAKEWORD(1,1);
@ -5601,16 +5555,6 @@ DOKEYDOWN:
OpenToolWindow(new CMemView());
return 0;
#if 0
case IDM_VIEW3D:
#ifdef HAVE_WX
driver->VIEW3D_Init();
driver->view3d->Launch();
#else
MessageBox(hwnd, "Sorry to get your hopes up; 3d viewer isn't finished yet.\r\nBut because of all these languages, it is too much trouble to remove from all the menus...", "DeSmuME", MB_OK);
#endif
return 0;
#endif
case IDM_SOUND_VIEW:
if(!SoundView_IsOpened()) SoundView_DlgOpen(HWND_DESKTOP);
return 0;

View File

@ -1,249 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: msvc/wx/msw/setup.h
// Purpose: wrapper around the real wx/setup.h for Visual C++
// Author: Vadim Zeitlin
// Modified by:
// Created: 2004-12-12
// RCS-ID: $Id: setup.h 43687 2006-11-27 15:03:59Z VZ $
// Copyright: (c) 2004 Vadim Zeitlin <vadim@wxwindows.org>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// VC++ IDE predefines _DEBUG and _UNICODE for the new projects itself, but
// the other symbols (WXUSINGDLL, __WXUNIVERSAL__, ...) should be defined
// explicitly!
#ifdef _MSC_VER
#ifdef _UNICODE
#ifdef WXUSINGDLL
#ifdef _DEBUG
#include "../../../lib/vc_dll/mswud/wx/setup.h"
#else
#include "../../../lib/vc_dll/mswu/wx/setup.h"
#endif
#else
#ifdef _DEBUG
#include "../../../lib/vc_lib/mswud/wx/setup.h"
#else
#include "../../../lib/vc_lib/mswu/wx/setup.h"
#endif
#endif
#ifdef _DEBUG
#pragma comment(lib,"wxbase28ud")
#pragma comment(lib,"wxbase28ud_net")
#pragma comment(lib,"wxbase28ud_xml")
#if wxUSE_REGEX
#pragma comment(lib,"wxregexud")
#endif
#if wxUSE_GUI
#if wxUSE_XML
#pragma comment(lib,"wxexpatd")
#endif
#if wxUSE_LIBJPEG
#pragma comment(lib,"wxjpegd")
#endif
#if wxUSE_LIBPNG
#pragma comment(lib,"wxpngd")
#endif
#if wxUSE_LIBTIFF
#pragma comment(lib,"wxtiffd")
#endif
#if wxUSE_ZLIB
#pragma comment(lib,"wxzlibd")
#endif
#pragma comment(lib,"wxmsw28ud_adv")
#pragma comment(lib,"wxmsw28ud_core")
#pragma comment(lib,"wxmsw28ud_html")
#if wxUSE_GLCANVAS
#pragma comment(lib,"wxmsw28ud_gl")
#endif
#if wxUSE_DEBUGREPORT
#pragma comment(lib,"wxmsw28ud_qa")
#endif
#if wxUSE_XRC
#pragma comment(lib,"wxmsw28ud_xrc")
#endif
#if wxUSE_AUI
#pragma comment(lib,"wxmsw28ud_aui")
#endif
#if wxUSE_RICHTEXT
#pragma comment(lib,"wxmsw28ud_richtext")
#endif
#if wxUSE_MEDIACTRL
#pragma comment(lib,"wxmsw28ud_media")
#endif
#if wxUSE_ODBC
#pragma comment(lib,"wxbase28ud_odbc")
#endif
#endif // wxUSE_GUI
#else // release
#pragma comment(lib,"wxbase28u")
#pragma comment(lib,"wxbase28u_net")
#pragma comment(lib,"wxbase28u_xml")
#if wxUSE_REGEX
#pragma comment(lib,"wxregexu")
#endif
#if wxUSE_GUI
#if wxUSE_XML
#pragma comment(lib,"wxexpat")
#endif
#if wxUSE_LIBJPEG
#pragma comment(lib,"wxjpeg")
#endif
#if wxUSE_LIBPNG
#pragma comment(lib,"wxpng")
#endif
#if wxUSE_LIBTIFF
#pragma comment(lib,"wxtiff")
#endif
#if wxUSE_ZLIB
#pragma comment(lib,"wxzlib")
#endif
#pragma comment(lib,"wxmsw28u_adv")
#pragma comment(lib,"wxmsw28u_core")
#pragma comment(lib,"wxmsw28u_html")
#if wxUSE_GLCANVAS
#pragma comment(lib,"wxmsw28u_gl")
#endif
#if wxUSE_DEBUGREPORT
#pragma comment(lib,"wxmsw28u_qa")
#endif
#if wxUSE_XRC
#pragma comment(lib,"wxmsw28u_xrc")
#endif
#if wxUSE_AUI
#pragma comment(lib,"wxmsw28u_aui")
#endif
#if wxUSE_RICHTEXT
#pragma comment(lib,"wxmsw28u_richtext")
#endif
#if wxUSE_MEDIACTRL
#pragma comment(lib,"wxmsw28u_media")
#endif
#if wxUSE_ODBC
#pragma comment(lib,"wxbase28u_odbc")
#endif
#endif // wxUSE_GUI
#endif // debug/release
#else // !_UNICODE
#ifdef WXUSINGDLL
#ifdef _DEBUG
#include "../../../lib/vc_dll/mswd/wx/setup.h"
#else
#include "../../../lib/vc_dll/msw/wx/setup.h"
#endif
#else // static lib
#ifdef _DEBUG
#include "../../../lib/vc_lib/mswd/wx/setup.h"
#else
#include "../../../lib/vc_lib/msw/wx/setup.h"
#endif
#endif // shared/static
#ifdef _DEBUG
#pragma comment(lib,"wxbase28d")
#pragma comment(lib,"wxbase28d_net")
#pragma comment(lib,"wxbase28d_xml")
#if wxUSE_REGEX
#pragma comment(lib,"wxregexd")
#endif
#if wxUSE_GUI
#if wxUSE_XML
#pragma comment(lib,"wxexpatd")
#endif
#if wxUSE_LIBJPEG
#pragma comment(lib,"wxjpegd")
#endif
#if wxUSE_LIBPNG
#pragma comment(lib,"wxpngd")
#endif
#if wxUSE_LIBTIFF
#pragma comment(lib,"wxtiffd")
#endif
#if wxUSE_ZLIB
#pragma comment(lib,"wxzlibd")
#endif
#pragma comment(lib,"wxmsw28d_adv")
#pragma comment(lib,"wxmsw28d_core")
#pragma comment(lib,"wxmsw28d_html")
#if wxUSE_GLCANVAS
#pragma comment(lib,"wxmsw28d_gl")
#endif
#if wxUSE_DEBUGREPORT
#pragma comment(lib,"wxmsw28d_qa")
#endif
#if wxUSE_XRC
#pragma comment(lib,"wxmsw28d_xrc")
#endif
#if wxUSE_AUI
#pragma comment(lib,"wxmsw28d_aui")
#endif
#if wxUSE_RICHTEXT
#pragma comment(lib,"wxmsw28d_richtext")
#endif
#if wxUSE_MEDIACTRL
#pragma comment(lib,"wxmsw28d_media")
#endif
#if wxUSE_ODBC
#pragma comment(lib,"wxbase28d_odbc")
#endif
#endif // wxUSE_GUI
#else // release
#pragma comment(lib,"wxbase28")
#pragma comment(lib,"wxbase28_net")
#pragma comment(lib,"wxbase28_xml")
#if wxUSE_REGEX
#pragma comment(lib,"wxregex")
#endif
#if wxUSE_GUI
#if wxUSE_XML
#pragma comment(lib,"wxexpat")
#endif
#if wxUSE_LIBJPEG
#pragma comment(lib,"wxjpeg")
#endif
#if wxUSE_LIBPNG
#pragma comment(lib,"wxpng")
#endif
#if wxUSE_LIBTIFF
#pragma comment(lib,"wxtiff")
#endif
#if wxUSE_ZLIB
#pragma comment(lib,"wxzlib")
#endif
#pragma comment(lib,"wxmsw28_adv")
#pragma comment(lib,"wxmsw28_core")
#pragma comment(lib,"wxmsw28_html")
#if wxUSE_GLCANVAS
#pragma comment(lib,"wxmsw28_gl")
#endif
#if wxUSE_DEBUGREPORT
#pragma comment(lib,"wxmsw28_qa")
#endif
#if wxUSE_XRC
#pragma comment(lib,"wxmsw28_xrc")
#endif
#if wxUSE_AUI
#pragma comment(lib,"wxmsw28_aui")
#endif
#if wxUSE_RICHTEXT
#pragma comment(lib,"wxmsw28_richtext")
#endif
#if wxUSE_MEDIACTRL
#pragma comment(lib,"wxmsw28_media")
#endif
#if wxUSE_ODBC
#pragma comment(lib,"wxbase28_odbc")
#endif
#endif // wxUSE_GUI
#endif // debug/release
#endif // _UNICODE/!_UNICODE
#else
#error "This file should only be included when using Microsoft Visual C++"
#endif

View File

@ -1,161 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/aboutdlg.h
// Purpose: declaration of wxAboutDialog class
// Author: Vadim Zeitlin
// Created: 2006-10-07
// RCS-ID: $Id: aboutdlg.h 58748 2009-02-08 09:46:03Z VZ $
// Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ABOUTDLG_H_
#define _WX_ABOUTDLG_H_
#include "wx/defs.h"
#if wxUSE_ABOUTDLG
#include "wx/app.h"
#include "wx/icon.h"
// ----------------------------------------------------------------------------
// wxAboutDialogInfo: information shown by the standard "About" dialog
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_ADV wxAboutDialogInfo
{
public:
// all fields are initially uninitialized
wxAboutDialogInfo() { }
// accessors for various simply fields
// -----------------------------------
// name of the program, if not used defaults wxApp::GetAppName()
void SetName(const wxString& name) { m_name = name; }
wxString GetName() const
{ return m_name.empty() ? wxTheApp->GetAppName() : m_name; }
// version of the program, in free format (but without "version" word)
void SetVersion(const wxString& version) { m_version = version; }
bool HasVersion() const { return !m_version.empty(); }
wxString GetVersion() const { return m_version; }
// brief, but possibly multiline, description of the program
void SetDescription(const wxString& desc) { m_description = desc; }
bool HasDescription() const { return !m_description.empty(); }
wxString GetDescription() const { return m_description; }
// short string containing the program copyright information
void SetCopyright(const wxString& copyright) { m_copyright = copyright; }
bool HasCopyright() const { return !m_copyright.empty(); }
wxString GetCopyright() const { return m_copyright; }
// long, multiline string containing the text of the program licence
void SetLicence(const wxString& licence) { m_licence = licence; }
void SetLicense(const wxString& licence) { m_licence = licence; }
bool HasLicence() const { return !m_licence.empty(); }
wxString GetLicence() const { return m_licence; }
// icon to be shown in the dialog, defaults to the main frame icon
void SetIcon(const wxIcon& icon) { m_icon = icon; }
bool HasIcon() const { return m_icon.Ok(); }
wxIcon GetIcon() const;
// web site for the program and its description (defaults to URL itself if
// empty)
void SetWebSite(const wxString& url, const wxString& desc = wxEmptyString)
{
m_url = url;
m_urlDesc = desc.empty() ? url : desc;
}
bool HasWebSite() const { return !m_url.empty(); }
wxString GetWebSiteURL() const { return m_url; }
wxString GetWebSiteDescription() const { return m_urlDesc; }
// accessors for the arrays
// ------------------------
// the list of developers of the program
void SetDevelopers(const wxArrayString& developers)
{ m_developers = developers; }
void AddDeveloper(const wxString& developer)
{ m_developers.push_back(developer); }
bool HasDevelopers() const { return !m_developers.empty(); }
const wxArrayString& GetDevelopers() const { return m_developers; }
// the list of documentation writers
void SetDocWriters(const wxArrayString& docwriters)
{ m_docwriters = docwriters; }
void AddDocWriter(const wxString& docwriter)
{ m_docwriters.push_back(docwriter); }
bool HasDocWriters() const { return !m_docwriters.empty(); }
const wxArrayString& GetDocWriters() const { return m_docwriters; }
// the list of artists for the program art
void SetArtists(const wxArrayString& artists)
{ m_artists = artists; }
void AddArtist(const wxString& artist)
{ m_artists.push_back(artist); }
bool HasArtists() const { return !m_artists.empty(); }
const wxArrayString& GetArtists() const { return m_artists; }
// the list of translators
void SetTranslators(const wxArrayString& translators)
{ m_translators = translators; }
void AddTranslator(const wxString& translator)
{ m_translators.push_back(translator); }
bool HasTranslators() const { return !m_translators.empty(); }
const wxArrayString& GetTranslators() const { return m_translators; }
// implementation only
// -------------------
// "simple" about dialog shows only textual information (with possibly
// default icon but without hyperlink nor any long texts such as the
// licence text)
bool IsSimple() const
{ return !HasWebSite() && !HasIcon() && !HasLicence(); }
// get the description and credits (i.e. all of developers, doc writers,
// artists and translators) as a one long multiline string
wxString GetDescriptionAndCredits() const;
#if wxABI_VERSION >= 20810
// returns the copyright with the (C) string substituted by the Unicode
// character U+00A9
wxString GetCopyrightToDisplay() const;
#endif // wx 2.8.10+
private:
wxString m_name,
m_version,
m_description,
m_copyright,
m_licence;
wxIcon m_icon;
wxString m_url,
m_urlDesc;
wxArrayString m_developers,
m_docwriters,
m_artists,
m_translators;
};
// functions to show the about dialog box
WXDLLIMPEXP_ADV void wxAboutBox(const wxAboutDialogInfo& info);
#endif // wxUSE_ABOUTDLG
#endif // _WX_ABOUTDLG_H_

View File

@ -1,171 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/accel.h
// Purpose: wxAcceleratorEntry and wxAcceleratorTable classes
// Author: Julian Smart, Robert Roebling, Vadim Zeitlin
// Modified by:
// Created: 31.05.01 (extracted from other files)
// RCS-ID: $Id: accel.h 53135 2008-04-12 02:31:04Z VZ $
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ACCEL_H_BASE_
#define _WX_ACCEL_H_BASE_
#include "wx/defs.h"
#if wxUSE_ACCEL
#include "wx/object.h"
class WXDLLIMPEXP_FWD_CORE wxAcceleratorTable;
class WXDLLIMPEXP_FWD_CORE wxMenuItem;
class WXDLLIMPEXP_FWD_CORE wxKeyEvent;
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
// wxAcceleratorEntry flags
enum
{
wxACCEL_NORMAL = 0x0000, // no modifiers
wxACCEL_ALT = 0x0001, // hold Alt key down
wxACCEL_CTRL = 0x0002, // hold Ctrl key down
wxACCEL_SHIFT = 0x0004, // hold Shift key down
#if defined(__WXMAC__) || defined(__WXCOCOA__)
wxACCEL_CMD = 0x0008 // Command key on OS X
#else
wxACCEL_CMD = wxACCEL_CTRL
#endif
};
// ----------------------------------------------------------------------------
// an entry in wxAcceleratorTable corresponds to one accelerator
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxAcceleratorEntry
{
public:
wxAcceleratorEntry(int flags = 0, int keyCode = 0, int cmd = 0,
wxMenuItem *item = NULL)
: m_flags(flags)
, m_keyCode(keyCode)
, m_command(cmd)
, m_item(item)
{ }
wxAcceleratorEntry(const wxAcceleratorEntry& entry)
: m_flags(entry.m_flags)
, m_keyCode(entry.m_keyCode)
, m_command(entry.m_command)
, m_item(entry.m_item)
{ }
// create accelerator corresponding to the specified string, return NULL if
// string couldn't be parsed or a pointer to be deleted by the caller
static wxAcceleratorEntry *Create(const wxString& str);
wxAcceleratorEntry& operator=(const wxAcceleratorEntry& entry)
{
Set(entry.m_flags, entry.m_keyCode, entry.m_command, entry.m_item);
return *this;
}
void Set(int flags, int keyCode, int cmd, wxMenuItem *item = NULL)
{
m_flags = flags;
m_keyCode = keyCode;
m_command = cmd;
m_item = item;
}
void SetMenuItem(wxMenuItem *item) { m_item = item; }
int GetFlags() const { return m_flags; }
int GetKeyCode() const { return m_keyCode; }
int GetCommand() const { return m_command; }
wxMenuItem *GetMenuItem() const { return m_item; }
bool operator==(const wxAcceleratorEntry& entry) const
{
return m_flags == entry.m_flags &&
m_keyCode == entry.m_keyCode &&
m_command == entry.m_command &&
m_item == entry.m_item;
}
bool operator!=(const wxAcceleratorEntry& entry) const
{ return !(*this == entry); }
#if defined(__WXMOTIF__)
// Implementation use only
bool MatchesEvent(const wxKeyEvent& event) const;
#endif
bool IsOk() const
{
return m_flags != 0 &&
m_keyCode != 0;
}
// string <-> wxAcceleratorEntry conversion
// ----------------------------------------
// returns a wxString for the this accelerator.
// this function formats it using the <flags>-<keycode> format
// where <flags> maybe a hyphen-separed list of "shift|alt|ctrl"
wxString ToString() const;
// returns true if the given string correctly initialized this object
// (i.e. if IsOk() returns true after this call)
bool FromString(const wxString& str);
private:
// common part of Create() and FromString()
static bool ParseAccel(const wxString& str, int *flags, int *keycode);
int m_flags; // combination of wxACCEL_XXX constants
int m_keyCode; // ASCII or virtual keycode
int m_command; // Command id to generate
// the menu item this entry corresponds to, may be NULL
wxMenuItem *m_item;
// for compatibility with old code, use accessors now!
friend class WXDLLIMPEXP_FWD_CORE wxMenu;
};
// ----------------------------------------------------------------------------
// include wxAcceleratorTable class declaration, it is only used by the library
// and so doesn't have any published user visible interface
// ----------------------------------------------------------------------------
#if defined(__WXUNIVERSAL__)
#include "wx/generic/accel.h"
#elif defined(__WXMSW__)
#include "wx/msw/accel.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/accel.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/accel.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/accel.h"
#elif defined(__WXMAC__)
#include "wx/mac/accel.h"
#elif defined(__WXCOCOA__)
#include "wx/generic/accel.h"
#elif defined(__WXPM__)
#include "wx/os2/accel.h"
#endif
extern WXDLLEXPORT_DATA(wxAcceleratorTable) wxNullAcceleratorTable;
#endif // wxUSE_ACCEL
#endif
// _WX_ACCEL_H_BASE_

View File

@ -1,377 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/access.h
// Purpose: Accessibility classes
// Author: Julian Smart
// Modified by:
// Created: 2003-02-12
// RCS-ID: $Id: access.h 51246 2008-01-16 12:56:37Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ACCESSBASE_H_
#define _WX_ACCESSBASE_H_
// ----------------------------------------------------------------------------
// headers we have to include here
// ----------------------------------------------------------------------------
#include "wx/defs.h"
#if wxUSE_ACCESSIBILITY
#include "wx/variant.h"
typedef enum
{
wxACC_FAIL,
wxACC_FALSE,
wxACC_OK,
wxACC_NOT_IMPLEMENTED,
wxACC_NOT_SUPPORTED
} wxAccStatus;
// Child ids are integer identifiers from 1 up.
// So zero represents 'this' object.
#define wxACC_SELF 0
// Navigation constants
typedef enum
{
wxNAVDIR_DOWN,
wxNAVDIR_FIRSTCHILD,
wxNAVDIR_LASTCHILD,
wxNAVDIR_LEFT,
wxNAVDIR_NEXT,
wxNAVDIR_PREVIOUS,
wxNAVDIR_RIGHT,
wxNAVDIR_UP
} wxNavDir;
// Role constants
typedef enum {
wxROLE_NONE,
wxROLE_SYSTEM_ALERT,
wxROLE_SYSTEM_ANIMATION,
wxROLE_SYSTEM_APPLICATION,
wxROLE_SYSTEM_BORDER,
wxROLE_SYSTEM_BUTTONDROPDOWN,
wxROLE_SYSTEM_BUTTONDROPDOWNGRID,
wxROLE_SYSTEM_BUTTONMENU,
wxROLE_SYSTEM_CARET,
wxROLE_SYSTEM_CELL,
wxROLE_SYSTEM_CHARACTER,
wxROLE_SYSTEM_CHART,
wxROLE_SYSTEM_CHECKBUTTON,
wxROLE_SYSTEM_CLIENT,
wxROLE_SYSTEM_CLOCK,
wxROLE_SYSTEM_COLUMN,
wxROLE_SYSTEM_COLUMNHEADER,
wxROLE_SYSTEM_COMBOBOX,
wxROLE_SYSTEM_CURSOR,
wxROLE_SYSTEM_DIAGRAM,
wxROLE_SYSTEM_DIAL,
wxROLE_SYSTEM_DIALOG,
wxROLE_SYSTEM_DOCUMENT,
wxROLE_SYSTEM_DROPLIST,
wxROLE_SYSTEM_EQUATION,
wxROLE_SYSTEM_GRAPHIC,
wxROLE_SYSTEM_GRIP,
wxROLE_SYSTEM_GROUPING,
wxROLE_SYSTEM_HELPBALLOON,
wxROLE_SYSTEM_HOTKEYFIELD,
wxROLE_SYSTEM_INDICATOR,
wxROLE_SYSTEM_LINK,
wxROLE_SYSTEM_LIST,
wxROLE_SYSTEM_LISTITEM,
wxROLE_SYSTEM_MENUBAR,
wxROLE_SYSTEM_MENUITEM,
wxROLE_SYSTEM_MENUPOPUP,
wxROLE_SYSTEM_OUTLINE,
wxROLE_SYSTEM_OUTLINEITEM,
wxROLE_SYSTEM_PAGETAB,
wxROLE_SYSTEM_PAGETABLIST,
wxROLE_SYSTEM_PANE,
wxROLE_SYSTEM_PROGRESSBAR,
wxROLE_SYSTEM_PROPERTYPAGE,
wxROLE_SYSTEM_PUSHBUTTON,
wxROLE_SYSTEM_RADIOBUTTON,
wxROLE_SYSTEM_ROW,
wxROLE_SYSTEM_ROWHEADER,
wxROLE_SYSTEM_SCROLLBAR,
wxROLE_SYSTEM_SEPARATOR,
wxROLE_SYSTEM_SLIDER,
wxROLE_SYSTEM_SOUND,
wxROLE_SYSTEM_SPINBUTTON,
wxROLE_SYSTEM_STATICTEXT,
wxROLE_SYSTEM_STATUSBAR,
wxROLE_SYSTEM_TABLE,
wxROLE_SYSTEM_TEXT,
wxROLE_SYSTEM_TITLEBAR,
wxROLE_SYSTEM_TOOLBAR,
wxROLE_SYSTEM_TOOLTIP,
wxROLE_SYSTEM_WHITESPACE,
wxROLE_SYSTEM_WINDOW
} wxAccRole;
// Object types
typedef enum {
wxOBJID_WINDOW = 0x00000000,
wxOBJID_SYSMENU = 0xFFFFFFFF,
wxOBJID_TITLEBAR = 0xFFFFFFFE,
wxOBJID_MENU = 0xFFFFFFFD,
wxOBJID_CLIENT = 0xFFFFFFFC,
wxOBJID_VSCROLL = 0xFFFFFFFB,
wxOBJID_HSCROLL = 0xFFFFFFFA,
wxOBJID_SIZEGRIP = 0xFFFFFFF9,
wxOBJID_CARET = 0xFFFFFFF8,
wxOBJID_CURSOR = 0xFFFFFFF7,
wxOBJID_ALERT = 0xFFFFFFF6,
wxOBJID_SOUND = 0xFFFFFFF5
} wxAccObject;
// Accessible states
#define wxACC_STATE_SYSTEM_ALERT_HIGH 0x00000001
#define wxACC_STATE_SYSTEM_ALERT_MEDIUM 0x00000002
#define wxACC_STATE_SYSTEM_ALERT_LOW 0x00000004
#define wxACC_STATE_SYSTEM_ANIMATED 0x00000008
#define wxACC_STATE_SYSTEM_BUSY 0x00000010
#define wxACC_STATE_SYSTEM_CHECKED 0x00000020
#define wxACC_STATE_SYSTEM_COLLAPSED 0x00000040
#define wxACC_STATE_SYSTEM_DEFAULT 0x00000080
#define wxACC_STATE_SYSTEM_EXPANDED 0x00000100
#define wxACC_STATE_SYSTEM_EXTSELECTABLE 0x00000200
#define wxACC_STATE_SYSTEM_FLOATING 0x00000400
#define wxACC_STATE_SYSTEM_FOCUSABLE 0x00000800
#define wxACC_STATE_SYSTEM_FOCUSED 0x00001000
#define wxACC_STATE_SYSTEM_HOTTRACKED 0x00002000
#define wxACC_STATE_SYSTEM_INVISIBLE 0x00004000
#define wxACC_STATE_SYSTEM_MARQUEED 0x00008000
#define wxACC_STATE_SYSTEM_MIXED 0x00010000
#define wxACC_STATE_SYSTEM_MULTISELECTABLE 0x00020000
#define wxACC_STATE_SYSTEM_OFFSCREEN 0x00040000
#define wxACC_STATE_SYSTEM_PRESSED 0x00080000
#define wxACC_STATE_SYSTEM_PROTECTED 0x00100000
#define wxACC_STATE_SYSTEM_READONLY 0x00200000
#define wxACC_STATE_SYSTEM_SELECTABLE 0x00400000
#define wxACC_STATE_SYSTEM_SELECTED 0x00800000
#define wxACC_STATE_SYSTEM_SELFVOICING 0x01000000
#define wxACC_STATE_SYSTEM_UNAVAILABLE 0x02000000
// Selection flag
typedef enum
{
wxACC_SEL_NONE = 0,
wxACC_SEL_TAKEFOCUS = 1,
wxACC_SEL_TAKESELECTION = 2,
wxACC_SEL_EXTENDSELECTION = 4,
wxACC_SEL_ADDSELECTION = 8,
wxACC_SEL_REMOVESELECTION = 16
} wxAccSelectionFlags;
// Accessibility event identifiers
#define wxACC_EVENT_SYSTEM_SOUND 0x0001
#define wxACC_EVENT_SYSTEM_ALERT 0x0002
#define wxACC_EVENT_SYSTEM_FOREGROUND 0x0003
#define wxACC_EVENT_SYSTEM_MENUSTART 0x0004
#define wxACC_EVENT_SYSTEM_MENUEND 0x0005
#define wxACC_EVENT_SYSTEM_MENUPOPUPSTART 0x0006
#define wxACC_EVENT_SYSTEM_MENUPOPUPEND 0x0007
#define wxACC_EVENT_SYSTEM_CAPTURESTART 0x0008
#define wxACC_EVENT_SYSTEM_CAPTUREEND 0x0009
#define wxACC_EVENT_SYSTEM_MOVESIZESTART 0x000A
#define wxACC_EVENT_SYSTEM_MOVESIZEEND 0x000B
#define wxACC_EVENT_SYSTEM_CONTEXTHELPSTART 0x000C
#define wxACC_EVENT_SYSTEM_CONTEXTHELPEND 0x000D
#define wxACC_EVENT_SYSTEM_DRAGDROPSTART 0x000E
#define wxACC_EVENT_SYSTEM_DRAGDROPEND 0x000F
#define wxACC_EVENT_SYSTEM_DIALOGSTART 0x0010
#define wxACC_EVENT_SYSTEM_DIALOGEND 0x0011
#define wxACC_EVENT_SYSTEM_SCROLLINGSTART 0x0012
#define wxACC_EVENT_SYSTEM_SCROLLINGEND 0x0013
#define wxACC_EVENT_SYSTEM_SWITCHSTART 0x0014
#define wxACC_EVENT_SYSTEM_SWITCHEND 0x0015
#define wxACC_EVENT_SYSTEM_MINIMIZESTART 0x0016
#define wxACC_EVENT_SYSTEM_MINIMIZEEND 0x0017
#define wxACC_EVENT_OBJECT_CREATE 0x8000
#define wxACC_EVENT_OBJECT_DESTROY 0x8001
#define wxACC_EVENT_OBJECT_SHOW 0x8002
#define wxACC_EVENT_OBJECT_HIDE 0x8003
#define wxACC_EVENT_OBJECT_REORDER 0x8004
#define wxACC_EVENT_OBJECT_FOCUS 0x8005
#define wxACC_EVENT_OBJECT_SELECTION 0x8006
#define wxACC_EVENT_OBJECT_SELECTIONADD 0x8007
#define wxACC_EVENT_OBJECT_SELECTIONREMOVE 0x8008
#define wxACC_EVENT_OBJECT_SELECTIONWITHIN 0x8009
#define wxACC_EVENT_OBJECT_STATECHANGE 0x800A
#define wxACC_EVENT_OBJECT_LOCATIONCHANGE 0x800B
#define wxACC_EVENT_OBJECT_NAMECHANGE 0x800C
#define wxACC_EVENT_OBJECT_DESCRIPTIONCHANGE 0x800D
#define wxACC_EVENT_OBJECT_VALUECHANGE 0x800E
#define wxACC_EVENT_OBJECT_PARENTCHANGE 0x800F
#define wxACC_EVENT_OBJECT_HELPCHANGE 0x8010
#define wxACC_EVENT_OBJECT_DEFACTIONCHANGE 0x8011
#define wxACC_EVENT_OBJECT_ACCELERATORCHANGE 0x8012
// ----------------------------------------------------------------------------
// wxAccessible
// All functions return an indication of success, failure, or not implemented.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_CORE wxAccessible;
class WXDLLIMPEXP_FWD_CORE wxWindow;
class WXDLLIMPEXP_FWD_CORE wxPoint;
class WXDLLIMPEXP_FWD_CORE wxRect;
class WXDLLEXPORT wxAccessibleBase : public wxObject
{
DECLARE_NO_COPY_CLASS(wxAccessibleBase)
public:
wxAccessibleBase(wxWindow* win): m_window(win) {}
virtual ~wxAccessibleBase() {}
// Overridables
// Can return either a child object, or an integer
// representing the child element, starting from 1.
// pt is in screen coordinates.
virtual wxAccStatus HitTest(const wxPoint& WXUNUSED(pt), int* WXUNUSED(childId), wxAccessible** WXUNUSED(childObject))
{ return wxACC_NOT_IMPLEMENTED; }
// Returns the rectangle for this object (id = 0) or a child element (id > 0).
// rect is in screen coordinates.
virtual wxAccStatus GetLocation(wxRect& WXUNUSED(rect), int WXUNUSED(elementId))
{ return wxACC_NOT_IMPLEMENTED; }
// Navigates from fromId to toId/toObject.
virtual wxAccStatus Navigate(wxNavDir WXUNUSED(navDir), int WXUNUSED(fromId),
int* WXUNUSED(toId), wxAccessible** WXUNUSED(toObject))
{ return wxACC_NOT_IMPLEMENTED; }
// Gets the name of the specified object.
virtual wxAccStatus GetName(int WXUNUSED(childId), wxString* WXUNUSED(name))
{ return wxACC_NOT_IMPLEMENTED; }
// Gets the number of children.
virtual wxAccStatus GetChildCount(int* WXUNUSED(childCount))
{ return wxACC_NOT_IMPLEMENTED; }
// Gets the specified child (starting from 1).
// If *child is NULL and return value is wxACC_OK,
// this means that the child is a simple element and
// not an accessible object.
virtual wxAccStatus GetChild(int WXUNUSED(childId), wxAccessible** WXUNUSED(child))
{ return wxACC_NOT_IMPLEMENTED; }
// Gets the parent, or NULL.
virtual wxAccStatus GetParent(wxAccessible** WXUNUSED(parent))
{ return wxACC_NOT_IMPLEMENTED; }
// Performs the default action. childId is 0 (the action for this object)
// or > 0 (the action for a child).
// Return wxACC_NOT_SUPPORTED if there is no default action for this
// window (e.g. an edit control).
virtual wxAccStatus DoDefaultAction(int WXUNUSED(childId))
{ return wxACC_NOT_IMPLEMENTED; }
// Gets the default action for this object (0) or > 0 (the action for a child).
// Return wxACC_OK even if there is no action. actionName is the action, or the empty
// string if there is no action.
// The retrieved string describes the action that is performed on an object,
// not what the object does as a result. For example, a toolbar button that prints
// a document has a default action of "Press" rather than "Prints the current document."
virtual wxAccStatus GetDefaultAction(int WXUNUSED(childId), wxString* WXUNUSED(actionName))
{ return wxACC_NOT_IMPLEMENTED; }
// Returns the description for this object or a child.
virtual wxAccStatus GetDescription(int WXUNUSED(childId), wxString* WXUNUSED(description))
{ return wxACC_NOT_IMPLEMENTED; }
// Returns help text for this object or a child, similar to tooltip text.
virtual wxAccStatus GetHelpText(int WXUNUSED(childId), wxString* WXUNUSED(helpText))
{ return wxACC_NOT_IMPLEMENTED; }
// Returns the keyboard shortcut for this object or child.
// Return e.g. ALT+K
virtual wxAccStatus GetKeyboardShortcut(int WXUNUSED(childId), wxString* WXUNUSED(shortcut))
{ return wxACC_NOT_IMPLEMENTED; }
// Returns a role constant.
virtual wxAccStatus GetRole(int WXUNUSED(childId), wxAccRole* WXUNUSED(role))
{ return wxACC_NOT_IMPLEMENTED; }
// Returns a state constant.
virtual wxAccStatus GetState(int WXUNUSED(childId), long* WXUNUSED(state))
{ return wxACC_NOT_IMPLEMENTED; }
// Returns a localized string representing the value for the object
// or child.
virtual wxAccStatus GetValue(int WXUNUSED(childId), wxString* WXUNUSED(strValue))
{ return wxACC_NOT_IMPLEMENTED; }
// Selects the object or child.
virtual wxAccStatus Select(int WXUNUSED(childId), wxAccSelectionFlags WXUNUSED(selectFlags))
{ return wxACC_NOT_IMPLEMENTED; }
// Gets the window with the keyboard focus.
// If childId is 0 and child is NULL, no object in
// this subhierarchy has the focus.
// If this object has the focus, child should be 'this'.
virtual wxAccStatus GetFocus(int* WXUNUSED(childId), wxAccessible** WXUNUSED(child))
{ return wxACC_NOT_IMPLEMENTED; }
#if wxUSE_VARIANT
// Gets a variant representing the selected children
// of this object.
// Acceptable values:
// - a null variant (IsNull() returns TRUE)
// - a list variant (GetType() == wxT("list"))
// - an integer representing the selected child element,
// or 0 if this object is selected (GetType() == wxT("long"))
// - a "void*" pointer to a wxAccessible child object
virtual wxAccStatus GetSelections(wxVariant* WXUNUSED(selections))
{ return wxACC_NOT_IMPLEMENTED; }
#endif // wxUSE_VARIANT
// Accessors
// Returns the window associated with this object.
wxWindow* GetWindow() { return m_window; }
// Sets the window associated with this object.
void SetWindow(wxWindow* window) { m_window = window; }
// Operations
// Each platform's implementation must define this
// static void NotifyEvent(int eventType, wxWindow* window, wxAccObject objectType,
// int objectId);
private:
// Data members
wxWindow* m_window;
};
// ----------------------------------------------------------------------------
// now include the declaration of the real class
// ----------------------------------------------------------------------------
#if defined(__WXMSW__)
#include "wx/msw/ole/access.h"
#endif
#endif // wxUSE_ACCESSIBILITY
#endif // _WX_ACCESSBASE_H_

View File

@ -1,48 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
// Name: include/wx/afterstd.h
// Purpose: #include after STL headers
// Author: Vadim Zeitlin
// Modified by:
// Created: 07/07/03
// RCS-ID: $Id: afterstd.h 42906 2006-11-01 14:16:42Z VZ $
// Copyright: (c) 2003 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
/**
See the comments in beforestd.h.
*/
#if defined(__WXMSW__)
#include "wx/msw/winundef.h"
#endif
// undo what we did in wx/beforestd.h
#if defined(__VISUALC__) && __VISUALC__ <= 1201
// MSVC 5 does not have this
#if _MSC_VER > 1100
// don't restore this one for VC6, it gives it in each try/catch which is a
// bit annoying to say the least
#if _MSC_VER >= 0x1300
// unreachable code
#pragma warning(default:4702)
#endif // VC++ >= 7
#pragma warning(pop)
#else
// 'expression' : signed/unsigned mismatch
#pragma warning(default:4018)
// 'identifier' : unreferenced formal parameter
#pragma warning(default:4100)
// 'conversion' : conversion from 'type1' to 'type2',
// possible loss of data
#pragma warning(default:4244)
// C++ language change: to explicitly specialize class template
// 'identifier' use the following syntax
#pragma warning(default:4663)
#endif
#endif

View File

@ -1,77 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/anidecod.h
// Purpose: wxANIDecoder, ANI reader for wxImage and wxAnimation
// Author: Francesco Montorsi
// CVS-ID: $Id: anidecod.h 45563 2007-04-21 18:17:50Z VZ $
// Copyright: (c) 2006 Francesco Montorsi
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ANIDECOD_H
#define _WX_ANIDECOD_H
#include "wx/defs.h"
#if wxUSE_STREAMS && wxUSE_ICO_CUR
#include "wx/stream.h"
#include "wx/image.h"
#include "wx/animdecod.h"
#include "wx/dynarray.h"
class /*WXDLLEXPORT*/ wxANIFrameInfo;
WX_DECLARE_EXPORTED_OBJARRAY(wxANIFrameInfo, wxANIFrameInfoArray);
WX_DECLARE_EXPORTED_OBJARRAY(wxImage, wxImageArray);
// --------------------------------------------------------------------------
// wxANIDecoder class
// --------------------------------------------------------------------------
class WXDLLEXPORT wxANIDecoder : public wxAnimationDecoder
{
public:
// constructor, destructor, etc.
wxANIDecoder();
~wxANIDecoder();
virtual wxSize GetFrameSize(unsigned int frame) const;
virtual wxPoint GetFramePosition(unsigned int frame) const;
virtual wxAnimationDisposal GetDisposalMethod(unsigned int frame) const;
virtual long GetDelay(unsigned int frame) const;
virtual wxColour GetTransparentColour(unsigned int frame) const;
// implementation of wxAnimationDecoder's pure virtuals
virtual bool CanRead( wxInputStream& stream ) const;
virtual bool Load( wxInputStream& stream );
bool ConvertToImage(unsigned int frame, wxImage *image) const;
wxAnimationDecoder *Clone() const
{ return new wxANIDecoder; }
wxAnimationType GetType() const
{ return wxANIMATION_TYPE_ANI; }
private:
// frames stored as wxImage(s): ANI files are meant to be used mostly for animated
// cursors and thus they do not use any optimization to encode differences between
// two frames: they are just a list of images to display sequentially.
wxImageArray m_images;
// the info about each image stored in m_images.
// NB: m_info.GetCount() may differ from m_images.GetCount()!
wxANIFrameInfoArray m_info;
// this is the wxCURHandler used to load the ICON chunk of the ANI files
static wxCURHandler sm_handler;
DECLARE_NO_COPY_CLASS(wxANIDecoder)
};
#endif // wxUSE_STREAM && wxUSE_ICO_CUR
#endif // _WX_ANIDECOD_H

View File

@ -1,124 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/animate.h
// Purpose: wxAnimation and wxAnimationCtrl
// Author: Julian Smart and Guillermo Rodriguez Garcia
// Modified by: Francesco Montorsi
// Created: 13/8/99
// RCS-ID: $Id: animate.h 53135 2008-04-12 02:31:04Z VZ $
// Copyright: (c) Julian Smart and Guillermo Rodriguez Garcia
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ANIMATE_H_
#define _WX_ANIMATE_H_
#include "wx/defs.h"
#if wxUSE_ANIMATIONCTRL
#include "wx/animdecod.h"
#include "wx/control.h"
#include "wx/timer.h"
#include "wx/bitmap.h"
class WXDLLIMPEXP_FWD_ADV wxAnimation;
extern WXDLLIMPEXP_DATA_ADV(wxAnimation) wxNullAnimation;
extern WXDLLIMPEXP_DATA_ADV(const wxChar) wxAnimationCtrlNameStr[];
// ----------------------------------------------------------------------------
// wxAnimationBase
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_ADV wxAnimationBase : public wxGDIObject
{
public:
wxAnimationBase() {}
virtual bool IsOk() const = 0;
// can be -1
virtual int GetDelay(unsigned int frame) const = 0;
virtual unsigned int GetFrameCount() const = 0;
virtual wxImage GetFrame(unsigned int frame) const = 0;
virtual wxSize GetSize() const = 0;
virtual bool LoadFile(const wxString& name,
wxAnimationType type = wxANIMATION_TYPE_ANY) = 0;
virtual bool Load(wxInputStream& stream,
wxAnimationType type = wxANIMATION_TYPE_ANY) = 0;
protected:
DECLARE_ABSTRACT_CLASS(wxAnimationBase)
};
// ----------------------------------------------------------------------------
// wxAnimationCtrlBase
// ----------------------------------------------------------------------------
// do not autoresize to the animation's size when SetAnimation() is called
#define wxAC_NO_AUTORESIZE (0x0010)
// default style does not include wxAC_NO_AUTORESIZE, that is, the control
// auto-resizes by default to fit the new animation when SetAnimation() is called
#define wxAC_DEFAULT_STYLE (wxNO_BORDER)
class WXDLLIMPEXP_ADV wxAnimationCtrlBase : public wxControl
{
public:
wxAnimationCtrlBase() { }
// public API
virtual bool LoadFile(const wxString& filename,
wxAnimationType type = wxANIMATION_TYPE_ANY) = 0;
virtual void SetAnimation(const wxAnimation &anim) = 0;
virtual wxAnimation GetAnimation() const = 0;
virtual bool Play() = 0;
virtual void Stop() = 0;
virtual bool IsPlaying() const = 0;
virtual void SetInactiveBitmap(const wxBitmap &bmp);
// always return the original bitmap set in this control
wxBitmap GetInactiveBitmap() const
{ return m_bmpStatic; }
protected:
// the inactive bitmap as it was set by the user
wxBitmap m_bmpStatic;
// the inactive bitmap currently shown in the control
// (may differ in the size from m_bmpStatic)
wxBitmap m_bmpStaticReal;
// updates m_bmpStaticReal from m_bmpStatic if needed
virtual void UpdateStaticImage();
// called by SetInactiveBitmap
virtual void DisplayStaticImage() = 0;
private:
DECLARE_ABSTRACT_CLASS(wxAnimationCtrlBase)
};
// ----------------------------------------------------------------------------
// include the platform-specific version of the wxAnimationCtrl class
// ----------------------------------------------------------------------------
#if defined(__WXGTK20__) && !defined(__WXUNIVERSAL__)
#include "wx/gtk/animate.h"
#else
#include "wx/generic/animate.h"
#endif
#endif // wxUSE_ANIMATIONCTRL
#endif // _WX_ANIMATE_H_

View File

@ -1,146 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/animdecod.h
// Purpose: wxAnimationDecoder
// Author: Francesco Montorsi
// CVS-ID: $Id: animdecod.h 49563 2007-10-31 20:46:21Z VZ $
// Copyright: (c) 2006 Francesco Montorsi
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ANIMDECOD_H
#define _WX_ANIMDECOD_H
#include "wx/defs.h"
#if wxUSE_STREAMS
#include "wx/colour.h"
#include "wx/gdicmn.h"
class WXDLLIMPEXP_FWD_BASE wxInputStream;
class WXDLLIMPEXP_FWD_CORE wxImage;
/*
Differences between a wxAnimationDecoder and a wxImageHandler:
1) wxImageHandlers always load an input stream directly into a given wxImage
object converting from the format-specific data representation to the
wxImage native format (RGB24).
wxAnimationDecoders always load an input stream using some optimized format
to store it which is format-depedent. This allows to store a (possibly big)
animation using a format which is a good compromise between required memory
and time required to blit in on the screen.
2) wxAnimationDecoders contain the animation data in some internal var.
That's why they derive from wxObjectRefData: they are data which can be shared.
3) wxAnimationDecoders can be used by a wxImageHandler to retrieve a frame
in wxImage format; the viceversa cannot be done.
4) wxAnimationDecoders are decoders only, thus do not support save features.
5) wxAnimationDecoders are directly used by wxAnimation (generic implementation)
as wxObjectRefData while they need to be 'wrapped' by a wxImageHandler for
wxImage uses.
*/
// --------------------------------------------------------------------------
// Constants
// --------------------------------------------------------------------------
// NB: the values of these enum items are not casual but coincide with the
// GIF disposal codes. Do not change them !!
enum wxAnimationDisposal
{
// No disposal specified. The decoder is not required to take any action.
wxANIM_UNSPECIFIED = -1,
// Do not dispose. The graphic is to be left in place.
wxANIM_DONOTREMOVE = 0,
// Restore to background color. The area used by the graphic must be
// restored to the background color.
wxANIM_TOBACKGROUND = 1,
// Restore to previous. The decoder is required to restore the area
// overwritten by the graphic with what was there prior to rendering the graphic.
wxANIM_TOPREVIOUS = 2
};
enum wxAnimationType
{
wxANIMATION_TYPE_INVALID,
wxANIMATION_TYPE_GIF,
wxANIMATION_TYPE_ANI,
wxANIMATION_TYPE_ANY
};
// --------------------------------------------------------------------------
// wxAnimationDecoder class
// --------------------------------------------------------------------------
class WXDLLEXPORT wxAnimationDecoder : public wxObjectRefData
{
public:
wxAnimationDecoder()
{
m_background = wxNullColour;
m_nFrames = 0;
}
virtual ~wxAnimationDecoder() { }
virtual bool Load( wxInputStream& stream ) = 0;
virtual bool CanRead( wxInputStream& stream ) const = 0;
virtual wxAnimationDecoder *Clone() const = 0;
virtual wxAnimationType GetType() const = 0;
// convert given frame to wxImage
virtual bool ConvertToImage(unsigned int frame, wxImage *image) const = 0;
// frame specific data getters
// not all frames may be of the same size; e.g. GIF allows to
// specify that between two frames only a smaller portion of the
// entire animation has changed.
virtual wxSize GetFrameSize(unsigned int frame) const = 0;
// the position of this frame in case it's not as big as m_szAnimation
// or wxPoint(0,0) otherwise.
virtual wxPoint GetFramePosition(unsigned int frame) const = 0;
// what should be done after displaying this frame.
virtual wxAnimationDisposal GetDisposalMethod(unsigned int frame) const = 0;
// the number of milliseconds this frame should be displayed.
// if returns -1 then the frame must be displayed forever.
virtual long GetDelay(unsigned int frame) const = 0;
// the transparent colour for this frame if any or wxNullColour.
virtual wxColour GetTransparentColour(unsigned int frame) const = 0;
// get global data
wxSize GetAnimationSize() const { return m_szAnimation; }
wxColour GetBackgroundColour() const { return m_background; }
unsigned int GetFrameCount() const { return m_nFrames; }
protected:
wxSize m_szAnimation;
unsigned int m_nFrames;
// this is the colour to use for the wxANIM_TOBACKGROUND disposal.
// if not specified by the animation, it's set to wxNullColour
wxColour m_background;
};
#endif // wxUSE_STREAM
#endif // _WX_ANIMDECOD_H

View File

@ -1,708 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/app.h
// Purpose: wxAppBase class and macros used for declaration of wxApp
// derived class in the user code
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: app.h 51592 2008-02-08 08:17:41Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_APP_H_BASE_
#define _WX_APP_H_BASE_
// ----------------------------------------------------------------------------
// headers we have to include here
// ----------------------------------------------------------------------------
#include "wx/event.h" // for the base class
#include "wx/build.h"
#include "wx/init.h" // we must declare wxEntry()
#include "wx/intl.h" // for wxLayoutDirection
class WXDLLIMPEXP_FWD_BASE wxAppConsole;
class WXDLLIMPEXP_FWD_BASE wxAppTraits;
class WXDLLIMPEXP_FWD_BASE wxCmdLineParser;
class WXDLLIMPEXP_FWD_BASE wxLog;
class WXDLLIMPEXP_FWD_BASE wxMessageOutput;
#if wxUSE_GUI
class WXDLLIMPEXP_FWD_BASE wxEventLoop;
struct WXDLLIMPEXP_FWD_CORE wxVideoMode;
#endif
// ----------------------------------------------------------------------------
// typedefs
// ----------------------------------------------------------------------------
// the type of the function used to create a wxApp object on program start up
typedef wxAppConsole* (*wxAppInitializerFunction)();
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
enum
{
wxPRINT_WINDOWS = 1,
wxPRINT_POSTSCRIPT = 2
};
// ----------------------------------------------------------------------------
// wxAppConsole: wxApp for non-GUI applications
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxAppConsole : public wxEvtHandler
{
public:
// ctor and dtor
wxAppConsole();
virtual ~wxAppConsole();
// the virtual functions which may/must be overridden in the derived class
// -----------------------------------------------------------------------
// This is the very first function called for a newly created wxApp object,
// it is used by the library to do the global initialization. If, for some
// reason, you must override it (instead of just overriding OnInit(), as
// usual, for app-specific initializations), do not forget to call the base
// class version!
virtual bool Initialize(int& argc, wxChar **argv);
// This gives wxCocoa a chance to call OnInit() with a memory pool in place
virtual bool CallOnInit() { return OnInit(); }
// Called before OnRun(), this is a good place to do initialization -- if
// anything fails, return false from here to prevent the program from
// continuing. The command line is normally parsed here, call the base
// class OnInit() to do it.
virtual bool OnInit();
// this is here only temporary hopefully (FIXME)
virtual bool OnInitGui() { return true; }
// This is the replacement for the normal main(): all program work should
// be done here. When OnRun() returns, the programs starts shutting down.
virtual int OnRun() = 0;
// This is only called if OnInit() returned true so it's a good place to do
// any cleanup matching the initializations done there.
virtual int OnExit();
// This is the very last function called on wxApp object before it is
// destroyed. If you override it (instead of overriding OnExit() as usual)
// do not forget to call the base class version!
virtual void CleanUp();
// Called when a fatal exception occurs, this function should take care not
// to do anything which might provoke a nested exception! It may be
// overridden if you wish to react somehow in non-default way (core dump
// under Unix, application crash under Windows) to fatal program errors,
// however extreme care should be taken if you don't want this function to
// crash.
virtual void OnFatalException() { }
// Called from wxExit() function, should terminate the application a.s.a.p.
virtual void Exit();
// application info: name, description, vendor
// -------------------------------------------
// NB: all these should be set by the application itself, there are no
// reasonable default except for the application name which is taken to
// be argv[0]
// set/get the application name
wxString GetAppName() const
{
return m_appName.empty() ? m_className : m_appName;
}
void SetAppName(const wxString& name) { m_appName = name; }
// set/get the app class name
wxString GetClassName() const { return m_className; }
void SetClassName(const wxString& name) { m_className = name; }
// set/get the vendor name
const wxString& GetVendorName() const { return m_vendorName; }
void SetVendorName(const wxString& name) { m_vendorName = name; }
// cmd line parsing stuff
// ----------------------
// all of these methods may be overridden in the derived class to
// customize the command line parsing (by default only a few standard
// options are handled)
//
// you also need to call wxApp::OnInit() from YourApp::OnInit() for all
// this to work
#if wxUSE_CMDLINE_PARSER
// this one is called from OnInit() to add all supported options
// to the given parser (don't forget to call the base class version if you
// override it!)
virtual void OnInitCmdLine(wxCmdLineParser& parser);
// called after successfully parsing the command line, return true
// to continue and false to exit (don't forget to call the base class
// version if you override it!)
virtual bool OnCmdLineParsed(wxCmdLineParser& parser);
// called if "--help" option was specified, return true to continue
// and false to exit
virtual bool OnCmdLineHelp(wxCmdLineParser& parser);
// called if incorrect command line options were given, return
// false to abort and true to continue
virtual bool OnCmdLineError(wxCmdLineParser& parser);
#endif // wxUSE_CMDLINE_PARSER
// miscellaneous customization functions
// -------------------------------------
// create the app traits object to which we delegate for everything which
// either should be configurable by the user (then he can change the
// default behaviour simply by overriding CreateTraits() and returning his
// own traits object) or which is GUI/console dependent as then wxAppTraits
// allows us to abstract the differences behind the common façade
wxAppTraits *GetTraits();
// the functions below shouldn't be used now that we have wxAppTraits
#if WXWIN_COMPATIBILITY_2_4
#if wxUSE_LOG
// override this function to create default log target of arbitrary
// user-defined class (default implementation creates a wxLogGui
// object) -- this log object is used by default by all wxLogXXX()
// functions.
wxDEPRECATED( virtual wxLog *CreateLogTarget() );
#endif // wxUSE_LOG
// similar to CreateLogTarget() but for the global wxMessageOutput
// object
wxDEPRECATED( virtual wxMessageOutput *CreateMessageOutput() );
#endif // WXWIN_COMPATIBILITY_2_4
// event processing functions
// --------------------------
// this method allows to filter all the events processed by the program, so
// you should try to return quickly from it to avoid slowing down the
// program to the crawl
//
// return value should be -1 to continue with the normal event processing,
// or TRUE or FALSE to stop further processing and pretend that the event
// had been already processed or won't be processed at all, respectively
virtual int FilterEvent(wxEvent& event);
#if wxUSE_EXCEPTIONS
// call the specified handler on the given object with the given event
//
// this method only exists to allow catching the exceptions thrown by any
// event handler, it would lead to an extra (useless) virtual function call
// if the exceptions were not used, so it doesn't even exist in that case
virtual void HandleEvent(wxEvtHandler *handler,
wxEventFunction func,
wxEvent& event) const;
// Called when an unhandled C++ exception occurs inside OnRun(): note that
// the exception type is lost by now, so if you really want to handle the
// exception you should override OnRun() and put a try/catch around
// MainLoop() call there or use OnExceptionInMainLoop()
virtual void OnUnhandledException() { }
#endif // wxUSE_EXCEPTIONS
// process all events in the wxPendingEvents list -- it is necessary to
// call this function to process posted events. This happens during each
// event loop iteration in GUI mode but if there is no main loop, it may be
// also called directly.
virtual void ProcessPendingEvents();
// doesn't do anything in this class, just a hook for GUI wxApp
virtual bool Yield(bool WXUNUSED(onlyIfNeeded) = false) { return true; }
// make sure that idle events are sent again
virtual void WakeUpIdle() { }
// this is just a convenience: by providing its implementation here we
// avoid #ifdefs in the code using it
static bool IsMainLoopRunning() { return false; }
// debugging support
// -----------------
#ifdef __WXDEBUG__
// this function is called when an assert failure occurs, the base class
// version does the normal processing (i.e. shows the usual assert failure
// dialog box)
//
// the arguments are the location of the failed assert (func may be empty
// if the compiler doesn't support C99 __FUNCTION__), the text of the
// assert itself and the user-specified message
virtual void OnAssertFailure(const wxChar *file,
int line,
const wxChar *func,
const wxChar *cond,
const wxChar *msg);
// old version of the function without func parameter, for compatibility
// only, override OnAssertFailure() in the new code
virtual void OnAssert(const wxChar *file,
int line,
const wxChar *cond,
const wxChar *msg);
#endif // __WXDEBUG__
// check that the wxBuildOptions object (constructed in the application
// itself, usually the one from IMPLEMENT_APP() macro) matches the build
// options of the library and abort if it doesn't
static bool CheckBuildOptions(const char *optionsSignature,
const char *componentName);
#if WXWIN_COMPATIBILITY_2_4
wxDEPRECATED( static bool CheckBuildOptions(const wxBuildOptions& buildOptions) );
#endif
// implementation only from now on
// -------------------------------
// helpers for dynamic wxApp construction
static void SetInitializerFunction(wxAppInitializerFunction fn)
{ ms_appInitFn = fn; }
static wxAppInitializerFunction GetInitializerFunction()
{ return ms_appInitFn; }
// accessors for ms_appInstance field (external code might wish to modify
// it, this is why we provide a setter here as well, but you should really
// know what you're doing if you call it), wxTheApp is usually used instead
// of GetInstance()
static wxAppConsole *GetInstance() { return ms_appInstance; }
static void SetInstance(wxAppConsole *app) { ms_appInstance = app; }
// command line arguments (public for backwards compatibility)
int argc;
wxChar **argv;
protected:
// the function which creates the traits object when GetTraits() needs it
// for the first time
virtual wxAppTraits *CreateTraits();
// function used for dynamic wxApp creation
static wxAppInitializerFunction ms_appInitFn;
// the one and only global application object
static wxAppConsole *ms_appInstance;
// application info (must be set from the user code)
wxString m_vendorName, // vendor name (ACME Inc)
m_appName, // app name
m_className; // class name
// the class defining the application behaviour, NULL initially and created
// by GetTraits() when first needed
wxAppTraits *m_traits;
// the application object is a singleton anyhow, there is no sense in
// copying it
DECLARE_NO_COPY_CLASS(wxAppConsole)
};
// ----------------------------------------------------------------------------
// wxAppBase: the common part of wxApp implementations for all platforms
// ----------------------------------------------------------------------------
#if wxUSE_GUI
class WXDLLIMPEXP_CORE wxAppBase : public wxAppConsole
{
public:
wxAppBase();
virtual ~wxAppBase();
// the virtual functions which may/must be overridden in the derived class
// -----------------------------------------------------------------------
// very first initialization function
//
// Override: very rarely
virtual bool Initialize(int& argc, wxChar **argv);
// a platform-dependent version of OnInit(): the code here is likely to
// depend on the toolkit. default version does nothing.
//
// Override: rarely.
virtual bool OnInitGui();
// called to start program execution - the default version just enters
// the main GUI loop in which events are received and processed until
// the last window is not deleted (if GetExitOnFrameDelete) or
// ExitMainLoop() is called. In console mode programs, the execution
// of the program really starts here
//
// Override: rarely in GUI applications, always in console ones.
virtual int OnRun();
// a matching function for OnInit()
virtual int OnExit();
// very last clean up function
//
// Override: very rarely
virtual void CleanUp();
// the worker functions - usually not used directly by the user code
// -----------------------------------------------------------------
// return true if we're running main loop, i.e. if the events can
// (already) be dispatched
static bool IsMainLoopRunning()
{
wxAppBase *app = wx_static_cast(wxAppBase *, GetInstance());
return app && app->m_mainLoop != NULL;
}
// execute the main GUI loop, the function returns when the loop ends
virtual int MainLoop();
// exit the main loop thus terminating the application
virtual void Exit();
// exit the main GUI loop during the next iteration (i.e. it does not
// stop the program immediately!)
virtual void ExitMainLoop();
// returns true if there are unprocessed events in the event queue
virtual bool Pending();
// process the first event in the event queue (blocks until an event
// appears if there are none currently, use Pending() if this is not
// wanted), returns false if the event loop should stop and true
// otherwise
virtual bool Dispatch();
// process all currently pending events right now
//
// it is an error to call Yield() recursively unless the value of
// onlyIfNeeded is true
//
// WARNING: this function is dangerous as it can lead to unexpected
// reentrancies (i.e. when called from an event handler it
// may result in calling the same event handler again), use
// with _extreme_ care or, better, don't use at all!
virtual bool Yield(bool onlyIfNeeded = false) = 0;
// this virtual function is called in the GUI mode when the application
// becomes idle and normally just sends wxIdleEvent to all interested
// parties
//
// it should return true if more idle events are needed, false if not
virtual bool ProcessIdle();
// Send idle event to window and all subwindows
// Returns true if more idle time is requested.
virtual bool SendIdleEvents(wxWindow* win, wxIdleEvent& event);
#if wxUSE_EXCEPTIONS
// Function called if an uncaught exception is caught inside the main
// event loop: it may return true to continue running the event loop or
// false to stop it (in the latter case it may rethrow the exception as
// well)
virtual bool OnExceptionInMainLoop();
#endif // wxUSE_EXCEPTIONS
// top level window functions
// --------------------------
// return true if our app has focus
virtual bool IsActive() const { return m_isActive; }
// set the "main" top level window
void SetTopWindow(wxWindow *win) { m_topWindow = win; }
// return the "main" top level window (if it hadn't been set previously
// with SetTopWindow(), will return just some top level window and, if
// there are none, will return NULL)
virtual wxWindow *GetTopWindow() const;
// control the exit behaviour: by default, the program will exit the
// main loop (and so, usually, terminate) when the last top-level
// program window is deleted. Beware that if you disable this behaviour
// (with SetExitOnFrameDelete(false)), you'll have to call
// ExitMainLoop() explicitly from somewhere.
void SetExitOnFrameDelete(bool flag)
{ m_exitOnFrameDelete = flag ? Yes : No; }
bool GetExitOnFrameDelete() const
{ return m_exitOnFrameDelete == Yes; }
// display mode, visual, printing mode, ...
// ------------------------------------------------------------------------
// Get display mode that is used use. This is only used in framebuffer
// wxWin ports (such as wxMGL or wxDFB).
virtual wxVideoMode GetDisplayMode() const;
// Set display mode to use. This is only used in framebuffer wxWin
// ports (such as wxMGL or wxDFB). This method should be called from
// wxApp::OnInitGui
virtual bool SetDisplayMode(const wxVideoMode& WXUNUSED(info)) { return true; }
// set use of best visual flag (see below)
void SetUseBestVisual( bool flag, bool forceTrueColour = false )
{ m_useBestVisual = flag; m_forceTrueColour = forceTrueColour; }
bool GetUseBestVisual() const { return m_useBestVisual; }
// set/get printing mode: see wxPRINT_XXX constants.
//
// default behaviour is the normal one for Unix: always use PostScript
// printing.
virtual void SetPrintMode(int WXUNUSED(mode)) { }
int GetPrintMode() const { return wxPRINT_POSTSCRIPT; }
// Return the layout direction for the current locale or wxLayout_Default
// if it's unknown
virtual wxLayoutDirection GetLayoutDirection() const;
// command line parsing (GUI-specific)
// ------------------------------------------------------------------------
#if wxUSE_CMDLINE_PARSER
virtual bool OnCmdLineParsed(wxCmdLineParser& parser);
virtual void OnInitCmdLine(wxCmdLineParser& parser);
#endif
// miscellaneous other stuff
// ------------------------------------------------------------------------
// called by toolkit-specific code to set the app status: active (we have
// focus) or not and also the last window which had focus before we were
// deactivated
virtual void SetActive(bool isActive, wxWindow *lastFocus);
#if WXWIN_COMPATIBILITY_2_6
// OBSOLETE: don't use, always returns true
//
// returns true if the program is successfully initialized
wxDEPRECATED( bool Initialized() );
#endif // WXWIN_COMPATIBILITY_2_6
// perform standard OnIdle behaviour, ensure that this is always called
void OnIdle(wxIdleEvent& event);
protected:
// delete all objects in wxPendingDelete list
void DeletePendingObjects();
// override base class method to use GUI traits
virtual wxAppTraits *CreateTraits();
// the main event loop of the application (may be NULL if the loop hasn't
// been started yet or has already terminated)
wxEventLoop *m_mainLoop;
// the main top level window (may be NULL)
wxWindow *m_topWindow;
// if Yes, exit the main loop when the last top level window is deleted, if
// No don't do it and if Later -- only do it once we reach our OnRun()
//
// the explanation for using this strange scheme is given in appcmn.cpp
enum
{
Later = -1,
No,
Yes
} m_exitOnFrameDelete;
// true if the app wants to use the best visual on systems where
// more than one are available (Sun, SGI, XFree86 4.0 ?)
bool m_useBestVisual;
// force TrueColour just in case "best" isn't TrueColour
bool m_forceTrueColour;
// does any of our windows have focus?
bool m_isActive;
DECLARE_NO_COPY_CLASS(wxAppBase)
};
#if WXWIN_COMPATIBILITY_2_6
inline bool wxAppBase::Initialized() { return true; }
#endif // WXWIN_COMPATIBILITY_2_6
#endif // wxUSE_GUI
// ----------------------------------------------------------------------------
// now include the declaration of the real class
// ----------------------------------------------------------------------------
#if wxUSE_GUI
#if defined(__WXPALMOS__)
#include "wx/palmos/app.h"
#elif defined(__WXMSW__)
#include "wx/msw/app.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/app.h"
#elif defined(__WXMGL__)
#include "wx/mgl/app.h"
#elif defined(__WXDFB__)
#include "wx/dfb/app.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/app.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/app.h"
#elif defined(__WXX11__)
#include "wx/x11/app.h"
#elif defined(__WXMAC__)
#include "wx/mac/app.h"
#elif defined(__WXCOCOA__)
#include "wx/cocoa/app.h"
#elif defined(__WXPM__)
#include "wx/os2/app.h"
#endif
#else // !GUI
// allow using just wxApp (instead of wxAppConsole) in console programs
typedef wxAppConsole wxApp;
#endif // GUI/!GUI
// ----------------------------------------------------------------------------
// the global data
// ----------------------------------------------------------------------------
// for compatibility, we define this macro to access the global application
// object of type wxApp
//
// note that instead of using of wxTheApp in application code you should
// consider using DECLARE_APP() after which you may call wxGetApp() which will
// return the object of the correct type (i.e. MyApp and not wxApp)
//
// the cast is safe as in GUI build we only use wxApp, not wxAppConsole, and in
// console mode it does nothing at all
#define wxTheApp wx_static_cast(wxApp*, wxApp::GetInstance())
// ----------------------------------------------------------------------------
// global functions
// ----------------------------------------------------------------------------
// event loop related functions only work in GUI programs
// ------------------------------------------------------
// Force an exit from main loop
extern void WXDLLIMPEXP_BASE wxExit();
// avoid redeclaring this function here if it had been already declated by
// wx/utils.h, this results in warnings from g++ with -Wredundant-decls
#ifndef wx_YIELD_DECLARED
#define wx_YIELD_DECLARED
// Yield to other apps/messages
extern bool WXDLLIMPEXP_BASE wxYield();
#endif // wx_YIELD_DECLARED
// Yield to other apps/messages
extern void WXDLLIMPEXP_BASE wxWakeUpIdle();
// ----------------------------------------------------------------------------
// macros for dynamic creation of the application object
// ----------------------------------------------------------------------------
// Having a global instance of this class allows wxApp to be aware of the app
// creator function. wxApp can then call this function to create a new app
// object. Convoluted, but necessary.
class WXDLLIMPEXP_BASE wxAppInitializer
{
public:
wxAppInitializer(wxAppInitializerFunction fn)
{ wxApp::SetInitializerFunction(fn); }
};
// the code below defines a IMPLEMENT_WXWIN_MAIN macro which you can use if
// your compiler really, really wants main() to be in your main program (e.g.
// hello.cpp). Now IMPLEMENT_APP should add this code if required.
#define IMPLEMENT_WXWIN_MAIN_CONSOLE \
int main(int argc, char **argv) { return wxEntry(argc, argv); }
// port-specific header could have defined it already in some special way
#ifndef IMPLEMENT_WXWIN_MAIN
#define IMPLEMENT_WXWIN_MAIN IMPLEMENT_WXWIN_MAIN_CONSOLE
#endif // defined(IMPLEMENT_WXWIN_MAIN)
#ifdef __WXUNIVERSAL__
#include "wx/univ/theme.h"
#ifdef wxUNIV_DEFAULT_THEME
#define IMPLEMENT_WX_THEME_SUPPORT \
WX_USE_THEME(wxUNIV_DEFAULT_THEME);
#else
#define IMPLEMENT_WX_THEME_SUPPORT
#endif
#else
#define IMPLEMENT_WX_THEME_SUPPORT
#endif
// Use this macro if you want to define your own main() or WinMain() function
// and call wxEntry() from there.
#define IMPLEMENT_APP_NO_MAIN(appname) \
wxAppConsole *wxCreateApp() \
{ \
wxAppConsole::CheckBuildOptions(WX_BUILD_OPTIONS_SIGNATURE, \
"your program"); \
return new appname; \
} \
wxAppInitializer \
wxTheAppInitializer((wxAppInitializerFunction) wxCreateApp); \
DECLARE_APP(appname) \
appname& wxGetApp() { return *wx_static_cast(appname*, wxApp::GetInstance()); }
// Same as IMPLEMENT_APP() normally but doesn't include themes support in
// wxUniversal builds
#define IMPLEMENT_APP_NO_THEMES(appname) \
IMPLEMENT_APP_NO_MAIN(appname) \
IMPLEMENT_WXWIN_MAIN
// Use this macro exactly once, the argument is the name of the wxApp-derived
// class which is the class of your application.
#define IMPLEMENT_APP(appname) \
IMPLEMENT_APP_NO_THEMES(appname) \
IMPLEMENT_WX_THEME_SUPPORT
// Same as IMPLEMENT_APP(), but for console applications.
#define IMPLEMENT_APP_CONSOLE(appname) \
IMPLEMENT_APP_NO_MAIN(appname) \
IMPLEMENT_WXWIN_MAIN_CONSOLE
// this macro can be used multiple times and just allows you to use wxGetApp()
// function
#define DECLARE_APP(appname) extern appname& wxGetApp();
// declare the stuff defined by IMPLEMENT_APP() macro, it's not really needed
// anywhere else but at the very least it suppresses icc warnings about
// defining extern symbols without prior declaration, and it shouldn't do any
// harm
extern wxAppConsole *wxCreateApp();
extern wxAppInitializer wxTheAppInitializer;
#endif // _WX_APP_H_BASE_

View File

@ -1,272 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/apptrait.h
// Purpose: declaration of wxAppTraits and derived classes
// Author: Vadim Zeitlin
// Modified by:
// Created: 19.06.2003
// RCS-ID: $Id: apptrait.h 49804 2007-11-10 01:09:42Z VZ $
// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_APPTRAIT_H_
#define _WX_APPTRAIT_H_
#include "wx/string.h"
#include "wx/platinfo.h"
class WXDLLIMPEXP_FWD_BASE wxObject;
class WXDLLIMPEXP_FWD_BASE wxAppTraits;
#if wxUSE_FONTMAP
class WXDLLIMPEXP_FWD_CORE wxFontMapper;
#endif // wxUSE_FONTMAP
class WXDLLIMPEXP_FWD_BASE wxLog;
class WXDLLIMPEXP_FWD_BASE wxMessageOutput;
class WXDLLIMPEXP_FWD_CORE wxRendererNative;
class WXDLLIMPEXP_FWD_BASE wxString;
class GSocketGUIFunctionsTable;
// ----------------------------------------------------------------------------
// wxAppTraits: this class defines various configurable aspects of wxApp
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_BASE wxStandardPathsBase;
class WXDLLIMPEXP_BASE wxAppTraitsBase
{
public:
// needed since this class declares virtual members
virtual ~wxAppTraitsBase() { }
// hooks for creating the global objects, may be overridden by the user
// ------------------------------------------------------------------------
#if wxUSE_LOG
// create the default log target
virtual wxLog *CreateLogTarget() = 0;
#endif // wxUSE_LOG
// create the global object used for printing out messages
virtual wxMessageOutput *CreateMessageOutput() = 0;
#if wxUSE_FONTMAP
// create the global font mapper object used for encodings/charset mapping
virtual wxFontMapper *CreateFontMapper() = 0;
#endif // wxUSE_FONTMAP
// get the renderer to use for drawing the generic controls (return value
// may be NULL in which case the default renderer for the current platform
// is used); this is used in GUI only and always returns NULL in console
//
// NB: returned pointer will be deleted by the caller
virtual wxRendererNative *CreateRenderer() = 0;
#if wxUSE_STDPATHS
// wxStandardPaths object is normally the same for wxBase and wxGUI
// except in the case of wxMac and wxCocoa
virtual wxStandardPathsBase& GetStandardPaths();
#endif // wxUSE_STDPATHS
// functions abstracting differences between GUI and console modes
// ------------------------------------------------------------------------
#ifdef __WXDEBUG__
// show the assert dialog with the specified message in GUI or just print
// the string to stderr in console mode
//
// base class version has an implementation (in spite of being pure
// virtual) in base/appbase.cpp which can be called as last resort.
//
// return true to suppress subsequent asserts, false to continue as before
virtual bool ShowAssertDialog(const wxString& msg) = 0;
#endif // __WXDEBUG__
// return true if fprintf(stderr) goes somewhere, false otherwise
virtual bool HasStderr() = 0;
// managing "pending delete" list: in GUI mode we can't immediately delete
// some objects because there may be unprocessed events for them and so we
// only do it during the next idle loop iteration while this is, of course,
// unnecessary in wxBase, so we have a few functions to abstract these
// operations
// add the object to the pending delete list in GUI, delete it immediately
// in wxBase
virtual void ScheduleForDestroy(wxObject *object) = 0;
// remove this object from the pending delete list in GUI, do nothing in
// wxBase
virtual void RemoveFromPendingDelete(wxObject *object) = 0;
#if wxUSE_SOCKETS
// return table of GUI callbacks for GSocket code or NULL in wxBase. This
// is needed because networking classes are in their own library and so
// they can't directly call GUI functions (the same net library can be
// used in both GUI and base apps). To complicate it further, GUI library
// ("wxCore") doesn't depend on networking library and so only a functions
// table can be passed around
virtual GSocketGUIFunctionsTable* GetSocketGUIFunctionsTable() = 0;
#endif
// return information about the (native) toolkit currently used and its
// runtime (not compile-time) version.
// returns wxPORT_BASE for console applications and one of the remaining
// wxPORT_* values for GUI applications.
virtual wxPortId GetToolkitVersion(int *majVer, int *minVer) const = 0;
// return true if the port is using wxUniversal for the GUI, false if not
virtual bool IsUsingUniversalWidgets() const = 0;
// return the name of the Desktop Environment such as
// "KDE" or "GNOME". May return an empty string.
virtual wxString GetDesktopEnvironment() const { return wxEmptyString; }
protected:
#if wxUSE_STACKWALKER && defined( __WXDEBUG__ )
// utility function: returns the stack frame as a plain wxString
virtual wxString GetAssertStackTrace();
#endif
};
// ----------------------------------------------------------------------------
// include the platform-specific version of the class
// ----------------------------------------------------------------------------
// NB: test for __UNIX__ before __WXMAC__ as under Darwin we want to use the
// Unix code (and otherwise __UNIX__ wouldn't be defined)
// ABX: check __WIN32__ instead of __WXMSW__ for the same MSWBase in any Win32 port
#if defined(__WXPALMOS__)
#include "wx/palmos/apptbase.h"
#elif defined(__WIN32__)
#include "wx/msw/apptbase.h"
#elif defined(__UNIX__) && !defined(__EMX__)
#include "wx/unix/apptbase.h"
#elif defined(__WXMAC__)
#include "wx/mac/apptbase.h"
#elif defined(__OS2__)
#include "wx/os2/apptbase.h"
#else // no platform-specific methods to add to wxAppTraits
// wxAppTraits must be a class because it was forward declared as class
class WXDLLIMPEXP_BASE wxAppTraits : public wxAppTraitsBase
{
};
#endif // platform
// ============================================================================
// standard traits for console and GUI applications
// ============================================================================
// ----------------------------------------------------------------------------
// wxConsoleAppTraitsBase: wxAppTraits implementation for the console apps
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxConsoleAppTraitsBase : public wxAppTraits
{
public:
#if wxUSE_LOG
virtual wxLog *CreateLogTarget();
#endif // wxUSE_LOG
virtual wxMessageOutput *CreateMessageOutput();
#if wxUSE_FONTMAP
virtual wxFontMapper *CreateFontMapper();
#endif // wxUSE_FONTMAP
virtual wxRendererNative *CreateRenderer();
#if wxUSE_SOCKETS
virtual GSocketGUIFunctionsTable* GetSocketGUIFunctionsTable();
#endif
#ifdef __WXDEBUG__
virtual bool ShowAssertDialog(const wxString& msg);
#endif // __WXDEBUG__
virtual bool HasStderr();
virtual void ScheduleForDestroy(wxObject *object);
virtual void RemoveFromPendingDelete(wxObject *object);
// the GetToolkitVersion for console application is always the same
virtual wxPortId GetToolkitVersion(int *verMaj, int *verMin) const
{
// no toolkits (wxBase is for console applications without GUI support)
// NB: zero means "no toolkit", -1 means "not initialized yet"
// so we must use zero here!
if (verMaj) *verMaj = 0;
if (verMin) *verMin = 0;
return wxPORT_BASE;
}
virtual bool IsUsingUniversalWidgets() const { return false; }
};
// ----------------------------------------------------------------------------
// wxGUIAppTraitsBase: wxAppTraits implementation for the GUI apps
// ----------------------------------------------------------------------------
#if wxUSE_GUI
class WXDLLEXPORT wxGUIAppTraitsBase : public wxAppTraits
{
public:
#if wxUSE_LOG
virtual wxLog *CreateLogTarget();
#endif // wxUSE_LOG
virtual wxMessageOutput *CreateMessageOutput();
#if wxUSE_FONTMAP
virtual wxFontMapper *CreateFontMapper();
#endif // wxUSE_FONTMAP
virtual wxRendererNative *CreateRenderer();
#if wxUSE_SOCKETS
virtual GSocketGUIFunctionsTable* GetSocketGUIFunctionsTable();
#endif
#ifdef __WXDEBUG__
virtual bool ShowAssertDialog(const wxString& msg);
#endif // __WXDEBUG__
virtual bool HasStderr();
virtual void ScheduleForDestroy(wxObject *object);
virtual void RemoveFromPendingDelete(wxObject *object);
virtual bool IsUsingUniversalWidgets() const
{
#ifdef __WXUNIVERSAL__
return true;
#else
return false;
#endif
}
};
#endif // wxUSE_GUI
// ----------------------------------------------------------------------------
// include the platform-specific version of the classes above
// ----------------------------------------------------------------------------
// ABX: check __WIN32__ instead of __WXMSW__ for the same MSWBase in any Win32 port
#if defined(__WXPALMOS__)
#include "wx/palmos/apptrait.h"
#elif defined(__WIN32__)
#include "wx/msw/apptrait.h"
#elif defined(__OS2__)
#include "wx/os2/apptrait.h"
#elif defined(__UNIX__)
#include "wx/unix/apptrait.h"
#elif defined(__WXMAC__)
#include "wx/mac/apptrait.h"
#elif defined(__DOS__)
#include "wx/msdos/apptrait.h"
#else
#if wxUSE_GUI
class wxGUIAppTraits : public wxGUIAppTraitsBase
{
};
#endif // wxUSE_GUI
class wxConsoleAppTraits: public wxConsoleAppTraitsBase
{
};
#endif // platform
#endif // _WX_APPTRAIT_H_

View File

@ -1,381 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/archive.h
// Purpose: Streams for archive formats
// Author: Mike Wetherell
// RCS-ID: $Id: archive.h 43445 2006-11-16 14:30:20Z MW $
// Copyright: (c) 2004 Mike Wetherell
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ARCHIVE_H__
#define _WX_ARCHIVE_H__
#include "wx/defs.h"
#if wxUSE_STREAMS && wxUSE_ARCHIVE_STREAMS
#include "wx/stream.h"
#include "wx/filename.h"
/////////////////////////////////////////////////////////////////////////////
// wxArchiveNotifier
class WXDLLIMPEXP_BASE wxArchiveNotifier
{
public:
virtual ~wxArchiveNotifier() { }
virtual void OnEntryUpdated(class wxArchiveEntry& entry) = 0;
};
/////////////////////////////////////////////////////////////////////////////
// wxArchiveEntry
//
// Holds an entry's meta data, such as filename and timestamp.
class WXDLLIMPEXP_BASE wxArchiveEntry : public wxObject
{
public:
virtual ~wxArchiveEntry() { }
virtual wxDateTime GetDateTime() const = 0;
virtual wxFileOffset GetSize() const = 0;
virtual wxFileOffset GetOffset() const = 0;
virtual bool IsDir() const = 0;
virtual bool IsReadOnly() const = 0;
virtual wxString GetInternalName() const = 0;
virtual wxPathFormat GetInternalFormat() const = 0;
virtual wxString GetName(wxPathFormat format = wxPATH_NATIVE) const = 0;
virtual void SetDateTime(const wxDateTime& dt) = 0;
virtual void SetSize(wxFileOffset size) = 0;
virtual void SetIsDir(bool isDir = true) = 0;
virtual void SetIsReadOnly(bool isReadOnly = true) = 0;
virtual void SetName(const wxString& name,
wxPathFormat format = wxPATH_NATIVE) = 0;
wxArchiveEntry *Clone() const { return DoClone(); }
void SetNotifier(wxArchiveNotifier& notifier);
virtual void UnsetNotifier() { m_notifier = NULL; }
protected:
wxArchiveEntry() : m_notifier(NULL) { }
wxArchiveEntry(const wxArchiveEntry& e) : wxObject(e), m_notifier(NULL) { }
virtual void SetOffset(wxFileOffset offset) = 0;
virtual wxArchiveEntry* DoClone() const = 0;
wxArchiveNotifier *GetNotifier() const { return m_notifier; }
wxArchiveEntry& operator=(const wxArchiveEntry& entry);
private:
wxArchiveNotifier *m_notifier;
DECLARE_ABSTRACT_CLASS(wxArchiveEntry)
};
/////////////////////////////////////////////////////////////////////////////
// wxArchiveInputStream
//
// GetNextEntry() returns an wxArchiveEntry object containing the meta-data
// for the next entry in the archive (and gives away ownership). Reading from
// the wxArchiveInputStream then returns the entry's data. Eof() becomes true
// after an attempt has been made to read past the end of the entry's data.
//
// When there are no more entries, GetNextEntry() returns NULL and sets Eof().
class WXDLLIMPEXP_BASE wxArchiveInputStream : public wxFilterInputStream
{
public:
typedef wxArchiveEntry entry_type;
virtual ~wxArchiveInputStream() { }
virtual bool OpenEntry(wxArchiveEntry& entry) = 0;
virtual bool CloseEntry() = 0;
wxArchiveEntry *GetNextEntry() { return DoGetNextEntry(); }
virtual char Peek() { return wxInputStream::Peek(); }
protected:
wxArchiveInputStream(wxInputStream& stream, wxMBConv& conv);
wxArchiveInputStream(wxInputStream *stream, wxMBConv& conv);
virtual wxArchiveEntry *DoGetNextEntry() = 0;
wxMBConv& GetConv() const { return m_conv; }
private:
wxMBConv& m_conv;
};
/////////////////////////////////////////////////////////////////////////////
// wxArchiveOutputStream
//
// PutNextEntry is used to create a new entry in the output archive, then
// the entry's data is written to the wxArchiveOutputStream.
//
// Only one entry can be open for output at a time; another call to
// PutNextEntry closes the current entry and begins the next.
//
// The overload 'bool PutNextEntry(wxArchiveEntry *entry)' takes ownership
// of the entry object.
class WXDLLIMPEXP_BASE wxArchiveOutputStream : public wxFilterOutputStream
{
public:
virtual ~wxArchiveOutputStream() { }
virtual bool PutNextEntry(wxArchiveEntry *entry) = 0;
virtual bool PutNextEntry(const wxString& name,
const wxDateTime& dt = wxDateTime::Now(),
wxFileOffset size = wxInvalidOffset) = 0;
virtual bool PutNextDirEntry(const wxString& name,
const wxDateTime& dt = wxDateTime::Now()) = 0;
virtual bool CopyEntry(wxArchiveEntry *entry,
wxArchiveInputStream& stream) = 0;
virtual bool CopyArchiveMetaData(wxArchiveInputStream& stream) = 0;
virtual bool CloseEntry() = 0;
protected:
wxArchiveOutputStream(wxOutputStream& stream, wxMBConv& conv);
wxArchiveOutputStream(wxOutputStream *stream, wxMBConv& conv);
wxMBConv& GetConv() const { return m_conv; }
private:
wxMBConv& m_conv;
};
/////////////////////////////////////////////////////////////////////////////
// wxArchiveIterator
//
// An input iterator that can be used to transfer an archive's catalog to
// a container.
#if wxUSE_STL || defined WX_TEST_ARCHIVE_ITERATOR
#include <iterator>
#include <utility>
template <class X, class Y> inline
void _wxSetArchiveIteratorValue(
X& val, Y entry, void *WXUNUSED(d))
{
val = X(entry);
}
template <class X, class Y, class Z> inline
void _wxSetArchiveIteratorValue(
std::pair<X, Y>& val, Z entry, Z WXUNUSED(d))
{
val = std::make_pair(X(entry->GetInternalName()), Y(entry));
}
#if defined _MSC_VER && _MSC_VER < 1300
template <class Arc, class T = Arc::entry_type*>
#else
template <class Arc, class T = typename Arc::entry_type*>
#endif
class wxArchiveIterator
{
public:
typedef std::input_iterator_tag iterator_category;
typedef T value_type;
typedef ptrdiff_t difference_type;
typedef T* pointer;
typedef T& reference;
wxArchiveIterator() : m_rep(NULL) { }
wxArchiveIterator(Arc& arc) {
typename Arc::entry_type* entry = arc.GetNextEntry();
m_rep = entry ? new Rep(arc, entry) : NULL;
}
wxArchiveIterator(const wxArchiveIterator& it) : m_rep(it.m_rep) {
if (m_rep)
m_rep->AddRef();
}
~wxArchiveIterator() {
if (m_rep)
m_rep->UnRef();
}
const T& operator *() const {
return m_rep->GetValue();
}
const T* operator ->() const {
return &**this;
}
wxArchiveIterator& operator =(const wxArchiveIterator& it) {
if (it.m_rep)
it.m_rep.AddRef();
if (m_rep)
m_rep.UnRef();
m_rep = it.m_rep;
return *this;
}
wxArchiveIterator& operator ++() {
m_rep = m_rep->Next();
return *this;
}
wxArchiveIterator operator ++(int) {
wxArchiveIterator it(*this);
++(*this);
return it;
}
bool operator ==(const wxArchiveIterator& j) const {
return m_rep == j.m_rep;
}
bool operator !=(const wxArchiveIterator& j) const {
return !(*this == j);
}
private:
class Rep {
Arc& m_arc;
typename Arc::entry_type* m_entry;
T m_value;
int m_ref;
public:
Rep(Arc& arc, typename Arc::entry_type* entry)
: m_arc(arc), m_entry(entry), m_value(), m_ref(1) { }
~Rep()
{ delete m_entry; }
void AddRef() {
m_ref++;
}
void UnRef() {
if (--m_ref == 0)
delete this;
}
Rep *Next() {
typename Arc::entry_type* entry = m_arc.GetNextEntry();
if (!entry) {
UnRef();
return NULL;
}
if (m_ref > 1) {
m_ref--;
return new Rep(m_arc, entry);
}
delete m_entry;
m_entry = entry;
m_value = T();
return this;
}
const T& GetValue() {
if (m_entry) {
_wxSetArchiveIteratorValue(m_value, m_entry, m_entry);
m_entry = NULL;
}
return m_value;
}
} *m_rep;
};
typedef wxArchiveIterator<wxArchiveInputStream> wxArchiveIter;
typedef wxArchiveIterator<wxArchiveInputStream,
std::pair<wxString, wxArchiveEntry*> > wxArchivePairIter;
#endif // wxUSE_STL || defined WX_TEST_ARCHIVE_ITERATOR
/////////////////////////////////////////////////////////////////////////////
// wxArchiveClassFactory
//
// A wxArchiveClassFactory instance for a particular archive type allows
// the creation of the other classes that may be needed.
void WXDLLIMPEXP_BASE wxUseArchiveClasses();
class WXDLLIMPEXP_BASE wxArchiveClassFactory : public wxFilterClassFactoryBase
{
public:
typedef wxArchiveEntry entry_type;
typedef wxArchiveInputStream instream_type;
typedef wxArchiveOutputStream outstream_type;
typedef wxArchiveNotifier notifier_type;
#if wxUSE_STL || defined WX_TEST_ARCHIVE_ITERATOR
typedef wxArchiveIter iter_type;
typedef wxArchivePairIter pairiter_type;
#endif
virtual ~wxArchiveClassFactory() { }
wxArchiveEntry *NewEntry() const
{ return DoNewEntry(); }
wxArchiveInputStream *NewStream(wxInputStream& stream) const
{ return DoNewStream(stream); }
wxArchiveOutputStream *NewStream(wxOutputStream& stream) const
{ return DoNewStream(stream); }
wxArchiveInputStream *NewStream(wxInputStream *stream) const
{ return DoNewStream(stream); }
wxArchiveOutputStream *NewStream(wxOutputStream *stream) const
{ return DoNewStream(stream); }
virtual wxString GetInternalName(
const wxString& name,
wxPathFormat format = wxPATH_NATIVE) const = 0;
void SetConv(wxMBConv& conv) { m_pConv = &conv; }
wxMBConv& GetConv() const
{ if (m_pConv) return *m_pConv; else return wxConvLocal; }
static const wxArchiveClassFactory *Find(const wxChar *protocol,
wxStreamProtocolType type
= wxSTREAM_PROTOCOL);
static const wxArchiveClassFactory *GetFirst();
const wxArchiveClassFactory *GetNext() const { return m_next; }
void PushFront() { Remove(); m_next = sm_first; sm_first = this; }
void Remove();
protected:
// old compilers don't support covarient returns, so 'Do' methods are
// used to simulate them
virtual wxArchiveEntry *DoNewEntry() const = 0;
virtual wxArchiveInputStream *DoNewStream(wxInputStream& stream) const = 0;
virtual wxArchiveOutputStream *DoNewStream(wxOutputStream& stream) const = 0;
virtual wxArchiveInputStream *DoNewStream(wxInputStream *stream) const = 0;
virtual wxArchiveOutputStream *DoNewStream(wxOutputStream *stream) const = 0;
wxArchiveClassFactory() : m_pConv(NULL), m_next(this) { }
wxArchiveClassFactory& operator=(const wxArchiveClassFactory& WXUNUSED(f))
{ return *this; }
private:
wxMBConv *m_pConv;
static wxArchiveClassFactory *sm_first;
wxArchiveClassFactory *m_next;
DECLARE_ABSTRACT_CLASS(wxArchiveClassFactory)
};
#endif // wxUSE_STREAMS && wxUSE_ARCHIVE_STREAMS
#endif // _WX_ARCHIVE_H__

View File

@ -1,120 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/arrimpl.cpp
// Purpose: helper file for implementation of dynamic lists
// Author: Vadim Zeitlin
// Modified by:
// Created: 16.10.97
// RCS-ID: $Id: arrimpl.cpp 34241 2005-05-22 12:10:55Z JS $
// Copyright: (c) 1997 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
/*****************************************************************************
* Purpose: implements methods of "template" class declared in *
* DECLARE_OBJARRAY macro and which couldn't be implemented inline *
* (because they need the full definition of type T in scope) *
* *
* Usage: 1) #include dynarray.h *
* 2) WX_DECLARE_OBJARRAY *
* 3) #include arrimpl.cpp *
* 4) WX_DEFINE_OBJARRAY *
*****************************************************************************/
// needed to resolve the conflict between global T and macro parameter T
#define _WX_ERROR_REMOVE2(x) wxT("bad index in ") wxT(#x) wxT("::RemoveAt()")
// macro implements remaining (not inline) methods of template list
// (it's private to this file)
#undef _DEFINE_OBJARRAY
#define _DEFINE_OBJARRAY(T, name) \
name::~name() \
{ \
Empty(); \
} \
\
void name::DoCopy(const name& src) \
{ \
for ( size_t ui = 0; ui < src.size(); ui++ ) \
Add(src[ui]); \
} \
\
name& name::operator=(const name& src) \
{ \
Empty(); \
DoCopy(src); \
\
return *this; \
} \
\
name::name(const name& src) : wxArrayPtrVoid() \
{ \
DoCopy(src); \
} \
\
void name::DoEmpty() \
{ \
for ( size_t ui = 0; ui < size(); ui++ ) \
delete (T*)base_array::operator[](ui); \
} \
\
void name::RemoveAt(size_t uiIndex, size_t nRemove) \
{ \
wxCHECK_RET( uiIndex < size(), _WX_ERROR_REMOVE2(name) ); \
\
for (size_t i = 0; i < nRemove; i++ ) \
delete (T*)base_array::operator[](uiIndex + i); \
\
base_array::erase(begin() + uiIndex, begin() + uiIndex + nRemove); \
} \
\
void name::Add(const T& item, size_t nInsert) \
{ \
if (nInsert == 0) \
return; \
T* pItem = new T(item); \
size_t nOldSize = size(); \
if ( pItem != NULL ) \
base_array::insert(end(), nInsert, pItem); \
for (size_t i = 1; i < nInsert; i++) \
base_array::operator[](nOldSize + i) = new T(item); \
} \
\
void name::Insert(const T& item, size_t uiIndex, size_t nInsert) \
{ \
if (nInsert == 0) \
return; \
T* pItem = new T(item); \
if ( pItem != NULL ) \
base_array::insert(begin() + uiIndex, nInsert, pItem); \
for (size_t i = 1; i < nInsert; i++) \
base_array::operator[](uiIndex + i) = new T(item); \
} \
\
int name::Index(const T& Item, bool bFromEnd) const \
{ \
if ( bFromEnd ) { \
if ( size() > 0 ) { \
size_t ui = size() - 1; \
do { \
if ( (T*)base_array::operator[](ui) == &Item ) \
return wx_static_cast(int, ui); \
ui--; \
} \
while ( ui != 0 ); \
} \
} \
else { \
for( size_t ui = 0; ui < size(); ui++ ) { \
if( (T*)base_array::operator[](ui) == &Item ) \
return wx_static_cast(int, ui); \
} \
} \
\
return wxNOT_FOUND; \
}
// redefine the macro so that now it will generate the class implementation
// old value would provoke a compile-time error if this file is not included
#undef WX_DEFINE_OBJARRAY
#define WX_DEFINE_OBJARRAY(name) _DEFINE_OBJARRAY(_wxObjArray##name, name)

View File

@ -1,377 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
// Name: include/wx/arrstr.h
// Purpose: wxArrayString class
// Author: Mattia Barbon and Vadim Zeitlin
// Modified by:
// Created: 07/07/03
// RCS-ID: $Id: arrstr.h 56758 2008-11-13 22:32:21Z VS $
// Copyright: (c) 2003 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ARRSTR_H
#define _WX_ARRSTR_H
#include "wx/defs.h"
#include "wx/string.h"
WXDLLIMPEXP_BASE int wxCMPFUNC_CONV wxStringSortAscending(wxString*, wxString*);
WXDLLIMPEXP_BASE int wxCMPFUNC_CONV wxStringSortDescending(wxString*, wxString*);
#if wxUSE_STL
#include "wx/dynarray.h"
typedef int (wxCMPFUNC_CONV *CMPFUNCwxString)(wxString*, wxString*);
typedef wxString _wxArraywxBaseArrayStringBase;
_WX_DECLARE_BASEARRAY_2(_wxArraywxBaseArrayStringBase, wxBaseArrayStringBase,
wxArray_SortFunction<wxString>,
class WXDLLIMPEXP_BASE);
WX_DEFINE_USER_EXPORTED_TYPEARRAY(wxString, wxArrayStringBase,
wxBaseArrayStringBase, WXDLLIMPEXP_BASE);
_WX_DEFINE_SORTED_TYPEARRAY_2(wxString, wxSortedArrayStringBase,
wxBaseArrayStringBase, = wxStringSortAscending,
class WXDLLIMPEXP_BASE, CMPFUNCwxString);
class WXDLLIMPEXP_BASE wxArrayString : public wxArrayStringBase
{
public:
// type of function used by wxArrayString::Sort()
typedef int (wxCMPFUNC_CONV *CompareFunction)(const wxString& first,
const wxString& second);
wxArrayString() { }
wxArrayString(const wxArrayString& a) : wxArrayStringBase(a) { }
wxArrayString(size_t sz, const wxChar** a);
wxArrayString(size_t sz, const wxString* a);
int Index(const wxChar* sz, bool bCase = true, bool bFromEnd = false) const;
void Sort(bool reverseOrder = false);
void Sort(CompareFunction function);
void Sort(CMPFUNCwxString function) { wxArrayStringBase::Sort(function); }
size_t Add(const wxString& string, size_t copies = 1)
{
wxArrayStringBase::Add(string, copies);
return size() - copies;
}
};
class WXDLLIMPEXP_BASE wxSortedArrayString : public wxSortedArrayStringBase
{
public:
wxSortedArrayString() : wxSortedArrayStringBase(wxStringSortAscending)
{ }
wxSortedArrayString(const wxSortedArrayString& array)
: wxSortedArrayStringBase(array)
{ }
wxSortedArrayString(const wxArrayString& src)
: wxSortedArrayStringBase(wxStringSortAscending)
{
reserve(src.size());
for ( size_t n = 0; n < src.size(); n++ )
Add(src[n]);
}
int Index(const wxChar* sz, bool bCase = true, bool bFromEnd = false) const;
};
#else // if !wxUSE_STL
// ----------------------------------------------------------------------------
// The string array uses it's knowledge of internal structure of the wxString
// class to optimize string storage. Normally, we would store pointers to
// string, but as wxString is, in fact, itself a pointer (sizeof(wxString) is
// sizeof(char *)) we store these pointers instead. The cast to "wxString *" is
// really all we need to turn such pointer into a string!
//
// Of course, it can be called a dirty hack, but we use twice less memory and
// this approach is also more speed efficient, so it's probably worth it.
//
// Usage notes: when a string is added/inserted, a new copy of it is created,
// so the original string may be safely deleted. When a string is retrieved
// from the array (operator[] or Item() method), a reference is returned.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxArrayString
{
public:
// type of function used by wxArrayString::Sort()
typedef int (wxCMPFUNC_CONV *CompareFunction)(const wxString& first,
const wxString& second);
// type of function used by wxArrayString::Sort(), for compatibility with
// wxArray
typedef int (wxCMPFUNC_CONV *CompareFunction2)(wxString* first,
wxString* second);
// constructors and destructor
// default ctor
wxArrayString() { Init(false); }
// if autoSort is true, the array is always sorted (in alphabetical order)
//
// NB: the reason for using int and not bool is that like this we can avoid
// using this ctor for implicit conversions from "const char *" (which
// we'd like to be implicitly converted to wxString instead!)
//
// of course, using explicit would be even better - if all compilers
// supported it...
wxArrayString(int autoSort) { Init(autoSort != 0); }
// C string array ctor
wxArrayString(size_t sz, const wxChar** a);
// wxString string array ctor
wxArrayString(size_t sz, const wxString* a);
// copy ctor
wxArrayString(const wxArrayString& array);
// assignment operator
wxArrayString& operator=(const wxArrayString& src);
// not virtual, this class should not be derived from
~wxArrayString();
// memory management
// empties the list, but doesn't release memory
void Empty();
// empties the list and releases memory
void Clear();
// preallocates memory for given number of items
void Alloc(size_t nCount);
// minimzes the memory usage (by freeing all extra memory)
void Shrink();
// simple accessors
// number of elements in the array
size_t GetCount() const { return m_nCount; }
// is it empty?
bool IsEmpty() const { return m_nCount == 0; }
// number of elements in the array (GetCount is preferred API)
size_t Count() const { return m_nCount; }
// items access (range checking is done in debug version)
// get item at position uiIndex
wxString& Item(size_t nIndex) const
{
wxASSERT_MSG( nIndex < m_nCount,
_T("wxArrayString: index out of bounds") );
return *(wxString *)&(m_pItems[nIndex]);
}
// same as Item()
wxString& operator[](size_t nIndex) const { return Item(nIndex); }
// get last item
wxString& Last() const
{
wxASSERT_MSG( !IsEmpty(),
_T("wxArrayString: index out of bounds") );
return Item(Count() - 1);
}
// return a wxString[], useful for the controls which
// take one in their ctor. You must delete[] it yourself
// once you are done with it. Will return NULL if the
// ArrayString was empty.
#if WXWIN_COMPATIBILITY_2_4
wxDEPRECATED( wxString* GetStringArray() const );
#endif
// item management
// Search the element in the array, starting from the beginning if
// bFromEnd is false or from end otherwise. If bCase, comparison is case
// sensitive (default). Returns index of the first item matched or
// wxNOT_FOUND
int Index (const wxChar *sz, bool bCase = true, bool bFromEnd = false) const;
// add new element at the end (if the array is not sorted), return its
// index
size_t Add(const wxString& str, size_t nInsert = 1);
// add new element at given position
void Insert(const wxString& str, size_t uiIndex, size_t nInsert = 1);
// expand the array to have count elements
void SetCount(size_t count);
// remove first item matching this value
void Remove(const wxChar *sz);
// remove item by index
#if WXWIN_COMPATIBILITY_2_4
wxDEPRECATED( void Remove(size_t nIndex, size_t nRemove = 1) );
#endif
void RemoveAt(size_t nIndex, size_t nRemove = 1);
// sorting
// sort array elements in alphabetical order (or reversed alphabetical
// order if reverseOrder parameter is true)
void Sort(bool reverseOrder = false);
// sort array elements using specified comparaison function
void Sort(CompareFunction compareFunction);
void Sort(CompareFunction2 compareFunction);
// comparison
// compare two arrays case sensitively
bool operator==(const wxArrayString& a) const;
// compare two arrays case sensitively
bool operator!=(const wxArrayString& a) const { return !(*this == a); }
// STL-like interface
typedef wxString value_type;
typedef value_type* pointer;
typedef const value_type* const_pointer;
typedef value_type* iterator;
typedef const value_type* const_iterator;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef int difference_type;
typedef size_t size_type;
// TODO: this code duplicates the one in dynarray.h
class reverse_iterator
{
typedef wxString value_type;
typedef value_type* pointer;
typedef value_type& reference;
typedef reverse_iterator itor;
friend itor operator+(int o, const itor& it);
friend itor operator+(const itor& it, int o);
friend itor operator-(const itor& it, int o);
friend difference_type operator -(const itor& i1, const itor& i2);
public:
pointer m_ptr;
reverse_iterator() : m_ptr(NULL) { }
reverse_iterator(pointer ptr) : m_ptr(ptr) { }
reverse_iterator(const itor& it) : m_ptr(it.m_ptr) { }
reference operator*() const { return *m_ptr; }
pointer operator->() const { return m_ptr; }
itor& operator++() { --m_ptr; return *this; }
const itor operator++(int)
{ reverse_iterator tmp = *this; --m_ptr; return tmp; }
itor& operator--() { ++m_ptr; return *this; }
const itor operator--(int) { itor tmp = *this; ++m_ptr; return tmp; }
bool operator ==(const itor& it) const { return m_ptr == it.m_ptr; }
bool operator !=(const itor& it) const { return m_ptr != it.m_ptr; }
};
class const_reverse_iterator
{
typedef wxString value_type;
typedef const value_type* pointer;
typedef const value_type& reference;
typedef const_reverse_iterator itor;
friend itor operator+(int o, const itor& it);
friend itor operator+(const itor& it, int o);
friend itor operator-(const itor& it, int o);
friend difference_type operator -(const itor& i1, const itor& i2);
public:
pointer m_ptr;
const_reverse_iterator() : m_ptr(NULL) { }
const_reverse_iterator(pointer ptr) : m_ptr(ptr) { }
const_reverse_iterator(const itor& it) : m_ptr(it.m_ptr) { }
const_reverse_iterator(const reverse_iterator& it) : m_ptr(it.m_ptr) { }
reference operator*() const { return *m_ptr; }
pointer operator->() const { return m_ptr; }
itor& operator++() { --m_ptr; return *this; }
const itor operator++(int)
{ itor tmp = *this; --m_ptr; return tmp; }
itor& operator--() { ++m_ptr; return *this; }
const itor operator--(int) { itor tmp = *this; ++m_ptr; return tmp; }
bool operator ==(const itor& it) const { return m_ptr == it.m_ptr; }
bool operator !=(const itor& it) const { return m_ptr != it.m_ptr; }
};
wxArrayString(const_iterator first, const_iterator last)
{ Init(false); assign(first, last); }
wxArrayString(size_type n, const_reference v) { Init(false); assign(n, v); }
void assign(const_iterator first, const_iterator last);
void assign(size_type n, const_reference v)
{ clear(); Add(v, n); }
reference back() { return *(end() - 1); }
const_reference back() const { return *(end() - 1); }
iterator begin() { return (wxString *)&(m_pItems[0]); }
const_iterator begin() const { return (wxString *)&(m_pItems[0]); }
size_type capacity() const { return m_nSize; }
void clear() { Clear(); }
bool empty() const { return IsEmpty(); }
iterator end() { return begin() + GetCount(); }
const_iterator end() const { return begin() + GetCount(); }
iterator erase(iterator first, iterator last)
{
size_t idx = first - begin();
RemoveAt(idx, last - first);
return begin() + idx;
}
iterator erase(iterator it) { return erase(it, it + 1); }
reference front() { return *begin(); }
const_reference front() const { return *begin(); }
void insert(iterator it, size_type n, const_reference v)
{ Insert(v, it - begin(), n); }
iterator insert(iterator it, const_reference v = value_type())
{ size_t idx = it - begin(); Insert(v, idx); return begin() + idx; }
void insert(iterator it, const_iterator first, const_iterator last);
size_type max_size() const { return INT_MAX; }
void pop_back() { RemoveAt(GetCount() - 1); }
void push_back(const_reference v) { Add(v); }
reverse_iterator rbegin() { return reverse_iterator(end() - 1); }
const_reverse_iterator rbegin() const;
reverse_iterator rend() { return reverse_iterator(begin() - 1); }
const_reverse_iterator rend() const;
void reserve(size_type n) /* base::reserve*/;
void resize(size_type n, value_type v = value_type());
size_type size() const { return GetCount(); }
protected:
void Init(bool autoSort); // common part of all ctors
void Copy(const wxArrayString& src); // copies the contents of another array
private:
void Grow(size_t nIncrement = 0); // makes array bigger if needed
void Free(); // free all the strings stored
void DoSort(); // common part of all Sort() variants
size_t m_nSize, // current size of the array
m_nCount; // current number of elements
wxChar **m_pItems; // pointer to data
bool m_autoSort; // if true, keep the array always sorted
};
class WXDLLIMPEXP_BASE wxSortedArrayString : public wxArrayString
{
public:
wxSortedArrayString() : wxArrayString(true)
{ }
wxSortedArrayString(const wxArrayString& array) : wxArrayString(true)
{ Copy(array); }
};
#endif // !wxUSE_STL
// this class provides a temporary wxString* from a
// wxArrayString
class WXDLLIMPEXP_BASE wxCArrayString
{
public:
wxCArrayString( const wxArrayString& array )
: m_array( array ), m_strings( NULL )
{ }
~wxCArrayString() { delete[] m_strings; }
size_t GetCount() const { return m_array.GetCount(); }
wxString* GetStrings()
{
if( m_strings ) return m_strings;
size_t count = m_array.GetCount();
m_strings = new wxString[count];
for( size_t i = 0; i < count; ++i )
m_strings[i] = m_array[i];
return m_strings;
}
#if wxABI_VERSION >= 20810
wxString* Release();
#endif // wxABI_VERSION >= 20810
private:
const wxArrayString& m_array;
wxString* m_strings;
};
#endif

View File

@ -1,204 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/artprov.h
// Purpose: wxArtProvider class
// Author: Vaclav Slavik
// Modified by:
// Created: 18/03/2002
// RCS-ID: $Id: artprov.h 57701 2008-12-31 23:40:06Z VS $
// Copyright: (c) Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ARTPROV_H_
#define _WX_ARTPROV_H_
#include "wx/string.h"
#include "wx/bitmap.h"
#include "wx/icon.h"
class WXDLLIMPEXP_FWD_CORE wxArtProvidersList;
class WXDLLIMPEXP_FWD_CORE wxArtProviderCache;
class wxArtProviderModule;
// ----------------------------------------------------------------------------
// Types
// ----------------------------------------------------------------------------
typedef wxString wxArtClient;
typedef wxString wxArtID;
#define wxART_MAKE_CLIENT_ID_FROM_STR(id) (id + _T("_C"))
#define wxART_MAKE_CLIENT_ID(id) _T(#id) _T("_C")
#define wxART_MAKE_ART_ID_FROM_STR(id) (id)
#define wxART_MAKE_ART_ID(id) _T(#id)
// ----------------------------------------------------------------------------
// Art clients
// ----------------------------------------------------------------------------
#define wxART_TOOLBAR wxART_MAKE_CLIENT_ID(wxART_TOOLBAR)
#define wxART_MENU wxART_MAKE_CLIENT_ID(wxART_MENU)
#define wxART_FRAME_ICON wxART_MAKE_CLIENT_ID(wxART_FRAME_ICON)
#define wxART_CMN_DIALOG wxART_MAKE_CLIENT_ID(wxART_CMN_DIALOG)
#define wxART_HELP_BROWSER wxART_MAKE_CLIENT_ID(wxART_HELP_BROWSER)
#define wxART_MESSAGE_BOX wxART_MAKE_CLIENT_ID(wxART_MESSAGE_BOX)
#define wxART_BUTTON wxART_MAKE_CLIENT_ID(wxART_BUTTON)
#define wxART_OTHER wxART_MAKE_CLIENT_ID(wxART_OTHER)
// ----------------------------------------------------------------------------
// Art IDs
// ----------------------------------------------------------------------------
#define wxART_ADD_BOOKMARK wxART_MAKE_ART_ID(wxART_ADD_BOOKMARK)
#define wxART_DEL_BOOKMARK wxART_MAKE_ART_ID(wxART_DEL_BOOKMARK)
#define wxART_HELP_SIDE_PANEL wxART_MAKE_ART_ID(wxART_HELP_SIDE_PANEL)
#define wxART_HELP_SETTINGS wxART_MAKE_ART_ID(wxART_HELP_SETTINGS)
#define wxART_HELP_BOOK wxART_MAKE_ART_ID(wxART_HELP_BOOK)
#define wxART_HELP_FOLDER wxART_MAKE_ART_ID(wxART_HELP_FOLDER)
#define wxART_HELP_PAGE wxART_MAKE_ART_ID(wxART_HELP_PAGE)
#define wxART_GO_BACK wxART_MAKE_ART_ID(wxART_GO_BACK)
#define wxART_GO_FORWARD wxART_MAKE_ART_ID(wxART_GO_FORWARD)
#define wxART_GO_UP wxART_MAKE_ART_ID(wxART_GO_UP)
#define wxART_GO_DOWN wxART_MAKE_ART_ID(wxART_GO_DOWN)
#define wxART_GO_TO_PARENT wxART_MAKE_ART_ID(wxART_GO_TO_PARENT)
#define wxART_GO_HOME wxART_MAKE_ART_ID(wxART_GO_HOME)
#define wxART_FILE_OPEN wxART_MAKE_ART_ID(wxART_FILE_OPEN)
#define wxART_FILE_SAVE wxART_MAKE_ART_ID(wxART_FILE_SAVE)
#define wxART_FILE_SAVE_AS wxART_MAKE_ART_ID(wxART_FILE_SAVE_AS)
#define wxART_PRINT wxART_MAKE_ART_ID(wxART_PRINT)
#define wxART_HELP wxART_MAKE_ART_ID(wxART_HELP)
#define wxART_TIP wxART_MAKE_ART_ID(wxART_TIP)
#define wxART_REPORT_VIEW wxART_MAKE_ART_ID(wxART_REPORT_VIEW)
#define wxART_LIST_VIEW wxART_MAKE_ART_ID(wxART_LIST_VIEW)
#define wxART_NEW_DIR wxART_MAKE_ART_ID(wxART_NEW_DIR)
#define wxART_HARDDISK wxART_MAKE_ART_ID(wxART_HARDDISK)
#define wxART_FLOPPY wxART_MAKE_ART_ID(wxART_FLOPPY)
#define wxART_CDROM wxART_MAKE_ART_ID(wxART_CDROM)
#define wxART_REMOVABLE wxART_MAKE_ART_ID(wxART_REMOVABLE)
#define wxART_FOLDER wxART_MAKE_ART_ID(wxART_FOLDER)
#define wxART_FOLDER_OPEN wxART_MAKE_ART_ID(wxART_FOLDER_OPEN)
#define wxART_GO_DIR_UP wxART_MAKE_ART_ID(wxART_GO_DIR_UP)
#define wxART_EXECUTABLE_FILE wxART_MAKE_ART_ID(wxART_EXECUTABLE_FILE)
#define wxART_NORMAL_FILE wxART_MAKE_ART_ID(wxART_NORMAL_FILE)
#define wxART_TICK_MARK wxART_MAKE_ART_ID(wxART_TICK_MARK)
#define wxART_CROSS_MARK wxART_MAKE_ART_ID(wxART_CROSS_MARK)
#define wxART_ERROR wxART_MAKE_ART_ID(wxART_ERROR)
#define wxART_QUESTION wxART_MAKE_ART_ID(wxART_QUESTION)
#define wxART_WARNING wxART_MAKE_ART_ID(wxART_WARNING)
#define wxART_INFORMATION wxART_MAKE_ART_ID(wxART_INFORMATION)
#define wxART_MISSING_IMAGE wxART_MAKE_ART_ID(wxART_MISSING_IMAGE)
#define wxART_COPY wxART_MAKE_ART_ID(wxART_COPY)
#define wxART_CUT wxART_MAKE_ART_ID(wxART_CUT)
#define wxART_PASTE wxART_MAKE_ART_ID(wxART_PASTE)
#define wxART_DELETE wxART_MAKE_ART_ID(wxART_DELETE)
#define wxART_NEW wxART_MAKE_ART_ID(wxART_NEW)
#define wxART_UNDO wxART_MAKE_ART_ID(wxART_UNDO)
#define wxART_REDO wxART_MAKE_ART_ID(wxART_REDO)
#define wxART_QUIT wxART_MAKE_ART_ID(wxART_QUIT)
#define wxART_FIND wxART_MAKE_ART_ID(wxART_FIND)
#define wxART_FIND_AND_REPLACE wxART_MAKE_ART_ID(wxART_FIND_AND_REPLACE)
// ----------------------------------------------------------------------------
// wxArtProvider class
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxArtProvider : public wxObject
{
public:
// Dtor removes the provider from providers stack if it's still on it
virtual ~wxArtProvider();
// Add new provider to the top of providers stack (i.e. the provider will
// be queried first of all).
static void Push(wxArtProvider *provider);
// Add new provider to the bottom of providers stack (i.e. the provider
// will be queried as the last one).
#if wxABI_VERSION >= 20810
static void PushBack(wxArtProvider *provider);
#endif
// same as PushBack()
static void Insert(wxArtProvider *provider);
// Remove latest added provider and delete it.
static bool Pop();
// Remove provider from providers stack but don't delete it.
static bool Remove(wxArtProvider *provider);
// Delete the given provider and remove it from the providers stack.
static bool Delete(wxArtProvider *provider);
// Query the providers for bitmap with given ID and return it. Return
// wxNullBitmap if no provider provides it.
static wxBitmap GetBitmap(const wxArtID& id,
const wxArtClient& client = wxART_OTHER,
const wxSize& size = wxDefaultSize);
// Query the providers for icon with given ID and return it. Return
// wxNullIcon if no provider provides it.
static wxIcon GetIcon(const wxArtID& id,
const wxArtClient& client = wxART_OTHER,
const wxSize& size = wxDefaultSize);
// Get the size hint of an icon from a specific wxArtClient, queries
// the topmost provider if platform_dependent = false
static wxSize GetSizeHint(const wxArtClient& client, bool platform_dependent = false);
#if WXWIN_COMPATIBILITY_2_6
// use the corresponding methods without redundant "Provider" suffix
wxDEPRECATED( static void PushProvider(wxArtProvider *provider) );
wxDEPRECATED( static void InsertProvider(wxArtProvider *provider) );
wxDEPRECATED( static bool PopProvider() );
// use Delete() if this is what you really need, or just delete the
// provider pointer, do not use Remove() as it does not delete the pointer
// unlike RemoveProvider() which does
wxDEPRECATED( static bool RemoveProvider(wxArtProvider *provider) );
#endif // WXWIN_COMPATIBILITY_2_6
protected:
friend class wxArtProviderModule;
// Initializes default provider
static void InitStdProvider();
// Initializes platform's native provider, if available (e.g. GTK2)
static void InitNativeProvider();
// Destroy caches & all providers
static void CleanUpProviders();
// Get the default size of an icon for a specific client
virtual wxSize DoGetSizeHint(const wxArtClient& client)
{
return GetSizeHint(client, true);
}
// Derived classes must override this method to create requested
// art resource. This method is called only once per instance's
// lifetime for each requested wxArtID.
virtual wxBitmap CreateBitmap(const wxArtID& WXUNUSED(id),
const wxArtClient& WXUNUSED(client),
const wxSize& WXUNUSED(size)) = 0;
private:
static void CommonAddingProvider();
private:
// list of providers:
static wxArtProvidersList *sm_providers;
// art resources cache (so that CreateXXX is not called that often):
static wxArtProviderCache *sm_cache;
DECLARE_ABSTRACT_CLASS(wxArtProvider)
};
#endif // _WX_ARTPROV_H_

View File

@ -1,23 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/aui/aui.h
// Purpose: wxaui: wx advanced user interface - docking window manager
// Author: Benjamin I. Williams
// Modified by:
// Created: 2005-05-17
// RCS-ID: $Id: aui.h 55195 2008-08-23 06:31:01Z BIW $
// Copyright: (C) Copyright 2005, Kirix Corporation, All Rights Reserved.
// Licence: wxWindows Library Licence, Version 3.1
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_AUI_H_
#define _WX_AUI_H_
#include "wx/aui/framemanager.h"
#include "wx/aui/dockart.h"
#include "wx/aui/floatpane.h"
#include "wx/aui/auibar.h"
#include "wx/aui/auibook.h"
#include "wx/aui/tabmdi.h"
#endif // _WX_AUI_H_

View File

@ -1,684 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/aui/toolbar.h
// Purpose: wxaui: wx advanced user interface - docking window manager
// Author: Benjamin I. Williams
// Modified by:
// Created: 2008-08-04
// RCS-ID: $Id: auibar.h 55522 2008-09-08 09:54:28Z BIW $
// Copyright: (C) Copyright 2005, Kirix Corporation, All Rights Reserved.
// Licence: wxWindows Library Licence, Version 3.1
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_AUIBAR_H_
#define _WX_AUIBAR_H_
#include "wx/defs.h"
#if wxUSE_AUI
#if wxABI_VERSION >= 20809
#include "wx/control.h"
enum wxAuiToolBarStyle
{
wxAUI_TB_TEXT = 1 << 0,
wxAUI_TB_NO_TOOLTIPS = 1 << 1,
wxAUI_TB_NO_AUTORESIZE = 1 << 2,
wxAUI_TB_GRIPPER = 1 << 3,
wxAUI_TB_OVERFLOW = 1 << 4,
wxAUI_TB_VERTICAL = 1 << 5,
wxAUI_TB_HORZ_LAYOUT = 1 << 6,
wxAUI_TB_HORZ_TEXT = (wxAUI_TB_HORZ_LAYOUT | wxAUI_TB_TEXT),
wxAUI_TB_DEFAULT_STYLE = 0
};
enum wxAuiToolBarArtSetting
{
wxAUI_TBART_SEPARATOR_SIZE = 0,
wxAUI_TBART_GRIPPER_SIZE = 1,
wxAUI_TBART_OVERFLOW_SIZE = 2
};
enum wxAuiToolBarToolTextOrientation
{
wxAUI_TBTOOL_TEXT_LEFT = 0, // unused/unimplemented
wxAUI_TBTOOL_TEXT_RIGHT = 1,
wxAUI_TBTOOL_TEXT_TOP = 2, // unused/unimplemented
wxAUI_TBTOOL_TEXT_BOTTOM = 3
};
// aui toolbar event class
class WXDLLIMPEXP_AUI wxAuiToolBarEvent : public wxNotifyEvent
{
public:
wxAuiToolBarEvent(wxEventType command_type = wxEVT_NULL,
int win_id = 0)
: wxNotifyEvent(command_type, win_id)
{
is_dropdown_clicked = false;
click_pt = wxPoint(-1, -1);
rect = wxRect(-1,-1, 0, 0);
tool_id = -1;
}
#ifndef SWIG
wxAuiToolBarEvent(const wxAuiToolBarEvent& c) : wxNotifyEvent(c)
{
is_dropdown_clicked = c.is_dropdown_clicked;
click_pt = c.click_pt;
rect = c.rect;
tool_id = c.tool_id;
}
#endif
wxEvent *Clone() const { return new wxAuiToolBarEvent(*this); }
bool IsDropDownClicked() const { return is_dropdown_clicked; }
void SetDropDownClicked(bool c) { is_dropdown_clicked = c; }
wxPoint GetClickPoint() const { return click_pt; }
void SetClickPoint(const wxPoint& p) { click_pt = p; }
wxRect GetItemRect() const { return rect; }
void SetItemRect(const wxRect& r) { rect = r; }
int GetToolId() const { return tool_id; }
void SetToolId(int id) { tool_id = id; }
private:
bool is_dropdown_clicked;
wxPoint click_pt;
wxRect rect;
int tool_id;
#ifndef SWIG
private:
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxAuiToolBarEvent)
#endif
};
class WXDLLIMPEXP_AUI wxAuiToolBarItem
{
friend class wxAuiToolBar;
public:
wxAuiToolBarItem()
{
window = NULL;
sizer_item = NULL;
spacer_pixels = 0;
id = 0;
kind = wxITEM_NORMAL;
state = 0; // normal, enabled
proportion = 0;
active = true;
dropdown = true;
sticky = true;
user_data = 0;
}
wxAuiToolBarItem(const wxAuiToolBarItem& c)
{
Assign(c);
}
wxAuiToolBarItem& operator=(const wxAuiToolBarItem& c)
{
Assign(c);
return *this;
}
void Assign(const wxAuiToolBarItem& c)
{
window = c.window;
label = c.label;
bitmap = c.bitmap;
disabled_bitmap = c.disabled_bitmap;
hover_bitmap = c.hover_bitmap;
short_help = c.short_help;
long_help = c.long_help;
sizer_item = c.sizer_item;
min_size = c.min_size;
spacer_pixels = c.spacer_pixels;
id = c.id;
kind = c.kind;
state = c.state;
proportion = c.proportion;
active = c.active;
dropdown = c.dropdown;
sticky = c.sticky;
user_data = c.user_data;
}
void SetWindow(wxWindow* w) { window = w; }
wxWindow* GetWindow() { return window; }
void SetId(int new_id) { id = new_id; }
int GetId() const { return id; }
void SetKind(int new_kind) { kind = new_kind; }
int GetKind() const { return kind; }
void SetState(int new_state) { state = new_state; }
int GetState() const { return state; }
void SetSizerItem(wxSizerItem* s) { sizer_item = s; }
wxSizerItem* GetSizerItem() const { return sizer_item; }
void SetLabel(const wxString& s) { label = s; }
const wxString& GetLabel() const { return label; }
void SetBitmap(const wxBitmap& bmp) { bitmap = bmp; }
const wxBitmap& GetBitmap() const { return bitmap; }
void SetDisabledBitmap(const wxBitmap& bmp) { disabled_bitmap = bmp; }
const wxBitmap& GetDisabledBitmap() const { return disabled_bitmap; }
void SetHoverBitmap(const wxBitmap& bmp) { hover_bitmap = bmp; }
const wxBitmap& GetHoverBitmap() const { return hover_bitmap; }
void SetShortHelp(const wxString& s) { short_help = s; }
const wxString& GetShortHelp() const { return short_help; }
void SetLongHelp(const wxString& s) { long_help = s; }
const wxString& GetLongHelp() const { return long_help; }
void SetMinSize(const wxSize& s) { min_size = s; }
const wxSize& GetMinSize() const { return min_size; }
void SetSpacerPixels(int s) { spacer_pixels = s; }
int GetSpacerPixels() const { return spacer_pixels; }
void SetProportion(int p) { proportion = p; }
int GetProportion() const { return proportion; }
void SetActive(bool b) { active = b; }
bool IsActive() const { return active; }
void SetHasDropDown(bool b) { dropdown = b; }
bool HasDropDown() const { return dropdown; }
void SetSticky(bool b) { sticky = b; }
bool IsSticky() const { return sticky; }
void SetUserData(long l) { user_data = l; }
long GetUserData() const { return user_data; }
private:
wxWindow* window; // item's associated window
wxString label; // label displayed on the item
wxBitmap bitmap; // item's bitmap
wxBitmap disabled_bitmap; // item's disabled bitmap
wxBitmap hover_bitmap; // item's hover bitmap
wxString short_help; // short help (for tooltip)
wxString long_help; // long help (for status bar)
wxSizerItem* sizer_item; // sizer item
wxSize min_size; // item's minimum size
int spacer_pixels; // size of a spacer
int id; // item's id
int kind; // item's kind
int state; // state
int proportion; // proportion
bool active; // true if the item is currently active
bool dropdown; // true if the item has a dropdown button
bool sticky; // overrides button states if true (always active)
long user_data; // user-specified data
};
#ifndef SWIG
WX_DECLARE_USER_EXPORTED_OBJARRAY(wxAuiToolBarItem, wxAuiToolBarItemArray, WXDLLIMPEXP_AUI);
#endif
// tab art class
class WXDLLIMPEXP_AUI wxAuiToolBarArt
{
public:
wxAuiToolBarArt() { }
virtual ~wxAuiToolBarArt() { }
virtual wxAuiToolBarArt* Clone() = 0;
virtual void SetFlags(unsigned int flags) = 0;
virtual void SetFont(const wxFont& font) = 0;
virtual void SetTextOrientation(int orientation) = 0;
virtual void DrawBackground(
wxDC& dc,
wxWindow* wnd,
const wxRect& rect) = 0;
virtual void DrawLabel(
wxDC& dc,
wxWindow* wnd,
const wxAuiToolBarItem& item,
const wxRect& rect) = 0;
virtual void DrawButton(
wxDC& dc,
wxWindow* wnd,
const wxAuiToolBarItem& item,
const wxRect& rect) = 0;
virtual void DrawDropDownButton(
wxDC& dc,
wxWindow* wnd,
const wxAuiToolBarItem& item,
const wxRect& rect) = 0;
virtual void DrawControlLabel(
wxDC& dc,
wxWindow* wnd,
const wxAuiToolBarItem& item,
const wxRect& rect) = 0;
virtual void DrawSeparator(
wxDC& dc,
wxWindow* wnd,
const wxRect& rect) = 0;
virtual void DrawGripper(
wxDC& dc,
wxWindow* wnd,
const wxRect& rect) = 0;
virtual void DrawOverflowButton(
wxDC& dc,
wxWindow* wnd,
const wxRect& rect,
int state) = 0;
virtual wxSize GetLabelSize(
wxDC& dc,
wxWindow* wnd,
const wxAuiToolBarItem& item) = 0;
virtual wxSize GetToolSize(
wxDC& dc,
wxWindow* wnd,
const wxAuiToolBarItem& item) = 0;
virtual int GetElementSize(int element_id) = 0;
virtual void SetElementSize(int element_id, int size) = 0;
virtual int ShowDropDown(
wxWindow* wnd,
const wxAuiToolBarItemArray& items) = 0;
};
class WXDLLIMPEXP_AUI wxAuiDefaultToolBarArt : public wxAuiToolBarArt
{
public:
wxAuiDefaultToolBarArt();
virtual ~wxAuiDefaultToolBarArt();
virtual wxAuiToolBarArt* Clone();
virtual void SetFlags(unsigned int flags);
virtual void SetFont(const wxFont& font);
virtual void SetTextOrientation(int orientation);
virtual void DrawBackground(
wxDC& dc,
wxWindow* wnd,
const wxRect& rect);
virtual void DrawLabel(
wxDC& dc,
wxWindow* wnd,
const wxAuiToolBarItem& item,
const wxRect& rect);
virtual void DrawButton(
wxDC& dc,
wxWindow* wnd,
const wxAuiToolBarItem& item,
const wxRect& rect);
virtual void DrawDropDownButton(
wxDC& dc,
wxWindow* wnd,
const wxAuiToolBarItem& item,
const wxRect& rect);
virtual void DrawControlLabel(
wxDC& dc,
wxWindow* wnd,
const wxAuiToolBarItem& item,
const wxRect& rect);
virtual void DrawSeparator(
wxDC& dc,
wxWindow* wnd,
const wxRect& rect);
virtual void DrawGripper(
wxDC& dc,
wxWindow* wnd,
const wxRect& rect);
virtual void DrawOverflowButton(
wxDC& dc,
wxWindow* wnd,
const wxRect& rect,
int state);
virtual wxSize GetLabelSize(
wxDC& dc,
wxWindow* wnd,
const wxAuiToolBarItem& item);
virtual wxSize GetToolSize(
wxDC& dc,
wxWindow* wnd,
const wxAuiToolBarItem& item);
virtual int GetElementSize(int element);
virtual void SetElementSize(int element_id, int size);
virtual int ShowDropDown(wxWindow* wnd,
const wxAuiToolBarItemArray& items);
protected:
wxBitmap m_button_dropdown_bmp;
wxBitmap m_disabled_button_dropdown_bmp;
wxBitmap m_overflow_bmp;
wxBitmap m_disabled_overflow_bmp;
wxColour m_base_colour;
wxColour m_highlight_colour;
wxFont m_font;
unsigned int m_flags;
int m_text_orientation;
wxPen m_gripper_pen1;
wxPen m_gripper_pen2;
wxPen m_gripper_pen3;
int m_separator_size;
int m_gripper_size;
int m_overflow_size;
};
class WXDLLIMPEXP_AUI wxAuiToolBar : public wxControl
{
public:
wxAuiToolBar(wxWindow* parent,
wxWindowID id = -1,
const wxPoint& position = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxAUI_TB_DEFAULT_STYLE);
~wxAuiToolBar();
void SetWindowStyleFlag(long style);
void SetArtProvider(wxAuiToolBarArt* art);
wxAuiToolBarArt* GetArtProvider() const;
bool SetFont(const wxFont& font);
void AddTool(int tool_id,
const wxString& label,
const wxBitmap& bitmap,
const wxString& short_help_string = wxEmptyString,
wxItemKind kind = wxITEM_NORMAL);
void AddTool(int tool_id,
const wxString& label,
const wxBitmap& bitmap,
const wxBitmap& disabled_bitmap,
wxItemKind kind,
const wxString& short_help_string,
const wxString& long_help_string,
wxObject* client_data);
void AddTool(int tool_id,
const wxBitmap& bitmap,
const wxBitmap& disabled_bitmap,
bool toggle = false,
wxObject* client_data = NULL,
const wxString& short_help_string = wxEmptyString,
const wxString& long_help_string = wxEmptyString)
{
AddTool(tool_id,
wxEmptyString,
bitmap,
disabled_bitmap,
toggle ? wxITEM_CHECK : wxITEM_NORMAL,
short_help_string,
long_help_string,
client_data);
}
void AddLabel(int tool_id,
const wxString& label = wxEmptyString,
const int width = -1);
void AddControl(wxControl* control,
const wxString& label = wxEmptyString);
void AddSeparator();
void AddSpacer(int pixels);
void AddStretchSpacer(int proportion = 1);
bool Realize();
wxControl* FindControl(int window_id);
wxAuiToolBarItem* FindToolByPosition(wxCoord x, wxCoord y) const;
wxAuiToolBarItem* FindToolByIndex(int idx) const;
wxAuiToolBarItem* FindTool(int tool_id) const;
void ClearTools() { Clear() ; }
void Clear();
bool DeleteTool(int tool_id);
bool DeleteByIndex(int tool_id);
size_t GetToolCount() const;
int GetToolPos(int tool_id) const { return GetToolIndex(tool_id); }
int GetToolIndex(int tool_id) const;
bool GetToolFits(int tool_id) const;
wxRect GetToolRect(int tool_id) const;
bool GetToolFitsByIndex(int tool_id) const;
bool GetToolBarFits() const;
void SetMargins(const wxSize& size) { SetMargins(size.x, size.x, size.y, size.y); }
void SetMargins(int x, int y) { SetMargins(x, x, y, y); }
void SetMargins(int left, int right, int top, int bottom);
void SetToolBitmapSize(const wxSize& size);
wxSize GetToolBitmapSize() const;
bool GetOverflowVisible() const;
void SetOverflowVisible(bool visible);
bool GetGripperVisible() const;
void SetGripperVisible(bool visible);
void ToggleTool(int tool_id, bool state);
bool GetToolToggled(int tool_id) const;
void EnableTool(int tool_id, bool state);
bool GetToolEnabled(int tool_id) const;
void SetToolDropDown(int tool_id, bool dropdown);
bool GetToolDropDown(int tool_id) const;
void SetToolBorderPadding(int padding);
int GetToolBorderPadding() const;
void SetToolTextOrientation(int orientation);
int GetToolTextOrientation() const;
void SetToolPacking(int packing);
int GetToolPacking() const;
void SetToolProportion(int tool_id, int proportion);
int GetToolProportion(int tool_id) const;
void SetToolSeparation(int separation);
int GetToolSeparation() const;
void SetToolSticky(int tool_id, bool sticky);
bool GetToolSticky(int tool_id) const;
wxString GetToolLabel(int tool_id) const;
void SetToolLabel(int tool_id, const wxString& label);
wxBitmap GetToolBitmap(int tool_id) const;
void SetToolBitmap(int tool_id, const wxBitmap& bitmap);
wxString GetToolShortHelp(int tool_id) const;
void SetToolShortHelp(int tool_id, const wxString& help_string);
wxString GetToolLongHelp(int tool_id) const;
void SetToolLongHelp(int tool_id, const wxString& help_string);
void SetCustomOverflowItems(const wxAuiToolBarItemArray& prepend,
const wxAuiToolBarItemArray& append);
protected:
virtual void OnCustomRender(wxDC& WXUNUSED(dc),
const wxAuiToolBarItem& WXUNUSED(item),
const wxRect& WXUNUSED(rect)) { }
protected:
void DoIdleUpdate();
void SetOrientation(int orientation);
void SetHoverItem(wxAuiToolBarItem* item);
void SetPressedItem(wxAuiToolBarItem* item);
void RefreshOverflowState();
int GetOverflowState() const;
wxRect GetOverflowRect() const;
wxSize GetLabelSize(const wxString& label);
wxAuiToolBarItem* FindToolByPositionWithPacking(wxCoord x, wxCoord y) const;
void DoSetSize(int x,
int y,
int width,
int height,
int sizeFlags = wxSIZE_AUTO);
protected: // handlers
void OnSize(wxSizeEvent& evt);
void OnIdle(wxIdleEvent& evt);
void OnPaint(wxPaintEvent& evt);
void OnEraseBackground(wxEraseEvent& evt);
void OnLeftDown(wxMouseEvent& evt);
void OnLeftUp(wxMouseEvent& evt);
void OnRightDown(wxMouseEvent& evt);
void OnRightUp(wxMouseEvent& evt);
void OnMiddleDown(wxMouseEvent& evt);
void OnMiddleUp(wxMouseEvent& evt);
void OnMotion(wxMouseEvent& evt);
void OnLeaveWindow(wxMouseEvent& evt);
void OnSetCursor(wxSetCursorEvent& evt);
protected:
wxAuiToolBarItemArray m_items; // array of toolbar items
wxAuiToolBarArt* m_art; // art provider
wxBoxSizer* m_sizer; // main sizer for toolbar
wxAuiToolBarItem* m_action_item; // item that's being acted upon (pressed)
wxAuiToolBarItem* m_tip_item; // item that has its tooltip shown
wxBitmap m_bitmap; // double-buffer bitmap
wxSizerItem* m_gripper_sizer_item;
wxSizerItem* m_overflow_sizer_item;
wxSize m_absolute_min_size;
wxPoint m_action_pos; // position of left-mouse down
wxAuiToolBarItemArray m_custom_overflow_prepend;
wxAuiToolBarItemArray m_custom_overflow_append;
int m_button_width;
int m_button_height;
int m_sizer_element_count;
int m_left_padding;
int m_right_padding;
int m_top_padding;
int m_bottom_padding;
int m_tool_packing;
int m_tool_border_padding;
int m_tool_text_orientation;
int m_overflow_state;
bool m_dragging;
bool m_gripper_visible;
bool m_overflow_visible;
long m_style;
DECLARE_EVENT_TABLE()
DECLARE_CLASS(wxAuiToolBar)
};
// wx event machinery
#ifndef SWIG
BEGIN_DECLARE_EVENT_TYPES()
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN, 0)
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUITOOLBAR_OVERFLOW_CLICK, 0)
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUITOOLBAR_RIGHT_CLICK, 0)
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUITOOLBAR_MIDDLE_CLICK, 0)
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUITOOLBAR_BEGIN_DRAG, 0)
END_DECLARE_EVENT_TYPES()
typedef void (wxEvtHandler::*wxAuiToolBarEventFunction)(wxAuiToolBarEvent&);
#define wxAuiToolBarEventHandler(func) \
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxAuiToolBarEventFunction, &func)
#define EVT_AUITOOLBAR_TOOL_DROPDOWN(winid, fn) \
wx__DECLARE_EVT1(wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN, winid, wxAuiToolBarEventHandler(fn))
#define EVT_AUITOOLBAR_OVERFLOW_CLICK(winid, fn) \
wx__DECLARE_EVT1(wxEVT_COMMAND_AUITOOLBAR_OVERFLOW_CLICK, winid, wxAuiToolBarEventHandler(fn))
#define EVT_AUITOOLBAR_RIGHT_CLICK(winid, fn) \
wx__DECLARE_EVT1(wxEVT_COMMAND_AUITOOLBAR_RIGHT_CLICK, winid, wxAuiToolBarEventHandler(fn))
#define EVT_AUITOOLBAR_MIDDLE_CLICK(winid, fn) \
wx__DECLARE_EVT1(wxEVT_COMMAND_AUITOOLBAR_MIDDLE_CLICK, winid, wxAuiToolBarEventHandler(fn))
#define EVT_AUITOOLBAR_BEGIN_DRAG(winid, fn) \
wx__DECLARE_EVT1(wxEVT_COMMAND_AUITOOLBAR_BEGIN_DRAG, winid, wxAuiToolBarEventHandler(fn))
#else
// wxpython/swig event work
%constant wxEventType wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN;
%constant wxEventType wxEVT_COMMAND_AUITOOLBAR_OVERFLOW_CLICK;
%constant wxEventType wxEVT_COMMAND_AUITOOLBAR_RIGHT_CLICK;
%constant wxEventType wxEVT_COMMAND_AUITOOLBAR_MIDDLE_CLICK;
%constant wxEventType wxEVT_COMMAND_AUITOOLBAR_BEGIN_DRAG;
%pythoncode {
EVT_AUITOOLBAR_TOOL_DROPDOWN = wx.PyEventBinder( wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN, 1 )
EVT_AUITOOLBAR_OVERFLOW_CLICK = wx.PyEventBinder( wxEVT_COMMAND_AUITOOLBAR_OVERFLOW_CLICK, 1 )
EVT_AUITOOLBAR_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_AUITOOLBAR_RIGHT_CLICK, 1 )
EVT_AUITOOLBAR_MIDDLE_CLICK = wx.PyEventBinder( wxEVT_COMMAND_AUITOOLBAR_MIDDLE_CLICK, 1 )
EVT_AUITOOLBAR_BEGIN_DRAG = wx.PyEventBinder( wxEVT_COMMAND_AUITOOLBAR_BEGIN_DRAG, 1 )
}
#endif // SWIG
#endif // wxABI_VERSION >= 20809
#endif // wxUSE_AUI
#endif // _WX_AUIBAR_H_

View File

@ -1,753 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/aui/auibook.h
// Purpose: wxaui: wx advanced user interface - notebook
// Author: Benjamin I. Williams
// Modified by:
// Created: 2006-06-28
// Copyright: (C) Copyright 2006, Kirix Corporation, All Rights Reserved.
// Licence: wxWindows Library Licence, Version 3.1
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_AUINOTEBOOK_H_
#define _WX_AUINOTEBOOK_H_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/defs.h"
#if wxUSE_AUI
#include "wx/aui/framemanager.h"
#include "wx/aui/dockart.h"
#include "wx/aui/floatpane.h"
#include "wx/control.h"
class wxAuiNotebook;
enum wxAuiNotebookOption
{
wxAUI_NB_TOP = 1 << 0,
wxAUI_NB_LEFT = 1 << 1, // not implemented yet
wxAUI_NB_RIGHT = 1 << 2, // not implemented yet
wxAUI_NB_BOTTOM = 1 << 3,
wxAUI_NB_TAB_SPLIT = 1 << 4,
wxAUI_NB_TAB_MOVE = 1 << 5,
wxAUI_NB_TAB_EXTERNAL_MOVE = 1 << 6,
wxAUI_NB_TAB_FIXED_WIDTH = 1 << 7,
wxAUI_NB_SCROLL_BUTTONS = 1 << 8,
wxAUI_NB_WINDOWLIST_BUTTON = 1 << 9,
wxAUI_NB_CLOSE_BUTTON = 1 << 10,
wxAUI_NB_CLOSE_ON_ACTIVE_TAB = 1 << 11,
wxAUI_NB_CLOSE_ON_ALL_TABS = 1 << 12,
wxAUI_NB_MIDDLE_CLICK_CLOSE = 1 << 13,
wxAUI_NB_DEFAULT_STYLE = wxAUI_NB_TOP |
wxAUI_NB_TAB_SPLIT |
wxAUI_NB_TAB_MOVE |
wxAUI_NB_SCROLL_BUTTONS |
wxAUI_NB_CLOSE_ON_ACTIVE_TAB |
wxAUI_NB_MIDDLE_CLICK_CLOSE
};
// aui notebook event class
class WXDLLIMPEXP_AUI wxAuiNotebookEvent : public wxNotifyEvent
{
public:
wxAuiNotebookEvent(wxEventType command_type = wxEVT_NULL,
int win_id = 0)
: wxNotifyEvent(command_type, win_id)
{
old_selection = -1;
selection = -1;
drag_source = NULL;
}
#ifndef SWIG
wxAuiNotebookEvent(const wxAuiNotebookEvent& c) : wxNotifyEvent(c)
{
old_selection = c.old_selection;
selection = c.selection;
drag_source = c.drag_source;
}
#endif
wxEvent *Clone() const { return new wxAuiNotebookEvent(*this); }
void SetSelection(int s) { selection = s; m_commandInt = s; }
int GetSelection() const { return selection; }
void SetOldSelection(int s) { old_selection = s; }
int GetOldSelection() const { return old_selection; }
void SetDragSource(wxAuiNotebook* s) { drag_source = s; }
wxAuiNotebook* GetDragSource() const { return drag_source; }
public:
int old_selection;
int selection;
wxAuiNotebook* drag_source;
#ifndef SWIG
private:
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxAuiNotebookEvent)
#endif
};
class WXDLLIMPEXP_AUI wxAuiNotebookPage
{
public:
wxWindow* window; // page's associated window
wxString caption; // caption displayed on the tab
wxBitmap bitmap; // tab's bitmap
wxRect rect; // tab's hit rectangle
bool active; // true if the page is currently active
};
class WXDLLIMPEXP_AUI wxAuiTabContainerButton
{
public:
int id; // button's id
int cur_state; // current state (normal, hover, pressed, etc.)
int location; // buttons location (wxLEFT, wxRIGHT, or wxCENTER)
wxBitmap bitmap; // button's hover bitmap
wxBitmap dis_bitmap; // button's disabled bitmap
wxRect rect; // button's hit rectangle
};
#ifndef SWIG
WX_DECLARE_USER_EXPORTED_OBJARRAY(wxAuiNotebookPage, wxAuiNotebookPageArray, WXDLLIMPEXP_AUI);
WX_DECLARE_USER_EXPORTED_OBJARRAY(wxAuiTabContainerButton, wxAuiTabContainerButtonArray, WXDLLIMPEXP_AUI);
#endif
// tab art class
class WXDLLIMPEXP_AUI wxAuiTabArt
{
public:
wxAuiTabArt() { }
virtual ~wxAuiTabArt() { }
virtual wxAuiTabArt* Clone() = 0;
virtual void SetFlags(unsigned int flags) = 0;
virtual void SetSizingInfo(const wxSize& tab_ctrl_size,
size_t tab_count) = 0;
virtual void SetNormalFont(const wxFont& font) = 0;
virtual void SetSelectedFont(const wxFont& font) = 0;
virtual void SetMeasuringFont(const wxFont& font) = 0;
virtual void DrawBackground(
wxDC& dc,
wxWindow* wnd,
const wxRect& rect) = 0;
virtual void DrawTab(wxDC& dc,
wxWindow* wnd,
const wxAuiNotebookPage& pane,
const wxRect& in_rect,
int close_button_state,
wxRect* out_tab_rect,
wxRect* out_button_rect,
int* x_extent) = 0;
virtual void DrawButton(
wxDC& dc,
wxWindow* wnd,
const wxRect& in_rect,
int bitmap_id,
int button_state,
int orientation,
wxRect* out_rect) = 0;
virtual wxSize GetTabSize(
wxDC& dc,
wxWindow* wnd,
const wxString& caption,
const wxBitmap& bitmap,
bool active,
int close_button_state,
int* x_extent) = 0;
virtual int ShowDropDown(
wxWindow* wnd,
const wxAuiNotebookPageArray& items,
int active_idx) = 0;
virtual int GetIndentSize() = 0;
virtual int GetBestTabCtrlSize(
wxWindow* wnd,
const wxAuiNotebookPageArray& pages,
const wxSize& required_bmp_size) = 0;
};
class WXDLLIMPEXP_AUI wxAuiDefaultTabArt : public wxAuiTabArt
{
public:
wxAuiDefaultTabArt();
virtual ~wxAuiDefaultTabArt();
wxAuiTabArt* Clone();
void SetFlags(unsigned int flags);
void SetSizingInfo(const wxSize& tab_ctrl_size,
size_t tab_count);
void SetNormalFont(const wxFont& font);
void SetSelectedFont(const wxFont& font);
void SetMeasuringFont(const wxFont& font);
void DrawBackground(
wxDC& dc,
wxWindow* wnd,
const wxRect& rect);
void DrawTab(wxDC& dc,
wxWindow* wnd,
const wxAuiNotebookPage& pane,
const wxRect& in_rect,
int close_button_state,
wxRect* out_tab_rect,
wxRect* out_button_rect,
int* x_extent);
void DrawButton(
wxDC& dc,
wxWindow* wnd,
const wxRect& in_rect,
int bitmap_id,
int button_state,
int orientation,
wxRect* out_rect);
int GetIndentSize();
wxSize GetTabSize(
wxDC& dc,
wxWindow* wnd,
const wxString& caption,
const wxBitmap& bitmap,
bool active,
int close_button_state,
int* x_extent);
int ShowDropDown(
wxWindow* wnd,
const wxAuiNotebookPageArray& items,
int active_idx);
int GetBestTabCtrlSize(wxWindow* wnd,
const wxAuiNotebookPageArray& pages,
const wxSize& required_bmp_size);
protected:
wxFont m_normal_font;
wxFont m_selected_font;
wxFont m_measuring_font;
wxColour m_base_colour;
wxPen m_base_colour_pen;
wxPen m_border_pen;
wxBrush m_base_colour_brush;
wxBitmap m_active_close_bmp;
wxBitmap m_disabled_close_bmp;
wxBitmap m_active_left_bmp;
wxBitmap m_disabled_left_bmp;
wxBitmap m_active_right_bmp;
wxBitmap m_disabled_right_bmp;
wxBitmap m_active_windowlist_bmp;
wxBitmap m_disabled_windowlist_bmp;
int m_fixed_tab_width;
int m_tab_ctrl_height;
unsigned int m_flags;
};
class WXDLLIMPEXP_AUI wxAuiSimpleTabArt : public wxAuiTabArt
{
public:
wxAuiSimpleTabArt();
virtual ~wxAuiSimpleTabArt();
wxAuiTabArt* Clone();
void SetFlags(unsigned int flags);
void SetSizingInfo(const wxSize& tab_ctrl_size,
size_t tab_count);
void SetNormalFont(const wxFont& font);
void SetSelectedFont(const wxFont& font);
void SetMeasuringFont(const wxFont& font);
void DrawBackground(
wxDC& dc,
wxWindow* wnd,
const wxRect& rect);
void DrawTab(wxDC& dc,
wxWindow* wnd,
const wxAuiNotebookPage& pane,
const wxRect& in_rect,
int close_button_state,
wxRect* out_tab_rect,
wxRect* out_button_rect,
int* x_extent);
void DrawButton(
wxDC& dc,
wxWindow* wnd,
const wxRect& in_rect,
int bitmap_id,
int button_state,
int orientation,
wxRect* out_rect);
int GetIndentSize();
wxSize GetTabSize(
wxDC& dc,
wxWindow* wnd,
const wxString& caption,
const wxBitmap& bitmap,
bool active,
int close_button_state,
int* x_extent);
int ShowDropDown(
wxWindow* wnd,
const wxAuiNotebookPageArray& items,
int active_idx);
int GetBestTabCtrlSize(wxWindow* wnd,
const wxAuiNotebookPageArray& pages,
const wxSize& required_bmp_size);
protected:
wxFont m_normal_font;
wxFont m_selected_font;
wxFont m_measuring_font;
wxPen m_normal_bkpen;
wxPen m_selected_bkpen;
wxBrush m_normal_bkbrush;
wxBrush m_selected_bkbrush;
wxBrush m_bkbrush;
wxBitmap m_active_close_bmp;
wxBitmap m_disabled_close_bmp;
wxBitmap m_active_left_bmp;
wxBitmap m_disabled_left_bmp;
wxBitmap m_active_right_bmp;
wxBitmap m_disabled_right_bmp;
wxBitmap m_active_windowlist_bmp;
wxBitmap m_disabled_windowlist_bmp;
int m_fixed_tab_width;
unsigned int m_flags;
};
class WXDLLIMPEXP_AUI wxAuiTabContainer
{
public:
wxAuiTabContainer();
virtual ~wxAuiTabContainer();
void SetArtProvider(wxAuiTabArt* art);
wxAuiTabArt* GetArtProvider() const;
void SetFlags(unsigned int flags);
unsigned int GetFlags() const;
bool AddPage(wxWindow* page, const wxAuiNotebookPage& info);
bool InsertPage(wxWindow* page, const wxAuiNotebookPage& info, size_t idx);
bool MovePage(wxWindow* page, size_t new_idx);
bool RemovePage(wxWindow* page);
bool SetActivePage(wxWindow* page);
bool SetActivePage(size_t page);
void SetNoneActive();
int GetActivePage() const;
bool TabHitTest(int x, int y, wxWindow** hit) const;
bool ButtonHitTest(int x, int y, wxAuiTabContainerButton** hit) const;
wxWindow* GetWindowFromIdx(size_t idx) const;
int GetIdxFromWindow(wxWindow* page) const;
size_t GetPageCount() const;
wxAuiNotebookPage& GetPage(size_t idx);
const wxAuiNotebookPage& GetPage(size_t idx) const;
wxAuiNotebookPageArray& GetPages();
void SetNormalFont(const wxFont& normal_font);
void SetSelectedFont(const wxFont& selected_font);
void SetMeasuringFont(const wxFont& measuring_font);
void DoShowHide();
void SetRect(const wxRect& rect);
void RemoveButton(int id);
void AddButton(int id,
int location,
const wxBitmap& normal_bitmap = wxNullBitmap,
const wxBitmap& disabled_bitmap = wxNullBitmap);
size_t GetTabOffset() const;
void SetTabOffset(size_t offset);
// Is the tab visible?
bool IsTabVisible(int tabPage, int tabOffset, wxDC* dc, wxWindow* wnd);
// Make the tab visible if it wasn't already
void MakeTabVisible(int tabPage, wxWindow* win);
protected:
virtual void Render(wxDC* dc, wxWindow* wnd);
protected:
wxAuiTabArt* m_art;
wxAuiNotebookPageArray m_pages;
wxAuiTabContainerButtonArray m_buttons;
wxAuiTabContainerButtonArray m_tab_close_buttons;
wxRect m_rect;
size_t m_tab_offset;
unsigned int m_flags;
};
class WXDLLIMPEXP_AUI wxAuiTabCtrl : public wxControl,
public wxAuiTabContainer
{
public:
wxAuiTabCtrl(wxWindow* parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0);
~wxAuiTabCtrl();
#if wxABI_VERSION >= 20805
bool IsDragging() const { return m_is_dragging; }
#endif
protected:
void OnPaint(wxPaintEvent& evt);
void OnEraseBackground(wxEraseEvent& evt);
void OnSize(wxSizeEvent& evt);
void OnLeftDown(wxMouseEvent& evt);
void OnLeftUp(wxMouseEvent& evt);
#if wxABI_VERSION >= 20805
void OnMiddleDown(wxMouseEvent& evt);
void OnMiddleUp(wxMouseEvent& evt);
void OnRightDown(wxMouseEvent& evt);
void OnRightUp(wxMouseEvent& evt);
void OnLeftDClick(wxMouseEvent& evt);
void OnSetFocus(wxFocusEvent& evt);
void OnKillFocus(wxFocusEvent& evt);
void OnChar(wxKeyEvent& evt);
#endif
#if wxABI_VERSION >= 20809
void OnCaptureLost(wxMouseCaptureLostEvent& evt);
#endif
void OnMotion(wxMouseEvent& evt);
void OnLeaveWindow(wxMouseEvent& evt);
void OnButton(wxAuiNotebookEvent& evt);
protected:
wxPoint m_click_pt;
wxWindow* m_click_tab;
bool m_is_dragging;
wxAuiTabContainerButton* m_hover_button;
wxAuiTabContainerButton* m_pressed_button;
#ifndef SWIG
DECLARE_CLASS(wxAuiTabCtrl)
DECLARE_EVENT_TABLE()
#endif
};
class WXDLLIMPEXP_AUI wxAuiNotebook : public wxControl
{
public:
wxAuiNotebook();
wxAuiNotebook(wxWindow* parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxAUI_NB_DEFAULT_STYLE);
virtual ~wxAuiNotebook();
bool Create(wxWindow* parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0);
void SetWindowStyleFlag(long style);
void SetArtProvider(wxAuiTabArt* art);
wxAuiTabArt* GetArtProvider() const;
virtual void SetUniformBitmapSize(const wxSize& size);
virtual void SetTabCtrlHeight(int height);
bool AddPage(wxWindow* page,
const wxString& caption,
bool select = false,
const wxBitmap& bitmap = wxNullBitmap);
bool InsertPage(size_t page_idx,
wxWindow* page,
const wxString& caption,
bool select = false,
const wxBitmap& bitmap = wxNullBitmap);
bool DeletePage(size_t page);
bool RemovePage(size_t page);
size_t GetPageCount() const;
wxWindow* GetPage(size_t page_idx) const;
int GetPageIndex(wxWindow* page_wnd) const;
bool SetPageText(size_t page, const wxString& text);
wxString GetPageText(size_t page_idx) const;
bool SetPageBitmap(size_t page, const wxBitmap& bitmap);
wxBitmap GetPageBitmap(size_t page_idx) const;
size_t SetSelection(size_t new_page);
int GetSelection() const;
virtual void Split(size_t page, int direction);
#if wxABI_VERSION >= 20801
const wxAuiManager& GetAuiManager() const { return m_mgr; }
#endif
#if wxABI_VERSION >= 20805
// Sets the normal font
void SetNormalFont(const wxFont& font);
// Sets the selected tab font
void SetSelectedFont(const wxFont& font);
// Sets the measuring font
void SetMeasuringFont(const wxFont& font);
// Sets the tab font
virtual bool SetFont(const wxFont& font);
// Gets the tab control height
int GetTabCtrlHeight() const;
// Gets the height of the notebook for a given page height
int GetHeightForPageHeight(int pageHeight);
// Advances the selection, generation page selection events
void AdvanceSelection(bool forward = true);
// Shows the window menu
bool ShowWindowMenu();
#endif
protected:
// these can be overridden
virtual void UpdateTabCtrlHeight();
virtual int CalculateTabCtrlHeight();
virtual wxSize CalculateNewSplitSize();
protected:
void DoSizing();
void InitNotebook(long style);
wxAuiTabCtrl* GetTabCtrlFromPoint(const wxPoint& pt);
wxWindow* GetTabFrameFromTabCtrl(wxWindow* tab_ctrl);
wxAuiTabCtrl* GetActiveTabCtrl();
bool FindTab(wxWindow* page, wxAuiTabCtrl** ctrl, int* idx);
void RemoveEmptyTabFrames();
void UpdateHintWindowSize();
protected:
void OnChildFocus(wxChildFocusEvent& evt);
void OnRender(wxAuiManagerEvent& evt);
void OnSize(wxSizeEvent& evt);
void OnTabClicked(wxCommandEvent& evt);
void OnTabBeginDrag(wxCommandEvent& evt);
void OnTabDragMotion(wxCommandEvent& evt);
void OnTabEndDrag(wxCommandEvent& evt);
void OnTabButton(wxCommandEvent& evt);
#if wxABI_VERSION >= 20805
void OnTabMiddleDown(wxCommandEvent& evt);
void OnTabMiddleUp(wxCommandEvent& evt);
void OnTabRightDown(wxCommandEvent& evt);
void OnTabRightUp(wxCommandEvent& evt);
void OnNavigationKey(wxNavigationKeyEvent& event);
void OnTabBgDClick(wxCommandEvent& evt);
#endif
protected:
wxAuiManager m_mgr;
wxAuiTabContainer m_tabs;
int m_curpage;
int m_tab_id_counter;
wxWindow* m_dummy_wnd;
wxSize m_requested_bmp_size;
int m_requested_tabctrl_height;
wxFont m_selected_font;
wxFont m_normal_font;
int m_tab_ctrl_height;
int m_last_drag_x;
unsigned int m_flags;
#ifndef SWIG
DECLARE_CLASS(wxAuiNotebook)
DECLARE_EVENT_TABLE()
#endif
};
// wx event machinery
#ifndef SWIG
BEGIN_DECLARE_EVENT_TYPES()
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, 0)
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, 0)
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING, 0)
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_BUTTON, 0)
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG, 0)
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_END_DRAG, 0)
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION, 0)
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_ALLOW_DND, 0)
#if wxABI_VERSION >= 20805
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_DOWN, 0)
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_UP, 0)
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_DOWN, 0)
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_UP, 0)
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSED, 0)
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_DRAG_DONE, 0)
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_BG_DCLICK, 0)
#endif
END_DECLARE_EVENT_TYPES()
typedef void (wxEvtHandler::*wxAuiNotebookEventFunction)(wxAuiNotebookEvent&);
#define wxAuiNotebookEventHandler(func) \
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxAuiNotebookEventFunction, &func)
#define EVT_AUINOTEBOOK_PAGE_CLOSE(winid, fn) \
wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, winid, wxAuiNotebookEventHandler(fn))
#define EVT_AUINOTEBOOK_PAGE_CLOSED(winid, fn) \
wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSED, winid, wxAuiNotebookEventHandler(fn))
#define EVT_AUINOTEBOOK_PAGE_CHANGED(winid, fn) \
wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, winid, wxAuiNotebookEventHandler(fn))
#define EVT_AUINOTEBOOK_PAGE_CHANGING(winid, fn) \
wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING, winid, wxAuiNotebookEventHandler(fn))
#define EVT_AUINOTEBOOK_BUTTON(winid, fn) \
wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_BUTTON, winid, wxAuiNotebookEventHandler(fn))
#define EVT_AUINOTEBOOK_BEGIN_DRAG(winid, fn) \
wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG, winid, wxAuiNotebookEventHandler(fn))
#define EVT_AUINOTEBOOK_END_DRAG(winid, fn) \
wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_END_DRAG, winid, wxAuiNotebookEventHandler(fn))
#define EVT_AUINOTEBOOK_DRAG_MOTION(winid, fn) \
wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION, winid, wxAuiNotebookEventHandler(fn))
#define EVT_AUINOTEBOOK_ALLOW_DND(winid, fn) \
wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_ALLOW_DND, winid, wxAuiNotebookEventHandler(fn))
#if wxABI_VERSION >= 20805
#define EVT_AUINOTEBOOK_TAB_MIDDLE_DOWN(winid, fn) \
wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_DOWN, winid, wxAuiNotebookEventHandler(fn))
#define EVT_AUINOTEBOOK_TAB_MIDDLE_UP(winid, fn) \
wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_UP, winid, wxAuiNotebookEventHandler(fn))
#define EVT_AUINOTEBOOK_TAB_RIGHT_DOWN(winid, fn) \
wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_DOWN, winid, wxAuiNotebookEventHandler(fn))
#define EVT_AUINOTEBOOK_TAB_RIGHT_UP(winid, fn) \
wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_UP, winid, wxAuiNotebookEventHandler(fn))
#define EVT_AUINOTEBOOK_DRAG_DONE(winid, fn) \
wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_DRAG_DONE, winid, wxAuiNotebookEventHandler(fn))
#define EVT_AUINOTEBOOK_BG_DCLICK(winid, fn) \
wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_BG_DCLICK, winid, wxAuiNotebookEventHandler(fn))
#endif
#else
// wxpython/swig event work
%constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE;
%constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSED;
%constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED;
%constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING;
%constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_BUTTON;
%constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG;
%constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_END_DRAG;
%constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION;
%constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_ALLOW_DND;
%constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_DRAG_DONE;
%constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_BG_DCLICK;
%constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_DOWN;
%constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_UP;
%constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_DOWN;
%constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_UP;
%pythoncode {
EVT_AUINOTEBOOK_PAGE_CLOSE = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, 1 )
EVT_AUINOTEBOOK_PAGE_CLOSED = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSED, 1 )
EVT_AUINOTEBOOK_PAGE_CHANGED = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, 1 )
EVT_AUINOTEBOOK_PAGE_CHANGING = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING, 1 )
EVT_AUINOTEBOOK_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_BUTTON, 1 )
EVT_AUINOTEBOOK_BEGIN_DRAG = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG, 1 )
EVT_AUINOTEBOOK_END_DRAG = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_END_DRAG, 1 )
EVT_AUINOTEBOOK_DRAG_MOTION = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION, 1 )
EVT_AUINOTEBOOK_ALLOW_DND = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_ALLOW_DND, 1 )
EVT_AUINOTEBOOK_DRAG_DONE = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_DRAG_DONE, 1 )
EVT_AUINOTEBOOK_BG_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_BG_DCLICK, 1 )
EVT_AUINOTEBOOK_TAB_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_DOWN, 1 )
EVT_AUINOTEBOOK_TAB_MIDDLE_UP = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_UP , 1 )
EVT_AUINOTEBOOK_TAB_RIGHT_DOWN = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_DOWN, 1 )
EVT_AUINOTEBOOK_TAB_RIGHT_UP = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_UP, 1 )
}
#endif
#endif // wxUSE_AUI
#endif // _WX_AUINOTEBOOK_H_

View File

@ -1,173 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/aui/dockart.h
// Purpose: wxaui: wx advanced user interface - docking window manager
// Author: Benjamin I. Williams
// Modified by:
// Created: 2005-05-17
// RCS-ID: $Id: dockart.h 43154 2006-11-07 10:29:02Z BIW $
// Copyright: (C) Copyright 2005, Kirix Corporation, All Rights Reserved.
// Licence: wxWindows Library Licence, Version 3.1
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DOCKART_H_
#define _WX_DOCKART_H_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/defs.h"
#if wxUSE_AUI
#include "wx/pen.h"
#include "wx/brush.h"
#include "wx/bitmap.h"
#include "wx/colour.h"
// dock art provider code - a dock provider provides all drawing
// functionality to the wxAui dock manager. This allows the dock
// manager to have plugable look-and-feels
class WXDLLIMPEXP_AUI wxAuiDockArt
{
public:
wxAuiDockArt() { }
virtual ~wxAuiDockArt() { }
virtual int GetMetric(int id) = 0;
virtual void SetMetric(int id, int new_val) = 0;
virtual void SetFont(int id, const wxFont& font) = 0;
virtual wxFont GetFont(int id) = 0;
virtual wxColour GetColour(int id) = 0;
virtual void SetColour(int id, const wxColor& colour) = 0;
wxColour GetColor(int id) { return GetColour(id); }
void SetColor(int id, const wxColour& color) { SetColour(id, color); }
virtual void DrawSash(wxDC& dc,
wxWindow* window,
int orientation,
const wxRect& rect) = 0;
virtual void DrawBackground(wxDC& dc,
wxWindow* window,
int orientation,
const wxRect& rect) = 0;
virtual void DrawCaption(wxDC& dc,
wxWindow* window,
const wxString& text,
const wxRect& rect,
wxAuiPaneInfo& pane) = 0;
virtual void DrawGripper(wxDC& dc,
wxWindow* window,
const wxRect& rect,
wxAuiPaneInfo& pane) = 0;
virtual void DrawBorder(wxDC& dc,
wxWindow* window,
const wxRect& rect,
wxAuiPaneInfo& pane) = 0;
virtual void DrawPaneButton(wxDC& dc,
wxWindow* window,
int button,
int button_state,
const wxRect& rect,
wxAuiPaneInfo& pane) = 0;
};
// this is the default art provider for wxAuiManager. Dock art
// can be customized by creating a class derived from this one,
// or replacing this class entirely
class WXDLLIMPEXP_AUI wxAuiDefaultDockArt : public wxAuiDockArt
{
public:
wxAuiDefaultDockArt();
int GetMetric(int metric_id);
void SetMetric(int metric_id, int new_val);
wxColour GetColour(int id);
void SetColour(int id, const wxColor& colour);
void SetFont(int id, const wxFont& font);
wxFont GetFont(int id);
void DrawSash(wxDC& dc,
wxWindow *window,
int orientation,
const wxRect& rect);
void DrawBackground(wxDC& dc,
wxWindow *window,
int orientation,
const wxRect& rect);
void DrawCaption(wxDC& dc,
wxWindow *window,
const wxString& text,
const wxRect& rect,
wxAuiPaneInfo& pane);
void DrawGripper(wxDC& dc,
wxWindow *window,
const wxRect& rect,
wxAuiPaneInfo& pane);
void DrawBorder(wxDC& dc,
wxWindow *window,
const wxRect& rect,
wxAuiPaneInfo& pane);
void DrawPaneButton(wxDC& dc,
wxWindow *window,
int button,
int button_state,
const wxRect& rect,
wxAuiPaneInfo& pane);
protected:
void DrawCaptionBackground(wxDC& dc, const wxRect& rect, bool active);
protected:
wxPen m_border_pen;
wxBrush m_sash_brush;
wxBrush m_background_brush;
wxBrush m_gripper_brush;
wxFont m_caption_font;
wxBitmap m_inactive_close_bitmap;
wxBitmap m_inactive_pin_bitmap;
wxBitmap m_inactive_maximize_bitmap;
wxBitmap m_inactive_restore_bitmap;
wxBitmap m_active_close_bitmap;
wxBitmap m_active_pin_bitmap;
wxBitmap m_active_maximize_bitmap;
wxBitmap m_active_restore_bitmap;
wxPen m_gripper_pen1;
wxPen m_gripper_pen2;
wxPen m_gripper_pen3;
wxColour m_base_colour;
wxColour m_active_caption_colour;
wxColour m_active_caption_gradient_colour;
wxColour m_active_caption_text_colour;
wxColour m_inactive_caption_colour;
wxColour m_inactive_caption_gradient_colour;
wxColour m_inactive_caption_text_colour;
int m_border_size;
int m_caption_size;
int m_sash_size;
int m_button_size;
int m_gripper_size;
int m_gradient_type;
};
#endif // wxUSE_AUI
#endif //_WX_DOCKART_H_

View File

@ -1,81 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/aui/floatpane.h
// Purpose: wxaui: wx advanced user interface - docking window manager
// Author: Benjamin I. Williams
// Modified by:
// Created: 2005-05-17
// RCS-ID: $Id: floatpane.h 43467 2006-11-17 13:07:01Z BIW $
// Copyright: (C) Copyright 2005, Kirix Corporation, All Rights Reserved.
// Licence: wxWindows Library Licence, Version 3.1
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_FLOATPANE_H_
#define _WX_FLOATPANE_H_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/defs.h"
#if wxUSE_AUI
#include "wx/frame.h"
#if defined( __WXMSW__ ) || defined( __WXMAC__ ) || defined( __WXGTK__ )
#include "wx/minifram.h"
#define wxAuiFloatingFrameBaseClass wxMiniFrame
#else
#define wxAuiFloatingFrameBaseClass wxFrame
#endif
class WXDLLIMPEXP_AUI wxAuiFloatingFrame : public wxAuiFloatingFrameBaseClass
{
public:
wxAuiFloatingFrame(wxWindow* parent,
wxAuiManager* owner_mgr,
const wxAuiPaneInfo& pane,
wxWindowID id = wxID_ANY,
long style = wxRESIZE_BORDER | wxSYSTEM_MENU | wxCAPTION |
wxFRAME_NO_TASKBAR | wxFRAME_FLOAT_ON_PARENT |
wxCLIP_CHILDREN
);
virtual ~wxAuiFloatingFrame();
void SetPaneWindow(const wxAuiPaneInfo& pane);
wxAuiManager* GetOwnerManager() const;
protected:
virtual void OnMoveStart();
virtual void OnMoving(const wxRect& window_rect, wxDirection dir);
virtual void OnMoveFinished();
private:
void OnSize(wxSizeEvent& event);
void OnClose(wxCloseEvent& event);
void OnMoveEvent(wxMoveEvent& event);
void OnIdle(wxIdleEvent& event);
void OnActivate(wxActivateEvent& event);
static bool isMouseDown();
private:
wxWindow* m_pane_window; // pane window being managed
bool m_solid_drag; // true if system uses solid window drag
bool m_moving;
wxRect m_last_rect;
wxRect m_last2_rect;
wxRect m_last3_rect;
wxSize m_last_size;
wxDirection m_lastDirection;
wxAuiManager* m_owner_mgr;
wxAuiManager m_mgr;
#ifndef SWIG
DECLARE_EVENT_TABLE()
DECLARE_CLASS(wxAuiFloatingFrame)
#endif // SWIG
};
#endif // wxUSE_AUI
#endif //_WX_FLOATPANE_H_

View File

@ -1,856 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/aui/framemanager.h
// Purpose: wxaui: wx advanced user interface - docking window manager
// Author: Benjamin I. Williams
// Modified by:
// Created: 2005-05-17
// RCS-ID: $Id: framemanager.h 57885 2009-01-07 14:51:49Z JS $
// Copyright: (C) Copyright 2005, Kirix Corporation, All Rights Reserved.
// Licence: wxWindows Library Licence, Version 3.1
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_FRAMEMANAGER_H_
#define _WX_FRAMEMANAGER_H_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/defs.h"
#if wxUSE_AUI
#include "wx/dynarray.h"
#include "wx/gdicmn.h"
#include "wx/window.h"
#include "wx/timer.h"
#include "wx/sizer.h"
enum wxAuiManagerDock
{
wxAUI_DOCK_NONE = 0,
wxAUI_DOCK_TOP = 1,
wxAUI_DOCK_RIGHT = 2,
wxAUI_DOCK_BOTTOM = 3,
wxAUI_DOCK_LEFT = 4,
wxAUI_DOCK_CENTER = 5,
wxAUI_DOCK_CENTRE = wxAUI_DOCK_CENTER
};
enum wxAuiManagerOption
{
wxAUI_MGR_ALLOW_FLOATING = 1 << 0,
wxAUI_MGR_ALLOW_ACTIVE_PANE = 1 << 1,
wxAUI_MGR_TRANSPARENT_DRAG = 1 << 2,
wxAUI_MGR_TRANSPARENT_HINT = 1 << 3,
wxAUI_MGR_VENETIAN_BLINDS_HINT = 1 << 4,
wxAUI_MGR_RECTANGLE_HINT = 1 << 5,
wxAUI_MGR_HINT_FADE = 1 << 6,
wxAUI_MGR_NO_VENETIAN_BLINDS_FADE = 1 << 7,
wxAUI_MGR_LIVE_RESIZE = 1 << 8,
wxAUI_MGR_DEFAULT = wxAUI_MGR_ALLOW_FLOATING |
wxAUI_MGR_TRANSPARENT_HINT |
wxAUI_MGR_HINT_FADE |
wxAUI_MGR_NO_VENETIAN_BLINDS_FADE
};
enum wxAuiPaneDockArtSetting
{
wxAUI_DOCKART_SASH_SIZE = 0,
wxAUI_DOCKART_CAPTION_SIZE = 1,
wxAUI_DOCKART_GRIPPER_SIZE = 2,
wxAUI_DOCKART_PANE_BORDER_SIZE = 3,
wxAUI_DOCKART_PANE_BUTTON_SIZE = 4,
wxAUI_DOCKART_BACKGROUND_COLOUR = 5,
wxAUI_DOCKART_SASH_COLOUR = 6,
wxAUI_DOCKART_ACTIVE_CAPTION_COLOUR = 7,
wxAUI_DOCKART_ACTIVE_CAPTION_GRADIENT_COLOUR = 8,
wxAUI_DOCKART_INACTIVE_CAPTION_COLOUR = 9,
wxAUI_DOCKART_INACTIVE_CAPTION_GRADIENT_COLOUR = 10,
wxAUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR = 11,
wxAUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR = 12,
wxAUI_DOCKART_BORDER_COLOUR = 13,
wxAUI_DOCKART_GRIPPER_COLOUR = 14,
wxAUI_DOCKART_CAPTION_FONT = 15,
wxAUI_DOCKART_GRADIENT_TYPE = 16
};
enum wxAuiPaneDockArtGradients
{
wxAUI_GRADIENT_NONE = 0,
wxAUI_GRADIENT_VERTICAL = 1,
wxAUI_GRADIENT_HORIZONTAL = 2
};
enum wxAuiPaneButtonState
{
wxAUI_BUTTON_STATE_NORMAL = 0,
wxAUI_BUTTON_STATE_HOVER = 1 << 1,
wxAUI_BUTTON_STATE_PRESSED = 1 << 2,
wxAUI_BUTTON_STATE_DISABLED = 1 << 3,
wxAUI_BUTTON_STATE_HIDDEN = 1 << 4,
wxAUI_BUTTON_STATE_CHECKED = 1 << 5
};
enum wxAuiButtonId
{
wxAUI_BUTTON_CLOSE = 101,
wxAUI_BUTTON_MAXIMIZE_RESTORE = 102,
wxAUI_BUTTON_MINIMIZE = 103,
wxAUI_BUTTON_PIN = 104,
wxAUI_BUTTON_OPTIONS = 105,
wxAUI_BUTTON_WINDOWLIST = 106,
wxAUI_BUTTON_LEFT = 107,
wxAUI_BUTTON_RIGHT = 108,
wxAUI_BUTTON_UP = 109,
wxAUI_BUTTON_DOWN = 110,
wxAUI_BUTTON_CUSTOM1 = 201,
wxAUI_BUTTON_CUSTOM2 = 202,
wxAUI_BUTTON_CUSTOM3 = 203
};
enum wxAuiPaneInsertLevel
{
wxAUI_INSERT_PANE = 0,
wxAUI_INSERT_ROW = 1,
wxAUI_INSERT_DOCK = 2
};
// forwards and array declarations
class wxAuiDockUIPart;
class wxAuiPaneButton;
class wxAuiPaneInfo;
class wxAuiDockInfo;
class wxAuiDockArt;
class wxAuiManagerEvent;
#ifndef SWIG
WX_DECLARE_USER_EXPORTED_OBJARRAY(wxAuiDockInfo, wxAuiDockInfoArray, WXDLLIMPEXP_AUI);
WX_DECLARE_USER_EXPORTED_OBJARRAY(wxAuiDockUIPart, wxAuiDockUIPartArray, WXDLLIMPEXP_AUI);
WX_DECLARE_USER_EXPORTED_OBJARRAY(wxAuiPaneButton, wxAuiPaneButtonArray, WXDLLIMPEXP_AUI);
WX_DECLARE_USER_EXPORTED_OBJARRAY(wxAuiPaneInfo, wxAuiPaneInfoArray, WXDLLIMPEXP_AUI);
WX_DEFINE_USER_EXPORTED_ARRAY_PTR(wxAuiPaneInfo*, wxAuiPaneInfoPtrArray, class WXDLLIMPEXP_AUI);
WX_DEFINE_USER_EXPORTED_ARRAY_PTR(wxAuiDockInfo*, wxAuiDockInfoPtrArray, class WXDLLIMPEXP_AUI);
#endif // SWIG
extern WXDLLIMPEXP_AUI wxAuiDockInfo wxAuiNullDockInfo;
extern WXDLLIMPEXP_AUI wxAuiPaneInfo wxAuiNullPaneInfo;
class WXDLLIMPEXP_AUI wxAuiPaneInfo
{
public:
wxAuiPaneInfo()
{
window = NULL;
frame = NULL;
state = 0;
dock_direction = wxAUI_DOCK_LEFT;
dock_layer = 0;
dock_row = 0;
dock_pos = 0;
floating_pos = wxDefaultPosition;
floating_size = wxDefaultSize;
best_size = wxDefaultSize;
min_size = wxDefaultSize;
max_size = wxDefaultSize;
dock_proportion = 0;
DefaultPane();
}
~wxAuiPaneInfo() {}
#ifndef SWIG
wxAuiPaneInfo(const wxAuiPaneInfo& c)
{
name = c.name;
caption = c.caption;
window = c.window;
frame = c.frame;
state = c.state;
dock_direction = c.dock_direction;
dock_layer = c.dock_layer;
dock_row = c.dock_row;
dock_pos = c.dock_pos;
best_size = c.best_size;
min_size = c.min_size;
max_size = c.max_size;
floating_pos = c.floating_pos;
floating_size = c.floating_size;
dock_proportion = c.dock_proportion;
buttons = c.buttons;
rect = c.rect;
}
wxAuiPaneInfo& operator=(const wxAuiPaneInfo& c)
{
name = c.name;
caption = c.caption;
window = c.window;
frame = c.frame;
state = c.state;
dock_direction = c.dock_direction;
dock_layer = c.dock_layer;
dock_row = c.dock_row;
dock_pos = c.dock_pos;
best_size = c.best_size;
min_size = c.min_size;
max_size = c.max_size;
floating_pos = c.floating_pos;
floating_size = c.floating_size;
dock_proportion = c.dock_proportion;
buttons = c.buttons;
rect = c.rect;
return *this;
}
#endif // SWIG
// Write the safe parts of a newly loaded PaneInfo structure "source" into "this"
// used on loading perspectives etc.
void SafeSet(wxAuiPaneInfo source)
{
// note source is not passed by reference so we can overwrite, to keep the
// unsafe bits of "dest"
source.window = window;
source.frame = frame;
source.buttons = buttons;
// now assign
*this = source;
}
bool IsOk() const { return (window != NULL) ? true : false; }
bool IsFixed() const { return !HasFlag(optionResizable); }
bool IsResizable() const { return HasFlag(optionResizable); }
bool IsShown() const { return !HasFlag(optionHidden); }
bool IsFloating() const { return HasFlag(optionFloating); }
bool IsDocked() const { return !HasFlag(optionFloating); }
bool IsToolbar() const { return HasFlag(optionToolbar); }
bool IsTopDockable() const { return HasFlag(optionTopDockable); }
bool IsBottomDockable() const { return HasFlag(optionBottomDockable); }
bool IsLeftDockable() const { return HasFlag(optionLeftDockable); }
bool IsRightDockable() const { return HasFlag(optionRightDockable); }
bool IsFloatable() const { return HasFlag(optionFloatable); }
bool IsMovable() const { return HasFlag(optionMovable); }
bool IsDestroyOnClose() const { return HasFlag(optionDestroyOnClose); }
bool IsMaximized() const { return HasFlag(optionMaximized); }
bool HasCaption() const { return HasFlag(optionCaption); }
bool HasGripper() const { return HasFlag(optionGripper); }
bool HasBorder() const { return HasFlag(optionPaneBorder); }
bool HasCloseButton() const { return HasFlag(buttonClose); }
bool HasMaximizeButton() const { return HasFlag(buttonMaximize); }
bool HasMinimizeButton() const { return HasFlag(buttonMinimize); }
bool HasPinButton() const { return HasFlag(buttonPin); }
bool HasGripperTop() const { return HasFlag(optionGripperTop); }
#ifdef SWIG
%typemap(out) wxAuiPaneInfo& { $result = $self; Py_INCREF($result); }
#endif
wxAuiPaneInfo& Window(wxWindow* w) { window = w; return *this; }
wxAuiPaneInfo& Name(const wxString& n) { name = n; return *this; }
wxAuiPaneInfo& Caption(const wxString& c) { caption = c; return *this; }
wxAuiPaneInfo& Left() { dock_direction = wxAUI_DOCK_LEFT; return *this; }
wxAuiPaneInfo& Right() { dock_direction = wxAUI_DOCK_RIGHT; return *this; }
wxAuiPaneInfo& Top() { dock_direction = wxAUI_DOCK_TOP; return *this; }
wxAuiPaneInfo& Bottom() { dock_direction = wxAUI_DOCK_BOTTOM; return *this; }
wxAuiPaneInfo& Center() { dock_direction = wxAUI_DOCK_CENTER; return *this; }
wxAuiPaneInfo& Centre() { dock_direction = wxAUI_DOCK_CENTRE; return *this; }
wxAuiPaneInfo& Direction(int direction) { dock_direction = direction; return *this; }
wxAuiPaneInfo& Layer(int layer) { dock_layer = layer; return *this; }
wxAuiPaneInfo& Row(int row) { dock_row = row; return *this; }
wxAuiPaneInfo& Position(int pos) { dock_pos = pos; return *this; }
wxAuiPaneInfo& BestSize(const wxSize& size) { best_size = size; return *this; }
wxAuiPaneInfo& MinSize(const wxSize& size) { min_size = size; return *this; }
wxAuiPaneInfo& MaxSize(const wxSize& size) { max_size = size; return *this; }
wxAuiPaneInfo& BestSize(int x, int y) { best_size.Set(x,y); return *this; }
wxAuiPaneInfo& MinSize(int x, int y) { min_size.Set(x,y); return *this; }
wxAuiPaneInfo& MaxSize(int x, int y) { max_size.Set(x,y); return *this; }
wxAuiPaneInfo& FloatingPosition(const wxPoint& pos) { floating_pos = pos; return *this; }
wxAuiPaneInfo& FloatingPosition(int x, int y) { floating_pos.x = x; floating_pos.y = y; return *this; }
wxAuiPaneInfo& FloatingSize(const wxSize& size) { floating_size = size; return *this; }
wxAuiPaneInfo& FloatingSize(int x, int y) { floating_size.Set(x,y); return *this; }
wxAuiPaneInfo& Fixed() { return SetFlag(optionResizable, false); }
wxAuiPaneInfo& Resizable(bool resizable = true) { return SetFlag(optionResizable, resizable); }
wxAuiPaneInfo& Dock() { return SetFlag(optionFloating, false); }
wxAuiPaneInfo& Float() { return SetFlag(optionFloating, true); }
wxAuiPaneInfo& Hide() { return SetFlag(optionHidden, true); }
wxAuiPaneInfo& Show(bool show = true) { return SetFlag(optionHidden, !show); }
wxAuiPaneInfo& CaptionVisible(bool visible = true) { return SetFlag(optionCaption, visible); }
wxAuiPaneInfo& Maximize() { return SetFlag(optionMaximized, true); }
wxAuiPaneInfo& Restore() { return SetFlag(optionMaximized, false); }
wxAuiPaneInfo& PaneBorder(bool visible = true) { return SetFlag(optionPaneBorder, visible); }
wxAuiPaneInfo& Gripper(bool visible = true) { return SetFlag(optionGripper, visible); }
wxAuiPaneInfo& GripperTop(bool attop = true) { return SetFlag(optionGripperTop, attop); }
wxAuiPaneInfo& CloseButton(bool visible = true) { return SetFlag(buttonClose, visible); }
wxAuiPaneInfo& MaximizeButton(bool visible = true) { return SetFlag(buttonMaximize, visible); }
wxAuiPaneInfo& MinimizeButton(bool visible = true) { return SetFlag(buttonMinimize, visible); }
wxAuiPaneInfo& PinButton(bool visible = true) { return SetFlag(buttonPin, visible); }
wxAuiPaneInfo& DestroyOnClose(bool b = true) { return SetFlag(optionDestroyOnClose, b); }
wxAuiPaneInfo& TopDockable(bool b = true) { return SetFlag(optionTopDockable, b); }
wxAuiPaneInfo& BottomDockable(bool b = true) { return SetFlag(optionBottomDockable, b); }
wxAuiPaneInfo& LeftDockable(bool b = true) { return SetFlag(optionLeftDockable, b); }
wxAuiPaneInfo& RightDockable(bool b = true) { return SetFlag(optionRightDockable, b); }
wxAuiPaneInfo& Floatable(bool b = true) { return SetFlag(optionFloatable, b); }
wxAuiPaneInfo& Movable(bool b = true) { return SetFlag(optionMovable, b); }
#if wxABI_VERSION >= 20807
wxAuiPaneInfo& DockFixed(bool b = true) { return SetFlag(optionDockFixed, b); }
#endif
wxAuiPaneInfo& Dockable(bool b = true)
{
return TopDockable(b).BottomDockable(b).LeftDockable(b).RightDockable(b);
}
wxAuiPaneInfo& DefaultPane()
{
state |= optionTopDockable | optionBottomDockable |
optionLeftDockable | optionRightDockable |
optionFloatable | optionMovable | optionResizable |
optionCaption | optionPaneBorder | buttonClose;
return *this;
}
wxAuiPaneInfo& CentrePane() { return CenterPane(); }
wxAuiPaneInfo& CenterPane()
{
state = 0;
return Center().PaneBorder().Resizable();
}
wxAuiPaneInfo& ToolbarPane()
{
DefaultPane();
state |= (optionToolbar | optionGripper);
state &= ~(optionResizable | optionCaption);
if (dock_layer == 0)
dock_layer = 10;
return *this;
}
wxAuiPaneInfo& SetFlag(unsigned int flag, bool option_state)
{
if (option_state)
state |= flag;
else
state &= ~flag;
return *this;
}
bool HasFlag(unsigned int flag) const
{
return (state & flag) ? true:false;
}
#ifdef SWIG
%typemap(out) wxAuiPaneInfo& ;
#endif
public:
// NOTE: You can add and subtract flags from this list,
// but do not change the values of the flags, because
// they are stored in a binary integer format in the
// perspective string. If you really need to change the
// values around, you'll have to ensure backwards-compatibility
// in the perspective loading code.
enum wxAuiPaneState
{
optionFloating = 1 << 0,
optionHidden = 1 << 1,
optionLeftDockable = 1 << 2,
optionRightDockable = 1 << 3,
optionTopDockable = 1 << 4,
optionBottomDockable = 1 << 5,
optionFloatable = 1 << 6,
optionMovable = 1 << 7,
optionResizable = 1 << 8,
optionPaneBorder = 1 << 9,
optionCaption = 1 << 10,
optionGripper = 1 << 11,
optionDestroyOnClose = 1 << 12,
optionToolbar = 1 << 13,
optionActive = 1 << 14,
optionGripperTop = 1 << 15,
optionMaximized = 1 << 16,
optionDockFixed = 1 << 17,
buttonClose = 1 << 21,
buttonMaximize = 1 << 22,
buttonMinimize = 1 << 23,
buttonPin = 1 << 24,
buttonCustom1 = 1 << 26,
buttonCustom2 = 1 << 27,
buttonCustom3 = 1 << 28,
savedHiddenState = 1 << 30, // used internally
actionPane = 1 << 31 // used internally
};
public:
wxString name; // name of the pane
wxString caption; // caption displayed on the window
wxWindow* window; // window that is in this pane
wxFrame* frame; // floating frame window that holds the pane
unsigned int state; // a combination of wxPaneState values
int dock_direction; // dock direction (top, bottom, left, right, center)
int dock_layer; // layer number (0 = innermost layer)
int dock_row; // row number on the docking bar (0 = first row)
int dock_pos; // position inside the row (0 = first position)
wxSize best_size; // size that the layout engine will prefer
wxSize min_size; // minimum size the pane window can tolerate
wxSize max_size; // maximum size the pane window can tolerate
wxPoint floating_pos; // position while floating
wxSize floating_size; // size while floating
int dock_proportion; // proportion while docked
wxAuiPaneButtonArray buttons; // buttons on the pane
wxRect rect; // current rectangle (populated by wxAUI)
};
class WXDLLIMPEXP_FWD_AUI wxAuiFloatingFrame;
class WXDLLIMPEXP_AUI wxAuiManager : public wxEvtHandler
{
friend class wxAuiFloatingFrame;
public:
wxAuiManager(wxWindow* managed_wnd = NULL,
unsigned int flags = wxAUI_MGR_DEFAULT);
virtual ~wxAuiManager();
void UnInit();
void SetFlags(unsigned int flags);
unsigned int GetFlags() const;
void SetManagedWindow(wxWindow* managed_wnd);
wxWindow* GetManagedWindow() const;
static wxAuiManager* GetManager(wxWindow* window);
void SetArtProvider(wxAuiDockArt* art_provider);
wxAuiDockArt* GetArtProvider() const;
wxAuiPaneInfo& GetPane(wxWindow* window);
wxAuiPaneInfo& GetPane(const wxString& name);
wxAuiPaneInfoArray& GetAllPanes();
bool AddPane(wxWindow* window,
const wxAuiPaneInfo& pane_info);
bool AddPane(wxWindow* window,
const wxAuiPaneInfo& pane_info,
const wxPoint& drop_pos);
bool AddPane(wxWindow* window,
int direction = wxLEFT,
const wxString& caption = wxEmptyString);
bool InsertPane(wxWindow* window,
const wxAuiPaneInfo& insert_location,
int insert_level = wxAUI_INSERT_PANE);
bool DetachPane(wxWindow* window);
void Update();
wxString SavePaneInfo(wxAuiPaneInfo& pane);
void LoadPaneInfo(wxString pane_part, wxAuiPaneInfo &pane);
wxString SavePerspective();
bool LoadPerspective(const wxString& perspective, bool update = true);
void SetDockSizeConstraint(double width_pct, double height_pct);
void GetDockSizeConstraint(double* width_pct, double* height_pct) const;
void ClosePane(wxAuiPaneInfo& pane_info);
void MaximizePane(wxAuiPaneInfo& pane_info);
void RestorePane(wxAuiPaneInfo& pane_info);
void RestoreMaximizedPane();
public:
virtual wxAuiFloatingFrame* CreateFloatingFrame(wxWindow* parent, const wxAuiPaneInfo& p);
void StartPaneDrag(
wxWindow* pane_window,
const wxPoint& offset);
wxRect CalculateHintRect(
wxWindow* pane_window,
const wxPoint& pt,
const wxPoint& offset);
void DrawHintRect(
wxWindow* pane_window,
const wxPoint& pt,
const wxPoint& offset);
virtual void ShowHint(const wxRect& rect);
virtual void HideHint();
public:
// deprecated -- please use SetManagedWindow() and
// and GetManagedWindow() instead
wxDEPRECATED( void SetFrame(wxFrame* frame) );
wxDEPRECATED( wxFrame* GetFrame() const );
protected:
void UpdateHintWindowConfig();
void DoFrameLayout();
void LayoutAddPane(wxSizer* container,
wxAuiDockInfo& dock,
wxAuiPaneInfo& pane,
wxAuiDockUIPartArray& uiparts,
bool spacer_only);
void LayoutAddDock(wxSizer* container,
wxAuiDockInfo& dock,
wxAuiDockUIPartArray& uiparts,
bool spacer_only);
wxSizer* LayoutAll(wxAuiPaneInfoArray& panes,
wxAuiDockInfoArray& docks,
wxAuiDockUIPartArray& uiparts,
bool spacer_only = false);
virtual bool ProcessDockResult(wxAuiPaneInfo& target,
const wxAuiPaneInfo& new_pos);
bool DoDrop(wxAuiDockInfoArray& docks,
wxAuiPaneInfoArray& panes,
wxAuiPaneInfo& drop,
const wxPoint& pt,
const wxPoint& action_offset = wxPoint(0,0));
wxAuiDockUIPart* HitTest(int x, int y);
wxAuiDockUIPart* GetPanePart(wxWindow* pane);
int GetDockPixelOffset(wxAuiPaneInfo& test);
void OnFloatingPaneMoveStart(wxWindow* window);
void OnFloatingPaneMoving(wxWindow* window, wxDirection dir );
void OnFloatingPaneMoved(wxWindow* window, wxDirection dir);
void OnFloatingPaneActivated(wxWindow* window);
void OnFloatingPaneClosed(wxWindow* window, wxCloseEvent& evt);
void OnFloatingPaneResized(wxWindow* window, const wxSize& size);
void Render(wxDC* dc);
void Repaint(wxDC* dc = NULL);
void ProcessMgrEvent(wxAuiManagerEvent& event);
void UpdateButtonOnScreen(wxAuiDockUIPart* button_ui_part,
const wxMouseEvent& event);
void GetPanePositionsAndSizes(wxAuiDockInfo& dock,
wxArrayInt& positions,
wxArrayInt& sizes);
#if wxABI_VERSION >= 20810
/// Ends a resize action, or for live update, resizes the sash
bool DoEndResizeAction(wxMouseEvent& event);
#endif
public:
// public events (which can be invoked externally)
void OnRender(wxAuiManagerEvent& evt);
void OnPaneButton(wxAuiManagerEvent& evt);
protected:
// protected events
void OnPaint(wxPaintEvent& evt);
void OnEraseBackground(wxEraseEvent& evt);
void OnSize(wxSizeEvent& evt);
void OnSetCursor(wxSetCursorEvent& evt);
void OnLeftDown(wxMouseEvent& evt);
void OnLeftUp(wxMouseEvent& evt);
void OnMotion(wxMouseEvent& evt);
void OnLeaveWindow(wxMouseEvent& evt);
void OnChildFocus(wxChildFocusEvent& evt);
void OnHintFadeTimer(wxTimerEvent& evt);
void OnFindManager(wxAuiManagerEvent& evt);
protected:
enum
{
actionNone = 0,
actionResize,
actionClickButton,
actionClickCaption,
actionDragToolbarPane,
actionDragFloatingPane
};
protected:
wxWindow* m_frame; // the window being managed
wxAuiDockArt* m_art; // dock art object which does all drawing
unsigned int m_flags; // manager flags wxAUI_MGR_*
wxAuiPaneInfoArray m_panes; // array of panes structures
wxAuiDockInfoArray m_docks; // array of docks structures
wxAuiDockUIPartArray m_uiparts; // array of UI parts (captions, buttons, etc)
int m_action; // current mouse action
wxPoint m_action_start; // position where the action click started
wxPoint m_action_offset; // offset from upper left of the item clicked
wxAuiDockUIPart* m_action_part; // ptr to the part the action happened to
wxWindow* m_action_window; // action frame or window (NULL if none)
wxRect m_action_hintrect; // hint rectangle for the action
wxRect m_last_rect;
wxAuiDockUIPart* m_hover_button;// button uipart being hovered over
wxRect m_last_hint; // last hint rectangle
wxPoint m_last_mouse_move; // last mouse move position (see OnMotion)
bool m_skipping;
bool m_has_maximized;
double m_dock_constraint_x; // 0.0 .. 1.0; max pct of window width a dock can consume
double m_dock_constraint_y; // 0.0 .. 1.0; max pct of window height a dock can consume
wxFrame* m_hint_wnd; // transparent hint window, if supported by platform
wxTimer m_hint_fadetimer; // transparent fade timer
wxByte m_hint_fadeamt; // transparent fade amount
wxByte m_hint_fademax; // maximum value of hint fade
void* m_reserved;
#ifndef SWIG
DECLARE_EVENT_TABLE()
DECLARE_CLASS(wxAuiManager)
#endif // SWIG
};
// event declarations/classes
class WXDLLIMPEXP_AUI wxAuiManagerEvent : public wxEvent
{
public:
wxAuiManagerEvent(wxEventType type=wxEVT_NULL) : wxEvent(0, type)
{
manager = NULL;
pane = NULL;
button = 0;
veto_flag = false;
canveto_flag = true;
dc = NULL;
}
#ifndef SWIG
wxAuiManagerEvent(const wxAuiManagerEvent& c) : wxEvent(c)
{
manager = c.manager;
pane = c.pane;
button = c.button;
veto_flag = c.veto_flag;
canveto_flag = c.canveto_flag;
dc = c.dc;
}
#endif
wxEvent *Clone() const { return new wxAuiManagerEvent(*this); }
void SetManager(wxAuiManager* mgr) { manager = mgr; }
void SetPane(wxAuiPaneInfo* p) { pane = p; }
void SetButton(int b) { button = b; }
void SetDC(wxDC* pdc) { dc = pdc; }
wxAuiManager* GetManager() const { return manager; }
wxAuiPaneInfo* GetPane() const { return pane; }
int GetButton() const { return button; }
wxDC* GetDC() const { return dc; }
void Veto(bool veto = true) { veto_flag = veto; }
bool GetVeto() const { return veto_flag; }
void SetCanVeto(bool can_veto) { canveto_flag = can_veto; }
bool CanVeto() const { return canveto_flag && veto_flag; }
public:
wxAuiManager* manager;
wxAuiPaneInfo* pane;
int button;
bool veto_flag;
bool canveto_flag;
wxDC* dc;
#ifndef SWIG
private:
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxAuiManagerEvent)
#endif
};
class WXDLLIMPEXP_AUI wxAuiDockInfo
{
public:
wxAuiDockInfo()
{
dock_direction = 0;
dock_layer = 0;
dock_row = 0;
size = 0;
min_size = 0;
resizable = true;
fixed = false;
toolbar = false;
reserved1 = false;
}
#ifndef SWIG
wxAuiDockInfo(const wxAuiDockInfo& c)
{
dock_direction = c.dock_direction;
dock_layer = c.dock_layer;
dock_row = c.dock_row;
size = c.size;
min_size = c.min_size;
resizable = c.resizable;
fixed = c.fixed;
toolbar = c.toolbar;
panes = c.panes;
rect = c.rect;
reserved1 = c.reserved1;
}
wxAuiDockInfo& operator=(const wxAuiDockInfo& c)
{
dock_direction = c.dock_direction;
dock_layer = c.dock_layer;
dock_row = c.dock_row;
size = c.size;
min_size = c.min_size;
resizable = c.resizable;
fixed = c.fixed;
toolbar = c.toolbar;
panes = c.panes;
rect = c.rect;
reserved1 = c.reserved1;
return *this;
}
#endif // SWIG
bool IsOk() const { return (dock_direction != 0) ? true : false; }
bool IsHorizontal() const { return (dock_direction == wxAUI_DOCK_TOP ||
dock_direction == wxAUI_DOCK_BOTTOM) ? true:false; }
bool IsVertical() const { return (dock_direction == wxAUI_DOCK_LEFT ||
dock_direction == wxAUI_DOCK_RIGHT ||
dock_direction == wxAUI_DOCK_CENTER) ? true:false; }
public:
wxAuiPaneInfoPtrArray panes; // array of panes
wxRect rect; // current rectangle
int dock_direction; // dock direction (top, bottom, left, right, center)
int dock_layer; // layer number (0 = innermost layer)
int dock_row; // row number on the docking bar (0 = first row)
int size; // size of the dock
int min_size; // minimum size of a dock (0 if there is no min)
bool resizable; // flag indicating whether the dock is resizable
bool toolbar; // flag indicating dock contains only toolbars
bool fixed; // flag indicating that the dock operates on
// absolute coordinates as opposed to proportional
bool reserved1;
};
class WXDLLIMPEXP_AUI wxAuiDockUIPart
{
public:
enum
{
typeCaption,
typeGripper,
typeDock,
typeDockSizer,
typePane,
typePaneSizer,
typeBackground,
typePaneBorder,
typePaneButton
};
int type; // ui part type (see enum above)
int orientation; // orientation (either wxHORIZONTAL or wxVERTICAL)
wxAuiDockInfo* dock; // which dock the item is associated with
wxAuiPaneInfo* pane; // which pane the item is associated with
wxAuiPaneButton* button; // which pane button the item is associated with
wxSizer* cont_sizer; // the part's containing sizer
wxSizerItem* sizer_item; // the sizer item of the part
wxRect rect; // client coord rectangle of the part itself
};
class WXDLLIMPEXP_AUI wxAuiPaneButton
{
public:
int button_id; // id of the button (e.g. buttonClose)
};
#ifndef SWIG
// wx event machinery
BEGIN_DECLARE_EVENT_TYPES()
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_AUI_PANE_BUTTON, 0)
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_AUI_PANE_CLOSE, 0)
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_AUI_PANE_MAXIMIZE, 0)
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_AUI_PANE_RESTORE, 0)
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_AUI_RENDER, 0)
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_AUI_FIND_MANAGER, 0)
END_DECLARE_EVENT_TYPES()
typedef void (wxEvtHandler::*wxAuiManagerEventFunction)(wxAuiManagerEvent&);
#define wxAuiManagerEventHandler(func) \
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxAuiManagerEventFunction, &func)
#define EVT_AUI_PANE_BUTTON(func) \
wx__DECLARE_EVT0(wxEVT_AUI_PANE_BUTTON, wxAuiManagerEventHandler(func))
#define EVT_AUI_PANE_CLOSE(func) \
wx__DECLARE_EVT0(wxEVT_AUI_PANE_CLOSE, wxAuiManagerEventHandler(func))
#define EVT_AUI_PANE_MAXIMIZE(func) \
wx__DECLARE_EVT0(wxEVT_AUI_PANE_MAXIMIZE, wxAuiManagerEventHandler(func))
#define EVT_AUI_PANE_RESTORE(func) \
wx__DECLARE_EVT0(wxEVT_AUI_PANE_RESTORE, wxAuiManagerEventHandler(func))
#define EVT_AUI_RENDER(func) \
wx__DECLARE_EVT0(wxEVT_AUI_RENDER, wxAuiManagerEventHandler(func))
#define EVT_AUI_FIND_MANAGER(func) \
wx__DECLARE_EVT0(wxEVT_AUI_FIND_MANAGER, wxAuiManagerEventHandler(func))
#else
%constant wxEventType wxEVT_AUI_PANE_BUTTON;
%constant wxEventType wxEVT_AUI_PANE_CLOSE;
%constant wxEventType wxEVT_AUI_PANE_MAXIMIZE;
%constant wxEventType wxEVT_AUI_PANE_RESTORE;
%constant wxEventType wxEVT_AUI_RENDER;
%constant wxEventType wxEVT_AUI_FIND_MANAGER;
%pythoncode {
EVT_AUI_PANE_BUTTON = wx.PyEventBinder( wxEVT_AUI_PANE_BUTTON )
EVT_AUI_PANE_CLOSE = wx.PyEventBinder( wxEVT_AUI_PANE_CLOSE )
EVT_AUI_PANE_MAXIMIZE = wx.PyEventBinder( wxEVT_AUI_PANE_MAXIMIZE )
EVT_AUI_PANE_RESTORE = wx.PyEventBinder( wxEVT_AUI_PANE_RESTORE )
EVT_AUI_RENDER = wx.PyEventBinder( wxEVT_AUI_RENDER )
EVT_AUI_FIND_MANAGER = wx.PyEventBinder( wxEVT_AUI_FIND_MANAGER )
}
#endif // SWIG
#endif // wxUSE_AUI
#endif //_WX_FRAMEMANAGER_H_

View File

@ -1,269 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/tabmdi.h
// Purpose: Generic MDI (Multiple Document Interface) classes
// Author: Hans Van Leemputten
// Modified by: Benjamin I. Williams / Kirix Corporation
// Created: 29/07/2002
// RCS-ID: $Id: tabmdi.h 53135 2008-04-12 02:31:04Z VZ $
// Copyright: (c) Hans Van Leemputten
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_AUITABMDI_H_
#define _WX_AUITABMDI_H_
#if wxUSE_AUI
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/frame.h"
#include "wx/panel.h"
#include "wx/notebook.h"
#include "wx/icon.h"
#include "wx/aui/auibook.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_AUI wxAuiMDIParentFrame;
class WXDLLIMPEXP_FWD_AUI wxAuiMDIClientWindow;
class WXDLLIMPEXP_FWD_AUI wxAuiMDIChildFrame;
//-----------------------------------------------------------------------------
// wxAuiMDIParentFrame
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_AUI wxAuiMDIParentFrame : public wxFrame
{
public:
wxAuiMDIParentFrame();
wxAuiMDIParentFrame(wxWindow *parent,
wxWindowID winid,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
const wxString& name = wxFrameNameStr);
~wxAuiMDIParentFrame();
bool Create(wxWindow *parent,
wxWindowID winid,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
const wxString& name = wxFrameNameStr );
void SetArtProvider(wxAuiTabArt* provider);
wxAuiTabArt* GetArtProvider();
wxAuiNotebook* GetNotebook() const;
#if wxUSE_MENUS
wxMenu* GetWindowMenu() const { return m_pWindowMenu; }
void SetWindowMenu(wxMenu* pMenu);
virtual void SetMenuBar(wxMenuBar *pMenuBar);
#endif // wxUSE_MENUS
void SetChildMenuBar(wxAuiMDIChildFrame *pChild);
virtual bool ProcessEvent(wxEvent& event);
wxAuiMDIChildFrame *GetActiveChild() const;
void SetActiveChild(wxAuiMDIChildFrame* pChildFrame);
wxAuiMDIClientWindow *GetClientWindow() const;
virtual wxAuiMDIClientWindow *OnCreateClient();
virtual void Cascade() { /* Has no effect */ }
virtual void Tile(wxOrientation orient = wxHORIZONTAL);
virtual void ArrangeIcons() { /* Has no effect */ }
virtual void ActivateNext();
virtual void ActivatePrevious();
protected:
wxAuiMDIClientWindow* m_pClientWindow;
wxAuiMDIChildFrame* m_pActiveChild;
wxEvent* m_pLastEvt;
#if wxUSE_MENUS
wxMenu *m_pWindowMenu;
wxMenuBar *m_pMyMenuBar;
#endif // wxUSE_MENUS
protected:
void Init();
#if wxUSE_MENUS
void RemoveWindowMenu(wxMenuBar *pMenuBar);
void AddWindowMenu(wxMenuBar *pMenuBar);
void DoHandleMenu(wxCommandEvent &event);
#endif // wxUSE_MENUS
virtual void DoGetClientSize(int *width, int *height) const;
private:
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(wxAuiMDIParentFrame)
};
//-----------------------------------------------------------------------------
// wxAuiMDIChildFrame
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_AUI wxAuiMDIChildFrame : public wxPanel
{
public:
wxAuiMDIChildFrame();
wxAuiMDIChildFrame(wxAuiMDIParentFrame *parent,
wxWindowID winid,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr);
virtual ~wxAuiMDIChildFrame();
bool Create(wxAuiMDIParentFrame *parent,
wxWindowID winid,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr);
#if wxUSE_MENUS
virtual void SetMenuBar(wxMenuBar *menu_bar);
virtual wxMenuBar *GetMenuBar() const;
#endif // wxUSE_MENUS
virtual void SetTitle(const wxString& title);
virtual wxString GetTitle() const;
virtual void SetIcons(const wxIconBundle& icons);
virtual const wxIconBundle& GetIcons() const;
virtual void SetIcon(const wxIcon& icon);
virtual const wxIcon& GetIcon() const;
virtual void Activate();
virtual bool Destroy();
#if wxUSE_STATUSBAR
// no status bars
virtual wxStatusBar* CreateStatusBar(int WXUNUSED(number) = 1,
long WXUNUSED(style) = 1,
wxWindowID WXUNUSED(winid) = 1,
const wxString& WXUNUSED(name) = wxEmptyString)
{ return (wxStatusBar*)NULL; }
virtual wxStatusBar *GetStatusBar() const { return (wxStatusBar*)NULL; }
virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number)=0 ) {}
virtual void SetStatusWidths( int WXUNUSED(n), const int WXUNUSED(widths_field)[] ) {}
#endif
// no size hints
virtual void DoSetSizeHints(int WXUNUSED(minW),
int WXUNUSED(minH),
int WXUNUSED(maxW) = wxDefaultCoord,
int WXUNUSED(maxH) = wxDefaultCoord,
int WXUNUSED(incW) = wxDefaultCoord,
int WXUNUSED(incH) = wxDefaultCoord) {}
#if wxUSE_TOOLBAR
// no toolbar bars
virtual wxToolBar* CreateToolBar(long WXUNUSED(style),
wxWindowID WXUNUSED(winid),
const wxString& WXUNUSED(name))
{ return (wxToolBar*)NULL; }
virtual wxToolBar *GetToolBar() const { return (wxToolBar*)NULL; }
#endif
// no maximize etc
virtual void Maximize(bool WXUNUSED(maximize) = true) { /* Has no effect */ }
virtual void Restore() { /* Has no effect */ }
virtual void Iconize(bool WXUNUSED(iconize) = true) { /* Has no effect */ }
virtual bool IsMaximized() const { return true; }
virtual bool IsIconized() const { return false; }
virtual bool ShowFullScreen(bool WXUNUSED(show), long WXUNUSED(style)) { return false; }
virtual bool IsFullScreen() const { return false; }
virtual bool IsTopLevel() const { return false; }
void OnMenuHighlight(wxMenuEvent& evt);
void OnActivate(wxActivateEvent& evt);
void OnCloseWindow(wxCloseEvent& evt);
void SetMDIParentFrame(wxAuiMDIParentFrame* parent);
wxAuiMDIParentFrame* GetMDIParentFrame() const;
protected:
void Init();
virtual bool Show(bool show = true);
virtual void DoSetSize(int x, int y, int width, int height, int size_flags);
virtual void DoMoveWindow(int x, int y, int width, int height);
public:
// This function needs to be called when a size change is confirmed,
// we needed this function to prevent anybody from the outside
// changing the panel... it messes the UI layout when we would allow it.
void ApplyMDIChildFrameRect();
void DoShow(bool show);
protected:
wxAuiMDIParentFrame* m_pMDIParentFrame;
wxRect m_mdi_newrect;
wxRect m_mdi_currect;
wxString m_title;
wxIcon m_icon;
wxIconBundle m_icon_bundle;
bool m_activate_on_create;
#if wxUSE_MENUS
wxMenuBar* m_pMenuBar;
#endif // wxUSE_MENUS
private:
DECLARE_DYNAMIC_CLASS(wxAuiMDIChildFrame)
DECLARE_EVENT_TABLE()
friend class wxAuiMDIClientWindow;
};
//-----------------------------------------------------------------------------
// wxAuiMDIClientWindow
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_AUI wxAuiMDIClientWindow : public wxAuiNotebook
{
public:
wxAuiMDIClientWindow();
wxAuiMDIClientWindow(wxAuiMDIParentFrame *parent, long style = 0);
~wxAuiMDIClientWindow();
virtual bool CreateClient(wxAuiMDIParentFrame *parent,
long style = wxVSCROLL | wxHSCROLL);
virtual int SetSelection(size_t page);
protected:
void PageChanged(int old_selection, int new_selection);
void OnPageClose(wxAuiNotebookEvent& evt);
void OnPageChanged(wxAuiNotebookEvent& evt);
void OnSize(wxSizeEvent& evt);
private:
DECLARE_DYNAMIC_CLASS(wxAuiMDIClientWindow)
DECLARE_EVENT_TABLE()
};
#endif // wxUSE_AUI
#endif // _WX_AUITABMDI_H_

View File

@ -1,65 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
// Name: include/wx/beforestd.h
// Purpose: #include before STL headers
// Author: Vadim Zeitlin
// Modified by:
// Created: 07/07/03
// RCS-ID: $Id: beforestd.h 42906 2006-11-01 14:16:42Z VZ $
// Copyright: (c) 2003 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
/**
Unfortunately, when compiling at maximum warning level, the standard
headers themselves may generate warnings -- and really lots of them. So
before including them, this header should be included to temporarily
suppress the warnings and after this the header afterstd.h should be
included to enable them back again.
Note that there are intentionally no inclusion guards in this file, because
it can be included several times.
*/
// VC 7.x isn't as bad as VC6 and doesn't give these warnings but eVC (which
// defines _MSC_VER as 1201) does need to be included as it's VC6-like
#if defined(__VISUALC__) && __VISUALC__ <= 1201
// MSVC 5 does not have this
#if __VISUALC__ > 1100
// we have to disable (and reenable in afterstd.h) this one because,
// even though it is of level 4, it is not disabled by warning(push, 1)
// below for VC7.1!
// unreachable code
#pragma warning(disable:4702)
#pragma warning(push, 1)
#else // VC 5
// 'expression' : signed/unsigned mismatch
#pragma warning(disable:4018)
// 'identifier' : unreferenced formal parameter
#pragma warning(disable:4100)
// 'conversion' : conversion from 'type1' to 'type2',
// possible loss of data
#pragma warning(disable:4244)
// C++ language change: to explicitly specialize class template
// 'identifier' use the following syntax
#pragma warning(disable:4663)
#endif
// these warning have to be disabled and not just temporarily disabled
// because they will be given at the end of the compilation of the
// current source and there is absolutely nothing we can do about them
// 'foo': unreferenced inline function has been removed
#pragma warning(disable:4514)
// 'function' : function not inlined
#pragma warning(disable:4710)
// 'id': identifier was truncated to 'num' characters in the debug info
#pragma warning(disable:4786)
#endif // VC++ < 7

View File

@ -1,241 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/bitmap.h
// Purpose: wxBitmap class interface
// Author: Vaclav Slavik
// Modified by:
// Created: 22.04.01
// RCS-ID: $Id: bitmap.h 49563 2007-10-31 20:46:21Z VZ $
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_BITMAP_H_BASE_
#define _WX_BITMAP_H_BASE_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/string.h"
#include "wx/gdicmn.h" // for wxBitmapType
#include "wx/colour.h"
class WXDLLIMPEXP_FWD_CORE wxBitmap;
class WXDLLIMPEXP_FWD_CORE wxBitmapHandler;
class WXDLLIMPEXP_FWD_CORE wxIcon;
class WXDLLIMPEXP_FWD_CORE wxImage;
class WXDLLIMPEXP_FWD_CORE wxMask;
class WXDLLIMPEXP_FWD_CORE wxPalette;
// ----------------------------------------------------------------------------
// wxVariant support
// ----------------------------------------------------------------------------
#if wxUSE_VARIANT
#include "wx/variant.h"
DECLARE_VARIANT_OBJECT_EXPORTED(wxBitmap,WXDLLEXPORT)
#endif
// ----------------------------------------------------------------------------
// wxMask represents the transparent area of the bitmap
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxMaskBase : public wxObject
{
public:
// create the mask from bitmap pixels of the given colour
bool Create(const wxBitmap& bitmap, const wxColour& colour);
#if wxUSE_PALETTE
// create the mask from bitmap pixels with the given palette index
bool Create(const wxBitmap& bitmap, int paletteIndex);
#endif // wxUSE_PALETTE
// create the mask from the given mono bitmap
bool Create(const wxBitmap& bitmap);
protected:
// this function is called from Create() to free the existing mask data
virtual void FreeData() = 0;
// these functions must be overridden to implement the corresponding public
// Create() methods, they shouldn't call FreeData() as it's already called
// by the public wrappers
virtual bool InitFromColour(const wxBitmap& bitmap,
const wxColour& colour) = 0;
virtual bool InitFromMonoBitmap(const wxBitmap& bitmap) = 0;
};
#if defined(__WXMGL__) || \
defined(__WXDFB__) || \
defined(__WXMAC__) || \
defined(__WXGTK__) || \
defined(__WXCOCOA__) || \
defined(__WXMOTIF__) || \
defined(__WXX11__)
#define wxUSE_BITMAP_BASE 1
#else
#define wxUSE_BITMAP_BASE 0
#endif
// Only used by some ports
// FIXME -- make all ports (but MSW which uses wxGDIImage) use these base classes
#if wxUSE_BITMAP_BASE
// ----------------------------------------------------------------------------
// wxBitmapHandler: class which knows how to create/load/save bitmaps in
// different formats
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxBitmapHandlerBase : public wxObject
{
public:
wxBitmapHandlerBase() { m_type = wxBITMAP_TYPE_INVALID; }
virtual ~wxBitmapHandlerBase() { }
virtual bool Create(wxBitmap *bitmap, const void* data, long flags,
int width, int height, int depth = 1);
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
int desiredWidth, int desiredHeight);
virtual bool SaveFile(const wxBitmap *bitmap, const wxString& name,
int type, const wxPalette *palette = NULL);
void SetName(const wxString& name) { m_name = name; }
void SetExtension(const wxString& ext) { m_extension = ext; }
void SetType(wxBitmapType type) { m_type = type; }
const wxString& GetName() const { return m_name; }
const wxString& GetExtension() const { return m_extension; }
wxBitmapType GetType() const { return m_type; }
private:
wxString m_name;
wxString m_extension;
wxBitmapType m_type;
DECLARE_ABSTRACT_CLASS(wxBitmapHandlerBase)
};
class WXDLLEXPORT wxBitmapBase : public wxGDIObject
{
public:
/*
Derived class must implement these:
wxBitmap();
wxBitmap(int width, int height, int depth = -1);
wxBitmap(const char bits[], int width, int height, int depth = 1);
wxBitmap(const char* const* bits);
wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM);
wxBitmap(const wxImage& image, int depth = -1);
bool Create(int width, int height, int depth = -1);
static void InitStandardHandlers();
*/
virtual bool Ok() const { return IsOk(); }
virtual bool IsOk() const = 0;
virtual int GetHeight() const = 0;
virtual int GetWidth() const = 0;
virtual int GetDepth() const = 0;
virtual wxImage ConvertToImage() const = 0;
virtual wxMask *GetMask() const = 0;
virtual void SetMask(wxMask *mask) = 0;
virtual wxBitmap GetSubBitmap(const wxRect& rect) const = 0;
virtual bool SaveFile(const wxString &name, wxBitmapType type,
const wxPalette *palette = (wxPalette *)NULL) const = 0;
virtual bool LoadFile(const wxString &name, wxBitmapType type) = 0;
/*
If raw bitmap access is supported (see wx/rawbmp.h), the following
methods should be implemented:
virtual bool GetRawData(wxRawBitmapData *data) = 0;
virtual void UngetRawData(wxRawBitmapData *data) = 0;
*/
#if wxUSE_PALETTE
virtual wxPalette *GetPalette() const = 0;
virtual void SetPalette(const wxPalette& palette) = 0;
#endif // wxUSE_PALETTE
// copies the contents and mask of the given (colour) icon to the bitmap
virtual bool CopyFromIcon(const wxIcon& icon) = 0;
// implementation:
virtual void SetHeight(int height) = 0;
virtual void SetWidth(int width) = 0;
virtual void SetDepth(int depth) = 0;
// Format handling
static inline wxList& GetHandlers() { return sm_handlers; }
static void AddHandler(wxBitmapHandlerBase *handler);
static void InsertHandler(wxBitmapHandlerBase *handler);
static bool RemoveHandler(const wxString& name);
static wxBitmapHandler *FindHandler(const wxString& name);
static wxBitmapHandler *FindHandler(const wxString& extension, wxBitmapType bitmapType);
static wxBitmapHandler *FindHandler(wxBitmapType bitmapType);
//static void InitStandardHandlers();
// (wxBitmap must implement this one)
static void CleanUpHandlers();
// this method is only used by the generic implementation of wxMask
// currently but could be useful elsewhere in the future: it can be
// overridden to quantize the colour to correspond to bitmap colour depth
// if necessary; default implementation simply returns the colour as is
virtual wxColour QuantizeColour(const wxColour& colour) const
{
return colour;
}
protected:
static wxList sm_handlers;
DECLARE_ABSTRACT_CLASS(wxBitmapBase)
};
#endif // wxUSE_BITMAP_BASE
#if defined(__WXPALMOS__)
#include "wx/palmos/bitmap.h"
#elif defined(__WXMSW__)
#include "wx/msw/bitmap.h"
#elif defined(__WXMOTIF__)
#include "wx/x11/bitmap.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/bitmap.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/bitmap.h"
#elif defined(__WXX11__)
#include "wx/x11/bitmap.h"
#elif defined(__WXMGL__)
#include "wx/mgl/bitmap.h"
#elif defined(__WXDFB__)
#include "wx/dfb/bitmap.h"
#elif defined(__WXMAC__)
#include "wx/mac/bitmap.h"
#elif defined(__WXCOCOA__)
#include "wx/cocoa/bitmap.h"
#elif defined(__WXPM__)
#include "wx/os2/bitmap.h"
#endif
// we must include generic mask.h after wxBitmap definition
#if defined(__WXMGL__) || defined(__WXDFB__)
#define wxUSE_GENERIC_MASK 1
#else
#define wxUSE_GENERIC_MASK 0
#endif
#if wxUSE_GENERIC_MASK
#include "wx/generic/mask.h"
#endif
#endif // _WX_BITMAP_H_BASE_

View File

@ -1,122 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/bmpbutton.h
// Purpose: wxBitmapButton class interface
// Author: Vadim Zeitlin
// Modified by:
// Created: 25.08.00
// RCS-ID: $Id: bmpbuttn.h 45498 2007-04-16 13:03:05Z VZ $
// Copyright: (c) 2000 Vadim Zeitlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_BMPBUTTON_H_BASE_
#define _WX_BMPBUTTON_H_BASE_
#include "wx/defs.h"
#if wxUSE_BMPBUTTON
#include "wx/bitmap.h"
#include "wx/button.h"
extern WXDLLEXPORT_DATA(const wxChar) wxButtonNameStr[];
// ----------------------------------------------------------------------------
// wxBitmapButton: a button which shows bitmaps instead of the usual string.
// It has different bitmaps for different states (focused/disabled/pressed)
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxBitmapButtonBase : public wxButton
{
public:
wxBitmapButtonBase()
{
m_marginX =
m_marginY = 0;
}
// set the bitmaps
void SetBitmapLabel(const wxBitmap& bitmap)
{ m_bmpNormal = bitmap; OnSetBitmap(); }
void SetBitmapSelected(const wxBitmap& sel)
{ m_bmpSelected = sel; OnSetBitmap(); }
void SetBitmapFocus(const wxBitmap& focus)
{ m_bmpFocus = focus; OnSetBitmap(); }
void SetBitmapDisabled(const wxBitmap& disabled)
{ m_bmpDisabled = disabled; OnSetBitmap(); }
void SetBitmapHover(const wxBitmap& hover)
{ m_bmpHover = hover; OnSetBitmap(); }
// retrieve the bitmaps
const wxBitmap& GetBitmapLabel() const { return m_bmpNormal; }
const wxBitmap& GetBitmapSelected() const { return m_bmpSelected; }
const wxBitmap& GetBitmapFocus() const { return m_bmpFocus; }
const wxBitmap& GetBitmapDisabled() const { return m_bmpDisabled; }
const wxBitmap& GetBitmapHover() const { return m_bmpHover; }
wxBitmap& GetBitmapLabel() { return m_bmpNormal; }
wxBitmap& GetBitmapSelected() { return m_bmpSelected; }
wxBitmap& GetBitmapFocus() { return m_bmpFocus; }
wxBitmap& GetBitmapDisabled() { return m_bmpDisabled; }
wxBitmap& GetBitmapHover() { return m_bmpHover; }
// set/get the margins around the button
virtual void SetMargins(int x, int y) { m_marginX = x; m_marginY = y; }
int GetMarginX() const { return m_marginX; }
int GetMarginY() const { return m_marginY; }
// deprecated synonym for SetBitmapLabel()
#if WXWIN_COMPATIBILITY_2_6
wxDEPRECATED( void SetLabel(const wxBitmap& bitmap) );
// prevent virtual function hiding
virtual void SetLabel(const wxString& label)
{ wxWindow::SetLabel(label); }
#endif // WXWIN_COMPATIBILITY_2_6
protected:
// function called when any of the bitmaps changes
virtual void OnSetBitmap() { InvalidateBestSize(); Refresh(); }
// the bitmaps for various states
wxBitmap m_bmpNormal,
m_bmpSelected,
m_bmpFocus,
m_bmpDisabled,
m_bmpHover;
// the margins around the bitmap
int m_marginX,
m_marginY;
DECLARE_NO_COPY_CLASS(wxBitmapButtonBase)
};
#if WXWIN_COMPATIBILITY_2_6
inline void wxBitmapButtonBase::SetLabel(const wxBitmap& bitmap)
{
SetBitmapLabel(bitmap);
}
#endif // WXWIN_COMPATIBILITY_2_6
#if defined(__WXUNIVERSAL__)
#include "wx/univ/bmpbuttn.h"
#elif defined(__WXMSW__)
#include "wx/msw/bmpbuttn.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/bmpbuttn.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/bmpbuttn.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/bmpbuttn.h"
#elif defined(__WXMAC__)
#include "wx/mac/bmpbuttn.h"
#elif defined(__WXCOCOA__)
#include "wx/cocoa/bmpbuttn.h"
#elif defined(__WXPM__)
#include "wx/os2/bmpbuttn.h"
#endif
#endif // wxUSE_BMPBUTTON
#endif // _WX_BMPBUTTON_H_BASE_

View File

@ -1,49 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/bmpcbox.h
// Purpose: wxBitmapComboBox base header
// Author: Jaakko Salli
// Modified by:
// Created: Aug-31-2006
// Copyright: (c) Jaakko Salli
// RCS-ID: $Id: bmpcbox.h 42046 2006-10-16 09:30:01Z ABX $
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_BMPCBOX_H_BASE_
#define _WX_BMPCBOX_H_BASE_
#include "wx/defs.h"
#if wxUSE_BITMAPCOMBOBOX
#include "wx/bitmap.h"
extern WXDLLIMPEXP_DATA_ADV(const wxChar) wxBitmapComboBoxNameStr[];
class WXDLLIMPEXP_ADV wxBitmapComboBoxBase
{
public:
// ctors and such
wxBitmapComboBoxBase() { }
virtual ~wxBitmapComboBoxBase() { }
// Returns the image of the item with the given index.
virtual wxBitmap GetItemBitmap(unsigned int n) const = 0;
// Sets the image for the given item.
virtual void SetItemBitmap(unsigned int n, const wxBitmap& bitmap) = 0;
// Returns size of the image used in list
virtual wxSize GetBitmapSize() const = 0;
};
#include "wx/generic/bmpcbox.h"
#endif // wxUSE_BITMAPCOMBOBOX
#endif // _WX_BMPCBOX_H_BASE_

View File

@ -1,403 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/bookctrl.h
// Purpose: wxBookCtrlBase: common base class for wxList/Tree/Notebook
// Author: Vadim Zeitlin
// Modified by:
// Created: 19.08.03
// RCS-ID: $Id: bookctrl.h 49563 2007-10-31 20:46:21Z VZ $
// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_BOOKCTRL_H_
#define _WX_BOOKCTRL_H_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/defs.h"
#if wxUSE_BOOKCTRL
#include "wx/control.h"
#include "wx/dynarray.h"
WX_DEFINE_EXPORTED_ARRAY_PTR(wxWindow *, wxArrayPages);
class WXDLLIMPEXP_FWD_CORE wxImageList;
class WXDLLIMPEXP_FWD_CORE wxBookCtrlBaseEvent;
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
// wxBookCtrl hit results
enum
{
wxBK_HITTEST_NOWHERE = 1, // not on tab
wxBK_HITTEST_ONICON = 2, // on icon
wxBK_HITTEST_ONLABEL = 4, // on label
wxBK_HITTEST_ONITEM = wxBK_HITTEST_ONICON | wxBK_HITTEST_ONLABEL,
wxBK_HITTEST_ONPAGE = 8 // not on tab control, but over the selected page
};
// wxBookCtrl flags (common for wxNotebook, wxListbook, wxChoicebook, wxTreebook)
#define wxBK_DEFAULT 0x0000
#define wxBK_TOP 0x0010
#define wxBK_BOTTOM 0x0020
#define wxBK_LEFT 0x0040
#define wxBK_RIGHT 0x0080
#define wxBK_ALIGN_MASK (wxBK_TOP | wxBK_BOTTOM | wxBK_LEFT | wxBK_RIGHT)
// ----------------------------------------------------------------------------
// wxBookCtrlBase
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxBookCtrlBase : public wxControl
{
public:
// construction
// ------------
wxBookCtrlBase()
{
Init();
}
wxBookCtrlBase(wxWindow *parent,
wxWindowID winid,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxEmptyString)
{
Init();
(void)Create(parent, winid, pos, size, style, name);
}
// quasi ctor
bool Create(wxWindow *parent,
wxWindowID winid,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxEmptyString);
// dtor
virtual ~wxBookCtrlBase();
// accessors
// ---------
// get number of pages in the dialog
virtual size_t GetPageCount() const { return m_pages.size(); }
// get the panel which represents the given page
wxWindow *GetPage(size_t n) { return m_pages[n]; }
wxWindow *GetPage(size_t n) const { return m_pages[n]; }
// get the current page or NULL if none
wxWindow *GetCurrentPage() const
{
const int n = GetSelection();
return n == wxNOT_FOUND ? NULL : GetPage(n);
}
// get the currently selected page or wxNOT_FOUND if none
virtual int GetSelection() const = 0;
// set/get the title of a page
virtual bool SetPageText(size_t n, const wxString& strText) = 0;
virtual wxString GetPageText(size_t n) const = 0;
// image list stuff: each page may have an image associated with it (all
// images belong to the same image list)
// ---------------------------------------------------------------------
// sets the image list to use, it is *not* deleted by the control
virtual void SetImageList(wxImageList *imageList);
// as SetImageList() but we will delete the image list ourselves
void AssignImageList(wxImageList *imageList);
// get pointer (may be NULL) to the associated image list
wxImageList* GetImageList() const { return m_imageList; }
// sets/returns item's image index in the current image list
virtual int GetPageImage(size_t n) const = 0;
virtual bool SetPageImage(size_t n, int imageId) = 0;
// geometry
// --------
// resize the notebook so that all pages will have the specified size
virtual void SetPageSize(const wxSize& size);
// calculate the size of the control from the size of its page
virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const = 0;
// get/set size of area between book control area and page area
unsigned int GetInternalBorder() const { return m_internalBorder; }
void SetInternalBorder(unsigned int border) { m_internalBorder = border; }
// Sets/gets the margin around the controller
void SetControlMargin(int margin) { m_controlMargin = margin; }
int GetControlMargin() const { return m_controlMargin; }
// returns true if we have wxBK_TOP or wxBK_BOTTOM style
bool IsVertical() const { return HasFlag(wxBK_BOTTOM | wxBK_TOP); }
// set/get option to shrink to fit current page
void SetFitToCurrentPage(bool fit) { m_fitToCurrentPage = fit; }
bool GetFitToCurrentPage() const { return m_fitToCurrentPage; }
// returns the sizer containing the control, if any
wxSizer* GetControlSizer() const { return m_controlSizer; }
// operations
// ----------
// remove one page from the control and delete it
virtual bool DeletePage(size_t n);
// remove one page from the notebook, without deleting it
virtual bool RemovePage(size_t n)
{
DoInvalidateBestSize();
return DoRemovePage(n) != NULL;
}
// remove all pages and delete them
virtual bool DeleteAllPages()
{
DoInvalidateBestSize();
WX_CLEAR_ARRAY(m_pages);
return true;
}
// adds a new page to the control
virtual bool AddPage(wxWindow *page,
const wxString& text,
bool bSelect = false,
int imageId = -1)
{
DoInvalidateBestSize();
return InsertPage(GetPageCount(), page, text, bSelect, imageId);
}
// the same as AddPage(), but adds the page at the specified position
virtual bool InsertPage(size_t n,
wxWindow *page,
const wxString& text,
bool bSelect = false,
int imageId = -1) = 0;
// set the currently selected page, return the index of the previously
// selected one (or -1 on error)
//
// NB: this function will generate PAGE_CHANGING/ED events
virtual int SetSelection(size_t n) = 0;
// acts as SetSelection but does not generate events
virtual int ChangeSelection(size_t n) = 0;
// cycle thru the pages
void AdvanceSelection(bool forward = true)
{
int nPage = GetNextPage(forward);
if ( nPage != -1 )
{
// cast is safe because of the check above
SetSelection((size_t)nPage);
}
}
// hit test: returns which page is hit and, optionally, where (icon, label)
virtual int HitTest(const wxPoint& WXUNUSED(pt),
long * WXUNUSED(flags) = NULL) const
{
return wxNOT_FOUND;
}
// we do have multiple pages
virtual bool HasMultiplePages() const { return true; }
protected:
// flags for DoSetSelection()
enum
{
SetSelection_SendEvent = 1
};
// set the selection to the given page, sending the events (which can
// possibly prevent the page change from taking place) if SendEvent flag is
// included
virtual int DoSetSelection(size_t nPage, int flags = 0);
// if the derived class uses DoSetSelection() for implementing
// [Set|Change]Selection, it must override UpdateSelectedPage(),
// CreatePageChangingEvent() and MakeChangedEvent(), but as it might not
// use it, these functions are not pure virtual
// called to notify the control about a new current page
virtual void UpdateSelectedPage(size_t WXUNUSED(newsel))
{ wxFAIL_MSG(wxT("Override this function!")); }
// create a new "page changing" event
virtual wxBookCtrlBaseEvent* CreatePageChangingEvent() const
{ wxFAIL_MSG(wxT("Override this function!")); return NULL; }
// modify the event created by CreatePageChangingEvent() to "page changed"
// event, usually by just calling SetEventType() on it
virtual void MakeChangedEvent(wxBookCtrlBaseEvent& WXUNUSED(event))
{ wxFAIL_MSG(wxT("Override this function!")); }
// Should we accept NULL page pointers in Add/InsertPage()?
//
// Default is no but derived classes may override it if they can treat NULL
// pages in some sensible way (e.g. wxTreebook overrides this to allow
// having nodes without any associated page)
virtual bool AllowNullPage() const { return false; }
// remove the page and return a pointer to it
virtual wxWindow *DoRemovePage(size_t page) = 0;
// our best size is the size which fits all our pages
virtual wxSize DoGetBestSize() const;
// helper: get the next page wrapping if we reached the end
int GetNextPage(bool forward) const;
// Lay out controls
void DoSize();
// This method also invalidates the size of the controller and should be
// called instead of just InvalidateBestSize() whenever pages are added or
// removed as this also affects the controller
void DoInvalidateBestSize();
#if wxUSE_HELP
// Show the help for the corresponding page
void OnHelp(wxHelpEvent& event);
#endif // wxUSE_HELP
// the array of all pages of this control
wxArrayPages m_pages;
// the associated image list or NULL
wxImageList *m_imageList;
// true if we must delete m_imageList
bool m_ownsImageList;
// get the page area
wxRect GetPageRect() const;
// event handlers
virtual wxSize GetControllerSize() const;
void OnSize(wxSizeEvent& event);
// controller buddy if available, NULL otherwise (usually for native book controls like wxNotebook)
wxControl *m_bookctrl;
// Whether to shrink to fit current page
bool m_fitToCurrentPage;
// the sizer containing the choice control
wxSizer *m_controlSizer;
// the margin around the choice control
int m_controlMargin;
private:
// common part of all ctors
void Init();
// internal border
unsigned int m_internalBorder;
DECLARE_ABSTRACT_CLASS(wxBookCtrlBase)
DECLARE_NO_COPY_CLASS(wxBookCtrlBase)
DECLARE_EVENT_TABLE()
};
// ----------------------------------------------------------------------------
// wxBookCtrlBaseEvent: page changing events generated by derived classes
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxBookCtrlBaseEvent : public wxNotifyEvent
{
public:
wxBookCtrlBaseEvent(wxEventType commandType = wxEVT_NULL, int winid = 0,
int nSel = -1, int nOldSel = -1)
: wxNotifyEvent(commandType, winid)
{
m_nSel = nSel;
m_nOldSel = nOldSel;
}
wxBookCtrlBaseEvent(const wxBookCtrlBaseEvent& event)
: wxNotifyEvent(event)
{
m_nSel = event.m_nSel;
m_nOldSel = event.m_nOldSel;
}
// accessors
// the currently selected page (-1 if none)
int GetSelection() const { return m_nSel; }
void SetSelection(int nSel) { m_nSel = nSel; }
// the page that was selected before the change (-1 if none)
int GetOldSelection() const { return m_nOldSel; }
void SetOldSelection(int nOldSel) { m_nOldSel = nOldSel; }
private:
int m_nSel, // currently selected page
m_nOldSel; // previously selected page
};
// make a default book control for given platform
#if wxUSE_NOTEBOOK
// dedicated to majority of desktops
#include "wx/notebook.h"
#define wxBookCtrl wxNotebook
#define wxBookCtrlEvent wxNotebookEvent
#define wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGED wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED
#define wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGING wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING
#define EVT_BOOKCTRL_PAGE_CHANGED(id, fn) EVT_NOTEBOOK_PAGE_CHANGED(id, fn)
#define EVT_BOOKCTRL_PAGE_CHANGING(id, fn) EVT_NOTEBOOK_PAGE_CHANGING(id, fn)
#define wxBookctrlEventHandler(func) wxNotebookEventHandler(func)
#else
// dedicated to Smartphones
#include "wx/choicebk.h"
#define wxBookCtrl wxChoicebook
#define wxBookCtrlEvent wxChoicebookEvent
#define wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGED wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED
#define wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGING wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING
#define EVT_BOOKCTRL_PAGE_CHANGED(id, fn) EVT_CHOICEBOOK_PAGE_CHANGED(id, fn)
#define EVT_BOOKCTRL_PAGE_CHANGING(id, fn) EVT_CHOICEBOOK_PAGE_CHANGING(id, fn)
#define wxBookctrlEventHandler(func) wxChoicebookEventHandler(func)
#endif
#if WXWIN_COMPATIBILITY_2_6
#define wxBC_TOP wxBK_TOP
#define wxBC_BOTTOM wxBK_BOTTOM
#define wxBC_LEFT wxBK_LEFT
#define wxBC_RIGHT wxBK_RIGHT
#define wxBC_DEFAULT wxBK_DEFAULT
#endif
#endif // wxUSE_BOOKCTRL
#endif // _WX_BOOKCTRL_H_

View File

@ -1,54 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/brush.h
// Purpose: Includes platform-specific wxBrush file
// Author: Julian Smart
// Modified by:
// Created:
// RCS-ID: $Id: brush.h 40865 2006-08-27 09:42:42Z VS $
// Copyright: Julian Smart
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_BRUSH_H_BASE_
#define _WX_BRUSH_H_BASE_
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/gdiobj.h"
// wxBrushBase
class WXDLLEXPORT wxBrushBase: public wxGDIObject
{
public:
virtual ~wxBrushBase() { }
virtual int GetStyle() const = 0;
virtual bool IsHatch() const
{ return (GetStyle()>=wxFIRST_HATCH) && (GetStyle()<=wxLAST_HATCH); }
};
#if defined(__WXPALMOS__)
#include "wx/palmos/brush.h"
#elif defined(__WXMSW__)
#include "wx/msw/brush.h"
#elif defined(__WXMOTIF__) || defined(__WXX11__)
#include "wx/x11/brush.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/brush.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/brush.h"
#elif defined(__WXMGL__)
#include "wx/mgl/brush.h"
#elif defined(__WXDFB__)
#include "wx/dfb/brush.h"
#elif defined(__WXMAC__)
#include "wx/mac/brush.h"
#elif defined(__WXCOCOA__)
#include "wx/cocoa/brush.h"
#elif defined(__WXPM__)
#include "wx/os2/brush.h"
#endif
#endif
// _WX_BRUSH_H_BASE_

View File

@ -1,314 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/buffer.h
// Purpose: auto buffer classes: buffers which automatically free memory
// Author: Vadim Zeitlin
// Modified by:
// Created: 12.04.99
// RCS-ID: $Id: buffer.h 45761 2007-05-02 17:09:30Z VS $
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_BUFFER_H
#define _WX_BUFFER_H
#include "wx/wxchar.h"
#include <stdlib.h> // malloc() and free()
// ----------------------------------------------------------------------------
// Special classes for (wide) character strings: they use malloc/free instead
// of new/delete
// ----------------------------------------------------------------------------
#define DEFINE_BUFFER(classname, chartype, strdupfunc) \
class WXDLLIMPEXP_BASE classname \
{ \
public: \
classname(const chartype *str = NULL) \
: m_str(str ? strdupfunc(str) : NULL) \
{ \
} \
\
classname(size_t len) \
: m_str((chartype *)malloc((len + 1)*sizeof(chartype))) \
{ \
m_str[len] = (chartype)0; \
} \
\
/* no need to check for NULL, free() does it */ \
~classname() { free(m_str); } \
\
/* \
WARNING: \
\
the copy ctor and assignment operators change the passed in object \
even although it is declared as "const", so: \
\
a) it shouldn't be really const \
b) you shouldn't use it afterwards (or know that it was reset) \
\
This is very ugly but is unfortunately needed to make the normal use\
of classname buffer objects possible and is very similar to what \
std::auto_ptr<> does (as if it were an excuse...) \
*/ \
\
/* \
because of the remark above, release() is declared const even if it \
isn't really const \
*/ \
chartype *release() const \
{ \
chartype *p = m_str; \
((classname *)this)->m_str = NULL; \
return p; \
} \
\
void reset() \
{ \
free(m_str); \
m_str = NULL; \
} \
\
classname(const classname& src) \
: m_str(src.release()) \
{ \
} \
\
classname& operator=(const chartype *str) \
{ \
free(m_str); \
m_str = str ? strdupfunc(str) : NULL; \
return *this; \
} \
\
classname& operator=(const classname& src) \
{ \
free(m_str); \
m_str = src.release(); \
\
return *this; \
} \
\
bool extend(size_t len) \
{ \
chartype * \
str = (chartype *)realloc(m_str, (len + 1)*sizeof(chartype)); \
if ( !str ) \
return false; \
\
m_str = str; \
\
return true; \
} \
\
chartype *data() { return m_str; } \
const chartype *data() const { return m_str; } \
operator const chartype *() const { return m_str; } \
chartype operator[](size_t n) const { return m_str[n]; } \
\
private: \
chartype *m_str; \
}
#if wxABI_VERSION >= 20804
// needed for wxString::char_str() and wchar_str()
#define DEFINE_WRITABLE_BUFFER(classname, baseclass, chartype) \
class WXDLLIMPEXP_BASE classname : public baseclass \
{ \
public: \
classname(const baseclass& src) : baseclass(src) {} \
classname(const chartype *str = NULL) : baseclass(str) {} \
\
operator chartype*() { return this->data(); } \
}
#endif // wxABI_VERSION >= 20804
DEFINE_BUFFER(wxCharBuffer, char, wxStrdupA);
#if wxABI_VERSION >= 20804
DEFINE_WRITABLE_BUFFER(wxWritableCharBuffer, wxCharBuffer, char);
#endif
#if wxUSE_WCHAR_T
DEFINE_BUFFER(wxWCharBuffer, wchar_t, wxStrdupW);
#if wxABI_VERSION >= 20804
DEFINE_WRITABLE_BUFFER(wxWritableWCharBuffer, wxWCharBuffer, wchar_t);
#endif
#endif // wxUSE_WCHAR_T
#undef DEFINE_BUFFER
#undef DEFINE_WRITABLE_BUFFER
#if wxUSE_UNICODE
typedef wxWCharBuffer wxWxCharBuffer;
#define wxMB2WXbuf wxWCharBuffer
#define wxWX2MBbuf wxCharBuffer
#define wxWC2WXbuf wxChar*
#define wxWX2WCbuf wxChar*
#else // ANSI
typedef wxCharBuffer wxWxCharBuffer;
#define wxMB2WXbuf wxChar*
#define wxWX2MBbuf wxChar*
#define wxWC2WXbuf wxCharBuffer
#define wxWX2WCbuf wxWCharBuffer
#endif // Unicode/ANSI
// ----------------------------------------------------------------------------
// A class for holding growable data buffers (not necessarily strings)
// ----------------------------------------------------------------------------
// This class manages the actual data buffer pointer and is ref-counted.
class wxMemoryBufferData
{
public:
// the initial size and also the size added by ResizeIfNeeded()
enum { DefBufSize = 1024 };
friend class wxMemoryBuffer;
// everyting is private as it can only be used by wxMemoryBuffer
private:
wxMemoryBufferData(size_t size = wxMemoryBufferData::DefBufSize)
: m_data(size ? malloc(size) : NULL), m_size(size), m_len(0), m_ref(0)
{
}
~wxMemoryBufferData() { free(m_data); }
void ResizeIfNeeded(size_t newSize)
{
if (newSize > m_size)
{
void *dataOld = m_data;
m_data = realloc(m_data, newSize + wxMemoryBufferData::DefBufSize);
if ( !m_data )
{
free(dataOld);
}
m_size = newSize + wxMemoryBufferData::DefBufSize;
}
}
void IncRef() { m_ref += 1; }
void DecRef()
{
m_ref -= 1;
if (m_ref == 0) // are there no more references?
delete this;
}
// the buffer containing the data
void *m_data;
// the size of the buffer
size_t m_size;
// the amount of data currently in the buffer
size_t m_len;
// the reference count
size_t m_ref;
DECLARE_NO_COPY_CLASS(wxMemoryBufferData)
};
class wxMemoryBuffer
{
public:
// ctor and dtor
wxMemoryBuffer(size_t size = wxMemoryBufferData::DefBufSize)
{
m_bufdata = new wxMemoryBufferData(size);
m_bufdata->IncRef();
}
~wxMemoryBuffer() { m_bufdata->DecRef(); }
// copy and assignment
wxMemoryBuffer(const wxMemoryBuffer& src)
: m_bufdata(src.m_bufdata)
{
m_bufdata->IncRef();
}
wxMemoryBuffer& operator=(const wxMemoryBuffer& src)
{
m_bufdata->DecRef();
m_bufdata = src.m_bufdata;
m_bufdata->IncRef();
return *this;
}
// Accessors
void *GetData() const { return m_bufdata->m_data; }
size_t GetBufSize() const { return m_bufdata->m_size; }
size_t GetDataLen() const { return m_bufdata->m_len; }
void SetBufSize(size_t size) { m_bufdata->ResizeIfNeeded(size); }
void SetDataLen(size_t len)
{
wxASSERT(len <= m_bufdata->m_size);
m_bufdata->m_len = len;
}
// Ensure the buffer is big enough and return a pointer to it
void *GetWriteBuf(size_t sizeNeeded)
{
m_bufdata->ResizeIfNeeded(sizeNeeded);
return m_bufdata->m_data;
}
// Update the length after the write
void UngetWriteBuf(size_t sizeUsed) { SetDataLen(sizeUsed); }
// Like the above, but appends to the buffer
void *GetAppendBuf(size_t sizeNeeded)
{
m_bufdata->ResizeIfNeeded(m_bufdata->m_len + sizeNeeded);
return (char*)m_bufdata->m_data + m_bufdata->m_len;
}
// Update the length after the append
void UngetAppendBuf(size_t sizeUsed)
{
SetDataLen(m_bufdata->m_len + sizeUsed);
}
// Other ways to append to the buffer
void AppendByte(char data)
{
wxCHECK_RET( m_bufdata->m_data, _T("invalid wxMemoryBuffer") );
m_bufdata->ResizeIfNeeded(m_bufdata->m_len + 1);
*(((char*)m_bufdata->m_data) + m_bufdata->m_len) = data;
m_bufdata->m_len += 1;
}
void AppendData(const void *data, size_t len)
{
memcpy(GetAppendBuf(len), data, len);
UngetAppendBuf(len);
}
operator const char *() const { return (const char*)GetData(); }
private:
wxMemoryBufferData* m_bufdata;
};
// ----------------------------------------------------------------------------
// template class for any kind of data
// ----------------------------------------------------------------------------
// TODO
#endif // _WX_BUFFER_H

View File

@ -1,149 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/build.h
// Purpose: Runtime build options checking
// Author: Vadim Zeitlin, Vaclav Slavik
// Modified by:
// Created: 07.05.02
// RCS-ID: $Id: build.h 35858 2005-10-09 15:48:42Z MBN $
// Copyright: (c) 2002 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_BUILD_H_
#define _WX_BUILD_H_
#include "wx/version.h"
// NB: This file contains macros for checking binary compatibility of libraries
// in multilib buildm, plugins and user components.
// The WX_BUILD_OPTIONS_SIGNATURE macro expands into string that should
// uniquely identify binary compatible builds: i.e. if two builds of the
// library are binary compatible, their signature string should be the
// same; if two builds are binary incompatible, their signatures should
// be different.
//
// Therefore, wxUSE_XXX flags that affect binary compatibility (vtables,
// function signatures) should be accounted for here. So should compilers
// and compiler versions (but note that binary compatible compiler versions
// such as gcc-2.95.2 and gcc-2.95.3 should have same signature!).
// ----------------------------------------------------------------------------
// WX_BUILD_OPTIONS_SIGNATURE
// ----------------------------------------------------------------------------
#define __WX_BO_STRINGIZE(x) __WX_BO_STRINGIZE0(x)
#define __WX_BO_STRINGIZE0(x) #x
#if (wxMINOR_VERSION % 2) == 0
#define __WX_BO_VERSION(x,y,z) \
__WX_BO_STRINGIZE(x) "." __WX_BO_STRINGIZE(y)
#else
#define __WX_BO_VERSION(x,y,z) \
__WX_BO_STRINGIZE(x) "." __WX_BO_STRINGIZE(y) "." __WX_BO_STRINGIZE(z)
#endif
#ifdef __WXDEBUG__
#define __WX_BO_DEBUG "debug"
#else
#define __WX_BO_DEBUG "no debug"
#endif
#if wxUSE_UNICODE
#define __WX_BO_UNICODE "Unicode"
#else
#define __WX_BO_UNICODE "ANSI"
#endif
// GCC and Intel C++ share same C++ ABI (and possibly others in the future),
// check if compiler versions are compatible:
#if defined(__GXX_ABI_VERSION)
#define __WX_BO_COMPILER \
",compiler with C++ ABI " __WX_BO_STRINGIZE(__GXX_ABI_VERSION)
#elif defined(__INTEL_COMPILER)
#define __WX_BO_COMPILER ",Intel C++"
#elif defined(__GNUG__)
#define __WX_BO_COMPILER ",GCC " \
__WX_BO_STRINGIZE(__GNUC__) "." __WX_BO_STRINGIZE(__GNUC_MINOR__)
#elif defined(__VISUALC__)
#define __WX_BO_COMPILER ",Visual C++"
#elif defined(__BORLANDC__)
#define __WX_BO_COMPILER ",Borland C++"
#elif defined(__DIGITALMARS__)
#define __WX_BO_COMPILER ",DigitalMars"
#elif defined(__WATCOMC__)
#define __WX_BO_COMPILER ",Watcom C++"
#else
#define __WX_BO_COMPILER
#endif
// WXWIN_COMPATIBILITY macros affect presence of virtual functions
#if WXWIN_COMPATIBILITY_2_4
#define __WX_BO_WXWIN_COMPAT_2_4 ",compatible with 2.4"
#else
#define __WX_BO_WXWIN_COMPAT_2_4
#endif
#if WXWIN_COMPATIBILITY_2_6
#define __WX_BO_WXWIN_COMPAT_2_6 ",compatible with 2.6"
#else
#define __WX_BO_WXWIN_COMPAT_2_6
#endif
// deriving wxWin containers from STL ones changes them completely:
#if wxUSE_STL
#define __WX_BO_STL ",STL containers"
#else
#define __WX_BO_STL ",wx containers"
#endif
// This macro is passed as argument to wxConsoleApp::CheckBuildOptions()
#define WX_BUILD_OPTIONS_SIGNATURE \
__WX_BO_VERSION(wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER) \
" (" __WX_BO_DEBUG "," __WX_BO_UNICODE \
__WX_BO_COMPILER \
__WX_BO_STL \
__WX_BO_WXWIN_COMPAT_2_4 __WX_BO_WXWIN_COMPAT_2_6 \
")"
// ----------------------------------------------------------------------------
// WX_CHECK_BUILD_OPTIONS
// ----------------------------------------------------------------------------
// Use this macro to check build options. Adding it to a file in DLL will
// ensure that the DLL checks build options in same way IMPLEMENT_APP() does.
#define WX_CHECK_BUILD_OPTIONS(libName) \
static struct wxBuildOptionsChecker \
{ \
wxBuildOptionsChecker() \
{ \
wxAppConsole::CheckBuildOptions(WX_BUILD_OPTIONS_SIGNATURE, \
libName); \
} \
} gs_buildOptionsCheck;
#if WXWIN_COMPATIBILITY_2_4
// ----------------------------------------------------------------------------
// wxBuildOptions
// ----------------------------------------------------------------------------
// NB: Don't use this class in new code, it relies on the ctor being always
// inlined. WX_BUILD_OPTIONS_SIGNATURE always works.
class wxBuildOptions
{
public:
// the ctor must be inline to get the compilation settings of the code
// which included this header
wxBuildOptions() : m_signature(WX_BUILD_OPTIONS_SIGNATURE) {}
private:
const char *m_signature;
// actually only CheckBuildOptions() should be our friend but well...
friend class wxAppConsole;
};
#endif // WXWIN_COMPATIBILITY_2_4
#endif // _WX_BUILD_H_

View File

@ -1,21 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/busyinfo.h
// Purpose: Information window (when app is busy)
// Author: Vaclav Slavik
// Copyright: (c) 1999 Vaclav Slavik
// RCS-ID: $Id: busyinfo.h 37158 2006-01-26 15:40:46Z ABX $
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __BUSYINFO_H_BASE__
#define __BUSYINFO_H_BASE__
#include "wx/defs.h"
#if wxUSE_BUSYINFO
#include "wx/generic/busyinfo.h"
#endif // wxUSE_BUSYINFO
#endif // __BUSYINFO_H_BASE__

View File

@ -1,106 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/button.h
// Purpose: wxButtonBase class
// Author: Vadim Zetlin
// Modified by:
// Created: 15.08.00
// RCS-ID: $Id: button.h 49563 2007-10-31 20:46:21Z VZ $
// Copyright: (c) Vadim Zetlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_BUTTON_H_BASE_
#define _WX_BUTTON_H_BASE_
#include "wx/defs.h"
// ----------------------------------------------------------------------------
// wxButton flags shared with other classes
// ----------------------------------------------------------------------------
#if wxUSE_TOGGLEBTN || wxUSE_BUTTON
// These flags affect label alignment
#define wxBU_LEFT 0x0040
#define wxBU_TOP 0x0080
#define wxBU_RIGHT 0x0100
#define wxBU_BOTTOM 0x0200
#define wxBU_ALIGN_MASK ( wxBU_LEFT | wxBU_TOP | wxBU_RIGHT | wxBU_BOTTOM )
#endif
#if wxUSE_BUTTON
// ----------------------------------------------------------------------------
// wxButton specific flags
// ----------------------------------------------------------------------------
// These two flags are obsolete
#define wxBU_NOAUTODRAW 0x0000
#define wxBU_AUTODRAW 0x0004
// by default, the buttons will be created with some (system dependent)
// minimal size to make them look nicer, giving this style will make them as
// small as possible
#define wxBU_EXACTFIT 0x0001
#include "wx/control.h"
class WXDLLIMPEXP_FWD_CORE wxBitmap;
extern WXDLLEXPORT_DATA(const wxChar) wxButtonNameStr[];
// ----------------------------------------------------------------------------
// wxButton: a push button
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxButtonBase : public wxControl
{
public:
wxButtonBase() { }
// show the image in the button in addition to the label
virtual void SetImageLabel(const wxBitmap& WXUNUSED(bitmap)) { }
// set the margins around the image
virtual void SetImageMargins(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y)) { }
// this wxButton method is called when the button becomes the default one
// on its panel
virtual void SetDefault() { }
// Buttons on MSW can look bad if they are not native colours, because
// then they become owner-drawn and not theme-drawn. Disable it here
// in wxButtonBase to make it consistent.
virtual bool ShouldInheritColours() const { return false; }
// returns the default button size for this platform
static wxSize GetDefaultSize();
protected:
DECLARE_NO_COPY_CLASS(wxButtonBase)
};
#if defined(__WXUNIVERSAL__)
#include "wx/univ/button.h"
#elif defined(__WXMSW__)
#include "wx/msw/button.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/button.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/button.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/button.h"
#elif defined(__WXMAC__)
#include "wx/mac/button.h"
#elif defined(__WXCOCOA__)
#include "wx/cocoa/button.h"
#elif defined(__WXPM__)
#include "wx/os2/button.h"
#elif defined(__WXPALMOS__)
#include "wx/palmos/button.h"
#endif
#endif // wxUSE_BUTTON
#endif
// _WX_BUTTON_H_BASE_

View File

@ -1,232 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/calctrl.h
// Purpose: date-picker control
// Author: Vadim Zeitlin
// Modified by:
// Created: 29.12.99
// RCS-ID: $Id: calctrl.h 53135 2008-04-12 02:31:04Z VZ $
// Copyright: (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
/*
TODO
1. implement multiple selections for date ranges
2. background bitmap for the calendar?
*/
#ifndef _WX_CALCTRL_H_
#define _WX_CALCTRL_H_
#include "wx/defs.h"
#if wxUSE_CALENDARCTRL
#include "wx/dateevt.h"
#include "wx/colour.h"
#include "wx/font.h"
// ----------------------------------------------------------------------------
// wxCalendarCtrl flags
// ----------------------------------------------------------------------------
enum
{
// show Sunday as the first day of the week (default)
wxCAL_SUNDAY_FIRST = 0x0000,
// show Monder as the first day of the week
wxCAL_MONDAY_FIRST = 0x0001,
// highlight holidays
wxCAL_SHOW_HOLIDAYS = 0x0002,
// disable the year change control, show only the month change one
wxCAL_NO_YEAR_CHANGE = 0x0004,
// don't allow changing neither month nor year (implies
// wxCAL_NO_YEAR_CHANGE)
wxCAL_NO_MONTH_CHANGE = 0x000c,
// use MS-style month-selection instead of combo-spin combination
wxCAL_SEQUENTIAL_MONTH_SELECTION = 0x0010,
// show the neighbouring weeks in the previous and next month
wxCAL_SHOW_SURROUNDING_WEEKS = 0x0020
};
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
// return values for the HitTest() method
enum wxCalendarHitTestResult
{
wxCAL_HITTEST_NOWHERE, // outside of anything
wxCAL_HITTEST_HEADER, // on the header (weekdays)
wxCAL_HITTEST_DAY, // on a day in the calendar
wxCAL_HITTEST_INCMONTH,
wxCAL_HITTEST_DECMONTH,
wxCAL_HITTEST_SURROUNDING_WEEK
};
// border types for a date
enum wxCalendarDateBorder
{
wxCAL_BORDER_NONE, // no border (default)
wxCAL_BORDER_SQUARE, // a rectangular border
wxCAL_BORDER_ROUND // a round border
};
// ----------------------------------------------------------------------------
// wxCalendarDateAttr: custom attributes for a calendar date
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_ADV wxCalendarDateAttr
{
#if !defined(__VISAGECPP__)
protected:
// This has to be before the use of Init(), for MSVC++ 1.5
// But dorks up Visualage!
void Init(wxCalendarDateBorder border = wxCAL_BORDER_NONE)
{
m_border = border;
m_holiday = false;
}
#endif
public:
// ctors
wxCalendarDateAttr() { Init(); }
wxCalendarDateAttr(const wxColour& colText,
const wxColour& colBack = wxNullColour,
const wxColour& colBorder = wxNullColour,
const wxFont& font = wxNullFont,
wxCalendarDateBorder border = wxCAL_BORDER_NONE)
: m_colText(colText), m_colBack(colBack),
m_colBorder(colBorder), m_font(font)
{
Init(border);
}
wxCalendarDateAttr(wxCalendarDateBorder border,
const wxColour& colBorder = wxNullColour)
: m_colBorder(colBorder)
{
Init(border);
}
// setters
void SetTextColour(const wxColour& colText) { m_colText = colText; }
void SetBackgroundColour(const wxColour& colBack) { m_colBack = colBack; }
void SetBorderColour(const wxColour& col) { m_colBorder = col; }
void SetFont(const wxFont& font) { m_font = font; }
void SetBorder(wxCalendarDateBorder border) { m_border = border; }
void SetHoliday(bool holiday) { m_holiday = holiday; }
// accessors
bool HasTextColour() const { return m_colText.Ok(); }
bool HasBackgroundColour() const { return m_colBack.Ok(); }
bool HasBorderColour() const { return m_colBorder.Ok(); }
bool HasFont() const { return m_font.Ok(); }
bool HasBorder() const { return m_border != wxCAL_BORDER_NONE; }
bool IsHoliday() const { return m_holiday; }
const wxColour& GetTextColour() const { return m_colText; }
const wxColour& GetBackgroundColour() const { return m_colBack; }
const wxColour& GetBorderColour() const { return m_colBorder; }
const wxFont& GetFont() const { return m_font; }
wxCalendarDateBorder GetBorder() const { return m_border; }
#if defined(__VISAGECPP__)
protected:
// This has to be here for VisualAge
void Init(wxCalendarDateBorder border = wxCAL_BORDER_NONE)
{
m_border = border;
m_holiday = false;
}
#endif
private:
wxColour m_colText,
m_colBack,
m_colBorder;
wxFont m_font;
wxCalendarDateBorder m_border;
bool m_holiday;
};
// ----------------------------------------------------------------------------
// wxCalendarCtrl events
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_ADV wxCalendarCtrl;
class WXDLLIMPEXP_ADV wxCalendarEvent : public wxDateEvent
{
friend class wxCalendarCtrl;
public:
wxCalendarEvent() { Init(); }
inline wxCalendarEvent(wxCalendarCtrl *cal, wxEventType type);
void SetWeekDay(const wxDateTime::WeekDay wd) { m_wday = wd; }
wxDateTime::WeekDay GetWeekDay() const { return m_wday; }
protected:
void Init()
{
m_wday = wxDateTime::Inv_WeekDay;
}
private:
wxDateTime::WeekDay m_wday;
DECLARE_DYNAMIC_CLASS_NO_COPY(wxCalendarEvent)
};
// ----------------------------------------------------------------------------
// wxCalendarCtrl
// ----------------------------------------------------------------------------
// so far we only have a generic version, so keep it simple
#include "wx/generic/calctrl.h"
// now we can define the inline ctor using wxCalendarCtrl
inline
wxCalendarEvent::wxCalendarEvent(wxCalendarCtrl *cal, wxEventType type)
: wxDateEvent(cal, cal->GetDate(), type)
{
}
// ----------------------------------------------------------------------------
// calendar event types and macros for handling them
// ----------------------------------------------------------------------------
BEGIN_DECLARE_EVENT_TYPES()
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_CALENDAR_SEL_CHANGED, 950)
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_CALENDAR_DAY_CHANGED, 951)
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_CALENDAR_MONTH_CHANGED, 952)
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_CALENDAR_YEAR_CHANGED, 953)
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_CALENDAR_DOUBLECLICKED, 954)
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_CALENDAR_WEEKDAY_CLICKED, 955)
END_DECLARE_EVENT_TYPES()
typedef void (wxEvtHandler::*wxCalendarEventFunction)(wxCalendarEvent&);
#define wxCalendarEventHandler(func) \
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxCalendarEventFunction, &func)
#define wx__DECLARE_CALEVT(evt, id, fn) \
wx__DECLARE_EVT1(wxEVT_CALENDAR_ ## evt, id, wxCalendarEventHandler(fn))
#define EVT_CALENDAR(id, fn) wx__DECLARE_CALEVT(DOUBLECLICKED, id, fn)
#define EVT_CALENDAR_SEL_CHANGED(id, fn) wx__DECLARE_CALEVT(SEL_CHANGED, id, fn)
#define EVT_CALENDAR_DAY(id, fn) wx__DECLARE_CALEVT(DAY_CHANGED, id, fn)
#define EVT_CALENDAR_MONTH(id, fn) wx__DECLARE_CALEVT(MONTH_CHANGED, id, fn)
#define EVT_CALENDAR_YEAR(id, fn) wx__DECLARE_CALEVT(YEAR_CHANGED, id, fn)
#define EVT_CALENDAR_WEEKDAY_CLICKED(id, fn) wx__DECLARE_CALEVT(WEEKDAY_CLICKED, id, fn)
#endif // wxUSE_CALENDARCTRL
#endif // _WX_CALCTRL_H_

View File

@ -1,252 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/caret.h
// Purpose: wxCaretBase class - the interface of wxCaret
// Author: Vadim Zeitlin
// Modified by:
// Created: 23.05.99
// RCS-ID: $Id: caret.h 49804 2007-11-10 01:09:42Z VZ $
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CARET_H_BASE_
#define _WX_CARET_H_BASE_
#include "wx/defs.h"
#if wxUSE_CARET
// ---------------------------------------------------------------------------
// forward declarations
// ---------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_CORE wxWindow;
class WXDLLIMPEXP_FWD_CORE wxWindowBase;
// ----------------------------------------------------------------------------
// headers we have to include
// ----------------------------------------------------------------------------
#include "wx/gdicmn.h" // for wxPoint, wxSize
// ----------------------------------------------------------------------------
// A caret is a blinking cursor showing the position where the typed text will
// appear. It can be either a solid block or a custom bitmap (TODO)
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxCaretBase
{
public:
// ctors
// -----
// default - use Create
wxCaretBase() { Init(); }
// create the caret of given (in pixels) width and height and associate
// with the given window
wxCaretBase(wxWindowBase *window, int width, int height)
{
Init();
(void)Create(window, width, height);
}
// same as above
wxCaretBase(wxWindowBase *window, const wxSize& size)
{
Init();
(void)Create(window, size);
}
// a virtual dtor has been provided since this class has virtual members
virtual ~wxCaretBase() { }
// Create() functions - same as ctor but returns the success code
// --------------------------------------------------------------
// same as ctor
bool Create(wxWindowBase *window, int width, int height)
{ return DoCreate(window, width, height); }
// same as ctor
bool Create(wxWindowBase *window, const wxSize& size)
{ return DoCreate(window, size.x, size.y); }
// accessors
// ---------
// is the caret valid?
bool IsOk() const { return m_width != 0 && m_height != 0; }
// is the caret currently shown?
bool IsVisible() const { return m_countVisible > 0; }
// get the caret position
void GetPosition(int *x, int *y) const
{
if ( x ) *x = m_x;
if ( y ) *y = m_y;
}
wxPoint GetPosition() const { return wxPoint(m_x, m_y); }
// get the caret size
void GetSize(int *width, int *height) const
{
if ( width ) *width = m_width;
if ( height ) *height = m_height;
}
wxSize GetSize() const { return wxSize(m_width, m_height); }
// get the window we're associated with
wxWindow *GetWindow() const { return (wxWindow *)m_window; }
// change the size of the caret
void SetSize(int width, int height) {
m_width = width;
m_height = height;
DoSize();
}
void SetSize(const wxSize& size) { SetSize(size.x, size.y); }
// operations
// ----------
// move the caret to given position (in logical coords)
void Move(int x, int y) { m_x = x; m_y = y; DoMove(); }
void Move(const wxPoint& pt) { m_x = pt.x; m_y = pt.y; DoMove(); }
// show/hide the caret (should be called by wxWindow when needed):
// Show() must be called as many times as Hide() + 1 to make the caret
// visible
virtual void Show(bool show = true)
{
if ( show )
{
if ( m_countVisible++ == 0 )
DoShow();
}
else
{
if ( --m_countVisible == 0 )
DoHide();
}
}
virtual void Hide() { Show(false); }
// blink time is measured in milliseconds and is the time elapsed
// between 2 inversions of the caret (blink time of the caret is common
// to all carets in the Universe, so these functions are static)
static int GetBlinkTime();
static void SetBlinkTime(int milliseconds);
// implementation from now on
// --------------------------
// these functions should be called by wxWindow when the window gets/loses
// the focus - we create/show and hide/destroy the caret here
virtual void OnSetFocus() { }
virtual void OnKillFocus() { }
protected:
// these functions may be overriden in the derived classes, but they
// should call the base class version first
virtual bool DoCreate(wxWindowBase *window, int width, int height)
{
m_window = window;
m_width = width;
m_height = height;
return true;
}
// pure virtuals to implement in the derived class
virtual void DoShow() = 0;
virtual void DoHide() = 0;
virtual void DoMove() = 0;
virtual void DoSize() { }
// the common initialization
void Init()
{
m_window = (wxWindowBase *)NULL;
m_x = m_y = 0;
m_width = m_height = 0;
m_countVisible = 0;
}
// the size of the caret
int m_width, m_height;
// the position of the caret
int m_x, m_y;
// the window we're associated with
wxWindowBase *m_window;
// visibility count: the caret is visible only if it's positive
int m_countVisible;
private:
DECLARE_NO_COPY_CLASS(wxCaretBase)
};
// ---------------------------------------------------------------------------
// now include the real thing
// ---------------------------------------------------------------------------
#if defined(__WXMSW__)
#include "wx/msw/caret.h"
#else
#include "wx/generic/caret.h"
#endif // platform
// ----------------------------------------------------------------------------
// wxCaretSuspend: a simple class which hides the caret in its ctor and
// restores it in the dtor, this should be used when drawing on the screen to
// avoid overdrawing the caret
// ----------------------------------------------------------------------------
#ifdef wxHAS_CARET_USING_OVERLAYS
// we don't need to hide the caret if it's rendered using overlays
class WXDLLEXPORT wxCaretSuspend
{
public:
wxCaretSuspend(wxWindow *WXUNUSED(win)) {}
DECLARE_NO_COPY_CLASS(wxCaretSuspend)
};
#else // !wxHAS_CARET_USING_OVERLAYS
class WXDLLEXPORT wxCaretSuspend
{
public:
wxCaretSuspend(wxWindow *win)
{
m_caret = win->GetCaret();
m_show = false;
if ( m_caret && m_caret->IsVisible() )
{
m_caret->Hide();
m_show = true;
}
}
~wxCaretSuspend()
{
if ( m_caret && m_show )
m_caret->Show();
}
private:
wxCaret *m_caret;
bool m_show;
DECLARE_NO_COPY_CLASS(wxCaretSuspend)
};
#endif // wxHAS_CARET_USING_OVERLAYS/!wxHAS_CARET_USING_OVERLAYS
#endif // wxUSE_CARET
#endif // _WX_CARET_H_BASE_

View File

@ -1,156 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/checkbox.h
// Purpose: wxCheckBox class interface
// Author: Vadim Zeitlin
// Modified by:
// Created: 07.09.00
// RCS-ID: $Id: checkbox.h 39901 2006-06-30 10:51:44Z VS $
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CHECKBOX_H_BASE_
#define _WX_CHECKBOX_H_BASE_
#include "wx/defs.h"
#if wxUSE_CHECKBOX
#include "wx/control.h"
/*
* wxCheckBox style flags
* (Using wxCHK_* because wxCB_* is used by wxComboBox).
* Determine whether to use a 3-state or 2-state
* checkbox. 3-state enables to differentiate
* between 'unchecked', 'checked' and 'undetermined'.
*/
#define wxCHK_2STATE 0x0000
#define wxCHK_3STATE 0x1000
/*
* If this style is set the user can set the checkbox to the
* undetermined state. If not set the undetermined set can only
* be set programmatically.
* This style can only be used with 3 state checkboxes.
*/
#define wxCHK_ALLOW_3RD_STATE_FOR_USER 0x2000
/*
* The possible states of a 3-state checkbox (Compatible
* with the 2-state checkbox).
*/
enum wxCheckBoxState
{
wxCHK_UNCHECKED,
wxCHK_CHECKED,
wxCHK_UNDETERMINED /* 3-state checkbox only */
};
extern WXDLLEXPORT_DATA(const wxChar) wxCheckBoxNameStr[];
// ----------------------------------------------------------------------------
// wxCheckBox: a control which shows a label and a box which may be checked
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxCheckBoxBase : public wxControl
{
public:
wxCheckBoxBase() { }
// set/get the checked status of the listbox
virtual void SetValue(bool value) = 0;
virtual bool GetValue() const = 0;
bool IsChecked() const
{
wxASSERT_MSG( !Is3State(), wxT("Calling IsChecked() doesn't make sense for")
wxT(" a three state checkbox, Use Get3StateValue() instead") );
return GetValue();
}
wxCheckBoxState Get3StateValue() const
{
wxCheckBoxState state = DoGet3StateValue();
if ( state == wxCHK_UNDETERMINED && !Is3State() )
{
// Undetermined state with a 2-state checkbox??
wxFAIL_MSG( wxT("DoGet3StateValue() says the 2-state checkbox is ")
wxT("in an undetermined/third state") );
state = wxCHK_UNCHECKED;
}
return state;
}
void Set3StateValue(wxCheckBoxState state)
{
if ( state == wxCHK_UNDETERMINED && !Is3State() )
{
wxFAIL_MSG(wxT("Setting a 2-state checkbox to undetermined state"));
state = wxCHK_UNCHECKED;
}
DoSet3StateValue(state);
}
bool Is3State() const { return HasFlag(wxCHK_3STATE); }
bool Is3rdStateAllowedForUser() const
{
return HasFlag(wxCHK_ALLOW_3RD_STATE_FOR_USER);
}
virtual bool HasTransparentBackground() { return true; }
// wxCheckBox-specific processing after processing the update event
virtual void DoUpdateWindowUI(wxUpdateUIEvent& event)
{
wxControl::DoUpdateWindowUI(event);
if ( event.GetSetChecked() )
SetValue(event.GetChecked());
}
protected:
virtual void DoSet3StateValue(wxCheckBoxState WXUNUSED(state)) { wxFAIL; }
virtual wxCheckBoxState DoGet3StateValue() const
{
wxFAIL;
return wxCHK_UNCHECKED;
}
private:
DECLARE_NO_COPY_CLASS(wxCheckBoxBase)
};
#if defined(__WXUNIVERSAL__)
#include "wx/univ/checkbox.h"
#elif defined(__WXMSW__)
#include "wx/msw/checkbox.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/checkbox.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/checkbox.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/checkbox.h"
#elif defined(__WXMAC__)
#include "wx/mac/checkbox.h"
#elif defined(__WXCOCOA__)
#include "wx/cocoa/checkbox.h"
#elif defined(__WXPM__)
#include "wx/os2/checkbox.h"
#elif defined(__WXPALMOS__)
#include "wx/palmos/checkbox.h"
#endif
#endif // wxUSE_CHECKBOX
#endif
// _WX_CHECKBOX_H_BASE_

View File

@ -1,64 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/checklst.h
// Purpose: wxCheckListBox class interface
// Author: Vadim Zeitlin
// Modified by:
// Created: 12.09.00
// RCS-ID: $Id: checklst.h 38319 2006-03-23 22:05:23Z VZ $
// Copyright: (c) Vadim Zeitlin
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CHECKLST_H_BASE_
#define _WX_CHECKLST_H_BASE_
#if wxUSE_CHECKLISTBOX
#include "wx/listbox.h"
// ----------------------------------------------------------------------------
// wxCheckListBox: a listbox whose items may be checked
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxCheckListBoxBase : public
#ifdef __WXWINCE__
// keep virtuals synchronised
wxListBoxBase
#else
wxListBox
#endif
{
public:
wxCheckListBoxBase() { }
// check list box specific methods
virtual bool IsChecked(unsigned int item) const = 0;
virtual void Check(unsigned int item, bool check = true) = 0;
DECLARE_NO_COPY_CLASS(wxCheckListBoxBase)
};
#if defined(__WXUNIVERSAL__)
#include "wx/univ/checklst.h"
#elif defined(__WXWINCE__)
#include "wx/msw/wince/checklst.h"
#elif defined(__WXMSW__)
#include "wx/msw/checklst.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/checklst.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/checklst.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/checklst.h"
#elif defined(__WXMAC__)
#include "wx/mac/checklst.h"
#elif defined(__WXCOCOA__)
#include "wx/cocoa/checklst.h"
#elif defined(__WXPM__)
#include "wx/os2/checklst.h"
#endif
#endif // wxUSE_CHECKLISTBOX
#endif
// _WX_CHECKLST_H_BASE_

File diff suppressed because it is too large Load Diff

View File

@ -1,22 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/choicdgg.h
// Purpose: Includes generic choice dialog file
// Author: Julian Smart
// Modified by:
// Created:
// RCS-ID: $Id: choicdlg.h 33948 2005-05-04 18:57:50Z JS $
// Copyright: Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CHOICDLG_H_BASE_
#define _WX_CHOICDLG_H_BASE_
#if wxUSE_CHOICEDLG
#include "wx/generic/choicdgg.h"
#endif
#endif
// _WX_CHOICDLG_H_BASE_

View File

@ -1,88 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/choice.h
// Purpose: wxChoice class interface
// Author: Vadim Zeitlin
// Modified by:
// Created: 26.07.99
// RCS-ID: $Id: choice.h 42727 2006-10-30 16:04:27Z VZ $
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CHOICE_H_BASE_
#define _WX_CHOICE_H_BASE_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/defs.h"
#if wxUSE_CHOICE
#include "wx/ctrlsub.h" // the base class
// ----------------------------------------------------------------------------
// global data
// ----------------------------------------------------------------------------
extern WXDLLEXPORT_DATA(const wxChar) wxChoiceNameStr[];
// ----------------------------------------------------------------------------
// wxChoice allows to select one of a non-modifiable list of strings
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxChoiceBase : public wxControlWithItems
{
public:
wxChoiceBase() { }
virtual ~wxChoiceBase();
// all generic methods are in wxControlWithItems
// get the current selection: this can only be different from the normal
// selection if the popup items list is currently opened and the user
// selected some item in it but didn't close the list yet; otherwise (and
// currently always on platforms other than MSW) this is the same as
// GetSelection()
virtual int GetCurrentSelection() const { return GetSelection(); }
// set/get the number of columns in the control (as they're not supported on
// most platforms, they do nothing by default)
virtual void SetColumns(int WXUNUSED(n) = 1 ) { }
virtual int GetColumns() const { return 1 ; }
// emulate selecting the item event.GetInt()
void Command(wxCommandEvent& event);
private:
DECLARE_NO_COPY_CLASS(wxChoiceBase)
};
// ----------------------------------------------------------------------------
// include the platform-dependent class definition
// ----------------------------------------------------------------------------
#if defined(__WXUNIVERSAL__)
#include "wx/univ/choice.h"
#elif defined(__SMARTPHONE__) && defined(__WXWINCE__)
#include "wx/msw/wince/choicece.h"
#elif defined(__WXMSW__)
#include "wx/msw/choice.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/choice.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/choice.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/choice.h"
#elif defined(__WXMAC__)
#include "wx/mac/choice.h"
#elif defined(__WXCOCOA__)
#include "wx/cocoa/choice.h"
#elif defined(__WXPM__)
#include "wx/os2/choice.h"
#endif
#endif // wxUSE_CHOICE
#endif // _WX_CHOICE_H_BASE_

View File

@ -1,154 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/choicebk.h
// Purpose: wxChoicebook: wxChoice and wxNotebook combination
// Author: Vadim Zeitlin
// Modified by: Wlodzimierz ABX Skiba from wx/listbook.h
// Created: 15.09.04
// RCS-ID: $Id: choicebk.h 56623 2008-10-31 23:07:49Z VZ $
// Copyright: (c) Vadim Zeitlin, Wlodzimierz Skiba
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CHOICEBOOK_H_
#define _WX_CHOICEBOOK_H_
#include "wx/defs.h"
#if wxUSE_CHOICEBOOK
#include "wx/bookctrl.h"
#include "wx/choice.h"
class WXDLLIMPEXP_FWD_CORE wxChoice;
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED;
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING;
// wxChoicebook flags
#define wxCHB_DEFAULT wxBK_DEFAULT
#define wxCHB_TOP wxBK_TOP
#define wxCHB_BOTTOM wxBK_BOTTOM
#define wxCHB_LEFT wxBK_LEFT
#define wxCHB_RIGHT wxBK_RIGHT
#define wxCHB_ALIGN_MASK wxBK_ALIGN_MASK
// ----------------------------------------------------------------------------
// wxChoicebook
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxChoicebook : public wxBookCtrlBase
{
public:
wxChoicebook()
{
Init();
}
wxChoicebook(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxEmptyString)
{
Init();
(void)Create(parent, id, pos, size, style, name);
}
// quasi ctor
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxEmptyString);
virtual int GetSelection() const;
virtual bool SetPageText(size_t n, const wxString& strText);
virtual wxString GetPageText(size_t n) const;
virtual int GetPageImage(size_t n) const;
virtual bool SetPageImage(size_t n, int imageId);
virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const;
virtual bool InsertPage(size_t n,
wxWindow *page,
const wxString& text,
bool bSelect = false,
int imageId = -1);
virtual int SetSelection(size_t n) { return DoSetSelection(n, SetSelection_SendEvent); }
virtual int ChangeSelection(size_t n) { return DoSetSelection(n); }
virtual void SetImageList(wxImageList *imageList);
virtual bool DeleteAllPages();
// returns the choice control
wxChoice* GetChoiceCtrl() const { return (wxChoice*)m_bookctrl; }
protected:
virtual wxWindow *DoRemovePage(size_t page);
// get the size which the choice control should have
virtual wxSize GetControllerSize() const;
void UpdateSelectedPage(size_t newsel)
{
m_selection = wx_static_cast(int, newsel);
GetChoiceCtrl()->Select(newsel);
}
wxBookCtrlBaseEvent* CreatePageChangingEvent() const;
void MakeChangedEvent(wxBookCtrlBaseEvent &event);
// event handlers
void OnChoiceSelected(wxCommandEvent& event);
// the currently selected page or wxNOT_FOUND if none
int m_selection;
private:
// common part of all constructors
void Init();
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS_NO_COPY(wxChoicebook)
};
// ----------------------------------------------------------------------------
// choicebook event class and related stuff
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxChoicebookEvent : public wxBookCtrlBaseEvent
{
public:
wxChoicebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
int nSel = -1, int nOldSel = -1)
: wxBookCtrlBaseEvent(commandType, id, nSel, nOldSel)
{
}
wxChoicebookEvent(const wxChoicebookEvent& event)
: wxBookCtrlBaseEvent(event)
{
}
virtual wxEvent *Clone() const { return new wxChoicebookEvent(*this); }
private:
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxChoicebookEvent)
};
typedef void (wxEvtHandler::*wxChoicebookEventFunction)(wxChoicebookEvent&);
#define wxChoicebookEventHandler(func) \
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxChoicebookEventFunction, &func)
#define EVT_CHOICEBOOK_PAGE_CHANGED(winid, fn) \
wx__DECLARE_EVT1(wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED, winid, wxChoicebookEventHandler(fn))
#define EVT_CHOICEBOOK_PAGE_CHANGING(winid, fn) \
wx__DECLARE_EVT1(wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING, winid, wxChoicebookEventHandler(fn))
#endif // wxUSE_CHOICEBOOK
#endif // _WX_CHOICEBOOK_H_

View File

@ -1,145 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/clipbrd.h
// Purpose: wxClipboad class and clipboard functions
// Author: Vadim Zeitlin
// Modified by:
// Created: 19.10.99
// RCS-ID: $Id: clipbrd.h 49563 2007-10-31 20:46:21Z VZ $
// Copyright: (c) wxWidgets Team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CLIPBRD_H_BASE_
#define _WX_CLIPBRD_H_BASE_
#include "wx/defs.h"
#if wxUSE_CLIPBOARD
#include "wx/object.h"
#include "wx/wxchar.h"
class WXDLLIMPEXP_FWD_CORE wxDataFormat;
class WXDLLIMPEXP_FWD_CORE wxDataObject;
class WXDLLIMPEXP_FWD_CORE wxClipboard;
// ----------------------------------------------------------------------------
// wxClipboard represents the system clipboard. Normally, you should use
// wxTheClipboard which is a global pointer to the (unique) clipboard.
//
// Clipboard can be used to copy data to/paste data from. It works together
// with wxDataObject.
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxClipboardBase : public wxObject
{
public:
wxClipboardBase() {}
// open the clipboard before Add/SetData() and GetData()
virtual bool Open() = 0;
// close the clipboard after Add/SetData() and GetData()
virtual void Close() = 0;
// query whether the clipboard is opened
virtual bool IsOpened() const = 0;
// add to the clipboard data
//
// NB: the clipboard owns the pointer and will delete it, so data must be
// allocated on the heap
virtual bool AddData( wxDataObject *data ) = 0;
// set the clipboard data, this is the same as Clear() followed by
// AddData()
virtual bool SetData( wxDataObject *data ) = 0;
// ask if data in correct format is available
virtual bool IsSupported( const wxDataFormat& format ) = 0;
// fill data with data on the clipboard (if available)
virtual bool GetData( wxDataObject& data ) = 0;
// clears wxTheClipboard and the system's clipboard if possible
virtual void Clear() = 0;
// flushes the clipboard: this means that the data which is currently on
// clipboard will stay available even after the application exits (possibly
// eating memory), otherwise the clipboard will be emptied on exit
virtual bool Flush() { return false; }
// X11 has two clipboards which get selected by this call. Empty on MSW.
virtual void UsePrimarySelection( bool WXUNUSED(primary) = false ) { }
// Returns global instance (wxTheClipboard) of the object:
static wxClipboard *Get();
};
// ----------------------------------------------------------------------------
// globals
// ----------------------------------------------------------------------------
// The global clipboard object - backward compatible access macro:
#define wxTheClipboard (wxClipboard::Get())
// ----------------------------------------------------------------------------
// include platform-specific class declaration
// ----------------------------------------------------------------------------
#if defined(__WXMSW__)
#include "wx/msw/clipbrd.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/clipbrd.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/clipbrd.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/clipbrd.h"
#elif defined(__WXX11__)
#include "wx/x11/clipbrd.h"
#elif defined(__WXMGL__)
#include "wx/mgl/clipbrd.h"
#elif defined(__WXMAC__)
#include "wx/mac/clipbrd.h"
#elif defined(__WXCOCOA__)
#include "wx/cocoa/clipbrd.h"
#elif defined(__WXPM__)
#include "wx/os2/clipbrd.h"
#endif
// ----------------------------------------------------------------------------
// helpful class for opening the clipboard and automatically closing it
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxClipboardLocker
{
public:
wxClipboardLocker(wxClipboard *clipboard = (wxClipboard *)NULL)
{
m_clipboard = clipboard ? clipboard : wxTheClipboard;
if ( m_clipboard )
{
m_clipboard->Open();
}
}
bool operator!() const { return !m_clipboard->IsOpened(); }
~wxClipboardLocker()
{
if ( m_clipboard )
{
m_clipboard->Close();
}
}
private:
wxClipboard *m_clipboard;
DECLARE_NO_COPY_CLASS(wxClipboardLocker)
};
#endif // wxUSE_CLIPBOARD
#endif // _WX_CLIPBRD_H_BASE_

Some files were not shown because too many files have changed in this diff Show More