Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | Related Pages

It's easy to init a container like std::vector from constant data. More...


Classes

class  wftk::Fatal
 an exception thrown when the library experiences a fatal error More...
class  wftk::Application
 Toplevel application class. More...
class  wftk::BorderedDialog
 A dialog with decorative borders. More...
class  wftk::Box
 a box which can hold multiple screen areas More...
class  wftk::Box::iterator
 an iterator over the box's children More...
class  wftk::Button
 Button Class. More...
class  wftk::Color
 Wrapper class for describing colors using 8-bits per red, green, blue, and alpha channels. More...
class  wftk::CornerContainer
 A container which puts its single child in one of its corners. More...
class  wftk::Debug
 The Debug class handles the debug channels. More...
class  wftk::Debug::Endl
 A class that emulates std::endl when DEBUG is defined, but doesn't require <iostream> when it's not. More...
class  wftk::Debug::Flush
 A class that emulates std::flush when DEBUG is defined, but doesn't require <iostream> when it's not. More...
class  wftk::Dialog
 Dialog. More...
class  wftk::Filler
 Filler Class. More...
class  wftk::FixedDialog
 A dialog that all but ignores its child's packing preferences. More...
class  wftk::Focus
 Singleton class for handling the current widget that owns keyboard focus. More...
class  wftk::Font
 FreeType based surface font. More...
class  wftk::Font::BadFont
 an exception thrown when a font fails to load properly More...
class  wftk::Font::Glyph
 Glyph class: represents a single ASCII value as a surface. More...
struct  wftk::Font::Glyph::Metrics
 holds the info from FT_Glyph_Slot_Rec More...
struct  wftk::Font::Metrics
 info from FT_Face_Rec More...
class  wftk::FullScreenDialog
 A dialog that completely fills its parent widget. More...
class  wftk::Joystick
 A class to handle joystick information. More...
class  wftk::Label
 Display a text message onscreen. More...
class  wftk::LineEdit
 LineEdit: a single-line text box for user input. More...
class  wftk::ListBox
 A multi-line selection with scroll bar. More...
class  wftk::BoolMarshal
 A custom marshaller for bools. More...
class  wftk::MessageDialog
 Display a message to the user, allow them to dismiss this box. More...
class  wftk::Mixer
 Wrapper class around the audio mixer. More...
class  wftk::Pointer
 virtual base pointer class More...
class  wftk::Mouse
 software mouse pointer. More...
class  wftk::Movie
 "movie" of animated surfaces (stop-animation) More...
class  wftk::MultiLineEdit
 multi-line text box for user input More...
class  wftk::Music
 Wrapper class for loading and playing music files (mp3, ogg, mod). More...
class  wftk::Mutex
 Mutex class. More...
class  wftk::Painter
 class that allows drawing graphics primitives onto a Surface More...
class  wftk::Pixelformat
 Format of pixels in memory. More...
class  wftk::Point
 Class to handle x,y - points on the screen. More...
class  wftk::HardPointer
 a pointer which uses SDL's native pointer capabilities More...
class  wftk::SoftPointer
 a software pointer More...
class  wftk::AnimatedPointer
 an animated software pointer More...
class  wftk::PollBase
 Base class for watching for socket events. More...
class  wftk::Poll
 Watch a socket for data. More...
class  wftk::ProgressBar
 Simple widget that paints a progress meter. More...
class  wftk::ProgressDialog
 progress meter dialog More...
class  wftk::PushButton
 PushButton Class. More...
class  wftk::QuestionBox
 Dialog box with question, user answers yes / no. More...
class  wftk::Rect
 Rectangle class. Has corners, fill, etc. More...
class  wftk::Region
 Region specifies a 'working area' of the screen - pixels outside the region are always ignored. More...
class  wftk::Region::RectList
 Used for things like passing an array of SDL_Rect to SDL_UpdateRects(). More...
class  wftk::Region::const_iterator
 Iterator over points in the region. More...
struct  wftk::ResDestroy< R >
 default data freeing mechanism for resources (do nothing) More...
struct  wftk::ResDestroy< R * >
 default data freeing mechanism for resources which are pointers (call delete) More...
struct  wftk::ResInval< R >
 default fallback for a failed resource find (return a reference to a static member) More...
struct  wftk::ResInval< R * >
 default fallback for a failed resource find for pointer data (return null) More...
