KDE 2.0 Development

David Sweet, et al.

Copyright 2001 by Sams Publishing

This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/).

Distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder.

No patent liability is assumed with respect to the use of the information contained herein. Although every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions. Neither is any liability assumed for damages resulting from the use of the information contained herein.

Library of Congress Catalog Card Number: 99-067972

Printed in the United States of America

First Printing: October 2000

03 02 01 00 4 3 2 1

Trademarks

All terms mentioned in this book that are known to be trademarks or service marks have been appropriately capitalized. Sams Publishing cannot attest to the accuracy of this information. Use of a term in this book should not be regarded as affecting the validity of any trademark or service mark.

Warning and Disclaimer

Every effort has been made to make this book as complete and as accurate as possible, but no warranty or fitness is implied. The information provided is on an "as is" basis. The authors and the publisher shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising from the information contained in this book.


Table of Contents
Foreword
1. Lead Author
2. Contributing Authors
3. Acknowledgments
4. Tell Us What You Think!
Introduction
1. Prerequisites
2. About the Open Publication License
3. Organization of This Book
4. Conventions Used in This Book
5. Time to Develop!
1. Fundamentals of KDE Application Programming
1. The K Desktop Environment Background
1.1. Motivation for a Free Desktop
1.2. Why Develop with KDE?
1.3. KDE Organization and Resources
1.4. System Requirements
1.5. Obtaining and Installing KDE
1.6. Licenses and Legalities
1.7. Let's Code, Already!
2. A Simple KDE Application
2.1. The Linux/UNIX Programmer's Desktop
2.2. Compiling a KDE Program
2.3. KDE Application Structure
2.4. GUI Elements
2.5. Programming Conventions
2.6. Summary
2.7. Exercises
3. The Qt Toolkit
3.1. What It Is For (Look and Feel)
3.2. Inside the Qt Toolkit
3.3. Signals and Slots
3.4. Meta Object Compiler (moc)
3.5. The Utility Classes
3.6. Special Features (ImageIO, OpenGL, Mesa)
3.7. Summary
3.8. Exercises
4. Creating Custom KDE Widgets
4.1. Widget Basics
4.2. Painting Widgets
4.3. Using Child Widgets
4.4. Handling User Input
4.5. Summary
4.6. Exercises
5. KDE User Interface Compliance
5.1. The KDE Document-Centric Interface
5.2. Helping the User Use Your Application
5.3. Standard Dialog Boxes
5.4. Summary
5.5. Exercises
6. KDE Style Reference
6.1. Accessing the Standard Actions
6.2. Session Management
6.3. The Standard KDE Icons
6.4. Internationalization
6.5. Playing Sounds
6.6. User Notifications
6.7. Executing Other Programs
6.8. Network Transparency
6.9. User Friendliness
6.10. Summary
6.11. Exercises
II. Advanced KDE Widgets and UI Design Techniques
7. Further KDE Compliance
7.1. Drag and Drop
7.2. Application Configuration Information
7.3. Session Management
7.4. Application Resources
7.5. Network Transparency
7.6. Summary
7.7. Exercises
8. Using Dialog Boxes
8.1. Getting Started with the Dialog Widgets
8.2. Dialog Layout the Simple Way
8.3. Dialog Modality—Modal or Modeless Dialogs
8.4. KDE User-Interface Library (kdeui)
8.5. Dialog Style and KDialogBase
8.6. A Larger Example: The Option Dialog in KEdit
8.7. User Interface Design Rules for Dialogs
8.8. Summary
8.9. Exercises
9. Constructing A Responsive User Interface
9.1. The Importance of Responsiveness
9.2. Speeding Up Window Updates
9.3. Performing Long Jobs
9.4. Summary
9.5. Exercises
10. Complex-Function KDE Widgets
10.1. Rendering HTML Files
10.2. Manipulating Images
10.3. Checking Spelling
10.4. Accessing the Address Book
10.5. Summary
10.6. Exercises
11. Alternative Application Types
11.1. Dialog-Based Applications
11.2. Single-Instance Applications
11.3. Panel Applets
11.4. Summary
11.5. Exercises
III. Application Interaction and Integration
12. Creating and Using Components (KParts)
12.1. The Difference Between Components and Widgets
12.2. The KDE Component Framework
12.3. Describing User Interface in XML
12.4. Read-Only and Read/Write Parts
12.5. Creating a Part
12.6. Making a Part Available Using Shared Libraries
12.7. Creating a KParts Application
12.8. Embedding More Than One Part in the Same Window
12.9. Creating a KParts Plug-in
12.10. Summary
13. DCOP—Desktop Communication Protocol
13.1. Motivation
13.2. History
13.3. Underlying Technologies
13.4. Architecture
13.5. Description of DCOP's Programming Interface
13.6. Developer Concerns and Tools in DCOP
13.7. DCOP Use in KDE 2.0—A Few Examples
13.8. Summary
14. Multimedia
14.1. Introducing aRts/MCOP
14.2. A First Glance at Writing Modules
14.3. MCOP
14.4. Standard Interfaces
14.5. Implementing a StereoEffect
14.6. KDE Multimedia Besides MCOP
14.7. The Future of MCOP
14.8. Summary
14.9. Exercises
IV. Developer Tools and Support
15. Creating Documentation
15.1. Documenting Source Code
15.2. Documenting Applications
15.3. Summary
16. Packaging and Distributing Code
16.1. The Structure of a Package
16.2. Administrative Files
16.3. Distributing Your Application
16.4. Summary
17. Managing Source Code with CVS
17.1. What Is CVS?
17.2. CVS Organization
17.3. Accessing Source Code in CVS
17.4. Installing and Using CVSup
17.5. Installing and Using cvs
17.6. Summary
18. The KDevelop IDE: The Integrated Development Environment for KDE
18.1. General Issues
18.2. Creating KDE 2.0 Applications
18.3. Getting Started with the KDE 2.0 API
18.4. The Classbrowser and Your Project
18.5. The File Viewers—The Windows to Your Project Files
18.6. The KDevelop Debugger
18.7. KDevelop 2.0—A Preview
18.8. Summary
19. Licensing Issues
19.1. What Are the "Issues?"
19.2. License Usage by KDE
19.3. The License Usage by Qt
19.4. The KDE/Qt License History
19.5. Summary
V. Appendixes
A. KDE-Related Licenses
A.1. GNU Library General Public License (LGPL)
A.2. GNU General Public License
B. KDE Class Reference
C. Answers
C.1. Chapter 1
C.2. Chapter 2
C.3. Chapter 3
C.4. Chapter 4
C.5. Chapter 5
C.6. Chapter 6
C.7. Chapter 7
C.8. Chapter 8
C.9. Chapter 9
C.10. Chapter 10
C.11. Chapter 11
C.12. Chapter 12
C.13. Chapter 13
C.14. Chapter 14
List of Tables
2.1. Options Processed by All KDE Applications
2.2. KDE Naming Conventions
5.1. XML Tags Used by kpartgui Files
5.2. Dialog Boxes Available for Common Tasks
7.1. Resource Types Supported by KStandardDirs Class
10.1a. Image Formats Supported by Qt
10.1b. Additional Image Formats Supported by libksycoca
10.2. Libraries Required for Complex-Function Classes
14.1. Defining Streams in the.idl File
15.1. DocBook Meta-Information Tags
15.2. DocBook Document Structure Tags
15.3. DocBook Formatting Tags
16.1. Administrative Files in a KDE Package
16.2. Commonly Used Targets Included in Autogenerated Makefiles
17.1. Current KDE CVS Modules
List of Figures
1.1. The KDE Developer's Corner Web site is a great resource for developers.
2.1. It is helpful to have an editor display the filename first in the caption.
2.2. khello is a simple KDE application that says "Hello!"
2.3. You derive your application from KTMainWindow, shown here as KMyMainWindow, and add a menubar, a toolbar, a status line, and a widget of your choice (or creation) for the content area.
2.4. KWrite offers a prototype KDE-style, document-centric application.
2.5. KSimpleApp demonstrates basic usage of important KDE widgets: KMenuBar, KToolBar, and KStatusBar.
2.6. You should place the same icon (a light bulb in this example) in the menubar as is used in the toolbar so that the user knows these are two ways of performing the same function.
3.1. A QWidget inside a window.
3.2. Mouse-handling window
3.3. QPainter example.
3.4. QPushButton.
3.5. Showing a JPEG Picture with ImageIO.
3.6. The OpenGL sample program.
4.1. KXOSquare draws a blue X or a red O in response to mouse clicks.
4.2. The KChildren widget shows how to use child widgets to easily create custom widgets.
4.3. The KChildren widget does not adapt to different-sized windows because it uses poor geometry management.
4.4. The KTicTacToe widget uses the KXOSquare widget nine times to create a game board.
4.5. The KTicTacToe widget adapts to different-sized windows because it uses Qt's geometry management.
4.6. The geometry manager was asked not to let the text label shrink too much. No such request was made for the game board, so it nearly disappears when you shrink the window too much.
4.7. The KDisc widget processes mouse-move events to let the user drag the disc around.
5.1. KWrite offers a good example of a document-centric user interface.
5.2. Screen shot of KStdActionsDemo.
5.3. The Custom menu shows checkable and disabled menu entries.
5.4. Three types of toolbars are created by KCustomActions.
5.5. konqueror has loaded 94% of the KDE home page and is loading at a rate of 8.0 KB/s.
5.6. KStatusBarDemo displays a message that disappears in two seconds.
5.7. One document displayed and edited with konqueror is a directory.
5.8. KOrganizer extends the idea of a document to an appointment book.
5.9. KHelpers gives ToolTip help on the client area.
5.10. KHelpers also gives What's This? help on the client area.
5.11. KStandardDialogs uses KFileDialog to let the user choose a file.
5.12. KStandardDialogs uses KFontDialog to let the user choose a font.
5.13. KStandardDialogs uses KColorDialog to let the user choose a color.
5.14. KMessageBox::warningContinueCancel() displays this style dialog box.
5.15. KMessageBox::information() displays this style dialog box.
5.16. KMessageBox::sorry() displays this style dialog box.
5.17. KMessageBox::error() displays this style dialog box.
6.1. High color should remain consistent with the low-color version, perhaps with a loss of dithering and smoother gradients.
6.2. Lotus WordPro '98 floating control panel.
7.1. KDropDemo accepts text drop events and displays the data contained in them. Here it has just accepted a URL drop from Konqueror.
7.2. kdragdemotest shows some draggable text. You can drag the text starting from anywhere inside the widget to a suitable target, such as kdropdemotest.
7.3. KConfigDemo saves the text you enter in its configuration file.
7.4. KSaveAcross saves its options across sessions and offers to save the user's data before it is closed.
7.5. KResourceDemo places a pixmap in the background and some text in the foreground, both of which are stored as application resources.
8.1. This dialog is used to display the number of bytes currently selected in KHexEdit's editor window. The value is printed in decimal and hexadecimal.
8.2. The appearance of the dialog that is implemented in the second constructor of Listing 8.2.
8.3. The Goto dialog of Listing 8.3.
8.4. Usage of user-definable action buttons and stretchable space between them. The dialog itself is based on the KDialogBase class in Tabbed mode.
8.5. The KEdit Option dialog. The dialog is based on the KDialogBase class in IconList mode.
9.1. kquickdraw updates its window quickly by storing its window contents in an offscreen buffer.
9.2. Klongjob performs a long calculation while still allowing user interaction.
10.1. KSimpleBrowser displaying the initial instructions page.
10.2. KImageView displaying the KDE wallpaper Marble01.jpg.
10.3. KSpellDemo shows some misspelled text.
10.4. The KSpell dialog box shows the misspelled word and offers suggestions for replacement.
10.5. The KSpellConfig dialog box lets the user configure KSpell.
10.6. The KabAPI dialog box lets the user choose an entry from the address book.
10.7. KabDemo displays the results of the user's selection.
11.1. Screenshot of KDialogApp.
13.1. The client/server architecture of DCOP.
13.2. The kdcop tool.
14.1. The flow graph of a stereo beep.
14.2. A flow graph of some real-life applications running.
14.3. The Example_ADD interface.
14.4. Flow graph for Listing 14.3.
14.5. How asynchronous streaming works.
14.6. How a StereoEffectStack works.
15.1. Screen shot of Konqueror viewing the HTML output of kdoc given kdocsample.h as input.
15.2. Screenshot of the HTML output created from ksimpleapp.docbook as viewed by Konqueror.
16.1. The layout of a typical KDE source code package.
17.1. The World Wide Web interface to the KDE CVS Repository.
18.1. The KDevelop 1.2 main window.
18.2. KDevelop 1.2 editing a sample project's options.
18.3. The KDevelop Dialog Editor with a sample dialog ready for editing.
18.4. The KDevelop Application Wizard.
18.5. The KDevelop project editor after generating a KDE 2.0 application with the Application Wizard.
18.6. The KDevelop Documentation-Browser with the Tree View displaying the KDE 2.0 API down to the member functions of classes.
18.7. The KDevelop Classbrowser displaying the KDevelop source code, graphically structured with an opened class allowing direct access to methods and attributes.
18.8. The Add New Method dialog lets you easily add a method to a class, including its documentation, declaration, and an implementation head, with support for signals and slots used by Qt/KDE.
18.9. The Logical File Viewer shows your project files separated into groups, depending on the file filters set.
18.10. The Real File Viewer of KDevelop offers you direct access to all project files and even CVS commands.
18.11. The KDevelop debugger is your gateway to the CPU and memory usage of your application. It allows you to monitor your program's execution line by line along the source code.
18.12. KDevelop 2.0 at its current state of development.
C.1. The mail dialog.
C.2. The mail dialog with the modified layout.
List of Examples
2.1. khello is a Simple KDE Application that Says "Hello!"
2.2. The Makefile Used as Input to the make Utility to Compile Listings 2.3–2.5
2.3. ksimpleapp.h: The Class Declaration File for KSimpleApp, the Main Widget of the Application ksimpleapp
2.4. main.cpp: The main() Function for KSimpleApp
2.5. ksimpleapp.cpp: The Class Definition File for KSimpleApp
3.1. widget.cpp: A Window with Mouse Handling
3.2. Drawing a Line in a Window
3.3. A Window with a Button in It
3.4. buttons.h: Class Definition for the Class MyWindow
3.5. buttons.cc: Class Implementation for the Class MyWindow Declared in Listing 3.4
3.6. mywindow.h: Class Declaration with moc Keywords
3.7. mywindow.cpp: Class Implementation for MyWindow
3.8. main.cpp: The Main Program File
3.9. stl.cpp: A Program That Shows How Template Classes Work
3.10. qlist.cpp: QList Example
3.11. imageio.cpp: An Image Viewer Program
3.12. main.cpp: OpenGL Program for Qt
4.1. kpushbutton.h: Class Declaration for a KDE Widget
4.2. kxosquare.cpp is the Class Declaration for KXOSquare, a Widget that Draws an X or an O in a Square
4.3. kxosquare.cpp: Class Definition for the KXOSquare Widget
4.4. main.cpp Contains a main() Function that Can Be Used to Test the Widget KXOSquare
4.5. kchildren.h Contains the Class Declaration for KChildren, a Custom Widget
4.6. kchildren.cpp is the Class Definition for KChildren
4.7. main.cpp is a main() Function Suitable for Testing the KChildren Widget
4.8. ktictactoe.h is the Class Declaration for the Widget KTicTacToe
4.9. ktictactoe.cpp is the Class Definition for KTicTacToe
4.10. kdisc.h Contains the Class Declaration for the KDisc Widget
4.11. kdisc.cpp Contains the Class Definition for the KDisc Widget
4.12. main.cpp Contains a main() Function Suitable for Testing KDisc
5.1. kstdactionsdemo.cpp: Class Declaration for KStdActionsDemo
5.2. kstdactionsdemo.h: Class Definition for KStdActionsDemo
5.3. main.cpp: A main() Function Suitable for Testing KStdActionsDemo
5.4. kcustomactions.h: Class Declaration for KCustomActions
5.5. kcustomactions.cpp: Class Definition for KCustomActions
5.6. kcustomui.rc: XML File Describing the Layout of the KCustomActions UI
5.7. kcustomactions.h: The Class Definition for KCustomActions
5.8. main.cpp: A main() Function Suitable for Testing KCustomActions
5.9. kstatusbardemo.h: Contains the Class Declaration for KStatusBarDemo, a Subclass of KTMainWindow
5.10. main.cpp: Contains a main() Function That Creates and Executes kstatusbardemo, an Application Based on KStatusBarDemo
5.11. kstatusbardemo.cpp: Contains the Class Definition for KStatusBarDemo
5.12. khelpers.h: Contains a Class Declaration for KHelpers, a Subclass of KTMainWindow
5.13. khelpers.cpp: Contains a Class Definition for KHelpers
5.14. main.cpp: Contains a main() Function That Creates and Executes KHelpers, an Application Based on KHelpers
5.15. main.cpp: Contains a main() Function That Demonstrates Various KDE and Qt Dialog Boxes
6.1. main.cpp: Example of Session Management
6.2. mykapp.h: Header File for Main Window
6.3. mykapp.cpp: Source File for Main Window
6.4. kedit.cpp: A Part of KEdit's Main Window Source File
6.5. Static run Functions
6.6. runwalk.h: Open a File (Header)
6.7. runwalk.cpp: Open a File (Source).XXX
6.8. Opening a File, Network Transparently
6.9. More Network Transparency Checks
6.10. Complete Network Transparency Example
7.1. kdropdemo.h: Contains the Class Definition for the Widget KDropDemo
7.2. kdropdemo.cpp: Contains the Class Declaration for the Widget KDropDemo
7.3. main.cpp: Contains a main() Function Suitable for Testing the KDropDemo Widget
7.4. kdragdemo.h: Contains a Class Declaration for the Widget KDragDemo
7.5. kdragdemo.cpp: Contains a Class Definition for the Widget KDragDemo
7.6. main.cpp: Contains a main() Function Suitable for Testing KDragDemo
7.7. A Sample KDE Application Configuration File
7.8. kconfigdemo.h: Class Declaration for KConfigDemo, a widget that demonstrates KConfig
7.9. kconfigdemo.cpp: Class Definition for KConfigDemo
7.10. main.cpp: A main() Function Suitable for Testing KConfigDemo
7.11. ksaveacross.h: Class Declaration for KSaveAcross, a Widget That Demonstrates Session Management Features of KTMainWindow
7.12. ksaveacross.cpp: Class Definition for KSaveAcross
7.13. main.cpp: A main() Function Suitable for Testing KSaveAcross
7.14. kresourcedemo.h: Class Declaration for KResourceDemo, a Widget That Demonstrates Loading and Using Application Resources
7.15. kresourcedemo.cpp: Class Definition for KResourceDemo
7.16. Contents of $KDEDIR/share/appstext.txt, Which is Displayed by kresourcedemo
7.17. kresource.po: The Translation Template File Generated by xgettext
7.18. kremotedemo.h: Class declaration for KRemoteDemo
7.19. kremotedemo.cpp: Class definition for KRemoteDemo
7.20. main.cpp: A main() function suitable for testing KRemoteDemo
8.1. Simplified Listing of the SelectDialog Dialog Class
8.2. The Difference Between the Old Style (Manual) Geometry Strategy and the New Based on QLayouts
8.3. The CGotoDialog Class Uses the KDialogBase Class Somewhat Differently from What Has Been Shown Earlier
8.4. The CGotoDialog Class Using a QVBox Widget to Do the Geometry Management
8.5. A Modal Dialog Located on the Stack
8.6. A Modal Dialog Allocated from the Heap
8.7. A Modeless Dialog
8.8. This Can Make Your Code Buggy!
8.9. A Secure Way to Remove a Modeless Dialog Object from Memory After It Has Been Hidden
8.10. Using a Dialog from the kdeui Library
8.11. Usage of KButtonBox in a Dialog
8.12. Setting the Text of User-Definable Action Buttons in the Constructor
8.13. The KEdit Dialog Code, Somewhat Simplified
9.1. kquickdraw.h: Class Declaration for KQuickDraw, a Widget That Demonstrates Double-buffering
9.2. kquickdraw.cpp: Class Definition for KQuickDraw
9.3. main.cpp: A main() Function Suitable for Testing KQuickDraw
9.4. klongjob.h: Class Definition for KLongJob, a Main Widget That Demonstrates How to Use QTimer to Perform a Long Job
9.5. klongjob.cpp: Class Declaration for KLongJob
9.6. main.cpp: A main() Function Suitable for Testing KLongJob
9.7. Modified Version of KlongJob, Which Uses QApplication::processEvents()
10.1. ksimplebrowser.h: Class Declaration for KSimpleBrowser, a Simple Web Browser
10.2. ksimplebrowser.cpp: Class Definition for KSimpleBrowser
10.3. main.cpp: A main() Function that Creates and Executes KSimpleBrowser
10.4. kimageview.h: Class Definition for KImageView, a Widget that Loads, Modifies, Saves, and Displays an Image
10.5. kimageview.cpp: Class Declaration for KImageView
10.6. main.cpp: A main() Function that Instantiates KImageView and Passes a Filename to It from the Command Line
10.7. kspelldemo.h: Class Declaration for KSpellDemo, a Simple Application that Uses KSpell
10.8. kspelldemo.cpp: Class Definition for KSpellDemo
10.9. main.cpp: A main() Function Suitable for Testing KSpellDemo
10.10. kabdemo.h: Class Declaration for KabDemo, a Demonstration of the KDE Address Book
10.11. kabdemo.cpp: Class Definition for KabDemo
10.12. main.cpp: A main() Function Suitable for Testing KabDemo
11.1. kdialogapp.h: Class Declaration for KDialogApp, a Dialog-Based Application
11.2. kdialogapp.cpp: Class Definition for KDialogApp
11.3. main.cpp: The main() Function Needed to Start KDialogApp
11.4. main.cpp: A main() Function Suitable for Starting a Single-Instance Application
11.5. kunique.cpp: Class Definition for KUnique, a Single-Instance Application
11.6. kunique.h: Class Declaration for KUnique
11.7. main.cpp: A main() Function Suitable for Starting a Panel applet
11.8. kweather.cpp: Class Definition for KWeather, a Panel Applet
11.9. kweather.h: Class Declaration for KWeather
12.1. Excerpt of konqueror.rc: A User Interface Described in XML
12.2. notepad_part.h: Header of the NotepadPart Class
12.3. notepadpart.rc: XML Description of the Notepad Part's User Interface
12.4. notepad_part.cpp part 1: Constructor
12.5. notepad_part.cpp part 2: Implementation of setReadWrite
12.6. notepad_part.cpp part 3: Implementation of openFile
12.7. notepad_part.cpp part 4: Implementation of saveFile
12.8. Extract from Makefile.am
12.9. notepad_factory.h: Header File for NotepadFactory
12.10. notepad_factory.cpp: NotepadFactory Implementation
12.11. ghostviewtest_shell.rc: The Mainwindow's GUI
12.12. ghostviewtest.h: Header for a Simple KParts Mainwindow
12.13. Excerpt of ghostviewtest.cpp: Implementation of the Simple KParts Mainwindow
13.1. Writing Through a QDataStream
13.2. Reading from a Raw "Device" Using a QDataStream
13.3. Typical Use of DCOPClient::send()
13.4. DCOPClient::send() with QString Data
13.5. Typical Use of DCOPClient::call()
13.6. Simple Object that Implements DCOP Processing
13.7. DCOP Processing with Transactions
13.8. Using dcopidl
13.9. A Typical Application that Uses DCOP
13.10. Example of a Handmade Stub File
13.11. DCOP Client Using the Automatically Generated Interface of Another DCOP Client
13.12. Specific Makefile Rules Needed for the DCOP Mechanism
13.13. Example of DCOPRef Usage
13.14. DCOP within a KPart
13.15. A KUniqueApplication has a Special Way of Starting
13.16. A KuniqueApplication has a Special Way of Passing Command-Line Parameters to Predecessors
13.17. A Desktop at the Fingertip
14.1. Listening to a Stereo Beep
14.2. Implementing the Example_ADD Interface
14.3. Using an Example_ADD Module
14.4. Running StereoBalanceControl on the Server
15.1. kdocsample.h: A Class Declaration Commented for Processing by KDOC
15.2. ksimpleapp.docbook: DocBook Documentation for KSimpleApp
16.1. Makefile.am: An Automake Source File Used to Build KSimpleApp
16.2. ksimpleapp-1.0.lsm: An LSM File for the KSimpleApp Package
17.1. CVSup Configuration File
C.1. Modified ksimpleapp.h
C.2. Modified ksimpleapp.cpp
C.3. Modified ksimpleapp.h
C.4. Modified ksimpleapp.cpp
C.5. Program Displaying an Empty Window
C.6. Program Displaying a Window with a Button
C.7. Modified ktictactoe.cpp File
C.8. Modified ktictactoe.h Method
C.9. Modified kxosquare.h Method
C.10. Modified kxosquare.cpp Method
C.11. Modified Methods from kdisc.cpp
C.12. kstatwidget.h: Class Definition for KStatWidget
C.13. kstatwidget.cpp: Class Definition for KStatWidget
C.14. main.cpp: main() Function, Which Can Be Used to Try KStatWidget
C.15. keditor.h: Class Declaration for KEditor
C.16. keditor.cpp: Class Definition for KEditor
C.17. main.cpp: main() Function, Which Can Be Used to Test KEditor
C.18. Creating a Full-Featured Edit Menu with KIO::NetAccess
C.19. Using KRun to Execute a Program
C.20. Modified kdropdemo.cpp
C.21. Modified kdragdemo.h
C.22. Modified kdragdemo.cpp
C.23. kplaysound.h
C.24. kplaysound.cpp
C.25. main.cpp
C.26. Creating a Dialog Box to Compose and Send Email Messages
C.27. Modifying the Dialog Box
C.28. klongdraw.h: Class Declaration for KLongDraw, a Widget That Draws a Complex Scene
C.29. klongdraw.cpp: Class Definition for KLongDraw, a Widget That Draws a Complex Scene
C.30. main.cpp: A main() Function Suitable for Testing KLongDraw
C.31. ksimplebrowser.h—Class Declaration for KSimpleBrowser
C.32. ksimplebrowser.cpp—Class Definition for KSimpleBrowser
C.33. ktransform.h—Class Declaration for KTransform
C.34. ktransform.cpp—Class Declaration for KTransform
C.35. kuniqueweather.h: Class Declaration for KUniqueWeather, a Single-Instance Panel Applet
C.36. kuniqueweather.cpp: Class Definition for KUniqueWeather, a Single-Instance Panel Applet
C.37. main.cpp: The main() Function Used to Start KUniqueWeather
C.38. Implementing a Beep Sound with Variable Frequency
C.39. The Missing Cases in balance_impl.cc
C.40. The Missing Cases in balance.cc
C.41. Stereo Beep Example