Committed William Osborne's wxPalmOS port
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29996 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
698b34facd
commit
ffecfa5aeb
22
build/palmos/.cdtproject
Normal file
22
build/palmos/.cdtproject
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<cdtproject id="org.eclipse.cdt.make.core.make">
|
||||
<extension id="org.eclipse.cdt.make.core.MakeScannerProvider" point="org.eclipse.cdt.core.ScannerInfoProvider"/>
|
||||
<extension id="org.eclipse.cdt.core.Elf" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<data>
|
||||
<item id="org.eclipse.cdt.make.core.makeScannerInfo">
|
||||
<includePath path="$(SDK6_LOCATION)headers"/>
|
||||
<includePath path="$(SDK6_LOCATION)headers\EntryNums"/>
|
||||
<includePath path="$(SDK6_LOCATION)headers\posix"/>
|
||||
<includePath path="$(SDK6_LOCATION)headers\posix\arm"/>
|
||||
<includePath path="$(SDK6_LOCATION)headers\posix\arpa"/>
|
||||
<includePath path="$(SDK6_LOCATION)headers\posix\machine"/>
|
||||
<includePath path="$(SDK6_LOCATION)headers\posix\machine\arm"/>
|
||||
<includePath path="$(SDK6_LOCATION)headers\posix\machine\x86"/>
|
||||
<includePath path="$(SDK6_LOCATION)headers\posix\net"/>
|
||||
<includePath path="$(SDK6_LOCATION)headers\posix\netinet"/>
|
||||
<includePath path="$(SDK6_LOCATION)headers\posix\sys"/>
|
||||
<includePath path="$(SDK6_LOCATION)headers\streams"/>
|
||||
<definedSymbol symbol="__arm__"/>
|
||||
</item>
|
||||
</data>
|
||||
</cdtproject>
|
126
build/palmos/.project
Normal file
126
build/palmos/.project
Normal file
@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>wxWidgets</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>com.palmsource.eclipse.palmoscore.palmOSMakeBuilder</name>
|
||||
<arguments>
|
||||
<dictionary>
|
||||
<key>CREATOR_ID</key>
|
||||
<value>STRT</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>DB_HIDDEN</key>
|
||||
<value>false</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>TARGET</key>
|
||||
<value>Simulator</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>DB_TYPE</key>
|
||||
<value>appl</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>VERSION</key>
|
||||
<value>1</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>SDK</key>
|
||||
<value>com.palmsource.eclipse.sdk.palmos6</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>DB_RESET_INSTALL</key>
|
||||
<value>false</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>APP_NAME</key>
|
||||
<value>wxWidgets</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>PROJECT_NAME</key>
|
||||
<value>wxWidgets</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>OS_API</key>
|
||||
<value>Protein</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>PROJECT_TYPE</key>
|
||||
<value>appl</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>DB_BACKUP</key>
|
||||
<value>true</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>DB_PREVENT_COPY</key>
|
||||
<value>false</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>DEBUG_OR_RELEASE</key>
|
||||
<value>Debug</value>
|
||||
</dictionary>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.make.core.makeBuilder</name>
|
||||
<arguments>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.core.errorOutputParser</key>
|
||||
<value>org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
|
||||
<value>clean all</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
|
||||
<value>all</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
|
||||
<value>false</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.buildLocation</key>
|
||||
<value></value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
|
||||
<value>true</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.buildCommand</key>
|
||||
<value>make</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
|
||||
<value>true</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
|
||||
<value>true</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
|
||||
<value>all</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.stopOnError</key>
|
||||
<value>false</value>
|
||||
</dictionary>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>com.palmsource.eclipse.palmos6dev.palmOSProteinNature</nature>
|
||||
<nature>com.palmsource.eclipse.palmoscore.palmOSNature</nature>
|
||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||
<nature>org.eclipse.cdt.make.core.makeNature</nature>
|
||||
<nature>org.eclipse.cdt.core.ccnature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
72
build/palmos/auto-generated.mk
Normal file
72
build/palmos/auto-generated.mk
Normal file
@ -0,0 +1,72 @@
|
||||
# This file auto-generated by Palm OS Make builder. Don't modify directly!!!
|
||||
|
||||
# This value is unescaped. Either quote the value or escape special characters when you use it.
|
||||
ifeq ($(TOOLS_DIR), )
|
||||
TOOLS_DIR = C:/Program Files/PalmSource/Palm OS Developer Suite/PalmOSTools/
|
||||
endif
|
||||
|
||||
# This value is unescaped. Either quote the value or escape special characters when you use it.
|
||||
ifeq ($(SDK_LOCATION), )
|
||||
SDK_LOCATION = C:/Program Files/PalmSource/Palm OS Developer Suite/sdk-6/
|
||||
endif
|
||||
|
||||
ifeq ($(SDK_VERSION), )
|
||||
SDK_VERSION = sdk-6
|
||||
endif
|
||||
|
||||
ifeq ($(CREATOR_ID), )
|
||||
CREATOR_ID = STRT
|
||||
endif
|
||||
|
||||
ifeq ($(DB_HIDDEN), )
|
||||
DB_HIDDEN = false
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET), )
|
||||
TARGET = Simulator
|
||||
endif
|
||||
|
||||
ifeq ($(DB_TYPE), )
|
||||
DB_TYPE = appl
|
||||
endif
|
||||
|
||||
ifeq ($(VERSION), )
|
||||
VERSION = 1
|
||||
endif
|
||||
|
||||
ifeq ($(DB_RESET_INSTALL), )
|
||||
DB_RESET_INSTALL = false
|
||||
endif
|
||||
|
||||
ifeq ($(SDK), )
|
||||
SDK = com.palmsource.eclipse.sdk.palmos6
|
||||
endif
|
||||
|
||||
ifeq ($(APP_NAME), )
|
||||
APP_NAME = wxWidgets
|
||||
endif
|
||||
|
||||
ifeq ($(OS_API), )
|
||||
OS_API = Protein
|
||||
endif
|
||||
|
||||
ifeq ($(PROJECT_NAME), )
|
||||
PROJECT_NAME = wxWidgets
|
||||
endif
|
||||
|
||||
ifeq ($(PROJECT_TYPE), )
|
||||
PROJECT_TYPE = appl
|
||||
endif
|
||||
|
||||
ifeq ($(DB_BACKUP), )
|
||||
DB_BACKUP = true
|
||||
endif
|
||||
|
||||
ifeq ($(DB_PREVENT_COPY), )
|
||||
DB_PREVENT_COPY = false
|
||||
endif
|
||||
|
||||
ifeq ($(DEBUG_OR_RELEASE), )
|
||||
DEBUG_OR_RELEASE = Debug
|
||||
endif
|
||||
|
456
build/palmos/makefile
Normal file
456
build/palmos/makefile
Normal file
@ -0,0 +1,456 @@
|
||||
## --------------------------------------------------------------------------
|
||||
# Palm OS Generic Protein Makefile for Eclipse v1.0.0
|
||||
#
|
||||
# Fill in this file to specify your project and the source that you want
|
||||
# to build, and the settings involved in the build. The makefile-engine.mk
|
||||
# will then do the hard work of the makefile and dependency handling.
|
||||
#
|
||||
# After starting a new project, please remember the following steps...
|
||||
# 1. Add all sources and resources in SOURCES and RESOURCES
|
||||
# 2. Review the other settings as needed.
|
||||
#
|
||||
## --------------------------------------------------------------------------
|
||||
|
||||
SHELL = /bin/sh
|
||||
## conditionally include an auto-generated.mk for dynamic definitions
|
||||
-include auto-generated.mk
|
||||
|
||||
## --------------------------------------------------------------------------
|
||||
# Set up the artifact name.
|
||||
# The database name and other file names are based on the application name
|
||||
## --------------------------------------------------------------------------
|
||||
|
||||
ARTIFACT_NAME = wxWidgets
|
||||
EMPTY =
|
||||
SPACE =$(EMPTY) $(EMPTY)
|
||||
ESCAPED_ARTIFACT_NAME = $(subst $(SPACE),\ ,$(ARTIFACT_NAME))
|
||||
|
||||
PROJECT_NAME = wxWidgets
|
||||
PRC_NAME = wxWidgets.prc
|
||||
|
||||
## --------------------------------------------------------------------------
|
||||
# Sources and Resources and Definition files
|
||||
# List all the sources (.c/.cpp), resources (.xrd), and definition file (.sld)
|
||||
# in your project. Use project relative path names with forward slashes
|
||||
# (src/code.cpp). Please do not use spaces in directory or file names.
|
||||
#
|
||||
# A note about XRD resource files: If you have existing .rsrc or .rcp files,
|
||||
# refer to the documentation for the GenerateXRD tool to convert them into
|
||||
# XRD files for use with all Palm OS SDKs.
|
||||
## --------------------------------------------------------------------------
|
||||
|
||||
# TODO: Update all sources and resources
|
||||
|
||||
SOURCES = ../../samples/minimal/minimal.cpp \
|
||||
../../src/common/accesscmn.cpp \
|
||||
../../src/common/appbase.cpp \
|
||||
../../src/common/appcmn.cpp \
|
||||
../../src/common/artprov.cpp \
|
||||
../../src/common/artstd.cpp \
|
||||
../../src/common/bmpbase.cpp \
|
||||
../../src/common/bookctrl.cpp \
|
||||
../../src/common/choiccmn.cpp \
|
||||
../../src/common/clipcmn.cpp \
|
||||
../../src/common/clntdata.cpp \
|
||||
../../src/common/cmdproc.cpp \
|
||||
../../src/common/cmndata.cpp \
|
||||
../../src/common/config.cpp \
|
||||
../../src/common/containr.cpp \
|
||||
../../src/common/cshelp.cpp \
|
||||
../../src/common/ctrlcmn.cpp \
|
||||
../../src/common/ctrlsub.cpp \
|
||||
../../src/common/datacmn.cpp \
|
||||
../../src/common/datetime.cpp \
|
||||
../../src/common/datstrm.cpp \
|
||||
../../src/common/db.cpp \
|
||||
../../src/common/dbgrid.cpp \
|
||||
../../src/common/dbtable.cpp \
|
||||
../../src/common/dcbase.cpp \
|
||||
../../src/common/dircmn.cpp \
|
||||
../../src/common/dlgcmn.cpp \
|
||||
../../src/common/dndcmn.cpp \
|
||||
../../src/common/dobjcmn.cpp \
|
||||
../../src/common/docmdi.cpp \
|
||||
../../src/common/docview.cpp \
|
||||
../../src/common/dpycmn.cpp \
|
||||
../../src/common/dseldlg.cpp \
|
||||
../../src/common/dynarray.cpp \
|
||||
../../src/common/dynlib.cpp \
|
||||
../../src/common/dynload.cpp \
|
||||
../../src/common/effects.cpp \
|
||||
../../src/common/encconv.cpp \
|
||||
../../src/common/event.cpp \
|
||||
../../src/common/fddlgcmn.cpp \
|
||||
../../src/common/ffile.cpp \
|
||||
../../src/common/file.cpp \
|
||||
../../src/common/fileconf.cpp \
|
||||
../../src/common/filesys.cpp \
|
||||
../../src/common/fldlgcmn.cpp \
|
||||
../../src/common/fmapbase.cpp \
|
||||
../../src/common/fontcmn.cpp \
|
||||
../../src/common/fontmap.cpp \
|
||||
../../src/common/framecmn.cpp \
|
||||
../../src/common/fs_inet.cpp \
|
||||
../../src/common/fs_mem.cpp \
|
||||
../../src/common/fs_zip.cpp \
|
||||
../../src/common/ftp.cpp \
|
||||
../../src/common/gaugecmn.cpp \
|
||||
../../src/common/gbsizer.cpp \
|
||||
../../src/common/gdicmn.cpp \
|
||||
../../src/common/geometry.cpp \
|
||||
../../src/common/gifdecod.cpp \
|
||||
../../src/common/hash.cpp \
|
||||
../../src/common/hashmap.cpp \
|
||||
../../src/common/helpbase.cpp \
|
||||
../../src/common/http.cpp \
|
||||
../../src/common/iconbndl.cpp \
|
||||
../../src/common/imagall.cpp \
|
||||
../../src/common/imagbmp.cpp \
|
||||
../../src/common/image.cpp \
|
||||
../../src/common/imagfill.cpp \
|
||||
../../src/common/imaggif.cpp \
|
||||
../../src/common/imagiff.cpp \
|
||||
../../src/common/imagjpeg.cpp \
|
||||
../../src/common/imagpcx.cpp \
|
||||
../../src/common/imagpng.cpp \
|
||||
../../src/common/imagpnm.cpp \
|
||||
../../src/common/imagtiff.cpp \
|
||||
../../src/common/imagxpm.cpp \
|
||||
../../src/common/init.cpp \
|
||||
../../src/common/intl.cpp \
|
||||
../../src/common/ipcbase.cpp \
|
||||
../../src/common/layout.cpp \
|
||||
../../src/common/lboxcmn.cpp \
|
||||
../../src/common/list.cpp \
|
||||
../../src/common/log.cpp \
|
||||
../../src/common/longlong.cpp \
|
||||
../../src/common/matrix.cpp \
|
||||
../../src/common/memory.cpp \
|
||||
../../src/common/menucmn.cpp \
|
||||
../../src/common/mimecmn.cpp \
|
||||
../../src/common/module.cpp \
|
||||
../../src/common/msgout.cpp \
|
||||
../../src/common/mstream.cpp \
|
||||
../../src/common/nbkbase.cpp \
|
||||
../../src/common/object.cpp \
|
||||
../../src/common/paper.cpp \
|
||||
../../src/common/popupcmn.cpp \
|
||||
../../src/common/prntbase.cpp \
|
||||
../../src/common/process.cpp \
|
||||
../../src/common/protocol.cpp \
|
||||
../../src/common/quantize.cpp \
|
||||
../../src/common/radiocmn.cpp \
|
||||
../../src/common/regex.cpp \
|
||||
../../src/common/rendcmn.cpp \
|
||||
../../src/common/rgncmn.cpp \
|
||||
../../src/common/sckaddr.cpp \
|
||||
../../src/common/sckfile.cpp \
|
||||
../../src/common/sckipc.cpp \
|
||||
../../src/common/sckstrm.cpp \
|
||||
../../src/common/settcmn.cpp \
|
||||
../../src/common/sizer.cpp \
|
||||
../../src/common/socket.cpp \
|
||||
../../src/common/statbar.cpp \
|
||||
../../src/common/strconv.cpp \
|
||||
../../src/common/stream.cpp \
|
||||
../../src/common/string.cpp \
|
||||
../../src/common/sysopt.cpp \
|
||||
../../src/common/taskbarcmn.cpp \
|
||||
../../src/common/tbarbase.cpp \
|
||||
../../src/common/textbuf.cpp \
|
||||
../../src/common/textcmn.cpp \
|
||||
../../src/common/textfile.cpp \
|
||||
../../src/common/timercmn.cpp \
|
||||
../../src/common/tokenzr.cpp \
|
||||
../../src/common/toplvcmn.cpp \
|
||||
../../src/common/treebase.cpp \
|
||||
../../src/common/txtstrm.cpp \
|
||||
../../src/common/url.cpp \
|
||||
../../src/common/utilscmn.cpp \
|
||||
../../src/common/valgen.cpp \
|
||||
../../src/common/validate.cpp \
|
||||
../../src/common/valtext.cpp \
|
||||
../../src/common/variant.cpp \
|
||||
../../src/common/wfstream.cpp \
|
||||
../../src/common/wincmn.cpp \
|
||||
../../src/common/wxchar.cpp \
|
||||
../../src/common/xpmdecod.cpp \
|
||||
../../src/common/xti.cpp \
|
||||
../../src/common/xtistrm.cpp \
|
||||
../../src/common/xtixml.cpp \
|
||||
../../src/common/zipstrm.cpp \
|
||||
../../src/common/zstream.cpp \
|
||||
../../src/generic/renderg.cpp \
|
||||
../../src/generic/statusbr.cpp \
|
||||
../../src/palmos/accel.cpp \
|
||||
../../src/palmos/app.cpp \
|
||||
../../src/palmos/base.cpp \
|
||||
../../src/palmos/bitmap.cpp \
|
||||
../../src/palmos/bmpbuttn.cpp \
|
||||
../../src/palmos/brush.cpp \
|
||||
../../src/palmos/button.cpp \
|
||||
../../src/palmos/caret.cpp \
|
||||
../../src/palmos/checkbox.cpp \
|
||||
../../src/palmos/checklst.cpp \
|
||||
../../src/palmos/choice.cpp \
|
||||
../../src/palmos/clipbrd.cpp \
|
||||
../../src/palmos/colordlg.cpp \
|
||||
../../src/palmos/colour.cpp \
|
||||
../../src/palmos/combobox.cpp \
|
||||
../../src/palmos/control.cpp \
|
||||
../../src/palmos/crashrpt.cpp \
|
||||
../../src/palmos/cursor.cpp \
|
||||
../../src/palmos/data.cpp \
|
||||
../../src/palmos/dc.cpp \
|
||||
../../src/palmos/dcclient.cpp \
|
||||
../../src/palmos/dcmemory.cpp \
|
||||
../../src/palmos/dcprint.cpp \
|
||||
../../src/palmos/dcscreen.cpp \
|
||||
../../src/palmos/dialog.cpp \
|
||||
../../src/palmos/dialup.cpp \
|
||||
../../src/palmos/dib.cpp \
|
||||
../../src/palmos/dir.cpp \
|
||||
../../src/palmos/dirdlg.cpp \
|
||||
../../src/palmos/display.cpp \
|
||||
../../src/palmos/dragimag.cpp \
|
||||
../../src/palmos/dummy.cpp \
|
||||
../../src/palmos/enhmeta.cpp \
|
||||
../../src/palmos/evtloop.cpp \
|
||||
../../src/palmos/fdrepdlg.cpp \
|
||||
../../src/palmos/filedlg.cpp \
|
||||
../../src/palmos/font.cpp \
|
||||
../../src/palmos/fontdlg.cpp \
|
||||
../../src/palmos/fontenum.cpp \
|
||||
../../src/palmos/fontutil.cpp \
|
||||
../../src/palmos/frame.cpp \
|
||||
../../src/palmos/gauge.cpp \
|
||||
../../src/palmos/gdiimage.cpp \
|
||||
../../src/palmos/gdiobj.cpp \
|
||||
../../src/palmos/glcanvas.cpp \
|
||||
../../src/palmos/help.cpp \
|
||||
../../src/palmos/icon.cpp \
|
||||
../../src/palmos/imaglist.cpp \
|
||||
../../src/palmos/iniconf.cpp \
|
||||
../../src/palmos/joystick.cpp \
|
||||
../../src/palmos/listbox.cpp \
|
||||
../../src/palmos/listctrl.cpp \
|
||||
../../src/palmos/main.cpp \
|
||||
../../src/palmos/mdi.cpp \
|
||||
../../src/palmos/menu.cpp \
|
||||
../../src/palmos/menuitem.cpp \
|
||||
../../src/palmos/metafile.cpp \
|
||||
../../src/palmos/mimetype.cpp \
|
||||
../../src/palmos/minifram.cpp \
|
||||
../../src/palmos/msgdlg.cpp \
|
||||
../../src/palmos/mslu.cpp \
|
||||
../../src/palmos/nativdlg.cpp \
|
||||
../../src/palmos/notebook.cpp \
|
||||
../../src/palmos/ownerdrw.cpp \
|
||||
../../src/palmos/palette.cpp \
|
||||
../../src/palmos/pen.cpp \
|
||||
../../src/palmos/popupwin.cpp \
|
||||
../../src/palmos/printdlg.cpp \
|
||||
../../src/palmos/printpalm.cpp \
|
||||
../../src/palmos/radiobox.cpp \
|
||||
../../src/palmos/radiobut.cpp \
|
||||
../../src/palmos/regconf.cpp \
|
||||
../../src/palmos/region.cpp \
|
||||
../../src/palmos/registry.cpp \
|
||||
../../src/palmos/renderer.cpp \
|
||||
../../src/palmos/scrolbar.cpp \
|
||||
../../src/palmos/settings.cpp \
|
||||
../../src/palmos/slider.cpp \
|
||||
../../src/palmos/snglinst.cpp \
|
||||
../../src/palmos/sound.cpp \
|
||||
../../src/palmos/spinbutt.cpp \
|
||||
../../src/palmos/spinctrl.cpp \
|
||||
../../src/palmos/statbmp.cpp \
|
||||
../../src/palmos/statbox.cpp \
|
||||
../../src/palmos/statusbar.cpp \
|
||||
../../src/palmos/statline.cpp \
|
||||
../../src/palmos/stattext.cpp \
|
||||
../../src/palmos/taskbar.cpp \
|
||||
../../src/palmos/toolbar.cpp \
|
||||
../../src/palmos/textctrl.cpp \
|
||||
../../src/palmos/tglbtn.cpp \
|
||||
../../src/palmos/thread.cpp \
|
||||
../../src/palmos/timer.cpp \
|
||||
../../src/palmos/tooltip.cpp \
|
||||
../../src/palmos/toplevel.cpp \
|
||||
../../src/palmos/treectrl.cpp \
|
||||
../../src/palmos/utils.cpp \
|
||||
../../src/palmos/utilsexc.cpp \
|
||||
../../src/palmos/utilsgui.cpp \
|
||||
../../src/palmos/volume.cpp \
|
||||
../../src/palmos/window.cpp
|
||||
|
||||
RESOURCES = ../../include/wx/palmos/wxWidgets.xrd ../../include/wx/palmos/Version.xrd
|
||||
DEFS_FILE = ../../include/wx/palmos/wxWidgets.def
|
||||
SLD_FILE = ../../include/wx/palmos/wxWidgets.sld
|
||||
|
||||
## --------------------------------------------------------------------------
|
||||
# Review Database information
|
||||
# Register Creator ID at: http://dev.palmos.com/creatorid/
|
||||
## --------------------------------------------------------------------------
|
||||
|
||||
CREATOR_ID = bapp
|
||||
DB_TYPE = appl
|
||||
|
||||
DATABASE_RESET =
|
||||
DATABASE_BACKUP = -b
|
||||
DATABASE_HIDDEN =
|
||||
DATABASE_PROTECT =
|
||||
DATABASE_VERSION = 1
|
||||
|
||||
LOCALE = enUS
|
||||
DATABASE_NAME = $(APP_NAME)
|
||||
|
||||
## --------------------------------------------------------------------------
|
||||
# Choose SDK
|
||||
# Supported values:
|
||||
# sdk-6
|
||||
## --------------------------------------------------------------------------
|
||||
|
||||
SDK_VERSION = sdk-6
|
||||
|
||||
ifeq ($(SDK_LOCATION),)
|
||||
SDK_LOCATION=../../
|
||||
endif
|
||||
## --------------------------------------------------------------------------
|
||||
# Build Settings
|
||||
# Review the following for your needs.
|
||||
# The default settings build with debug information and no optimization and
|
||||
# a target platform of an actual device.
|
||||
## --------------------------------------------------------------------------
|
||||
|
||||
#
|
||||
# Set Debug or Release configuration for this project via the project
|
||||
# properties (right-click on the project and select Properties).
|
||||
#
|
||||
DEBUG_OR_RELEASE=Debug
|
||||
|
||||
#
|
||||
# Set the target platform for the build; either Device or Simulator
|
||||
# Use Device as a target for emulator builds.
|
||||
#
|
||||
TARGET_PLATFORM=Simulator
|
||||
|
||||
# Specify the level of optimization that you want:
|
||||
# NONE, SOME, FULL, INTRAPROCEDURAL, INTERPROCEDURAL, INLINING.
|
||||
# Leave blank to select FULL for release builds, and NONE for
|
||||
# debug builds.
|
||||
# INTRAPROCEDURAL, INTERPROCEDURAL, INLINING are applicable to
|
||||
# device builds only; simulator builds will translate those levels
|
||||
# to FULL.
|
||||
OPTIMIZE_LEVEL = NONE
|
||||
|
||||
# Specify warning level
|
||||
# NONE = suppress all warnings
|
||||
# ALL = enable all warnings
|
||||
# <undefined> = default warnings
|
||||
WARNING_LEVEL =
|
||||
|
||||
# Specify exception handling support
|
||||
# true = enable it
|
||||
# false = don't enable it
|
||||
ENABLE_EXCEPTION_HANDLING=true
|
||||
|
||||
# List additional libraries to link with
|
||||
# (Full or project relative path)
|
||||
ADDITIONAL_LINK_LIBRARIES =
|
||||
ADDITIONAL_SIM_LINK_LIBRARIES =
|
||||
|
||||
# Additional paths to look for #include "header"
|
||||
# (Source file directories are automatically included)
|
||||
# Please note that both local and system include paths should
|
||||
# either use "cygwin" syntax or if in Windows syntax the should
|
||||
# be quoted. ie: ../MyLibrary/headers or "C:\Source\MyLibrary\headers"
|
||||
# Additionally, you must explicly specify the "-I" prior to each
|
||||
# path included in this variable. Spaces are used to separate
|
||||
# each path from each other.
|
||||
LOCAL_INCLUDE_PATHS = -Irsc -I../../include
|
||||
LOCAL_SIM_INCLUDE_PATHS = -Irsc -I../../include
|
||||
|
||||
# Additional paths to look for #include <header>
|
||||
# (Palm OS SDK directories are automatically included)
|
||||
# Additionally, you must explicly specify the "-I" prior to each
|
||||
# path included in this variable. Spaces are used to separate
|
||||
# each path from each other.
|
||||
SYSTEM_INCLUDE_PATHS =
|
||||
SYSTEM_SIM_INCLUDE_PATHS =
|
||||
|
||||
# Specify any needed preprocessor symbols.
|
||||
# If you set DEFINES to "ASSERTLEVEL=1", the compiler will see "-DASSERTLEVEL=1"
|
||||
# (separate individual entries with spaces)
|
||||
DEFINES =
|
||||
SIM_DEFINES =
|
||||
|
||||
# Specify additional compiler flags for all files
|
||||
ADDITIONAL_COMPILER_FLAGS =
|
||||
ADDITIONAL_SIM_COMPILER_FLAGS =
|
||||
|
||||
# Specify additional linker flags
|
||||
ADDITIONAL_LINKER_FLAGS =
|
||||
ADDITIONAL_SIM_LINKER_FLAGS =
|
||||
|
||||
# Specify additional archival flags (for static libraries)
|
||||
ADDITIONAL_AR_FLAGS =
|
||||
ADDITIONAL_SIM_AR_FLAGS =
|
||||
|
||||
|
||||
# Tools Directory
|
||||
# Normally you wouldn't want to override this since the necessary tools
|
||||
# are in the PATH. But if you experimenting with other tools, then
|
||||
# reset the directory here
|
||||
# If overridden, end with a trailing '/'
|
||||
|
||||
ifeq ($(TOOLS_DIR), )
|
||||
TOOLS_DIR = ../../../PalmOSTools/
|
||||
endif
|
||||
|
||||
## --------------------------------------------------------------------------
|
||||
# Resource Settings
|
||||
## --------------------------------------------------------------------------
|
||||
|
||||
# Specify the target text encoding
|
||||
# LATIN, JAPANESE, SIMPLIFIED_CHINESE
|
||||
TEXTENCODING = LATIN
|
||||
|
||||
# Specify error levels for locale and text encoding
|
||||
# NOCHECK
|
||||
# STRICT
|
||||
# <default>
|
||||
LOCALE_CHECKING =
|
||||
|
||||
# Specific if encoding should be checked
|
||||
# FALSE, TRUE
|
||||
STRICT_ENCODING = FALSE
|
||||
|
||||
## --------------------------------------------------------------------------
|
||||
# Output Settings
|
||||
## --------------------------------------------------------------------------
|
||||
|
||||
# Modify if you want object and output files to be in different locations
|
||||
# (However, please note that all three object directories must be different
|
||||
# for the makefile engine to properly operate.)
|
||||
# OUTPUT_DIR is the "main" output directory, where all linked and binary objects
|
||||
# will be put.
|
||||
|
||||
DEBUG_DEVICE_OUTPUT_DIR := DebugDevice
|
||||
RELEASE_DEVICE_OUTPUT_DIR := ReleaseDevice
|
||||
DEBUG_SIMULATOR_OUTPUT_DIR := DebugSim
|
||||
RELEASE_SIMULATOR_OUTPUT_DIR := ReleaseSim
|
||||
RSC_OBJ_DIR := ResourceObjs
|
||||
|
||||
## --------------------------------------------------------------------------
|
||||
# Makefiles
|
||||
## --------------------------------------------------------------------------
|
||||
|
||||
|
||||
## include the makefile engine
|
||||
include makefile-engine.mk
|
||||
|
||||
## conditionally include your own custom.mk for your specific overrides or definitions
|
||||
## this is useful if you don't want to use the auto-generated.mk values
|
||||
## for some reason
|
||||
-include custom.mk
|
746
build/palmos/makefile-engine.mk
Normal file
746
build/palmos/makefile-engine.mk
Normal file
@ -0,0 +1,746 @@
|
||||
## Palm OS Protein Generic Makefile Engine for Eclipse v1.0.0
|
||||
#
|
||||
# Last edit: 7/22/04
|
||||
#
|
||||
# This makefile engine is capable of compiling Protein
|
||||
# applications for Palm OS.
|
||||
#
|
||||
# This makefile engine assumes that the following variables are
|
||||
# set outside of this makefile by a referencing master makefile
|
||||
# (see a master makefile generated by a Palm OS Developer
|
||||
# Suite wizard for detailed explanation of each variable):
|
||||
#
|
||||
# SOURCES
|
||||
# RESOURCES
|
||||
# DATABASE_RESET
|
||||
# DATABASE_BACKUP
|
||||
# DATABASE_HIDDEN
|
||||
# DATABASE_PROTECT
|
||||
# DATABASE_BUNDLE
|
||||
# DATABASE_VERSION
|
||||
# DATABASE_NAME
|
||||
# PROJECT_TYPE
|
||||
# DEBUG_OR_RELEASE
|
||||
# OPTIMIZE_LEVEL
|
||||
# WARNING_LEVEL
|
||||
# ENABLE_EXCEPTIONS
|
||||
# ENABLE_ASSERTIONS
|
||||
# ADDITIONAL_LINK_LIBRARIES
|
||||
# ADDITIONAL_SIM_LINK_LIBRARIES
|
||||
# LOCAL_INCLUDE_PATHS
|
||||
# LOCAL_SIM_INCLUDE_PATHS
|
||||
# SYSTEM_INCLUDE_PATHS
|
||||
# SYSTEM_SIM_INCLUDE_PATHS
|
||||
# DEFINES
|
||||
# SIM_DEFINES
|
||||
# ADDITIONAL_COMPILER_FLAGS
|
||||
# ADDITIONAL_SIM_COMPILER_FLAGS
|
||||
# ADDITIONAL_LINKER_FLAGS
|
||||
# ADDITIONAL_SIM_LINKER_FLAGS
|
||||
# ADDITIONAL_AR_FLAGS
|
||||
# ADDITIONAL_SIM_AR_FLAGS
|
||||
# TEXTENCODING
|
||||
# LOCALE_CHECKING
|
||||
# STRICT_ENCODING
|
||||
# SDK_LOCATION
|
||||
# TARGET_PLATFORM
|
||||
#
|
||||
# Additionally, the user of this makefile engine may obtain the
|
||||
# dynamic values for:
|
||||
# SDK_LOCATION
|
||||
# SDK_VERSION
|
||||
# TOOLS_DIR
|
||||
# by doing an optional include of a makefile segment that is
|
||||
# generated during the Palm OS Developer Suite standard make build.
|
||||
# The makefile line to accomplish this is:
|
||||
# -include auto-generated.mk
|
||||
# All master makefiles generated by Palm OS Developer Suite
|
||||
# wizards include this line already to pick up and use these
|
||||
# dynamic definitions.
|
||||
#
|
||||
# All variable values may be overridden by editing the make command
|
||||
# for the project (Project->Properties->C/C++ Make Project->Make Builder,
|
||||
# Build Command field).
|
||||
#
|
||||
|
||||
###############################################################################
|
||||
# Defaults
|
||||
|
||||
comma:= ,
|
||||
|
||||
ifeq ($(TOOLS_DIR), )
|
||||
TOOLS_DIR =
|
||||
endif
|
||||
|
||||
# Locale (defaults to English)
|
||||
ifeq ($(LOCALE), )
|
||||
LOCALE := enUS
|
||||
endif
|
||||
|
||||
ifeq ($(CREATOR_ID), )
|
||||
CREATOR_ID = STRT
|
||||
endif
|
||||
|
||||
ifeq ($(DB_TYPE), )
|
||||
DB_TYPE = appl
|
||||
endif
|
||||
|
||||
ifeq ($(SLD_FILE), )
|
||||
SLD_FILE = none
|
||||
endif
|
||||
|
||||
ifeq ($(DEBUG_DEVICE_OUTPUT_DIR), )
|
||||
DEBUG_DEVICE_OUTPUT_DIR = DebugDevice
|
||||
endif
|
||||
|
||||
ifeq ($(RELEASE_DEVICE_OUTPUT_DIR), )
|
||||
RELEASE_DEVICE_OUTPUT_DIR = ReleaseDevice
|
||||
endif
|
||||
|
||||
ifeq ($(DEBUG_SIMULATOR_OUTPUT_DIR), )
|
||||
DEBUG_SIMULATOR_OUTPUT_DIR = DebugSim
|
||||
endif
|
||||
|
||||
ifeq ($(RELEASE_SIMULATOR_OUTPUT_DIR), )
|
||||
RELEASE_SIMULATOR_OUTPUT_DIR = ReleaseSim
|
||||
endif
|
||||
|
||||
ifeq ($(SDK_VERSION), )
|
||||
SDK_VERSION = sdk-6
|
||||
endif
|
||||
|
||||
ifeq ($(ENABLE_EXCEPTIONS), )
|
||||
ENABLE_EXCEPTIONS=TRUE
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
# App/PRC/Database Names
|
||||
#
|
||||
# The difference between App Name and Database name is that App Name may
|
||||
# contain spaces while the database name is the App name with spaces removed.
|
||||
# (Coded in such a way that if the user already explicitly defined these
|
||||
# variables previously, we'll go with those).
|
||||
|
||||
ifeq ($(DATABASE_NAME), )
|
||||
ifeq ($(ESCAPED_ARTIFACT_NAME), )
|
||||
# Database name defaults if ARTIFACT_NAME is empty
|
||||
DATABASE_NAME = StartApp
|
||||
else
|
||||
DATABASE_NAME = $(ESCAPED_ARTIFACT_NAME)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(PRC_NAME), )
|
||||
ifeq ($(ESCAPED_ARTIFACT_NAME), )
|
||||
# PRC name defaults if ESCAPED_ARTIFACT_NAME is empty
|
||||
PRC_NAME = Start.prc
|
||||
else
|
||||
PRC_NAME = $(DATABASE_NAME).prc
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(LIB_NAME), )
|
||||
ifeq ($(ESCAPED_ARTIFACT_NAME), )
|
||||
# LIB name defaults if ESCAPED_ARTIFACT_NAME is empty
|
||||
LIB_NAME = Start.a
|
||||
else
|
||||
LIB_NAME = $(DATABASE_NAME).a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(SIM_LIB_NAME), )
|
||||
ifeq ($(ESCAPED_ARTIFACT_NAME), )
|
||||
# SIM LIB name defaults if ESCAPED_ARTIFACT_NAME is empty
|
||||
SIM_LIB_NAME = Start.lib
|
||||
else
|
||||
SIM_LIB_NAME = $(DATABASE_NAME).lib
|
||||
endif
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
# Compile and Link Settings
|
||||
|
||||
TARGET_FORMAT=PalmOS6
|
||||
|
||||
# Compiler settings... compiler + optimizations + debug
|
||||
# This is a makefile for Palm OS 6 so the compilers used are as follows:
|
||||
# Device target compiler is pacc
|
||||
# Simulator target compiler is gcc
|
||||
|
||||
CC = "$(TOOLS_DIR)pacc"
|
||||
SIM_CC = gcc
|
||||
|
||||
CFLAGS += -D__PALMOS_KERNEL__=1 -D__PALMOS__=0x06000000
|
||||
SIM_CFLAGS += -fexceptions -mno-cygwin -mwindows -D__PALMOS_KERNEL__=1 -D__PALMOS__=0x06000000 -D_SUPPORTS_NAMESPACE=0 -D_SUPPORTS_RTTI=1 -DTARGET_PLATFORM=TARGET_PLATFORM_PALMSIM_WIN32 -DTARGET_HOST=TARGET_HOST_PALMOS
|
||||
|
||||
# Warning level for device target
|
||||
ifeq ($(WARNING_LEVEL), ALL)
|
||||
CFLAGS += -W4
|
||||
else
|
||||
ifeq ($(WARNING_LEVEL), SOME)
|
||||
CFLAGS += -W2
|
||||
else
|
||||
ifeq ($(WARNING_LEVEL), NONE)
|
||||
CFLAGS += -W0
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# Warning level for simulator target
|
||||
ifeq ($(SIM_WARNING_LEVEL), ALL)
|
||||
SIM_CFLAGS += -Wall
|
||||
else
|
||||
ifeq ($(SIM_WARNING_LEVEL), NONE)
|
||||
SIM_CFLAGS += -w
|
||||
endif
|
||||
endif
|
||||
|
||||
# Warnings as errors for device builds
|
||||
ifeq ($(WARNING_AS_ERROR), TRUE)
|
||||
CFLAGS += -Werror
|
||||
endif
|
||||
|
||||
# Warnings as errors for simulator builds
|
||||
ifeq ($(SIM_WARNING_AS_ERROR), TRUE)
|
||||
SIM_CFLAGS += -Werror
|
||||
endif
|
||||
|
||||
# Adding after other warnings flags so this is always in effect
|
||||
SIM_CFLAGS += -Wno-multichar
|
||||
|
||||
# Verbose output for device build
|
||||
ifeq ($(VERBOSE), TRUE)
|
||||
CFLAGS += -v
|
||||
endif
|
||||
|
||||
# Verbose output for simulator build
|
||||
ifeq ($(SIM_VERBOSE), TRUE)
|
||||
SIM_CFLAGS += -v
|
||||
endif
|
||||
|
||||
# Dislay logo
|
||||
ifeq ($(ARM_LOGO), TRUE)
|
||||
CFLAGS += -logo
|
||||
else
|
||||
CFLAGS += -nologo
|
||||
endif
|
||||
|
||||
# Exception handling support
|
||||
ifeq ($(ENABLE_EXCEPTIONS), TRUE)
|
||||
CFLAGS += -ex
|
||||
LDFLAGS += -ex
|
||||
endif
|
||||
|
||||
# Assertion handling support
|
||||
ifeq ($(ENABLE_ASSERTIONS), TRUE)
|
||||
CFLAGS += -UNDEBUG
|
||||
else
|
||||
CFLAGS += -DNDEBUG=1
|
||||
endif
|
||||
|
||||
# Additional linker flags
|
||||
ifdef ADDITIONAL_PALINK_FLAGS
|
||||
LDFLAGS += $(ADDITIONAL_PALINK_FLAGS)
|
||||
endif
|
||||
|
||||
# Optimization settings
|
||||
ifeq ($(OPTIMIZE_LEVEL), INLINING)
|
||||
OPTIMIZER_FLAG = -O5
|
||||
SIM_OPTIMIZER_FLAG = -O3
|
||||
else
|
||||
ifeq ($(OPTIMIZE_LEVEL), INTERPROCEDURAL)
|
||||
OPTIMIZER_FLAG = -O4
|
||||
SIM_OPTIMIZER_FLAG = -O3
|
||||
else
|
||||
ifeq ($(OPTIMIZE_LEVEL), FULL)
|
||||
OPTIMIZER_FLAG = -O3
|
||||
SIM_OPTIMIZER_FLAG = -O3
|
||||
else
|
||||
ifeq ($(OPTIMIZE_LEVEL), INTRAPROCEDURAL)
|
||||
OPTIMIZER_FLAG = -O2
|
||||
SIM_OPTIMIZER_FLAG = -O3
|
||||
else
|
||||
ifeq ($(OPTIMIZE_LEVEL), SOME)
|
||||
OPTIMIZER_FLAG = -O1
|
||||
SIM_OPTIMIZER_FLAG = -O1
|
||||
else
|
||||
ifeq ($(OPTIMIZE_LEVEL), NONE)
|
||||
OPTIMIZER_FLAG = -O0
|
||||
SIM_OPTIMIZER_FLAG = -O0
|
||||
else
|
||||
# Default to 0 for debug, 3 for release
|
||||
ifeq ($(DEBUG_OR_RELEASE), Debug)
|
||||
OPTIMIZER_FLAG = -O0
|
||||
SIM_OPTIMIZER_FLAG = -O0
|
||||
else
|
||||
OPTIMIZER_FLAG = -O3
|
||||
SIM_OPTIMIZER_FLAG = -O3
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# Debug settings (can override optimize settings)
|
||||
ifeq ($(DEBUG_OR_RELEASE), Debug)
|
||||
DEBUG_FLAG += -g
|
||||
BUILD_TYPE_FLAG = -DBUILD_TYPE=BUILD_TYPE_DEBUG
|
||||
TRACE_OUTPUT_FLAG = -DTRACE_OUTPUT=TRACE_OUTPUT_ON
|
||||
else
|
||||
BUILD_TYPE_FLAG = -DBUILD_TYPE=BUILD_TYPE_RELEASE
|
||||
TRACE_OUTPUT_FLAG = -DTRACE_OUTPUT=TRACE_OUTPUT_OFF
|
||||
endif
|
||||
|
||||
ifeq ($(DEBUG_OR_RELEASE), Debug)
|
||||
OBJ_DIR = $(DEBUG_DEVICE_OUTPUT_DIR)
|
||||
SIM_OBJ_DIR = $(DEBUG_SIMULATOR_OUTPUT_DIR)
|
||||
else
|
||||
OBJ_DIR = $(RELEASE_DEVICE_OUTPUT_DIR)
|
||||
SIM_OBJ_DIR = $(RELEASE_SIMULATOR_OUTPUT_DIR)
|
||||
endif
|
||||
|
||||
|
||||
CFLAGS += $(OPTIMIZER_FLAG) $(DEBUG_FLAG) $(BUILD_TYPE_FLAG) $(TRACE_OUTPUT_FLAG)
|
||||
SIM_CFLAGS += $(SIM_OPTIMIZER_FLAG) $(DEBUG_FLAG) $(BUILD_TYPE_FLAG) $(TRACE_OUTPUT_FLAG)
|
||||
|
||||
# Linker settings (must come after setting DEBUG_FLAG)
|
||||
LD = "$(TOOLS_DIR)pacc"
|
||||
SIM_LD = gcc
|
||||
|
||||
LDFLAGS += $(DEBUG_FLAG) -nologo -Wl,-nolocals
|
||||
SIM_LDFLAGS += $(DEBUG_FLAG) -mno-cygwin -mwindows $(SIM_OBJ_DIR)/gcc_link.def -shared -nostdlib -u___divdi3 -u___moddi3 -u___udivdi3 -u___umoddi3
|
||||
SIM_LIBS = -L "$(TOOLS_DIR)misclibs" -lpxstlport -lpxsupc++ -lpxgcc -lgcc
|
||||
ifeq ($(DEBUG_OR_RELEASE), Debug)
|
||||
LDFLAGS += -Wl,-debug -Wl,-libpath -Wl,"$(SDK_LOCATION)libraries/ARM_4T/Debug/Default"
|
||||
SIM_LIBS += "$(SDK_LOCATION)libraries/Simulator/Debug/PalmOS.lib"
|
||||
else
|
||||
LDFLAGS += -Wl,-libpath -Wl,"$(SDK_LOCATION)libraries/ARM_4T/Release/Default"
|
||||
SIM_LIBS += "$(SDK_LOCATION)libraries/Simulator/Release/PalmOS.lib"
|
||||
endif
|
||||
|
||||
LDOBJS = PalmOS.a SystemGlue.a FloatMgr.sa
|
||||
|
||||
ifeq ($(TARGET_PLATFORM), Device)
|
||||
NATIVE_OBJ_DIR := $(OBJ_DIR)
|
||||
RSC_OBJ_DIR := $(OBJ_DIR)
|
||||
else
|
||||
NATIVE_OBJ_DIR := $(SIM_OBJ_DIR)
|
||||
RSC_OBJ_DIR := $(SIM_OBJ_DIR)
|
||||
endif
|
||||
|
||||
# Librarian settings
|
||||
AR="$(TOOLS_DIR)palib"
|
||||
SIM_AR=ar
|
||||
|
||||
ARFLAGS= -c -a
|
||||
SIM_ARFLAGS=-rc
|
||||
|
||||
LINKER_OUTPUT := $(OBJ_DIR)/$(DATABASE_NAME).axf
|
||||
SIM_LINKER_OUTPUT := $(SIM_OBJ_DIR)/$(DATABASE_NAME).dll
|
||||
|
||||
TARGET := $(OBJ_DIR)/$(PRC_NAME)
|
||||
SIM_TARGET := $(SIM_OBJ_DIR)/$(PRC_NAME)
|
||||
|
||||
STATIC_LIB_TARGET := $(OBJ_DIR)/$(LIB_NAME)
|
||||
SIM_STATIC_LIB_TARGET := $(SIM_OBJ_DIR)/$(SIM_LIB_NAME)
|
||||
|
||||
###############################################################################
|
||||
# Resource flags (PalmRC)
|
||||
|
||||
RFLAGS +=
|
||||
|
||||
# Default text encoding is Latin
|
||||
ifeq ($(PRC_TEXT_ENCODING), )
|
||||
PRC_TEXT_ENCODING = LATIN
|
||||
endif
|
||||
|
||||
ifeq ($(PRC_TEXT_ENCODING), LATIN)
|
||||
RFLAGS += -target 4.0
|
||||
else
|
||||
ifeq ($(PRC_TEXT_ENCODING), JAPANESE)
|
||||
RFLAGS += -target 4.0J
|
||||
else
|
||||
ifeq ($(PRC_TEXT_ENCODING), SIMPLIFIED_CHINESE)
|
||||
RFLAGS += -target 4.0CS
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(PRC_NO_LOCALE_CHECK), TRUE)
|
||||
RFLAGS += -noLocaleCheck
|
||||
endif
|
||||
|
||||
ifeq ($(PRC_STRICT_LOCALE), TRUE)
|
||||
RFLAGS += -strictLocale
|
||||
endif
|
||||
|
||||
ifeq ($(PRC_STRICT_ENCODING), TRUE)
|
||||
RFLAGS += -strictTextEncoding
|
||||
endif
|
||||
|
||||
ifdef PRC_OVERLAY_FILTER
|
||||
RFLAGS += -overlayFilter $(PRC_OVERLAY_FILTER)
|
||||
endif
|
||||
|
||||
ifeq ($(PRC_NO_WARN_SIZE), TRUE)
|
||||
RFLAGS += -noWarnSize
|
||||
endif
|
||||
|
||||
ifeq ($(PRC_QUIET), TRUE)
|
||||
RFLAGS += -quiet
|
||||
endif
|
||||
|
||||
ifeq ($(PRCMERGE_QUIET), TRUE)
|
||||
PRCFLAGS += -quiet
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
|
||||
# function for converting sources to object file names in one of output directories
|
||||
define SOURCE_LIST_TO_OBJS
|
||||
$(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(SOURCES), \
|
||||
$(basename $(notdir $(file))))))
|
||||
endef
|
||||
|
||||
# function for converting sources to object file names in $(SIM_OBJ_DIR)
|
||||
define SOURCE_LIST_TO_SIM_OBJS
|
||||
$(addprefix $(SIM_OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(SOURCES), \
|
||||
$(basename $(notdir $(file))))))
|
||||
endef
|
||||
|
||||
# function for converting resources into resource object files
|
||||
define RESOURCE_LIST_TO_OBJS
|
||||
$(addprefix $(RSC_OBJ_DIR)/, $(addsuffix .trc, $(foreach file, $(RESOURCES), \
|
||||
$(basename $(file)))))
|
||||
endef
|
||||
|
||||
OBJS = $(SOURCE_LIST_TO_OBJS)
|
||||
SIM_OBJS = $(SOURCE_LIST_TO_SIM_OBJS)
|
||||
SOURCE_PATHS += $(sort $(foreach file, $(SOURCES), $(dir $(file))))
|
||||
RESOURCE_OBJS = $(RESOURCE_LIST_TO_OBJS)
|
||||
RESOURCE_PATHS += $(sort $(foreach file, $(RESOURCES), $(dir $(file))))
|
||||
SLD_BASENAME := $(addsuffix _Startup, $(basename $(notdir $(SLD_FILE))))
|
||||
SLD_OBJ := $(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(SLD_BASENAME)))
|
||||
SLD_SIM_OBJ := $(addprefix $(SIM_OBJ_DIR)/, $(addsuffix .o, $(SLD_BASENAME)))
|
||||
|
||||
VPATH :=
|
||||
VPATH += $(addprefix :, $(subst ,:, $(filter-out $($(subst, :, ,$(VPATH))), $(SOURCE_PATHS) $(RESOURCE_PATHS) )))
|
||||
|
||||
SYSTEM_INCLUDES = $(SYSTEM_INCLUDE_PATHS) -I "$(SDK_LOCATION)headers" -I "$(SDK_LOCATION)headers/posix"
|
||||
INCLUDES = $(LOCAL_INCLUDE_PATHS) $(foreach path, $(SOURCE_PATHS), $(addprefix -I, $(path))) $(SYSTEM_INCLUDES) $(PRE_INCLUDE_PATHS)
|
||||
CPP_INCLUDES = -I "$(TOOLS_DIR)include/stlport"
|
||||
|
||||
SIM_SYSTEM_INCLUDES = $(SYSTEM_SIM_INCLUDE_PATHS) -I "$(SDK_LOCATION)headers" -I "$(SDK_LOCATION)headers/posix"
|
||||
SIM_INCLUDES = $(LOCAL_SIM_INCLUDE_PATHS) $(foreach path, $(SOURCE_PATHS), $(addprefix -I, $(path))) $(SIM_SYSTEM_INCLUDES) $(SIM_PRE_INCLUDE_PATHS)
|
||||
SIM_CPP_INCLUDES = -I "$(TOOLS_DIR)include/stlport"
|
||||
|
||||
# Now add additional settings specified by user
|
||||
LDFLAGS += $(ADDITIONAL_LINK_LIBRARIES)
|
||||
LDFLAGS += $(foreach libpath, $(ADDITIONAL_LINK_LIBPATH), $(addprefix -libpath , $(libpath)))
|
||||
LDFLAGS += $(foreach option, $(ADDITIONAL_LINKER_FLAGS), $(addprefix -Wl$(comma), $(option)))
|
||||
CFLAGS += $(foreach define, $(DEFINES), $(addprefix -D, $(define)))
|
||||
CFLAGS += $(foreach define, $(UNDEFINES), $(addprefix -U, $(define)))
|
||||
CFLAGS += $(ADDITIONAL_COMPILER_FLAGS)
|
||||
|
||||
SIM_LDFLAGS += $(ADDITIONAL_SIM_LINK_LIBRARIES)
|
||||
SIM_LDFLAGS += $(ADDITIONAL_SIM_LINKER_FLAGS)
|
||||
SIM_LDFLAGS += $(foreach libpath, $(ADDITIONAL_SIM_LINK_LIBPATH), $(addprefix -L, $(libpath)))
|
||||
SIM_CFLAGS += $(foreach define, $(SIM_DEFINES), $(addprefix -D, $(define)))
|
||||
SIM_CFLAGS += $(foreach define, $(SIM_UNDEFINES), $(addprefix -U, $(define)))
|
||||
SIM_CFLAGS += $(ADDITIONAL_SIM_COMPILER_FLAGS)
|
||||
|
||||
# Specifyc additional archival flags (for static libraries)
|
||||
ARFLAGS += $(ADDITIONAL_AR_FLAGS)
|
||||
SIM_ARFLAGS += $(ADDITIONAL_SIM_AR_FLAGS)
|
||||
|
||||
RFLAGS += $(ADDITIONAL_PRC_FLAGS)
|
||||
PRCFLAGS += $(ADDITIONAL_PRCMERGE_FLAGS)
|
||||
|
||||
###############################################################################
|
||||
# Flags for PRC creation
|
||||
|
||||
PRCFLAGS += -dbFlagExtendedDB -dbFlagExecutable
|
||||
|
||||
PRCFLAGS += -dbVersion $(DATABASE_VERSION) $(DATABASE_PROTECT) $(DATABASE_HIDDEN) $(DATABASE_BACKUP) $(DATABASE_RESET) $(DATABASE_BUNDLE)
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Flags for pslib
|
||||
|
||||
PSLIB_DEV_FLAGS =
|
||||
PSLIB_SIM_FLAGS = -outSimgcc
|
||||
ifeq ($(PROJECT_TYPE), slib)
|
||||
PSLIB_DEV_FLAGS += -outEntryNums $(OBJ_DIR)/$(DATABASE_NAME)_Client.h -outObjStubs $(OBJ_DIR)/$(DATABASE_NAME)_Client.sa
|
||||
PSLIB_SIM_FLAGS += -outEntryNums $(SIM_OBJ_DIR)/$(DATABASE_NAME)_Client.h -outSimStubs $(SIM_OBJ_DIR)/$(DATABASE_NAME)_Client.slib
|
||||
endif
|
||||
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Project make target determination
|
||||
|
||||
ifeq ($(TARGET_PLATFORM), Device)
|
||||
|
||||
ifeq ($(PROJECT_TYPE), )
|
||||
PROJECT_TARGET = device
|
||||
endif
|
||||
|
||||
ifeq ($(PROJECT_TYPE), appl)
|
||||
PROJECT_TARGET = device
|
||||
endif
|
||||
ifeq ($(PROJECT_TYPE), slib)
|
||||
PROJECT_TARGET = device_shared_lib
|
||||
endif
|
||||
ifeq ($(PROJECT_TYPE), lib)
|
||||
PROJECT_TARGET = device_static_lib
|
||||
endif
|
||||
|
||||
else
|
||||
|
||||
ifeq ($(PROJECT_TYPE), )
|
||||
PROJECT_TARGET = simulator
|
||||
endif
|
||||
|
||||
ifeq ($(PROJECT_TYPE), appl)
|
||||
PROJECT_TARGET = simulator
|
||||
endif
|
||||
ifeq ($(PROJECT_TYPE), slib)
|
||||
PROJECT_TARGET = simulator_shared_lib
|
||||
endif
|
||||
ifeq ($(PROJECT_TYPE), lib)
|
||||
PROJECT_TARGET = simulator_static_lib
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
# Eclipse requires an all target to get the work done
|
||||
|
||||
all: $(PROJECT_TARGET)
|
||||
|
||||
# This rule is only valid for projects created as application projects.
|
||||
# Don't invoke this make target directly; instead change the value of
|
||||
# TARGET_PLATFORM to Device in the main makefile
|
||||
device: $(OBJ_DIR) $(TARGET)
|
||||
|
||||
# This rule is only valid for projects created as application projects.
|
||||
# Don't invoke this make target directly; instead change the value of
|
||||
# TARGET_PLATFORM to Simulator in the main makefile
|
||||
simulator: $(SIM_OBJ_DIR) $(SIM_TARGET)
|
||||
|
||||
# This rule is only valid for projects created as shared library projects.
|
||||
# Don't invoke this make target directly; instead change the value of
|
||||
# TARGET_PLATFORM to Device in the main makefile
|
||||
device_shared_lib: $(OBJ_DIR) $(TARGET)
|
||||
|
||||
# This rule is only valid for projects created as shared library projects.
|
||||
# Don't invoke this make target directly; instead change the value of
|
||||
# TARGET_PLATFORM to Simulator in the main makefile
|
||||
simulator_shared_lib: $(SIM_OBJ_DIR) $(SIM_TARGET)
|
||||
|
||||
# This rule is only valid for projects created as static library projects.
|
||||
# Don't invoke this make target directly; instead change the value of
|
||||
# TARGET_PLATFORM to Device in the main makefile
|
||||
device_static_lib: $(OBJ_DIR) $(STATIC_LIB_TARGET)
|
||||
|
||||
# This rule is only valid for projects created as static library projects.
|
||||
# Don't invoke this make target directly; instead change the value of
|
||||
# TARGET_PLATFORM to Simulator in the main makefile
|
||||
simulator_static_lib: $(SIM_OBJ_DIR) $(SIM_STATIC_LIB_TARGET)
|
||||
|
||||
|
||||
# rule to create the object file directories if needed
|
||||
$(OBJ_DIR):
|
||||
@[ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) > /dev/null 2>&1
|
||||
|
||||
$(SIM_OBJ_DIR):
|
||||
@[ -d $(SIM_OBJ_DIR) ] || mkdir $(SIM_OBJ_DIR) > /dev/null 2>&1
|
||||
|
||||
# main C/C++ sources
|
||||
$(OBJ_DIR)/%.o : %.c makefile
|
||||
$(CC) -c $< $(INCLUDES) $(CFLAGS) -o $@
|
||||
$(OBJ_DIR)/%.o : %.cpp makefile
|
||||
$(CC) -c $< $(INCLUDES) $(CPP_INCLUDES) $(CFLAGS) -o $@
|
||||
$(OBJ_DIR)/%.o : %.cp makefile
|
||||
$(CC) -c $< $(INCLUDES) $(CPP_INCLUDES) $(CFLAGS) -o $@
|
||||
$(OBJ_DIR)/%.o : %.cc makefile
|
||||
$(CC) -c $< $(INCLUDES) $(CPP_INCLUDES) $(CFLAGS) -o $@
|
||||
$(OBJ_DIR)/%.o : %.C makefile
|
||||
$(CC) -c $< $(INCLUDES) $(CFLAGS) -o $@
|
||||
$(OBJ_DIR)/%.o : %.CC makefile
|
||||
$(CC) -c $< $(INCLUDES) $(CPP_INCLUDES) $(CFLAGS) -o $@
|
||||
$(OBJ_DIR)/%.o : %.CPP makefile
|
||||
$(CC) -c $< $(INCLUDES) $(CPP_INCLUDES) $(CFLAGS) -o $@
|
||||
|
||||
# Simulator C/C++ sources
|
||||
$(SIM_OBJ_DIR)/%.o : %.c makefile
|
||||
$(SIM_CC) -c $< $(SIM_INCLUDES) -std=c99 $(SIM_CFLAGS) -o $@
|
||||
$(SIM_OBJ_DIR)/%.o : %.cpp makefile
|
||||
$(SIM_CC) -c $< $(SIM_INCLUDES) $(SIM_CPP_INCLUDES) -frtti $(SIM_CFLAGS) -o $@
|
||||
$(SIM_OBJ_DIR)/%.o : %.cp makefile
|
||||
$(SIM_CC) -c $< $(SIM_INCLUDES) $(SIM_CPP_INCLUDES) -frtti $(SIM_CFLAGS) -o $@
|
||||
$(SIM_OBJ_DIR)/%.o : %.cc makefile
|
||||
$(SIM_CC) -c $< $(SIM_INCLUDES) $(SIM_CPP_INCLUDES) -frtti $(SIM_CFLAGS) -o $@
|
||||
$(SIM_OBJ_DIR)/%.o : %.C makefile
|
||||
$(SIM_CC) -c $< $(SIM_INCLUDES) -std=c99 $(SIM_CFLAGS) -o $@
|
||||
$(SIM_OBJ_DIR)/%.o : %.CC makefile
|
||||
$(SIM_CC) -c $< $(SIM_INCLUDES) $(SIM_CPP_INCLUDES) -frtti $(SIM_CFLAGS) -o $@
|
||||
$(SIM_OBJ_DIR)/%.o : %.CPP makefile
|
||||
$(SIM_CC) -c $< $(SIM_INCLUDES) $(SIM_CPP_INCLUDES) -frtti $(SIM_CFLAGS) -o $@
|
||||
|
||||
|
||||
# XRD source processing
|
||||
$(RSC_OBJ_DIR)/%.trc : %.xrd makefile
|
||||
"$(TOOLS_DIR)PalmRC" -p $(TARGET_FORMAT) -makeDeps $(@D)/$(*F).deps $(RFLAGS) -locale $(LOCALE) "`cygpath -w -a ./$<`" -o $@
|
||||
$(RSC_OBJ_DIR)/%.trc : %.XRD makefile
|
||||
"$(TOOLS_DIR)PalmRC" -p $(TARGET_FORMAT) -makeDeps $(@D)/$(*F).deps $(RFLAGS) -locale $(LOCALE) "`cygpath -w -a ./$<`" -o $@
|
||||
|
||||
|
||||
# Definition file source processing
|
||||
$(SLD_OBJ) : makefile
|
||||
@echo "...Processing definition file for Device..."
|
||||
"$(TOOLS_DIR)pslib" -inDef "$(SLD_FILE)" $(PSLIB_DEV_FLAGS) -outObjStartup $@ -type '$(DB_TYPE)' -creator '$(CREATOR_ID)' -execName $(DATABASE_NAME)
|
||||
|
||||
$(SLD_SIM_OBJ) : makefile
|
||||
@echo "...Processing definition file for Simulator..."
|
||||
"$(TOOLS_DIR)pslib" -inDef "$(SLD_FILE)" $(PSLIB_SIM_FLAGS) -outSimStartup $@ -outSimRsrc $(SIM_OBJ_DIR)/acod0000.bin -outSimDefs $(SIM_OBJ_DIR)/gcc_link.def -type '$(DB_TYPE)' -creator '$(CREATOR_ID)' -execName $(DATABASE_NAME)
|
||||
|
||||
# Linking step
|
||||
$(LINKER_OUTPUT) : $(OBJS)
|
||||
@echo "...Linking for Device Target..."
|
||||
$(LD) -o $(LINKER_OUTPUT) $(OBJS) $(SLD_OBJ) $(LDOBJS) $(LDFLAGS)
|
||||
|
||||
$(SIM_LINKER_OUTPUT) : $(SIM_OBJS)
|
||||
@echo "...Linking for Simulator Target..."
|
||||
$(SIM_LD) --entry 0 -o $(SIM_LINKER_OUTPUT) $(SIM_OBJS) $(SLD_SIM_OBJ) $(SIM_LDFLAGS) $(SIM_LIBS)
|
||||
|
||||
|
||||
# Final target creation
|
||||
$(TARGET): $(SLD_OBJ) $(LINKER_OUTPUT) $(RESOURCE_OBJS)
|
||||
@echo "...Creating PRC for Device: $(TARGET)"
|
||||
"$(TOOLS_DIR)pelf2bin" -format 6 -directory $(OBJ_DIR) -code acod -data adat -rsrc 0x0000 $(LINKER_OUTPUT)
|
||||
"$(TOOLS_DIR)PRCMerge" -dbType '$(DB_TYPE)' -dbCreator '$(CREATOR_ID)' -dbName $(DATABASE_NAME) $(PRCFLAGS) -o $(TARGET) $(RESOURCE_OBJS) $(OBJ_DIR)/adat0000.bin $(OBJ_DIR)/acod0000.bin
|
||||
@echo ...Done with Device build...
|
||||
@echo
|
||||
|
||||
$(SIM_TARGET): $(SLD_SIM_OBJ) $(SIM_LINKER_OUTPUT) $(RESOURCE_OBJS)
|
||||
@echo "...Creating PRC for Simulator: $(SIM_TARGET)"
|
||||
cp -f "$(SDK_LOCATION)misctools/Resources/amdd_fake" $(SIM_OBJ_DIR)/adat0000.bin
|
||||
"$(TOOLS_DIR)PRCMerge" -dbType '$(DB_TYPE)' -dbCreator '$(CREATOR_ID)' -dbName $(DATABASE_NAME) $(PRCFLAGS) -o $(SIM_TARGET) $(RESOURCE_OBJS) $(SIM_OBJ_DIR)/adat0000.bin $(SIM_OBJ_DIR)/acod0000.bin
|
||||
@echo ...Done with Simulator build...
|
||||
@echo
|
||||
|
||||
$(STATIC_LIB_TARGET) : $(OBJS)
|
||||
@echo "...Linking Static Library for Device Target..."
|
||||
$(AR) $(ARFLAGS) $(STATIC_LIB_TARGET) $(OBJS)
|
||||
|
||||
$(SIM_STATIC_LIB_TARGET) : $(SIM_OBJS)
|
||||
@echo "...Linking Static Library for Simulator Target..."
|
||||
$(SIM_AR) $(SIM_ARFLAGS) $(SIM_STATIC_LIB_TARGET) $(SIM_OBJS)
|
||||
|
||||
|
||||
FORCE:
|
||||
|
||||
# Eclipse requires a clean command
|
||||
clean :: FORCE
|
||||
-rm -rf $(NATIVE_OBJ_DIR)/*
|
||||
|
||||
|
||||
printvars :: FORCE
|
||||
@echo "SDK_LOCATION"
|
||||
@echo $(SDK_LOCATION)
|
||||
@echo "CFLAGS"
|
||||
@echo $(CFLAGS)
|
||||
@echo "SIM_CFLAGS"
|
||||
@echo $(SIM_CFLAGS)
|
||||
@echo "LDFLAGS"
|
||||
@echo $(LDFLAGS)
|
||||
@echo "SIM_LDFLAGS"
|
||||
@echo $(SIM_LDFLAGS)
|
||||
@echo "OBJS"
|
||||
@echo $(OBJS)
|
||||
@echo "SIM_OBJS"
|
||||
@echo $(SIM_OBJS)
|
||||
@echo "SLD_OBJ"
|
||||
@echo $(SLD_OBJ)
|
||||
@echo "SLD_SIM_OBJ"
|
||||
@echo $(SLD_SIM_OBJ)
|
||||
@echo "TARGET"
|
||||
@echo $(TARGET)
|
||||
@echo "SIM_TARGET"
|
||||
@echo $(SIM_TARGET)
|
||||
@echo "SOURCE_PATHS"
|
||||
@echo $(SOURCE_PATHS)
|
||||
@echo "RESOURCE_OBJS"
|
||||
@echo $(RESOURCE_OBJS)
|
||||
@echo "RESOURCE_PATHS"
|
||||
@echo $(RESOURCE_PATHS)
|
||||
@echo "OBJ_DIR"
|
||||
@echo $(OBJ_DIR)
|
||||
@echo "SIM_OBJ_DIR"
|
||||
@echo $(SIM_OBJ_DIR)
|
||||
@echo "RSC_OBJ_DIR"
|
||||
@echo $(RSC_OBJ_DIR)
|
||||
@echo "LINKER_OUTPUT"
|
||||
@echo $(LINKER_OUTPUT)
|
||||
@echo "SIM_LINKER_OUTPUT"
|
||||
@echo $(SIM_LINKER_OUTPUT)
|
||||
@echo "SIM_GCC_SLIBS"
|
||||
@echo $(SIM_GCC_SLIBS)
|
||||
@echo "SIM_GCC_SLIB_PATHS"
|
||||
@echo $(SIM_GCC_SLIB_PATHS)
|
||||
@echo "VPATH"
|
||||
@echo $(VPATH)
|
||||
|
||||
|
||||
#
|
||||
# dependency generation
|
||||
# Generate dependencies with depend target "make depend"
|
||||
#
|
||||
|
||||
DEPFLAG = -MM
|
||||
|
||||
#
|
||||
# Adds $(SIM_OBJ_DIR) to target .o file
|
||||
# ...Search for string starting at the beginning of the line [^]
|
||||
# ...that contain anything followed by .o [.*\.o]
|
||||
# ...and remember that string [\(...\)]
|
||||
# ...replace that string with $(SIM_OBJ_DIR)/<tagged string> [$$(SIM_OBJ_DIR)/\1]
|
||||
# ($ is doubled so that make doesn't interpret the variable syntax)
|
||||
#
|
||||
SOURCE_SEDSCRIPT = sed -e's%^\(.*\.o\)%$$(OBJ_DIR)/\1%'
|
||||
SOURCE_SIM_SEDSCRIPT = sed -e's%^\(.*\.o\)%$$(SIM_OBJ_DIR)/\1%'
|
||||
|
||||
# Command adds $(RSC_OBJ_DIR) and converts .xrd to .trc
|
||||
RESOURCE_TARGET_SEDSCRIPT = sed -e';s%^\(.*\).xrd%$$(RSC_OBJ_DIR)/\1.trc%'
|
||||
|
||||
# Command to escape spaces in a path
|
||||
ESCAPE_SPACES_SEDSCRIPT = sed 's/ /\\\ /g'
|
||||
|
||||
# Take out all newlines (and/or returns) and replace with spaces
|
||||
# ...putting all dependencies on the same line
|
||||
RESOURCE_PREREQ_SEDSCRIPT = tr '\r\n' ' '
|
||||
|
||||
depend :: FORCE
|
||||
@echo "" > .dependencies
|
||||
@$(SIM_CC) $(SIM_INCLUDES) $(SIM_CFLAGS) $(DEPFLAG) $(SOURCES) | $(SOURCE_SIM_SEDSCRIPT) >> .dependencies
|
||||
@$(SIM_CC) $(SIM_INCLUDES) $(SIM_CFLAGS) $(DEPFLAG) $(SOURCES) | $(SOURCE_SEDSCRIPT) >> .dependencies
|
||||
@for i in $(RESOURCES); do \
|
||||
echo "$$i: \\" | $(RESOURCE_TARGET_SEDSCRIPT) >> .resdependencies; \
|
||||
"$(TOOLS_DIR)PalmRC" -p $(TARGET_FORMAT) $(RFLAGS) -locale $(LOCALE) -makedeps $$i.tmp "`cygpath -w -a ./$$i`"; \
|
||||
cygpath -m -f $$i.tmp | $(ESCAPE_SPACES_SEDSCRIPT) >> $$i.deps; \
|
||||
rm -rf $$i.tmp; \
|
||||
cat $$i.deps | $(RESOURCE_PREREQ_SEDSCRIPT) >> .resdependencies; \
|
||||
echo "" >> .resdependencies; \
|
||||
rm -rf $$i.deps; \
|
||||
cat .resdependencies >> .dependencies; \
|
||||
rm -rf .resdependencies; \
|
||||
done
|
||||
|
||||
|
||||
cleandepend :: FORCE
|
||||
-rm -f .dependencies
|
||||
|
||||
-include .dependencies
|
66
docs/palmos/readme.txt
Normal file
66
docs/palmos/readme.txt
Normal file
@ -0,0 +1,66 @@
|
||||
wxWidgets 2.5.3 CVS 10-18-2004
|
||||
------------------------------
|
||||
|
||||
This is a Palm OS 6 port of the wxWidgets toolkit. Included in the source
|
||||
package is the complete source necessary to build the Palm OS port using the
|
||||
Palm OS Developer Studio. Also included is the diff showing the changes that
|
||||
need to be incorporated into the wxWidgets 2.5.3 CVS source tree before the
|
||||
Palm OS port can be integrated.
|
||||
|
||||
I am releasing this port to the wxWidgets team under the terms of the wxWindows
|
||||
license. A copy of the wxWindows license is included in the source package.
|
||||
|
||||
No third party libraries or code were used in making this port. The port consists
|
||||
entirely of code I personally wrote combined with code that was included in the
|
||||
wxWidgets 2.5.3 CSV source tree. Whenever possible, I have used the Palm OS 6 API,
|
||||
in places where the API was not practical to use, I wrote my own functions.
|
||||
|
||||
I am submitting this source package as an entry in the wxWidgets Palm OS 6 port
|
||||
challenge. Details on this challenge are available at http://www.wxwindows.org/palmos.htm
|
||||
|
||||
Please note that this port is in a very early state. Currently the port
|
||||
provides limited functionality for the wxFrame, wxMenu, wxStatusBar,
|
||||
wxTopLevelWindow, and wxWindow classes. The other classes in the wxWidgets
|
||||
toolkit still need to be ported. In it's current state, the Palm OS 6 port
|
||||
is capable of running the minimal wxWidgets sample
|
||||
|
||||
The easiest way to see the port in action is to build the source package with
|
||||
the Palm OS Developer Studio available at http://www.palmos.com/dev/dl/dl_tools/dl_pods/
|
||||
Here are the steps that you need to follow to build the package:
|
||||
|
||||
1) Unpack the ZIP file into a directory located within the Palm OS Developer
|
||||
Studio workspace directory. The path to the folder should look something
|
||||
like this: "C:\Program Files\PalmSource\Palm OS Developer Suite\workspace\wxWidgets"
|
||||
|
||||
2) Open Palm OS Developer Studio and click on File->Import.
|
||||
|
||||
3) Select "Existing Project into Workspace" as the import source and click Next.
|
||||
|
||||
4) On the next screen click the Browse button next to Project contents and select
|
||||
the folder you unpacked the source package into. Click on Finish to continue.
|
||||
|
||||
5) You should now see the project listed in the Project pane on the right side of the
|
||||
window. Click on the name of the project. Now click on the Project menu and select
|
||||
"Rebuild Project"
|
||||
|
||||
6) After the build is complete, click on the Run menu and select "" The Palm OS 6 simulator
|
||||
should start. If this is the first time you have used the simulator, you will be prompted
|
||||
to choose a ROM file. You can find the ROM files in a folder like "C:\Program
|
||||
Files\PalmSource\Palm OS Developer Suite\sdk-6\tools\Simulator\6.0.1\ROM" It doesn't
|
||||
really matter whether you choose a Release or a Debug ROM (the debug ROM generates extra
|
||||
reports when an application crashes.)
|
||||
|
||||
7) You should see the Palm logo appear in the simulator window. You may get a dialog box
|
||||
asking you to choose a language. Click OK to continue. You should see the simulator
|
||||
initialize the built-in Palm applications. After a few moments, the wxWidgets minimal
|
||||
sample should start. Have fun!
|
||||
|
||||
Since this source package was based on the wxWidgets 2.5.3 CVS source tree dated October 18,
|
||||
2004 I don't anticipate any problems with merging the sources into the 2.5.3 source tree.
|
||||
|
||||
If you have any questions or comments about the port, please feel free to send an email to
|
||||
the wxWidgets developer list or directly to me at wbo@freeshell.org
|
||||
|
||||
Enjoy!
|
||||
William Osborne
|
||||
wbo@freeshell.org
|
@ -561,7 +561,9 @@ protected:
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_GUI
|
||||
#if defined(__WXMSW__)
|
||||
#if defined(__PALMOS__)
|
||||
#include "wx/palmos/app.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/app.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/app.h"
|
||||
|
@ -134,7 +134,9 @@ public:
|
||||
|
||||
// NB: test for __UNIX__ before __WXMAC__ as under Darwin we want to use the
|
||||
// Unix code (and otherwise __UNIX__ wouldn't be defined)
|
||||
#if defined(__WXMSW__)
|
||||
#if defined(__PALMOS__)
|
||||
#include "wx/palmos/apptbase.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/apptbase.h"
|
||||
#elif defined(__UNIX__) && !defined(__EMX__)
|
||||
#include "wx/unix/apptbase.h"
|
||||
@ -217,7 +219,9 @@ public:
|
||||
// include the platform-specific version of the classes above
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#if defined(__PALMOS__)
|
||||
#include "wx/palmos/apptrait.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/apptrait.h"
|
||||
#elif defined(__UNIX__) && !defined(__EMX__)
|
||||
#include "wx/unix/apptrait.h"
|
||||
|
@ -163,7 +163,9 @@ protected:
|
||||
};
|
||||
#endif
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#if defined(__PALMOS__)
|
||||
#include "wx/palmos/bitmap.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/bitmap.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/x11/bitmap.h"
|
||||
|
@ -1,7 +1,9 @@
|
||||
#ifndef _WX_BRUSH_H_BASE_
|
||||
#define _WX_BRUSH_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#if defined(__PALMOS__)
|
||||
#include "wx/palmos/brush.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/brush.h"
|
||||
#elif defined(__WXMOTIF__) || defined(__WXX11__)
|
||||
#include "wx/x11/brush.h"
|
||||
|
@ -15,7 +15,9 @@
|
||||
Compiler-specific checking.
|
||||
*/
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#if defined(__PALMOS__)
|
||||
# include "wx/palmos/chkconf.h"
|
||||
#elif defined(__WXMSW__)
|
||||
# include "wx/msw/chkconf.h"
|
||||
#elif defined(__WXMAC__)
|
||||
# include "wx/mac/chkconf.h"
|
||||
|
@ -1,7 +1,9 @@
|
||||
#ifndef _WX_COLOUR_H_BASE_
|
||||
#define _WX_COLOUR_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#if defined(__PALMOS__)
|
||||
#include "wx/palmos/colour.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/colour.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/colour.h"
|
||||
|
@ -100,6 +100,8 @@ protected:
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/control.h"
|
||||
#elif defined(__PALMOS__)
|
||||
#include "wx/palmos/control.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/control.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
|
@ -1,7 +1,9 @@
|
||||
#ifndef _WX_CURSOR_H_BASE_
|
||||
#define _WX_CURSOR_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#if defined(__PALMOS__)
|
||||
#include "wx/palmos/cursor.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/cursor.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/cursor.h"
|
||||
|
@ -786,7 +786,9 @@ private:
|
||||
// now include the declaration of wxDC class
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#if defined(__PALMOS__)
|
||||
#include "wx/palmos/dc.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/dc.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/dc.h"
|
||||
|
@ -1,7 +1,9 @@
|
||||
#ifndef _WX_DCCLIENT_H_BASE_
|
||||
#define _WX_DCCLIENT_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#if defined(__PALMOS__)
|
||||
#include "wx/palmos/dcclient.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/dcclient.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/dcclient.h"
|
||||
|
@ -1,7 +1,9 @@
|
||||
#ifndef _WX_DCMEMORY_H_BASE_
|
||||
#define _WX_DCMEMORY_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#if defined(__PALMOS__)
|
||||
#include "wx/palmos/dcmemory.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/dcmemory.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/dcmemory.h"
|
||||
|
@ -1,7 +1,9 @@
|
||||
#ifndef _WX_DCPRINT_H_BASE_
|
||||
#define _WX_DCPRINT_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#if defined(__PALMOS__)
|
||||
#include "wx/palmos/dcprint.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/dcprint.h"
|
||||
#endif
|
||||
#if defined(__WXPM__)
|
||||
|
@ -1,7 +1,9 @@
|
||||
#ifndef _WX_DCSCREEN_H_BASE_
|
||||
#define _WX_DCSCREEN_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#if defined(__PALMOS__)
|
||||
#include "wx/palmos/dcscreen.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/dcscreen.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/dcscreen.h"
|
||||
|
@ -71,7 +71,9 @@ protected:
|
||||
#if defined(__WXUNIVERSAL__) && !defined(__WXMICROWIN__)
|
||||
#include "wx/univ/dialog.h"
|
||||
#else
|
||||
#if defined(__WXMSW__)
|
||||
#if defined(__PALMOS__)
|
||||
#include "wx/palmos/dialog.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/dialog.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/dialog.h"
|
||||
|
@ -35,6 +35,7 @@
|
||||
struct WXDLLEXPORT wxNativeEncodingInfo
|
||||
{
|
||||
wxString facename; // may be empty meaning "any"
|
||||
#ifndef __PALMOS__
|
||||
wxFontEncoding encoding; // so that we know what this struct represents
|
||||
|
||||
#if defined(__WXMSW__) || \
|
||||
@ -60,7 +61,7 @@ struct WXDLLEXPORT wxNativeEncodingInfo
|
||||
#else
|
||||
#error "Unsupported toolkit"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// this struct is saved in config by wxFontMapper, so it should know to
|
||||
// serialise itself (implemented in platform-specific code)
|
||||
bool FromString(const wxString& s);
|
||||
|
@ -72,7 +72,9 @@ protected:
|
||||
// can sometimes be very useful (e.g. under MSW this is necessary for
|
||||
// integration with MFC) but currently this is done for MSW only, other ports
|
||||
// should follow a.s.a.p.
|
||||
#ifdef __WXMSW__
|
||||
#if defined(__PALMOS__)
|
||||
#include "wx/palmos/evtloop.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/evtloop.h"
|
||||
#else
|
||||
|
||||
|
@ -174,7 +174,9 @@ enum wxSeekMode
|
||||
|
||||
// detect compilers which have support for huge files (currently only
|
||||
// Digital Mars doesn't)
|
||||
#ifndef __PALMOS__
|
||||
#include "wx/msw/private.h"
|
||||
#endif
|
||||
|
||||
#undef wxHAS_HUGE_FILES
|
||||
#if defined(__MINGW32__)
|
||||
@ -300,7 +302,7 @@ enum wxSeekMode
|
||||
#endif
|
||||
|
||||
// constants (unless already defined by the user code)
|
||||
#if !defined(__BORLANDC__) && !defined(__WATCOMC__)
|
||||
#if !defined(__BORLANDC__) && !defined(__WATCOMC__) && !defined(__PALMOS__)
|
||||
#ifndef O_RDONLY
|
||||
#define O_RDONLY _O_RDONLY
|
||||
#define O_WRONLY _O_WRONLY
|
||||
|
@ -231,7 +231,9 @@ private:
|
||||
};
|
||||
|
||||
// include the real class declaration
|
||||
#if defined(__WXMSW__)
|
||||
#if defined(__PALMOS__)
|
||||
#include "wx/palmos/font.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/font.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/font.h"
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
#include "wx/font.h" // for wxFont and wxFontEncoding
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#if defined(__WXMSW__) && !defined(__PALMOS__)
|
||||
#include "wx/msw/wrapwin.h"
|
||||
#endif
|
||||
|
||||
@ -109,7 +109,7 @@ public:
|
||||
|
||||
// set the XFLD
|
||||
void SetXFontName(const wxString& xFontName);
|
||||
#elif defined(__WXMSW__)
|
||||
#elif defined(__WXMSW__) && !defined(__PALMOS__)
|
||||
LOGFONT lf;
|
||||
#elif defined(__WXPM__)
|
||||
// OS/2 native structures that define a font
|
||||
|
@ -250,7 +250,9 @@ protected:
|
||||
#if defined(__WXUNIVERSAL__) // && !defined(__WXMICROWIN__)
|
||||
#include "wx/univ/frame.h"
|
||||
#else // !__WXUNIVERSAL__
|
||||
#if defined(__WXMSW__)
|
||||
#if defined(__PALMOS__)
|
||||
#include "wx/palmos/frame.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/frame.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/frame.h"
|
||||
|
@ -1,7 +1,9 @@
|
||||
#ifndef _WX_GDIOBJ_H_BASE_
|
||||
#define _WX_GDIOBJ_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#if defined(__PALMOS__)
|
||||
#include "wx/palmos/gdiobj.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/gdiobj.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/gdiobj.h"
|
||||
|
@ -9,6 +9,10 @@
|
||||
#include "wx/msw/wince/helpwce.h"
|
||||
|
||||
#define wxHelpController wxWinceHelpController
|
||||
#elif defined(__PALMOS__)
|
||||
#include "wx/palmos/help.h"
|
||||
|
||||
#define wxHelpController wxPalmHelpController
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/helpwin.h"
|
||||
|
||||
|
@ -3,7 +3,9 @@
|
||||
|
||||
#include "wx/iconloc.h"
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#if defined(__PALMOS__)
|
||||
#include "wx/palmos/icon.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/icon.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/icon.h"
|
||||
|
@ -498,6 +498,8 @@ protected:
|
||||
#else // !wxUSE_BASE_CLASSES_ONLY
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/menu.h"
|
||||
#elif defined(__PALMOS__)
|
||||
#include "wx/palmos/menu.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/menu.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
|
@ -155,6 +155,8 @@ private:
|
||||
#else // !wxUSE_BASE_CLASSES_ONLY
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/menuitem.h"
|
||||
#elif defined(__PALMOS__)
|
||||
#include "wx/palmos/menuitem.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/menuitem.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
|
@ -21,7 +21,11 @@
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#if wxUSE_ENH_METAFILE
|
||||
#if defined(__PALMOS__)
|
||||
#include "wx/palmos/enhmeta.h"
|
||||
#else
|
||||
#include "wx/msw/enhmeta.h"
|
||||
#endif
|
||||
|
||||
// map all metafile classes to enh metafile
|
||||
#if !wxUSE_WIN_METAFILES_ALWAYS
|
||||
@ -34,8 +38,12 @@
|
||||
#define wxMETAFILE_IS_ENH
|
||||
#endif // wxUSE_WIN_METAFILES_ALWAYS
|
||||
#else // !wxUSE_ENH_METAFILE
|
||||
#if defined(__PALMOS__)
|
||||
#include "wx/palmos/metafile.h"
|
||||
#else
|
||||
#include "wx/msw/metafile.h"
|
||||
#endif
|
||||
#endif
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/metafile.h"
|
||||
#elif defined(__WXMAC__)
|
||||
|
@ -1,7 +1,9 @@
|
||||
#ifndef _WX_MINIFRAM_H_BASE_
|
||||
#define _WX_MINIFRAMH_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#if defined(__PALMOS__)
|
||||
#include "wx/palmos/minifram.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/minifram.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/minifram.h"
|
||||
|
@ -7,6 +7,8 @@
|
||||
|
||||
#if defined(__WXUNIVERSAL__) || defined(__WXGPE__)
|
||||
#include "wx/generic/msgdlgg.h"
|
||||
#elif defined(__PALMOS__)
|
||||
#include "wx/palmos/msgdlg.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/msgdlg.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
|
94
include/wx/palmos/AppResources.h
Normal file
94
include/wx/palmos/AppResources.h
Normal file
@ -0,0 +1,94 @@
|
||||
// Header generated by Constructor for Palm OS (R) 1.9
|
||||
//
|
||||
// Generated at 3:29:52 PM on Tuesday, June 24, 2003
|
||||
//
|
||||
// Generated for file: BasicApp.xrd
|
||||
//
|
||||
// THIS IS AN AUTOMATICALLY GENERATED HEADER FILE
|
||||
// DO NOT EDIT - CHANGES MADE TO THIS FILE WILL BE LOST
|
||||
//
|
||||
// Palm App Name: "BasicApp"
|
||||
//
|
||||
// Palm App Version: "1.0a1"
|
||||
|
||||
|
||||
// Resource: tFRM 1000
|
||||
#define MainForm 1000 //(Left Origin = 0, Top Origin = 0, Width = 160, Height = 160, Usable = 1, Modal = 0, Save Behind = 0, Help ID = 0, Menu Bar ID = 1000, Default Button ID = 0)
|
||||
#define MainContentLabel 1603 //(Left Origin = 32, Top Origin = 50, Usable = 1, Font = Bold)
|
||||
#define MainForm2Button 1001 //(Left Origin = 1, Top Origin = 147, Width = 39, Height = 12, Usable = 1, Anchor Left = 1, Frame = 1, Non-bold Frame = 1, Font = Standard)
|
||||
#define MainDialogButton 1002 //(Left Origin = 46, Top Origin = 147, Width = 39, Height = 12, Usable = 1, Anchor Left = 1, Frame = 1, Non-bold Frame = 1, Font = Standard)
|
||||
|
||||
// Resource: tFRM 1200
|
||||
#define DialogForm 1200 //(Left Origin = 2, Top Origin = 58, Width = 156, Height = 100, Usable = 1, Modal = 1, Save Behind = 1, Help ID = 1200, Menu Bar ID = 0, Default Button ID = 1202)
|
||||
#define DialogOKButton 1201 //(Left Origin = 5, Top Origin = 83, Width = 36, Height = 12, Usable = 1, Anchor Left = 1, Frame = 1, Non-bold Frame = 1, Font = Standard)
|
||||
#define DialogCancelButton 1202 //(Left Origin = 47, Top Origin = 83, Width = 36, Height = 12, Usable = 1, Anchor Left = 1, Frame = 1, Non-bold Frame = 1, Font = Standard)
|
||||
#define DialogContentLabel 1203 //(Left Origin = 10, Top Origin = 23, Usable = 1, Font = Bold)
|
||||
|
||||
// Resource: tFRM 1300
|
||||
#define Form2Form 1300 //(Left Origin = 0, Top Origin = 0, Width = 160, Height = 160, Usable = 1, Modal = 0, Save Behind = 0, Help ID = 0, Menu Bar ID = 0, Default Button ID = 0)
|
||||
#define Form2DoneButton 1301 //(Left Origin = 1, Top Origin = 147, Width = 36, Height = 12, Usable = 1, Anchor Left = 1, Frame = 1, Non-bold Frame = 1, Font = Standard)
|
||||
|
||||
// Resource: tFRM 2000
|
||||
#define AboutForm 2000 //(Left Origin = 2, Top Origin = 2, Width = 156, Height = 156, Usable = 1, Modal = 1, Save Behind = 1, Help ID = 0, Menu Bar ID = 0, Default Button ID = 0)
|
||||
#define AboutTitleLabel 2002 //(Left Origin = 54, Top Origin = 25, Usable = 1, Font = Bold 12)
|
||||
#define AboutText1Label 2003 //(Left Origin = 23, Top Origin = 54, Usable = 1, Font = Standard)
|
||||
#define AboutText2Label 2004 //(Left Origin = 50, Top Origin = 104, Usable = 1, Font = Bold)
|
||||
#define AboutOKButton 2005 //(Left Origin = 58, Top Origin = 139, Width = 40, Height = 12, Usable = 1, Anchor Left = 1, Frame = 1, Non-bold Frame = 1, Font = Standard)
|
||||
|
||||
|
||||
// Resource: MBAR 1000
|
||||
#define MainFormMenuBar 1000
|
||||
|
||||
|
||||
// Resource: MENU 1000
|
||||
#define MainOptionsMenu 1000
|
||||
#define MainOptionsAboutBasicApp 1000
|
||||
|
||||
|
||||
// Resource: tSTR 1200
|
||||
#define HelpID1200String 1200 // "Placeholder text for the modal dialog Tips button."
|
||||
|
||||
|
||||
// Resource: PICT 1000
|
||||
#define Largeicon1bitBitmap 1000
|
||||
|
||||
// Resource: PICT 1001
|
||||
#define Largeicon2bitBitmap 1001
|
||||
|
||||
// Resource: PICT 1002
|
||||
#define Largeicon8bitBitmap 1002
|
||||
|
||||
// Resource: PICT 1003
|
||||
#define LargeiconX21bitBitmap 1003
|
||||
|
||||
// Resource: PICT 1004
|
||||
#define LargeiconX22bitBitmap 1004
|
||||
|
||||
// Resource: PICT 1005
|
||||
#define LargeiconX28bitBitmap 1005
|
||||
|
||||
// Resource: PICT 1006
|
||||
#define Smallicon1bitBitmap 1006
|
||||
|
||||
// Resource: PICT 1007
|
||||
#define Smallicon2bitBitmap 1007
|
||||
|
||||
// Resource: PICT 1008
|
||||
#define Smallicon8bitBitmap 1008
|
||||
|
||||
// Resource: PICT 1009
|
||||
#define SmalliconX21bitBitmap 1009
|
||||
|
||||
// Resource: PICT 1010
|
||||
#define SmalliconX22bitBitmap 1010
|
||||
|
||||
// Resource: PICT 1011
|
||||
#define SmalliconX28bitBitmap 1011
|
||||
|
||||
|
||||
// Resource: taif 1000
|
||||
#define Largeicons12and8bitsAppIconFamily 1000
|
||||
|
||||
// Resource: taif 1001
|
||||
#define Smallicons12and8bitsAppIconFamily 1001
|
||||
|
BIN
include/wx/palmos/Icons/AppIcon_Large-X2-8.bmp
Normal file
BIN
include/wx/palmos/Icons/AppIcon_Large-X2-8.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
BIN
include/wx/palmos/Icons/AppIcon_Small-X2-8.bmp
Normal file
BIN
include/wx/palmos/Icons/AppIcon_Small-X2-8.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
9
include/wx/palmos/Version.xrd
Normal file
9
include/wx/palmos/Version.xrd
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
|
||||
<PALMOS_RESOURCE_FILE>
|
||||
|
||||
<APP_VERSION_RESOURCE RESOURCE_ID="1000">
|
||||
<TEXT> "1.0" </TEXT>
|
||||
</APP_VERSION_RESOURCE>
|
||||
|
||||
</PALMOS_RESOURCE_FILE>
|
58
include/wx/palmos/accel.h
Normal file
58
include/wx/palmos/accel.h
Normal file
@ -0,0 +1,58 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/accel.h
|
||||
// Purpose: wxAcceleratorTable class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_ACCEL_H_
|
||||
#define _WX_ACCEL_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "accel.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// the accel table has all accelerators for a given window or menu
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxAcceleratorTable : public wxObject
|
||||
{
|
||||
public:
|
||||
// default ctor
|
||||
wxAcceleratorTable();
|
||||
|
||||
// copy ctor
|
||||
wxAcceleratorTable(const wxAcceleratorTable& accel) { Ref(accel); }
|
||||
|
||||
// load from .rc resource (Windows specific)
|
||||
wxAcceleratorTable(const wxString& resource);
|
||||
|
||||
// initialize from array
|
||||
wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]);
|
||||
|
||||
virtual ~wxAcceleratorTable();
|
||||
|
||||
wxAcceleratorTable& operator = (const wxAcceleratorTable& accel) { if ( *this != accel ) Ref(accel); return *this; }
|
||||
bool operator==(const wxAcceleratorTable& accel) const
|
||||
{ return m_refData == accel.m_refData; } // FIXME: this is wrong (VZ)
|
||||
bool operator!=(const wxAcceleratorTable& accel) const
|
||||
{ return !(*this == accel); }
|
||||
|
||||
bool Ok() const;
|
||||
void SetHACCEL(WXHACCEL hAccel);
|
||||
WXHACCEL GetHACCEL() const;
|
||||
|
||||
// translate the accelerator, return TRUE if done
|
||||
bool Translate(wxWindow *window, WXMSG *msg) const;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxAcceleratorTable)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_ACCEL_H_
|
117
include/wx/palmos/app.h
Normal file
117
include/wx/palmos/app.h
Normal file
@ -0,0 +1,117 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: app.h
|
||||
// Purpose: wxApp class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/17/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_APP_H_
|
||||
#define _WX_APP_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "app.h"
|
||||
#endif
|
||||
|
||||
#include "wx/event.h"
|
||||
#include "wx/icon.h"
|
||||
|
||||
class WXDLLIMPEXP_CORE wxFrame;
|
||||
class WXDLLIMPEXP_CORE wxWindow;
|
||||
class WXDLLIMPEXP_CORE wxApp;
|
||||
class WXDLLIMPEXP_CORE wxKeyEvent;
|
||||
class WXDLLIMPEXP_BASE wxLog;
|
||||
|
||||
// Represents the application. Derive OnInit and declare
|
||||
// a new App object to start application
|
||||
class WXDLLEXPORT wxApp : public wxAppBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxApp)
|
||||
|
||||
public:
|
||||
wxApp();
|
||||
virtual ~wxApp();
|
||||
|
||||
// override base class (pure) virtuals
|
||||
virtual bool Initialize(int& argc, wxChar **argv);
|
||||
virtual void CleanUp();
|
||||
|
||||
virtual bool Yield(bool onlyIfNeeded = false);
|
||||
virtual void WakeUpIdle();
|
||||
|
||||
virtual void SetPrintMode(int mode) { m_printMode = mode; }
|
||||
virtual int GetPrintMode() const { return m_printMode; }
|
||||
|
||||
// implementation only
|
||||
void OnIdle(wxIdleEvent& event);
|
||||
void OnEndSession(wxCloseEvent& event);
|
||||
void OnQueryEndSession(wxCloseEvent& event);
|
||||
|
||||
#if wxUSE_EXCEPTIONS
|
||||
virtual bool OnExceptionInMainLoop();
|
||||
#endif // wxUSE_EXCEPTIONS
|
||||
|
||||
// deprecated functions, use wxEventLoop directly instead
|
||||
#if WXWIN_COMPATIBILITY_2_4
|
||||
wxDEPRECATED( void DoMessage(WXMSG *pMsg) );
|
||||
wxDEPRECATED( bool DoMessage() );
|
||||
wxDEPRECATED( bool ProcessMessage(WXMSG* pMsg) );
|
||||
#endif // WXWIN_COMPATIBILITY_2_4
|
||||
|
||||
protected:
|
||||
int m_printMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
|
||||
|
||||
public:
|
||||
// Implementation
|
||||
static bool RegisterWindowClasses();
|
||||
static bool UnregisterWindowClasses();
|
||||
|
||||
#if wxUSE_RICHEDIT
|
||||
// initialize the richedit DLL of (at least) given version, return true if
|
||||
// ok (Win95 has version 1, Win98/NT4 has 1 and 2, W2K has 3)
|
||||
static bool InitRichEdit(int version = 2);
|
||||
#endif // wxUSE_RICHEDIT
|
||||
|
||||
// returns 400, 470, 471 for comctl32.dll 4.00, 4.70, 4.71 or 0 if it
|
||||
// wasn't found at all
|
||||
static int GetComCtl32Version();
|
||||
|
||||
// the SW_XXX value to be used for the frames opened by the application
|
||||
// (currently seems unused which is a bug -- TODO)
|
||||
static int m_nCmdShow;
|
||||
|
||||
protected:
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_NO_COPY_CLASS(wxApp)
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Palm OS specific wxEntry() overload and IMPLEMENT_WXWIN_MAIN definition
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifndef SW_SHOWNORMAL
|
||||
#define SW_SHOWNORMAL 1
|
||||
#endif
|
||||
|
||||
extern int WXDLLEXPORT
|
||||
wxEntry();
|
||||
|
||||
#include <PalmOS.h>
|
||||
#define IMPLEMENT_WXWIN_MAIN \
|
||||
uint32_t PilotMain(uint16_t cmd, MemPtr cmdPBP, uint16_t launchFlags) \
|
||||
{ \
|
||||
switch (cmd) { \
|
||||
case sysAppLaunchCmdNormalLaunch: \
|
||||
wxEntry(); \
|
||||
break; \
|
||||
default: \
|
||||
break; \
|
||||
} \
|
||||
return errNone; \
|
||||
}
|
||||
|
||||
#endif // _WX_APP_H_
|
||||
|
54
include/wx/palmos/apptbase.h
Normal file
54
include/wx/palmos/apptbase.h
Normal file
@ -0,0 +1,54 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/apptbase.h
|
||||
// Purpose: declaration of wxAppTraits for Palm OS
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_PALMOS_APPTBASE_H_
|
||||
#define _WX_PALMOS_APPTBASE_H_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxAppTraits: the MSW version adds extra hooks needed by MSW-only code
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_BASE wxAppTraits : public wxAppTraitsBase
|
||||
{
|
||||
public:
|
||||
// wxExecute() support methods
|
||||
// ---------------------------
|
||||
|
||||
// called before starting to wait for the child termination, may return
|
||||
// some opaque data which will be passed later to AfterChildWaitLoop()
|
||||
virtual void *BeforeChildWaitLoop() = 0;
|
||||
|
||||
// process pending Windows messages, even in console app
|
||||
virtual void AlwaysYield() = 0;
|
||||
|
||||
// called after starting to wait for the child termination, the parameter
|
||||
// is the return value of BeforeChildWaitLoop()
|
||||
virtual void AfterChildWaitLoop(void *data) = 0;
|
||||
|
||||
|
||||
// wxThread helpers
|
||||
// ----------------
|
||||
|
||||
// process a message while waiting for a(nother) thread, should return
|
||||
// false if and only if we have to exit the application
|
||||
virtual bool DoMessageFromThreadWait() = 0;
|
||||
|
||||
// other miscellaneous helpers
|
||||
// ---------------------------
|
||||
|
||||
// under MSW this function returns same version for both console and GUI
|
||||
// applications so we can implement it directly in the base class and only
|
||||
// override it wxGUIAppTraits to fill in toolkit information
|
||||
virtual wxToolkitInfo& GetToolkitInfo();
|
||||
};
|
||||
|
||||
#endif // _WX_PALMOS_APPTBASE_H_
|
||||
|
45
include/wx/palmos/apptrait.h
Normal file
45
include/wx/palmos/apptrait.h
Normal file
@ -0,0 +1,45 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/apptrait.h
|
||||
// Purpose: class implementing wxAppTraits for Palm OS
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_MSW_APPTRAIT_H_
|
||||
#define _WX_MSW_APPTRAIT_H_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGUI/ConsoleAppTraits: must derive from wxAppTraits, not wxAppTraitsBase
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_BASE wxConsoleAppTraits : public wxConsoleAppTraitsBase
|
||||
{
|
||||
public:
|
||||
virtual void *BeforeChildWaitLoop();
|
||||
virtual void AlwaysYield();
|
||||
virtual void AfterChildWaitLoop(void *data);
|
||||
|
||||
virtual bool DoMessageFromThreadWait();
|
||||
};
|
||||
|
||||
#if wxUSE_GUI
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGUIAppTraits : public wxGUIAppTraitsBase
|
||||
{
|
||||
public:
|
||||
virtual void *BeforeChildWaitLoop();
|
||||
virtual void AlwaysYield();
|
||||
virtual void AfterChildWaitLoop(void *data);
|
||||
|
||||
virtual bool DoMessageFromThreadWait();
|
||||
virtual wxToolkitInfo& GetToolkitInfo();
|
||||
};
|
||||
|
||||
#endif // wxUSE_GUI
|
||||
|
||||
#endif // _WX_MSW_APPTRAIT_H_
|
||||
|
293
include/wx/palmos/bitmap.h
Normal file
293
include/wx/palmos/bitmap.h
Normal file
@ -0,0 +1,293 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/bitmap.h
|
||||
// Purpose: wxBitmap class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_BITMAP_H_
|
||||
#define _WX_BITMAP_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "bitmap.h"
|
||||
#endif
|
||||
|
||||
#include "wx/palmos/gdiimage.h"
|
||||
#include "wx/gdicmn.h"
|
||||
#include "wx/palette.h"
|
||||
|
||||
class WXDLLEXPORT wxBitmap;
|
||||
class WXDLLEXPORT wxBitmapHandler;
|
||||
class WXDLLEXPORT wxBitmapRefData;
|
||||
class WXDLLEXPORT wxControl;
|
||||
class WXDLLEXPORT wxCursor;
|
||||
class WXDLLEXPORT wxDC;
|
||||
#if wxUSE_WXDIB
|
||||
class WXDLLEXPORT wxDIB;
|
||||
#endif
|
||||
class WXDLLEXPORT wxIcon;
|
||||
class WXDLLEXPORT wxImage;
|
||||
class WXDLLEXPORT wxMask;
|
||||
class WXDLLEXPORT wxPalette;
|
||||
class WXDLLEXPORT wxPixelDataBase;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxBitmap: a mono or colour bitmap
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxBitmap : public wxGDIImage
|
||||
{
|
||||
public:
|
||||
// default ctor creates an invalid bitmap, you must Create() it later
|
||||
wxBitmap() { Init(); }
|
||||
|
||||
// Copy constructors
|
||||
wxBitmap(const wxBitmap& bitmap) { Init(); Ref(bitmap); }
|
||||
|
||||
// Initialize with raw data
|
||||
wxBitmap(const char bits[], int width, int height, int depth = 1);
|
||||
|
||||
// Initialize with XPM data
|
||||
wxBitmap(const char **data) { CreateFromXpm(data); }
|
||||
wxBitmap(char **data) { CreateFromXpm((const char **)data); }
|
||||
|
||||
// Load a file or resource
|
||||
wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_BMP_RESOURCE);
|
||||
|
||||
// New constructor for generalised creation from data
|
||||
wxBitmap(void *data, long type, int width, int height, int depth = 1);
|
||||
|
||||
// Create a new, uninitialized bitmap of the given size and depth (if it
|
||||
// is omitted, will create a bitmap compatible with the display)
|
||||
//
|
||||
// NB: this ctor will create a DIB for 24 and 32bpp bitmaps, use ctor
|
||||
// taking a DC argument if you want to force using DDB in this case
|
||||
wxBitmap(int width, int height, int depth = -1);
|
||||
|
||||
// Create a bitmap compatible with the given DC
|
||||
wxBitmap(int width, int height, const wxDC& dc);
|
||||
|
||||
#if wxUSE_IMAGE && wxUSE_WXDIB
|
||||
// Convert from wxImage
|
||||
wxBitmap(const wxImage& image, int depth = -1)
|
||||
{ (void)CreateFromImage(image, depth); }
|
||||
|
||||
// Create a DDB compatible with the given DC from wxImage
|
||||
wxBitmap(const wxImage& image, const wxDC& dc)
|
||||
{ (void)CreateFromImage(image, dc); }
|
||||
#endif // wxUSE_IMAGE
|
||||
|
||||
// we must have this, otherwise icons are silently copied into bitmaps using
|
||||
// the copy ctor but the resulting bitmap is invalid!
|
||||
wxBitmap(const wxIcon& icon) { Init(); CopyFromIcon(icon); }
|
||||
|
||||
wxBitmap& operator=(const wxBitmap& bitmap)
|
||||
{
|
||||
if ( m_refData != bitmap.m_refData )
|
||||
Ref(bitmap);
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxBitmap& operator=(const wxIcon& icon)
|
||||
{
|
||||
(void)CopyFromIcon(icon);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxBitmap& operator=(const wxCursor& cursor)
|
||||
{
|
||||
(void)CopyFromCursor(cursor);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
virtual ~wxBitmap();
|
||||
|
||||
#if wxUSE_IMAGE && wxUSE_WXDIB
|
||||
wxImage ConvertToImage() const;
|
||||
#endif // wxUSE_IMAGE
|
||||
|
||||
// get the given part of bitmap
|
||||
wxBitmap GetSubBitmap( const wxRect& rect ) const;
|
||||
|
||||
// copies the contents and mask of the given (colour) icon to the bitmap
|
||||
bool CopyFromIcon(const wxIcon& icon);
|
||||
|
||||
// copies the contents and mask of the given cursor to the bitmap
|
||||
bool CopyFromCursor(const wxCursor& cursor);
|
||||
|
||||
#if wxUSE_WXDIB
|
||||
// copies from a device independent bitmap
|
||||
bool CopyFromDIB(const wxDIB& dib);
|
||||
#endif
|
||||
|
||||
virtual bool Create(int width, int height, int depth = -1);
|
||||
virtual bool Create(int width, int height, const wxDC& dc);
|
||||
virtual bool Create(void *data, long type, int width, int height, int depth = 1);
|
||||
virtual bool LoadFile(const wxString& name, long type = wxBITMAP_TYPE_BMP_RESOURCE);
|
||||
virtual bool SaveFile(const wxString& name, int type, const wxPalette *cmap = NULL);
|
||||
|
||||
wxBitmapRefData *GetBitmapData() const
|
||||
{ return (wxBitmapRefData *)m_refData; }
|
||||
|
||||
// raw bitmap access support functions
|
||||
void *GetRawData(wxPixelDataBase& data, int bpp);
|
||||
void UngetRawData(wxPixelDataBase& data);
|
||||
|
||||
#if wxUSE_PALETTE
|
||||
wxPalette* GetPalette() const;
|
||||
void SetPalette(const wxPalette& palette);
|
||||
#endif // wxUSE_PALETTE
|
||||
|
||||
wxMask *GetMask() const;
|
||||
void SetMask(wxMask *mask);
|
||||
|
||||
bool operator==(const wxBitmap& bitmap) const { return m_refData == bitmap.m_refData; }
|
||||
bool operator!=(const wxBitmap& bitmap) const { return m_refData != bitmap.m_refData; }
|
||||
|
||||
// these functions are internal and shouldn't be used, they risk to
|
||||
// disappear in the future
|
||||
bool HasAlpha() const;
|
||||
void UseAlpha();
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2_4
|
||||
// these functions do nothing and are only there for backwards
|
||||
// compatibility
|
||||
wxDEPRECATED( int GetQuality() const );
|
||||
wxDEPRECATED( void SetQuality(int quality) );
|
||||
#endif // WXWIN_COMPATIBILITY_2_4
|
||||
|
||||
// implementation only from now on
|
||||
// -------------------------------
|
||||
|
||||
public:
|
||||
void SetHBITMAP(WXHBITMAP bmp) { SetHandle((WXHANDLE)bmp); }
|
||||
WXHBITMAP GetHBITMAP() const { return (WXHBITMAP)GetHandle(); }
|
||||
|
||||
#ifdef __WXDEBUG__
|
||||
void SetSelectedInto(wxDC *dc);
|
||||
wxDC *GetSelectedInto() const;
|
||||
#endif // __WXDEBUG__
|
||||
|
||||
protected:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
virtual wxGDIImageRefData *CreateData() const;
|
||||
|
||||
// creates the bitmap from XPM data, supposed to be called from ctor
|
||||
bool CreateFromXpm(const char **bits);
|
||||
|
||||
// creates an uninitialized bitmap, called from Create()s above
|
||||
bool DoCreate(int w, int h, int depth, WXHDC hdc);
|
||||
|
||||
#if wxUSE_IMAGE && wxUSE_WXDIB
|
||||
// creates the bitmap from wxImage, supposed to be called from ctor
|
||||
bool CreateFromImage(const wxImage& image, int depth);
|
||||
|
||||
// creates a DDB from wxImage, supposed to be called from ctor
|
||||
bool CreateFromImage(const wxImage& image, const wxDC& dc);
|
||||
|
||||
// common part of the 2 methods above (hdc may be 0)
|
||||
bool CreateFromImage(const wxImage& image, int depth, WXHDC hdc);
|
||||
#endif // wxUSE_IMAGE
|
||||
|
||||
private:
|
||||
#ifdef __WIN32__
|
||||
// common part of CopyFromIcon/CopyFromCursor for Win32
|
||||
bool CopyFromIconOrCursor(const wxGDIImage& icon);
|
||||
#endif // __WIN32__
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxBitmap)
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxMask: a mono bitmap used for drawing bitmaps transparently.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxMask : public wxObject
|
||||
{
|
||||
public:
|
||||
wxMask();
|
||||
|
||||
// Construct a mask from a bitmap and a colour indicating the transparent
|
||||
// area
|
||||
wxMask(const wxBitmap& bitmap, const wxColour& colour);
|
||||
|
||||
// Construct a mask from a bitmap and a palette index indicating the
|
||||
// transparent area
|
||||
wxMask(const wxBitmap& bitmap, int paletteIndex);
|
||||
|
||||
// Construct a mask from a mono bitmap (copies the bitmap).
|
||||
wxMask(const wxBitmap& bitmap);
|
||||
|
||||
// construct a mask from the givne bitmap handle
|
||||
wxMask(WXHBITMAP hbmp) { m_maskBitmap = hbmp; }
|
||||
|
||||
virtual ~wxMask();
|
||||
|
||||
bool Create(const wxBitmap& bitmap, const wxColour& colour);
|
||||
bool Create(const wxBitmap& bitmap, int paletteIndex);
|
||||
bool Create(const wxBitmap& bitmap);
|
||||
|
||||
// Implementation
|
||||
WXHBITMAP GetMaskBitmap() const { return m_maskBitmap; }
|
||||
void SetMaskBitmap(WXHBITMAP bmp) { m_maskBitmap = bmp; }
|
||||
|
||||
protected:
|
||||
WXHBITMAP m_maskBitmap;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxMask)
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxBitmapHandler is a class which knows how to load/save bitmaps to/from file
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxBitmapHandler : public wxGDIImageHandler
|
||||
{
|
||||
public:
|
||||
wxBitmapHandler() { m_type = wxBITMAP_TYPE_INVALID; }
|
||||
wxBitmapHandler(const wxString& name, const wxString& ext, long type)
|
||||
: wxGDIImageHandler(name, ext, type)
|
||||
{
|
||||
}
|
||||
|
||||
// keep wxBitmapHandler derived from wxGDIImageHandler compatible with the
|
||||
// old class which worked only with bitmaps
|
||||
virtual bool Create(wxBitmap *bitmap,
|
||||
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(wxBitmap *bitmap,
|
||||
const wxString& name,
|
||||
int type,
|
||||
const wxPalette *palette = NULL);
|
||||
|
||||
virtual bool Create(wxGDIImage *image,
|
||||
void *data,
|
||||
long flags,
|
||||
int width, int height, int depth = 1);
|
||||
virtual bool Load(wxGDIImage *image,
|
||||
const wxString& name,
|
||||
long flags,
|
||||
int desiredWidth, int desiredHeight);
|
||||
virtual bool Save(wxGDIImage *image,
|
||||
const wxString& name,
|
||||
int type);
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxBitmapHandler)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_BITMAP_H_
|
65
include/wx/palmos/bmpbuttn.h
Normal file
65
include/wx/palmos/bmpbuttn.h
Normal file
@ -0,0 +1,65 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: bmpbuttn.h
|
||||
// Purpose: wxBitmapButton class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_BMPBUTTN_H_
|
||||
#define _WX_BMPBUTTN_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "bmpbuttn.h"
|
||||
#endif
|
||||
|
||||
#include "wx/button.h"
|
||||
#include "wx/bitmap.h"
|
||||
|
||||
#define wxDEFAULT_BUTTON_MARGIN 4
|
||||
|
||||
class WXDLLEXPORT wxBitmapButton: public wxBitmapButtonBase
|
||||
{
|
||||
public:
|
||||
wxBitmapButton()
|
||||
{ m_marginX = m_marginY = wxDEFAULT_BUTTON_MARGIN; }
|
||||
wxBitmapButton(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxBitmap& bitmap,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxBU_AUTODRAW,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxButtonNameStr)
|
||||
{
|
||||
Create(parent, id, bitmap, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxBitmap& bitmap,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxBU_AUTODRAW,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxButtonNameStr);
|
||||
|
||||
// Implementation
|
||||
virtual void SetDefault();
|
||||
virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
|
||||
virtual void DrawFace( WXHDC dc, int left, int top, int right, int bottom, bool sel );
|
||||
virtual void DrawButtonFocus( WXHDC dc, int left, int top, int right, int bottom, bool sel );
|
||||
virtual void DrawButtonDisable( WXHDC dc, int left, int top, int right, int bottom, bool with_marg );
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxBitmapButton)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_BMPBUTTN_H_
|
65
include/wx/palmos/brush.h
Normal file
65
include/wx/palmos/brush.h
Normal file
@ -0,0 +1,65 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/brush.h
|
||||
// Purpose: wxBrush class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_BRUSH_H_
|
||||
#define _WX_BRUSH_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "brush.h"
|
||||
#endif
|
||||
|
||||
#include "wx/gdicmn.h"
|
||||
#include "wx/gdiobj.h"
|
||||
#include "wx/bitmap.h"
|
||||
|
||||
class WXDLLEXPORT wxBrush;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxBrush
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxBrush : public wxGDIObject
|
||||
{
|
||||
public:
|
||||
wxBrush();
|
||||
wxBrush(const wxColour& col, int style = wxSOLID);
|
||||
wxBrush(const wxBitmap& stipple);
|
||||
wxBrush(const wxBrush& brush) { Ref(brush); }
|
||||
virtual ~wxBrush();
|
||||
|
||||
virtual void SetColour(const wxColour& col);
|
||||
virtual void SetColour(unsigned char r, unsigned char g, unsigned char b);
|
||||
virtual void SetStyle(int style);
|
||||
virtual void SetStipple(const wxBitmap& stipple);
|
||||
|
||||
wxBrush& operator=(const wxBrush& brush);
|
||||
bool operator==(const wxBrush& brush) const;
|
||||
bool operator!=(const wxBrush& brush) const { return !(*this == brush); }
|
||||
|
||||
wxColour GetColour() const;
|
||||
int GetStyle() const;
|
||||
wxBitmap *GetStipple() const;
|
||||
|
||||
bool Ok() const { return m_refData != NULL; }
|
||||
|
||||
// return the HBRUSH for this brush
|
||||
virtual WXHANDLE GetResourceHandle() const;
|
||||
|
||||
protected:
|
||||
virtual wxObjectRefData *CreateRefData() const;
|
||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxBrush)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_BRUSH_H_
|
94
include/wx/palmos/button.h
Normal file
94
include/wx/palmos/button.h
Normal file
@ -0,0 +1,94 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/button.h
|
||||
// Purpose: wxButton class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_BUTTON_H_
|
||||
#define _WX_BUTTON_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "button.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Pushbutton
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxButton : public wxButtonBase
|
||||
{
|
||||
public:
|
||||
wxButton() { }
|
||||
wxButton(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxButtonNameStr)
|
||||
{
|
||||
Create(parent, id, label, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxButtonNameStr);
|
||||
|
||||
virtual ~wxButton();
|
||||
|
||||
virtual void SetDefault();
|
||||
|
||||
// implementation from now on
|
||||
virtual void Command(wxCommandEvent& event);
|
||||
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
||||
|
||||
virtual void ApplyParentThemeBackground(const wxColour& bg)
|
||||
{
|
||||
// avoide switching into owner-drawn mode
|
||||
wxControl::SetBackgroundColour(bg);
|
||||
}
|
||||
|
||||
#ifdef __WIN32__
|
||||
// coloured buttons support
|
||||
virtual bool SetBackgroundColour(const wxColour &colour);
|
||||
virtual bool SetForegroundColour(const wxColour &colour);
|
||||
|
||||
virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
|
||||
|
||||
private:
|
||||
void MakeOwnerDrawn();
|
||||
#endif // __WIN32__
|
||||
|
||||
protected:
|
||||
// send a notification event, return TRUE if processed
|
||||
bool SendClickEvent();
|
||||
|
||||
// default button handling
|
||||
void SetTmpDefault();
|
||||
void UnsetTmpDefault();
|
||||
|
||||
// set or unset BS_DEFPUSHBUTTON style
|
||||
static void SetDefaultStyle(wxButton *btn, bool on);
|
||||
|
||||
// usually overridden base class virtuals
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const ;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxButton)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_BUTTON_H_
|
68
include/wx/palmos/caret.h
Normal file
68
include/wx/palmos/caret.h
Normal file
@ -0,0 +1,68 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/caret.h
|
||||
// Purpose: wxCaret class - the Palm OS implementation of wxCaret
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_CARET_H_
|
||||
#define _WX_CARET_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "caret.h"
|
||||
#endif
|
||||
|
||||
class WXDLLEXPORT wxCaret : public wxCaretBase
|
||||
{
|
||||
public:
|
||||
wxCaret() { Init(); }
|
||||
// create the caret of given (in pixels) width and height and associate
|
||||
// with the given window
|
||||
wxCaret(wxWindow *window, int width, int height)
|
||||
{
|
||||
Init();
|
||||
|
||||
(void)Create(window, width, height);
|
||||
}
|
||||
// same as above
|
||||
wxCaret(wxWindowBase *window, const wxSize& size)
|
||||
{
|
||||
Init();
|
||||
|
||||
(void)Create(window, size);
|
||||
}
|
||||
|
||||
// process wxWindow notifications
|
||||
virtual void OnSetFocus();
|
||||
virtual void OnKillFocus();
|
||||
|
||||
protected:
|
||||
void Init()
|
||||
{
|
||||
wxCaretBase::Init();
|
||||
|
||||
m_hasCaret = FALSE;
|
||||
}
|
||||
|
||||
// override base class virtuals
|
||||
virtual void DoMove();
|
||||
virtual void DoShow();
|
||||
virtual void DoHide();
|
||||
virtual void DoSize();
|
||||
|
||||
// helper function which creates the system caret
|
||||
bool PalmOSCreateCaret();
|
||||
|
||||
private:
|
||||
bool m_hasCaret;
|
||||
|
||||
DECLARE_NO_COPY_CLASS(wxCaret)
|
||||
};
|
||||
|
||||
#endif // _WX_CARET_H_
|
||||
|
||||
|
65
include/wx/palmos/checkbox.h
Normal file
65
include/wx/palmos/checkbox.h
Normal file
@ -0,0 +1,65 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/checkbox.h
|
||||
// Purpose: wxCheckBox class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_CHECKBOX_H_
|
||||
#define _WX_CHECKBOX_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "checkbox.h"
|
||||
#endif
|
||||
|
||||
// Checkbox item (single checkbox)
|
||||
class WXDLLEXPORT wxCheckBox : public wxCheckBoxBase
|
||||
{
|
||||
public:
|
||||
wxCheckBox() { }
|
||||
wxCheckBox(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxCheckBoxNameStr)
|
||||
{
|
||||
Create(parent, id, label, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxCheckBoxNameStr);
|
||||
|
||||
virtual void SetValue(bool value);
|
||||
virtual bool GetValue() const;
|
||||
|
||||
virtual void SetLabel(const wxString& label);
|
||||
|
||||
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
||||
virtual void Command(wxCommandEvent& event);
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
virtual void DoSet3StateValue(wxCheckBoxState value);
|
||||
|
||||
virtual wxCheckBoxState DoGet3StateValue() const;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxCheckBox)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_CHECKBOX_H_
|
98
include/wx/palmos/checklst.h
Normal file
98
include/wx/palmos/checklst.h
Normal file
@ -0,0 +1,98 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: checklst.h
|
||||
// Purpose: wxCheckListBox class - a listbox with checkable items
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CHECKLST__H_
|
||||
#define __CHECKLST__H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "checklst.h"
|
||||
#endif
|
||||
|
||||
#if !wxUSE_OWNER_DRAWN
|
||||
#error "wxCheckListBox class requires owner-drawn functionality."
|
||||
#endif
|
||||
|
||||
class WXDLLEXPORT wxOwnerDrawn;
|
||||
class WXDLLEXPORT wxCheckListBoxItem; // fwd decl, defined in checklst.cpp
|
||||
|
||||
class WXDLLEXPORT wxCheckListBox : public wxCheckListBoxBase
|
||||
{
|
||||
public:
|
||||
// ctors
|
||||
wxCheckListBox();
|
||||
wxCheckListBox(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int nStrings = 0,
|
||||
const wxString choices[] = NULL,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxListBoxNameStr);
|
||||
wxCheckListBox(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
const wxArrayString& choices,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxListBoxNameStr);
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int n = 0, const wxString choices[] = NULL,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxListBoxNameStr);
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
const wxArrayString& choices,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxListBoxNameStr);
|
||||
|
||||
// override base class virtuals
|
||||
virtual void Delete(int n);
|
||||
|
||||
virtual bool SetFont( const wxFont &font );
|
||||
|
||||
// items may be checked
|
||||
virtual bool IsChecked(size_t uiIndex) const;
|
||||
virtual void Check(size_t uiIndex, bool bCheck = TRUE);
|
||||
|
||||
// return the index of the item at this position or wxNOT_FOUND
|
||||
int HitTest(const wxPoint& pt) const { return DoHitTestItem(pt.x, pt.y); }
|
||||
int HitTest(wxCoord x, wxCoord y) const { return DoHitTestItem(x, y); }
|
||||
|
||||
// accessors
|
||||
size_t GetItemHeight() const { return m_nItemHeight; }
|
||||
|
||||
protected:
|
||||
// we create our items ourselves and they have non-standard size,
|
||||
// so we need to override these functions
|
||||
virtual wxOwnerDrawn *CreateLboxItem(size_t n);
|
||||
virtual bool MSWOnMeasure(WXMEASUREITEMSTRUCT *item);
|
||||
|
||||
// this can't be called DoHitTest() because wxWindow already has this method
|
||||
int DoHitTestItem(wxCoord x, wxCoord y) const;
|
||||
|
||||
// pressing space or clicking the check box toggles the item
|
||||
void OnKeyDown(wxKeyEvent& event);
|
||||
void OnLeftClick(wxMouseEvent& event);
|
||||
|
||||
private:
|
||||
size_t m_nItemHeight; // height of checklistbox items (the same for all)
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxCheckListBox)
|
||||
};
|
||||
|
||||
#endif //_CHECKLST_H
|
118
include/wx/palmos/chkconf.h
Normal file
118
include/wx/palmos/chkconf.h
Normal file
@ -0,0 +1,118 @@
|
||||
/*
|
||||
* Name: wx/palmos/chkconf.h
|
||||
* Purpose: Compiler-specific configuration checking
|
||||
* Author: William Osborne
|
||||
* Modified by:
|
||||
* Created: 10/13/04
|
||||
* RCS-ID: $Id:
|
||||
* Copyright: (c) William Osborne
|
||||
* Licence: wxWindows licence
|
||||
*/
|
||||
|
||||
/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */
|
||||
|
||||
#ifndef _WX_PALMOS_CHKCONF_H_
|
||||
#define _WX_PALMOS_CHKCONF_H_
|
||||
|
||||
/*
|
||||
* disable the settings which don't work for some compilers
|
||||
*/
|
||||
|
||||
/*
|
||||
* If using PostScript-in-MSW in Univ, must enable PostScript
|
||||
*/
|
||||
|
||||
#if defined(__WXUNIVERSAL__) && wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW && !wxUSE_POSTSCRIPT
|
||||
#undef wxUSE_POSTSCRIPT
|
||||
#define wxUSE_POSTSCRIPT 1
|
||||
#endif
|
||||
|
||||
#ifndef wxUSE_NORLANDER_HEADERS
|
||||
#if (defined(__WATCOMC__) && (__WATCOMC__ >= 1200)) || defined(__WINE__) || ((defined(__MINGW32__) || defined(__CYGWIN__)) && ((__GNUC__>2) ||((__GNUC__==2) && (__GNUC_MINOR__>=95))))
|
||||
# define wxUSE_NORLANDER_HEADERS 1
|
||||
#else
|
||||
# define wxUSE_NORLANDER_HEADERS 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* GCC does not have SEH (__try/__catch)
|
||||
*/
|
||||
|
||||
#if defined(__GNUG__)
|
||||
#undef wxUSE_ON_FATAL_EXCEPTION
|
||||
#define wxUSE_ON_FATAL_EXCEPTION 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* wxUSE_DEBUG_NEW_ALWAYS doesn't work with CodeWarrior
|
||||
*/
|
||||
|
||||
#if defined(__MWERKS__)
|
||||
#undef wxUSE_DEBUG_NEW_ALWAYS
|
||||
#define wxUSE_DEBUG_NEW_ALWAYS 0
|
||||
#endif
|
||||
|
||||
#if defined(__GNUWIN32__)
|
||||
/* These don't work as expected for mingw32 and cygwin32 */
|
||||
#undef wxUSE_MEMORY_TRACING
|
||||
#define wxUSE_MEMORY_TRACING 0
|
||||
|
||||
#undef wxUSE_GLOBAL_MEMORY_OPERATORS
|
||||
#define wxUSE_GLOBAL_MEMORY_OPERATORS 0
|
||||
|
||||
#undef wxUSE_DEBUG_NEW_ALWAYS
|
||||
#define wxUSE_DEBUG_NEW_ALWAYS 0
|
||||
|
||||
/* Cygwin betas don't have wcslen */
|
||||
#if defined(__CYGWIN__) || defined(__CYGWIN32__)
|
||||
# if ! ((__GNUC__>2) ||((__GNUC__==2) && (__GNUC_MINOR__>=95)))
|
||||
# undef wxUSE_WCHAR_T
|
||||
# define wxUSE_WCHAR_T 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/* __GNUWIN32__ */
|
||||
|
||||
/* MFC duplicates these operators */
|
||||
#if wxUSE_MFC
|
||||
#undef wxUSE_GLOBAL_MEMORY_OPERATORS
|
||||
#define wxUSE_GLOBAL_MEMORY_OPERATORS 0
|
||||
|
||||
#undef wxUSE_DEBUG_NEW_ALWAYS
|
||||
#define wxUSE_DEBUG_NEW_ALWAYS 0
|
||||
#endif
|
||||
/* wxUSE_MFC */
|
||||
|
||||
#if (defined(__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS)
|
||||
/* GnuWin32 doesn't have appropriate headers for e.g. IUnknown. */
|
||||
#undef wxUSE_DRAG_AND_DROP
|
||||
#define wxUSE_DRAG_AND_DROP 0
|
||||
#endif
|
||||
|
||||
#if !wxUSE_OWNER_DRAWN
|
||||
#undef wxUSE_CHECKLISTBOX
|
||||
#define wxUSE_CHECKLISTBOX 0
|
||||
#endif
|
||||
|
||||
#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
|
||||
/* BC++ 4.0 can't compile JPEG library */
|
||||
#undef wxUSE_LIBJPEG
|
||||
#define wxUSE_LIBJPEG 0
|
||||
#endif
|
||||
|
||||
/* wxUSE_DEBUG_NEW_ALWAYS = 1 not compatible with BC++ in DLL mode */
|
||||
#if defined(__BORLANDC__) && (defined(WXMAKINGDLL) || defined(WXUSINGDLL))
|
||||
#undef wxUSE_DEBUG_NEW_ALWAYS
|
||||
#define wxUSE_DEBUG_NEW_ALWAYS 0
|
||||
#endif
|
||||
|
||||
#if defined(__WXMSW__) && (defined(__WATCOMC__) && __WATCOMC__ < 1200)
|
||||
#undef wxUSE_WCHAR_T
|
||||
#define wxUSE_WCHAR_T 0
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/* _WX_PALMOS_CHKCONF_H_ */
|
||||
|
127
include/wx/palmos/choice.h
Normal file
127
include/wx/palmos/choice.h
Normal file
@ -0,0 +1,127 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: choice.h
|
||||
// Purpose: wxChoice class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_CHOICE_H_
|
||||
#define _WX_CHOICE_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "choice.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Choice item
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxChoice : public wxChoiceBase
|
||||
{
|
||||
public:
|
||||
// ctors
|
||||
wxChoice() { }
|
||||
virtual ~wxChoice();
|
||||
|
||||
wxChoice(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int n = 0, const wxString choices[] = NULL,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxChoiceNameStr)
|
||||
{
|
||||
Create(parent, id, pos, size, n, choices, style, validator, name);
|
||||
}
|
||||
wxChoice(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
const wxArrayString& choices,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxChoiceNameStr)
|
||||
{
|
||||
Create(parent, id, pos, size, choices, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int n = 0, const wxString choices[] = NULL,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxChoiceNameStr);
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
const wxArrayString& choices,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxChoiceNameStr);
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual int DoAppend(const wxString& item);
|
||||
virtual int DoInsert(const wxString& item, int pos);
|
||||
virtual void Delete(int n);
|
||||
virtual void Clear();
|
||||
|
||||
virtual int GetCount() const;
|
||||
virtual int GetSelection() const;
|
||||
virtual void SetSelection(int n);
|
||||
|
||||
virtual int FindString(const wxString& s) const;
|
||||
virtual wxString GetString(int n) const;
|
||||
virtual void SetString(int n, const wxString& s);
|
||||
|
||||
// MSW only
|
||||
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
||||
WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
protected:
|
||||
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||
virtual void DoSetItemClientData( int n, void* clientData );
|
||||
virtual void* DoGetItemClientData( int n ) const;
|
||||
virtual void DoSetItemClientObject( int n, wxClientData* clientData );
|
||||
virtual wxClientData* DoGetItemClientObject( int n ) const;
|
||||
|
||||
// MSW implementation
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
virtual void DoGetSize(int *w, int *h) const;
|
||||
virtual void DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
|
||||
virtual bool MSWShouldPreProcessMessage(WXMSG *pMsg);
|
||||
|
||||
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
|
||||
|
||||
// update the height of the drop down list to fit the number of items we
|
||||
// have (without changing the visible height)
|
||||
void UpdateVisibleHeight();
|
||||
|
||||
// create and initialize the control
|
||||
bool CreateAndInit(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
int n, const wxString choices[],
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name);
|
||||
|
||||
// free all memory we have (used by Clear() and dtor)
|
||||
void Free();
|
||||
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxChoice)
|
||||
};
|
||||
|
||||
#endif // _WX_CHOICE_H_
|
102
include/wx/palmos/clipbrd.h
Normal file
102
include/wx/palmos/clipbrd.h
Normal file
@ -0,0 +1,102 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/clipbrd.h
|
||||
// Purpose: wxClipboad class and clipboard functions for Palm OS
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_CLIPBRD_H_
|
||||
#define _WX_CLIPBRD_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "clipbrd.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_CLIPBOARD
|
||||
|
||||
#include "wx/list.h"
|
||||
#include "wx/module.h"
|
||||
#include "wx/dataobj.h" // for wxDataFormat
|
||||
|
||||
// These functions superceded by wxClipboard, but retained in order to
|
||||
// implement wxClipboard, and for compatibility.
|
||||
|
||||
// open/close the clipboard
|
||||
WXDLLEXPORT bool wxOpenClipboard();
|
||||
WXDLLEXPORT bool wxIsClipboardOpened();
|
||||
#define wxClipboardOpen wxIsClipboardOpened
|
||||
WXDLLEXPORT bool wxCloseClipboard();
|
||||
|
||||
// get/set data
|
||||
WXDLLEXPORT bool wxEmptyClipboard();
|
||||
WXDLLEXPORT bool wxSetClipboardData(wxDataFormat dataFormat,
|
||||
const void *data,
|
||||
int width = 0, int height = 0);
|
||||
WXDLLEXPORT void* wxGetClipboardData(wxDataFormat dataFormat,
|
||||
long *len = NULL);
|
||||
|
||||
// clipboard formats
|
||||
WXDLLEXPORT bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat);
|
||||
WXDLLEXPORT wxDataFormat wxEnumClipboardFormats(wxDataFormat dataFormat);
|
||||
WXDLLEXPORT int wxRegisterClipboardFormat(wxChar *formatName);
|
||||
WXDLLEXPORT bool wxGetClipboardFormatName(wxDataFormat dataFormat,
|
||||
wxChar *formatName,
|
||||
int maxCount);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxClipboard
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxDataObject;
|
||||
class WXDLLEXPORT wxClipboard : public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxClipboard)
|
||||
|
||||
public:
|
||||
wxClipboard();
|
||||
~wxClipboard();
|
||||
|
||||
// open the clipboard before SetData() and GetData()
|
||||
virtual bool Open();
|
||||
|
||||
// close the clipboard after SetData() and GetData()
|
||||
virtual void Close();
|
||||
|
||||
// query whether the clipboard is opened
|
||||
virtual bool IsOpened() const;
|
||||
|
||||
// set the clipboard data. all other formats will be deleted.
|
||||
virtual bool SetData( wxDataObject *data );
|
||||
|
||||
// add to the clipboard data.
|
||||
virtual bool AddData( wxDataObject *data );
|
||||
|
||||
// ask if data in correct format is available
|
||||
virtual bool IsSupported( wxDataFormat format );
|
||||
|
||||
// fill data with data on the clipboard (if available)
|
||||
virtual bool GetData( wxDataObject& data );
|
||||
|
||||
// clears wxTheClipboard and the system's clipboard if possible
|
||||
virtual void Clear();
|
||||
|
||||
// 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();
|
||||
|
||||
// X11 has two clipboards which get selected by this call. Empty on MSW.
|
||||
void UsePrimarySelection( bool WXUNUSED(primary) = FALSE ) { }
|
||||
|
||||
private:
|
||||
bool m_clearOnExit;
|
||||
bool m_isOpened;
|
||||
};
|
||||
|
||||
#endif // wxUSE_CLIPBOARD
|
||||
#endif
|
||||
// _WX_CLIPBRD_H_
|
61
include/wx/palmos/colordlg.h
Normal file
61
include/wx/palmos/colordlg.h
Normal file
@ -0,0 +1,61 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/colordlg.h
|
||||
// Purpose: wxColourDialog class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_COLORDLG_H_
|
||||
#define _WX_COLORDLG_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "colordlg.h"
|
||||
#endif
|
||||
|
||||
#include "wx/setup.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/cmndata.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxColourDialog: dialog for choosing a colours
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxColourDialog : public wxDialog
|
||||
{
|
||||
public:
|
||||
wxColourDialog();
|
||||
wxColourDialog(wxWindow *parent, wxColourData *data = NULL);
|
||||
|
||||
bool Create(wxWindow *parent, wxColourData *data = NULL);
|
||||
|
||||
wxColourData& GetColourData() { return m_colourData; }
|
||||
|
||||
// override some base class virtuals
|
||||
virtual void SetTitle(const wxString& title);
|
||||
virtual wxString GetTitle() const;
|
||||
|
||||
virtual int ShowModal();
|
||||
|
||||
virtual void DoGetPosition( int *x, int *y ) const;
|
||||
|
||||
protected:
|
||||
virtual void DoGetSize(int *width, int *height) const;
|
||||
virtual void DoGetClientSize(int *width, int *height) const;
|
||||
virtual void DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
|
||||
wxColourData m_colourData;
|
||||
wxString m_title;
|
||||
|
||||
wxPoint m_pos;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxColourDialog)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_COLORDLG_H_
|
114
include/wx/palmos/colour.h
Normal file
114
include/wx/palmos/colour.h
Normal file
@ -0,0 +1,114 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/colour.h
|
||||
// Purpose: wxColour class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_COLOUR_H_
|
||||
#define _WX_COLOUR_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "colour.h"
|
||||
#endif
|
||||
|
||||
#include "wx/object.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Colour
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxColour : public wxObject
|
||||
{
|
||||
public:
|
||||
// constructors
|
||||
// ------------
|
||||
|
||||
// default
|
||||
wxColour() { Init(); }
|
||||
|
||||
// from separate RGB
|
||||
wxColour( unsigned char red, unsigned char green, unsigned char blue )
|
||||
{ Set(red, green, blue); }
|
||||
|
||||
// from packed RGB
|
||||
wxColour( unsigned long colRGB ) { Set(colRGB); }
|
||||
|
||||
// implicit conversion from the colour name
|
||||
wxColour(const wxString &colourName) { InitFromName(colourName); }
|
||||
wxColour(const wxChar *colourName) { InitFromName(colourName); }
|
||||
|
||||
|
||||
// copy ctors and assignment operators
|
||||
wxColour(const wxColour& col);
|
||||
wxColour& operator=( const wxColour& col);
|
||||
|
||||
// dtor
|
||||
~wxColour();
|
||||
|
||||
|
||||
// other methods
|
||||
// -------------
|
||||
|
||||
// to have the matching Create also for this class
|
||||
void Create( unsigned char red, unsigned char green, unsigned char blue )
|
||||
{ Set(red, green, blue); }
|
||||
|
||||
// Set() functions
|
||||
void Set(unsigned char red, unsigned char green, unsigned char blue);
|
||||
void Set(unsigned long colRGB)
|
||||
{
|
||||
// we don't need to know sizeof(long) here because we assume that the three
|
||||
// least significant bytes contain the R, G and B values
|
||||
Set((unsigned char)colRGB,
|
||||
(unsigned char)(colRGB >> 8),
|
||||
(unsigned char)(colRGB >> 16));
|
||||
}
|
||||
|
||||
// accessors
|
||||
// ---------
|
||||
|
||||
bool Ok() const { return m_isInit; }
|
||||
|
||||
unsigned char Red() const { return m_red; }
|
||||
unsigned char Green() const { return m_green; }
|
||||
unsigned char Blue() const { return m_blue; }
|
||||
|
||||
// comparison
|
||||
bool operator==(const wxColour& colour) const
|
||||
{
|
||||
return m_isInit == colour.m_isInit
|
||||
&& m_red == colour.m_red
|
||||
&& m_green == colour.m_green
|
||||
&& m_blue == colour.m_blue;
|
||||
}
|
||||
|
||||
bool operator != (const wxColour& colour) const { return !(*this == colour); }
|
||||
|
||||
WXCOLORREF GetPixel() const { return m_pixel; };
|
||||
|
||||
void InitFromName(const wxString& colourName);
|
||||
|
||||
public:
|
||||
WXCOLORREF m_pixel;
|
||||
|
||||
protected:
|
||||
// Helper function
|
||||
void Init();
|
||||
|
||||
private:
|
||||
bool m_isInit;
|
||||
unsigned char m_red;
|
||||
unsigned char m_blue;
|
||||
unsigned char m_green;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxColour)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_COLOUR_H_
|
114
include/wx/palmos/combobox.h
Normal file
114
include/wx/palmos/combobox.h
Normal file
@ -0,0 +1,114 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/msw/combobox.h
|
||||
// Purpose: wxComboBox class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_COMBOBOX_H_
|
||||
#define _WX_COMBOBOX_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "combobox.h"
|
||||
#endif
|
||||
|
||||
#include "wx/choice.h"
|
||||
|
||||
#if wxUSE_COMBOBOX
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Combobox control
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxComboBox: public wxChoice
|
||||
{
|
||||
public:
|
||||
wxComboBox() { }
|
||||
|
||||
wxComboBox(wxWindow *parent, wxWindowID id,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int n = 0, const wxString choices[] = NULL,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxComboBoxNameStr)
|
||||
{
|
||||
Create(parent, id, value, pos, size, n, choices, style, validator, name);
|
||||
}
|
||||
wxComboBox(wxWindow *parent, wxWindowID id,
|
||||
const wxString& value,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
const wxArrayString& choices,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxComboBoxNameStr)
|
||||
{
|
||||
Create(parent, id, value, pos, size, choices, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int n = 0,
|
||||
const wxString choices[] = NULL,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxComboBoxNameStr);
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& value,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
const wxArrayString& choices,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxComboBoxNameStr);
|
||||
|
||||
// List functions: see wxChoice
|
||||
|
||||
// Text field functions
|
||||
wxString GetValue() const { return GetLabel(); }
|
||||
virtual void SetValue(const wxString& value);
|
||||
|
||||
// Clipboard operations
|
||||
virtual void Copy();
|
||||
virtual void Cut();
|
||||
virtual void Paste();
|
||||
virtual void SetInsertionPoint(long pos);
|
||||
virtual void SetInsertionPointEnd();
|
||||
virtual long GetInsertionPoint() const;
|
||||
virtual long GetLastPosition() const;
|
||||
virtual void Replace(long from, long to, const wxString& value);
|
||||
virtual void Remove(long from, long to);
|
||||
virtual void SetSelection(int n) { wxChoice::SetSelection(n); }
|
||||
virtual void SetSelection(long from, long to);
|
||||
virtual void SetEditable(bool editable);
|
||||
|
||||
// implementation only from now on
|
||||
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
||||
bool MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
WXHWND GetEditHWND() const;
|
||||
|
||||
protected:
|
||||
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxComboBox)
|
||||
};
|
||||
|
||||
#endif // wxUSE_COMBOBOX
|
||||
#endif
|
||||
// _WX_COMBOBOX_H_
|
136
include/wx/palmos/control.h
Normal file
136
include/wx/palmos/control.h
Normal file
@ -0,0 +1,136 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: control.h
|
||||
// Purpose: wxControl class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_CONTROL_H_
|
||||
#define _WX_CONTROL_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "control.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dynarray.h"
|
||||
|
||||
// General item class
|
||||
class WXDLLEXPORT wxControl : public wxControlBase
|
||||
{
|
||||
public:
|
||||
wxControl() { }
|
||||
|
||||
wxControl(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxControlNameStr)
|
||||
{
|
||||
Create(parent, id, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxControlNameStr);
|
||||
|
||||
virtual ~wxControl();
|
||||
|
||||
// Simulates an event
|
||||
virtual void Command(wxCommandEvent& event) { ProcessCommand(event); }
|
||||
|
||||
|
||||
// implementation from now on
|
||||
// --------------------------
|
||||
|
||||
virtual wxVisualAttributes GetDefaultAttributes() const
|
||||
{
|
||||
return GetClassDefaultAttributes(GetWindowVariant());
|
||||
}
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
// Calls the callback and appropriate event handlers
|
||||
bool ProcessCommand(wxCommandEvent& event);
|
||||
|
||||
// MSW-specific
|
||||
#ifdef __WIN95__
|
||||
virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
|
||||
#endif // Win95
|
||||
|
||||
// For ownerdraw items
|
||||
virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *WXUNUSED(item)) { return FALSE; };
|
||||
virtual bool MSWOnMeasure(WXMEASUREITEMSTRUCT *WXUNUSED(item)) { return FALSE; };
|
||||
|
||||
const wxArrayLong& GetSubcontrols() const { return m_subControls; }
|
||||
|
||||
void OnEraseBackground(wxEraseEvent& event);
|
||||
|
||||
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
protected:
|
||||
// choose the default border for this window
|
||||
virtual wxBorder GetDefaultBorder() const;
|
||||
|
||||
// return default best size (doesn't really make any sense, override this)
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
// create the control of the given Windows class: this is typically called
|
||||
// from Create() method of the derived class passing its label, pos and
|
||||
// size parameter (style parameter is not needed because m_windowStyle is
|
||||
// supposed to had been already set and so is used instead when this
|
||||
// function is called)
|
||||
bool MSWCreateControl(const wxChar *classname,
|
||||
const wxString& label,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size);
|
||||
|
||||
// NB: the method below is deprecated now, with MSWGetStyle() the method
|
||||
// above should be used instead! Once all the controls are updated to
|
||||
// implement MSWGetStyle() this version will disappear.
|
||||
//
|
||||
// create the control of the given class with the given style (combination
|
||||
// of WS_XXX flags, i.e. Windows style, not wxWidgets one), returns
|
||||
// FALSE if creation failed
|
||||
//
|
||||
// All parameters except classname and style are optional, if the
|
||||
// size/position are not given, they should be set later with SetSize()
|
||||
// and, label (the title of the window), of course, is left empty. The
|
||||
// extended style is determined from the style and the app 3D settings
|
||||
// automatically if it's not specified explicitly.
|
||||
bool MSWCreateControl(const wxChar *classname,
|
||||
WXDWORD style,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const wxString& label = wxEmptyString,
|
||||
WXDWORD exstyle = (WXDWORD)-1);
|
||||
|
||||
// default style for the control include WS_TABSTOP if it AcceptsFocus()
|
||||
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
|
||||
|
||||
// this is a helper for the derived class GetClassDefaultAttributes()
|
||||
// implementation: it returns the right colours for the classes which
|
||||
// contain something else (e.g. wxListBox, wxTextCtrl, ...) instead of
|
||||
// being simple controls (such as wxButton, wxCheckBox, ...)
|
||||
static wxVisualAttributes
|
||||
GetCompositeControlsDefaultAttributes(wxWindowVariant variant);
|
||||
|
||||
|
||||
// for controls like radiobuttons which are really composite this array
|
||||
// holds the ids (not HWNDs!) of the sub controls
|
||||
wxArrayLong m_subControls;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxControl)
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_CONTROL_H_
|
69
include/wx/palmos/crashrpt.h
Normal file
69
include/wx/palmos/crashrpt.h
Normal file
@ -0,0 +1,69 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/crashrpt.h
|
||||
// Purpose: helpers for the structured exception handling (SEH)
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_MSW_SEH_H_
|
||||
#define _WX_MSW_SEH_H_
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_ON_FATAL_EXCEPTION
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// report generation flags
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
enum
|
||||
{
|
||||
// we always report where the crash occured
|
||||
wxCRASH_REPORT_LOCATION = 0,
|
||||
|
||||
// if this flag is given, the call stack is dumped
|
||||
//
|
||||
// this results in dump/crash report as small as possible, this is the
|
||||
// default flag
|
||||
wxCRASH_REPORT_STACK = 1,
|
||||
|
||||
// if this flag is given, the values of the local variables are dumped
|
||||
//
|
||||
// note that this will result in huge file containing the dump of the
|
||||
// entire process memory space when using mini dumps!
|
||||
wxCRASH_REPORT_LOCALS = 2,
|
||||
|
||||
// if this flag is given, the values of all global variables are dumped
|
||||
//
|
||||
// this creates a much larger mini dump and also takes more time to
|
||||
// generate if our own crash reporting code is used
|
||||
wxCRASH_REPORT_GLOBALS = 4
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxCrashReport: this class is used to create crash reports
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
struct WXDLLIMPEXP_BASE wxCrashReport
|
||||
{
|
||||
// set the name of the file to which the report is written, it is
|
||||
// constructed from the .exe name by default
|
||||
static void SetFileName(const wxChar *filename);
|
||||
|
||||
// return the current file name
|
||||
static const wxChar *GetFileName();
|
||||
|
||||
// write the exception report to the file, return true if it could be done
|
||||
// or false otherwise
|
||||
static bool Generate(int flags = wxCRASH_REPORT_LOCATION |
|
||||
wxCRASH_REPORT_STACK);
|
||||
};
|
||||
|
||||
#endif // wxUSE_ON_FATAL_EXCEPTION
|
||||
|
||||
#endif // _WX_MSW_SEH_H_
|
||||
|
59
include/wx/palmos/cursor.h
Normal file
59
include/wx/palmos/cursor.h
Normal file
@ -0,0 +1,59 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/cursor.h
|
||||
// Purpose: wxCursor class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_CURSOR_H_
|
||||
#define _WX_CURSOR_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "cursor.h"
|
||||
#endif
|
||||
|
||||
#include "wx/palmos/gdiimage.h"
|
||||
|
||||
class WXDLLEXPORT wxImage;
|
||||
|
||||
// Cursor
|
||||
class WXDLLEXPORT wxCursor : public wxGDIImage
|
||||
{
|
||||
public:
|
||||
// constructors
|
||||
wxCursor();
|
||||
wxCursor(const wxCursor& cursor) { Ref(cursor); }
|
||||
wxCursor(const wxImage& image);
|
||||
wxCursor(const char bits[], int width, int height,
|
||||
int hotSpotX = -1, int hotSpotY = -1,
|
||||
const char maskBits[] = NULL);
|
||||
wxCursor(const wxString& name,
|
||||
long flags = wxBITMAP_TYPE_CUR_RESOURCE,
|
||||
int hotSpotX = 0, int hotSpotY = 0);
|
||||
wxCursor(int idCursor);
|
||||
virtual ~wxCursor();
|
||||
|
||||
wxCursor& operator=(const wxCursor& cursor)
|
||||
{ if (*this == cursor) return (*this); Ref(cursor); return *this; }
|
||||
|
||||
bool operator==(const wxCursor& cursor) const;
|
||||
bool operator!=(const wxCursor& cursor) const
|
||||
{ return !(*this == cursor); }
|
||||
|
||||
// implementation only
|
||||
void SetHCURSOR(WXHCURSOR cursor) { SetHandle((WXHANDLE)cursor); }
|
||||
WXHCURSOR GetHCURSOR() const { return (WXHCURSOR)GetHandle(); }
|
||||
|
||||
protected:
|
||||
virtual wxGDIImageRefData *CreateData() const;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxCursor)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_CURSOR_H_
|
276
include/wx/palmos/dc.h
Normal file
276
include/wx/palmos/dc.h
Normal file
@ -0,0 +1,276 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dc.h
|
||||
// Purpose: wxDC class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_DC_H_
|
||||
#define _WX_DC_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "dc.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/dc.h"
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// macros
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_DC_CACHEING
|
||||
/*
|
||||
* Cached blitting, maintaining a cache
|
||||
* of bitmaps required for transparent blitting
|
||||
* instead of constant creation/deletion
|
||||
*/
|
||||
|
||||
class wxDCCacheEntry: public wxObject
|
||||
{
|
||||
public:
|
||||
wxDCCacheEntry(WXHBITMAP hBitmap, int w, int h, int depth);
|
||||
wxDCCacheEntry(WXHDC hDC, int depth);
|
||||
~wxDCCacheEntry();
|
||||
|
||||
WXHBITMAP m_bitmap;
|
||||
WXHDC m_dc;
|
||||
int m_width;
|
||||
int m_height;
|
||||
int m_depth;
|
||||
};
|
||||
#endif
|
||||
|
||||
class WXDLLEXPORT wxDC : public wxDCBase
|
||||
{
|
||||
public:
|
||||
wxDC();
|
||||
~wxDC();
|
||||
|
||||
// implement base class pure virtuals
|
||||
// ----------------------------------
|
||||
|
||||
virtual void Clear();
|
||||
|
||||
virtual bool StartDoc(const wxString& message);
|
||||
virtual void EndDoc();
|
||||
|
||||
virtual void StartPage();
|
||||
virtual void EndPage();
|
||||
|
||||
virtual void SetFont(const wxFont& font);
|
||||
virtual void SetPen(const wxPen& pen);
|
||||
virtual void SetBrush(const wxBrush& brush);
|
||||
virtual void SetBackground(const wxBrush& brush);
|
||||
virtual void SetBackgroundMode(int mode);
|
||||
#if wxUSE_PALETTE
|
||||
virtual void SetPalette(const wxPalette& palette);
|
||||
#endif // wxUSE_PALETTE
|
||||
|
||||
virtual void DestroyClippingRegion();
|
||||
|
||||
virtual wxCoord GetCharHeight() const;
|
||||
virtual wxCoord GetCharWidth() const;
|
||||
virtual void DoGetTextExtent(const wxString& string,
|
||||
wxCoord *x, wxCoord *y,
|
||||
wxCoord *descent = NULL,
|
||||
wxCoord *externalLeading = NULL,
|
||||
wxFont *theFont = NULL) const;
|
||||
virtual bool DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const;
|
||||
|
||||
virtual bool CanDrawBitmap() const;
|
||||
virtual bool CanGetTextExtent() const;
|
||||
virtual int GetDepth() const;
|
||||
virtual wxSize GetPPI() const;
|
||||
|
||||
virtual void SetMapMode(int mode);
|
||||
virtual void SetUserScale(double x, double y);
|
||||
virtual void SetSystemScale(double x, double y);
|
||||
virtual void SetLogicalScale(double x, double y);
|
||||
virtual void SetLogicalOrigin(wxCoord x, wxCoord y);
|
||||
virtual void SetDeviceOrigin(wxCoord x, wxCoord y);
|
||||
virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp);
|
||||
virtual void SetLogicalFunction(int function);
|
||||
|
||||
// implementation from now on
|
||||
// --------------------------
|
||||
|
||||
virtual void SetRop(WXHDC cdc);
|
||||
virtual void SelectOldObjects(WXHDC dc);
|
||||
|
||||
wxWindow *GetWindow() const { return m_canvas; }
|
||||
void SetWindow(wxWindow *win)
|
||||
{
|
||||
m_canvas = win;
|
||||
|
||||
#if wxUSE_PALETTE
|
||||
// if we have palettes use the correct one for this window
|
||||
InitializePalette();
|
||||
#endif // wxUSE_PALETTE
|
||||
}
|
||||
|
||||
WXHDC GetHDC() const { return m_hDC; }
|
||||
void SetHDC(WXHDC dc, bool bOwnsDC = FALSE)
|
||||
{
|
||||
m_hDC = dc;
|
||||
m_bOwnsDC = bOwnsDC;
|
||||
|
||||
// we might have a pre existing clipping region, make sure that we
|
||||
// return it if asked -- but avoid calling ::GetClipBox() right now as
|
||||
// it could be unnecessary wasteful
|
||||
m_clipping = true;
|
||||
m_clipX1 =
|
||||
m_clipX2 = 0;
|
||||
}
|
||||
|
||||
const wxBitmap& GetSelectedBitmap() const { return m_selectedBitmap; }
|
||||
wxBitmap& GetSelectedBitmap() { return m_selectedBitmap; }
|
||||
|
||||
// update the internal clip box variables
|
||||
void UpdateClipBox();
|
||||
|
||||
#if wxUSE_DC_CACHEING
|
||||
static wxDCCacheEntry* FindBitmapInCache(WXHDC hDC, int w, int h);
|
||||
static wxDCCacheEntry* FindDCInCache(wxDCCacheEntry* notThis, WXHDC hDC);
|
||||
|
||||
static void AddToBitmapCache(wxDCCacheEntry* entry);
|
||||
static void AddToDCCache(wxDCCacheEntry* entry);
|
||||
static void ClearCache();
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
|
||||
int style = wxFLOOD_SURFACE);
|
||||
|
||||
virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const;
|
||||
|
||||
virtual void DoDrawPoint(wxCoord x, wxCoord y);
|
||||
virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2);
|
||||
|
||||
virtual void DoDrawArc(wxCoord x1, wxCoord y1,
|
||||
wxCoord x2, wxCoord y2,
|
||||
wxCoord xc, wxCoord yc);
|
||||
virtual void DoDrawCheckMark(wxCoord x, wxCoord y,
|
||||
wxCoord width, wxCoord height);
|
||||
virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h,
|
||||
double sa, double ea);
|
||||
|
||||
virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
||||
virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y,
|
||||
wxCoord width, wxCoord height,
|
||||
double radius);
|
||||
virtual void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
||||
|
||||
virtual void DoCrossHair(wxCoord x, wxCoord y);
|
||||
|
||||
virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y);
|
||||
virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
|
||||
bool useMask = FALSE);
|
||||
|
||||
virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y);
|
||||
virtual void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y,
|
||||
double angle);
|
||||
|
||||
virtual bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
|
||||
wxDC *source, wxCoord xsrc, wxCoord ysrc,
|
||||
int rop = wxCOPY, bool useMask = FALSE, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1);
|
||||
|
||||
// this is gnarly - we can't even call this function DoSetClippingRegion()
|
||||
// because of virtual function hiding
|
||||
virtual void DoSetClippingRegionAsRegion(const wxRegion& region);
|
||||
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
|
||||
wxCoord width, wxCoord height);
|
||||
virtual void DoGetClippingRegion(wxCoord *x, wxCoord *y,
|
||||
wxCoord *width, wxCoord *height)
|
||||
{
|
||||
GetClippingBox(x, y, width, height);
|
||||
}
|
||||
virtual void DoGetClippingBox(wxCoord *x, wxCoord *y,
|
||||
wxCoord *w, wxCoord *h) const;
|
||||
|
||||
virtual void DoGetSize(int *width, int *height) const;
|
||||
virtual void DoGetSizeMM(int* width, int* height) const;
|
||||
|
||||
virtual void DoDrawLines(int n, wxPoint points[],
|
||||
wxCoord xoffset, wxCoord yoffset);
|
||||
virtual void DoDrawPolygon(int n, wxPoint points[],
|
||||
wxCoord xoffset, wxCoord yoffset,
|
||||
int fillStyle = wxODDEVEN_RULE);
|
||||
virtual void DoDrawPolyPolygon(int n, int count[], wxPoint points[],
|
||||
wxCoord xoffset, wxCoord yoffset,
|
||||
int fillStyle = wxODDEVEN_RULE);
|
||||
|
||||
|
||||
#if wxUSE_PALETTE
|
||||
// MSW specific, select a logical palette into the HDC
|
||||
// (tell windows to translate pixel from other palettes to our custom one
|
||||
// and vice versa)
|
||||
// Realize tells it to also reset the system palette to this one.
|
||||
void DoSelectPalette(bool realize = FALSE);
|
||||
|
||||
// Find out what palette our parent window has, then select it into the dc
|
||||
void InitializePalette();
|
||||
#endif // wxUSE_PALETTE
|
||||
|
||||
// common part of DoDrawText() and DoDrawRotatedText()
|
||||
void DrawAnyText(const wxString& text, wxCoord x, wxCoord y);
|
||||
|
||||
// common part of DoSetClippingRegion() and DoSetClippingRegionAsRegion()
|
||||
void SetClippingHrgn(WXHRGN hrgn);
|
||||
|
||||
// MSW-specific member variables
|
||||
// -----------------------------
|
||||
|
||||
// the window associated with this DC (may be NULL)
|
||||
wxWindow *m_canvas;
|
||||
|
||||
wxBitmap m_selectedBitmap;
|
||||
|
||||
// TRUE => DeleteDC() in dtor, FALSE => only ReleaseDC() it
|
||||
bool m_bOwnsDC:1;
|
||||
|
||||
// our HDC
|
||||
WXHDC m_hDC;
|
||||
|
||||
// Store all old GDI objects when do a SelectObject, so we can select them
|
||||
// back in (this unselecting user's objects) so we can safely delete the
|
||||
// DC.
|
||||
WXHBITMAP m_oldBitmap;
|
||||
WXHPEN m_oldPen;
|
||||
WXHBRUSH m_oldBrush;
|
||||
WXHFONT m_oldFont;
|
||||
|
||||
#if wxUSE_PALETTE
|
||||
WXHPALETTE m_oldPalette;
|
||||
#endif // wxUSE_PALETTE
|
||||
|
||||
#if wxUSE_DC_CACHEING
|
||||
static wxList sm_bitmapCache;
|
||||
static wxList sm_dcCache;
|
||||
#endif
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxDC)
|
||||
DECLARE_NO_COPY_CLASS(wxDC)
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxDCTemp: a wxDC which doesn't free the given HDC (used by wxWidgets
|
||||
// only/mainly)
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxDCTemp : public wxDC
|
||||
{
|
||||
public:
|
||||
wxDCTemp(WXHDC hdc) { SetHDC(hdc); }
|
||||
virtual ~wxDCTemp() { SetHDC((WXHDC)NULL); }
|
||||
|
||||
private:
|
||||
DECLARE_NO_COPY_CLASS(wxDCTemp)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_DC_H_
|
122
include/wx/palmos/dcclient.h
Normal file
122
include/wx/palmos/dcclient.h
Normal file
@ -0,0 +1,122 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dcclient.h
|
||||
// Purpose: wxClientDC class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_DCCLIENT_H_
|
||||
#define _WX_DCCLIENT_H_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "dcclient.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dc.h"
|
||||
#include "wx/dynarray.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// array types
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// this one if used by wxPaintDC only
|
||||
struct WXDLLEXPORT wxPaintDCInfo;
|
||||
|
||||
WX_DECLARE_EXPORTED_OBJARRAY(wxPaintDCInfo, wxArrayDCInfo);
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// DC classes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxWindowDC : public wxDC
|
||||
{
|
||||
public:
|
||||
// default ctor
|
||||
wxWindowDC();
|
||||
|
||||
// Create a DC corresponding to the whole window
|
||||
wxWindowDC(wxWindow *win);
|
||||
|
||||
protected:
|
||||
// intiialize the newly created DC
|
||||
void InitDC();
|
||||
|
||||
// override some base class virtuals
|
||||
virtual void DoGetSize(int *width, int *height) const;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxWindowDC)
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxClientDC : public wxWindowDC
|
||||
{
|
||||
public:
|
||||
// default ctor
|
||||
wxClientDC();
|
||||
|
||||
// Create a DC corresponding to the client area of the window
|
||||
wxClientDC(wxWindow *win);
|
||||
|
||||
virtual ~wxClientDC();
|
||||
|
||||
protected:
|
||||
void InitDC();
|
||||
|
||||
// override some base class virtuals
|
||||
virtual void DoGetSize(int *width, int *height) const;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxClientDC)
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxPaintDC : public wxClientDC
|
||||
{
|
||||
public:
|
||||
wxPaintDC();
|
||||
|
||||
// Create a DC corresponding for painting the window in OnPaint()
|
||||
wxPaintDC(wxWindow *win);
|
||||
|
||||
virtual ~wxPaintDC();
|
||||
|
||||
// find the entry for this DC in the cache (keyed by the window)
|
||||
static WXHDC FindDCInCache(wxWindow* win);
|
||||
|
||||
protected:
|
||||
static wxArrayDCInfo ms_cache;
|
||||
|
||||
// find the entry for this DC in the cache (keyed by the window)
|
||||
wxPaintDCInfo *FindInCache(size_t *index = NULL) const;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxPaintDC)
|
||||
};
|
||||
|
||||
/*
|
||||
* wxPaintDCEx
|
||||
* This class is used when an application sends an HDC with the WM_PAINT
|
||||
* message. It is used in HandlePaint and need not be used by an application.
|
||||
*/
|
||||
|
||||
class WXDLLEXPORT wxPaintDCEx : public wxPaintDC
|
||||
{
|
||||
public:
|
||||
wxPaintDCEx(wxWindow *canvas, WXHDC dc);
|
||||
virtual ~wxPaintDCEx();
|
||||
private:
|
||||
int saveState;
|
||||
|
||||
DECLARE_CLASS(wxPaintDCEx)
|
||||
DECLARE_NO_COPY_CLASS(wxPaintDCEx)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_DCCLIENT_H_
|
45
include/wx/palmos/dcmemory.h
Normal file
45
include/wx/palmos/dcmemory.h
Normal file
@ -0,0 +1,45 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/dcmemory.h
|
||||
// Purpose: wxMemoryDC class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_DCMEMORY_H_
|
||||
#define _WX_DCMEMORY_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "dcmemory.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dcclient.h"
|
||||
|
||||
class WXDLLEXPORT wxMemoryDC : public wxDC
|
||||
{
|
||||
public:
|
||||
wxMemoryDC();
|
||||
wxMemoryDC(wxDC *dc); // Create compatible DC
|
||||
|
||||
virtual void SelectObject(const wxBitmap& bitmap);
|
||||
|
||||
protected:
|
||||
// override some base class virtuals
|
||||
virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
||||
virtual void DoGetSize(int* width, int* height) const;
|
||||
|
||||
// create DC compatible with the given one or screen if dc == NULL
|
||||
bool CreateCompatible(wxDC *dc);
|
||||
|
||||
// initialize the newly created DC
|
||||
void Init();
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxMemoryDC)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_DCMEMORY_H_
|
68
include/wx/palmos/dcprint.h
Normal file
68
include/wx/palmos/dcprint.h
Normal file
@ -0,0 +1,68 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/dcprint.h
|
||||
// Purpose: wxPrinterDC class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_DCPRINT_H_
|
||||
#define _WX_DCPRINT_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "dcprint.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_PRINTING_ARCHITECTURE
|
||||
|
||||
#include "wx/dc.h"
|
||||
#include "wx/cmndata.h"
|
||||
|
||||
class WXDLLEXPORT wxPrinterDC : public wxDC
|
||||
{
|
||||
public:
|
||||
// Create a printer DC (obsolete function: use wxPrintData version now)
|
||||
wxPrinterDC(const wxString& driver, const wxString& device, const wxString& output, bool interactive = TRUE, int orientation = wxPORTRAIT);
|
||||
|
||||
// Create from print data
|
||||
wxPrinterDC(const wxPrintData& data);
|
||||
|
||||
wxPrinterDC(WXHDC theDC);
|
||||
|
||||
// override some base class virtuals
|
||||
virtual bool StartDoc(const wxString& message);
|
||||
virtual void EndDoc();
|
||||
virtual void StartPage();
|
||||
virtual void EndPage();
|
||||
|
||||
protected:
|
||||
virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
|
||||
bool useMask = FALSE);
|
||||
virtual bool DoBlit(wxCoord xdest, wxCoord ydest,
|
||||
wxCoord width, wxCoord height,
|
||||
wxDC *source, wxCoord xsrc, wxCoord ysrc,
|
||||
int rop = wxCOPY, bool useMask = FALSE, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1);
|
||||
|
||||
// init the dc
|
||||
void Init();
|
||||
|
||||
wxPrintData m_printData;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxPrinterDC)
|
||||
};
|
||||
|
||||
// Gets an HDC for the default printer configuration
|
||||
// WXHDC WXDLLEXPORT wxGetPrinterDC(int orientation);
|
||||
|
||||
// Gets an HDC for the specified printer configuration
|
||||
WXHDC WXDLLEXPORT wxGetPrinterDC(const wxPrintData& data);
|
||||
|
||||
#endif // wxUSE_PRINTING_ARCHITECTURE
|
||||
|
||||
#endif
|
||||
// _WX_DCPRINT_H_
|
||||
|
41
include/wx/palmos/dcscreen.h
Normal file
41
include/wx/palmos/dcscreen.h
Normal file
@ -0,0 +1,41 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/dcscreen.h
|
||||
// Purpose: wxScreenDC class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_DCSCREEN_H_
|
||||
#define _WX_DCSCREEN_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "dcscreen.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dcclient.h"
|
||||
|
||||
class WXDLLEXPORT wxScreenDC : public wxWindowDC
|
||||
{
|
||||
public:
|
||||
// Create a DC representing the whole screen
|
||||
wxScreenDC();
|
||||
|
||||
// Compatibility with X's requirements for drawing on top of all windows
|
||||
static bool StartDrawingOnTop(wxWindow* WXUNUSED(window)) { return TRUE; }
|
||||
static bool StartDrawingOnTop(wxRect* WXUNUSED(rect) = NULL) { return TRUE; }
|
||||
static bool EndDrawingOnTop() { return TRUE; }
|
||||
|
||||
protected:
|
||||
virtual void DoGetSize(int *width, int *height) const;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxScreenDC)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_DCSCREEN_H_
|
||||
|
130
include/wx/palmos/dialog.h
Normal file
130
include/wx/palmos/dialog.h
Normal file
@ -0,0 +1,130 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/dialog.h
|
||||
// Purpose: wxDialog class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_DIALOG_H_
|
||||
#define _WX_DIALOG_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "dialog.h"
|
||||
#endif
|
||||
|
||||
#include "wx/panel.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxDialogNameStr;
|
||||
|
||||
class WXDLLEXPORT wxDialogModalData;
|
||||
|
||||
// Dialog boxes
|
||||
class WXDLLEXPORT wxDialog : public wxDialogBase
|
||||
{
|
||||
public:
|
||||
wxDialog() { Init(); }
|
||||
|
||||
// full ctor
|
||||
wxDialog(wxWindow *parent, wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_DIALOG_STYLE,
|
||||
const wxString& name = wxDialogNameStr)
|
||||
{
|
||||
Init();
|
||||
|
||||
(void)Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_DIALOG_STYLE,
|
||||
const wxString& name = wxDialogNameStr);
|
||||
|
||||
virtual ~wxDialog();
|
||||
|
||||
// return true if we're showing the dialog modally
|
||||
virtual bool IsModal() const { return m_modalData != NULL; }
|
||||
|
||||
// show the dialog modally and return the value passed to EndModal()
|
||||
virtual int ShowModal();
|
||||
|
||||
// may be called to terminate the dialog with the given return code
|
||||
virtual void EndModal(int retCode);
|
||||
|
||||
// implementation only from now on
|
||||
// -------------------------------
|
||||
|
||||
// override some base class virtuals
|
||||
virtual bool Show(bool show = TRUE);
|
||||
|
||||
virtual void Raise();
|
||||
|
||||
// event handlers
|
||||
void OnCharHook(wxKeyEvent& event);
|
||||
void OnCloseWindow(wxCloseEvent& event);
|
||||
|
||||
// Standard buttons
|
||||
void OnOK(wxCommandEvent& event);
|
||||
void OnApply(wxCommandEvent& event);
|
||||
void OnCancel(wxCommandEvent& event);
|
||||
|
||||
// Responds to colour changes
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
|
||||
// Windows callbacks
|
||||
WXLRESULT MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
#if wxUSE_CTL3D
|
||||
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
#endif // wxUSE_CTL3D
|
||||
|
||||
// obsolete methods
|
||||
// ----------------
|
||||
|
||||
// use the other ctor
|
||||
wxDEPRECATED( wxDialog(wxWindow *parent,
|
||||
const wxString& title, bool modal,
|
||||
int x = -1, int y= -1, int width = 500, int height = 500,
|
||||
long style = wxDEFAULT_DIALOG_STYLE,
|
||||
const wxString& name = wxDialogNameStr) );
|
||||
|
||||
// just call Show() or ShowModal()
|
||||
wxDEPRECATED( void SetModal(bool flag) );
|
||||
|
||||
// use IsModal()
|
||||
wxDEPRECATED( bool IsModalShowing() const );
|
||||
|
||||
protected:
|
||||
// find the window to use as parent for this dialog if none has been
|
||||
// specified explicitly by the user
|
||||
//
|
||||
// may return NULL
|
||||
wxWindow *FindSuitableParent() const;
|
||||
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
private:
|
||||
wxWindow* m_oldFocus;
|
||||
bool m_endModalCalled; // allow for closing within InitDialog
|
||||
|
||||
// this pointer is non-NULL only while the modal event loop is running
|
||||
wxDialogModalData *m_modalData;
|
||||
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxDialog)
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_NO_COPY_CLASS(wxDialog)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_DIALOG_H_
|
243
include/wx/palmos/dib.h
Normal file
243
include/wx/palmos/dib.h
Normal file
@ -0,0 +1,243 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/dib.h
|
||||
// Purpose: wxDIB class representing device independent bitmaps
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_PALMOS_DIB_H_
|
||||
#define _WX_PALMOS_DIB_H_
|
||||
|
||||
class WXDLLEXPORT wxBitmap;
|
||||
class WXDLLEXPORT wxPalette;
|
||||
|
||||
#include "wx/msw/private.h"
|
||||
|
||||
#if wxUSE_WXDIB
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxDIB: represents a DIB section
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxDIB
|
||||
{
|
||||
public:
|
||||
// ctors and such
|
||||
// --------------
|
||||
|
||||
// create an uninitialized DIB with the given width, height and depth (only
|
||||
// 24 and 32 bpp DIBs are currently supported)
|
||||
//
|
||||
// after using this ctor, GetData() and GetHandle() may be used if IsOk()
|
||||
// returns true
|
||||
wxDIB(int width, int height, int depth)
|
||||
{ Init(); (void)Create(width, height, depth); }
|
||||
|
||||
// create a DIB from the DDB
|
||||
wxDIB(const wxBitmap& bmp)
|
||||
{ Init(); (void)Create(bmp); }
|
||||
|
||||
// load a DIB from file (any depth is supoprted here unlike above)
|
||||
//
|
||||
// as above, use IsOk() to see if the bitmap was loaded successfully
|
||||
wxDIB(const wxString& filename)
|
||||
{ Init(); (void)Load(filename); }
|
||||
|
||||
// same as the corresponding ctors but with return value
|
||||
bool Create(int width, int height, int depth);
|
||||
bool Create(const wxBitmap& bmp);
|
||||
bool Load(const wxString& filename);
|
||||
|
||||
// dtor is not virtual, this class is not meant to be used polymorphically
|
||||
~wxDIB();
|
||||
|
||||
|
||||
// operations
|
||||
// ----------
|
||||
|
||||
#ifndef __WXWINCE__
|
||||
// create a bitmap compatiblr with the given HDC (or screen by default) and
|
||||
// return its handle, the caller is responsible for freeing it (using
|
||||
// DeleteObject())
|
||||
HBITMAP CreateDDB(HDC hdc = 0) const;
|
||||
#endif // !__WXWINCE__
|
||||
|
||||
// get the handle from the DIB and reset it, i.e. this object won't destroy
|
||||
// the DIB after this (but the caller should do it)
|
||||
HBITMAP Detach() { HBITMAP hbmp = m_handle; m_handle = 0; return hbmp; }
|
||||
|
||||
#if wxUSE_PALETTE
|
||||
// create a palette for this DIB (always a trivial/default one for 24bpp)
|
||||
wxPalette *CreatePalette() const;
|
||||
#endif // wxUSE_PALETTE
|
||||
|
||||
// save the DIB as a .BMP file to the file with the given name
|
||||
bool Save(const wxString& filename);
|
||||
|
||||
|
||||
// accessors
|
||||
// ---------
|
||||
|
||||
// return true if DIB was successfully created, false otherwise
|
||||
bool IsOk() const { return m_handle != 0; }
|
||||
|
||||
// get the bitmap size
|
||||
wxSize GetSize() const { DoGetObject(); return wxSize(m_width, m_height); }
|
||||
int GetWidth() const { DoGetObject(); return m_width; }
|
||||
int GetHeight() const { DoGetObject(); return m_height; }
|
||||
|
||||
// get the number of bits per pixel, or depth
|
||||
int GetDepth() const { DoGetObject(); return m_depth; }
|
||||
|
||||
// get the DIB handle
|
||||
HBITMAP GetHandle() const { return m_handle; }
|
||||
|
||||
// get raw pointer to bitmap bits, you should know what you do if you
|
||||
// decide to use it
|
||||
void *GetData() const { DoGetObject(); return m_data; }
|
||||
|
||||
|
||||
// HBITMAP conversion
|
||||
// ------------------
|
||||
|
||||
// these functions are only used by wxWidgets internally right now, please
|
||||
// don't use them directly if possible as they're subject to change
|
||||
|
||||
#ifndef __WXWINCE__
|
||||
// creates a DDB compatible with the given (or screen) DC from either
|
||||
// a plain DIB or a DIB section (in which case the last parameter must be
|
||||
// non NULL)
|
||||
static HBITMAP ConvertToBitmap(const BITMAPINFO *pbi,
|
||||
HDC hdc = 0,
|
||||
void *bits = NULL);
|
||||
|
||||
// create a plain DIB (not a DIB section) from a DDB, the caller is
|
||||
// responsable for freeing it using ::GlobalFree()
|
||||
static HGLOBAL ConvertFromBitmap(HBITMAP hbmp);
|
||||
|
||||
// creates a DIB from the given DDB or calculates the space needed by it:
|
||||
// if pbi is NULL, only the space is calculated, otherwise pbi is supposed
|
||||
// to point at BITMAPINFO of the correct size which is filled by this
|
||||
// function (this overload is needed for wxBitmapDataObject code in
|
||||
// src/msw/ole/dataobj.cpp)
|
||||
static size_t ConvertFromBitmap(BITMAPINFO *pbi, HBITMAP hbmp);
|
||||
#endif // __WXWINCE__
|
||||
|
||||
|
||||
// wxImage conversion
|
||||
// ------------------
|
||||
|
||||
#if wxUSE_IMAGE
|
||||
// create a DIB from the given image, the DIB will be either 24 or 32 (if
|
||||
// the image has alpha channel) bpp
|
||||
wxDIB(const wxImage& image) { Init(); (void)Create(image); }
|
||||
|
||||
// same as the above ctor but with the return code
|
||||
bool Create(const wxImage& image);
|
||||
|
||||
// create wxImage having the same data as this DIB
|
||||
wxImage ConvertToImage() const;
|
||||
#endif // wxUSE_IMAGE
|
||||
|
||||
|
||||
// helper functions
|
||||
// ----------------
|
||||
|
||||
// return the size of one line in a DIB with given width and depth: the
|
||||
// point here is that as the scan lines need to be DWORD aligned so we may
|
||||
// need to add some padding
|
||||
static unsigned long GetLineSize(int width, int depth)
|
||||
{
|
||||
return ((width*depth + 31) & ~31) >> 3;
|
||||
}
|
||||
|
||||
private:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
// free resources
|
||||
void Free();
|
||||
|
||||
// initialize the contents from the provided DDB (Create() must have been
|
||||
// already called)
|
||||
bool CopyFromDDB(HBITMAP hbmp);
|
||||
|
||||
|
||||
// the DIB section handle, 0 if invalid
|
||||
HBITMAP m_handle;
|
||||
|
||||
// NB: we could store only m_handle and not any of the other fields as
|
||||
// we may always retrieve them from it using ::GetObject(), but we
|
||||
// decide to still store them for efficiency concerns -- however if we
|
||||
// don't have them from the very beginning (e.g. DIB constructed from a
|
||||
// bitmap), we only retrieve them when necessary and so these fields
|
||||
// should *never* be accessed directly, even from inside wxDIB code
|
||||
|
||||
// function which must be called before accessing any members and which
|
||||
// gets their values from m_handle, if not done yet
|
||||
void DoGetObject() const;
|
||||
|
||||
// pointer to DIB bits, may be NULL
|
||||
void *m_data;
|
||||
|
||||
// size and depth of the image
|
||||
int m_width,
|
||||
m_height,
|
||||
m_depth;
|
||||
|
||||
// in some cases we could be using a handle which we didn't create and in
|
||||
// this case we shouldn't free it neither -- this flag tell us if this is
|
||||
// the case
|
||||
bool m_ownsHandle;
|
||||
|
||||
|
||||
// DIBs can't be copied
|
||||
wxDIB(const wxDIB&);
|
||||
wxDIB& operator=(const wxDIB&);
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// inline functions implementation
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
inline
|
||||
void wxDIB::Init()
|
||||
{
|
||||
m_handle = 0;
|
||||
m_ownsHandle = true;
|
||||
|
||||
m_data = NULL;
|
||||
|
||||
m_width =
|
||||
m_height =
|
||||
m_depth = 0;
|
||||
}
|
||||
|
||||
inline
|
||||
void wxDIB::Free()
|
||||
{
|
||||
if ( m_handle && m_ownsHandle )
|
||||
{
|
||||
if ( !::DeleteObject(m_handle) )
|
||||
{
|
||||
wxLogLastError(wxT("DeleteObject(hDIB)"));
|
||||
}
|
||||
|
||||
Init();
|
||||
}
|
||||
}
|
||||
|
||||
inline wxDIB::~wxDIB()
|
||||
{
|
||||
Free();
|
||||
}
|
||||
|
||||
#endif
|
||||
// wxUSE_WXDIB
|
||||
|
||||
#endif // _WX_PALMOS_DIB_H_
|
||||
|
49
include/wx/palmos/dirdlg.h
Normal file
49
include/wx/palmos/dirdlg.h
Normal file
@ -0,0 +1,49 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/dirdlg.h
|
||||
// Purpose: wxDirDialog class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_DIRDLG_H_
|
||||
#define _WX_DIRDLG_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "dirdlg.h"
|
||||
#endif
|
||||
|
||||
class WXDLLEXPORT wxDirDialog : public wxDialog
|
||||
{
|
||||
public:
|
||||
wxDirDialog(wxWindow *parent,
|
||||
const wxString& message = wxDirSelectorPromptStr,
|
||||
const wxString& defaultPath = wxEmptyString,
|
||||
long style = 0,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const wxString& name = wxDirDialogNameStr);
|
||||
|
||||
void SetMessage(const wxString& message) { m_message = message; }
|
||||
void SetPath(const wxString& path);
|
||||
void SetStyle(long style) { SetWindowStyle(style); }
|
||||
|
||||
wxString GetMessage() const { return m_message; }
|
||||
wxString GetPath() const { return m_path; }
|
||||
long GetStyle() const { return GetWindowStyle(); }
|
||||
|
||||
virtual int ShowModal();
|
||||
|
||||
protected:
|
||||
wxString m_message;
|
||||
wxString m_path;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDirDialog)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_DIRDLG_H_
|
56
include/wx/palmos/display.h
Normal file
56
include/wx/palmos/display.h
Normal file
@ -0,0 +1,56 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: display.h
|
||||
// Purpose: wxDisplay class customization for Palm OS
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "display.h"
|
||||
#endif
|
||||
|
||||
#ifndef _WX_PALMOS_DISPLAY_H_
|
||||
#define _WX_PALMOS_DISPLAY_H_
|
||||
|
||||
class WXDLLEXPORT wxDisplay : public wxDisplayBase
|
||||
{
|
||||
public:
|
||||
// this function may be called *before* using any other wxDisplay methods
|
||||
// to tell it to use DirectX functions instead of the standard Windows ones
|
||||
static void UseDirectX(bool useDX);
|
||||
|
||||
// create the display object for the given physical display
|
||||
wxDisplay(size_t index = 0);
|
||||
|
||||
virtual ~wxDisplay();
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual bool IsOk() const;
|
||||
virtual wxRect GetGeometry() const;
|
||||
virtual wxString GetName() const;
|
||||
|
||||
virtual wxArrayVideoModes
|
||||
GetModes(const wxVideoMode& mode = wxVideoMode()) const;
|
||||
virtual wxVideoMode GetCurrentMode() const;
|
||||
virtual bool ChangeMode(const wxVideoMode& mode = wxVideoMode());
|
||||
|
||||
private:
|
||||
// get the display name to use with EnumDisplaySettings()
|
||||
wxString GetNameForEnumSettings() const;
|
||||
|
||||
// we have different implementations using DirectDraw and without it
|
||||
wxArrayVideoModes DoGetModesDirectX(const wxVideoMode& modeMatch) const;
|
||||
bool DoChangeModeDirectX(const wxVideoMode& mode);
|
||||
|
||||
wxArrayVideoModes DoGetModesWindows(const wxVideoMode& modeMatch) const;
|
||||
bool DoChangeModeWindows(const wxVideoMode& mode);
|
||||
|
||||
|
||||
DECLARE_NO_COPY_CLASS(wxDisplay)
|
||||
};
|
||||
|
||||
#endif // _WX_PALMOS_DISPLAY_H_
|
275
include/wx/palmos/dragimag.h
Normal file
275
include/wx/palmos/dragimag.h
Normal file
@ -0,0 +1,275 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/dragimag.h
|
||||
// Purpose: wxDragImage class: a kind of a cursor, that can cope
|
||||
// with more sophisticated images
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_DRAGIMAG_H_
|
||||
#define _WX_DRAGIMAG_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "dragimag.h"
|
||||
#endif
|
||||
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/icon.h"
|
||||
#include "wx/cursor.h"
|
||||
#include "wx/treectrl.h"
|
||||
#include "wx/listctrl.h"
|
||||
|
||||
// If 1, use a simple wxCursor instead of ImageList_SetDragCursorImage
|
||||
#define wxUSE_SIMPLER_DRAGIMAGE 0
|
||||
|
||||
/*
|
||||
To use this class, create a wxDragImage when you start dragging, for example:
|
||||
|
||||
void MyTreeCtrl::OnBeginDrag(wxTreeEvent& event)
|
||||
{
|
||||
#ifdef __WXMSW__
|
||||
::UpdateWindow((HWND) GetHWND()); // We need to implement this in wxWidgets
|
||||
#endif
|
||||
|
||||
CaptureMouse();
|
||||
|
||||
m_dragImage = new wxDragImage(* this, itemId);
|
||||
m_dragImage->BeginDrag(wxPoint(0, 0), this);
|
||||
m_dragImage->Move(pt, this);
|
||||
m_dragImage->Show(this);
|
||||
...
|
||||
}
|
||||
|
||||
In your OnMouseMove function, hide the image, do any display updating required,
|
||||
then move and show the image again:
|
||||
|
||||
void MyTreeCtrl::OnMouseMove(wxMouseEvent& event)
|
||||
{
|
||||
if (m_dragMode == MY_TREE_DRAG_NONE)
|
||||
{
|
||||
event.Skip();
|
||||
return;
|
||||
}
|
||||
|
||||
// Prevent screen corruption by hiding the image
|
||||
if (m_dragImage)
|
||||
m_dragImage->Hide(this);
|
||||
|
||||
// Do some updating of the window, such as highlighting the drop target
|
||||
...
|
||||
|
||||
#ifdef __WXMSW__
|
||||
if (updateWindow)
|
||||
::UpdateWindow((HWND) GetHWND());
|
||||
#endif
|
||||
|
||||
// Move and show the image again
|
||||
m_dragImage->Move(event.GetPosition(), this);
|
||||
m_dragImage->Show(this);
|
||||
}
|
||||
|
||||
Eventually we end the drag and delete the drag image.
|
||||
|
||||
void MyTreeCtrl::OnLeftUp(wxMouseEvent& event)
|
||||
{
|
||||
...
|
||||
|
||||
// End the drag and delete the drag image
|
||||
if (m_dragImage)
|
||||
{
|
||||
m_dragImage->EndDrag(this);
|
||||
delete m_dragImage;
|
||||
m_dragImage = NULL;
|
||||
}
|
||||
ReleaseMouse();
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
Notes for Unix version:
|
||||
Can we simply use cursors instead, creating a cursor dynamically, setting it into the window
|
||||
in BeginDrag, and restoring the old cursor in EndDrag?
|
||||
For a really bog-standard implementation, we could simply use a normal dragging cursor
|
||||
and ignore the image.
|
||||
*/
|
||||
|
||||
/*
|
||||
* wxDragImage
|
||||
*/
|
||||
|
||||
class WXDLLEXPORT wxDragImage: public wxObject
|
||||
{
|
||||
public:
|
||||
|
||||
// Ctors & dtor
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
wxDragImage();
|
||||
wxDragImage(const wxBitmap& image, const wxCursor& cursor = wxNullCursor)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(image, cursor);
|
||||
}
|
||||
|
||||
// Deprecated form of the above
|
||||
wxDragImage(const wxBitmap& image, const wxCursor& cursor, const wxPoint& cursorHotspot)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(image, cursor, cursorHotspot);
|
||||
}
|
||||
|
||||
wxDragImage(const wxIcon& image, const wxCursor& cursor = wxNullCursor)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(image, cursor);
|
||||
}
|
||||
|
||||
// Deprecated form of the above
|
||||
wxDragImage(const wxIcon& image, const wxCursor& cursor, const wxPoint& cursorHotspot)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(image, cursor, cursorHotspot);
|
||||
}
|
||||
|
||||
wxDragImage(const wxString& str, const wxCursor& cursor = wxNullCursor)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(str, cursor);
|
||||
}
|
||||
|
||||
// Deprecated form of the above
|
||||
wxDragImage(const wxString& str, const wxCursor& cursor, const wxPoint& cursorHotspot)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(str, cursor, cursorHotspot);
|
||||
}
|
||||
|
||||
#if wxUSE_TREECTRL
|
||||
wxDragImage(const wxTreeCtrl& treeCtrl, wxTreeItemId& id)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(treeCtrl, id);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if wxUSE_LISTCTRL
|
||||
wxDragImage(const wxListCtrl& listCtrl, long id)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(listCtrl, id);
|
||||
}
|
||||
#endif
|
||||
|
||||
~wxDragImage();
|
||||
|
||||
// Attributes
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Operations
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Create a drag image from a bitmap and optional cursor
|
||||
bool Create(const wxBitmap& image, const wxCursor& cursor = wxNullCursor);
|
||||
bool Create(const wxBitmap& image, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot))
|
||||
{
|
||||
wxLogDebug(wxT("wxDragImage::Create: use of a cursor hotspot is now deprecated. Please omit this argument."));
|
||||
return Create(image, cursor);
|
||||
}
|
||||
|
||||
// Create a drag image from an icon and optional cursor
|
||||
bool Create(const wxIcon& image, const wxCursor& cursor = wxNullCursor);
|
||||
bool Create(const wxIcon& image, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot))
|
||||
{
|
||||
wxLogDebug(wxT("wxDragImage::Create: use of a cursor hotspot is now deprecated. Please omit this argument."));
|
||||
return Create(image, cursor);
|
||||
}
|
||||
|
||||
// Create a drag image from a string and optional cursor
|
||||
bool Create(const wxString& str, const wxCursor& cursor = wxNullCursor);
|
||||
bool Create(const wxString& str, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot))
|
||||
{
|
||||
wxLogDebug(wxT("wxDragImage::Create: use of a cursor hotspot is now deprecated. Please omit this argument."));
|
||||
return Create(str, cursor);
|
||||
}
|
||||
|
||||
#if wxUSE_TREECTRL
|
||||
// Create a drag image for the given tree control item
|
||||
bool Create(const wxTreeCtrl& treeCtrl, wxTreeItemId& id);
|
||||
#endif
|
||||
|
||||
#if wxUSE_LISTCTRL
|
||||
// Create a drag image for the given list control item
|
||||
bool Create(const wxListCtrl& listCtrl, long id);
|
||||
#endif
|
||||
|
||||
// Begin drag. hotspot is the location of the drag position relative to the upper-left
|
||||
// corner of the image.
|
||||
bool BeginDrag(const wxPoint& hotspot, wxWindow* window, bool fullScreen = FALSE, wxRect* rect = (wxRect*) NULL);
|
||||
|
||||
// Begin drag. hotspot is the location of the drag position relative to the upper-left
|
||||
// corner of the image. This is full screen only. fullScreenRect gives the
|
||||
// position of the window on the screen, to restrict the drag to.
|
||||
bool BeginDrag(const wxPoint& hotspot, wxWindow* window, wxWindow* fullScreenRect);
|
||||
|
||||
// End drag
|
||||
bool EndDrag();
|
||||
|
||||
// Move the image: call from OnMouseMove. Pt is in window client coordinates if window
|
||||
// is non-NULL, or in screen coordinates if NULL.
|
||||
bool Move(const wxPoint& pt);
|
||||
|
||||
// Show the image
|
||||
bool Show();
|
||||
|
||||
// Hide the image
|
||||
bool Hide();
|
||||
|
||||
// Implementation
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Initialize variables
|
||||
void Init();
|
||||
|
||||
// Returns the native image list handle
|
||||
WXHIMAGELIST GetHIMAGELIST() const { return m_hImageList; }
|
||||
|
||||
#if !wxUSE_SIMPLER_DRAGIMAGE
|
||||
// Returns the native image list handle for the cursor
|
||||
WXHIMAGELIST GetCursorHIMAGELIST() const { return m_hCursorImageList; }
|
||||
#endif
|
||||
|
||||
protected:
|
||||
WXHIMAGELIST m_hImageList;
|
||||
|
||||
#if wxUSE_SIMPLER_DRAGIMAGE
|
||||
wxCursor m_oldCursor;
|
||||
#else
|
||||
WXHIMAGELIST m_hCursorImageList;
|
||||
#endif
|
||||
|
||||
wxCursor m_cursor;
|
||||
// wxPoint m_cursorHotspot; // Obsolete
|
||||
wxPoint m_position;
|
||||
wxWindow* m_window;
|
||||
wxRect m_boundingRect;
|
||||
bool m_fullScreen;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxDragImage)
|
||||
DECLARE_NO_COPY_CLASS(wxDragImage)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_DRAGIMAG_H_
|
180
include/wx/palmos/enhmeta.h
Normal file
180
include/wx/palmos/enhmeta.h
Normal file
@ -0,0 +1,180 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/enhmeta.h
|
||||
// Purpose: wxEnhMetaFile class for Win32
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_PALMOS_ENHMETA_H_
|
||||
#define _WX_PALMOS_ENHMETA_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "enhmeta.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dc.h"
|
||||
|
||||
#if wxUSE_DRAG_AND_DROP
|
||||
#include "wx/dataobj.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxEnhMetaFile: encapsulation of Win32 HENHMETAFILE
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxEnhMetaFile : public wxObject
|
||||
{
|
||||
public:
|
||||
wxEnhMetaFile(const wxString& file = wxEmptyString) : m_filename(file)
|
||||
{ Init(); }
|
||||
wxEnhMetaFile(const wxEnhMetaFile& metafile)
|
||||
{ Init(); Assign(metafile); }
|
||||
wxEnhMetaFile& operator=(const wxEnhMetaFile& metafile)
|
||||
{ Free(); Assign(metafile); return *this; }
|
||||
|
||||
virtual ~wxEnhMetaFile()
|
||||
{ Free(); }
|
||||
|
||||
// display the picture stored in the metafile on the given DC
|
||||
bool Play(wxDC *dc, wxRect *rectBound = (wxRect *)NULL);
|
||||
|
||||
// accessors
|
||||
bool Ok() const { return m_hMF != 0; }
|
||||
|
||||
wxSize GetSize() const;
|
||||
int GetWidth() const { return GetSize().x; }
|
||||
int GetHeight() const { return GetSize().y; }
|
||||
|
||||
const wxString& GetFileName() const { return m_filename; }
|
||||
|
||||
// copy the metafile to the clipboard: the width and height parameters are
|
||||
// for backwards compatibility (with wxMetaFile) only, they are ignored by
|
||||
// this method
|
||||
bool SetClipboard(int width = 0, int height = 0);
|
||||
|
||||
// implementation
|
||||
WXHANDLE GetHENHMETAFILE() const { return m_hMF; }
|
||||
void SetHENHMETAFILE(WXHANDLE hMF) { Free(); m_hMF = hMF; }
|
||||
|
||||
protected:
|
||||
void Init() { m_hMF = 0; }
|
||||
void Free();
|
||||
void Assign(const wxEnhMetaFile& mf);
|
||||
|
||||
private:
|
||||
wxString m_filename;
|
||||
WXHANDLE m_hMF;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxEnhMetaFile)
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxEnhMetaFileDC: allows to create a wxEnhMetaFile
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxEnhMetaFileDC : public wxDC
|
||||
{
|
||||
public:
|
||||
// the ctor parameters specify the filename (empty for memory metafiles),
|
||||
// the metafile picture size and the optional description/comment
|
||||
wxEnhMetaFileDC(const wxString& filename = wxEmptyString,
|
||||
int width = 0, int height = 0,
|
||||
const wxString& description = wxEmptyString);
|
||||
|
||||
virtual ~wxEnhMetaFileDC();
|
||||
|
||||
// obtain a pointer to the new metafile (caller should delete it)
|
||||
wxEnhMetaFile *Close();
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxEnhMetaFileDC)
|
||||
};
|
||||
|
||||
#if wxUSE_DRAG_AND_DROP
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxEnhMetaFileDataObject is a specialization of wxDataObject for enh metafile
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// notice that we want to support both CF_METAFILEPICT and CF_ENHMETAFILE and
|
||||
// so we derive from wxDataObject and not from wxDataObjectSimple
|
||||
class WXDLLEXPORT wxEnhMetaFileDataObject : public wxDataObject
|
||||
{
|
||||
public:
|
||||
// ctors
|
||||
wxEnhMetaFileDataObject() { }
|
||||
wxEnhMetaFileDataObject(const wxEnhMetaFile& metafile)
|
||||
: m_metafile(metafile) { }
|
||||
|
||||
// virtual functions which you may override if you want to provide data on
|
||||
// demand only - otherwise, the trivial default versions will be used
|
||||
virtual void SetMetafile(const wxEnhMetaFile& metafile)
|
||||
{ m_metafile = metafile; }
|
||||
virtual wxEnhMetaFile GetMetafile() const
|
||||
{ return m_metafile; }
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual wxDataFormat GetPreferredFormat(Direction dir) const;
|
||||
virtual size_t GetFormatCount(Direction dir) const;
|
||||
virtual void GetAllFormats(wxDataFormat *formats, Direction dir) const;
|
||||
virtual size_t GetDataSize(const wxDataFormat& format) const;
|
||||
virtual bool GetDataHere(const wxDataFormat& format, void *buf) const;
|
||||
virtual bool SetData(const wxDataFormat& format, size_t len,
|
||||
const void *buf);
|
||||
|
||||
protected:
|
||||
wxEnhMetaFile m_metafile;
|
||||
|
||||
DECLARE_NO_COPY_CLASS(wxEnhMetaFileDataObject)
|
||||
};
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxEnhMetaFileSimpleDataObject does derive from wxDataObjectSimple which
|
||||
// makes it more convenient to use (it can be used with wxDataObjectComposite)
|
||||
// at the price of not supoprting any more CF_METAFILEPICT but only
|
||||
// CF_ENHMETAFILE
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxEnhMetaFileSimpleDataObject : public wxDataObjectSimple
|
||||
{
|
||||
public:
|
||||
// ctors
|
||||
wxEnhMetaFileSimpleDataObject() : wxDataObjectSimple(wxDF_ENHMETAFILE) { }
|
||||
wxEnhMetaFileSimpleDataObject(const wxEnhMetaFile& metafile)
|
||||
: wxDataObjectSimple(wxDF_ENHMETAFILE), m_metafile(metafile) { }
|
||||
|
||||
// virtual functions which you may override if you want to provide data on
|
||||
// demand only - otherwise, the trivial default versions will be used
|
||||
virtual void SetEnhMetafile(const wxEnhMetaFile& metafile)
|
||||
{ m_metafile = metafile; }
|
||||
virtual wxEnhMetaFile GetEnhMetafile() const
|
||||
{ return m_metafile; }
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual size_t GetDataSize() const;
|
||||
virtual bool GetDataHere(void *buf) const;
|
||||
virtual bool SetData(size_t len, const void *buf);
|
||||
|
||||
virtual size_t GetDataSize(const wxDataFormat& WXUNUSED(format)) const
|
||||
{ return GetDataSize(); }
|
||||
virtual bool GetDataHere(const wxDataFormat& WXUNUSED(format),
|
||||
void *buf) const
|
||||
{ return GetDataHere(buf); }
|
||||
virtual bool SetData(const wxDataFormat& WXUNUSED(format),
|
||||
size_t len, const void *buf)
|
||||
{ return SetData(len, buf); }
|
||||
|
||||
protected:
|
||||
wxEnhMetaFile m_metafile;
|
||||
|
||||
DECLARE_NO_COPY_CLASS(wxEnhMetaFileSimpleDataObject)
|
||||
};
|
||||
|
||||
#endif // wxUSE_DRAG_AND_DROP
|
||||
|
||||
#endif // _WX_PALMOS_ENHMETA_H_
|
50
include/wx/palmos/evtloop.h
Normal file
50
include/wx/palmos/evtloop.h
Normal file
@ -0,0 +1,50 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/evtloop.h
|
||||
// Purpose: wxEventLoop class for Palm OS
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 2004-10-14
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_PALMOS_EVTLOOP_H_
|
||||
#define _WX_PALMOS_EVTLOOP_H_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxEventLoop
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxEventLoop : public wxEventLoopBase
|
||||
{
|
||||
public:
|
||||
wxEventLoop();
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual int Run();
|
||||
virtual void Exit(int rc = 0);
|
||||
virtual bool Pending() const;
|
||||
virtual bool Dispatch();
|
||||
virtual bool IsRunning() const;
|
||||
|
||||
// MSW-specific methods
|
||||
// --------------------
|
||||
|
||||
// preprocess a message, return true if processed (i.e. no further
|
||||
// dispatching required)
|
||||
virtual bool PreProcessMessage(WXMSG *msg);
|
||||
|
||||
// process a single message
|
||||
virtual void ProcessMessage(WXMSG *msg);
|
||||
|
||||
protected:
|
||||
// should we exit the loop?
|
||||
bool m_shouldExit;
|
||||
|
||||
// the loop exit code
|
||||
int m_exitcode;
|
||||
};
|
||||
|
||||
#endif // _WX_PALMOS_EVTLOOP_H_
|
||||
|
63
include/wx/palmos/fdrepdlg.h
Normal file
63
include/wx/palmos/fdrepdlg.h
Normal file
@ -0,0 +1,63 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/fdrepdlg.h
|
||||
// Purpose: wxFindReplaceDialog class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "mswfdrepdlg.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFindReplaceDialog: dialog for searching / replacing text
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxFindReplaceDialog : public wxFindReplaceDialogBase
|
||||
{
|
||||
public:
|
||||
// ctors and such
|
||||
wxFindReplaceDialog() { Init(); }
|
||||
wxFindReplaceDialog(wxWindow *parent,
|
||||
wxFindReplaceData *data,
|
||||
const wxString &title,
|
||||
int style = 0);
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxFindReplaceData *data,
|
||||
const wxString &title,
|
||||
int style = 0);
|
||||
|
||||
virtual ~wxFindReplaceDialog();
|
||||
|
||||
// implementation only from now on
|
||||
|
||||
wxFindReplaceDialogImpl *GetImpl() const { return m_impl; }
|
||||
|
||||
// override some base class virtuals
|
||||
virtual bool Show(bool show = TRUE);
|
||||
virtual void SetTitle( const wxString& title);
|
||||
virtual wxString GetTitle() const;
|
||||
|
||||
protected:
|
||||
virtual void DoGetSize(int *width, int *height) const;
|
||||
virtual void DoGetClientSize(int *width, int *height) const;
|
||||
virtual void DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
|
||||
void Init();
|
||||
|
||||
wxString m_title;
|
||||
|
||||
wxFindReplaceDialogImpl *m_impl;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxFindReplaceDialog)
|
||||
DECLARE_NO_COPY_CLASS(wxFindReplaceDialog)
|
||||
};
|
||||
|
||||
|
48
include/wx/palmos/filedlg.h
Normal file
48
include/wx/palmos/filedlg.h
Normal file
@ -0,0 +1,48 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/filedlg.h
|
||||
// Purpose: wxFileDialog class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_FILEDLG_H_
|
||||
#define _WX_FILEDLG_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "filedlg.h"
|
||||
#endif
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// wxFileDialog
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxFileDialog: public wxFileDialogBase
|
||||
{
|
||||
public:
|
||||
wxFileDialog(wxWindow *parent,
|
||||
const wxString& message = wxFileSelectorPromptStr,
|
||||
const wxString& defaultDir = wxEmptyString,
|
||||
const wxString& defaultFile = wxEmptyString,
|
||||
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||
long style = 0,
|
||||
const wxPoint& pos = wxDefaultPosition);
|
||||
|
||||
virtual void SetPath(const wxString& path);
|
||||
virtual void GetPaths(wxArrayString& paths) const;
|
||||
virtual void GetFilenames(wxArrayString& files) const;
|
||||
|
||||
virtual int ShowModal();
|
||||
|
||||
private:
|
||||
wxArrayString m_fileNames;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxFileDialog)
|
||||
DECLARE_NO_COPY_CLASS(wxFileDialog)
|
||||
};
|
||||
|
||||
#endif // _WX_FILEDLG_H_
|
||||
|
162
include/wx/palmos/font.h
Normal file
162
include/wx/palmos/font.h
Normal file
@ -0,0 +1,162 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: font.h
|
||||
// Purpose: wxFont class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/14/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_FONT_H_
|
||||
#define _WX_FONT_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "font.h"
|
||||
#endif
|
||||
|
||||
#include <wx/gdicmn.h>
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFont
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxFont : public wxFontBase
|
||||
{
|
||||
public:
|
||||
// ctors and such
|
||||
wxFont() { Init(); }
|
||||
wxFont(const wxFont& font) : wxFontBase(font) { Init(); Ref(font); }
|
||||
|
||||
wxFont(int size,
|
||||
int family,
|
||||
int style,
|
||||
int weight,
|
||||
bool underlined = false,
|
||||
const wxString& face = wxEmptyString,
|
||||
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
|
||||
{
|
||||
Init();
|
||||
|
||||
(void)Create(size, family, style, weight, underlined, face, encoding);
|
||||
}
|
||||
|
||||
wxFont(const wxSize& pixelSize,
|
||||
int family,
|
||||
int style,
|
||||
int weight,
|
||||
bool underlined = false,
|
||||
const wxString& face = wxEmptyString,
|
||||
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
|
||||
{
|
||||
Init();
|
||||
|
||||
(void)Create(pixelSize, family, style, weight,
|
||||
underlined, face, encoding);
|
||||
}
|
||||
|
||||
wxFont(const wxNativeFontInfo& info, WXHFONT hFont = 0)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(info, hFont);
|
||||
}
|
||||
|
||||
wxFont(const wxString& fontDesc);
|
||||
|
||||
bool Create(int size,
|
||||
int family,
|
||||
int style,
|
||||
int weight,
|
||||
bool underlined = false,
|
||||
const wxString& face = wxEmptyString,
|
||||
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
|
||||
{
|
||||
return DoCreate(size, wxDefaultSize, false, family, style,
|
||||
weight, underlined, face, encoding);
|
||||
}
|
||||
|
||||
bool Create(const wxSize& pixelSize,
|
||||
int family,
|
||||
int style,
|
||||
int weight,
|
||||
bool underlined = false,
|
||||
const wxString& face = wxEmptyString,
|
||||
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
|
||||
{
|
||||
return DoCreate(-1, pixelSize, true, family, style,
|
||||
weight, underlined, face, encoding);
|
||||
}
|
||||
|
||||
bool Create(const wxNativeFontInfo& info, WXHFONT hFont = 0);
|
||||
|
||||
virtual ~wxFont();
|
||||
|
||||
// assignment
|
||||
wxFont& operator=(const wxFont& font);
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual int GetPointSize() const;
|
||||
virtual wxSize GetPixelSize() const;
|
||||
virtual bool IsUsingSizeInPixels() const;
|
||||
virtual int GetFamily() const;
|
||||
virtual int GetStyle() const;
|
||||
virtual int GetWeight() const;
|
||||
virtual bool GetUnderlined() const;
|
||||
virtual wxString GetFaceName() const;
|
||||
virtual wxFontEncoding GetEncoding() const;
|
||||
virtual const wxNativeFontInfo *GetNativeFontInfo() const;
|
||||
|
||||
virtual void SetPointSize(int pointSize);
|
||||
virtual void SetPixelSize(const wxSize& pixelSize);
|
||||
virtual void SetFamily(int family);
|
||||
virtual void SetStyle(int style);
|
||||
virtual void SetWeight(int weight);
|
||||
virtual void SetFaceName(const wxString& faceName);
|
||||
virtual void SetUnderlined(bool underlined);
|
||||
virtual void SetEncoding(wxFontEncoding encoding);
|
||||
|
||||
virtual bool IsFixedWidth() const;
|
||||
|
||||
// implementation only from now on
|
||||
// -------------------------------
|
||||
|
||||
virtual bool IsFree() const;
|
||||
virtual bool RealizeResource();
|
||||
virtual WXHANDLE GetResourceHandle() const;
|
||||
virtual bool FreeResource(bool force = false);
|
||||
|
||||
// for consistency with other wxMSW classes
|
||||
WXHFONT GetHFONT() const;
|
||||
|
||||
/*
|
||||
virtual bool UseResource();
|
||||
virtual bool ReleaseResource();
|
||||
*/
|
||||
|
||||
protected:
|
||||
// real font creation function, used in all cases
|
||||
bool DoCreate(int size,
|
||||
const wxSize& pixelSize,
|
||||
bool sizeUsingPixels,
|
||||
int family,
|
||||
int style,
|
||||
int weight,
|
||||
bool underlined = false,
|
||||
const wxString& face = wxEmptyString,
|
||||
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
|
||||
|
||||
virtual void DoSetNativeFontInfo(const wxNativeFontInfo& info);
|
||||
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
void Unshare();
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxFont)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_FONT_H_
|
44
include/wx/palmos/fontdlg.h
Normal file
44
include/wx/palmos/fontdlg.h
Normal file
@ -0,0 +1,44 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: fontdlg.h
|
||||
// Purpose: wxFontDialog class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_PALMOS_FONTDLG_H_
|
||||
#define _WX_PALMOS_FONTDLG_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "fontdlg.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFontDialog
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxFontDialog : public wxFontDialogBase
|
||||
{
|
||||
public:
|
||||
wxFontDialog() : wxFontDialogBase() { /* must be Create()d later */ }
|
||||
wxFontDialog(wxWindow *parent)
|
||||
: wxFontDialogBase(parent) { Create(parent); }
|
||||
wxFontDialog(wxWindow *parent, const wxFontData& data)
|
||||
: wxFontDialogBase(parent, data) { Create(parent, data); }
|
||||
|
||||
virtual int ShowModal();
|
||||
|
||||
// deprecated interface, don't use
|
||||
wxFontDialog(wxWindow *parent, const wxFontData *data)
|
||||
: wxFontDialogBase(parent, data) { Create(parent, data); }
|
||||
|
||||
protected:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxFontDialog)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_PALMOS_FONTDLG_H_
|
||||
|
45
include/wx/palmos/fontenum.h
Normal file
45
include/wx/palmos/fontenum.h
Normal file
@ -0,0 +1,45 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: fontenum.h
|
||||
// Purpose: wxFontEnumerator class for Palm OS
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_FONTENUM_H_
|
||||
#define _WX_FONTENUM_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "fontenum.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* wxFontEnumerator: for gathering font information
|
||||
*/
|
||||
|
||||
class wxFontEnumerator: public wxObject
|
||||
{
|
||||
DECLARE_CLASS(wxFontEnumerator)
|
||||
public:
|
||||
wxFontEnumerator() {};
|
||||
|
||||
// Enumerate the fonts.
|
||||
bool Enumerate();
|
||||
|
||||
// Stop enumeration if FALSE is returned.
|
||||
// By default, the enumerator stores the facenames in a list for
|
||||
// retrieval via GetFacenames().
|
||||
virtual bool OnFont(const wxFont& font);
|
||||
|
||||
// Return the list of facenames.
|
||||
wxStringList& GetFacenames() { return (wxStringList&) m_faceNames; }
|
||||
protected:
|
||||
wxStringList m_faceNames;
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_FONTENUM_H_
|
||||
|
169
include/wx/palmos/frame.h
Normal file
169
include/wx/palmos/frame.h
Normal file
@ -0,0 +1,169 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/frame.h
|
||||
// Purpose: wxFrame class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_FRAME_H_
|
||||
#define _WX_FRAME_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "frame.h"
|
||||
#endif
|
||||
|
||||
class WXDLLEXPORT wxFrame : public wxFrameBase
|
||||
{
|
||||
public:
|
||||
// construction
|
||||
wxFrame() { Init(); }
|
||||
wxFrame(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
|
||||
virtual ~wxFrame();
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
|
||||
virtual void Raise();
|
||||
|
||||
// implementation only from now on
|
||||
// -------------------------------
|
||||
|
||||
// event handlers
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
// Toolbar
|
||||
#if wxUSE_TOOLBAR
|
||||
virtual wxToolBar* CreateToolBar(long style = -1,
|
||||
wxWindowID id = -1,
|
||||
const wxString& name = wxToolBarNameStr);
|
||||
|
||||
virtual void PositionToolBar();
|
||||
#endif // wxUSE_TOOLBAR
|
||||
|
||||
// Status bar
|
||||
#if wxUSE_STATUSBAR
|
||||
virtual wxStatusBar* OnCreateStatusBar(int number = 1,
|
||||
long style = wxST_SIZEGRIP,
|
||||
wxWindowID id = 0,
|
||||
const wxString& name = wxStatusLineNameStr);
|
||||
|
||||
virtual void PositionStatusBar();
|
||||
|
||||
// Hint to tell framework which status bar to use: the default is to use
|
||||
// native one for the platforms which support it (Win32), the generic one
|
||||
// otherwise
|
||||
|
||||
// TODO: should this go into a wxFrameworkSettings class perhaps?
|
||||
static void UseNativeStatusBar(bool useNative)
|
||||
{ m_useNativeStatusBar = useNative; };
|
||||
static bool UsesNativeStatusBar()
|
||||
{ return m_useNativeStatusBar; };
|
||||
#endif // wxUSE_STATUSBAR
|
||||
|
||||
WXHMENU GetWinMenu() const { return m_hMenu; }
|
||||
|
||||
// event handlers
|
||||
bool HandlePaint();
|
||||
bool HandleSize(int x, int y, WXUINT flag);
|
||||
bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control);
|
||||
bool HandleMenuLoop(const wxEventType& evtType, WXWORD isPopup);
|
||||
|
||||
// tooltip management
|
||||
#if wxUSE_TOOLTIPS
|
||||
WXHWND GetToolTipCtrl() const { return m_hwndToolTip; }
|
||||
void SetToolTipCtrl(WXHWND hwndTT) { m_hwndToolTip = hwndTT; }
|
||||
#endif // tooltips
|
||||
|
||||
// a MSW only function which sends a size event to the window using its
|
||||
// current size - this has an effect of refreshing the window layout
|
||||
virtual void SendSizeEvent();
|
||||
|
||||
virtual wxPoint GetClientAreaOrigin() const;
|
||||
|
||||
#if wxUSE_MENUS_NATIVE
|
||||
bool HandleMenuOpen();
|
||||
bool HandleMenuSelect(int ItemID);
|
||||
#endif // wxUSE_MENUS_NATIVE
|
||||
|
||||
protected:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
// override base class virtuals
|
||||
virtual void DoGetClientSize(int *width, int *height) const;
|
||||
virtual void DoSetClientSize(int width, int height);
|
||||
|
||||
#if wxUSE_MENUS_NATIVE
|
||||
// perform MSW-specific action when menubar is changed
|
||||
virtual void AttachMenuBar(wxMenuBar *menubar);
|
||||
|
||||
// a plug in for MDI frame classes which need to do something special when
|
||||
// the menubar is set
|
||||
virtual void InternalSetMenuBar();
|
||||
#endif // wxUSE_MENUS_NATIVE
|
||||
|
||||
// propagate our state change to all child frames
|
||||
void IconizeChildFrames(bool bIconize);
|
||||
|
||||
// we add menu bar accel processing
|
||||
bool MSWTranslateMessage(WXMSG* pMsg);
|
||||
|
||||
// window proc for the frames
|
||||
WXLRESULT MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
// handle WM_INITMENUPOPUP message
|
||||
bool HandleInitMenuPopup(WXHMENU hMenu);
|
||||
|
||||
virtual bool IsMDIChild() const { return FALSE; }
|
||||
|
||||
// get default (wxWidgets) icon for the frame
|
||||
virtual WXHICON GetDefaultIcon() const;
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
static bool m_useNativeStatusBar;
|
||||
wxStatusBar *StatusBar;
|
||||
#endif // wxUSE_STATUSBAR
|
||||
|
||||
// Data to save/restore when calling ShowFullScreen
|
||||
int m_fsStatusBarFields; // 0 for no status bar
|
||||
int m_fsStatusBarHeight;
|
||||
int m_fsToolBarHeight;
|
||||
|
||||
private:
|
||||
#if wxUSE_TOOLTIPS
|
||||
WXHWND m_hwndToolTip;
|
||||
#endif // tooltips
|
||||
|
||||
// used by IconizeChildFrames(), see comments there
|
||||
bool m_wasMinimized;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxFrame)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_FRAME_H_
|
69
include/wx/palmos/gauge.h
Normal file
69
include/wx/palmos/gauge.h
Normal file
@ -0,0 +1,69 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: gauge.h
|
||||
// Purpose: wxGauge class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _GAUGE_H_
|
||||
#define _GAUGE_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "gauge95.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_GAUGE
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxGaugeNameStr;
|
||||
|
||||
// Group box
|
||||
class WXDLLEXPORT wxGauge : public wxGaugeBase
|
||||
{
|
||||
public:
|
||||
wxGauge() { }
|
||||
|
||||
wxGauge(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
int range,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxGA_HORIZONTAL,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxGaugeNameStr)
|
||||
{
|
||||
(void)Create(parent, id, range, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
int range,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxGA_HORIZONTAL,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxGaugeNameStr);
|
||||
|
||||
// set gauge range/value
|
||||
virtual void SetRange(int range);
|
||||
virtual void SetValue(int pos);
|
||||
|
||||
// overriden base class virtuals
|
||||
virtual bool SetForegroundColour(const wxColour& col);
|
||||
virtual bool SetBackgroundColour(const wxColour& col);
|
||||
|
||||
protected:
|
||||
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxGauge)
|
||||
};
|
||||
|
||||
#endif // wxUSE_GAUGE
|
||||
|
||||
#endif
|
||||
// _GAUGE_H_
|
105
include/wx/palmos/gccpriv.h
Normal file
105
include/wx/palmos/gccpriv.h
Normal file
@ -0,0 +1,105 @@
|
||||
/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */
|
||||
/* MinGW w32api specific stuff */
|
||||
|
||||
#ifndef _WX_MSW_GCCPRIV_H_
|
||||
#define _WX_MSW_GCCPRIV_H_
|
||||
|
||||
#if defined(__MINGW32__) && !defined(__GNUWIN32__)
|
||||
#define __GNUWIN32__
|
||||
#endif
|
||||
|
||||
#if defined( __MINGW32__ ) && !defined(__WINE__) && !defined( HAVE_W32API_H )
|
||||
#if ( __GNUC__ > 2 ) || ( ( __GNUC__ == 2 ) && ( __GNUC_MINOR__ >= 95 ) )
|
||||
#include <_mingw.h>
|
||||
#if __MINGW32_MAJOR_VERSION >= 1
|
||||
#define HAVE_W32API_H
|
||||
#endif
|
||||
#endif
|
||||
#elif defined( __CYGWIN__ ) && !defined( HAVE_W32API_H )
|
||||
#if ( __GNUC__ > 2 )
|
||||
#define HAVE_W32API_H
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (defined(__WATCOMC__) && __WATCOMC__ >= 1200)
|
||||
#define HAVE_W32API_H
|
||||
#endif
|
||||
|
||||
/* check for MinGW/Cygwin w32api version ( releases >= 0.5, only ) */
|
||||
#if defined( HAVE_W32API_H )
|
||||
#include <w32api.h>
|
||||
#endif
|
||||
|
||||
/* Watcom can't handle defined(xxx) here: */
|
||||
#if defined(__W32API_MAJOR_VERSION) && defined(__W32API_MINOR_VERSION)
|
||||
#define wxCHECK_W32API_VERSION( major, minor ) \
|
||||
( ( ( __W32API_MAJOR_VERSION > (major) ) \
|
||||
|| ( __W32API_MAJOR_VERSION == (major) && __W32API_MINOR_VERSION >= (minor) ) ) )
|
||||
#else
|
||||
#define wxCHECK_W32API_VERSION( major, minor ) (0)
|
||||
#endif
|
||||
|
||||
/* Cygwin / Mingw32 with gcc >= 2.95 use new windows headers which
|
||||
are more ms-like (header author is Anders Norlander, hence the name) */
|
||||
#if (defined(__MINGW32__) || defined(__CYGWIN__) || defined(__WINE__)) && ((__GNUC__>2) || ((__GNUC__==2) && (__GNUC_MINOR__>=95)))
|
||||
#ifndef wxUSE_NORLANDER_HEADERS
|
||||
#define wxUSE_NORLANDER_HEADERS 1
|
||||
#endif
|
||||
#else
|
||||
#ifndef wxUSE_NORLANDER_HEADERS
|
||||
#define wxUSE_NORLANDER_HEADERS 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* "old" GNUWIN32 is the one without Norlander's headers: it lacks the
|
||||
standard Win32 headers and we define the used stuff ourselves for it
|
||||
in wx/msw/gnuwin32/extra.h */
|
||||
#if defined(__GNUC__) && !wxUSE_NORLANDER_HEADERS
|
||||
#define __GNUWIN32_OLD__
|
||||
#endif
|
||||
|
||||
/* Cygwin 1.0 */
|
||||
#if defined(__CYGWIN__) && ((__GNUC__==2) && (__GNUC_MINOR__==9))
|
||||
#define __CYGWIN10__
|
||||
#endif
|
||||
|
||||
/* Mingw runtime 1.0-20010604 has some missing _tXXXX functions,
|
||||
so let's define them ourselves: */
|
||||
#if defined(__GNUWIN32__) && wxCHECK_W32API_VERSION( 1, 0 ) \
|
||||
&& !wxCHECK_W32API_VERSION( 1, 1 )
|
||||
#ifndef _tsetlocale
|
||||
#if wxUSE_UNICODE
|
||||
#define _tsetlocale _wsetlocale
|
||||
#else
|
||||
#define _tsetlocale setlocale
|
||||
#endif
|
||||
#endif
|
||||
#ifndef _tgetenv
|
||||
#if wxUSE_UNICODE
|
||||
#define _tgetenv _wgetenv
|
||||
#else
|
||||
#define _tgetenv getenv
|
||||
#endif
|
||||
#endif
|
||||
#ifndef _tfopen
|
||||
#if wxUSE_UNICODE
|
||||
#define _tfopen _wfopen
|
||||
#else
|
||||
#define _tfopen fopen
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// current mingw32 headers forget to define _puttchar, this will probably be
|
||||
// fixed in the next versions but for now do it ourselves
|
||||
#if defined( __MINGW32__ ) && !defined( _puttchar )
|
||||
#ifdef wxUSE_UNICODE
|
||||
#define _puttchar putwchar
|
||||
#else
|
||||
#define _puttchar puttchar
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
/* _WX_MSW_GCCPRIV_H_ */
|
182
include/wx/palmos/gdiimage.h
Normal file
182
include/wx/palmos/gdiimage.h
Normal file
@ -0,0 +1,182 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: include/wx/palmos/gdiimage.h
|
||||
// Purpose: wxGDIImage class: base class for wxBitmap, wxIcon, wxCursor
|
||||
// under Palm OS
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// NB: this is a private header, it is not intended to be directly included by
|
||||
// user code (but may be included from other, public, wxWin headers
|
||||
|
||||
#ifndef _WX_PALMOS_GDIIMAGE_H_
|
||||
#define _WX_PALMOS_GDIIMAGE_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "gdiimage.h"
|
||||
#endif
|
||||
|
||||
#include "wx/gdiobj.h" // base class
|
||||
#include "wx/gdicmn.h" // wxBITMAP_TYPE_INVALID
|
||||
#include "wx/list.h"
|
||||
|
||||
class WXDLLEXPORT wxGDIImageRefData;
|
||||
class WXDLLEXPORT wxGDIImageHandler;
|
||||
class WXDLLEXPORT wxGDIImage;
|
||||
|
||||
WX_DECLARE_EXPORTED_LIST(wxGDIImageHandler, wxGDIImageHandlerList);
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGDIImageRefData: common data fields for all derived classes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxGDIImageRefData : public wxGDIRefData
|
||||
{
|
||||
public:
|
||||
wxGDIImageRefData()
|
||||
{
|
||||
m_width = m_height = m_depth = 0;
|
||||
|
||||
m_handle = 0;
|
||||
}
|
||||
|
||||
// accessors
|
||||
bool IsOk() const { return m_handle != 0; }
|
||||
|
||||
void SetSize(int w, int h) { m_width = w; m_height = h; }
|
||||
|
||||
// free the ressources we allocated
|
||||
virtual void Free() = 0;
|
||||
|
||||
// for compatibility, the member fields are public
|
||||
|
||||
// the size of the image
|
||||
int m_width, m_height;
|
||||
|
||||
// the depth of the image
|
||||
int m_depth;
|
||||
|
||||
// the handle to it
|
||||
union
|
||||
{
|
||||
WXHANDLE m_handle; // for untyped access
|
||||
WXHBITMAP m_hBitmap;
|
||||
WXHICON m_hIcon;
|
||||
WXHCURSOR m_hCursor;
|
||||
};
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGDIImageHandler: a class which knows how to load/save wxGDIImages.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxGDIImageHandler : public wxObject
|
||||
{
|
||||
public:
|
||||
// ctor
|
||||
wxGDIImageHandler() { m_type = wxBITMAP_TYPE_INVALID; }
|
||||
wxGDIImageHandler(const wxString& name,
|
||||
const wxString& ext,
|
||||
long type)
|
||||
: m_name(name), m_extension(ext)
|
||||
{
|
||||
m_type = type;
|
||||
}
|
||||
|
||||
// accessors
|
||||
void SetName(const wxString& name) { m_name = name; }
|
||||
void SetExtension(const wxString& ext) { m_extension = ext; }
|
||||
void SetType(long type) { m_type = type; }
|
||||
|
||||
wxString GetName() const { return m_name; }
|
||||
wxString GetExtension() const { return m_extension; }
|
||||
long GetType() const { return m_type; }
|
||||
|
||||
// real handler operations: to implement in derived classes
|
||||
virtual bool Create(wxGDIImage *image,
|
||||
void *data,
|
||||
long flags,
|
||||
int width, int height, int depth = 1) = 0;
|
||||
virtual bool Load(wxGDIImage *image,
|
||||
const wxString& name,
|
||||
long flags,
|
||||
int desiredWidth, int desiredHeight) = 0;
|
||||
virtual bool Save(wxGDIImage *image,
|
||||
const wxString& name,
|
||||
int type) = 0;
|
||||
|
||||
protected:
|
||||
wxString m_name;
|
||||
wxString m_extension;
|
||||
long m_type;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGDIImage: this class supports GDI image handlers which may be registered
|
||||
// dynamically and will be used for loading/saving the images in the specified
|
||||
// format. It also falls back to wxImage if no appropriate image is found.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxGDIImage : public wxGDIObject
|
||||
{
|
||||
public:
|
||||
// handlers list interface
|
||||
static wxGDIImageHandlerList& GetHandlers() { return ms_handlers; }
|
||||
|
||||
static void AddHandler(wxGDIImageHandler *handler);
|
||||
static void InsertHandler(wxGDIImageHandler *handler);
|
||||
static bool RemoveHandler(const wxString& name);
|
||||
|
||||
static wxGDIImageHandler *FindHandler(const wxString& name);
|
||||
static wxGDIImageHandler *FindHandler(const wxString& extension, long type);
|
||||
static wxGDIImageHandler *FindHandler(long type);
|
||||
|
||||
static void InitStandardHandlers();
|
||||
static void CleanUpHandlers();
|
||||
|
||||
// access to the ref data casted to the right type
|
||||
wxGDIImageRefData *GetGDIImageData() const
|
||||
{ return (wxGDIImageRefData *)m_refData; }
|
||||
|
||||
// create data if we don't have it yet
|
||||
void EnsureHasData() { if ( IsNull() ) m_refData = CreateData(); }
|
||||
|
||||
// accessors
|
||||
WXHANDLE GetHandle() const
|
||||
{ return IsNull() ? 0 : GetGDIImageData()->m_handle; }
|
||||
void SetHandle(WXHANDLE handle)
|
||||
{ EnsureHasData(); GetGDIImageData()->m_handle = handle; }
|
||||
|
||||
bool Ok() const { return GetHandle() != 0; }
|
||||
|
||||
int GetWidth() const { return IsNull() ? 0 : GetGDIImageData()->m_width; }
|
||||
int GetHeight() const { return IsNull() ? 0 : GetGDIImageData()->m_height; }
|
||||
int GetDepth() const { return IsNull() ? 0 : GetGDIImageData()->m_depth; }
|
||||
|
||||
void SetWidth(int w) { EnsureHasData(); GetGDIImageData()->m_width = w; }
|
||||
void SetHeight(int h) { EnsureHasData(); GetGDIImageData()->m_height = h; }
|
||||
void SetDepth(int d) { EnsureHasData(); GetGDIImageData()->m_depth = d; }
|
||||
|
||||
void SetSize(int w, int h)
|
||||
{
|
||||
EnsureHasData();
|
||||
GetGDIImageData()->SetSize(w, h);
|
||||
}
|
||||
void SetSize(const wxSize& size) { SetSize(size.x, size.y); }
|
||||
|
||||
// forward some of base class virtuals to wxGDIImageRefData
|
||||
bool FreeResource(bool force = FALSE);
|
||||
virtual WXHANDLE GetResourceHandle() const;
|
||||
|
||||
protected:
|
||||
// create the data for the derived class here
|
||||
virtual wxGDIImageRefData *CreateData() const = 0;
|
||||
|
||||
static wxGDIImageHandlerList ms_handlers;
|
||||
};
|
||||
|
||||
#endif // _WX_PALMOS_GDIIMAGE_H_
|
65
include/wx/palmos/gdiobj.h
Normal file
65
include/wx/palmos/gdiobj.h
Normal file
@ -0,0 +1,65 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/gdiobj.h
|
||||
// Purpose: wxGDIObject class: base class for other GDI classes
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GDIOBJ_H_
|
||||
#define _WX_GDIOBJ_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "gdiobj.h"
|
||||
#endif
|
||||
|
||||
#include "wx/object.h" // base class
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGDIRefData is the base class for wxXXXData structures which contain the
|
||||
// real data for the GDI object and are shared among all wxWin objects sharing
|
||||
// the same native GDI object
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxGDIRefData : public wxObjectRefData
|
||||
{
|
||||
// this class is intentionally left blank
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGDIObject
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxGDIObject : public wxObject
|
||||
{
|
||||
public:
|
||||
wxGDIObject() { m_visible = FALSE; };
|
||||
|
||||
// Creates the resource
|
||||
virtual bool RealizeResource() { return FALSE; };
|
||||
|
||||
// Frees the resource
|
||||
virtual bool FreeResource(bool WXUNUSED(force) = FALSE) { return FALSE; }
|
||||
|
||||
virtual bool IsFree() const { return FALSE; }
|
||||
|
||||
bool IsNull() const { return (m_refData == 0); }
|
||||
|
||||
// Returns handle.
|
||||
virtual WXHANDLE GetResourceHandle() const { return 0; }
|
||||
|
||||
virtual bool GetVisible() { return m_visible; }
|
||||
virtual void SetVisible(bool v) { m_visible = v; }
|
||||
|
||||
protected:
|
||||
bool m_visible; // TRUE only if we should delete this object ourselves
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxGDIObject)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_GDIOBJ_H_
|
164
include/wx/palmos/glcanvas.h
Normal file
164
include/wx/palmos/glcanvas.h
Normal file
@ -0,0 +1,164 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/glcanvas.h
|
||||
// Purpose: wxGLCanvas, for using OpenGL with wxWidgets under Palm OS
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "glcanvas.h"
|
||||
#endif
|
||||
|
||||
#ifndef _WX_GLCANVAS_H_
|
||||
#define _WX_GLCANVAS_H_
|
||||
|
||||
#include "wx/palette.h"
|
||||
#include "wx/scrolwin.h"
|
||||
|
||||
#include <windows.h>
|
||||
#include "wx/msw/winundef.h"
|
||||
|
||||
#include <GL/gl.h>
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Constants for attriblist
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
// The generic GL implementation doesn't support most of these options,
|
||||
// such as stereo, auxiliary buffers, alpha channel, and accum buffer.
|
||||
// Other implementations may actually support them.
|
||||
|
||||
enum
|
||||
{
|
||||
WX_GL_RGBA=1, /* use true color palette */
|
||||
WX_GL_BUFFER_SIZE, /* bits for buffer if not WX_GL_RGBA */
|
||||
WX_GL_LEVEL, /* 0 for main buffer, >0 for overlay, <0 for underlay */
|
||||
WX_GL_DOUBLEBUFFER, /* use doublebuffer */
|
||||
WX_GL_STEREO, /* use stereoscopic display */
|
||||
WX_GL_AUX_BUFFERS, /* number of auxiliary buffers */
|
||||
WX_GL_MIN_RED, /* use red buffer with most bits (> MIN_RED bits) */
|
||||
WX_GL_MIN_GREEN, /* use green buffer with most bits (> MIN_GREEN bits) */
|
||||
WX_GL_MIN_BLUE, /* use blue buffer with most bits (> MIN_BLUE bits) */
|
||||
WX_GL_MIN_ALPHA, /* use blue buffer with most bits (> MIN_ALPHA bits) */
|
||||
WX_GL_DEPTH_SIZE, /* bits for Z-buffer (0,16,32) */
|
||||
WX_GL_STENCIL_SIZE, /* bits for stencil buffer */
|
||||
WX_GL_MIN_ACCUM_RED, /* use red accum buffer with most bits (> MIN_ACCUM_RED bits) */
|
||||
WX_GL_MIN_ACCUM_GREEN, /* use green buffer with most bits (> MIN_ACCUM_GREEN bits) */
|
||||
WX_GL_MIN_ACCUM_BLUE, /* use blue buffer with most bits (> MIN_ACCUM_BLUE bits) */
|
||||
WX_GL_MIN_ACCUM_ALPHA /* use blue buffer with most bits (> MIN_ACCUM_ALPHA bits) */
|
||||
};
|
||||
|
||||
class WXDLLIMPEXP_GL wxGLCanvas; /* forward reference */
|
||||
|
||||
class WXDLLIMPEXP_GL wxGLContext: public wxObject
|
||||
{
|
||||
public:
|
||||
wxGLContext(bool isRGB, wxGLCanvas *win, const wxPalette& palette = wxNullPalette);
|
||||
|
||||
wxGLContext( bool isRGB, wxGLCanvas *win,
|
||||
const wxPalette& WXUNUSED(palette),
|
||||
const wxGLContext *other /* for sharing display lists */ );
|
||||
|
||||
~wxGLContext();
|
||||
|
||||
|
||||
void SetCurrent();
|
||||
|
||||
void SetColour(const wxChar *colour);
|
||||
|
||||
void SwapBuffers();
|
||||
|
||||
|
||||
inline wxWindow* GetWindow() const { return m_window; }
|
||||
|
||||
inline WXHDC GetHDC() const { return m_hDC; }
|
||||
|
||||
inline HGLRC GetGLRC() const { return m_glContext; }
|
||||
|
||||
public:
|
||||
HGLRC m_glContext;
|
||||
WXHDC m_hDC;
|
||||
wxWindow* m_window;
|
||||
};
|
||||
|
||||
class WXDLLIMPEXP_GL wxGLCanvas: public wxWindow
|
||||
{
|
||||
DECLARE_CLASS(wxGLCanvas)
|
||||
public:
|
||||
wxGLCanvas(wxWindow *parent, wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxString& name = wxGLCanvasName, int *attribList = 0,
|
||||
const wxPalette& palette = wxNullPalette);
|
||||
|
||||
wxGLCanvas(wxWindow *parent,
|
||||
const wxGLContext *shared = (wxGLContext *) NULL,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxGLCanvasName,
|
||||
int *attribList = (int *) NULL,
|
||||
const wxPalette& palette = wxNullPalette);
|
||||
|
||||
wxGLCanvas(wxWindow *parent,
|
||||
const wxGLCanvas *shared = (wxGLCanvas *)NULL,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxGLCanvasName,
|
||||
int *attribList = 0,
|
||||
const wxPalette& palette = wxNullPalette);
|
||||
|
||||
~wxGLCanvas();
|
||||
|
||||
// Replaces wxWindow::Create functionality, since
|
||||
// we need to use a different window class
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size,
|
||||
long style, const wxString& name);
|
||||
|
||||
void SetCurrent();
|
||||
|
||||
#ifdef __WXUNIVERSAL__
|
||||
virtual bool SetCurrent(bool doit) { return wxWindow::SetCurrent(doit); };
|
||||
#endif
|
||||
|
||||
void SetColour(const wxChar *colour);
|
||||
|
||||
void SwapBuffers();
|
||||
|
||||
void OnSize(wxSizeEvent& event);
|
||||
|
||||
void OnQueryNewPalette(wxQueryNewPaletteEvent& event);
|
||||
|
||||
void OnPaletteChanged(wxPaletteChangedEvent& event);
|
||||
|
||||
inline wxGLContext* GetContext() const { return m_glContext; }
|
||||
|
||||
inline WXHDC GetHDC() const { return m_hDC; }
|
||||
|
||||
void SetupPixelFormat(int *attribList = (int *) NULL);
|
||||
|
||||
void SetupPalette(const wxPalette& palette);
|
||||
|
||||
wxPalette CreateDefaultPalette();
|
||||
|
||||
inline wxPalette* GetPalette() const { return (wxPalette *) &m_palette; }
|
||||
|
||||
protected:
|
||||
wxGLContext* m_glContext; // this is typedef-ed ptr, in fact
|
||||
wxPalette m_palette;
|
||||
WXHDC m_hDC;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_GLCANVAS_H_
|
||||
|
60
include/wx/palmos/help.h
Normal file
60
include/wx/palmos/help.h
Normal file
@ -0,0 +1,60 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: helpwin.h
|
||||
// Purpose: Help system: WinHelp implementation
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_HELP_H_
|
||||
#define _WX_HELP_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "help.h"
|
||||
#endif
|
||||
|
||||
#include "wx/wx.h"
|
||||
|
||||
#if wxUSE_HELP
|
||||
|
||||
#include "wx/helpbase.h"
|
||||
|
||||
class WXDLLEXPORT wxPalmHelpController: public wxHelpControllerBase
|
||||
{
|
||||
DECLARE_CLASS(wxPalmHelpController)
|
||||
|
||||
public:
|
||||
wxPalmHelpController() {};
|
||||
~wxPalmHelpController() {};
|
||||
|
||||
// Must call this to set the filename
|
||||
virtual bool Initialize(const wxString& file);
|
||||
virtual bool Initialize(const wxString& file, int WXUNUSED(server) ) { return Initialize( file ); }
|
||||
|
||||
// If file is "", reloads file given in Initialize
|
||||
virtual bool LoadFile(const wxString& file = wxEmptyString);
|
||||
virtual bool DisplayContents();
|
||||
virtual bool DisplaySection(int sectionNo);
|
||||
virtual bool DisplaySection(const wxString& section) { return KeywordSearch(section); }
|
||||
virtual bool DisplayBlock(long blockNo);
|
||||
virtual bool DisplayContextPopup(int contextId);
|
||||
virtual bool KeywordSearch(const wxString& k,
|
||||
wxHelpSearchMode mode = wxHELP_SEARCH_ALL);
|
||||
virtual bool Quit();
|
||||
|
||||
inline wxString GetHelpFile() const { return m_helpFile; }
|
||||
|
||||
protected:
|
||||
// Append extension if necessary.
|
||||
wxString GetValidFilename(const wxString& file) const;
|
||||
|
||||
private:
|
||||
wxString m_helpFile;
|
||||
};
|
||||
|
||||
#endif // wxUSE_HELP
|
||||
#endif
|
||||
// _WX_HELP_H_
|
107
include/wx/palmos/icon.h
Normal file
107
include/wx/palmos/icon.h
Normal file
@ -0,0 +1,107 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/icon.h
|
||||
// Purpose: wxIcon class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_ICON_H_
|
||||
#define _WX_ICON_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "icon.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/palmos/gdiimage.h"
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// icon data
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// notice that although wxIconRefData inherits from wxBitmapRefData, it is not
|
||||
// a valid wxBitmapRefData
|
||||
class WXDLLEXPORT wxIconRefData : public wxGDIImageRefData
|
||||
{
|
||||
public:
|
||||
wxIconRefData() { }
|
||||
virtual ~wxIconRefData() { Free(); }
|
||||
|
||||
virtual void Free();
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Icon
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxIcon : public wxGDIImage
|
||||
{
|
||||
public:
|
||||
// ctors
|
||||
// default
|
||||
wxIcon() { }
|
||||
|
||||
// copy
|
||||
wxIcon(const wxIcon& icon) { Ref(icon); }
|
||||
|
||||
// from raw data
|
||||
wxIcon(const char bits[], int width, int height);
|
||||
|
||||
// from XPM data
|
||||
wxIcon(const char **data) { CreateIconFromXpm(data); }
|
||||
|
||||
wxIcon(char **data) { CreateIconFromXpm((const char **)data); }
|
||||
|
||||
// from resource/file
|
||||
wxIcon(const wxString& name,
|
||||
long type = wxBITMAP_TYPE_ICO_RESOURCE,
|
||||
int desiredWidth = -1, int desiredHeight = -1);
|
||||
|
||||
wxIcon(const wxIconLocation& loc);
|
||||
|
||||
virtual ~wxIcon();
|
||||
|
||||
virtual bool LoadFile(const wxString& name,
|
||||
long type = wxBITMAP_TYPE_ICO_RESOURCE,
|
||||
int desiredWidth = -1, int desiredHeight = -1);
|
||||
|
||||
wxIcon& operator = (const wxIcon& icon)
|
||||
{ if ( *this != icon ) Ref(icon); return *this; }
|
||||
bool operator == (const wxIcon& icon) const
|
||||
{ return m_refData == icon.m_refData; }
|
||||
bool operator != (const wxIcon& icon) const
|
||||
{ return m_refData != icon.m_refData; }
|
||||
|
||||
// implementation only from now on
|
||||
wxIconRefData *GetIconData() const { return (wxIconRefData *)m_refData; }
|
||||
|
||||
void SetHICON(WXHICON icon) { SetHandle((WXHANDLE)icon); }
|
||||
WXHICON GetHICON() const { return (WXHICON)GetHandle(); }
|
||||
|
||||
// create from bitmap (which should have a mask unless it's monochrome):
|
||||
// there shouldn't be any implicit bitmap -> icon conversion (i.e. no
|
||||
// ctors, assignment operators...), but it's ok to have such function
|
||||
void CopyFromBitmap(const wxBitmap& bmp);
|
||||
|
||||
protected:
|
||||
virtual wxGDIImageRefData *CreateData() const
|
||||
{
|
||||
return new wxIconRefData;
|
||||
}
|
||||
|
||||
// create from XPM data
|
||||
void CreateIconFromXpm(const char **data);
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxIcon)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_ICON_H_
|
231
include/wx/palmos/imaglist.h
Normal file
231
include/wx/palmos/imaglist.h
Normal file
@ -0,0 +1,231 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/imaglist.h
|
||||
// Purpose: wxImageList class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_IMAGLIST_H_
|
||||
#define _WX_IMAGLIST_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "imaglist.h"
|
||||
#endif
|
||||
|
||||
#include "wx/bitmap.h"
|
||||
|
||||
/*
|
||||
* wxImageList is used for wxListCtrl, wxTreeCtrl. These controls refer to
|
||||
* images for their items by an index into an image list.
|
||||
* A wxImageList is capable of creating images with optional masks from
|
||||
* a variety of sources - a single bitmap plus a colour to indicate the mask,
|
||||
* two bitmaps, or an icon.
|
||||
*
|
||||
* Image lists can also create and draw images used for drag and drop functionality.
|
||||
* This is not yet implemented in wxImageList. We need to discuss a generic API
|
||||
* for doing drag and drop and see whether it ties in with the Win95 view of it.
|
||||
* See below for candidate functions and an explanation of how they might be
|
||||
* used.
|
||||
*/
|
||||
|
||||
// Flags for Draw
|
||||
#define wxIMAGELIST_DRAW_NORMAL 0x0001
|
||||
#define wxIMAGELIST_DRAW_TRANSPARENT 0x0002
|
||||
#define wxIMAGELIST_DRAW_SELECTED 0x0004
|
||||
#define wxIMAGELIST_DRAW_FOCUSED 0x0008
|
||||
|
||||
// Flag values for Set/GetImageList
|
||||
enum {
|
||||
wxIMAGE_LIST_NORMAL, // Normal icons
|
||||
wxIMAGE_LIST_SMALL, // Small icons
|
||||
wxIMAGE_LIST_STATE // State icons: unimplemented (see WIN32 documentation)
|
||||
};
|
||||
|
||||
// Eventually we'll make this a reference-counted wxGDIObject. For
|
||||
// now, the app must take care of ownership issues. That is, the
|
||||
// image lists must be explicitly deleted after the control(s) that uses them
|
||||
// is (are) deleted, or when the app exits.
|
||||
class WXDLLEXPORT wxImageList : public wxObject
|
||||
{
|
||||
public:
|
||||
/*
|
||||
* Public interface
|
||||
*/
|
||||
|
||||
wxImageList();
|
||||
|
||||
// Creates an image list.
|
||||
// Specify the width and height of the images in the list,
|
||||
// whether there are masks associated with them (e.g. if creating images
|
||||
// from icons), and the initial size of the list.
|
||||
wxImageList(int width, int height, bool mask = TRUE, int initialCount = 1)
|
||||
{
|
||||
Create(width, height, mask, initialCount);
|
||||
}
|
||||
~wxImageList();
|
||||
|
||||
|
||||
// Attributes
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Returns the number of images in the image list.
|
||||
int GetImageCount() const;
|
||||
|
||||
// Returns the size (same for all images) of the images in the list
|
||||
bool GetSize(int index, int &width, int &height) const;
|
||||
|
||||
// Operations
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Creates an image list
|
||||
// width, height specify the size of the images in the list (all the same).
|
||||
// mask specifies whether the images have masks or not.
|
||||
// initialNumber is the initial number of images to reserve.
|
||||
bool Create(int width, int height, bool mask = TRUE, int initialNumber = 1);
|
||||
|
||||
// Adds a bitmap, and optionally a mask bitmap.
|
||||
// Note that wxImageList creates *new* bitmaps, so you may delete
|
||||
// 'bitmap' and 'mask' after calling Add.
|
||||
int Add(const wxBitmap& bitmap, const wxBitmap& mask = wxNullBitmap);
|
||||
|
||||
// Adds a bitmap, using the specified colour to create the mask bitmap
|
||||
// Note that wxImageList creates *new* bitmaps, so you may delete
|
||||
// 'bitmap' after calling Add.
|
||||
int Add(const wxBitmap& bitmap, const wxColour& maskColour);
|
||||
|
||||
// Adds a bitmap and mask from an icon.
|
||||
int Add(const wxIcon& icon);
|
||||
|
||||
// Replaces a bitmap, optionally passing a mask bitmap.
|
||||
// Note that wxImageList creates new bitmaps, so you may delete
|
||||
// 'bitmap' and 'mask' after calling Replace.
|
||||
bool Replace(int index, const wxBitmap& bitmap, const wxBitmap& mask = wxNullBitmap);
|
||||
|
||||
/* Not supported by Win95
|
||||
// Replacing a bitmap, using the specified colour to create the mask bitmap
|
||||
// Note that wxImageList creates new bitmaps, so you may delete
|
||||
// 'bitmap'.
|
||||
bool Replace(int index, const wxBitmap& bitmap, const wxColour& maskColour);
|
||||
*/
|
||||
|
||||
// Replaces a bitmap and mask from an icon.
|
||||
// You can delete 'icon' after calling Replace.
|
||||
bool Replace(int index, const wxIcon& icon);
|
||||
|
||||
// Removes the image at the given index.
|
||||
bool Remove(int index);
|
||||
|
||||
// Remove all images
|
||||
bool RemoveAll();
|
||||
|
||||
// Draws the given image on a dc at the specified position.
|
||||
// If 'solidBackground' is TRUE, Draw sets the image list background
|
||||
// colour to the background colour of the wxDC, to speed up
|
||||
// drawing by eliminating masked drawing where possible.
|
||||
bool Draw(int index, wxDC& dc, int x, int y,
|
||||
int flags = wxIMAGELIST_DRAW_NORMAL,
|
||||
bool solidBackground = FALSE);
|
||||
|
||||
// TODO: miscellaneous functionality
|
||||
/*
|
||||
wxIcon *MakeIcon(int index);
|
||||
bool SetOverlayImage(int index, int overlayMask);
|
||||
|
||||
*/
|
||||
|
||||
// TODO: Drag-and-drop related functionality.
|
||||
|
||||
#if 0
|
||||
// Creates a new drag image by combining the given image (typically a mouse cursor image)
|
||||
// with the current drag image.
|
||||
bool SetDragCursorImage(int index, const wxPoint& hotSpot);
|
||||
|
||||
// If successful, returns a pointer to the temporary image list that is used for dragging;
|
||||
// otherwise, NULL.
|
||||
// dragPos: receives the current drag position.
|
||||
// hotSpot: receives the offset of the drag image relative to the drag position.
|
||||
static wxImageList *GetDragImageList(wxPoint& dragPos, wxPoint& hotSpot);
|
||||
|
||||
// Call this function to begin dragging an image. This function creates a temporary image list
|
||||
// that is used for dragging. The image combines the specified image and its mask with the
|
||||
// current cursor. In response to subsequent mouse move messages, you can move the drag image
|
||||
// by using the DragMove member function. To end the drag operation, you can use the EndDrag
|
||||
// member function.
|
||||
bool BeginDrag(int index, const wxPoint& hotSpot);
|
||||
|
||||
// Ends a drag operation.
|
||||
bool EndDrag();
|
||||
|
||||
// Call this function to move the image that is being dragged during a drag-and-drop operation.
|
||||
// This function is typically called in response to a mouse move message. To begin a drag
|
||||
// operation, use the BeginDrag member function.
|
||||
static bool DragMove(const wxPoint& point);
|
||||
|
||||
// During a drag operation, locks updates to the window specified by lockWindow and displays
|
||||
// the drag image at the position specified by point.
|
||||
// The coordinates are relative to the window's upper left corner, so you must compensate
|
||||
// for the widths of window elements, such as the border, title bar, and menu bar, when
|
||||
// specifying the coordinates.
|
||||
// If lockWindow is NULL, this function draws the image in the display context associated
|
||||
// with the desktop window, and coordinates are relative to the upper left corner of the screen.
|
||||
// This function locks all other updates to the given window during the drag operation.
|
||||
// If you need to do any drawing during a drag operation, such as highlighting the target
|
||||
// of a drag-and-drop operation, you can temporarily hide the dragged image by using the
|
||||
// wxImageList::DragLeave function.
|
||||
|
||||
// lockWindow: pointer to the window that owns the drag image.
|
||||
// point: position at which to display the drag image. Coordinates are relative to the
|
||||
// upper left corner of the window (not the client area).
|
||||
|
||||
static bool DragEnter( wxWindow *lockWindow, const wxPoint& point );
|
||||
|
||||
// Unlocks the window specified by pWndLock and hides the drag image, allowing the
|
||||
// window to be updated.
|
||||
static bool DragLeave( wxWindow *lockWindow );
|
||||
|
||||
/* Here's roughly how you'd use these functions if implemented in this Win95-like way:
|
||||
|
||||
1) Starting to drag:
|
||||
|
||||
wxImageList *dragImageList = new wxImageList(16, 16, TRUE);
|
||||
dragImageList->Add(myDragImage); // Provide an image to combine with the current cursor
|
||||
dragImageList->BeginDrag(0, wxPoint(0, 0));
|
||||
wxShowCursor(FALSE); // wxShowCursor not yet implemented in wxWin
|
||||
myWindow->CaptureMouse();
|
||||
|
||||
2) Dragging:
|
||||
|
||||
// Called within mouse move event. Could also use dragImageList instead of assuming
|
||||
// these are static functions.
|
||||
// These two functions could possibly be combined into one, since DragEnter is
|
||||
// a bit obscure.
|
||||
wxImageList::DragMove(wxPoint(x, y)); // x, y are current cursor position
|
||||
wxImageList::DragEnter(NULL, wxPoint(x, y)); // NULL assumes dragging across whole screen
|
||||
|
||||
3) Finishing dragging:
|
||||
|
||||
dragImageList->EndDrag();
|
||||
myWindow->ReleaseMouse();
|
||||
wxShowCursor(TRUE);
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
// Implementation
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Returns the native image list handle
|
||||
WXHIMAGELIST GetHIMAGELIST() const { return m_hImageList; }
|
||||
|
||||
protected:
|
||||
WXHIMAGELIST m_hImageList;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxImageList)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_IMAGLIST_H_
|
95
include/wx/palmos/iniconf.h
Normal file
95
include/wx/palmos/iniconf.h
Normal file
@ -0,0 +1,95 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: include/wx/palmos/iniconf.h
|
||||
// Purpose: INI-file based wxConfigBase implementation
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _INICONF_H
|
||||
#define _INICONF_H
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxIniConfig is a wxConfig implementation which uses MS Windows INI files to
|
||||
// store the data. Because INI files don't really support arbitrary nesting of
|
||||
// groups, we do the following:
|
||||
// (1) in win.ini file we store all entries in the [vendor] section and
|
||||
// the value group1/group2/key is mapped to the value group1_group2_key
|
||||
// in this section, i.e. all path separators are replaced with underscore
|
||||
// (2) in appname.ini file we map group1/group2/group3/key to the entry
|
||||
// group2_group3_key in [group1]
|
||||
//
|
||||
// Of course, it might lead to indesirable results if '_' is also used in key
|
||||
// names (i.e. group/key is the same as group_key) and also GetPath() result
|
||||
// may be not what you would expect it to be.
|
||||
//
|
||||
// Another limitation: the keys and section names are never case-sensitive
|
||||
// which might differ from wxFileConfig it it was compiled with
|
||||
// wxCONFIG_CASE_SENSITIVE option.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// for this class, "local" file is the file appname.ini and the global file
|
||||
// is the [vendor] subsection of win.ini (default for "vendor" is to be the
|
||||
// same as appname). The file name (strAppName parameter) may, in fact,
|
||||
// contain the full path to the file. If it doesn't, the file is searched for
|
||||
// in the Windows directory.
|
||||
class WXDLLEXPORT wxIniConfig : public wxConfigBase
|
||||
{
|
||||
public:
|
||||
// ctor & dtor
|
||||
// if strAppName doesn't contain the extension and is not an absolute path,
|
||||
// ".ini" is appended to it. if strVendor is empty, it's taken to be the
|
||||
// same as strAppName.
|
||||
wxIniConfig(const wxString& strAppName = wxEmptyString, const wxString& strVendor = wxEmptyString,
|
||||
const wxString& localFilename = wxEmptyString, const wxString& globalFilename = wxEmptyString, long style = wxCONFIG_USE_LOCAL_FILE);
|
||||
virtual ~wxIniConfig();
|
||||
|
||||
// implement inherited pure virtual functions
|
||||
virtual void SetPath(const wxString& strPath);
|
||||
virtual const wxString& GetPath() const;
|
||||
|
||||
virtual bool GetFirstGroup(wxString& str, long& lIndex) const;
|
||||
virtual bool GetNextGroup (wxString& str, long& lIndex) const;
|
||||
virtual bool GetFirstEntry(wxString& str, long& lIndex) const;
|
||||
virtual bool GetNextEntry (wxString& str, long& lIndex) const;
|
||||
|
||||
virtual size_t GetNumberOfEntries(bool bRecursive = FALSE) const;
|
||||
virtual size_t GetNumberOfGroups(bool bRecursive = FALSE) const;
|
||||
|
||||
virtual bool HasGroup(const wxString& strName) const;
|
||||
virtual bool HasEntry(const wxString& strName) const;
|
||||
|
||||
// return TRUE if the current group is empty
|
||||
bool IsEmpty() const;
|
||||
|
||||
virtual bool Flush(bool bCurrentOnly = FALSE);
|
||||
|
||||
virtual bool RenameEntry(const wxString& oldName, const wxString& newName);
|
||||
virtual bool RenameGroup(const wxString& oldName, const wxString& newName);
|
||||
|
||||
virtual bool DeleteEntry(const wxString& Key, bool bGroupIfEmptyAlso = TRUE);
|
||||
virtual bool DeleteGroup(const wxString& szKey);
|
||||
virtual bool DeleteAll();
|
||||
|
||||
protected:
|
||||
// read/write
|
||||
bool DoReadString(const wxString& key, wxString *pStr) const;
|
||||
bool DoReadLong(const wxString& key, long *plResult) const;
|
||||
|
||||
bool DoWriteString(const wxString& key, const wxString& szValue);
|
||||
bool DoWriteLong(const wxString& key, long lValue);
|
||||
|
||||
private:
|
||||
// helpers
|
||||
wxString GetPrivateKeyName(const wxString& szKey) const;
|
||||
wxString GetKeyName(const wxString& szKey) const;
|
||||
|
||||
wxString m_strLocalFilename; // name of the private INI file
|
||||
wxString m_strGroup, // current group in appname.ini file
|
||||
m_strPath; // the rest of the path (no trailing '_'!)
|
||||
};
|
||||
|
||||
#endif //_INICONF_H
|
94
include/wx/palmos/joystick.h
Normal file
94
include/wx/palmos/joystick.h
Normal file
@ -0,0 +1,94 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: joystick.h
|
||||
// Purpose: wxJoystick class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_JOYSTICK_H_
|
||||
#define _WX_JOYSTICK_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "joystick.h"
|
||||
#endif
|
||||
|
||||
#include "wx/event.h"
|
||||
|
||||
class WXDLLIMPEXP_ADV wxJoystick: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxJoystick)
|
||||
public:
|
||||
/*
|
||||
* Public interface
|
||||
*/
|
||||
|
||||
wxJoystick(int joystick = wxJOYSTICK1);
|
||||
|
||||
// Attributes
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
wxPoint GetPosition(void) const;
|
||||
int GetZPosition(void) const;
|
||||
int GetButtonState(void) const;
|
||||
int GetPOVPosition(void) const;
|
||||
int GetPOVCTSPosition(void) const;
|
||||
int GetRudderPosition(void) const;
|
||||
int GetUPosition(void) const;
|
||||
int GetVPosition(void) const;
|
||||
int GetMovementThreshold(void) const;
|
||||
void SetMovementThreshold(int threshold) ;
|
||||
|
||||
// Capabilities
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static int GetNumberJoysticks(void);
|
||||
|
||||
bool IsOk(void) const; // Checks that the joystick is functioning
|
||||
int GetManufacturerId(void) const ;
|
||||
int GetProductId(void) const ;
|
||||
wxString GetProductName(void) const ;
|
||||
int GetXMin(void) const;
|
||||
int GetYMin(void) const;
|
||||
int GetZMin(void) const;
|
||||
int GetXMax(void) const;
|
||||
int GetYMax(void) const;
|
||||
int GetZMax(void) const;
|
||||
int GetNumberButtons(void) const;
|
||||
int GetNumberAxes(void) const;
|
||||
int GetMaxButtons(void) const;
|
||||
int GetMaxAxes(void) const;
|
||||
int GetPollingMin(void) const;
|
||||
int GetPollingMax(void) const;
|
||||
int GetRudderMin(void) const;
|
||||
int GetRudderMax(void) const;
|
||||
int GetUMin(void) const;
|
||||
int GetUMax(void) const;
|
||||
int GetVMin(void) const;
|
||||
int GetVMax(void) const;
|
||||
|
||||
bool HasRudder(void) const;
|
||||
bool HasZ(void) const;
|
||||
bool HasU(void) const;
|
||||
bool HasV(void) const;
|
||||
bool HasPOV(void) const;
|
||||
bool HasPOV4Dir(void) const;
|
||||
bool HasPOVCTS(void) const;
|
||||
|
||||
// Operations
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// pollingFreq = 0 means that movement events are sent when above the threshold.
|
||||
// If pollingFreq > 0, events are received every this many milliseconds.
|
||||
bool SetCapture(wxWindow* win, int pollingFreq = 0);
|
||||
bool ReleaseCapture(void);
|
||||
|
||||
protected:
|
||||
int m_joystick;
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_JOYSTICK_H_
|
166
include/wx/palmos/listbox.h
Normal file
166
include/wx/palmos/listbox.h
Normal file
@ -0,0 +1,166 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/listbox.h
|
||||
// Purpose: wxListBox class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_LISTBOX_H_
|
||||
#define _WX_LISTBOX_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "listbox.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_LISTBOX
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// simple types
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
class WXDLLEXPORT wxOwnerDrawn;
|
||||
|
||||
// define the array of list box items
|
||||
#include "wx/dynarray.h"
|
||||
|
||||
WX_DEFINE_EXPORTED_ARRAY_PTR(wxOwnerDrawn *, wxListBoxItemsArray);
|
||||
#endif // wxUSE_OWNER_DRAWN
|
||||
|
||||
// forward decl for GetSelections()
|
||||
class wxArrayInt;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// List box control
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxListBox : public wxListBoxBase
|
||||
{
|
||||
public:
|
||||
// ctors and such
|
||||
wxListBox();
|
||||
wxListBox(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int n = 0, const wxString choices[] = NULL,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxListBoxNameStr)
|
||||
{
|
||||
Create(parent, id, pos, size, n, choices, style, validator, name);
|
||||
}
|
||||
wxListBox(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
const wxArrayString& choices,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxListBoxNameStr)
|
||||
{
|
||||
Create(parent, id, pos, size, choices, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int n = 0, const wxString choices[] = NULL,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxListBoxNameStr);
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
const wxArrayString& choices,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxListBoxNameStr);
|
||||
|
||||
virtual ~wxListBox();
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual void Clear();
|
||||
virtual void Delete(int n);
|
||||
|
||||
virtual int GetCount() const;
|
||||
virtual wxString GetString(int n) const;
|
||||
virtual void SetString(int n, const wxString& s);
|
||||
virtual int FindString(const wxString& s) const;
|
||||
|
||||
virtual bool IsSelected(int n) const;
|
||||
virtual void SetSelection(int n, bool select = TRUE);
|
||||
virtual int GetSelection() const;
|
||||
virtual int GetSelections(wxArrayInt& aSelections) const;
|
||||
|
||||
virtual int DoAppend(const wxString& item);
|
||||
virtual void DoInsertItems(const wxArrayString& items, int pos);
|
||||
virtual void DoSetItems(const wxArrayString& items, void **clientData);
|
||||
|
||||
virtual void DoSetFirstItem(int n);
|
||||
|
||||
virtual void DoSetItemClientData(int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(int n) const;
|
||||
virtual void DoSetItemClientObject(int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(int n) const;
|
||||
|
||||
// wxCheckListBox support
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
bool MSWOnMeasure(WXMEASUREITEMSTRUCT *item);
|
||||
bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
|
||||
|
||||
// plug-in for derived classes
|
||||
virtual wxOwnerDrawn *CreateLboxItem(size_t n);
|
||||
|
||||
// allows to get the item and use SetXXX functions to set it's appearance
|
||||
wxOwnerDrawn *GetItem(size_t n) const { return m_aItems[n]; }
|
||||
|
||||
// get the index of the given item
|
||||
int GetItemIndex(wxOwnerDrawn *item) const { return m_aItems.Index(item); }
|
||||
#endif // wxUSE_OWNER_DRAWN
|
||||
|
||||
// Windows-specific code to set the horizontal extent of the listbox, if
|
||||
// necessary. If s is non-NULL, it's used to calculate the horizontal
|
||||
// extent. Otherwise, all strings are used.
|
||||
virtual void SetHorizontalExtent(const wxString& s = wxEmptyString);
|
||||
|
||||
// Windows callbacks
|
||||
bool MSWCommand(WXUINT param, WXWORD id);
|
||||
|
||||
virtual wxVisualAttributes GetDefaultAttributes() const
|
||||
{
|
||||
return GetClassDefaultAttributes(GetWindowVariant());
|
||||
}
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL)
|
||||
{
|
||||
return GetCompositeControlsDefaultAttributes(variant);
|
||||
}
|
||||
|
||||
protected:
|
||||
WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
|
||||
|
||||
// free memory (common part of Clear() and dtor)
|
||||
void Free();
|
||||
|
||||
int m_noItems;
|
||||
int m_selected;
|
||||
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
// control items
|
||||
wxListBoxItemsArray m_aItems;
|
||||
#endif
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxListBox)
|
||||
};
|
||||
|
||||
#endif // wxUSE_LISTBOX
|
||||
|
||||
#endif
|
||||
// _WX_LISTBOX_H_
|
423
include/wx/palmos/listctrl.h
Normal file
423
include/wx/palmos/listctrl.h
Normal file
@ -0,0 +1,423 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/listctrl.h
|
||||
// Purpose: wxListCtrl class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_LISTCTRL_H_
|
||||
#define _WX_LISTCTRL_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "listctrl.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_LISTCTRL
|
||||
|
||||
#include "wx/control.h"
|
||||
#include "wx/event.h"
|
||||
#include "wx/hash.h"
|
||||
#include "wx/textctrl.h"
|
||||
|
||||
|
||||
class WXDLLEXPORT wxImageList;
|
||||
|
||||
/*
|
||||
The wxListCtrl can show lists of items in four different modes:
|
||||
wxLC_LIST: multicolumn list view, with optional small icons (icons could be
|
||||
optional for some platforms). Columns are computed automatically,
|
||||
i.e. you don't set columns as in wxLC_REPORT. In other words,
|
||||
the list wraps, unlike a wxListBox.
|
||||
wxLC_REPORT: single or multicolumn report view (with optional header)
|
||||
wxLC_ICON: large icon view, with optional labels
|
||||
wxLC_SMALL_ICON: small icon view, with optional labels
|
||||
|
||||
You can change the style dynamically, either with SetSingleStyle or
|
||||
SetWindowStyleFlag.
|
||||
|
||||
Further window styles:
|
||||
|
||||
wxLC_ALIGN_TOP icons align to the top (default)
|
||||
wxLC_ALIGN_LEFT icons align to the left
|
||||
wxLC_AUTOARRANGE icons arrange themselves
|
||||
wxLC_USER_TEXT the app provides label text on demand, except for column headers
|
||||
wxLC_EDIT_LABELS labels are editable: app will be notified.
|
||||
wxLC_NO_HEADER no header in report mode
|
||||
wxLC_NO_SORT_HEADER can't click on header
|
||||
wxLC_SINGLE_SEL single selection
|
||||
wxLC_SORT_ASCENDING sort ascending (must still supply a comparison callback in SortItems)
|
||||
wxLC_SORT_DESCENDING sort descending (ditto)
|
||||
|
||||
Items are referred to by their index (position in the list starting from zero).
|
||||
|
||||
Label text is supplied via insertion/setting functions and is stored by the
|
||||
control, unless the wxLC_USER_TEXT style has been specified, in which case
|
||||
the app will be notified when text is required (see sample).
|
||||
|
||||
Images are dealt with by (optionally) associating 3 image lists with the control.
|
||||
Zero-based indexes into these image lists indicate which image is to be used for
|
||||
which item. Each image in an image list can contain a mask, and can be made out
|
||||
of either a bitmap, two bitmaps or an icon. See ImagList.h for more details.
|
||||
|
||||
Notifications are passed via the wxWidgets 2.0 event system, or using virtual
|
||||
functions in wxWidgets 1.66.
|
||||
|
||||
See the sample wxListCtrl app for API usage.
|
||||
|
||||
TODO:
|
||||
- addition of further convenience functions
|
||||
to avoid use of wxListItem in some functions
|
||||
- state/overlay images: probably not needed.
|
||||
- in Win95, you can be called back to supply other information
|
||||
besides text, such as state information. This saves no memory
|
||||
and is probably superfluous to requirements.
|
||||
- testing of whole API, extending current sample.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
class WXDLLEXPORT wxListCtrl: public wxControl
|
||||
{
|
||||
public:
|
||||
/*
|
||||
* Public interface
|
||||
*/
|
||||
|
||||
wxListCtrl() { Init(); }
|
||||
|
||||
wxListCtrl(wxWindow *parent,
|
||||
wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxLC_ICON,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = _T("wxListCtrl"))
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(parent, id, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
virtual ~wxListCtrl();
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxLC_ICON,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = _T("wxListCtrl"));
|
||||
|
||||
|
||||
// Attributes
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Set the control colours
|
||||
bool SetForegroundColour(const wxColour& col);
|
||||
bool SetBackgroundColour(const wxColour& col);
|
||||
|
||||
// Gets information about this column
|
||||
bool GetColumn(int col, wxListItem& item) const;
|
||||
|
||||
// Sets information about this column
|
||||
bool SetColumn(int col, wxListItem& item) ;
|
||||
|
||||
// Gets the column width
|
||||
int GetColumnWidth(int col) const;
|
||||
|
||||
// Sets the column width
|
||||
bool SetColumnWidth(int col, int width) ;
|
||||
|
||||
// Gets the number of items that can fit vertically in the
|
||||
// visible area of the list control (list or report view)
|
||||
// or the total number of items in the list control (icon
|
||||
// or small icon view)
|
||||
int GetCountPerPage() const;
|
||||
|
||||
// return the total area occupied by all the items (icon/small icon only)
|
||||
wxRect GetViewRect() const;
|
||||
|
||||
// Gets the edit control for editing labels.
|
||||
wxTextCtrl* GetEditControl() const;
|
||||
|
||||
// Gets information about the item
|
||||
bool GetItem(wxListItem& info) const ;
|
||||
|
||||
// Sets information about the item
|
||||
bool SetItem(wxListItem& info) ;
|
||||
|
||||
// Sets a string field at a particular column
|
||||
long SetItem(long index, int col, const wxString& label, int imageId = -1);
|
||||
|
||||
// Gets the item state
|
||||
int GetItemState(long item, long stateMask) const ;
|
||||
|
||||
// Sets the item state
|
||||
bool SetItemState(long item, long state, long stateMask) ;
|
||||
|
||||
// Sets the item image
|
||||
bool SetItemImage(long item, int image, int selImage) ;
|
||||
|
||||
// Gets the item text
|
||||
wxString GetItemText(long item) const ;
|
||||
|
||||
// Sets the item text
|
||||
void SetItemText(long item, const wxString& str) ;
|
||||
|
||||
// Gets the item data
|
||||
long GetItemData(long item) const ;
|
||||
|
||||
// Sets the item data
|
||||
bool SetItemData(long item, long data) ;
|
||||
|
||||
// Gets the item rectangle
|
||||
bool GetItemRect(long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS) const ;
|
||||
|
||||
// Gets the item position
|
||||
bool GetItemPosition(long item, wxPoint& pos) const ;
|
||||
|
||||
// Sets the item position
|
||||
bool SetItemPosition(long item, const wxPoint& pos) ;
|
||||
|
||||
// Gets the number of items in the list control
|
||||
int GetItemCount() const;
|
||||
|
||||
// Gets the number of columns in the list control
|
||||
int GetColumnCount() const { return m_colCount; }
|
||||
|
||||
// get the horizontal and vertical components of the item spacing
|
||||
wxSize GetItemSpacing() const;
|
||||
|
||||
// Foreground colour of an item.
|
||||
void SetItemTextColour( long item, const wxColour& col);
|
||||
wxColour GetItemTextColour( long item ) const;
|
||||
|
||||
// Background colour of an item.
|
||||
void SetItemBackgroundColour( long item, const wxColour &col);
|
||||
wxColour GetItemBackgroundColour( long item ) const;
|
||||
|
||||
// Gets the number of selected items in the list control
|
||||
int GetSelectedItemCount() const;
|
||||
|
||||
// Gets the text colour of the listview
|
||||
wxColour GetTextColour() const;
|
||||
|
||||
// Sets the text colour of the listview
|
||||
void SetTextColour(const wxColour& col);
|
||||
|
||||
// Gets the index of the topmost visible item when in
|
||||
// list or report view
|
||||
long GetTopItem() const ;
|
||||
|
||||
// Add or remove a single window style
|
||||
void SetSingleStyle(long style, bool add = TRUE) ;
|
||||
|
||||
// Set the whole window style
|
||||
void SetWindowStyleFlag(long style) ;
|
||||
|
||||
// Searches for an item, starting from 'item'.
|
||||
// item can be -1 to find the first item that matches the
|
||||
// specified flags.
|
||||
// Returns the item or -1 if unsuccessful.
|
||||
long GetNextItem(long item, int geometry = wxLIST_NEXT_ALL, int state = wxLIST_STATE_DONTCARE) const ;
|
||||
|
||||
// Gets one of the three image lists
|
||||
wxImageList *GetImageList(int which) const ;
|
||||
|
||||
// Sets the image list
|
||||
// N.B. There's a quirk in the Win95 list view implementation.
|
||||
// If in wxLC_LIST mode, it'll *still* display images by the labels if
|
||||
// there's a small-icon image list set for the control - even though you
|
||||
// haven't specified wxLIST_MASK_IMAGE when inserting.
|
||||
// So you have to set a NULL small-icon image list to be sure that
|
||||
// the wxLC_LIST mode works without icons. Of course, you may want icons...
|
||||
void SetImageList(wxImageList *imageList, int which) ;
|
||||
void AssignImageList(wxImageList *imageList, int which) ;
|
||||
|
||||
// are we in report mode?
|
||||
bool InReportView() const { return HasFlag(wxLC_REPORT); }
|
||||
|
||||
// are we in virtual report mode?
|
||||
bool IsVirtual() const { return HasFlag(wxLC_VIRTUAL); }
|
||||
|
||||
// refresh items selectively (only useful for virtual list controls)
|
||||
void RefreshItem(long item);
|
||||
void RefreshItems(long itemFrom, long itemTo);
|
||||
|
||||
// Operations
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Arranges the items
|
||||
bool Arrange(int flag = wxLIST_ALIGN_DEFAULT);
|
||||
|
||||
// Deletes an item
|
||||
bool DeleteItem(long item);
|
||||
|
||||
// Deletes all items
|
||||
bool DeleteAllItems() ;
|
||||
|
||||
// Deletes a column
|
||||
bool DeleteColumn(int col);
|
||||
|
||||
// Deletes all columns
|
||||
bool DeleteAllColumns();
|
||||
|
||||
// Clears items, and columns if there are any.
|
||||
void ClearAll();
|
||||
|
||||
// Edit the label
|
||||
wxTextCtrl* EditLabel(long item, wxClassInfo* textControlClass = CLASSINFO(wxTextCtrl));
|
||||
|
||||
// End label editing, optionally cancelling the edit
|
||||
bool EndEditLabel(bool cancel);
|
||||
|
||||
// Ensures this item is visible
|
||||
bool EnsureVisible(long item) ;
|
||||
|
||||
// Find an item whose label matches this string, starting from the item after 'start'
|
||||
// or the beginning if 'start' is -1.
|
||||
long FindItem(long start, const wxString& str, bool partial = FALSE);
|
||||
|
||||
// Find an item whose data matches this data, starting from the item after 'start'
|
||||
// or the beginning if 'start' is -1.
|
||||
long FindItem(long start, long data);
|
||||
|
||||
// Find an item nearest this position in the specified direction, starting from
|
||||
// the item after 'start' or the beginning if 'start' is -1.
|
||||
long FindItem(long start, const wxPoint& pt, int direction);
|
||||
|
||||
// Determines which item (if any) is at the specified point,
|
||||
// giving details in 'flags' (see wxLIST_HITTEST_... flags above)
|
||||
long HitTest(const wxPoint& point, int& flags);
|
||||
|
||||
// Inserts an item, returning the index of the new item if successful,
|
||||
// -1 otherwise.
|
||||
long InsertItem(wxListItem& info);
|
||||
|
||||
// Insert a string item
|
||||
long InsertItem(long index, const wxString& label);
|
||||
|
||||
// Insert an image item
|
||||
long InsertItem(long index, int imageIndex);
|
||||
|
||||
// Insert an image/string item
|
||||
long InsertItem(long index, const wxString& label, int imageIndex);
|
||||
|
||||
// For list view mode (only), inserts a column.
|
||||
long InsertColumn(long col, wxListItem& info);
|
||||
|
||||
long InsertColumn(long col,
|
||||
const wxString& heading,
|
||||
int format = wxLIST_FORMAT_LEFT,
|
||||
int width = -1);
|
||||
|
||||
// set the number of items in a virtual list control
|
||||
void SetItemCount(long count);
|
||||
|
||||
// Scrolls the list control. If in icon, small icon or report view mode,
|
||||
// x specifies the number of pixels to scroll. If in list view mode, x
|
||||
// specifies the number of columns to scroll.
|
||||
// If in icon, small icon or list view mode, y specifies the number of pixels
|
||||
// to scroll. If in report view mode, y specifies the number of lines to scroll.
|
||||
bool ScrollList(int dx, int dy);
|
||||
|
||||
// Sort items.
|
||||
|
||||
// fn is a function which takes 3 long arguments: item1, item2, data.
|
||||
// item1 is the long data associated with a first item (NOT the index).
|
||||
// item2 is the long data associated with a second item (NOT the index).
|
||||
// data is the same value as passed to SortItems.
|
||||
// The return value is a negative number if the first item should precede the second
|
||||
// item, a positive number of the second item should precede the first,
|
||||
// or zero if the two items are equivalent.
|
||||
|
||||
// data is arbitrary data to be passed to the sort function.
|
||||
bool SortItems(wxListCtrlCompare fn, long data);
|
||||
|
||||
// IMPLEMENTATION
|
||||
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
||||
virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
|
||||
|
||||
// bring the control in sync with current m_windowStyle value
|
||||
void UpdateStyle();
|
||||
|
||||
// Event handlers
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Necessary for drawing hrules and vrules, if specified
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
|
||||
virtual bool ShouldInheritColours() const { return false; }
|
||||
|
||||
virtual wxVisualAttributes GetDefaultAttributes() const
|
||||
{
|
||||
return GetClassDefaultAttributes(GetWindowVariant());
|
||||
}
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
|
||||
// obsolete stuff, for compatibility only -- don't use
|
||||
wxDEPRECATED( int GetItemSpacing(bool isSmall) const);
|
||||
|
||||
protected:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
// free memory taken by all internal data
|
||||
void FreeAllInternalData();
|
||||
|
||||
// convert our styles to Windows
|
||||
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
|
||||
|
||||
|
||||
wxTextCtrl* m_textCtrl; // The control used for editing a label
|
||||
wxImageList * m_imageListNormal; // The image list for normal icons
|
||||
wxImageList * m_imageListSmall; // The image list for small icons
|
||||
wxImageList * m_imageListState; // The image list state icons (not implemented yet)
|
||||
bool m_ownsImageListNormal,
|
||||
m_ownsImageListSmall,
|
||||
m_ownsImageListState;
|
||||
|
||||
int m_colCount; // Windows doesn't have GetColumnCount so must
|
||||
// keep track of inserted/deleted columns
|
||||
long m_count; // Keep track of item count to save calls to
|
||||
// ListView_GetItemCount
|
||||
bool m_ignoreChangeMessages;
|
||||
|
||||
// TRUE if we have any internal data (user data & attributes)
|
||||
bool m_AnyInternalData;
|
||||
|
||||
// TRUE if we have any items with custom attributes
|
||||
bool m_hasAnyAttr;
|
||||
|
||||
// these functions are only used for virtual list view controls, i.e. the
|
||||
// ones with wxLC_VIRTUAL style
|
||||
|
||||
// return the text for the given column of the given item
|
||||
virtual wxString OnGetItemText(long item, long column) const;
|
||||
|
||||
// return the icon for the given item
|
||||
virtual int OnGetItemImage(long item) const;
|
||||
|
||||
// return the attribute for the item (may return NULL if none)
|
||||
virtual wxListItemAttr *OnGetItemAttr(long item) const;
|
||||
|
||||
private:
|
||||
// process NM_CUSTOMDRAW notification message
|
||||
WXLPARAM OnCustomDraw(WXLPARAM lParam);
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxListCtrl)
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_NO_COPY_CLASS(wxListCtrl)
|
||||
};
|
||||
|
||||
#endif // wxUSE_LISTCTRL
|
||||
|
||||
#endif // _WX_LISTCTRL_H_
|
||||
|
231
include/wx/palmos/mdi.h
Normal file
231
include/wx/palmos/mdi.h
Normal file
@ -0,0 +1,231 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/mdi.h
|
||||
// Purpose: MDI (Multiple Document Interface) classes
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_MDI_H_
|
||||
#define _WX_MDI_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "mdi.h"
|
||||
#endif
|
||||
|
||||
#include "wx/frame.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxFrameNameStr;
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxStatusLineNameStr;
|
||||
|
||||
class WXDLLEXPORT wxMDIClientWindow;
|
||||
class WXDLLEXPORT wxMDIChildFrame;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxMDIParentFrame
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxMDIParentFrame : public wxFrame
|
||||
{
|
||||
public:
|
||||
wxMDIParentFrame();
|
||||
wxMDIParentFrame(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
||||
const wxString& name = wxFrameNameStr)
|
||||
{
|
||||
Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
~wxMDIParentFrame();
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
|
||||
// accessors
|
||||
// ---------
|
||||
|
||||
// Get the active MDI child window (Windows only)
|
||||
wxMDIChildFrame *GetActiveChild() const;
|
||||
|
||||
// Get the client window
|
||||
wxMDIClientWindow *GetClientWindow() const { return m_clientWindow; }
|
||||
|
||||
// Create the client window class (don't Create the window,
|
||||
// just return a new class)
|
||||
virtual wxMDIClientWindow *OnCreateClient(void);
|
||||
|
||||
// MDI windows menu
|
||||
wxMenu* GetWindowMenu() const { return m_windowMenu; };
|
||||
void SetWindowMenu(wxMenu* menu) ;
|
||||
|
||||
// MDI operations
|
||||
// --------------
|
||||
virtual void Cascade();
|
||||
virtual void Tile();
|
||||
virtual void ArrangeIcons();
|
||||
virtual void ActivateNext();
|
||||
virtual void ActivatePrevious();
|
||||
|
||||
// handlers
|
||||
// --------
|
||||
|
||||
// Responds to colour changes
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
|
||||
void OnSize(wxSizeEvent& event);
|
||||
|
||||
bool HandleActivate(int state, bool minimized, WXHWND activate);
|
||||
bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control);
|
||||
|
||||
// override window proc for MDI-specific message processing
|
||||
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
virtual WXLRESULT MSWDefWindowProc(WXUINT, WXWPARAM, WXLPARAM);
|
||||
virtual bool MSWTranslateMessage(WXMSG* msg);
|
||||
|
||||
protected:
|
||||
#if wxUSE_MENUS_NATIVE
|
||||
virtual void InternalSetMenuBar();
|
||||
#endif // wxUSE_MENUS_NATIVE
|
||||
|
||||
virtual WXHICON GetDefaultIcon() const;
|
||||
|
||||
wxMDIClientWindow * m_clientWindow;
|
||||
wxMDIChildFrame * m_currentChild;
|
||||
wxMenu* m_windowMenu;
|
||||
|
||||
// TRUE if MDI Frame is intercepting commands, not child
|
||||
bool m_parentFrameActive;
|
||||
|
||||
private:
|
||||
friend class WXDLLEXPORT wxMDIChildFrame;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
|
||||
DECLARE_NO_COPY_CLASS(wxMDIParentFrame)
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxMDIChildFrame
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxMDIChildFrame : public wxFrame
|
||||
{
|
||||
public:
|
||||
wxMDIChildFrame() { Init(); }
|
||||
wxMDIChildFrame(wxMDIParentFrame *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
~wxMDIChildFrame();
|
||||
|
||||
bool Create(wxMDIParentFrame *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
|
||||
virtual bool IsTopLevel() const { return FALSE; }
|
||||
|
||||
// MDI operations
|
||||
virtual void Maximize(bool maximize = TRUE);
|
||||
virtual void Restore();
|
||||
virtual void Activate();
|
||||
|
||||
// Implementation only from now on
|
||||
// -------------------------------
|
||||
|
||||
// Handlers
|
||||
bool HandleMDIActivate(long bActivate, WXHWND, WXHWND);
|
||||
bool HandleWindowPosChanging(void *lpPos);
|
||||
bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control);
|
||||
bool HandleGetMinMaxInfo(void *mmInfo);
|
||||
|
||||
virtual WXLRESULT MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
virtual WXLRESULT MSWDefWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
virtual bool MSWTranslateMessage(WXMSG *msg);
|
||||
|
||||
virtual void MSWDestroyWindow();
|
||||
|
||||
bool ResetWindowStyle(void *vrect);
|
||||
|
||||
void OnIdle(wxIdleEvent& event);
|
||||
|
||||
protected:
|
||||
virtual void DoGetPosition(int *x, int *y) const;
|
||||
virtual void DoSetClientSize(int width, int height);
|
||||
virtual void InternalSetMenuBar();
|
||||
virtual bool IsMDIChild() const { return TRUE; }
|
||||
|
||||
virtual WXHICON GetDefaultIcon() const;
|
||||
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
private:
|
||||
bool m_needsResize; // flag which tells us to artificially resize the frame
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxMDIChildFrame)
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxMDIClientWindow
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxMDIClientWindow : public wxWindow
|
||||
{
|
||||
public:
|
||||
wxMDIClientWindow() { Init(); }
|
||||
wxMDIClientWindow(wxMDIParentFrame *parent, long style = 0)
|
||||
{
|
||||
Init();
|
||||
|
||||
CreateClient(parent, style);
|
||||
}
|
||||
|
||||
// Note: this is virtual, to allow overridden behaviour.
|
||||
virtual bool CreateClient(wxMDIParentFrame *parent,
|
||||
long style = wxVSCROLL | wxHSCROLL);
|
||||
|
||||
// Explicitly call default scroll behaviour
|
||||
void OnScroll(wxScrollEvent& event);
|
||||
|
||||
virtual void DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
protected:
|
||||
void Init() { m_scrollX = m_scrollY = 0; }
|
||||
|
||||
int m_scrollX, m_scrollY;
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxMDIClientWindow)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_MDI_H_
|
240
include/wx/palmos/menu.h
Normal file
240
include/wx/palmos/menu.h
Normal file
@ -0,0 +1,240 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/menu.h
|
||||
// Purpose: wxMenu, wxMenuBar classes
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_MENU_H_
|
||||
#define _WX_MENU_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "menu.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_ACCEL
|
||||
#include "wx/accel.h"
|
||||
#include "wx/dynarray.h"
|
||||
|
||||
WX_DEFINE_EXPORTED_ARRAY_PTR(wxAcceleratorEntry *, wxAcceleratorArray);
|
||||
#endif // wxUSE_ACCEL
|
||||
|
||||
class WXDLLEXPORT wxFrame;
|
||||
|
||||
#if defined(__WXWINCE__) && wxUSE_TOOLBAR
|
||||
class WXDLLEXPORT wxToolBar;
|
||||
#endif
|
||||
|
||||
#include "wx/arrstr.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Menu
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxMenu : public wxMenuBase
|
||||
{
|
||||
public:
|
||||
// ctors & dtor
|
||||
wxMenu(const wxString& title, long style = 0)
|
||||
: wxMenuBase(title, style) { Init(); }
|
||||
|
||||
wxMenu(long style = 0) : wxMenuBase(style) { Init(); }
|
||||
|
||||
virtual ~wxMenu();
|
||||
|
||||
// implement base class virtuals
|
||||
virtual wxMenuItem* DoAppend(wxMenuItem *item);
|
||||
virtual wxMenuItem* DoInsert(size_t pos, wxMenuItem *item);
|
||||
virtual wxMenuItem* DoRemove(wxMenuItem *item);
|
||||
|
||||
virtual void Break();
|
||||
|
||||
virtual void SetTitle(const wxString& title);
|
||||
|
||||
// deprecated functions
|
||||
#if wxUSE_MENU_CALLBACK
|
||||
wxMenu(const wxString& title, const wxFunction func)
|
||||
: wxMenuBase(title)
|
||||
{
|
||||
Init();
|
||||
|
||||
Callback(func);
|
||||
}
|
||||
#endif // wxUSE_MENU_CALLBACK
|
||||
|
||||
// implementation only from now on
|
||||
// -------------------------------
|
||||
|
||||
virtual void Attach(wxMenuBarBase *menubar);
|
||||
|
||||
bool PalmCommand(WXUINT param, WXWORD id);
|
||||
|
||||
// semi-private accessors
|
||||
// get the window which contains this menu
|
||||
wxWindow *GetWindow() const;
|
||||
// get the menu handle
|
||||
WXHMENU GetHMenu() const { return m_hMenu; }
|
||||
|
||||
#if wxUSE_ACCEL
|
||||
// called by wxMenuBar to build its accel table from the accels of all menus
|
||||
bool HasAccels() const { return !m_accels.IsEmpty(); }
|
||||
size_t GetAccelCount() const { return m_accels.GetCount(); }
|
||||
size_t CopyAccels(wxAcceleratorEntry *accels) const;
|
||||
|
||||
// called by wxMenuItem when its accels changes
|
||||
void UpdateAccel(wxMenuItem *item);
|
||||
|
||||
// helper used by wxMenu itself (returns the index in m_accels)
|
||||
int FindAccel(int id) const;
|
||||
#endif // wxUSE_ACCEL
|
||||
|
||||
private:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
// common part of Append/Insert (behaves as Append is pos == (size_t)-1)
|
||||
bool DoInsertOrAppend(wxMenuItem *item, size_t pos = (size_t)-1);
|
||||
|
||||
// terminate the current radio group, if any
|
||||
void EndRadioGroup();
|
||||
|
||||
// if TRUE, insert a break before appending the next item
|
||||
bool m_doBreak;
|
||||
|
||||
// the position of the first item in the current radio group or -1
|
||||
int m_startRadioGroup;
|
||||
|
||||
// the menu handle of this menu
|
||||
WXHMENU m_hMenu;
|
||||
|
||||
#if wxUSE_ACCEL
|
||||
// the accelerators for our menu items
|
||||
wxAcceleratorArray m_accels;
|
||||
#endif // wxUSE_ACCEL
|
||||
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxMenu)
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Menu Bar (a la Windows)
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxMenuInfo : public wxObject
|
||||
{
|
||||
public :
|
||||
wxMenuInfo() { m_menu = NULL ; }
|
||||
virtual ~wxMenuInfo() { }
|
||||
|
||||
void Create( wxMenu *menu , const wxString &title )
|
||||
{ m_menu = menu ; m_title = title ; }
|
||||
wxMenu* GetMenu() const { return m_menu ; }
|
||||
wxString GetTitle() const { return m_title ; }
|
||||
private :
|
||||
wxMenu *m_menu ;
|
||||
wxString m_title ;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxMenuInfo) ;
|
||||
} ;
|
||||
|
||||
WX_DECLARE_EXPORTED_LIST(wxMenuInfo, wxMenuInfoList );
|
||||
|
||||
class WXDLLEXPORT wxMenuBar : public wxMenuBarBase
|
||||
{
|
||||
public:
|
||||
// ctors & dtor
|
||||
// default constructor
|
||||
wxMenuBar();
|
||||
|
||||
wxMenuBar(long style);
|
||||
// menubar takes ownership of the menus arrays but copies the titles
|
||||
wxMenuBar(int n, wxMenu *menus[], const wxString titles[]);
|
||||
virtual ~wxMenuBar();
|
||||
|
||||
// menubar construction
|
||||
bool Append( wxMenuInfo *info ) { return Append( info->GetMenu() , info->GetTitle() ) ; }
|
||||
const wxMenuInfoList& GetMenuInfos() const ;
|
||||
|
||||
virtual bool Append( wxMenu *menu, const wxString &title );
|
||||
virtual bool Insert(size_t pos, wxMenu *menu, const wxString& title);
|
||||
virtual wxMenu *Replace(size_t pos, wxMenu *menu, const wxString& title);
|
||||
virtual wxMenu *Remove(size_t pos);
|
||||
|
||||
virtual void EnableTop( size_t pos, bool flag );
|
||||
virtual void SetLabelTop( size_t pos, const wxString& label );
|
||||
virtual wxString GetLabelTop( size_t pos ) const;
|
||||
|
||||
// implementation from now on
|
||||
WXHMENU Create();
|
||||
virtual void Detach();
|
||||
virtual void Attach(wxFrame *frame);
|
||||
|
||||
void LoadMenu();
|
||||
int ProcessCommand(int ItemID);
|
||||
|
||||
#if wxUSE_TOOLBAR && defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__))
|
||||
// Under WinCE, a menubar is owned by the frame's toolbar
|
||||
void SetToolBar(wxToolBar* toolBar) { m_toolBar = toolBar; }
|
||||
wxToolBar* GetToolBar() const { return m_toolBar; }
|
||||
#endif
|
||||
|
||||
#if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__))
|
||||
WXHWND GetCommandBar() const { return m_commandBar; }
|
||||
bool AddAdornments(long style);
|
||||
#endif
|
||||
|
||||
#if wxUSE_ACCEL
|
||||
// get the accel table for all the menus
|
||||
const wxAcceleratorTable& GetAccelTable() const { return m_accelTable; }
|
||||
|
||||
// update the accel table (must be called after adding/deletign a menu)
|
||||
void RebuildAccelTable();
|
||||
#endif // wxUSE_ACCEL
|
||||
|
||||
// get the menu handle
|
||||
WXHMENU GetHMenu() const { return m_hMenu; }
|
||||
|
||||
// if the menubar is modified, the display is not updated automatically,
|
||||
// call this function to update it (m_menuBarFrame should be !NULL)
|
||||
void Refresh();
|
||||
|
||||
// To avoid compile warning
|
||||
void Refresh( bool eraseBackground,
|
||||
const wxRect *rect = (const wxRect *) NULL ) { wxWindow::Refresh(eraseBackground, rect); }
|
||||
|
||||
protected:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
wxArrayString m_titles ;
|
||||
wxMenuInfoList m_menuInfos;
|
||||
|
||||
WXHMENU m_hMenu;
|
||||
|
||||
// Return the Palm position for a wxMenu which is sometimes different from
|
||||
// the wxWidgets position.
|
||||
int PalmPositionForWxMenu(wxMenu *menu, int wxpos);
|
||||
#if wxUSE_ACCEL
|
||||
// the accelerator table for all accelerators in all our menus
|
||||
wxAcceleratorTable m_accelTable;
|
||||
#endif // wxUSE_ACCEL
|
||||
|
||||
#if defined(__WXWINCE__) && wxUSE_TOOLBAR
|
||||
wxToolBar* m_toolBar;
|
||||
#endif
|
||||
// Not using a combined wxToolBar/wxMenuBar? then use
|
||||
// a commandbar in WinCE .NET to implement the
|
||||
// menubar, since there is no ::SetMenu function.
|
||||
#if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__))
|
||||
WXHWND m_commandBar;
|
||||
bool m_adornmentsAdded;
|
||||
#endif
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxMenuBar)
|
||||
};
|
||||
|
||||
#endif // _WX_MENU_H_
|
96
include/wx/palmos/menuitem.h
Normal file
96
include/wx/palmos/menuitem.h
Normal file
@ -0,0 +1,96 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: menuitem.h
|
||||
// Purpose: wxMenuItem class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _MENUITEM_H
|
||||
#define _MENUITEM_H
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "menuitem.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
#include "wx/ownerdrw.h" // base class
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxMenuItem : public wxMenuItemBase
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
, public wxOwnerDrawn
|
||||
#endif
|
||||
{
|
||||
public:
|
||||
// ctor & dtor
|
||||
wxMenuItem(wxMenu *parentMenu = (wxMenu *)NULL,
|
||||
int id = wxID_SEPARATOR,
|
||||
const wxString& name = wxEmptyString,
|
||||
const wxString& help = wxEmptyString,
|
||||
wxItemKind kind = wxITEM_NORMAL,
|
||||
wxMenu *subMenu = (wxMenu *)NULL);
|
||||
virtual ~wxMenuItem();
|
||||
|
||||
// override base class virtuals
|
||||
virtual void SetText(const wxString& strName);
|
||||
virtual void SetCheckable(bool checkable);
|
||||
|
||||
virtual void Enable(bool bDoEnable = TRUE);
|
||||
virtual void Check(bool bDoCheck = TRUE);
|
||||
virtual bool IsChecked() const;
|
||||
|
||||
// unfortunately needed to resolve ambiguity between
|
||||
// wxMenuItemBase::IsCheckable() and wxOwnerDrawn::IsCheckable()
|
||||
bool IsCheckable() const { return wxMenuItemBase::IsCheckable(); }
|
||||
|
||||
// the id for a popup menu is really its menu handle (as required by
|
||||
// ::AppendMenu() API), so this function will return either the id or the
|
||||
// menu handle depending on what we're
|
||||
int GetRealId() const;
|
||||
|
||||
// mark item as belonging to the given radio group
|
||||
void SetAsRadioGroupStart();
|
||||
void SetRadioGroupStart(int start);
|
||||
void SetRadioGroupEnd(int end);
|
||||
|
||||
// compatibility only, don't use in new code
|
||||
wxMenuItem(wxMenu *parentMenu,
|
||||
int id,
|
||||
const wxString& text,
|
||||
const wxString& help,
|
||||
bool isCheckable,
|
||||
wxMenu *subMenu = (wxMenu *)NULL);
|
||||
|
||||
private:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
// the positions of the first and last items of the radio group this item
|
||||
// belongs to or -1: start is the radio group start and is valid for all
|
||||
// but first radio group items (m_isRadioGroupStart == FALSE), end is valid
|
||||
// only for the first one
|
||||
union
|
||||
{
|
||||
int start;
|
||||
int end;
|
||||
} m_radioGroup;
|
||||
|
||||
// does this item start a radio group?
|
||||
bool m_isRadioGroupStart;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxMenuItem)
|
||||
};
|
||||
|
||||
#endif //_MENUITEM_H
|
174
include/wx/palmos/metafile.h
Normal file
174
include/wx/palmos/metafile.h
Normal file
@ -0,0 +1,174 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/metafile.h
|
||||
// Purpose: wxMetaFile, wxMetaFileDC and wxMetaFileDataObject classes
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_METAFIILE_H_
|
||||
#define _WX_METAFIILE_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "metafile.h"
|
||||
#endif
|
||||
|
||||
#include "wx/setup.h"
|
||||
|
||||
#if wxUSE_METAFILE
|
||||
|
||||
#include "wx/dc.h"
|
||||
#include "wx/gdiobj.h"
|
||||
|
||||
#if wxUSE_DRAG_AND_DROP
|
||||
#include "wx/dataobj.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Metafile and metafile device context classes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxMetafile;
|
||||
|
||||
class WXDLLEXPORT wxMetafileRefData: public wxGDIRefData
|
||||
{
|
||||
friend class WXDLLEXPORT wxMetafile;
|
||||
public:
|
||||
wxMetafileRefData();
|
||||
~wxMetafileRefData();
|
||||
|
||||
public:
|
||||
WXHANDLE m_metafile;
|
||||
int m_windowsMappingMode;
|
||||
int m_width, m_height;
|
||||
};
|
||||
|
||||
#define M_METAFILEDATA ((wxMetafileRefData *)m_refData)
|
||||
|
||||
class WXDLLEXPORT wxMetafile: public wxGDIObject
|
||||
{
|
||||
public:
|
||||
wxMetafile(const wxString& file = wxEmptyString);
|
||||
wxMetafile(const wxMetafile& metafile) { Ref(metafile); }
|
||||
virtual ~wxMetafile();
|
||||
|
||||
// After this is called, the metafile cannot be used for anything
|
||||
// since it is now owned by the clipboard.
|
||||
virtual bool SetClipboard(int width = 0, int height = 0);
|
||||
|
||||
virtual bool Play(wxDC *dc);
|
||||
bool Ok() const { return (M_METAFILEDATA && (M_METAFILEDATA->m_metafile != 0)); };
|
||||
|
||||
// set/get the size of metafile for clipboard operations
|
||||
wxSize GetSize() const { return wxSize(GetWidth(), GetHeight()); }
|
||||
int GetWidth() const { return M_METAFILEDATA->m_width; }
|
||||
int GetHeight() const { return M_METAFILEDATA->m_height; }
|
||||
|
||||
void SetWidth(int width) { M_METAFILEDATA->m_width = width; }
|
||||
void SetHeight(int height) { M_METAFILEDATA->m_height = height; }
|
||||
|
||||
// Implementation
|
||||
WXHANDLE GetHMETAFILE() const { return M_METAFILEDATA->m_metafile; }
|
||||
void SetHMETAFILE(WXHANDLE mf) ;
|
||||
int GetWindowsMappingMode() const { return M_METAFILEDATA->m_windowsMappingMode; }
|
||||
void SetWindowsMappingMode(int mm);
|
||||
|
||||
// Operators
|
||||
wxMetafile& operator=(const wxMetafile& metafile)
|
||||
{ if (*this != metafile) Ref(metafile); return *this; }
|
||||
bool operator==(const wxMetafile& metafile) const
|
||||
{ return m_refData == metafile.m_refData; }
|
||||
bool operator!=(const wxMetafile& metafile) const
|
||||
{ return m_refData != metafile.m_refData; }
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxMetafile)
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxMetafileDC: public wxDC
|
||||
{
|
||||
public:
|
||||
// Don't supply origin and extent
|
||||
// Supply them to wxMakeMetaFilePlaceable instead.
|
||||
wxMetafileDC(const wxString& file = wxEmptyString);
|
||||
|
||||
// Supply origin and extent (recommended).
|
||||
// Then don't need to supply them to wxMakeMetaFilePlaceable.
|
||||
wxMetafileDC(const wxString& file, int xext, int yext, int xorg, int yorg);
|
||||
|
||||
virtual ~wxMetafileDC();
|
||||
|
||||
// Should be called at end of drawing
|
||||
virtual wxMetafile *Close();
|
||||
virtual void SetMapMode(int mode);
|
||||
virtual void GetTextExtent(const wxString& string, long *x, long *y,
|
||||
long *descent = NULL, long *externalLeading = NULL,
|
||||
wxFont *theFont = NULL, bool use16bit = FALSE) const;
|
||||
|
||||
// Implementation
|
||||
wxMetafile *GetMetaFile() const { return m_metaFile; }
|
||||
void SetMetaFile(wxMetafile *mf) { m_metaFile = mf; }
|
||||
int GetWindowsMappingMode() const { return m_windowsMappingMode; }
|
||||
void SetWindowsMappingMode(int mm) { m_windowsMappingMode = mm; }
|
||||
|
||||
protected:
|
||||
int m_windowsMappingMode;
|
||||
wxMetafile* m_metaFile;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxMetafileDC)
|
||||
};
|
||||
|
||||
/*
|
||||
* Pass filename of existing non-placeable metafile, and bounding box.
|
||||
* Adds a placeable metafile header, sets the mapping mode to anisotropic,
|
||||
* and sets the window origin and extent to mimic the wxMM_TEXT mapping mode.
|
||||
*
|
||||
*/
|
||||
|
||||
// No origin or extent
|
||||
bool WXDLLEXPORT wxMakeMetafilePlaceable(const wxString& filename, float scale = 1.0);
|
||||
|
||||
// Optional origin and extent
|
||||
bool WXDLLEXPORT wxMakeMetaFilePlaceable(const wxString& filename, int x1, int y1, int x2, int y2, float scale = 1.0, bool useOriginAndExtent = TRUE);
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxMetafileDataObject is a specialization of wxDataObject for metafile data
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_DRAG_AND_DROP
|
||||
|
||||
class WXDLLEXPORT wxMetafileDataObject : public wxDataObjectSimple
|
||||
{
|
||||
public:
|
||||
// ctors
|
||||
wxMetafileDataObject() : wxDataObjectSimple(wxDF_METAFILE)
|
||||
{ }
|
||||
wxMetafileDataObject(const wxMetafile& metafile)
|
||||
: wxDataObjectSimple(wxDF_METAFILE), m_metafile(metafile) { }
|
||||
|
||||
// virtual functions which you may override if you want to provide data on
|
||||
// demand only - otherwise, the trivial default versions will be used
|
||||
virtual void SetMetafile(const wxMetafile& metafile)
|
||||
{ m_metafile = metafile; }
|
||||
virtual wxMetafile GetMetafile() const
|
||||
{ return m_metafile; }
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual size_t GetDataSize() const;
|
||||
virtual bool GetDataHere(void *buf) const;
|
||||
virtual bool SetData(size_t len, const void *buf);
|
||||
|
||||
protected:
|
||||
wxMetafile m_metafile;
|
||||
};
|
||||
|
||||
#endif // wxUSE_DRAG_AND_DROP
|
||||
|
||||
#endif // wxUSE_METAFILE
|
||||
#endif
|
||||
// _WX_METAFIILE_H_
|
||||
|
126
include/wx/palmos/mimetype.h
Normal file
126
include/wx/palmos/mimetype.h
Normal file
@ -0,0 +1,126 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/mimetype.h
|
||||
// Purpose: classes and functions to manage MIME types
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _MIMETYPE_IMPL_H
|
||||
#define _MIMETYPE_IMPL_H
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "mimetype.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_MIMETYPE
|
||||
|
||||
#include "wx/mimetype.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFileTypeImpl is the MSW version of wxFileType, this is a private class
|
||||
// and is never used directly by the application
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_BASE wxFileTypeImpl
|
||||
{
|
||||
public:
|
||||
// ctor
|
||||
wxFileTypeImpl() { }
|
||||
|
||||
// one of these Init() function must be called (ctor can't take any
|
||||
// arguments because it's common)
|
||||
|
||||
// initialize us with our file type name and extension - in this case
|
||||
// we will read all other data from the registry
|
||||
void Init(const wxString& strFileType, const wxString& ext);
|
||||
|
||||
// implement accessor functions
|
||||
bool GetExtensions(wxArrayString& extensions);
|
||||
bool GetMimeType(wxString *mimeType) const;
|
||||
bool GetMimeTypes(wxArrayString& mimeTypes) const;
|
||||
bool GetIcon(wxIconLocation *iconLoc) const;
|
||||
bool GetDescription(wxString *desc) const;
|
||||
bool GetOpenCommand(wxString *openCmd,
|
||||
const wxFileType::MessageParameters& params) const;
|
||||
bool GetPrintCommand(wxString *printCmd,
|
||||
const wxFileType::MessageParameters& params) const;
|
||||
|
||||
size_t GetAllCommands(wxArrayString * verbs, wxArrayString * commands,
|
||||
const wxFileType::MessageParameters& params) const;
|
||||
|
||||
bool Unassociate();
|
||||
|
||||
// set an arbitrary command, ask confirmation if it already exists and
|
||||
// overwriteprompt is TRUE
|
||||
bool SetCommand(const wxString& cmd,
|
||||
const wxString& verb,
|
||||
bool overwriteprompt = TRUE);
|
||||
|
||||
bool SetDefaultIcon(const wxString& cmd = wxEmptyString, int index = 0);
|
||||
|
||||
// this is called by Associate
|
||||
bool SetDescription (const wxString& desc);
|
||||
|
||||
private:
|
||||
// helper function: reads the command corresponding to the specified verb
|
||||
// from the registry (returns an empty string if not found)
|
||||
wxString GetCommand(const wxChar *verb) const;
|
||||
|
||||
// get the registry path for the given verb
|
||||
wxString GetVerbPath(const wxString& verb) const;
|
||||
|
||||
// check that the registry key for our extension exists, create it if it
|
||||
// doesn't, return FALSE if this failed
|
||||
bool EnsureExtKeyExists();
|
||||
|
||||
wxString m_strFileType, // may be empty
|
||||
m_ext;
|
||||
|
||||
// these methods are not publicly accessible (as wxMimeTypesManager
|
||||
// doesn't know about them), and should only be called by Unassociate
|
||||
|
||||
bool RemoveOpenCommand();
|
||||
bool RemoveCommand(const wxString& verb);
|
||||
bool RemoveMimeType();
|
||||
bool RemoveDefaultIcon();
|
||||
bool RemoveDescription();
|
||||
};
|
||||
|
||||
class WXDLLIMPEXP_BASE wxMimeTypesManagerImpl
|
||||
{
|
||||
public:
|
||||
// nothing to do here, we don't load any data but just go and fetch it from
|
||||
// the registry when asked for
|
||||
wxMimeTypesManagerImpl() { }
|
||||
|
||||
// implement containing class functions
|
||||
wxFileType *GetFileTypeFromExtension(const wxString& ext);
|
||||
wxFileType *GetOrAllocateFileTypeFromExtension(const wxString& ext);
|
||||
wxFileType *GetFileTypeFromMimeType(const wxString& mimeType);
|
||||
|
||||
size_t EnumAllFileTypes(wxArrayString& mimetypes);
|
||||
|
||||
// this are NOPs under Windows
|
||||
bool ReadMailcap(const wxString& WXUNUSED(filename), bool WXUNUSED(fallback) = TRUE)
|
||||
{ return TRUE; }
|
||||
bool ReadMimeTypes(const wxString& WXUNUSED(filename))
|
||||
{ return TRUE; }
|
||||
|
||||
// create a new filetype association
|
||||
wxFileType *Associate(const wxFileTypeInfo& ftInfo);
|
||||
|
||||
// create a new filetype with the given name and extension
|
||||
wxFileType *CreateFileType(const wxString& filetype, const wxString& ext);
|
||||
};
|
||||
|
||||
#endif // wxUSE_MIMETYPE
|
||||
|
||||
#endif
|
||||
//_MIMETYPE_IMPL_H
|
||||
|
56
include/wx/palmos/minifram.h
Normal file
56
include/wx/palmos/minifram.h
Normal file
@ -0,0 +1,56 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/minifram.h
|
||||
// Purpose: wxMiniFrame class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_MINIFRAM_H_
|
||||
#define _WX_MINIFRAM_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "minifram.h"
|
||||
#endif
|
||||
|
||||
#include "wx/frame.h"
|
||||
|
||||
class WXDLLEXPORT wxMiniFrame : public wxFrame
|
||||
{
|
||||
public:
|
||||
wxMiniFrame() { }
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxCAPTION | wxCLIP_CHILDREN | wxRESIZE_BORDER,
|
||||
const wxString& name = wxFrameNameStr)
|
||||
{
|
||||
return wxFrame::Create(parent, id, title, pos, size,
|
||||
style |
|
||||
wxFRAME_TOOL_WINDOW |
|
||||
(parent ? wxFRAME_FLOAT_ON_PARENT : 0), name);
|
||||
}
|
||||
|
||||
wxMiniFrame(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxCAPTION | wxCLIP_CHILDREN | wxRESIZE_BORDER,
|
||||
const wxString& name = wxFrameNameStr)
|
||||
{
|
||||
Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
protected:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxMiniFrame)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_MINIFRAM_H_
|
47
include/wx/palmos/msgdlg.h
Normal file
47
include/wx/palmos/msgdlg.h
Normal file
@ -0,0 +1,47 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: msgdlg.h
|
||||
// Purpose: wxMessageDialog class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_MSGBOXDLG_H_
|
||||
#define _WX_MSGBOXDLG_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "msgdlg.h"
|
||||
#endif
|
||||
|
||||
#include "wx/setup.h"
|
||||
#include "wx/dialog.h"
|
||||
|
||||
/*
|
||||
* Message box dialog
|
||||
*/
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxMessageBoxCaptionStr;
|
||||
|
||||
class WXDLLEXPORT wxMessageDialog: public wxDialog
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMessageDialog)
|
||||
protected:
|
||||
wxString m_caption;
|
||||
wxString m_message;
|
||||
long m_dialogStyle;
|
||||
wxWindow * m_parent;
|
||||
public:
|
||||
wxMessageDialog(wxWindow *parent, const wxString& message, const wxString& caption = wxMessageBoxCaptionStr,
|
||||
long style = wxOK|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
|
||||
|
||||
int ShowModal(void);
|
||||
|
||||
DECLARE_NO_COPY_CLASS(wxMessageDialog)
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
// _WX_MSGBOXDLG_H_
|
72
include/wx/palmos/mslu.h
Normal file
72
include/wx/palmos/mslu.h
Normal file
@ -0,0 +1,72 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/mslu.h
|
||||
// Purpose: Fixes for bugs in MSLU
|
||||
// Author: Vaclav Slavik
|
||||
// Modified by:
|
||||
// Created: 2002/02/17
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2002 Vaclav Slavik
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_MSLU_H_
|
||||
#define _WX_MSLU_H_
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/wxchar.h"
|
||||
|
||||
#if !wxUSE_UNICODE_MSLU
|
||||
inline bool wxUsingUnicowsDll() { return FALSE; }
|
||||
#else
|
||||
|
||||
// Returns true if we are running under Unicode emulation in Win9x environment.
|
||||
// Workaround hacks take effect only if this condition is met
|
||||
inline bool wxUsingUnicowsDll()
|
||||
{
|
||||
return (wxGetOsVersion() == wxWIN95);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Wrongly implemented functions from unicows.dll
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_GUI
|
||||
|
||||
WXDLLEXPORT int wxMSLU_DrawStateW(WXHDC dc, WXHBRUSH br, WXFARPROC outputFunc,
|
||||
WXLPARAM lData, WXWPARAM wData,
|
||||
int x, int y, int cx, int cy,
|
||||
unsigned int flags);
|
||||
#define DrawStateW(dc, br, func, ld, wd, x, y, cx, cy, flags) \
|
||||
wxMSLU_DrawStateW((WXHDC)dc,(WXHBRUSH)br,(WXFARPROC)func, \
|
||||
ld, wd, x, y, cx, cy, flags)
|
||||
|
||||
WXDLLEXPORT int wxMSLU_GetOpenFileNameW(void *ofn);
|
||||
#define GetOpenFileNameW(ofn) wxMSLU_GetOpenFileNameW((void*)ofn)
|
||||
|
||||
WXDLLEXPORT int wxMSLU_GetSaveFileNameW(void *ofn);
|
||||
#define GetSaveFileNameW(ofn) wxMSLU_GetSaveFileNameW((void*)ofn)
|
||||
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Missing libc file manipulation functions in Win9x
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
WXDLLEXPORT int wxMSLU__trename(const wxChar *oldname, const wxChar *newname);
|
||||
WXDLLEXPORT int wxMSLU__tremove(const wxChar *name);
|
||||
|
||||
#if defined( __VISUALC__ ) \
|
||||
|| ( defined(__MINGW32__) && wxCHECK_W32API_VERSION( 0, 5 ) ) \
|
||||
|| ( defined(__MWERKS__) && defined(__WXMSW__) ) \
|
||||
|| ( defined(__BORLANDC__) && (__BORLANDC__ > 0x460) )
|
||||
WXDLLEXPORT int wxMSLU__wopen(const wxChar *name, int flags, int mode);
|
||||
WXDLLEXPORT int wxMSLU__waccess(const wxChar *name, int mode);
|
||||
WXDLLEXPORT int wxMSLU__wmkdir(const wxChar *name);
|
||||
WXDLLEXPORT int wxMSLU__wrmdir(const wxChar *name);
|
||||
WXDLLEXPORT int wxMSLU__wstat(const wxChar *name, struct _stat *buffer);
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_UNICODE_MSLU
|
||||
|
||||
#endif // _WX_MSLU_H_
|
69
include/wx/palmos/msvcrt.h
Normal file
69
include/wx/palmos/msvcrt.h
Normal file
@ -0,0 +1,69 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/palmos/msvcrt.h
|
||||
// Purpose: macros to use some non-standard features of MS Visual C++
|
||||
// C run-time library
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 31.01.1999
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Vadim Zeitlin
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// the goal of this file is to define wxCrtSetDbgFlag() macro which may be
|
||||
// used like this:
|
||||
// wxCrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF);
|
||||
// to turn on memory leak checks for programs compiled with Microsoft Visual
|
||||
// C++ (5.0+). The macro will expand to nothing under other compilers.
|
||||
|
||||
#ifndef _PALMOS_MSVCRT_H_
|
||||
#define _PALMOS_MSVCRT_H_
|
||||
|
||||
// use debug CRT functions for memory leak detections in VC++ 5.0+ in debug
|
||||
// builds
|
||||
#undef wxUSE_VC_CRTDBG
|
||||
#if defined(__WXDEBUG__) && defined(__VISUALC__) && (__VISUALC__ >= 1000) \
|
||||
&& !defined(UNDER_CE)
|
||||
// it doesn't combine well with wxWin own memory debugging methods
|
||||
#if !wxUSE_GLOBAL_MEMORY_OPERATORS && !wxUSE_MEMORY_TRACING && !defined(__NO_VC_CRTDBG__)
|
||||
#define wxUSE_VC_CRTDBG
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef wxUSE_VC_CRTDBG
|
||||
// VC++ uses this macro as debug/release mode indicator
|
||||
#ifndef _DEBUG
|
||||
#define _DEBUG
|
||||
#endif
|
||||
|
||||
// Need to undef new if including crtdbg.h which redefines new itself
|
||||
#ifdef new
|
||||
#undef new
|
||||
#endif
|
||||
|
||||
// we need this to show file & line number of the allocation that caused
|
||||
// the leak
|
||||
#define _CRTDBG_MAP_ALLOC
|
||||
#include <stdlib.h>
|
||||
#ifndef _CRTBLD
|
||||
// Need when builded with pure MS SDK
|
||||
#define _CRTBLD
|
||||
#endif
|
||||
|
||||
#include <crtdbg.h>
|
||||
|
||||
// this define works around a bug with inline declarations of new, see
|
||||
//
|
||||
// http://support.microsoft.com/support/kb/articles/Q140/8/58.asp
|
||||
//
|
||||
// for the details
|
||||
#define new new( _NORMAL_BLOCK, __FILE__, __LINE__)
|
||||
|
||||
#define wxCrtSetDbgFlag(flag) \
|
||||
_CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | (flag))
|
||||
#else // !using VC CRT
|
||||
#define wxCrtSetDbgFlag(flag)
|
||||
#endif // wxUSE_VC_CRTDBG
|
||||
|
||||
#endif // _PALMOS_MSVCRT_H_
|
||||
|
196
include/wx/palmos/notebook.h
Normal file
196
include/wx/palmos/notebook.h
Normal file
@ -0,0 +1,196 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/notebook.h
|
||||
// Purpose: MSW/GTK compatible notebook (a.k.a. property sheet)
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _NOTEBOOK_H
|
||||
#define _NOTEBOOK_H
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "notebook.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_NOTEBOOK
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxNotebook
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxNotebookPageInfo : public wxObject
|
||||
{
|
||||
public :
|
||||
wxNotebookPageInfo() { m_page = NULL ; m_imageId = -1 ; m_selected = false ; }
|
||||
virtual ~wxNotebookPageInfo() { }
|
||||
|
||||
void Create( wxNotebookPage *page , const wxString &text , bool selected , int imageId )
|
||||
{ m_page = page ; m_text = text ; m_selected = selected ; m_imageId = imageId ; }
|
||||
wxNotebookPage* GetPage() const { return m_page ; }
|
||||
wxString GetText() const { return m_text ; }
|
||||
bool GetSelected() const { return m_selected ; }
|
||||
int GetImageId() const { return m_imageId; }
|
||||
private :
|
||||
wxNotebookPage *m_page ;
|
||||
wxString m_text ;
|
||||
bool m_selected ;
|
||||
int m_imageId ;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxNotebookPageInfo) ;
|
||||
} ;
|
||||
|
||||
|
||||
WX_DECLARE_EXPORTED_LIST(wxNotebookPageInfo, wxNotebookPageInfoList );
|
||||
|
||||
class WXDLLEXPORT wxNotebook : public wxNotebookBase
|
||||
{
|
||||
public:
|
||||
// ctors
|
||||
// -----
|
||||
// default for dynamic class
|
||||
wxNotebook();
|
||||
// the same arguments as for wxControl (@@@ any special styles?)
|
||||
wxNotebook(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxNOTEBOOK_NAME);
|
||||
// Create() function
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxNOTEBOOK_NAME);
|
||||
|
||||
// accessors
|
||||
// ---------
|
||||
// get number of pages in the dialog
|
||||
virtual size_t GetPageCount() const;
|
||||
|
||||
// set the currently selected page, return the index of the previously
|
||||
// selected one (or -1 on error)
|
||||
// NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events
|
||||
int SetSelection(size_t nPage);
|
||||
// get the currently selected page
|
||||
int GetSelection() const { return m_nSelection; }
|
||||
|
||||
// set/get the title of a page
|
||||
bool SetPageText(size_t nPage, const wxString& strText);
|
||||
wxString GetPageText(size_t nPage) const;
|
||||
|
||||
// image list stuff: each page may have an image associated with it. All
|
||||
// the images belong to an image list, so you have to
|
||||
// 1) create an image list
|
||||
// 2) associate it with the notebook
|
||||
// 3) set for each page it's image
|
||||
// associate image list with a control
|
||||
void SetImageList(wxImageList* imageList);
|
||||
|
||||
// sets/returns item's image index in the current image list
|
||||
int GetPageImage(size_t nPage) const;
|
||||
bool SetPageImage(size_t nPage, int nImage);
|
||||
|
||||
// currently it's always 1 because wxGTK doesn't support multi-row
|
||||
// tab controls
|
||||
int GetRowCount() const;
|
||||
|
||||
// control the appearance of the notebook pages
|
||||
// set the size (the same for all pages)
|
||||
void SetPageSize(const wxSize& size);
|
||||
// set the padding between tabs (in pixels)
|
||||
void SetPadding(const wxSize& padding);
|
||||
|
||||
// Windows only: attempts to get colour for UX theme page background
|
||||
wxColour GetThemeBackgroundColour();
|
||||
|
||||
// operations
|
||||
// ----------
|
||||
// remove all pages
|
||||
bool DeleteAllPages();
|
||||
|
||||
// inserts a new page to the notebook (it will be deleted ny the notebook,
|
||||
// don't delete it yourself). If bSelect, this page becomes active.
|
||||
bool InsertPage(size_t nPage,
|
||||
wxNotebookPage *pPage,
|
||||
const wxString& strText,
|
||||
bool bSelect = FALSE,
|
||||
int imageId = -1);
|
||||
|
||||
void AddPageInfo( wxNotebookPageInfo* info ) { AddPage( info->GetPage() , info->GetText() , info->GetSelected() , info->GetImageId() ) ; }
|
||||
const wxNotebookPageInfoList& GetPageInfos() const ;
|
||||
|
||||
// Windows-only at present. Also, you must use the wxNB_FIXEDWIDTH
|
||||
// style.
|
||||
void SetTabSize(const wxSize& sz);
|
||||
|
||||
// Windows only: attempts to apply the UX theme page background to this page
|
||||
void ApplyThemeBackground(wxWindow* window, const wxColour& colour);
|
||||
|
||||
// hit test
|
||||
virtual int HitTest(const wxPoint& pt, long *flags = NULL) const;
|
||||
|
||||
// calculate the size of the notebook from the size of its page
|
||||
virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const;
|
||||
|
||||
// callbacks
|
||||
// ---------
|
||||
void OnSize(wxSizeEvent& event);
|
||||
void OnSelChange(wxNotebookEvent& event);
|
||||
void OnNavigationKey(wxNavigationKeyEvent& event);
|
||||
|
||||
// base class virtuals
|
||||
// -------------------
|
||||
|
||||
virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
|
||||
virtual bool MSWOnScroll(int orientation, WXWORD nSBCode,
|
||||
WXWORD pos, WXHWND control);
|
||||
virtual bool MSWTranslateMessage(WXMSG *wxmsg);
|
||||
|
||||
#if wxUSE_CONSTRAINTS
|
||||
virtual void SetConstraintSizes(bool recurse = TRUE);
|
||||
virtual bool DoPhase(int nPhase);
|
||||
#endif // wxUSE_CONSTRAINTS
|
||||
|
||||
protected:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
// translate wxWin styles to the Windows ones
|
||||
virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle = NULL) const;
|
||||
|
||||
// remove one page from the notebook, without deleting
|
||||
virtual wxNotebookPage *DoRemovePage(size_t nPage);
|
||||
|
||||
// set the size of the given page to fit in the notebook
|
||||
void AdjustPageSize(wxNotebookPage *page);
|
||||
|
||||
// override WndProc.
|
||||
#if wxUSE_UXTHEME
|
||||
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
#endif
|
||||
|
||||
// the current selection (-1 if none)
|
||||
int m_nSelection;
|
||||
|
||||
wxNotebookPageInfoList m_pageInfos ;
|
||||
|
||||
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxNotebook)
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif // wxUSE_NOTEBOOK
|
||||
|
||||
#endif // _NOTEBOOK_H
|
65
include/wx/palmos/palette.h
Normal file
65
include/wx/palmos/palette.h
Normal file
@ -0,0 +1,65 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palette.h
|
||||
// Purpose: wxPalette class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_PALETTE_H_
|
||||
#define _WX_PALETTE_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "palette.h"
|
||||
#endif
|
||||
|
||||
#include "wx/gdiobj.h"
|
||||
|
||||
class WXDLLEXPORT wxPalette;
|
||||
|
||||
class WXDLLEXPORT wxPaletteRefData: public wxGDIRefData
|
||||
{
|
||||
friend class WXDLLEXPORT wxPalette;
|
||||
public:
|
||||
wxPaletteRefData(void);
|
||||
~wxPaletteRefData(void);
|
||||
protected:
|
||||
WXHPALETTE m_hPalette;
|
||||
};
|
||||
|
||||
#define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
|
||||
|
||||
class WXDLLEXPORT wxPalette: public wxGDIObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxPalette)
|
||||
|
||||
public:
|
||||
wxPalette(void);
|
||||
inline wxPalette(const wxPalette& palette) { Ref(palette); }
|
||||
|
||||
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
|
||||
~wxPalette(void);
|
||||
bool Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
|
||||
int GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const;
|
||||
bool GetRGB(int pixel, unsigned char *red, unsigned char *green, unsigned char *blue) const;
|
||||
|
||||
virtual bool Ok(void) const { return (m_refData != NULL) ; }
|
||||
|
||||
inline wxPalette& operator = (const wxPalette& palette) { if (*this == palette) return (*this); Ref(palette); return *this; }
|
||||
inline bool operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; }
|
||||
inline bool operator != (const wxPalette& palette) const { return m_refData != palette.m_refData; }
|
||||
|
||||
virtual bool FreeResource(bool force = FALSE);
|
||||
|
||||
inline WXHPALETTE GetHPALETTE(void) const { return (M_PALETTEDATA ? M_PALETTEDATA->m_hPalette : 0); }
|
||||
void SetHPALETTE(WXHPALETTE pal);
|
||||
};
|
||||
|
||||
#define wxColorMap wxPalette
|
||||
#define wxColourMap wxPalette
|
||||
|
||||
#endif
|
||||
// _WX_PALETTE_H_
|
145
include/wx/palmos/pen.h
Normal file
145
include/wx/palmos/pen.h
Normal file
@ -0,0 +1,145 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/pen.h
|
||||
// Purpose: wxPen class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_PEN_H_
|
||||
#define _WX_PEN_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "pen.h"
|
||||
#endif
|
||||
|
||||
#include "wx/gdiobj.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/colour.h"
|
||||
|
||||
typedef WXDWORD wxMSWDash;
|
||||
|
||||
class WXDLLEXPORT wxPen;
|
||||
|
||||
// VZ: this class should be made private
|
||||
class WXDLLEXPORT wxPenRefData : public wxGDIRefData
|
||||
{
|
||||
public:
|
||||
wxPenRefData();
|
||||
wxPenRefData(const wxPenRefData& data);
|
||||
virtual ~wxPenRefData();
|
||||
|
||||
bool operator==(const wxPenRefData& data) const
|
||||
{
|
||||
// we intentionally don't compare m_hPen fields here
|
||||
return m_style == data.m_style &&
|
||||
m_width == data.m_width &&
|
||||
m_join == data.m_join &&
|
||||
m_cap == data.m_cap &&
|
||||
m_colour == data.m_colour &&
|
||||
(m_style != wxSTIPPLE || m_stipple == data.m_stipple) &&
|
||||
(m_style != wxUSER_DASH ||
|
||||
(m_nbDash == data.m_nbDash &&
|
||||
memcmp(m_dash, data.m_dash, m_nbDash*sizeof(wxDash)) == 0));
|
||||
}
|
||||
|
||||
protected:
|
||||
int m_width;
|
||||
int m_style;
|
||||
int m_join;
|
||||
int m_cap;
|
||||
wxBitmap m_stipple;
|
||||
int m_nbDash;
|
||||
wxDash * m_dash;
|
||||
wxColour m_colour;
|
||||
WXHPEN m_hPen;
|
||||
|
||||
private:
|
||||
friend class WXDLLEXPORT wxPen;
|
||||
|
||||
// Cannot use
|
||||
// DECLARE_NO_COPY_CLASS(wxPenRefData)
|
||||
// because copy constructor is explicitly declared above;
|
||||
// but no copy assignment operator is defined, so declare
|
||||
// it private to prevent the compiler from defining it:
|
||||
wxPenRefData& operator=(const wxPenRefData&);
|
||||
};
|
||||
|
||||
#define M_PENDATA ((wxPenRefData *)m_refData)
|
||||
#define wxPENDATA(x) ((wxPenRefData *)(x).m_refData)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Pen
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxPen : public wxGDIObject
|
||||
{
|
||||
public:
|
||||
wxPen();
|
||||
wxPen(const wxColour& col, int width = 1, int style = wxSOLID);
|
||||
wxPen(const wxBitmap& stipple, int width);
|
||||
wxPen(const wxPen& pen) { Ref(pen); }
|
||||
virtual ~wxPen();
|
||||
|
||||
wxPen& operator=(const wxPen& pen)
|
||||
{
|
||||
if ( this != &pen )
|
||||
Ref(pen);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool operator==(const wxPen& pen) const
|
||||
{
|
||||
const wxPenRefData *penData = (wxPenRefData *)pen.m_refData;
|
||||
|
||||
// an invalid pen is only equal to another invalid pen
|
||||
return m_refData ? penData && *M_PENDATA == *penData : !penData;
|
||||
}
|
||||
|
||||
bool operator!=(const wxPen& pen) const { return !(*this == pen); }
|
||||
|
||||
virtual bool Ok() const { return (m_refData != NULL); }
|
||||
|
||||
// Override in order to recreate the pen
|
||||
void SetColour(const wxColour& col);
|
||||
void SetColour(unsigned char r, unsigned char g, unsigned char b);
|
||||
|
||||
void SetWidth(int width);
|
||||
void SetStyle(int style);
|
||||
void SetStipple(const wxBitmap& stipple);
|
||||
void SetDashes(int nb_dashes, const wxDash *dash);
|
||||
void SetJoin(int join);
|
||||
void SetCap(int cap);
|
||||
|
||||
wxColour& GetColour() const { return (M_PENDATA ? M_PENDATA->m_colour : wxNullColour); };
|
||||
int GetWidth() const { return (M_PENDATA ? M_PENDATA->m_width : 0); };
|
||||
int GetStyle() const { return (M_PENDATA ? M_PENDATA->m_style : 0); };
|
||||
int GetJoin() const { return (M_PENDATA ? M_PENDATA->m_join : 0); };
|
||||
int GetCap() const { return (M_PENDATA ? M_PENDATA->m_cap : 0); };
|
||||
int GetDashes(wxDash **ptr) const
|
||||
{
|
||||
*ptr = (M_PENDATA ? (wxDash*)M_PENDATA->m_dash : (wxDash*) NULL);
|
||||
return (M_PENDATA ? M_PENDATA->m_nbDash : 0);
|
||||
}
|
||||
wxDash* GetDash() const { return (M_PENDATA ? (wxDash*)M_PENDATA->m_dash : (wxDash*)NULL); };
|
||||
inline int GetDashCount() const { return (M_PENDATA ? M_PENDATA->m_nbDash : 0); };
|
||||
|
||||
inline wxBitmap *GetStipple() const { return (M_PENDATA ? (& M_PENDATA->m_stipple) : (wxBitmap*) NULL); };
|
||||
|
||||
// Internal
|
||||
bool RealizeResource();
|
||||
bool FreeResource(bool force = FALSE);
|
||||
WXHANDLE GetResourceHandle() const;
|
||||
bool IsFree() const;
|
||||
void Unshare();
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxPen)
|
||||
};
|
||||
|
||||
#endif // _WX_PEN_H_
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user