struct  wftk::ResLoad< R >
 default loader for resource data More...
struct  wftk::ResLoad< R * >
 default loader for pointer resource data More...
class  wftk::Resource< R, Destroy >
 Resource manager with reference counting. More...
class  wftk::ResourceRegistry< R, Loader, Invalid, Destroy >
 R is the class of the resource type Loader specifies how to load the resource from a file Invalid specifies the fallback mechanism if a resource isn't found Destroy specifies how to free the resource data when the resource is freed. More...
class  wftk::RootWindow
 singleton class, handles access to the entire drawing surface of the application More...
class  wftk::Sample
 Sample - for loading / playing sounds. More...
class  wftk::ScreenArea
 ScreenArea Baseclass. More...
struct  wftk::ScreenArea::PackingInfo
 packing information to pass to containers More...
struct  wftk::ScreenArea::PackingInfo::Expander
 The per-axis packing info. More...
class  wftk::ScreenArea::PackingInfo::Weights
 For use by containers. More...
class  wftk::ScreenSurface
 interface to the underlying SDL_Surface More...
class  wftk::SDLFatal
 a fatal error generated by SDL's behavior (usually out of memory) More...
class  wftk::SDLHandler
 SDL_Event wrapper class. More...
class  wftk::SingleContainer
 A container which can hold a single child. More...
class  wftk::Slider
 Slider Class. More...
class  wftk::Sound
 abstract sound class More...
struct  wftk::StringHash< C >
 A wrapper for std::hash_map<std::string,Foo>, since it didn't make the C++ standard. More...
class  wftk::GammaFunction
 A texture to use with Surface::shiftGamma() The "texture" always has to have a size of 256*256 values ! More...
class  wftk::Surface
 Surface represents a bitmap (texture). More...
class  wftk::Table
 an automatically expanding table More...
class  wftk::Terminal
 Terminal widget: has multi-line output, one-line input, scroll bar. More...
class  wftk::Time
 A time class to escape SDL's 2^32 ms epoch limitations. More...
struct  wftk::Time::Info
 A structure used when parsing time into days, hours, ... More...
class  wftk::Timer
 Timer handles known events that must happen (fairly) regularly. More...
class  wftk::ToggleButton
 ToggleButton. More...
class  wftk::Video
 Wrapper class for loading and playing mpeg video. More...
class  wftk::VideoWidget
 Video player widget. More...
class  wftk::Widget
 Widget Baseclass. More...

Enumerations

enum  {
  KEY_UNKNOWN, KEY_FIRST = 0, KEY_BACKSPACE, KEY_TAB,
  KEY_CLEAR, KEY_RETURN, KEY_PAUSE, KEY_ESCAPE,
  KEY_SPACE, KEY_EXCLAIM, KEY_QUOTEDBL, KEY_HASH,
  KEY_DOLLAR, KEY_AMPERSAND, KEY_QUOTE, KEY_LEFTPAREN,
  KEY_RIGHTPAREN, KEY_ASTERISK, KEY_PLUS, KEY_COMMA,
  KEY_MINUS, KEY_PERIOD, KEY_SLASH, KEY_0,
  KEY_1, KEY_2, KEY_3, KEY_4,
  KEY_5, KEY_6, KEY_7, KEY_8,
  KEY_9, KEY_COLON, KEY_SEMICOLON, KEY_LESS,
  KEY_EQUALS, KEY_GREATER, KEY_QUESTION, KEY_AT,
  KEY_LEFTBRACKET, KEY_BACKSLASH, KEY_RIGHTBRACKET, KEY_CARET,
  KEY_UNDERSCORE, KEY_BACKQUOTE, KEY_a, KEY_b,
  KEY_c, KEY_d, KEY_e, KEY_f,
  KEY_g, KEY_h, KEY_i, KEY_j,
  KEY_k, KEY_l, KEY_m, KEY_n,
  KEY_o, KEY_p, KEY_q, KEY_r,
  KEY_s, KEY_t, KEY_u, KEY_v,
  KEY_w, KEY_x, KEY_y, KEY_z,
  KEY_DELETE, KEY_WORLD_0 = 160, KEY_WORLD_1, KEY_WORLD_2,
  KEY_WORLD_3, KEY_WORLD_4, KEY_WORLD_5, KEY_WORLD_6,
  KEY_WORLD_7, KEY_WORLD_8, KEY_WORLD_9, KEY_WORLD_10,
  KEY_WORLD_11, KEY_WORLD_12, KEY_WORLD_13, KEY_WORLD_14,
  KEY_WORLD_15, KEY_WORLD_16, KEY_WORLD_17, KEY_WORLD_18,
  KEY_WORLD_19, KEY_WORLD_20, KEY_WORLD_21, KEY_WORLD_22,
  KEY_WORLD_23, KEY_WORLD_24, KEY_WORLD_25, KEY_WORLD_26,
  KEY_WORLD_27, KEY_WORLD_28, KEY_WORLD_29, KEY_WORLD_30,
  KEY_WORLD_31, KEY_WORLD_32, KEY_WORLD_33, KEY_WORLD_34,
  KEY_WORLD_35, KEY_WORLD_36, KEY_WORLD_37, KEY_WORLD_38,
  KEY_WORLD_39, KEY_WORLD_40, KEY_WORLD_41, KEY_WORLD_42,
  KEY_WORLD_43, KEY_WORLD_44, KEY_WORLD_45, KEY_WORLD_46,
  KEY_WORLD_47, KEY_WORLD_48, KEY_WORLD_49, KEY_WORLD_50,
  KEY_WORLD_51, KEY_WORLD_52, KEY_WORLD_53, KEY_WORLD_54,
  KEY_WORLD_55, KEY_WORLD_56, KEY_WORLD_57, KEY_WORLD_58,
  KEY_WORLD_59, KEY_WORLD_60, KEY_WORLD_61, KEY_WORLD_62,
  KEY_WORLD_63, KEY_WORLD_64, KEY_WORLD_65, KEY_WORLD_66,
  KEY_WORLD_67, KEY_WORLD_68, KEY_WORLD_69, KEY_WORLD_70,
  KEY_WORLD_71, KEY_WORLD_72, KEY_WORLD_73, KEY_WORLD_74,
  KEY_WORLD_75, KEY_WORLD_76, KEY_WORLD_77, KEY_WORLD_78,
  KEY_WORLD_79, KEY_WORLD_80, KEY_WORLD_81, KEY_WORLD_82,
  KEY_WORLD_83, KEY_WORLD_84, KEY_WORLD_85, KEY_WORLD_86,
  KEY_WORLD_87, KEY_WORLD_88, KEY_WORLD_89, KEY_WORLD_90,
  KEY_WORLD_91, KEY_WORLD_92, KEY_WORLD_93, KEY_WORLD_94,
  KEY_WORLD_95 = 255, KEY_KP0, KEY_KP1, KEY_KP2,
  KEY_KP3, KEY_KP4, KEY_KP5, KEY_KP6,
  KEY_KP7, KEY_KP8, KEY_KP9, KEY_KP_PERIOD,
  KEY_KP_DIVIDE, KEY_KP_MULTIPLY, KEY_KP_MINUS, KEY_KP_PLUS,
  KEY_KP_ENTER, KEY_KP_EQUALS, KEY_UP, KEY_DOWN,
  KEY_RIGHT, KEY_LEFT, KEY_INSERT, KEY_HOME,
  KEY_END, KEY_PAGEUP, KEY_PAGEDOWN, KEY_F1,
  KEY_F2, KEY_F3, KEY_F4, KEY_F5,
  KEY_F6, KEY_F7, KEY_F8, KEY_F9,
  KEY_F10, KEY_F11, KEY_F12, KEY_F13,
  KEY_F14, KEY_F15, KEY_NUMLOCK, KEY_CAPSLOCK,
  KEY_SCROLLOCK, KEY_RSHIFT, KEY_LSHIFT, KEY_RCTRL,
  KEY_LCTRL, KEY_RALT, KEY_LALT, KEY_RMETA,
  KEY_LMETA, KEY_LSUPER, KEY_RSUPER, KEY_MODE,
  KEY_HELP, KEY_PRINT, KEY_SYSREQ, KEY_BREAK,
  KEY_MENU, KEY_POWER, KEY_EURO, KEY_LAST
}
enum  {
  KEY_MOD_NONE, KEY_MOD_NUM, KEY_MOD_LCTRL, KEY_MOD_RCTRL,
  KEY_MOD_CAPS, KEY_MOD_RSHIFT, KEY_MOD_LSHIFT, KEY_MOD_LALT,
  KEY_MOD_RALT, KEY_MOD_LMETA, KEY_MOD_RMETA
}

Functions

std::ostream & operator<< (std::ostream &os, const Pixelformat &pf)
std::ostream & operator<< (std::ostream &s, const Point &p)
std::ostream & operator<< (std::ostream &s, const Rect &p)
Time operator+ (Uint32 val, const Time &t)
 increment a timestamp
Time operator+ (int val, const Time &t)
 increment a timestamp


Detailed Description

It's easy to init a container like std::vector from constant data.

For a std::vector<A>, the sequence would be something like:

const A init_data[] = {...}; const unsigned num_init_data = sizeof(init_data)/sizeof(init_data[0]); const std::vector<A> vec(init_data, init_data + num_init_data);

where we use the fact that a pointer is a valid input iterator. It's somewhat harder with a std::map, since std::pair can only initialize from a normal constructor. You have to do something like:

const MapType::value_type init_data[] = {MapType::value_type(key1, data1), ...};

writing out each of the constructors explicitly. The following class provides a trick to initialize the std::pair values in the map. It should work for any container of std::pair<>. The initialization sequence then looks something like:

const PairInit<MapType::value_type> init_data[] = {{key1, data1}, {key2, data2}, ...}; const unsigned num_init_data = sizeof(init_data)/sizeof(init_data[0]); const MapType map(init_data->itr(), init_data->itr(num_init_data));

We use a custom iterator which casts to the type passed in the template when * dereferenced, so this works out nicely.


Enumeration Type Documentation

anonymous enum
 

Enumeration values:
KEY_UNKNOWN 
KEY_BACKSPACE 
KEY_TAB 
KEY_CLEAR 
KEY_RETURN 
KEY_PAUSE 
KEY_ESCAPE 
KEY_SPACE 
KEY_EXCLAIM 
KEY_QUOTEDBL 
KEY_HASH 
KEY_DOLLAR 
KEY_AMPERSAND 
KEY_QUOTE 
KEY_LEFTPAREN 
KEY_RIGHTPAREN 
KEY_ASTERISK 
KEY_PLUS 
KEY_COMMA 
KEY_MINUS 
KEY_PERIOD 
KEY_SLASH 
KEY_0 
KEY_1 
KEY_2 
KEY_3 
KEY_4 
KEY_5 
KEY_6 
KEY_7 
KEY_8 
KEY_9 
KEY_COLON 
KEY_SEMICOLON 
KEY_LESS 
KEY_EQUALS 
KEY_GREATER 
KEY_QUESTION 
KEY_AT 
KEY_LEFTBRACKET 
KEY_BACKSLASH 
KEY_RIGHTBRACKET 
KEY_CARET 
KEY_UNDERSCORE 
KEY_BACKQUOTE 
KEY_a 
KEY_b 
KEY_c 
KEY_d 
KEY_e 
KEY_f 
KEY_g 
KEY_h 
KEY_i 
KEY_j 
KEY_k 
KEY_l 
KEY_m 
KEY_n 
KEY_o 
KEY_p 
KEY_q 
KEY_r 
KEY_s 
KEY_t 
KEY_u 
KEY_v 
KEY_w 
KEY_x 
KEY_y 
KEY_z 
KEY_DELETE 
KEY_WORLD_0  0xA0
KEY_WORLD_1 
KEY_WORLD_2 
KEY_WORLD_3 
KEY_WORLD_4 
KEY_WORLD_5 
KEY_WORLD_6 
KEY_WORLD_7 
KEY_WORLD_8 
KEY_WORLD_9 
KEY_WORLD_10 
KEY_WORLD_11 
KEY_WORLD_12 
KEY_WORLD_13 
KEY_WORLD_14 
KEY_WORLD_15 
KEY_WORLD_16 
KEY_WORLD_17 
KEY_WORLD_18 
KEY_WORLD_19 
KEY_WORLD_20 
KEY_WORLD_21 
KEY_WORLD_22 
KEY_WORLD_23 
KEY_WORLD_24 
KEY_WORLD_25 
KEY_WORLD_26 
KEY_WORLD_27 
KEY_WORLD_28 
KEY_WORLD_29 
KEY_WORLD_30 
KEY_WORLD_31 
KEY_WORLD_32 
KEY_WORLD_33 
KEY_WORLD_34 
KEY_WORLD_35 
KEY_WORLD_36 
KEY_WORLD_37 
KEY_WORLD_38 
KEY_WORLD_39 
KEY_WORLD_40 
KEY_WORLD_41 
KEY_WORLD_42 
KEY_WORLD_43 
KEY_WORLD_44 
KEY_WORLD_45 
KEY_WORLD_46 
KEY_WORLD_47 
KEY_WORLD_48 
KEY_WORLD_49 
KEY_WORLD_50 
KEY_WORLD_51 
KEY_WORLD_52 
KEY_WORLD_53 
KEY_WORLD_54 
KEY_WORLD_55 
KEY_WORLD_56 
KEY_WORLD_57 
KEY_WORLD_58 
KEY_WORLD_59 
KEY_WORLD_60 
KEY_WORLD_61 
KEY_WORLD_62 
KEY_WORLD_63 
KEY_WORLD_64 
KEY_WORLD_65 
KEY_WORLD_66 
KEY_WORLD_67 
KEY_WORLD_68 
KEY_WORLD_69 
KEY_WORLD_70 
KEY_WORLD_71 
KEY_WORLD_72 
KEY_WORLD_73 
KEY_WORLD_74 
KEY_WORLD_75 
KEY_WORLD_76 
KEY_WORLD_77 
KEY_WORLD_78 
KEY_WORLD_79 
KEY_WORLD_80 
KEY_WORLD_81 
KEY_WORLD_82 
KEY_WORLD_83 
KEY_WORLD_84 
KEY_WORLD_85 
KEY_WORLD_86 
KEY_WORLD_87 
KEY_WORLD_88 
KEY_WORLD_89 
KEY_WORLD_90 
KEY_WORLD_91 
KEY_WORLD_92 
KEY_WORLD_93 
KEY_WORLD_94 
KEY_WORLD_95  0xFF
KEY_KP0 
KEY_KP1 
KEY_KP2 
KEY_KP3 
KEY_KP4 
KEY_KP5 
KEY_KP6 
KEY_KP7 
KEY_KP8 
KEY_KP9 
KEY_KP_PERIOD 
KEY_KP_DIVIDE 
KEY_KP_MULTIPLY 
KEY_KP_MINUS 
KEY_KP_PLUS 
KEY_KP_ENTER 
KEY_KP_EQUALS 
KEY_UP 
KEY_DOWN 
KEY_RIGHT 
KEY_LEFT 
KEY_INSERT 
KEY_HOME 
KEY_END 
KEY_PAGEUP 
KEY_PAGEDOWN 
KEY_F1 
KEY_F2 
KEY_F3 
KEY_F4 
KEY_F5 
KEY_F6 
KEY_F7 
KEY_F8 
KEY_F9 
KEY_F10 
KEY_F11 
KEY_F12 
KEY_F13 
KEY_F14 
KEY_F15 
KEY_NUMLOCK 
KEY_CAPSLOCK 
KEY_SCROLLOCK 
KEY_RSHIFT 
KEY_LSHIFT 
KEY_RCTRL 
KEY_LCTRL 
KEY_RALT 
KEY_LALT 
KEY_RMETA 
KEY_LMETA 
KEY_LSUPER  Left "Windows" key.
KEY_RSUPER  Right "Windows" key.
KEY_MODE  "Alt Gr" key
KEY_HELP 
KEY_PRINT 
KEY_SYSREQ 
KEY_BREAK 
KEY_MENU 
KEY_POWER  Power Macintosh power key.
KEY_EURO  Some european keyboards.

anonymous enum
 

Enumeration values:
KEY_MOD_NONE 
KEY_MOD_NUM 
KEY_MOD_LCTRL 
KEY_MOD_RCTRL 
KEY_MOD_CAPS 
KEY_MOD_RSHIFT 
KEY_MOD_LSHIFT 
KEY_MOD_LALT 
KEY_MOD_RALT 
KEY_MOD_LMETA 
KEY_MOD_RMETA 


Generated Mon Sep 6 21:58:16 2004.
Copyright © 1998-2003 by the respective authors.

This document is licensed under the terms of the GNU Free Documentation License and may be freely distributed under the conditions given by this license.