Add files lost in the migration from svn.

This commit is contained in:
Julien Cristau 2007-02-08 16:49:51 +01:00
parent 55347e43e6
commit cf2998bc78
256 changed files with 41588 additions and 0 deletions

0
bitmap/AUTHORS Normal file
View File

1128
bitmap/BitEdit.c Normal file

File diff suppressed because it is too large Load Diff

19
bitmap/Bitmap-color.ad Normal file
View File

@ -0,0 +1,19 @@
! $Xorg: Bitmap-co.ad,v 1.3 2000/08/17 19:53:49 cpqbld Exp $
! The App-defaults file for Bitmap on a color screen.
#include "Bitmap"
*background: medium blue
*foreground: cyan
*borderColor: plum
*frame: deep sky blue
*highlight: magenta
*Command.background: purple
*Toggle.background: purple
*MenuButton.background: purple
*Command.foreground: white
*Toggle.foreground: white
*MenuButton.foreground: white
*status.foreground: green
*Dialog.icon.foreground: pale green
*bitmap.stippled: off

233
bitmap/Bitmap-nocase.ad Normal file
View File

@ -0,0 +1,233 @@
! $Xorg: Bitmap.ad,v 1.3 2000/08/17 19:53:49 cpqbld Exp $
!
! $XFree86: $
!
! The App-defaults file for Bitmap for use on file systems
! that are not case sensitive.
*TransientShell.allowShellResize: True
*shapeStyle: oval
*cursor: left_ptr
*pane.orientation: horizontal
*Form*top: ChainTop
*Form*bottom: ChainTop
*Form*left: ChainLeft
*Form*right: ChainLeft
*MenuButton.leftBitmap: menu12
*form*width: 120
*form*height: 15
*baseTranslations:#override\
Ctrl<Key>c: do-quit()\n\
<Key>q: do-quit()\n\
Ctrl<Key>n: do-new()\n\
Ctrl<Key>f: do-load()\n\
Ctrl<Key>i: do-insert()\n\
Ctrl<Key>s: do-save()\n\
Ctrl<Key>w: do-save-as()\n\
Ctrl<Key>r: do-resize()\n\
Ctrl<Key>x: do-rescale()\n\
Ctrl<Key>e: do-filename()\n\
Ctrl<Key>b: do-basename()\n\
Meta<Key>i: switch-image()\n\
Meta<Key>g: switch-grid()\n\
Meta<Key>d: switch-dashed()\n\
Meta<Key>a: switch-axes()\n\
Meta<Key>s: switch-stippled()\n\
Meta<Key>p: switch-proportional()\n\
Meta<Key>z: switch-zoom()\n\
Meta<Key>c: do-cut()\n\
Meta<Key>w: do-copy()\n\
Meta<Key>y: do-paste()
*Toggle.translations: <EnterWindow>: highlight(WhenUnset)\n\
<LeaveWindow>: unhighlight()\n\
<Btn1Down>,<Btn1Up>: set() notify()
*MenuButton.translations:<EnterWindow>: highlight()\n\
<LeaveWindow>: reset()\n\
Any<BtnDown>: reset() fix-menu() PopupMenu()
*Dialog*baseTranslations:#override\
<Key>Return: set-dialog-button(okay, yes, retry)\n\
Ctrl<Key>g: set-dialog-button(cancel, abort)
*image*baseTranslations:#override\
<Btn1Down>,<Btn1Up>: switch-image()
*image*width: 0
*image*height: 0
*image*Label.internalWidth: 0
*image*Label.internalHeight: 0
*image*normalImage.foreground: white
*image*normalImage.background: black
*image*invertedImage.foreground: black
*image*invertedImage.background: white
*bitmap.cursor: tcross
*bitmap.dashes: Dashes
*bitmap.stipple: Stippler
*bitmap.stippled: on
*TransientShell.width: 300
*input*icon: Term
*qsave*icon: Term
*error*icon: Excl
*Dialog.yes.label: Yes
*Dialog.no.label: No
*Dialog.okay.label: OK
*Dialog.abort.label: Abort
*Dialog.cancel.label: Cancel
*Dialog.retry.label: Retry
*MenuButton.width: 58
*SimpleMenu.width: 0
*SimpleMenu.height: 0
*SimpleMenu.cursor: hand2
*SimpleMenu.line.height: 0
*fileButton.label: File
*fileButton.menuName: fileMenu
*editButton.label: Edit
*editButton.fromHoriz: fileButton
*editButton.menuName: editMenu
*formy.status*top: ChainTop
*formy.status*bottom: ChainTop
*formy.status*left: ChainLeft
*formy.status*right: ChainRight
*status.fromHoriz: editButton
*status.borderWidth: 0
*SmeBSB.HorizontalMargins: 32
*fileMenu.new.label: New (Ctrl-N)...
*fileMenu.load.label: Load (Ctrl-F)...
*fileMenu.insert.label: Insert (Ctrl-I)...
*fileMenu.save.label: Save (Ctrl-S)
*fileMenu.saveAs.label: Save As (Ctrl-W)...
*fileMenu.resize.label: Resize (Ctrl-R)...
*fileMenu.rescale.label: Rescale (Ctrl-X)...
*fileMenu.filename.label: Filename (Ctrl-E)...
*fileMenu.basename.label: Basename (Ctrl-B)...
*fileMenu.quit.label: Quit (Ctrl-C, Q)
*editMenu.image.label: Image (Meta-I)
*editMenu.grid.label: Grid (Meta-G)
*editMenu.dashed.label: Dashed (Meta-D)
*editMenu.axes.label: Axes (Meta-A)
*editMenu.stippled.label: Stippled (Meta-S)
*editMenu.proportional.label: Proportional (Meta-P)
*editMenu.zoom.label: Zoom (Meta-Z)
*editMenu.cut.label: Cut (Meta-C)
*editMenu.copy.label: Copy (Meta-W)
*editMenu.paste.label: Paste (Meta-Y, Ctrl-mb)
*form.clear.label: Clear
*form.set.fromVert: clear
*form.set.label: Set
*form.invert.fromVert: set
*form.invert.label: Invert
*form.mark.vertDistance: 10
*form.mark.fromVert: invert
*form.mark.label: Mark
*form.unmark.fromVert: mark
*form.unmark.label: Unmark
*form.copy.vertDistance: 10
*form.copy.fromVert: unmark
*form.copy.radioGroup: mark
*form.copy.label: Copy
*form.move.fromVert: copy
*form.move.radioGroup: copy
*form.move.label: Move
*form.flipHoriz.vertDistance: 10
*form.flipHoriz.width: 36
*form.flipHoriz.height: 36
*form.flipHoriz.fromVert: move
*form.flipHoriz.bitmap: FlipHoriz
*form.up.vertDistance: 10
*form.up.width: 36
*form.up.height: 36
*form.up.fromVert: move
*form.up.fromHoriz: flipHoriz
*form.up.bitmap: Up
*form.flipVert.vertDistance: 10
*form.flipVert.width: 36
*form.flipVert.height: 36
*form.flipVert.fromVert: move
*form.flipVert.fromHoriz: up
*form.flipVert.bitmap: FlipVert
*form.left.width: 36
*form.left.height: 36
*form.left.fromVert: flipHoriz
*form.left.bitmap: Left
*form.fold.width: 36
*form.fold.height: 36
*form.fold.fromVert: up
*form.fold.fromHoriz: left
*form.fold.bitmap: Fold
*form.right.width: 36
*form.right.height: 36
*form.right.fromVert: flipVert
*form.right.fromHoriz: fold
*form.right.bitmap: Right
*form.rotateLeft.width: 36
*form.rotateLeft.height: 36
*form.rotateLeft.fromVert: left
*form.rotateLeft.bitmap: RotateLeft
*form.down.width: 36
*form.down.height: 36
*form.down.fromVert: fold
*form.down.fromHoriz: rotateLeft
*form.down.bitmap: Down
*form.rotateRight.width: 36
*form.rotateRight.height: 36
*form.rotateRight.fromVert: right
*form.rotateRight.fromHoriz: down
*form.rotateRight.bitmap: RotateRight
*form.point.vertDistance: 10
*form.point.fromVert: rotateLeft
*form.point.radioGroup: move
*form.point.label: Point
*form.curve.fromVert: point
*form.curve.radioGroup: point
*form.curve.label: Curve
*form.line.fromVert: curve
*form.line.radioGroup: curve
*form.line.label: Line
*form.rectangle.fromVert: line
*form.rectangle.radioGroup: line
*form.rectangle.label: Rectangle
*form.filledRectangle.fromVert: rectangle
*form.filledRectangle.radioGroup: rectangle
*form.filledRectangle.label: Filled Rectangle
*form.circle.fromVert: filledRectangle
*form.circle.radioGroup: filledRectangle
*form.circle.label: Circle
*form.filledCircle.fromVert: circle
*form.filledCircle.radioGroup: circle
*form.filledCircle.label: Filled Circle
*form.floodFill.fromVert: filledCircle
*form.floodFill.radioGroup: filledCircle
*form.floodFill.label: Flood Fill
*form.setHotSpot.vertDistance: 10
*form.setHotSpot.fromVert: floodFill
*form.setHotSpot.radioGroup: floodFill
*form.setHotSpot.label: Set Hot Spot
*form.clearHotSpot.fromVert: setHotSpot
*form.clearHotSpot.label: Clear Hot Spot
*form.undo.vertDistance: 10
*form.undo.fromVert: clearHotSpot
*form.undo.label: Undo

229
bitmap/Bitmap.ad Normal file
View File

@ -0,0 +1,229 @@
! $Xorg: Bitmap.ad,v 1.3 2000/08/17 19:53:49 cpqbld Exp $
! The App-defaults file for Bitmap.
*TransientShell.allowShellResize: True
*shapeStyle: oval
*cursor: left_ptr
*pane.orientation: horizontal
*Form*top: ChainTop
*Form*bottom: ChainTop
*Form*left: ChainLeft
*Form*right: ChainLeft
*MenuButton.leftBitmap: menu12
*form*width: 120
*form*height: 15
*baseTranslations:#override\
Ctrl<Key>c: do-quit()\n\
<Key>q: do-quit()\n\
Ctrl<Key>n: do-new()\n\
Ctrl<Key>f: do-load()\n\
Ctrl<Key>i: do-insert()\n\
Ctrl<Key>s: do-save()\n\
Ctrl<Key>w: do-save-as()\n\
Ctrl<Key>r: do-resize()\n\
Ctrl<Key>x: do-rescale()\n\
Ctrl<Key>e: do-filename()\n\
Ctrl<Key>b: do-basename()\n\
Meta<Key>i: switch-image()\n\
Meta<Key>g: switch-grid()\n\
Meta<Key>d: switch-dashed()\n\
Meta<Key>a: switch-axes()\n\
Meta<Key>s: switch-stippled()\n\
Meta<Key>p: switch-proportional()\n\
Meta<Key>z: switch-zoom()\n\
Meta<Key>c: do-cut()\n\
Meta<Key>w: do-copy()\n\
Meta<Key>y: do-paste()
*Toggle.translations: <EnterWindow>: highlight(WhenUnset)\n\
<LeaveWindow>: unhighlight()\n\
<Btn1Down>,<Btn1Up>: set() notify()
*MenuButton.translations:<EnterWindow>: highlight()\n\
<LeaveWindow>: reset()\n\
Any<BtnDown>: reset() fix-menu() PopupMenu()
*Dialog*baseTranslations:#override\
<Key>Return: set-dialog-button(okay, yes, retry)\n\
Ctrl<Key>g: set-dialog-button(cancel, abort)
*image*baseTranslations:#override\
<Btn1Down>,<Btn1Up>: switch-image()
*image*width: 0
*image*height: 0
*image*Label.internalWidth: 0
*image*Label.internalHeight: 0
*image*normalImage.foreground: white
*image*normalImage.background: black
*image*invertedImage.foreground: black
*image*invertedImage.background: white
*bitmap.cursor: tcross
*bitmap.dashes: Dashes
*bitmap.stipple: Stipple
*bitmap.stippled: on
*TransientShell.width: 300
*input*icon: Term
*qsave*icon: Term
*error*icon: Excl
*Dialog.yes.label: Yes
*Dialog.no.label: No
*Dialog.okay.label: OK
*Dialog.abort.label: Abort
*Dialog.cancel.label: Cancel
*Dialog.retry.label: Retry
*MenuButton.width: 58
*SimpleMenu.width: 0
*SimpleMenu.height: 0
*SimpleMenu.cursor: hand2
*SimpleMenu.line.height: 0
*fileButton.label: File
*fileButton.menuName: fileMenu
*editButton.label: Edit
*editButton.fromHoriz: fileButton
*editButton.menuName: editMenu
*formy.status*top: ChainTop
*formy.status*bottom: ChainTop
*formy.status*left: ChainLeft
*formy.status*right: ChainRight
*status.fromHoriz: editButton
*status.borderWidth: 0
*SmeBSB.HorizontalMargins: 32
*fileMenu.new.label: New (Ctrl-N)...
*fileMenu.load.label: Load (Ctrl-F)...
*fileMenu.insert.label: Insert (Ctrl-I)...
*fileMenu.save.label: Save (Ctrl-S)
*fileMenu.saveAs.label: Save As (Ctrl-W)...
*fileMenu.resize.label: Resize (Ctrl-R)...
*fileMenu.rescale.label: Rescale (Ctrl-X)...
*fileMenu.filename.label: Filename (Ctrl-E)...
*fileMenu.basename.label: Basename (Ctrl-B)...
*fileMenu.quit.label: Quit (Ctrl-C, Q)
*editMenu.image.label: Image (Meta-I)
*editMenu.grid.label: Grid (Meta-G)
*editMenu.dashed.label: Dashed (Meta-D)
*editMenu.axes.label: Axes (Meta-A)
*editMenu.stippled.label: Stippled (Meta-S)
*editMenu.proportional.label: Proportional (Meta-P)
*editMenu.zoom.label: Zoom (Meta-Z)
*editMenu.cut.label: Cut (Meta-C)
*editMenu.copy.label: Copy (Meta-W)
*editMenu.paste.label: Paste (Meta-Y, Ctrl-mb)
*form.clear.label: Clear
*form.set.fromVert: clear
*form.set.label: Set
*form.invert.fromVert: set
*form.invert.label: Invert
*form.mark.vertDistance: 10
*form.mark.fromVert: invert
*form.mark.label: Mark
*form.unmark.fromVert: mark
*form.unmark.label: Unmark
*form.copy.vertDistance: 10
*form.copy.fromVert: unmark
*form.copy.radioGroup: mark
*form.copy.label: Copy
*form.move.fromVert: copy
*form.move.radioGroup: copy
*form.move.label: Move
*form.flipHoriz.vertDistance: 10
*form.flipHoriz.width: 36
*form.flipHoriz.height: 36
*form.flipHoriz.fromVert: move
*form.flipHoriz.bitmap: FlipHoriz
*form.up.vertDistance: 10
*form.up.width: 36
*form.up.height: 36
*form.up.fromVert: move
*form.up.fromHoriz: flipHoriz
*form.up.bitmap: Up
*form.flipVert.vertDistance: 10
*form.flipVert.width: 36
*form.flipVert.height: 36
*form.flipVert.fromVert: move
*form.flipVert.fromHoriz: up
*form.flipVert.bitmap: FlipVert
*form.left.width: 36
*form.left.height: 36
*form.left.fromVert: flipHoriz
*form.left.bitmap: Left
*form.fold.width: 36
*form.fold.height: 36
*form.fold.fromVert: up
*form.fold.fromHoriz: left
*form.fold.bitmap: Fold
*form.right.width: 36
*form.right.height: 36
*form.right.fromVert: flipVert
*form.right.fromHoriz: fold
*form.right.bitmap: Right
*form.rotateLeft.width: 36
*form.rotateLeft.height: 36
*form.rotateLeft.fromVert: left
*form.rotateLeft.bitmap: RotateLeft
*form.down.width: 36
*form.down.height: 36
*form.down.fromVert: fold
*form.down.fromHoriz: rotateLeft
*form.down.bitmap: Down
*form.rotateRight.width: 36
*form.rotateRight.height: 36
*form.rotateRight.fromVert: right
*form.rotateRight.fromHoriz: down
*form.rotateRight.bitmap: RotateRight
*form.point.vertDistance: 10
*form.point.fromVert: rotateLeft
*form.point.radioGroup: move
*form.point.label: Point
*form.curve.fromVert: point
*form.curve.radioGroup: point
*form.curve.label: Curve
*form.line.fromVert: curve
*form.line.radioGroup: curve
*form.line.label: Line
*form.rectangle.fromVert: line
*form.rectangle.radioGroup: line
*form.rectangle.label: Rectangle
*form.filledRectangle.fromVert: rectangle
*form.filledRectangle.radioGroup: rectangle
*form.filledRectangle.label: Filled Rectangle
*form.circle.fromVert: filledRectangle
*form.circle.radioGroup: filledRectangle
*form.circle.label: Circle
*form.filledCircle.fromVert: circle
*form.filledCircle.radioGroup: circle
*form.filledCircle.label: Filled Circle
*form.floodFill.fromVert: filledCircle
*form.floodFill.radioGroup: filledCircle
*form.floodFill.label: Flood Fill
*form.setHotSpot.vertDistance: 10
*form.setHotSpot.fromVert: floodFill
*form.setHotSpot.radioGroup: floodFill
*form.setHotSpot.label: Set Hot Spot
*form.clearHotSpot.fromVert: setHotSpot
*form.clearHotSpot.label: Clear Hot Spot
*form.undo.vertDistance: 10
*form.undo.fromVert: clearHotSpot
*form.undo.label: Undo

1950
bitmap/Bitmap.c Normal file

File diff suppressed because it is too large Load Diff

286
bitmap/Bitmap.h Normal file
View File

@ -0,0 +1,286 @@
/* $Xorg: Bitmap.h,v 1.4 2001/02/09 02:05:28 xorgcvs Exp $ */
/*
Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall
not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from The Open Group.
*/
/* $XFree86: xc/programs/bitmap/Bitmap.h,v 1.4 2001/06/12 09:45:53 alanh Exp $ */
/*
* Author: Davor Matic, MIT X Consortium
*/
#ifndef _Bitmap_h
#define _Bitmap_h
/****************************************************************
*
* Bitmap widget
*
****************************************************************/
#include <X11/Xaw/Simple.h>
/* Resources:
Name Class RepType Default Value
---- ----- ------- -------------
background Background Pixel XtDefaultBackground
foreground Foredround Pixel XtDefaultForeground
highlight Highlight Pixel XtDefaultForeground
frame Frame Pixel XtDefaultForeground
border BorderColor Pixel XtDefaultForeground
borderWidth BorderWidth Dimension 1
mappedWhenManaged MappedWhenManaged Boolean True
resize Resize Boolean True
sensitive Sensitive Boolean True
width Width Dimension 0
height Height Dimension 0
size Size String 32x32
squareWidht SquareWidht Dimension 16
squareHeight SquareHeight Dimension 16
x Position Position 320
y Position Position 320
xHot XHot Position NotSet
yHot YHot Position NotSet
margin Margin Dimension 16
grid Grid Boolean True
gridTolerance GridTolerance Dimension 8
dashed Dashed Boolean True
dashes Dashes Bitmap XtUnspecifiedPixmap
stippled Stippled Boolean True
stipple Stipple Bitmap XtUnspecifiedPixmap
proportional Proportional Boolean True
axes Axes Boolean True
button1Function Button1Function ButtonFunction Set
button2Function Button2Function ButtonFunction Invert
button3Function Button3Function ButtonFunction Clear
button4Function Button4Function ButtonFunction Invert
button5Function Button5Function ButtonFunction Invert
filename Filename String None
basename Basename String None
*/
/* define any special resource names here that are not in <X11/StringDefs.h> */
#define XtNbitmapResource "bitmapResource"
#define XtNstipple "stipple"
#define XtNstippled "stippled"
#define XtNdashes "dashes"
#define XtNdashed "dashed"
#define XtNgrid "grid"
#define XtNgridTolerance "gridTolerance"
#define XtNaxes "axes"
#define XtNbitmapSize "bitmapSize"
#define XtNsize "size"
#define XtNsquareWidth "squareWidth"
#define XtNsquareHeight "squareHeight"
#define XtNxHot "xHot"
#define XtNyHot "yHot"
#define XtNbutton1Function "button1Function"
#define XtNbutton2Function "button2Function"
#define XtNbutton3Function "button3Function"
#define XtNbutton4Function "button4Function"
#define XtNbutton5Function "button5Function"
#define XtNfilename "filename"
#define XtNbasename "basename"
#define XtNmouseForeground "mouseForeground"
#define XtNmouseBackground "mouseBackground"
#define XtNframe "frame"
#define XtNmargin "margin"
#define XtNproportional "proportional"
#define XtCBitmapResource "BitmapResource"
#define XtCHighlight "Highlight"
#define XtCStipple "Stipple"
#define XtCStippled "Stippled"
#define XtCDashes "Dashes"
#define XtCDashed "Dashed"
#define XtCGrid "Grid"
#define XtCGridTolerance "GridTolerance"
#define XtCAxes "Axes"
#define XtBitmapSize "BitmapSize"
#define XtCSize "Size"
#define XtCSquareWidth "SquareWidth"
#define XtCSquareHeight "SquareHeight"
#define XtCXHot "XHot"
#define XtCYHot "YHot"
#define XtCButton1Function "Button1Function"
#define XtCButton2Function "Button2Function"
#define XtCButton3Function "Button3Function"
#define XtCButton4Function "Button4Function"
#define XtCButton5Function "Button5Function"
#define XtCFilename "Filename"
#define XtCBasename "Basename"
#define XtCFrame "Frame"
#ifndef XtCMargin
#define XtCMargin "Margin"
#endif
#define XtCProportional "Proportional"
#define XtRButtonFunction "ButtonFunction"
/* bitmap defines */
#define NotSet -1
#define Clear 0
#define Set 1
#define Invert 2
#define Highlight 3
#define On True
#define Off False
#define XtClear "clear"
#define XtSet "set"
#define XtInvert "invert"
#define MarkRequest "MarkRequest"
#define StoreRequest "StoreRequest"
#define RestoreRequest "RestoreRequest"
#define CopyRequest "CopyRequest"
#define MoveRequest "MoveRequest"
#define PointRequest "PointRequest"
#define LineRequest "LineRequest"
#define CurveRequest "CurveRequest"
#define RectangleRequest "RectangleRequest"
#define FilledRectangleRequest "FilledRectangleRequest"
#define CircleRequest "CircleRequest"
#define FilledCircleRequest "FilledCircleRequest"
#define FloodFillRequest "FloodFillRequest"
#define HotSpotRequest "HotSpotRequest"
#define ZoomInRequest "ZoomInRequest"
#define PasteRequest "PasteRequest"
#define ImmediateCopyRequest "ImmediateCopyRequest"
#define ImmediateMoveRequest "ImmediateMoveRequest"
/* bitmap exports */
typedef struct _BWRequestRec BWRequestRec;
typedef char *BWRequest;
/* declare specific BitmapWidget class and instance datatypes */
typedef struct _BitmapClassRec *BitmapWidgetClass;
typedef struct _BitmapRec *BitmapWidget;
/* declare the class constant */
extern WidgetClass bitmapWidgetClass;
extern Boolean BWEngageRequest(Widget w, BWRequest name, Boolean trap,
XtPointer call_data, Cardinal call_data_size);
extern Boolean BWTerminateRequest(Widget w, Boolean cont);
extern void BWUp ( Widget w );
extern void BWDown ( Widget w );
extern void BWLeft ( Widget w );
extern void BWRight ( Widget w );
extern void BWRotateRight ( Widget w );
extern void BWRotateLeft ( Widget w );
extern void BWSwitchGrid ( Widget w );
extern void BWGrid ( Widget w, Boolean _switch );
extern void BWSwitchDashed ( Widget w );
extern void BWDashed ( Widget w, Boolean _switch );
extern void BWSwitchAxes ( Widget w );
extern void BWAxes ( Widget w, Boolean _switch );
extern void BWRedrawAxes( Widget w );
extern void BWDrawLine ( Widget w, Position from_x, Position from_y, Position to_x, Position to_y, int value );
extern void BWDrawRectangle ( Widget w, Position from_x, Position from_y, Position to_x, Position to_y, int value );
extern void BWDrawFilledRectangle ( Widget w, Position from_x, Position from_y, Position to_x, Position to_y, int value );
extern void BWDrawCircle ( Widget w, Position origin_x, Position origin_y, Position point_x, Position point_y, int value );
extern void BWDrawFilledCircle ( Widget w, Position origin_x, Position origin_y, Position point_x, Position point_y, int value );
extern void BWFloodFill ( Widget w, Position x, Position y, int value );
extern void BWMark ( Widget w, Position from_x, Position from_y, Position to_x, Position to_y );
extern void BWMarkAll ( Widget w );
extern void BWUnmark ( Widget w );
extern void BWSelect ( Widget w, Position from_x, Position from_y, Position to_x, Position to_y, Time btime );
extern void BWStore ( Widget w );
extern void BWStoreToBuffer ( Widget w );
extern void BWUndo ( Widget w );
extern void BWResize ( Widget w, Dimension width, Dimension height );
extern void BWClip ( Widget w, Position x, Position y, Dimension width, Dimension height );
extern void BWUnclip ( Widget w );
extern void BWGrabSelection ( Widget w, Time btime );
extern void BWRequestSelection ( Widget w, Time btime, Boolean wait );
extern void BWSetChanged ( Widget w );
extern Boolean BWQueryChanged ( Widget w );
extern int BWReadFile ( Widget w, String filename, String basename );
extern int BWWriteFile ( Widget w, String filename, String basename );
extern String BWUnparseStatus ( Widget w );
extern String BWGetFilename ( Widget w, String *str );
extern String BWGetBasename ( Widget w, String *str );
extern void BWChangeBasename ( Widget w, String str );
extern void BWRemoveAllRequests ( Widget w );
extern void BWClearHotSpot ( Widget w );
extern Boolean BWQueryMarked ( Widget w );
extern void BWFold ( Widget w );
extern void BWClear ( Widget w );
extern void BWSet ( Widget w );
extern void BWInvert ( Widget w );
extern void BWFlipHoriz ( Widget w );
extern void BWFlipVert ( Widget w );
extern void BWClearMarked ( Widget w );
extern Boolean BWAddRequest ( Widget w, BWRequest name, Boolean trap, XtPointer call_data, Cardinal call_data_size );
extern void BWChangeNotify ( Widget w );
extern Pixmap BWGetUnzoomedPixmap ( Widget w );
extern void BWClearChanged ( Widget w );
extern Boolean BWQueryStored ( Widget w );
extern Boolean BWQueryStippled ( Widget w );
extern void BWSwitchStippled ( Widget w );
extern void BWRedrawMark ( Widget w );
extern Boolean BWQueryAxes ( Widget w );
extern void BWHighlightAxes ( Widget w );
extern String BWGetFilepath ( Widget w, String *str );
extern void BWZoomOut ( Widget w );
extern void BWZoomMarked ( Widget w );
extern void BWRescale ( Widget w, Dimension width, Dimension height );
extern Boolean BWQueryZooming ( Widget w );
extern void BWRedrawGrid ( Widget w, Position x, Position y, Dimension width, Dimension height );
extern void BWRedrawSquares ( Widget w, Position x, Position y, Dimension width, Dimension height );
extern void BWRedrawHotSpot ( Widget w );
extern void BWSetHotSpot(Widget w, Position x, Position y);
extern Boolean BWQueryGrid ( Widget w );
extern Boolean BWQueryDashed ( Widget w );
extern Boolean BWQueryProportional ( Widget w );
extern void BWSwitchProportional ( Widget w );
extern void BWDrawGrid ( Widget w, Position from_x, Position from_y, Position to_x, Position to_y );
extern void BWChangeFilename ( Widget w, String str );
extern Boolean BWParseSize ( String size, Dimension *width, Dimension *height );
extern Boolean BWQuerySelection ( Widget w, Time btime );
extern int BWStoreFile ( Widget w, String filename, String *basename );
extern void BWNotify ( Widget w, XtActionProc proc );
extern void BWTMark ( Widget w, XEvent *event, String *params, Cardinal *num_params );
extern void BWTMarkAll ( Widget w, XEvent *event, String *params, Cardinal *num_params );
extern void BWTUnmark ( Widget w, XEvent *event, String *params, Cardinal *num_params );
extern void BWTPaste ( Widget w, XEvent *event, String *params, Cardinal *num_params );
extern void BWDebug ( Widget w, XEvent *event, String *params, Cardinal *num_params );
extern void BWAbort ( Widget w );
extern Boolean BWRemoveRequest ( Widget w );
extern void BWRedraw ( Widget w );
extern Pixmap BWGetPixmap( Widget w );
#endif /* _Bitmap_h */

211
bitmap/BitmapP.h Normal file
View File

@ -0,0 +1,211 @@
/* $Xorg: BitmapP.h,v 1.4 2001/02/09 02:05:28 xorgcvs Exp $ */
/*
Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall
not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from The Open Group.
*/
/* $XFree86: xc/programs/bitmap/BitmapP.h,v 1.3 2001/01/17 23:44:51 dawes Exp $ */
/*
* Author: Davor Matic, MIT X Consortium
*/
#ifndef _BitmapP_h
#define _BitmapP_h
#define bit int
#include "Bitmap.h"
#include "Requests.h"
#include <X11/Xaw/SimpleP.h>
typedef struct {
Atom *targets;
Cardinal num_targets;
BWRequestRec *requests;
Cardinal num_requests;
BWRequestRec *request[100];
} BitmapClassPart;
/* Full class record declaration */
typedef struct _BitmapClassRec {
CoreClassPart core_class;
SimpleClassPart simple_class;
BitmapClassPart bitmap_class;
} BitmapClassRec;
extern BitmapClassRec bitmapClassRec;
typedef void (*EngageProc)(Widget, BWStatus *, XtPointer, int *);
typedef void (*TerminateProc)( Widget, BWStatus *, XtPointer);
typedef void (*RemoveProc)(Widget w, BWStatus *, XtPointer);
/**********/
struct _BWRequestRec {
char *name;
int status_size;
EngageProc engage;
XtPointer engage_client_data;
TerminateProc terminate;
XtPointer terminate_client_data;
RemoveProc remove;
XtPointer remove_client_data;
} ;
typedef struct {
Position from_x, from_y,
to_x, to_y;
} BWArea;
typedef struct {
BWRequestRec *request;
XtPointer status;
Boolean trap;
XtPointer call_data;
} BWRequestStack;
typedef struct {
XImage *image, *buffer;
XPoint hot;
Position at_x, at_y;
Boolean fold;
Boolean grid;
Boolean changed;
} BWZoom;
typedef struct {
Boolean own;
Boolean limbo;
} BWSelection;
/* New fields for the Bitmap widget record */
typedef struct {
/* resources */
Pixel foreground_pixel;
Pixel highlight_pixel;
Pixel frame_pixel;
Pixmap stipple;
Boolean stippled;
Boolean proportional;
Boolean grid;
Dimension grid_tolerance;
Pixmap dashes;
Boolean dashed;
Boolean axes;
Boolean resize;
Dimension margin, squareW, squareH, width, height;
XPoint hot;
int button_function[5];
String filename, basename;
/* private state */
String size;
Position horizOffset, vertOffset;
XtActionProc notify;
BWRequestStack *request_stack;
Cardinal cardinal, current;
/*Boolean trapping;*/
XImage *image, *buffer, *storage;
XPoint buffer_hot;
BWArea mark, buffer_mark;
GC drawing_gc;
GC highlighting_gc;
GC frame_gc;
GC axes_gc;
Boolean changed;
Boolean fold;
Boolean zooming;
BWZoom zoom;
XtPointer *value;
char status[80];
BWSelection selection;
Boolean stipple_change_expose_event;
} BitmapPart;
/* Full instance record declaration */
typedef struct _BitmapRec {
CorePart core;
SimplePart simple;
BitmapPart bitmap;
} BitmapRec;
/* Private functions */
#define Length(width, height)\
(((int)(width) + 7) / 8 * (height))
#define InBitmapX(BW, x)\
(Position)(min((Position)((Dimension)(max(BW->bitmap.horizOffset,x) -\
BW->bitmap.horizOffset) /\
BW->bitmap.squareW), BW->bitmap.width - 1))
#define InBitmapY(BW, y)\
(Position)(min((Position)((Dimension)(max(BW->bitmap.vertOffset, y) -\
BW->bitmap.vertOffset) /\
BW->bitmap.squareH), BW->bitmap.height - 1))
#define InWindowX(BW, x)\
(Position) (BW->bitmap.horizOffset + ((x) * BW->bitmap.squareW))
#define InWindowY(BW, y)\
(Position) (BW->bitmap.vertOffset + ((y) * BW->bitmap.squareH))
#define GetPixmap(BW, image)\
XCreateBitmapFromData(XtDisplay(BW), XtWindow(BW),\
image->data, image->width, image->height)
#define QuerySet(x, y) (((x) != NotSet) && ((y) != NotSet))
#define bit int
#define QueryZero(x, y) (((x) == 0) || ((y) == 0))
#define Swap(x, y) {Position t; t = x; x = y; y = t;}
#define QuerySwap(x, y) if(x > y) Swap(x, y)
#define QueryInBitmap(BW, x, y)\
(((x) >= 0) && ((x) < BW->bitmap.image->width) &&\
((y) >= 0) && ((y) < BW->bitmap.image->height))
#define Value(BW, button) (BW->bitmap.button_function[button - 1])
#define CreateCleanData(length) XtCalloc(length, sizeof(char))
XImage *CreateBitmapImage(BitmapWidget BW, char *data, Dimension width, Dimension height);
void DestroyBitmapImage(XImage **image);
void TransferImageData(XImage *source, XImage *destination);
void CopyImageData(XImage *source, XImage *destination,
Position from_x, Position from_y,
Position to_x, Position to_y,
Position at_x, Position at_y);
XImage *GetImage(BitmapWidget BW, Pixmap pixmap);
XImage *ConvertToBitmapImage(BitmapWidget BW, XImage *image);
XImage *ScaleBitmapImage(BitmapWidget BW, XImage *src,
double scale_x, double scale_y);
#endif /* _BitmapP_h */

12
bitmap/COPYING Normal file
View File

@ -0,0 +1,12 @@
This is a stub file. This package has not yet had its complete licensing
information compiled. Please see the individual source files for details on
your rights to use and modify this software.
Please submit updated COPYING files to the Xorg bugzilla:
https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
All licensing questions regarding this software should be directed at the
Xorg mailing list:
http://lists.freedesktop.org/mailman/listinfo/xorg

207
bitmap/CutPaste.c Normal file
View File

@ -0,0 +1,207 @@
/* $Xorg: CutPaste.c,v 1.4 2001/02/09 02:05:28 xorgcvs Exp $ */
/*
Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall
not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from The Open Group.
*/
/* $XFree86: CutPaste.c,v 1.4 2001/12/14 20:00:40 dawes Exp $ */
/*
* Author: Davor Matic, MIT X Consortium
*/
#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>
#include <X11/Xatom.h>
#include "BitmapP.h"
#include <stdio.h>
#include <math.h>
#define min(x, y) (((x) < (y)) ? (x) : (y))
#define max(x, y) (((x) > (y)) ? (x) : (y))
extern Boolean DEBUG;
/*****************************************************************************
* Cut and Paste *
*****************************************************************************/
/* ARGSUSED */
static Boolean
ConvertSelection(Widget w, Atom *selection, Atom *target, Atom *type,
XtPointer *val_ret, unsigned long *length, int *format)
{
XPointer *value = (XPointer *)val_ret;
BitmapWidget BW = (BitmapWidget) w;
Pixmap *pixmap;
char *data;
XImage *image;
Dimension width, height;
switch (*target) {
/* XA_TARGETS undefined ?!?
case XA_TARGETS:
*type = XA_ATOM;
*value = (XPointer) bitmapClassRec.bitmap_class.targets;
*length = bitmapClassRec.bitmap_class.num_targets;
*format = 32;
return True;
*/
case XA_BITMAP:
case XA_PIXMAP:
if (BWQueryMarked(w)) {
width = BW->bitmap.mark.to_x - BW->bitmap.mark.from_x + 1;
height = BW->bitmap.mark.to_y - BW->bitmap.mark.from_y + 1;
data = CreateCleanData(Length(width, height));
image = CreateBitmapImage(BW, data, width, height);
CopyImageData(BW->bitmap.image, image,
BW->bitmap.mark.from_x, BW->bitmap.mark.from_y,
BW->bitmap.mark.to_x, BW->bitmap.mark.to_y, 0, 0);
pixmap = (Pixmap *) XtMalloc(sizeof(Pixmap));
*pixmap = GetPixmap(BW, image);
DestroyBitmapImage(&image);
}
else if (BWQueryStored(w)) {
pixmap = (Pixmap *) XtMalloc(sizeof(Pixmap));
*pixmap = GetPixmap(BW, BW->bitmap.storage);
}
else return False;
*type = XA_PIXMAP;
*value = (XPointer) pixmap;
*length = 1;
*format = 32;
return True;
default:
return False;
}
}
/* ARGSUSED */
static void
LoseSelection(Widget w, Atom selection)
{
BitmapWidget BW = (BitmapWidget) w;
if (DEBUG)
fprintf(stderr, "Lost Selection\n");
BW->bitmap.selection.own = False;
BWUnmark(w);
}
/* ARGSUSED */
static void
SelectionDone(Widget w, Atom *selection, Atom *target)
{
/* Done Automatically ?!?
BitmapWidget BW = (BitmapWidget) w;
if (*target != XA_TARGETS)
XtFree(BW->bitmap.value);
*/
}
void
BWGrabSelection(Widget w, Time btime)
{
BitmapWidget BW = (BitmapWidget) w;
BW->bitmap.selection.own = XtOwnSelection(w, XA_PRIMARY, btime,
ConvertSelection,
(XtLoseSelectionProc)LoseSelection,
SelectionDone);
if (DEBUG && BW->bitmap.selection.own)
fprintf(stderr, "Own the selection\n");
}
/* ARGSUSED */
static void
SelectionCallback(Widget w, XtPointer cldat, Atom *selection, Atom *type,
XtPointer val, unsigned long *length, int *format)
{
XPointer value = (XPointer)val;
BitmapWidget BW = (BitmapWidget) w;
Pixmap *pixmap;
switch (*type) {
case XA_BITMAP:
case XA_PIXMAP:
DestroyBitmapImage(&BW->bitmap.storage);
pixmap = (Pixmap *) value;
BW->bitmap.storage = GetImage(BW, *pixmap);
XFree((char *)pixmap);
break;
default:
XtWarning(" selection request failed. BitmapWidget");
break;
}
BW->bitmap.selection.limbo = FALSE;
}
void
BWRequestSelection(Widget w, Time btime, Boolean wait)
{
BitmapWidget BW = (BitmapWidget) w;
if (BW->bitmap.selection.own)
BWStore(w);
else {
XtGetSelectionValue(w, XA_PRIMARY, XA_PIXMAP,
SelectionCallback, NULL, btime);
BW->bitmap.selection.limbo = TRUE;
if (wait)
while (BW->bitmap.selection.limbo) {
XEvent event;
XtNextEvent(&event);
XtDispatchEvent(&event);
}
}
}
/* ARGSUSED */
/* Returns true if there is a transferable selection */
Boolean
BWQuerySelection(Widget w, Time btime)
{
/* To be written. XA_TARGETS to be used. So far undefined ?!? */
return True;
}
/*****************************************************************************/

4
bitmap/Dashes Normal file
View File

@ -0,0 +1,4 @@
#define Dashes_width 2
#define Dashes_height 2
static char Dashes_bits[] = {
0x01, 0x02};

202
bitmap/Dialog.c Normal file
View File

@ -0,0 +1,202 @@
/* $Xorg: Dialog.c,v 1.4 2001/02/09 02:05:28 xorgcvs Exp $ */
/*
Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall
not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from The Open Group.
*/
/* $XFree86: xc/programs/bitmap/Dialog.c,v 1.3 2001/01/17 23:44:51 dawes Exp $ */
/*
* Author: Davor Matic, MIT X Consortium
*/
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Shell.h>
#include <X11/Xaw/Dialog.h>
#include <X11/Xaw/Command.h>
#include <X11/Xmu/CharSet.h>
#include "Dialog.h"
#define min(x, y) (((x) < (y)) ? (x) : (y))
#define max(x, y) (((x) > (y)) ? (x) : (y))
static void SetDialogButton(Widget w, XEvent *event,
String *argv, Cardinal *argc);
static XtActionsRec actions_table[] = {
{"set-dialog-button", SetDialogButton},
};
static DialogButton dialog_buttons[] = {
{"yes", Yes},
{"no", No},
{"maybe", Maybe},
{"okay", Okay},
{"abort", Abort},
{"cancel", Cancel},
{"retry", Retry},
};
static unsigned long selected;
/* ARGSUSED */
static void
SetSelected(Widget w, XtPointer clientData, XtPointer callData) /* ARGSUSED */
{
String name = (String)clientData;
int i;
for (i = 0; i < XtNumber(dialog_buttons); i++)
if (!strcmp(dialog_buttons[i].name, name))
selected |= dialog_buttons[i].flag;
}
/* ARGSUSED */
static void
SetDialogButton(Widget w, /* not used */
XEvent *event, /* not used */
String *argv,
Cardinal *argc)
{
char button_name[80];
XtPointer dummy = NULL;
int i;
for (i = 0; i < *argc; i++) {
XmuCopyISOLatin1Lowered (button_name, argv[i]);
SetSelected(w, button_name, dummy);
}
}
static Boolean firstTime = True;
Dialog
CreateDialog(Widget top_widget, String name, unsigned long options)
{
int i;
Dialog popup;
popup = (Dialog) XtMalloc(sizeof(_Dialog));
if (popup) {
if (firstTime) {
XtAddActions(actions_table, XtNumber(actions_table));
firstTime = False;
}
popup->top_widget = top_widget;
popup->shell_widget = XtCreatePopupShell(name,
transientShellWidgetClass,
top_widget, NULL, 0);
popup->dialog_widget = XtCreateManagedWidget("dialog",
dialogWidgetClass,
popup->shell_widget,
NULL, 0);
for (i = 0; i < XtNumber(dialog_buttons); i++)
if (options & dialog_buttons[i].flag)
XawDialogAddButton(popup->dialog_widget,
dialog_buttons[i].name,
SetSelected, dialog_buttons[i].name);
popup->options = options;
return popup;
}
else
return NULL;
}
void
PopdownDialog(Dialog popup, String *answer)
{
if (answer)
*answer = XawDialogGetValueString(popup->dialog_widget);
XtPopdown(popup->shell_widget);
}
unsigned long
PopupDialog(Dialog popup, String message, String suggestion,
String *answer, XtGrabKind grab)
{
Position popup_x, popup_y, top_x, top_y;
Dimension popup_width, popup_height, top_width, top_height, border_width;
int n;
Arg wargs[4];
n = 0;
XtSetArg(wargs[n], XtNlabel, message); n++;
XtSetArg(wargs[n], XtNvalue, suggestion); n++;
XtSetValues(popup->dialog_widget, wargs, n);
XtRealizeWidget(popup->shell_widget);
n = 0;
XtSetArg(wargs[n], XtNx, &top_x); n++;
XtSetArg(wargs[n], XtNy, &top_y); n++;
XtSetArg(wargs[n], XtNwidth, &top_width); n++;
XtSetArg(wargs[n], XtNheight, &top_height); n++;
XtGetValues(popup->top_widget, wargs, n);
n = 0;
XtSetArg(wargs[n], XtNwidth, &popup_width); n++;
XtSetArg(wargs[n], XtNheight, &popup_height); n++;
XtSetArg(wargs[n], XtNborderWidth, &border_width); n++;
XtGetValues(popup->shell_widget, wargs, n);
popup_x = max(0,
min(top_x + ((Position)top_width - (Position)popup_width) / 2,
(Position)DisplayWidth(XtDisplay(popup->shell_widget),
DefaultScreen(XtDisplay(popup->shell_widget))) -
(Position)popup_width - 2 * (Position)border_width));
popup_y = max(0,
min(top_y + ((Position)top_height - (Position)popup_height) / 2,
(Position)DisplayHeight(XtDisplay(popup->shell_widget),
DefaultScreen(XtDisplay(popup->shell_widget))) -
(Position)popup_height - 2 * (Position)border_width));
n = 0;
XtSetArg(wargs[n], XtNx, popup_x); n++;
XtSetArg(wargs[n], XtNy, popup_y); n++;
XtSetValues(popup->shell_widget, wargs, n);
selected = None;
XtPopup(popup->shell_widget, grab);
XWarpPointer(XtDisplay(popup->shell_widget),
XtWindow(popup->top_widget),
XtWindow(popup->shell_widget),
0, 0, top_width, top_height,
popup_width / 2, popup_height / 2);
while ((selected & popup->options) == None) {
XEvent event;
XtNextEvent(&event);
XtDispatchEvent(&event);
}
PopdownDialog(popup, answer);
return (selected & popup->options);
}

57
bitmap/Dialog.h Normal file
View File

@ -0,0 +1,57 @@
/* $Xorg: Dialog.h,v 1.4 2001/02/09 02:05:28 xorgcvs Exp $ */
/*
Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall
not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from The Open Group.
*/
/* $XFree86: xc/programs/bitmap/Dialog.h,v 1.3 2001/01/17 23:44:51 dawes Exp $ */
/*
* Author: Davor Matic, MIT X Consortium
*/
/*#define None 0*/
#define Yes 1<<1
#define No 1<<2
#define Maybe 1<<3 /* :-) */
#define Okay 1<<4
#define Abort 1<<5
#define Cancel 1<<6
#define Retry 1<<7
typedef struct {
Widget top_widget, shell_widget, dialog_widget;
unsigned long options;
} _Dialog, *Dialog;
typedef struct {
String name;
unsigned long flag;
} DialogButton;
extern Dialog CreateDialog(Widget, String, unsigned long);
extern unsigned long PopupDialog(Dialog, String, String, String *, XtGrabKind);
extern void PopdownDialog(Dialog, String *);

13
bitmap/Down Normal file
View File

@ -0,0 +1,13 @@
#define Down_width 30
#define Down_height 30
static char Down_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x18, 0x03, 0x00,
0x00, 0xb8, 0x03, 0x00, 0x00, 0xf8, 0x03, 0x00, 0x00, 0x58, 0x03, 0x00,
0x00, 0xb8, 0x03, 0x00, 0x00, 0x58, 0x03, 0x00, 0x00, 0xb8, 0x03, 0x00,
0x00, 0x58, 0x03, 0x00, 0x00, 0xb8, 0x03, 0x00, 0x00, 0x58, 0x03, 0x00,
0x00, 0xb8, 0x03, 0x00, 0x00, 0x58, 0x03, 0x00, 0x00, 0xb8, 0x03, 0x00,
0x00, 0x58, 0x03, 0x00, 0xf0, 0xb8, 0xe3, 0x01, 0xf0, 0x59, 0xf3, 0x01,
0xb0, 0xbb, 0xbb, 0x01, 0x70, 0x5f, 0xdf, 0x01, 0xe0, 0xbe, 0xef, 0x00,
0xc0, 0x5d, 0x77, 0x00, 0x80, 0xab, 0x3a, 0x00, 0x00, 0x57, 0x1d, 0x00,
0x00, 0xae, 0x0e, 0x00, 0x00, 0x5c, 0x07, 0x00, 0x00, 0xb8, 0x03, 0x00,
0x00, 0xf0, 0x01, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00};

17
bitmap/Excl Normal file
View File

@ -0,0 +1,17 @@
#define Excl_width 40
#define Excl_height 32
static char Excl_bits[] = {
0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00,
0x7e, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x00,
0x00, 0x00, 0x80, 0xc3, 0x01, 0x00, 0x00, 0xc0, 0x99, 0x03, 0x00, 0x00,
0xc0, 0x34, 0x03, 0x00, 0x00, 0xe0, 0x6a, 0x07, 0x00, 0x00, 0x70, 0x76,
0x0e, 0x00, 0x00, 0x70, 0x6a, 0x0e, 0x00, 0x00, 0x38, 0x76, 0x1c, 0x00,
0x00, 0x18, 0x6a, 0x18, 0x00, 0x00, 0x1c, 0x76, 0x38, 0x00, 0x00, 0x0e,
0x6a, 0x70, 0x00, 0x00, 0x06, 0x76, 0x60, 0x00, 0x00, 0x07, 0x6a, 0xe0,
0x00, 0x80, 0x03, 0x76, 0xc0, 0x01, 0x80, 0x03, 0x6a, 0xc0, 0x01, 0xc0,
0x01, 0x76, 0x80, 0x03, 0xc0, 0x00, 0x6a, 0x00, 0x03, 0xe0, 0x00, 0x34,
0x00, 0x07, 0x70, 0x00, 0x18, 0x00, 0x0e, 0x70, 0x00, 0x00, 0x00, 0x0e,
0x38, 0x00, 0x3c, 0x00, 0x1c, 0x1c, 0x00, 0x76, 0x00, 0x38, 0x1c, 0x00,
0x6a, 0x00, 0x38, 0x0e, 0x00, 0x76, 0x00, 0x70, 0x0e, 0x00, 0x3c, 0x00,
0x70, 0x1e, 0x00, 0x00, 0x00, 0x78, 0xfe, 0xff, 0xff, 0xff, 0x7f, 0xfc,
0xff, 0xff, 0xff, 0x3f};

13
bitmap/FlipHoriz Normal file
View File

@ -0,0 +1,13 @@
#define FlipHoriz_width 30
#define FlipHoriz_height 30
static char FlipHoriz_bits[] = {
0x00, 0x80, 0x07, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x80, 0x1d, 0x00,
0x00, 0x80, 0x3b, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0xee, 0x00,
0x00, 0x00, 0xdc, 0x01, 0xc0, 0xff, 0xbf, 0x03, 0xe0, 0xff, 0x5f, 0x07,
0xb0, 0xaa, 0xaa, 0x0e, 0x58, 0x55, 0x55, 0x1d, 0xac, 0xaa, 0xaa, 0x0e,
0xfe, 0xff, 0x5f, 0x07, 0xff, 0xff, 0xbf, 0x03, 0x6b, 0x00, 0xdc, 0x01,
0x77, 0x00, 0xee, 0x00, 0x6b, 0x00, 0x77, 0x00, 0x77, 0x80, 0x3b, 0x00,
0x6b, 0x80, 0x1d, 0x00, 0x77, 0x80, 0x0f, 0x00, 0x6b, 0x80, 0x07, 0x00,
0xff, 0x1f, 0x00, 0x00, 0xfe, 0x0f, 0x00, 0x00, 0xac, 0x06, 0x00, 0x00,
0x58, 0x03, 0x00, 0x00, 0xb0, 0x06, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00,
0xc0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

13
bitmap/FlipVert Normal file
View File

@ -0,0 +1,13 @@
#define FlipVert_width 30
#define FlipVert_height 30
static char FlipVert_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00,
0x00, 0x1f, 0x00, 0x00, 0x80, 0x3b, 0x00, 0x00, 0xc0, 0x75, 0x00, 0x00,
0xe0, 0xea, 0x00, 0x00, 0x70, 0xd5, 0x01, 0x00, 0xb8, 0xaa, 0x03, 0x00,
0xdc, 0x75, 0x07, 0x00, 0xee, 0xfb, 0x0e, 0x00, 0xf7, 0xf5, 0x1d, 0x00,
0xbb, 0xbb, 0x1b, 0x00, 0x9f, 0x35, 0x1f, 0x00, 0x8f, 0x3b, 0x1e, 0x00,
0x80, 0x35, 0x00, 0x00, 0x80, 0x3b, 0x00, 0x00, 0x80, 0x35, 0x20, 0x08,
0x80, 0x3b, 0x60, 0x0c, 0x80, 0x35, 0xe0, 0x0e, 0x80, 0x3b, 0xe0, 0x0f,
0x80, 0x35, 0x60, 0x0d, 0x80, 0x3b, 0xe0, 0x0e, 0x80, 0xf5, 0x7f, 0x0d,
0x00, 0xfb, 0xff, 0x06, 0x00, 0xb6, 0x6a, 0x03, 0x00, 0x7c, 0xf5, 0x01,
0x00, 0xb8, 0xea, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0xe0, 0x3f, 0x00};

13
bitmap/Fold Normal file
View File

@ -0,0 +1,13 @@
#define Fold_width 30
#define Fold_height 30
static char Fold_bits[] = {
0xff, 0x3f, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0x57, 0xf5, 0xab, 0x3a,
0xab, 0xff, 0x7f, 0x35, 0xd7, 0x3f, 0xff, 0x3a, 0xab, 0x03, 0x70, 0x35,
0x57, 0x07, 0xb8, 0x3a, 0xbb, 0x0e, 0x5c, 0x37, 0x7f, 0x1d, 0xae, 0x3f,
0xfb, 0x3a, 0xd7, 0x37, 0xdf, 0xf5, 0xeb, 0x3e, 0x9b, 0xeb, 0x75, 0x36,
0x1f, 0xd7, 0x3a, 0x3e, 0x1f, 0xae, 0x1d, 0x3e, 0x0e, 0xfc, 0x0e, 0x1c,
0x0e, 0xdc, 0x0f, 0x1c, 0x1f, 0x6e, 0x1d, 0x3e, 0x1f, 0xd7, 0x3a, 0x3e,
0x9b, 0xeb, 0x75, 0x36, 0xdf, 0xf5, 0xeb, 0x3e, 0xfb, 0x3a, 0xd7, 0x37,
0x7f, 0x1d, 0xae, 0x3f, 0xbb, 0x0e, 0x5c, 0x37, 0x57, 0x07, 0xb8, 0x3a,
0xab, 0x03, 0x70, 0x35, 0xd7, 0x3f, 0xff, 0x3a, 0xab, 0xff, 0x7f, 0x35,
0x57, 0xf5, 0xab, 0x3a, 0xff, 0xff, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f};

1575
bitmap/Graphics.c Normal file

File diff suppressed because it is too large Load Diff

678
bitmap/Handlers.c Normal file
View File

@ -0,0 +1,678 @@
/* $Xorg: Handlers.c,v 1.4 2001/02/09 02:05:28 xorgcvs Exp $ */
/*
Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall
not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from The Open Group.
*/
/* $XFree86: Handlers.c,v 1.4 2001/12/14 20:00:41 dawes Exp $ */
/*
* Author: Davor Matic, MIT X Consortium
*/
#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>
#include "BitmapP.h"
#include <stdio.h>
#include <math.h>
#define min(x, y) (((int)(x) < (int)(y)) ? (x) : (y))
#define max(x, y) (((int)(x) > (int)(y)) ? (x) : (y))
#include "Requests.h"
extern Boolean DEBUG;
/*****************************************************************************
* Handlers *
*****************************************************************************/
#define QueryInSquare(BW, x, y, square_x, square_y)\
((InBitmapX(BW, x) == (square_x)) &&\
(InBitmapY(BW, y) == (square_y)))
static void
DragOnePointHandler(Widget w,
XtPointer client_data,
XEvent *event,
Boolean *cont) /* ARGSUSED */
{
BWStatus *status = (BWStatus *)client_data;
BitmapWidget BW = (BitmapWidget) w;
if (DEBUG)
fprintf(stderr, "D1PH ");
switch (event->type) {
case ButtonPress:
if (event->xbutton.state != status->state) return;
if (!QuerySet(status->at_x, status->at_y)) {
BWStoreToBuffer(w);
status->value = Value(BW, event->xbutton.button);
status->btime = event->xbutton.time;
status->at_x = InBitmapX(BW, event->xbutton.x);
status->at_y = InBitmapY(BW, event->xbutton.y);
status->success = status->draw ? True : False;
if (status->draw)
(*(DrawOnePointProc)status->draw)(w,
status->at_x, status->at_y, status->value);
}
break;
case ButtonRelease:
if (QuerySet(status->at_x, status->at_y)) {
status->value = Value(BW, event->xbutton.button);
status->btime = event->xbutton.time;
status->at_x = InBitmapX(BW, event->xbutton.x);
status->at_y = InBitmapY(BW, event->xbutton.y);
status->success = status->draw ? True : False;
/* SUPPRESS 701 */
BWTerminateRequest(w, TRUE);
}
break;
case MotionNotify:
if (QuerySet(status->at_x, status->at_y)) {
if (!QueryInSquare(BW, event->xmotion.x, event->xmotion.y,
status->at_x, status->at_y)) {
status->at_x = InBitmapX(BW, event->xmotion.x);
status->at_y = InBitmapY(BW, event->xmotion.y);
if (status->draw)
(*(DrawOnePointProc)status->draw)(w,
status->at_x, status->at_y, status->value);
}
}
break;
}
}
void
DragOnePointEngage(Widget w,
BWStatus *status,
XtPointer draw,
int *state)
{
status->at_x = NotSet;
status->at_y = NotSet;
status->draw = draw;
status->success = False;
status->state = *state;
XtAddEventHandler(w,
ButtonPressMask | ButtonReleaseMask | PointerMotionMask,
FALSE, DragOnePointHandler, (XtPointer)status);
}
/* ARGSUSED */
void
DragOnePointTerminate(Widget w,
BWStatus *status,
XtPointer draw)
{
if (status->success) {
BWChangeNotify(w);
BWSetChanged(w);
}
XtRemoveEventHandler(w,
ButtonPressMask | ButtonReleaseMask | PointerMotionMask,
FALSE, DragOnePointHandler, (XtPointer)status);
}
void
OnePointHandler(Widget w,
XtPointer client_data,
XEvent *event,
Boolean *cont) /* ARGSUSED */
{
BWStatus *status = (BWStatus *)client_data;
BitmapWidget BW = (BitmapWidget) w;
if (DEBUG)
fprintf(stderr, "1PH ");
switch (event->type) {
case Expose:
if (QuerySet(status->at_x, status->at_y)) {
BWClip(w, event->xexpose.x, event->xexpose.y,
event->xexpose.width, event->xexpose.height);
if (status->draw)
(*(DrawOnePointProc)status->draw)(w,
status->at_x, status->at_y, Highlight);
BWUnclip(w);
}
break;
case ButtonPress:
if (event->xbutton.state != status->state) return;
if (!QuerySet(status->at_x, status->at_y)) {
status->value = Value(BW, event->xbutton.button);
status->btime = event->xbutton.time;
status->at_x = InBitmapX(BW, event->xbutton.x);
status->at_y = InBitmapY(BW, event->xbutton.y);
if (status->draw)
(*(DrawOnePointProc)status->draw)(w,
status->at_x, status->at_y, Highlight);
}
break;
case ButtonRelease:
if (QuerySet(status->at_x, status->at_y)) {
if (status->draw)
(*(DrawOnePointProc)status->draw)(w,
status->at_x, status->at_y, Highlight);
status->value = Value(BW, event->xbutton.button);
status->btime = event->xbutton.time;
status->at_x = InBitmapX(BW, event->xbutton.x);
status->at_y = InBitmapY(BW, event->xbutton.y);
status->success = True;
BWTerminateRequest(w, TRUE);
}
break;
case MotionNotify:
if (QuerySet(status->at_x, status->at_y)) {
if (!QueryInSquare(BW, event->xmotion.x, event->xmotion.y,
status->at_x, status->at_y)) {
if (status->draw)
(*(DrawOnePointProc)status->draw)(w,
status->at_x, status->at_y, Highlight);
status->at_x = InBitmapX(BW, event->xmotion.x);
status->at_y = InBitmapY(BW, event->xmotion.y);
if (status->draw)
(*(DrawOnePointProc)status->draw)(w,
status->at_x, status->at_y, Highlight);
}
}
break;
}
}
void
OnePointEngage(Widget w,
BWStatus *status,
XtPointer draw,
int *state)
{
status->at_x = NotSet;
status->at_y = NotSet;
status->draw = draw;
status->success = False;
status->state = *state;
XtAddEventHandler(w,
ButtonPressMask | ButtonReleaseMask |
ExposureMask | PointerMotionMask,
FALSE, OnePointHandler, (XtPointer)status);
}
#if 0
void
OnePointImmediateEngage(Widget w,
BWStatus *status,
XtPointer draw,
int *state)
{
status->at_x = 0;
status->at_y = 0;
status->draw = draw;
status->success = False;
status->state = *state;
if (status->draw)
(*(DrawOnePointProc)status->draw)(w,
status->at_x, status->at_y, Highlight);
XtAddEventHandler(w,
ButtonPressMask | ButtonReleaseMask |
ExposureMask | PointerMotionMask,
FALSE, OnePointHandler, (XtPointer)status);
}
#endif
void
OnePointTerminate(Widget w,
BWStatus *status,
XtPointer draw)
{
if (status->success && draw) {
BWStoreToBuffer(w);
(*(DrawOnePointProc)draw)(w,
status->at_x, status->at_y,
status->value);
BWChangeNotify(w);
BWSetChanged(w);
}
else
if (QuerySet(status->at_x, status->at_y))
if (status->draw)
(*(DrawOnePointProc)status->draw)(w,
status->at_x, status->at_y, Highlight);
XtRemoveEventHandler(w,
ButtonPressMask | ButtonReleaseMask |
ExposureMask | PointerMotionMask,
FALSE, OnePointHandler, (XtPointer)status);
}
void
OnePointTerminateTransparent(Widget w,
BWStatus *status,
XtPointer draw)
{
if (status->success && draw)
(*(DrawOnePointProc)draw)(w,
status->at_x, status->at_y,
status->value);
else
if (QuerySet(status->at_x, status->at_y))
if (status->draw)
(*(DrawOnePointProc)status->draw)(w,
status->at_x, status->at_y, Highlight);
XtRemoveEventHandler(w,
ButtonPressMask | ButtonReleaseMask |
ExposureMask | PointerMotionMask,
FALSE, OnePointHandler, (XtPointer)status);
}
void
TwoPointsHandler(Widget w,
XtPointer client_data,
XEvent *event,
Boolean *cont) /* ARGSUSED */
{
BitmapWidget BW = (BitmapWidget) w;
BWStatus *status = (BWStatus *)client_data;
if (DEBUG)
fprintf(stderr, "2PH ");
switch (event->type) {
case Expose:
if (QuerySet(status->from_x, status->from_y) &&
QuerySet(status->to_x, status->to_y)) {
BWClip(w, event->xexpose.x, event->xexpose.y,
event->xexpose.width, event->xexpose.height);
if (status->draw)
(*(DrawTwoPointProc)status->draw)(w,
status->from_x, status->from_y,
status->to_x, status->to_y, Highlight);
BWUnclip(w);
}
break;
case ButtonPress:
if (event->xbutton.state != status->state) return;
if (!QuerySet(status->from_x, status->from_y)) {
status->value = Value(BW, event->xbutton.button);
status->btime = event->xbutton.time;
status->from_x = InBitmapX(BW, event->xbutton.x);
status->from_y = InBitmapY(BW, event->xbutton.y);
status->to_x = InBitmapX(BW, event->xbutton.x);
status->to_y = InBitmapY(BW, event->xbutton.y);
if (status->draw)
(*(DrawTwoPointProc)status->draw)(w,
status->from_x, status->from_y,
status->to_x, status->to_y, Highlight);
}
break;
case ButtonRelease:
if (QuerySet(status->from_x, status->from_y)) {
if (status->draw)
(*(DrawTwoPointProc)status->draw)(w,
status->from_x, status->from_y,
status->to_x, status->to_y, Highlight);
status->value = Value(BW, event->xbutton.button);
status->btime = event->xbutton.time;
status->to_x = InBitmapX(BW, event->xbutton.x);
status->to_y = InBitmapY(BW, event->xbutton.y);
status->success = True;
BWTerminateRequest(w, TRUE);
}
break;
case MotionNotify:
if (QuerySet(status->from_x, status->from_y)) {
if (QuerySet(status->to_x, status->to_y)) {
if (!QueryInSquare(BW, event->xmotion.x, event->xmotion.y,
status->to_x, status->to_y)) {
if (status->draw)
(*(DrawTwoPointProc)status->draw)(w,
status->from_x, status->from_y,
status->to_x, status->to_y, Highlight);
status->to_x = InBitmapX(BW, event->xmotion.x);
status->to_y = InBitmapY(BW, event->xmotion.y);
if (status->draw)
(*(DrawTwoPointProc)status->draw)(w,
status->from_x, status->from_y,
status->to_x, status->to_y, Highlight);
}
}
else {
status->to_x = InBitmapX(BW, event->xmotion.x);
status->to_y = InBitmapY(BW, event->xmotion.y);
if (status->draw)
(*(DrawTwoPointProc)status->draw)(w,
status->from_x, status->from_y,
status->to_x, status->to_y, Highlight);
}
}
break;
}
}
void
TwoPointsEngage(Widget w,
BWStatus *status,
XtPointer draw,
int *state)
{
status->from_x = NotSet;
status->from_y = NotSet;
status->to_x = NotSet;
status->to_y = NotSet;
status->draw = draw;
status->success = False;
status->state = *state;
XtAddEventHandler(w,
ButtonPressMask | ButtonReleaseMask |
ExposureMask | PointerMotionMask,
FALSE, TwoPointsHandler, (XtPointer)status);
}
void
TwoPointsTerminate(Widget w,
BWStatus *status,
XtPointer draw)
{
if (status->success && draw) {
BWStoreToBuffer(w);
(*(DrawTwoPointProc)draw)(w,
status->from_x, status->from_y,
status->to_x, status->to_y,
status->value);
BWChangeNotify(w);
BWSetChanged(w);
}
else
if (QuerySet(status->from_x, status->from_y) &&
QuerySet(status->to_x, status->to_y))
if (status->draw)
(*(DrawTwoPointProc)status->draw)(w,
status->from_x, status->from_y,
status->to_x, status->to_y, Highlight);
XtRemoveEventHandler(w,
ButtonPressMask | ButtonReleaseMask |
ExposureMask | PointerMotionMask,
FALSE, TwoPointsHandler, (XtPointer)status);
}
void
TwoPointsTerminateTransparent(Widget w,
BWStatus *status,
XtPointer draw)
{
if (status->success && draw)
(*(DrawTwoPointProc)draw)(w,
status->from_x, status->from_y,
status->to_x, status->to_y,
status->value);
else
if (QuerySet(status->from_x, status->from_y) &&
QuerySet(status->to_x, status->to_y))
if (status->draw)
(*(DrawTwoPointProc)status->draw)(w,
status->from_x, status->from_y,
status->to_x, status->to_y, Highlight);
XtRemoveEventHandler(w,
ButtonPressMask | ButtonReleaseMask |
ExposureMask | PointerMotionMask,
FALSE, TwoPointsHandler, (XtPointer)status);
}
void
TwoPointsTerminateTimed(Widget w,
BWStatus *status,
XtPointer draw)
{
if (status->success && draw)
(*(DrawTwoPointProc)draw)(w,
status->from_x, status->from_y,
status->to_x, status->to_y,
status->btime);
else
if (QuerySet(status->from_x, status->from_y) &&
QuerySet(status->to_x, status->to_y))
if (status->draw)
(*(DrawTwoPointProc)status->draw)(w,
status->from_x, status->from_y,
status->to_x, status->to_y, Highlight);
XtRemoveEventHandler(w,
ButtonPressMask | ButtonReleaseMask |
ExposureMask | PointerMotionMask,
FALSE, TwoPointsHandler, (XtPointer)status);
}
/* ARGSUSED */
void
Interface(Widget w,
BWStatus *status,
XtPointer action)
{
(*(InterfaceProc)action)(w);
}
void
Paste(Widget w,
Position at_x,
Position at_y,
int value)
{
BitmapWidget BW = (BitmapWidget) w;
BWStatus *my_status;
BWRequest request;
my_status = (BWStatus *)
BW->bitmap.request_stack[BW->bitmap.current].status;
my_status->draw = NULL;
request = (BWRequest)
BW->bitmap.request_stack[BW->bitmap.current].request->terminate_client_data;
BWTerminateRequest(w, FALSE);
if ((at_x == max(BW->bitmap.mark.from_x, min(at_x, BW->bitmap.mark.to_x)))
&&
(at_y == max(BW->bitmap.mark.from_y, min(at_y, BW->bitmap.mark.to_y)))) {
BWStatus *status;
if (DEBUG)
fprintf(stderr, "Prepaste request: %s\n", request);
BWEngageRequest(w, request, False, (char *)&(my_status->state), sizeof(int));
status = (BWStatus *)
BW->bitmap.request_stack[BW->bitmap.current].status;
status->at_x = at_x;
status->at_y = at_y;
status->value = value;
(*(DrawOnePointProc)status->draw) (w, at_x, at_y, Highlight);
}
else {
BWStatus *status;
BWEngageRequest(w, MarkRequest, False, (char *)&(my_status->state), sizeof(int));
status = (BWStatus *)
BW->bitmap.request_stack[BW->bitmap.current].status;
status->from_x = status->to_x = at_x;
status->from_y = status->to_y = at_y;
status->value = value;
(*(DrawTwoPointProc)status->draw) (w, at_x, at_y, at_x, at_y, Highlight);
}
}
void
DragTwoPointsHandler(Widget w,
XtPointer client_data,
XEvent *event,
Boolean *cont) /* ARGSUSED */
{
BitmapWidget BW = (BitmapWidget) w;
BWStatus *status = (BWStatus *)client_data;
if (DEBUG)
fprintf(stderr, "D2PH ");
switch (event->type) {
case ButtonPress:
if (event->xbutton.state != status->state) return;
if (!QuerySet(status->from_x, status->from_y)) {
BWStoreToBuffer(w);
status->value = Value(BW, event->xbutton.button);
status->btime = event->xbutton.time;
status->from_x = InBitmapX(BW, event->xbutton.x);
status->from_y = InBitmapY(BW, event->xbutton.y);
status->to_x = InBitmapX(BW, event->xbutton.x);
status->to_y = InBitmapY(BW, event->xbutton.y);
status->success = status->draw ? True : False;
if (status->draw)
(*(DrawTwoPointProc)status->draw)(w,
status->from_x, status->from_y,
status->to_x, status->to_y, status->value);
}
break;
case ButtonRelease:
if (QuerySet(status->from_x, status->from_y)) {
status->value = Value(BW, event->xbutton.button);
status->btime = event->xbutton.time;
status->from_x = status->to_x;
status->from_y = status->to_y;
status->to_x = InBitmapX(BW, event->xbutton.x);
status->to_y = InBitmapY(BW, event->xbutton.y);
status->success = True;
BWTerminateRequest(w, TRUE);
}
break;
case MotionNotify:
if (QuerySet(status->from_x, status->from_y)) {
if (QuerySet(status->to_x, status->to_y)) {
if (!QueryInSquare(BW, event->xmotion.x, event->xmotion.y,
status->to_x, status->to_y)) {
status->from_x = status->to_x;
status->from_y = status->to_y;
status->to_x = InBitmapX(BW, event->xmotion.x);
status->to_y = InBitmapY(BW, event->xmotion.y);
if (status->draw)
(*(DrawTwoPointProc)status->draw)(w,
status->from_x, status->from_y,
status->to_x, status->to_y, status->value);
}
}
}
break;
}
}
void
DragTwoPointsEngage(Widget w,
BWStatus *status,
XtPointer draw,
int *state)
{
status->from_x = NotSet;
status->from_y = NotSet;
status->to_x = NotSet;
status->to_y = NotSet;
status->draw = draw;
status->success = False;
status->state = *state;
XtAddEventHandler(w,
ButtonPressMask | ButtonReleaseMask | PointerMotionMask,
FALSE, DragTwoPointsHandler, (XtPointer)status);
}
void
DragTwoPointsTerminate(Widget w,
BWStatus *status,
XtPointer draw)
{
if (status->success && draw) {
if ((status->from_x != status->to_x)
||
(status->from_y != status->to_y))
(*(DrawTwoPointProc)draw)(w,
status->from_x, status->from_y,
status->to_x, status->to_y,
status->value);
BWChangeNotify(w);
BWSetChanged(w);
}
XtRemoveEventHandler(w,
ButtonPressMask | ButtonReleaseMask | PointerMotionMask,
FALSE, DragTwoPointsHandler, (XtPointer)status);
}
/*****************************************************************************/

0
bitmap/INSTALL Normal file
View File

13
bitmap/Left Normal file
View File

@ -0,0 +1,13 @@
#define Left_width 30
#define Left_height 30
static char Left_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00,
0x00, 0x37, 0x00, 0x00, 0x80, 0x3b, 0x00, 0x00, 0xc0, 0x1d, 0x00, 0x00,
0xe0, 0x0e, 0x00, 0x00, 0x70, 0x07, 0x00, 0x00, 0xb8, 0xff, 0xff, 0x1f,
0x5c, 0xff, 0xff, 0x0f, 0xae, 0xaa, 0xaa, 0x06, 0x57, 0x55, 0x55, 0x03,
0xae, 0xaa, 0xaa, 0x06, 0x5c, 0xff, 0xff, 0x0f, 0xb8, 0xff, 0xff, 0x1f,
0x70, 0x07, 0x00, 0x00, 0xe0, 0x0e, 0x00, 0x00, 0xc0, 0x1d, 0x00, 0x00,
0x80, 0x3b, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00,
0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

0
bitmap/NEWS Normal file
View File

0
bitmap/README Normal file
View File

263
bitmap/ReqMach.c Normal file
View File

@ -0,0 +1,263 @@
/* $Xorg: ReqMach.c,v 1.4 2001/02/09 02:05:28 xorgcvs Exp $ */
/*
Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall
not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from The Open Group.
*/
/* $XFree86: ReqMach.c,v 1.4 2001/12/14 20:00:41 dawes Exp $ */
/*
* Author: Davor Matic, MIT X Consortium
*/
#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>
#include <X11/Xfuncs.h>
#include <X11/Xos.h>
#include "BitmapP.h"
#include <stdio.h>
#include <math.h>
extern Boolean DEBUG;
/*****************************************************************************\
* Request Machine: stacks up and handles requests from application calls. *
\*****************************************************************************/
/*
* Searches for a request record of a request specified by its name.
* Returns a pointer to the record or NULL if the request was not found.
*/
static BWRequestRec *
FindRequest(BWRequest name)
{
int i;
for (i = 0; i < bitmapClassRec.bitmap_class.num_requests; i++)
if (!strcmp(name, bitmapClassRec.bitmap_class.requests[i].name))
return &bitmapClassRec.bitmap_class.requests[i];
return NULL;
}
/*
* Adds a request to the request stack and does proper initializations.
* Returns TRUE if the request was found and FALSE otherwise.
*/
Boolean
BWAddRequest(Widget w, BWRequest name, Boolean trap,
XtPointer call_data, Cardinal call_data_size)
{
BitmapWidget BW = (BitmapWidget) w;
BWRequestRec *request;
request = FindRequest(name);
if(request) {
if (DEBUG)
fprintf(stderr, "Adding... Cardinal: %d\n", BW->bitmap.cardinal + 1);
BW->bitmap.request_stack = (BWRequestStack *)
XtRealloc((char *)BW->bitmap.request_stack,
(++BW->bitmap.cardinal + 1) * sizeof(BWRequestStack));
BW->bitmap.request_stack[BW->bitmap.cardinal].request = request;
BW->bitmap.request_stack[BW->bitmap.cardinal].status =
XtMalloc(request->status_size);
BW->bitmap.request_stack[BW->bitmap.cardinal].trap = trap;
BW->bitmap.request_stack[BW->bitmap.cardinal].call_data =
XtMalloc(call_data_size);
memmove( BW->bitmap.request_stack[BW->bitmap.cardinal].call_data,
call_data,
call_data_size);
return True;
}
else {
XtWarning("bad request name. BitmapWidget");
return False;
}
}
/*
* Engages the request designated by the current parameter.
* Returnes TRUE if the request has an engage function and FALSE otherwise.
*/
static Boolean
Engage(BitmapWidget BW, Cardinal current)
{
BW->bitmap.current = current;
if (DEBUG)
fprintf(stderr, "Request: %s\n",
BW->bitmap.request_stack[current].request->name);
if (BW->bitmap.request_stack[current].request->engage) {
(*BW->bitmap.request_stack[current].request->engage)
((Widget) BW,
BW->bitmap.request_stack[current].status,
BW->bitmap.request_stack[current].request->engage_client_data,
BW->bitmap.request_stack[current].call_data);
return True;
}
else
return False;
}
/* Boolean BWTerminateRequest();
Boolean BWRemoveRequest(); */
/*
* Scans down the request stack removing all requests untill it finds
* one to be trapped.
*/
static void
TrappingLoop(BitmapWidget BW)
{
if (DEBUG)
fprintf(stderr, "Scanning... Current: %d\n", BW->bitmap.current);
if ((BW->bitmap.current > 0)
&&
(!BW->bitmap.request_stack[BW->bitmap.current--].trap)) {
BWRemoveRequest((Widget) BW);
TrappingLoop(BW);
}
else
if (BW->bitmap.cardinal > 0) {
if (DEBUG)
fprintf(stderr, "Trapping... Current: %d\n", BW->bitmap.current+1);
if(!Engage(BW, ++BW->bitmap.current))
BWTerminateRequest((Widget) BW, True);
}
}
/*
* Terimantes the current request and continues with next request if con = TRUE
* Returnes TRUE if there is any number of requests left on the stack.
*/
Boolean
BWTerminateRequest(Widget w, Boolean cont)
{
BitmapWidget BW = (BitmapWidget) w;
if (BW->bitmap.current > 0) {
if (DEBUG)
fprintf(stderr, "Terminating... Current: %d\n", BW->bitmap.current);
if (BW->bitmap.request_stack[BW->bitmap.current].request->terminate)
(*BW->bitmap.request_stack[BW->bitmap.current].request->terminate)
(w,
BW->bitmap.request_stack[BW->bitmap.current].status,
BW->bitmap.request_stack[BW->bitmap.current].request->terminate_client_data);
if (cont) {
if (BW->bitmap.current == BW->bitmap.cardinal)
TrappingLoop(BW);
else {
if (DEBUG)
fprintf(stderr, "Continuing... Current: %d\n", BW->bitmap.current+1);
if (!Engage(BW, ++BW->bitmap.current))
BWTerminateRequest(w, True);
}
}
else
BW->bitmap.current = 0;
}
return BW->bitmap.current;
}
/*
* Simple interface to BWTerminateRequest that takes only a widget.
*/
void
BWAbort(Widget w)
{
BWTerminateRequest(w, True);
}
/*
* Removes the top request from the request stack. If the request is active
* it will terminate it.
* Returns TRUE if the number of requests left on the stack != 0.
*/
Boolean
BWRemoveRequest(Widget w)
{
BitmapWidget BW = (BitmapWidget) w;
if (BW->bitmap.cardinal > 0) {
if (DEBUG)
fprintf(stderr, "Removing... Cardinal: %d\n", BW->bitmap.cardinal);
if (BW->bitmap.current == BW->bitmap.cardinal)
BWTerminateRequest(w, False);
if (BW->bitmap.request_stack[BW->bitmap.cardinal].request->remove)
(*BW->bitmap.request_stack[BW->bitmap.cardinal].request->remove)
(w,
BW->bitmap.request_stack[BW->bitmap.cardinal].status,
BW->bitmap.request_stack[BW->bitmap.cardinal].request->remove_client_data);
XtFree(BW->bitmap.request_stack[BW->bitmap.cardinal].status);
XtFree(BW->bitmap.request_stack[BW->bitmap.cardinal].call_data);
BW->bitmap.request_stack = (BWRequestStack *)
XtRealloc((char *)BW->bitmap.request_stack,
(--BW->bitmap.cardinal + 1) * sizeof(BWRequestStack));
return True;
}
else
return False;
}
void
BWRemoveAllRequests(Widget w)
{
while (BWRemoveRequest(w)) {/* removes all requests from the stack */}
}
/*
* Adds the request to the stack and performs engaging ritual.
* Returns TRUE if the request was found, FALSE otherwise.
*/
Boolean
BWEngageRequest(Widget w, BWRequest name, Boolean trap,
XtPointer call_data, Cardinal call_data_size)
{
BitmapWidget BW = (BitmapWidget) w;
if (BWAddRequest(w, name, trap, call_data, call_data_size)) {
BWTerminateRequest(w, False);
if (DEBUG)
fprintf(stderr, "Engaging... Cardinal: %d\n", BW->bitmap.cardinal);
if (!Engage(BW, BW->bitmap.cardinal))
BWTerminateRequest(w, True);
return True;
}
else
return False;
}
/************************* End of the Request Machine ************************/

87
bitmap/Requests.h Normal file
View File

@ -0,0 +1,87 @@
/* $Xorg: Requests.h,v 1.4 2001/02/09 02:05:28 xorgcvs Exp $ */
/*
Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall
not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from The Open Group.
*/
/* $XFree86: xc/programs/bitmap/Requests.h,v 1.4 2001/01/17 23:44:51 dawes Exp $ */
/*
* Author: Davor Matic, MIT X Consortium
*/
#ifndef _Requests_h
#define _Requests_h
typedef int (*DrawOnePointProc)(Widget, Position, Position, int);
typedef int (*DrawTwoPointProc)(Widget, Position, Position,
Position, Position, int);
typedef int (*InterfaceProc)(Widget);
typedef struct {
Boolean success;
Position at_x, at_y;
Position from_x, from_y,
to_x, to_y;
XtPointer draw;
int value;
Time btime;
int state;
} BWStatus;
extern void OnePointEngage ( Widget w, BWStatus *status, XtPointer draw, int *state );
extern void OnePointTerminate ( Widget w, BWStatus *status, XtPointer draw );
extern void OnePointTerminateTransparent ( Widget w, BWStatus *status, XtPointer draw );
extern void DragOnePointEngage ( Widget w, BWStatus *status, XtPointer draw, int *state );
extern void DragOnePointTerminate ( Widget w, BWStatus *status, XtPointer client_data );
extern void TwoPointsEngage ( Widget w, BWStatus *status, XtPointer draw, int *state );
extern void TwoPointsTerminate ( Widget w, BWStatus *status, XtPointer draw );
extern void TwoPointsTerminateTransparent ( Widget w, BWStatus *status, XtPointer draw );
extern void TwoPointsTerminateTimed ( Widget w, BWStatus *status, XtPointer draw );
extern void DragTwoPointsEngage ( Widget w, BWStatus *status, XtPointer draw, int *state );
extern void DragTwoPointsTerminate ( Widget w, BWStatus *status, XtPointer draw );
extern void Interface ( Widget w, BWStatus *status, XtPointer action );
extern void Paste ( Widget w, Position at_x, Position at_y, int value );
extern void BWDragMarked(Widget w, Position at_x, Position at_y);
extern void BWDragStored(Widget w, Position at_x, Position at_y);
extern void BWCopy(Widget w, Position at_x, Position at_y, int value);
extern void BWMove(Widget w, Position at_x, Position at_y, int value);
extern void BWRestore(Widget w, Position at_x, Position at_y, int value);
extern void BWDrawPoint(Widget w, Position x, Position y, bit value);
extern void BWBlindLine(Widget w, Position from_x, Position from_y,
Position to_x, Position to_y, int value);
extern void BWDrawHotSpot(Widget w, Position x, Position y, int value);
extern void BWZoomIn(Widget w, Position from_x, Position from_y,
Position to_x, Position to_y);
extern void OnePointHandler(Widget w, XtPointer client_data,
XEvent *event, Boolean *cont);
extern void TwoPointsHandler(Widget w, XtPointer client_data,
XEvent *event, Boolean *cont);
extern void DragTwoPointsHandler(Widget w, XtPointer client_data,
XEvent *event, Boolean *cont);
#endif /* _Requests_h */

13
bitmap/Right Normal file
View File

@ -0,0 +1,13 @@
#define Right_width 30
#define Right_height 30
static char Right_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00,
0x00, 0x80, 0x0f, 0x00, 0x00, 0x80, 0x1d, 0x00, 0x00, 0x80, 0x3b, 0x00,
0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0xee, 0x00, 0x00, 0x00, 0xdc, 0x01,
0xff, 0xff, 0xbf, 0x03, 0xfe, 0xff, 0x5f, 0x07, 0xac, 0xaa, 0xaa, 0x0e,
0x58, 0x55, 0x55, 0x1d, 0xac, 0xaa, 0xaa, 0x0e, 0xfe, 0xff, 0x5f, 0x07,
0xff, 0xff, 0xbf, 0x03, 0x00, 0x00, 0xdc, 0x01, 0x00, 0x00, 0xee, 0x00,
0x00, 0x00, 0x77, 0x00, 0x00, 0x80, 0x3b, 0x00, 0x00, 0x80, 0x1d, 0x00,
0x00, 0x80, 0x0f, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

13
bitmap/RotateLeft Normal file
View File

@ -0,0 +1,13 @@
#define RotateLeft_width 30
#define RotateLeft_height 30
static char RotateLeft_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00,
0x00, 0x6e, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x80, 0x3b, 0x00, 0x00,
0xc0, 0x1d, 0x00, 0x00, 0xe0, 0x0e, 0x00, 0x00, 0x70, 0xff, 0x0f, 0x00,
0xb8, 0xfe, 0x1f, 0x00, 0x5c, 0x55, 0x35, 0x00, 0xae, 0xaa, 0x6a, 0x00,
0x5c, 0x55, 0xd5, 0x00, 0xb8, 0xfe, 0xff, 0x01, 0x70, 0xff, 0xff, 0x03,
0xe0, 0x0e, 0x58, 0x03, 0xc0, 0x1d, 0xb8, 0x03, 0x80, 0x3b, 0x58, 0x03,
0x00, 0x77, 0xb8, 0x03, 0x00, 0x6e, 0x58, 0x03, 0x00, 0x7c, 0xb8, 0x03,
0x00, 0x78, 0x58, 0x03, 0x00, 0x00, 0xb8, 0x03, 0x00, 0x00, 0x58, 0x03,
0x00, 0x00, 0xf8, 0x03, 0x00, 0x00, 0xb8, 0x03, 0x00, 0x00, 0x18, 0x03,
0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

13
bitmap/RotateRight Normal file
View File

@ -0,0 +1,13 @@
#define RotateRight_width 30
#define RotateRight_height 30
static char RotateRight_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x80, 0x0f, 0x00,
0x00, 0x80, 0x1d, 0x00, 0x00, 0x80, 0x3b, 0x00, 0x00, 0x00, 0x77, 0x00,
0x00, 0x00, 0xee, 0x00, 0x00, 0x00, 0xdc, 0x01, 0x00, 0xfc, 0xbf, 0x03,
0x00, 0xfe, 0x5f, 0x07, 0x00, 0xab, 0xaa, 0x0e, 0x80, 0x55, 0x55, 0x1d,
0xc0, 0xaa, 0xaa, 0x0e, 0xe0, 0xff, 0x5f, 0x07, 0xf0, 0xff, 0xbf, 0x03,
0xb0, 0x06, 0xdc, 0x01, 0x70, 0x07, 0xee, 0x00, 0xb0, 0x06, 0x77, 0x00,
0x70, 0x87, 0x3b, 0x00, 0xb0, 0x86, 0x1d, 0x00, 0x70, 0x87, 0x0f, 0x00,
0xb0, 0x86, 0x07, 0x00, 0x70, 0x07, 0x00, 0x00, 0xb0, 0x06, 0x00, 0x00,
0xf0, 0x07, 0x00, 0x00, 0x70, 0x07, 0x00, 0x00, 0x30, 0x06, 0x00, 0x00,
0x10, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

4
bitmap/Stipple Normal file
View File

@ -0,0 +1,4 @@
#define Stipple_width 2
#define Stipple_height 2
static char Stipple_bits[] = {
0x01, 0x00};

14
bitmap/Term Normal file
View File

@ -0,0 +1,14 @@
#define Term_width 32
#define Term_height 32
static char Term_bits[] = {
0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x1f, 0x04, 0x00, 0x00, 0x20,
0xe4, 0xff, 0xff, 0x27, 0x14, 0x00, 0x00, 0x28, 0x14, 0x80, 0x01, 0x28,
0x14, 0x80, 0x01, 0x28, 0x14, 0x80, 0x01, 0x28, 0x14, 0x80, 0x01, 0x28,
0x14, 0x80, 0x01, 0x28, 0x14, 0x80, 0x01, 0x28, 0x14, 0x80, 0x00, 0x28,
0x14, 0x80, 0x00, 0x28, 0x14, 0x80, 0x00, 0x28, 0x14, 0x80, 0x00, 0x28,
0x14, 0x00, 0x00, 0x28, 0x14, 0x80, 0x00, 0x28, 0x14, 0x00, 0x00, 0x28,
0xe4, 0xff, 0xff, 0x27, 0x04, 0x00, 0x00, 0x20, 0xf8, 0xff, 0xff, 0x1f,
0xfe, 0xff, 0xff, 0x7f, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x40,
0x02, 0x00, 0xc0, 0x5f, 0x02, 0x00, 0x00, 0x40, 0xfa, 0xff, 0xff, 0x5f,
0xae, 0xaa, 0xaa, 0x6a, 0x56, 0x55, 0x55, 0x55, 0xab, 0xaa, 0xaa, 0xea,
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00};

13
bitmap/Up Normal file
View File

@ -0,0 +1,13 @@
#define Up_width 30
#define Up_height 30
static char Up_bits[] = {
0x00, 0x40, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00,
0x00, 0xb8, 0x03, 0x00, 0x00, 0x5c, 0x07, 0x00, 0x00, 0xae, 0x0e, 0x00,
0x00, 0x57, 0x1d, 0x00, 0x80, 0xab, 0x3a, 0x00, 0xc0, 0x5d, 0x77, 0x00,
0xe0, 0xbe, 0xef, 0x00, 0x70, 0x5f, 0xdf, 0x01, 0xb0, 0xbb, 0xbb, 0x01,
0xf0, 0x59, 0xf3, 0x01, 0xf0, 0xb8, 0xe3, 0x01, 0x00, 0x58, 0x03, 0x00,
0x00, 0xb8, 0x03, 0x00, 0x00, 0x58, 0x03, 0x00, 0x00, 0xb8, 0x03, 0x00,
0x00, 0x58, 0x03, 0x00, 0x00, 0xb8, 0x03, 0x00, 0x00, 0x58, 0x03, 0x00,
0x00, 0xb8, 0x03, 0x00, 0x00, 0x58, 0x03, 0x00, 0x00, 0xb8, 0x03, 0x00,
0x00, 0x58, 0x03, 0x00, 0x00, 0xf8, 0x03, 0x00, 0x00, 0xb8, 0x03, 0x00,
0x00, 0x18, 0x03, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00};

296
bitmap/atobm.c Normal file
View File

@ -0,0 +1,296 @@
/* $Xorg: atobm.c,v 1.4 2001/02/09 02:05:28 xorgcvs Exp $ */
/*
Copyright 1988, 1993, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall
not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from The Open Group.
*/
/* $XFree86: xc/programs/bitmap/atobm.c,v 3.4 2001/07/25 15:05:12 dawes Exp $ */
/*
* atobm - ascii to bitmap filter
* Author: Jim Fulton, MIT X Consortium
*/
#include <stdio.h>
#include <ctype.h>
#include <X11/Xos.h>
#include <stdlib.h>
char *ProgramName;
static void doit(FILE *fp, char *filename, char *chars,
int xhot, int yhot, char *name);
static void
usage (void)
{
fprintf (stderr, "usage: %s [-options ...] [filename]\n\n",
ProgramName);
fprintf (stderr,
"where options include:\n");
fprintf (stderr,
" -chars cc chars to use for 0 and 1 bits, respectively\n");
fprintf (stderr,
" -name variable name to use in bitmap file\n");
fprintf (stderr,
" -xhot number x position of hotspot\n");
fprintf (stderr,
" -yhot number y position of hotspot\n");
fprintf (stderr, "\n");
exit (1);
}
static char *
cify_name (char *name)
{
int length = name ? strlen (name) : 0;
int i;
for (i = 0; i < length; i++) { /* strncpy (result, begin, length); */
char c = name[i];
if (!((isascii(c) && isalnum(c)) || c == '_')) name[i] = '_';
}
return name;
}
static char *
StripName(char *name)
{
char *begin = strrchr(name, '/');
char *end, *result;
int length;
begin = (begin ? begin+1 : name);
end = strchr(begin, '.'); /* change to strrchr to allow longer names */
length = (end ? (end - begin) : strlen (begin));
result = (char *) malloc (length + 1);
strncpy (result, begin, length);
result [length] = '\0';
return (result);
}
int
main (int argc, char *argv[])
{
int i;
int xhot = -1, yhot = -1;
char *filename = NULL;
char *chars = "-#";
char *name = NULL;
FILE *fp;
ProgramName = argv[0];
for (i = 1; i < argc; i++) {
char *arg = argv[i];
if (arg[0] == '-') {
switch (arg[1]) {
case '\0':
filename = NULL;
continue;
case 'c':
if (++i >= argc) usage ();
chars = argv[i];
continue;
case 'n':
if (++i >= argc) usage ();
name = argv[i];
continue;
case 'x':
if (++i >= argc) usage ();
xhot = atoi (argv[i]);
continue;
case 'y':
if (++i >= argc) usage ();
yhot = atoi (argv[i]);
continue;
default:
usage ();
}
} else {
filename = arg;
}
}
if (strlen (chars) != 2) {
fprintf (stderr,
"%s: bad character list \"%s\", must have exactly 2 characters\n",
ProgramName, chars);
exit (1);
}
if (filename) {
fp = fopen (filename, "r");
if (!fp) {
fprintf (stderr, "%s: unable to open file \"%s\".\n",
ProgramName, filename);
exit (1);
}
} else {
fp = stdin;
}
if (!name) name = filename ? StripName (filename) : "";
cify_name (name);
doit (fp, filename, chars, xhot, yhot, name);
if (filename) (void) fclose (fp);
exit (0);
}
static void
doit (FILE *fp,
char *filename,
char *chars,
int xhot, int yhot,
char *name)
{
int i, j;
int last_character;
char buf[BUFSIZ];
char *cp, *newline;
int width = 0, height = 0;
int len;
int removespace = (((isascii(chars[0]) && isspace(chars[0])) ||
(isascii(chars[1]) && isspace(chars[1]))) ? 0 : 1);
int lineno = 0;
int bytes_per_scanline = 0;
struct _scan_list {
int allocated;
int used;
unsigned char *scanlines;
struct _scan_list *next;
} *head = NULL, *slist = NULL;
static unsigned char masktable[] = {
0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 };
int padded = 0;
#define NTOALLOC 16
#define NewSList() \
slist = (struct _scan_list *) calloc (1, sizeof *slist); \
if (!slist) { \
fprintf (stderr, "%s: unable to allocate scan list\n", \
ProgramName); \
return; \
} \
slist->allocated = NTOALLOC * bytes_per_scanline; \
slist->scanlines = (unsigned char *) calloc(slist->allocated, 1); \
if (!slist->scanlines) { \
fprintf (stderr, "%s: unable to allocate char array\n", \
ProgramName); \
return; \
} \
slist->used = 0; \
slist->next = NULL;
while (1) {
buf[0] = '\0';
lineno++;
if (fgets (buf, sizeof buf, fp) == NULL) break;
cp = buf;
if (removespace) {
for (cp = buf; *cp && isascii(*cp) && isspace(*cp); cp++) ;
}
if (*cp == '\n' || !*cp) continue; /* empty line */
newline = strchr(cp, '\n');
if (!newline) {
fprintf (stderr, "%s: line %d too long.\n",
ProgramName, lineno);
return;
}
if (removespace) {
for (; --newline > cp && isascii(*newline) && isspace(*newline); );
newline++;
}
if (newline == cp + 1) continue;
*newline = '\0';
len = strlen (cp);
if (width == 0) {
width = len;
padded = ((width & 7) != 0);
bytes_per_scanline = (len + 7) / 8;
NewSList ();
head = slist;
} else if (width != len) {
fprintf (stderr,
"%s: line %d is %d characters wide instead of %d\n",
ProgramName, lineno, len, width);
return;
}
if (slist->used + 1 >= slist->allocated) {
struct _scan_list *old = slist;
NewSList ();
old->next = slist;
}
/* okay, parse the line and stick values into the scanline array */
for (i = 0; i < width; i++) {
int ind = (i & 7);
int on = 0;
if (cp[i] == chars[1]) {
on = 1;
} else if (cp[i] != chars[0]) {
fprintf (stderr, "%s: bad character '%c' on line %d\n",
ProgramName, cp[i], lineno);
}
if (on) slist->scanlines[slist->used] |= masktable[ind];
if (ind == 7) slist->used++;
}
if (padded) slist->used++;
height++;
}
printf ("#define %s_width %d\n", name, width);
printf ("#define %s_height %d\n", name, height);
if (xhot >= 0) printf ("#define %s_x_hot %d\n", name, xhot);
if (yhot >= 0) printf ("#define %s_y_hot %d\n", name, yhot);
printf ("\n");
printf ("static unsigned char %s_bits[] = {\n", name);
j = 0;
last_character = height * bytes_per_scanline - 1;
for (slist = head; slist; slist = slist->next) {
for (i = 0; i < slist->used; i++) {
printf (" 0x%02x", slist->scanlines[i]);
if (j != last_character) putchar (',');
if ((j % 12) == 11) putchar ('\n');
j++;
}
}
printf (" };\n");
return;
}

14
bitmap/bitmap.icon Normal file
View File

@ -0,0 +1,14 @@
#define bitmap_width 32
#define bitmap_height 32
static char bitmap_bits[] = {
0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xf8, 0xfd, 0xff, 0xff, 0xfb,
0x85, 0x08, 0x23, 0xfa, 0x95, 0x28, 0x23, 0xfa, 0x95, 0x29, 0x67, 0xfa,
0xb5, 0x69, 0x67, 0xfa, 0xb5, 0x69, 0x67, 0xfa, 0xb5, 0x69, 0x67, 0xfa,
0x85, 0x09, 0x67, 0xfa, 0xfd, 0xff, 0xff, 0xfb, 0x85, 0x18, 0x21, 0xfa,
0x95, 0x18, 0x25, 0xfa, 0x95, 0x39, 0x65, 0xfa, 0xb5, 0x39, 0x6d, 0xfa,
0xb5, 0x39, 0x6d, 0xfa, 0xb5, 0x39, 0x6d, 0xfa, 0x85, 0x39, 0x61, 0xfa,
0xfd, 0xff, 0xff, 0xfb, 0x45, 0x18, 0xf9, 0xfb, 0x45, 0x19, 0xe1, 0xfb,
0x4d, 0x39, 0xd3, 0xfb, 0x4d, 0x3b, 0xab, 0xfb, 0x4d, 0x3b, 0x57, 0xfb,
0x4d, 0x3b, 0xaf, 0xfa, 0x4d, 0x38, 0x5f, 0xfd, 0xfd, 0xff, 0xbf, 0xfa,
0x01, 0x00, 0x40, 0xf5, 0xff, 0xff, 0xff, 0xea, 0xff, 0xff, 0xff, 0xe5,
0xff, 0xff, 0xff, 0xf3, 0xff, 0xff, 0xff, 0xff};

661
bitmap/bitmap.man Normal file
View File

@ -0,0 +1,661 @@
.\" $Xorg: bitmap.man,v 1.4 2001/02/09 02:05:28 xorgcvs Exp $
.\" Copyright 1993, 1998 The Open Group
.\"
.\" Permission to use, copy, modify, distribute, and sell this software and its
.\" documentation for any purpose is hereby granted without fee, provided that
.\" the above copyright notice appear in all copies and that both that
.\" copyright notice and this permission notice appear in supporting
.\" documentation.
.\"
.\" The above copyright notice and this permission notice shall be included
.\" in all copies or substantial portions of the Software.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
.\" IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
.\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
.\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
.\" OTHER DEALINGS IN THE SOFTWARE.
.\"
.\" Except as contained in this notice, the name of The Open Group shall
.\" not be used in advertising or otherwise to promote the sale, use or
.\" other dealings in this Software without prior written authorization
.\" from The Open Group.
.\"
.\" $XFree86: xc/programs/bitmap/bitmap.man,v 1.7 2001/12/14 20:00:41 dawes Exp $
.\"
.TH BITMAP 1 __xorgversion__
.SH NAME
bitmap, bmtoa, atobm \- bitmap editor and converter utilities for the X Window System
.SH SYNOPSIS
.B bitmap
[
.I \-options
\&.\|.\|. ] [
.I filename
] [
.I basename
]
.sp
.B bmtoa
[
.B \-chars
\&.\|.\|. ] [
.I filename
]
.sp
.B atobm
[
.B \-chars
.I cc
] [
.B \-name
.I variable
] [
.B \-xhot
.I number
] [
.B \-yhot
.I number
] [
.I filename
]
.SH DESCRIPTION
The \fIbitmap\fP program is a rudimentary tool for creating or editing
rectangular images made up of 1's and 0's. Bitmaps are used in X for
defining clipping regions, cursor shapes, icon shapes, and tile and
stipple patterns.
.PP
The \fIbmtoa\fP and \fIatobm\fP filters convert \fIbitmap\fP files (FILE
FORMAT) to and from ASCII strings. They are most commonly used to
quickly print out bitmaps and to generate versions for including in text.
.SH COMMAND LINE OPTIONS
\fIBitmap\fP supports the standard X Toolkit command line arguments
(see \fIX\fP(1)). The following additional arguments are supported as well.
.TP 4
.B \-size\fI WIDTHxHEIGHT\fP
Specifies size of the grid in squares.
.TP 4
.B \-sw\fI dimension\fP
Specifies the width of squares in pixels.
.TP 4
.B \-sh\fI dimension\fP
Specifies the height of squares in pixels.
.TP 4
.B \-gt\fI dimension\fP
Grid tolerance. If the square dimensions fall below the specified
value, grid will be automatically turned off.
.TP 4
.B \-grid, +grid
./&.B \-grid\fI on/off\fP
Turns on or off the grid lines.
.TP 4
.B \-axes, +axes
./&./&.B \-axes\fI on/off\fP
Turns on or off the major axes.
.TP 4
.B \-dashed, +dashed
./&.B \-dashed\fI on/off\fP
Turns on or off dashing for the frame and grid lines.
.TP 4
.B \-stippled, +stippled
./&.B \-stippled\fI on/off\fP
Turns on or off stippling of highlighted squares.
.TP 4
.B \-proportional, +proportional\fI
./&.B \-proportional\fI on/off\fP
Turns proportional mode on or off. If proportional mode is on,
square width is equal to square height. If proportional mode is
off,\fI bitmap\fP will use the smaller square dimension, if they
were initially different.
.TP 4
.B \-dashes\fI filename\fP
Specifies the bitmap to be used as a stipple for dashing.
.TP 4
.B \-stipple\fI filename\fP
Specifies the bitmap to be used as a stipple for highlighting.
.TP 4
.B \-hl\fI color\fP
Specifies the color used for highlighting.
.TP 4
.B \-fr\fI color\fP
Specifies the color used for the frame and grid lines.
.TP 4
.B filename
Specifies the bitmap to be initially loaded into the program.
If the file does not exist,\fI bitmap\fP will assume it is a new file.
.TP 4
.B basename
Specifies the basename to be used in the C code output file.
If it is different than the basename in the working file,\fI bitmap\fP
will change it when saving the file.
.PP
\fIBmtoa\fP accepts the following option:
.TP 4
.B \-chars \fIcc\fP
This option specifies the pair of characters to use in the string version
of the bitmap. The first character is used for 0 bits and the second character
is used for 1 bits. The default is to use dashes (\-) for 0's and sharp signs
(#) for 1's.
.PP
\fIAtobm\fP accepts the following options:
.TP 4
.B \-chars \fIcc\fP
This option specifies the pair of characters to use when converting string
bitmaps into arrays of numbers. The first character represents a 0 bit and
the second character represents a 1 bit. The default is to use dashes (\-)
for 0's and sharp signs (#) for 1's.
.TP 4
.B \-name \fIvariable\fP
This option specifies the variable name to be used when writing out the
bitmap file. The default is to use the basename of the \fIfilename\fP command
line argument or leave it blank if the standard input is read.
.TP 4
.B \-xhot \fInumber\fP
This option specifies the X coordinate of the hotspot. Only positive values
are allowed. By default, no hotspot information is included.
.TP 4
.B \-yhot \fInumber\fP
This option specifies the Y coordinate of the hotspot. Only positive values
are allowed. By default, no hotspot information is included.
.SH USAGE
\fIBitmap\fP displays grid in which each square represents a single
bit in the picture being edited. Actual size of the bitmap image, as
it would appear normaly and inverted, can be obtained by pressing\fB
Meta-I\fP key. You are free to move the image popup out of the way to
continue editing. Pressing the left mouse button in the popup window
or\fB Meta-I\fP again will remove the real size bitmap image.
.PP
If the bitmap is to be used for defining a cursor, one of the squares
in the images may be designated as the hot spot. This determines
where the cursor is actually pointing. For cursors with sharp tips
(such as arrows or fingers), this is usually at the end of the tip;
for symmetric cursors (such as crosses or bullseyes), this is usually
at the center.
.PP
Bitmaps are stored as small C code fragments suitable for including in
applications. They provide an array of bits as well as symbolic
constants giving the width, height, and hot spot (if specified) that
may be used in creating cursors, icons, and tiles.
.SH EDITING
To edit a bitmap image simply click on one of the buttons with drawing
commands (\fBPoint, Curve, Line, Rectangle,\fP etc.) and move the
pointer into the bitmap grid window. Press one of the buttons on your
mouse and the appropriate action will take place. You can either set,
clear or invert the gird squares. Setting a grid square corresponds
to setting a bit in the bitmap image to 1. Clearing a grid square
corresponds to setting a bit in the bitmap image to 0. Inverting a
grid square corresponds to changing a bit in the bitmap image from 0 to
1 or 1 to 0, depending what its previous state was. The
default behavior of mouse buttons is as specified below.
.sp
.nf
MouseButton1 Set
MouseButton2 Invert
MouseButton3 Clear
MouseButton4 Clear
MouseButton5 Clear
.fi
.sp
This default behavior can be changed by setting the button function
resources. An example is provided below.
.sp
.nf
bitmap*button1Function: Set
bitmap*button2Function: Clear
bitmap*button3Function: Invert
etc.
.fi
.sp
The button function applies to all drawing commands, including copying,
moving and pasting, flood filling and setting the hot spot.
.SH DRAWING COMMANDS
Here is the list of drawing commands accessible through the
buttons at the left side of the application's window. Some commands
can be aborted by pressing A inside the bitmap window, allowing the
user to select different guiding points where applicable.
.TP 4
.B Clear
This command clears all bits in the bitmap image. The grid squares
will be set to the background color. Pressing C inside the bitmap
window has the same effect.
.TP 4
.B Set
This command sets all bits in the bitmap image. The grid squares
will be set to the foreground color. Pressing S inside the bitmap
window has the same effect.
.TP 4
.B Invert
This command inverts all bits in the bitmap image. The grid squares
will be inverted appropriately. Pressing I inside the bitmap window
has the same effect.
.TP 4
.B Mark
This command is used to mark an area of the grid by dragging out a
rectangular shape in the highlighting color. Once the area is marked,
it can be operated on by a number of commands (see \fBUp, Down, Left,
Right, Rotate, Flip, Cut,\fP etc.) Only one marked area can be present
at any time. If you attempt to mark another area, the old mark will
vanish. The same effect can be achieved by pressing\fB
Shift-MouseButton1\fP and dragging out a rectangle in the grid window.
Pressing\fB Shift-MouseButton2\fP will mark the entire grid area.
.TP 4
.B Unmark
This command will cause the marked area to vanish. The same effect can
be achieved by pressing\fB Shift-MouseButton3\fP.
.TP 4
.B Copy
This command is used to copy an area of the grid from one location to
another. If there is no marked grid area displayed,\fB Copy\fP
behaves just like\fB Mark\fP described above. Once there is a marked
grid area displayed in the highlighting color, this command has two
alternative behaviors. If you click a mouse button inside the marked
area, you will be able to drag the rectangle that represents the
marked area to the desired location. After you release the mouse
button, the area will be copied. If you click outside the marked
area,\fB Copy\fP will assume that you wish to mark a different region of
the bitmap image, thus it will behave like\fB Mark\fP again.
.TP 4
.B Move
This command is used to move an area of the grid from one location to
another. Its behavior resembles the behavior of\fB Copy\fP command,
except that the marked area will be moved instead of copied.
.TP 4
.B Flip Horizontally
This command will flip the bitmap image with respect to the horizontal axes.
If a marked area of the grid is highlighted, it will operate only
inside the marked area. Pressing H inside the bitmap window has the
same effect.
.TP 4
.B Up
This command moves the bitmap image one pixel up.
If a marked area of the grid is highlighted, it will operate only
inside the marked area. Pressing UpArrow inside the bitmap window has the
same effect.
.TP 4
.B Flip Vertically
This command will flip the bitmap image with respect to the vertical axes.
If a marked area of the grid is highlighted, it will operate only
inside the marked area. Pressing V inside the bitmap window has the
same effect.
.TP 4
.B Left
This command moves the bitmap image one pixel to the left.
If a marked area of the grid is highlighted, it will operate only
inside the marked area. Pressing LeftArrow inside the bitmap window has
the same effect.
.TP 4
.B Fold
This command will fold the bitmap image so that the opposite corners
become adjacent. This is useful when creating bitmap images for
tiling. Pressing F inside the bitmap window has the same effect.
.TP 4
.B Right
This command moves the bitmap image one pixel to the right.
If a marked area of the grid is highlighted, it will operate only
inside the marked area. Pressing RightArrow inside the bitmap window
has the same effect.
.TP 4
.B Rotate Left
This command rotates the bitmap image 90 degrees to the left (counter
clockwise.)
If a marked area of the grid is highlighted, it will operate only
inside the marked area. Pressing L inside the bitmap window has the
same effect.
.TP 4
.B Down
This command moves the bitmap image one pixel down.
If a marked area of the grid is highlighted, it will operate only
inside the marked area. Pressing DownArrow inside the bitmap window
has the same effect.
.TP 4
.B Rotate Right
This command rotates the bitmap image 90 degrees to the right (clockwise.)
If a marked area of the grid is highlighted, it will operate only
inside the marked area. Pressing R inside the bitmap window has the
same effect.
.TP 4
.B Point
This command will change the grid squares underneath the mouse pointer if
a mouse button is being pressed down. If you drag the mouse button
continuously, the line may not be continuous, depending on the speed of your
system and frequency of mouse motion events.
.TP 4
.B Curve
This command will change the grid squares underneath the mouse pointer if
a mouse button is being pressed down. If you drag the mouse button
continuously, it will make sure that the line is continuous. If your system
is slow or\fI bitmap\fP receives very few mouse motion events, it might
behave quite strangely.
.TP 4
.B Line
This command will change the gird squares in a line between two squares.
Once you press a mouse button in the grid window,\fI bitmap\fP will
highlight the line from the square where the mouse button was initially
pressed to the square where the mouse pointer is located. By releasing the
mouse button you will cause the change to take effect, and the highlighted
line will disappear.
.TP 4
.B Rectangle
This command will change the gird squares in a rectangle between two squares.
Once you press a mouse button in the grid window,\fI bitmap\fP will
highlight the rectangle from the square where the mouse button was initially
pressed to the square where the mouse pointer is located. By releasing the
mouse button you will cause the change to take effect, and the highlighted
rectangle will disappear.
.TP 4
.B Filled Rectangle
This command is identical to\fB Rectangle\fP, except at the end the
rectangle will be filled rather than outlined.
.TP 4
.B Circle
This command will change the gird squares in a circle between two squares.
Once you press a mouse button in the grid window,\fI bitmap\fP will
highlight the circle from the square where the mouse button was initially
pressed to the square where the mouse pointer is located. By releasing the
mouse button you will cause the change to take effect, and the highlighted
circle will disappear.
.TP 4
.B Filled Circle
This command is identical to\fB Circle\fP, except at the end the
circle will be filled rather than outlined.
.TP 4
.B Flood Fill
This command will flood fill the connected area underneath the mouse
pointer when you click on the desired square. Diagonally adjacent
squares are not considered to be connected.
.TP 4
.B Set Hot Spot
This command designates one square in the grid as the hot spot if this
bitmap image is to be used for defining a cursor. Pressing a mouse button
in the desired square will cause a diamond shape to be displayed.
.TP 4
.B Clear Hot Spot
This command removes any designated hot spot from the bitmap image.
.TP 4
.B Undo
This command will undo the last executed command. It has depth one,
that is, pressing\fB Undo\fP after\fB Undo\fP will undo itself.
.SH FILE MENU
The File menu commands can be accessed by pressing the File button and
selecting the appropriate menu entry, or by pressing Ctrl key with
another key. These commands deal with files and global bitmap
parameters, such as size, basename, filename etc.
.TP 4
.B New
This command will clear the editing area and prompt for the name of
the new file to be edited. It will not load in the new file.
.TP 4
.B Load
This command is used to load a new bitmap file into the bitmap editor.
If the current image has not been saved, user will be asked whether to
save or ignore the changes. The editor can edit only one file at a
time. If you need interactive editing, run a number of editors and
use cut and paste mechanism as described below.
.TP 4
.B Insert
This command is used to insert a bitmap file into the image
being currently edited. After being prompted for the filename,
click inside the grid window and drag the outlined rectangle to the
location where you want to insert the new file.
.TP 4
.B Save
This command will save the bitmap image. It will not prompt for the
filename unless it is said to be <none>. If you leave the filename
undesignated or \-, the output will be piped to stdout.
.TP 4
.B Save As
This command will save the bitmap image after prompting for a new
filename. It should be used if you want to change the filename.
.TP 4
.B Resize
This command is used to resize the editing area to the new number of
pixels. The size should be entered in the WIDTHxHEIGHT format. The
information in the image being edited will not be lost unless the new
size is smaller that the current image size. The editor was not
designed to edit huge files.
.TP 4
.B Rescale
This command is used to rescale the editing area to the new width and
height. The size should be entered in the WIDTHxHEIGHT format. It will
not do antialiasing and information will be lost if you rescale to the
smaller sizes. Feel free to add you own algorithms for better rescaling.
.TP 4
.B Filename
This command is used to change the filename without changing the basename
nor saving the file. If you specify \- for a filename, the output will
be piped to stdout.
.TP 4
.B Basename
This command is used to change the basename, if a different one from
the specified filename is desired.
.TP 4
.B Quit
\This command will terminate the bitmap application. If the file was
not saved, user will be prompted and asked whether to save the image
or not. This command is preferred over killing the process.
.SH EDIT MENU
The Edit menu commands can be accessed by pressing the Edit button and
selecting the appropriate menu entry, or by pressing Meta key with
another key. These commands deal with editing facilities such as
grid, axes, zooming, cut and paste, etc.
.TP 4
.B Image
This command will display the image being edited and its inverse in its
actual size in a separate window. The window can be moved away to continue
with editing. Pressing the left mouse button in the image window will
cause it to disappear from the screen.
.TP 4
.B Grid
This command controls the grid in the editing area. If the grid spacing
is below the value specified by gridTolerance resource (8 by default),
the grid will be automatically turned off. It can be enforced by explicitly
activating this command.
.TP 4
.B Dashed
This command controls the stipple for drawing the grid lines. The stipple
specified by dashes resource can be turned on or off by activating this
command.
.TP 4
.B Axes
This command controls the highlighting of the main axes of the image
being edited. The actual lines are not part of the image. They are
provided to aid user when constructing symmetrical images, or whenever
having the main axes highlighted helps your editing.
.TP 4
.B Stippled
This command controls the stippling of the highlighted areas of the
bitmap image. The stipple specified by stipple resource can be turned on
or off by activating this command.
.TP 4
.B Proportional
This command controls the proportional mode. If the proportional mode
is on, width and height of all image squares are forced to be equal,
regardless of the proportions of the bitmap window.
.TP 4
.B Zoom
This command controls the zoom mode. If there is a marked area of the
image already displayed, bitmap will automatically zoom into it. Otherwise,
user will have to highlight an area to be edited in the zoom mode and
bitmap will automatically switch into it. One can use all the editing
commands and other utilities in the zoom mode. When you zoom out, undo
command will undo the whole zoom session.
.TP 4
.B Cut
This commands cuts the contents of the highlighted image area into the
internal cut and paste buffer.
.TP 4
.B Copy
This command copies the contents of the highlighted image area into the
internal cut and paste buffer.
.TP 4
.B Paste
This command will check if there are any other bitmap applications with
a highlighted image area, or if there is something in the internal cut
and paste buffer and copy it to the image. To place the copied image,
click in the editing window and drag the outlined image to the position
where you want to place i, and then release the button.
.SH CUT AND PASTE
Bitmap supports two cut and paste mechanisms; the internal cut and
paste and the global X selection cut and paste. The internal cut and
paste is used when executing copy and move drawing commands and also
cut and copy commands from the edit menu. The global X selection cut
and paste is used whenever there is a highlighted area of a bitmap
image displayed anywhere on the screen. To copy a part of image from
another bitmap editor simply highlight the desired area by using the
Mark command or pressing the shift key and dragging the area with the
left mouse button. When the selected area becomes highlighted, any
other applications (such as xterm, etc.) that use primary selection
will discard their selection values and unhighlight the appropriate
information. Now, use the Paste command for the Edit menu or control
mouse button to copy the selected part of image into another (or the
same) bitmap application. If you attempt to do this without a visible
highlighted image area, the bitmap will fall back to the internal cut
and paste buffer and paste whatever was there stored at the moment.
.SH WIDGETS
Below is the widget structure of the \fIbitmap\fP
application. Indentation indicates hierarchical structure. The
widget class name is given first, followed by the widget instance
name. All widgets except the bitmap widget are from the standard
Athena widget set.
.sp
.nf
Bitmap bitmap
TransientShell image
Box box
Label normalImage
Label invertedImage
TransientShell input
Dialog dialog
Command okay
Command cancel
TransientShell error
Dialog dialog
Command abort
Command retry
TransientShell qsave
Dialog dialog
Command yes
Command no
Command cancel
Paned parent
Form formy
MenuButton fileButton
SimpleMenu fileMenu
SmeBSB new
SmeBSB load
SmeBSB insert
SmeBSB save
SmeBSB saveAs
SmeBSB resize
SmeBSB rescale
SmeBSB filename
SmeBSB basename
SmeLine line
SmeBSB quit
MenuButton editButton
SimpleMenu editMenu
SmeBSB image
SmeBSB grid
SmeBSB dashed
SmeBSB axes
SmeBSB stippled
SmeBSB proportional
SmeBSB zoom
SmeLine line
SmeBSB cut
SmeBSB copy
SmeBSB paste
Label status
Pane pane
Bitmap bitmap
Form form
Command clear
Command set
Command invert
Toggle mark
Command unmark
Toggle copy
Toggle move
Command flipHoriz
Command up
Command flipVert
Command left
Command fold
Command right
Command rotateLeft
Command down
Command rotateRight
Toggle point
Toggle curve
Toggle line
Toggle rectangle
Toggle filledRectangle
Toggle circle
Toggle filledCircle
Toggle floodFill
Toggle setHotSpot
Command clearHotSpot
Command undo
.fi
.SH COLORS
If you would like bitmap to be viewable in color, include the following
in the #ifdef COLOR section of the file you read with xrdb:
.sp 1
*customization: \-color
.sp 1
.br
This will cause bitmap to pick up the colors in the app-defaults color
customization file:
.sp 1
__apploaddir__/Bitmap-color
.sp 1
.fi
.SH BITMAP WIDGET
Bitmap widget is a stand-alone widget for editing raster images. It
is not designed to edit large images, although it may be used in that
purpose as well. It can be freely incorporated with other
applications and used as a standard editing tool. The following are
the resources provided by the bitmap widget.
.sp
.nf
Bitmap Widget
Header file Bitmap.h
Class bitmapWidgetClass
Class Name Bitmap
Superclass Bitmap
All the Simple Widget resources plus .\|.\|.
.ta 1.6i 3.2i 4.8i
Name Class Type Default Value
foreground Foreground Pixel XtDefaultForeground
highlight Highlight Pixel XtDefaultForeground
framing Framing Pixel XtDefaultForeground
gridTolerance GridTolerance Dimension 8
size Size String 32x32
dashed Dashed Boolean True
grid Grid Boolean True
stippled Stippled Boolean True
proportional Proportional Boolean True
axes Axes Boolean False
squareWidth SquareWidth Dimension 16
squareHeight SquareHeight Dimension 16
margin Margin Dimension 16
xHot XHot Position NotSet (\-1)
yHot YHot Position NotSet (\-1)
button1Function Button1Function DrawingFunction Set
button2Function Button2Function DrawingFunction Invert
button3Function Button3Function DrawingFunction Clear
button4Function Button4Function DrawingFunction Invert
button5Function Button5Function DrawingFunction Invert
filename Filename String None ("")
basename Basename String None ("")
.fi
.SH AUTHOR
Davor Matic, MIT X Consortium

25
bitmap/config.h.in Normal file
View File

@ -0,0 +1,25 @@
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the `mkstemp' function. */
#undef HAS_MKSTEMP
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Version number of package */
#undef VERSION

111
bitmap/mkinstalldirs Executable file
View File

@ -0,0 +1,111 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain
errstatus=0
dirmode=""
usage="\
Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
# process command line arguments
while test $# -gt 0 ; do
case $1 in
-h | --help | --h*) # -h for help
echo "$usage" 1>&2
exit 0
;;
-m) # -m PERM arg
shift
test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
dirmode=$1
shift
;;
--) # stop option processing
shift
break
;;
-*) # unknown option
echo "$usage" 1>&2
exit 1
;;
*) # first non-opt arg
break
;;
esac
done
for file
do
if test -d "$file"; then
shift
else
break
fi
done
case $# in
0) exit 0 ;;
esac
case $dirmode in
'')
if mkdir -p -- . 2>/dev/null; then
echo "mkdir -p -- $*"
exec mkdir -p -- "$@"
fi
;;
*)
if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
echo "mkdir -m $dirmode -p -- $*"
exec mkdir -m "$dirmode" -p -- "$@"
fi
;;
esac
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d
do
pathcomp="$pathcomp$d"
case $pathcomp in
-*) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp"
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
else
if test ! -z "$dirmode"; then
echo "chmod $dirmode $pathcomp"
lasterr=""
chmod "$dirmode" "$pathcomp" || lasterr=$?
if test ! -z "$lasterr"; then
errstatus=$lasterr
fi
fi
fi
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# End:
# mkinstalldirs ends here

0
fstobdf/AUTHORS Normal file
View File

12
fstobdf/COPYING Normal file
View File

@ -0,0 +1,12 @@
This is a stub file. This package has not yet had its complete licensing
information compiled. Please see the individual source files for details on
your rights to use and modify this software.
Please submit updated COPYING files to the Xorg bugzilla:
https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
All licensing questions regarding this software should be directed at the
Xorg mailing list:
http://lists.freedesktop.org/mailman/listinfo/xorg

0
fstobdf/INSTALL Normal file
View File

67
fstobdf/Makefile.am Normal file
View File

@ -0,0 +1,67 @@
#
# Copyright 2005 Red Hat, Inc.
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of Red Hat not be used in
# advertising or publicity pertaining to distribution of the software without
# specific, written prior permission. Red Hat makes no
# representations about the suitability of this software for any purpose. It
# is provided "as is" without express or implied warranty.
#
# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
# EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
bin_PROGRAMS = fstobdf
fstobdf_CFLAGS = $(FSTOBDF_CFLAGS)
fstobdf_LDADD = $(FSTOBDF_LIBS)
fstobdf_SOURCES = \
chars.c \
fstobdf.c \
fstobdf.h \
header.c \
props.c
appman_PRE = \
fstobdf.man
appmandir = $(APP_MAN_DIR)
appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
EXTRA_DIST = $(appman_PRE)
CLEANFILES = $(appman_DATA)
SED = sed
# Strings to replace in man pages
XORGRELSTRING = @PACKAGE_STRING@
XORGMANNAME = X Version 11
MAN_SUBSTS = \
-e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
-e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
-e 's|__xservername__|Xorg|g' \
-e 's|__xconfigfile__|xorg.conf|g' \
-e 's|__projectroot__|$(prefix)|g' \
-e 's|__apploaddir__|$(appdefaultdir)|' \
-e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \
-e 's|__libmansuffix__|$(LIB_MAN_SUFFIX)|g' \
-e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \
-e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \
-e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g'
SUFFIXES = .$(APP_MAN_SUFFIX) .man
.man.$(APP_MAN_SUFFIX):
sed $(MAN_SUBSTS) < $< > $@

0
fstobdf/NEWS Normal file
View File

0
fstobdf/README Normal file
View File

22
fstobdf/config.h.in Normal file
View File

@ -0,0 +1,22 @@
/* config.h.in. Generated from configure.ac by autoheader. */
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Version number of package */
#undef VERSION

137
fstobdf/fstobdf.c Normal file
View File

@ -0,0 +1,137 @@
/* $Xorg: fstobdf.c,v 1.4 2001/02/09 02:05:30 xorgcvs Exp $ */
/*
Copyright 1990, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
* Copyright 1990 Network Computing Devices;
* Portions Copyright 1987 by Digital Equipment Corporation
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the names of Network Computing Devices, or Digital
* not be used in advertising or publicity pertaining to distribution
* of the software without specific, written prior permission.
*
* NETWORK COMPUTING DEVICES, AND DIGITAL DISCLAIM ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES,
* OR DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
/* $XFree86: xc/programs/fstobdf/fstobdf.c,v 1.6tsi Exp $ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "fstobdf.h"
static void
usage(char *progName)
{
fprintf(stderr, "Usage: %s [-s <font server>] -fn <font name>\n",
progName);
exit(0);
}
static void
Fail(char *progName)
{
fprintf(stderr, "%s: unable to dump font\n", progName);
exit(1);
}
int
main(int argc, char *argv[])
{
FSServer *fontServer;
Font fontID,
dummy;
FSBitmapFormat bitmapFormat;
FSXFontInfoHeader fontHeader;
FSPropInfo propInfo;
FSPropOffset *propOffsets;
unsigned char *propData;
FILE *outFile;
char *fontName;
char *serverName;
int i;
fontName = NULL;
serverName = NULL;
outFile = stdout;
for (i = 1; i < argc; i++) {
if (!strncmp(argv[i], "-s", 2)) {
if (argv[++i])
serverName = argv[i];
else
usage(argv[0]);
} else if (!strncmp(argv[i], "-fn", 3)) {
if (argv[++i])
fontName = argv[i];
else
usage(argv[0]);
}
}
if (fontName == NULL)
usage(argv[0]);
fontServer = FSOpenServer(serverName);
if (!fontServer) {
char *sn = FSServerName(serverName);
if (sn)
fprintf(stderr, "%s: can't open font server \"%s\"\n",
argv[0], sn);
else
fprintf(stderr, "%s: No font server specified.\n",
argv[0]);
exit(0);
}
bitmapFormat = 0;
fontID = FSOpenBitmapFont(fontServer, bitmapFormat, (FSBitmapFormatMask) 0,
fontName, &dummy);
if (!fontID) {
printf("can't open font \"%s\"\n", fontName);
exit(0);
}
FSQueryXInfo(fontServer, fontID, &fontHeader, &propInfo, &propOffsets,
&propData);
if (!EmitHeader(outFile, &fontHeader, &propInfo, propOffsets, propData))
Fail(argv[0]);
if (!EmitProperties(outFile, &fontHeader, &propInfo, propOffsets, propData))
Fail(argv[0]);
if (!EmitCharacters(outFile, fontServer, &fontHeader, fontID))
Fail(argv[0]);
fprintf(outFile, "ENDFONT\n");
FSFree((char *) propOffsets);
FSFree((char *) propData);
exit (0);
}

38
fstobdf/fstobdf.h Normal file
View File

@ -0,0 +1,38 @@
/* $XFree86: xc/programs/fstobdf/fstobdf.h,v 1.2 2001/08/27 17:41:01 dawes Exp $ */
/*
* Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name of the XFree86 Project shall
* not be used in advertising or otherwise to promote the sale, use or other
* dealings in this Software without prior written authorization from the
* XFree86 Project.
*/
#include <X11/fonts/FSlib.h>
extern Bool EmitHeader ( FILE *outFile, FSXFontInfoHeader *fontHeader,
FSPropInfo *propInfo, FSPropOffset *propOffsets,
unsigned char *propData );
extern Bool EmitProperties ( FILE *outFile, FSXFontInfoHeader *fontHeader,
FSPropInfo *propInfo, FSPropOffset *propOffsets,
unsigned char *propData );
extern Bool EmitCharacters ( FILE *outFile, FSServer *fontServer,
FSXFontInfoHeader *fontHeader, Font fontID );

64
fstobdf/fstobdf.man Normal file
View File

@ -0,0 +1,64 @@
.\" $Xorg: fstobdf.man,v 1.4 2001/02/09 02:05:30 xorgcvs Exp $
.\" Copyright 1990, Network Computing Devices
.\" Copyright 1990, 1998 The Open Group
.\"
.\" Permission to use, copy, modify, distribute, and sell this software and its
.\" documentation for any purpose is hereby granted without fee, provided that
.\" the above copyright notice appear in all copies and that both that
.\" copyright notice and this permission notice appear in supporting
.\" documentation.
.\"
.\" The above copyright notice and this permission notice shall be included
.\" in all copies or substantial portions of the Software.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
.\" IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
.\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
.\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
.\" OTHER DEALINGS IN THE SOFTWARE.
.\"
.\" Except as contained in this notice, the name of The Open Group shall
.\" not be used in advertising or otherwise to promote the sale, use or
.\" other dealings in this Software without prior written authorization
.\" from The Open Group.
.\"
.\" $XFree86: xc/programs/fstobdf/fstobdf.man,v 1.6 2001/01/27 18:21:02 dawes Exp $
.\"
.TH FSTOBDF 1 __xorgversion__
.SH NAME
fstobdf \- generate BDF font from X font server
.SH SYNOPSIS
.B "fstobdf"
[
.B \-server
.I server
]
.B \-fn
.I fontname
.SH DESCRIPTION
The \fIfstobdf\fP program reads a font from a font server and prints a BDF
file on the standard output that may be used to recreate the font.
This is useful in testing servers, debugging font metrics, and reproducing
lost BDF files.
.SH OPTIONS
.TP 8
.B \-server \fIservername\fP
This option specifies the server from which the font should be read.
.TP 8
.B \-fn \fIfontname\fP
This option specifies the font for which a BDF file should be generated.
.SH ENVIRONMENT
.TP 8
.B FONTSERVER
default server to use
.SH "SEE ALSO"
xfs(1), bdftopcf(1), fslsfonts(1)
.SH AUTHOR
Olaf Brandt, Network Computing Devices
.br
Dave Lemke, Network Computing Devices
.br
.sp
Jim Fulton, MIT X Consortium

213
fstobdf/header.c Normal file
View File

@ -0,0 +1,213 @@
/* $Xorg: header.c,v 1.4 2001/02/09 02:05:30 xorgcvs Exp $ */
/*
Copyright 1990, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
* Copyright 1990 Network Computing Devices;
* Portions Copyright 1987 by Digital Equipment Corporation
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the names of Network Computing Devices, or Digital
* not be used in advertising or publicity pertaining to distribution
* of the software without specific, written prior permission.
*
* NETWORK COMPUTING DEVICES, AND DIGITAL DISCLAIM ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES,
* OR DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
/* $XFree86: xc/programs/fstobdf/header.c,v 3.6 2001/07/25 15:05:13 dawes Exp $ */
#include <stdio.h>
#include <X11/Xosdefs.h>
#include <stdlib.h>
#include <string.h>
#include "fstobdf.h"
unsigned long pointSize;
unsigned long yResolution;
static char *warning[] =
{
"COMMENT ",
"COMMENT WARNING: This bdf file was generated from a font server using",
"COMMENT fstobdf. The resulting font is subject to the same copyright,",
"COMMENT license, and trademark restrictions as the original font. The",
"COMMENT authors and distributors of fstobdf disclaim all liability for",
"COMMENT misuse of the program or its output.",
"COMMENT ",
NULL
};
static char *
FindStringProperty(char *propName,
int *propLength,
FSPropInfo *propInfo,
FSPropOffset *propOffsets,
unsigned char *propData)
{
FSPropOffset *propOffset;
int length;
int i;
propOffset = &propOffsets[0];
length = strlen(propName);
for (i = propInfo->num_offsets; i--; propOffset++) {
if (propOffset->type == PropTypeString) {
#ifdef DEBUG
char pname[256];
memmove( pname, propData + propOffset->name.position,
propOffset->name.length);
pname[propOffset->name.length] = '\0';
fprintf(stderr, "prop name: %s (len %d)\n",
pname, propOffset->name.length);
#endif
if ((propOffset->name.length == length) &&
!strncmp((char*)propData + propOffset->name.position, propName, length)) {
*propLength = propOffset->value.length;
return (char *)(propData + propOffset->value.position);
}
}
}
*propLength = 0;
return (NULL);
}
static int
FindNumberProperty(char *propName,
unsigned long *propValue,
FSPropInfo *propInfo,
FSPropOffset *propOffsets,
unsigned char *propData)
{
FSPropOffset *propOffset;
int i;
int length;
propOffset = &propOffsets[0];
length = strlen(propName);
for (i = propInfo->num_offsets; i--; propOffset++) {
if ((propOffset->type == PropTypeSigned) ||
(propOffset->type == PropTypeUnsigned)) {
if ((propOffset->name.length == length) &&
!strncmp((char*)propData + propOffset->name.position, propName, length)) {
*propValue = propOffset->value.position;
return (propOffset->type);
}
}
}
return (-1);
}
/*
* EmitHeader - print STARTFONT, COMMENT lines, FONT, SIZE, and
* FONTBOUNDINGBOX lines
*/
Bool
EmitHeader(FILE *outFile,
FSXFontInfoHeader *fontHeader,
FSPropInfo *propInfo,
FSPropOffset *propOffsets,
unsigned char *propData)
{
int len;
int type;
char *cp;
char **cpp;
unsigned long xResolution;
fprintf(outFile, "STARTFONT 2.1\n");
/*
* find COPYRIGHT message and print it first, followed by warning
*/
cp = FindStringProperty("COPYRIGHT", &len, propInfo, propOffsets,
propData);
if (cp) {
fprintf(outFile, "COMMENT \nCOMMENT ");
fwrite(cp, 1, len, outFile);
fputc('\n', outFile);
}
for (cpp = warning; *cpp; cpp++)
fprintf(outFile, "%s\n", *cpp);
/*
* FONT name
*/
cp = FindStringProperty("FONT", &len, propInfo, propOffsets, propData);
if (cp) {
fprintf(outFile, "FONT ");
fwrite(cp, 1, len, outFile);
fputc('\n', outFile);
} else {
fprintf(stderr, "unable to find FONT property\n");
return (False);
}
/*
* SIZE point xres yres
*
* Get XLFD values if possible, else fake it
*/
type = FindNumberProperty("RESOLUTION_X", &xResolution, propInfo,
propOffsets, propData);
if ((type != PropTypeUnsigned) && (type != PropTypeSigned))
xResolution = 72;
type = FindNumberProperty("RESOLUTION_Y", &yResolution, propInfo,
propOffsets, propData);
if ((type != PropTypeUnsigned) && (type != PropTypeSigned))
yResolution = 72;
type = FindNumberProperty("POINT_SIZE", &pointSize, propInfo,
propOffsets, propData);
if ((type == PropTypeUnsigned) || (type == PropTypeSigned))
pointSize = (pointSize + 5) / 10;
else
pointSize = ((fontHeader->font_ascent + fontHeader->font_descent)
* 72) / yResolution;
fprintf(outFile, "SIZE %lu %lu %lu\n", pointSize, xResolution,
yResolution);
/*
* FONTBOUNDINGBOX width height xoff yoff
*
*/
fprintf(outFile, "FONTBOUNDINGBOX %d %d %d %d\n",
fontHeader->max_bounds.right - fontHeader->min_bounds.left,
fontHeader->max_bounds.ascent + fontHeader->max_bounds.descent,
fontHeader->min_bounds.left,
-fontHeader->max_bounds.descent);
return (True);
}

111
fstobdf/mkinstalldirs Executable file
View File

@ -0,0 +1,111 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain
errstatus=0
dirmode=""
usage="\
Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
# process command line arguments
while test $# -gt 0 ; do
case $1 in
-h | --help | --h*) # -h for help
echo "$usage" 1>&2
exit 0
;;
-m) # -m PERM arg
shift
test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
dirmode=$1
shift
;;
--) # stop option processing
shift
break
;;
-*) # unknown option
echo "$usage" 1>&2
exit 1
;;
*) # first non-opt arg
break
;;
esac
done
for file
do
if test -d "$file"; then
shift
else
break
fi
done
case $# in
0) exit 0 ;;
esac
case $dirmode in
'')
if mkdir -p -- . 2>/dev/null; then
echo "mkdir -p -- $*"
exec mkdir -p -- "$@"
fi
;;
*)
if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
echo "mkdir -m $dirmode -p -- $*"
exec mkdir -m "$dirmode" -p -- "$@"
fi
;;
esac
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d
do
pathcomp="$pathcomp$d"
case $pathcomp in
-*) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp"
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
else
if test ! -z "$dirmode"; then
echo "chmod $dirmode $pathcomp"
lasterr=""
chmod "$dirmode" "$pathcomp" || lasterr=$?
if test ! -z "$lasterr"; then
errstatus=$lasterr
fi
fi
fi
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# End:
# mkinstalldirs ends here

145
fstobdf/props.c Normal file
View File

@ -0,0 +1,145 @@
/* $Xorg: props.c,v 1.4 2001/02/09 02:05:30 xorgcvs Exp $ */
/*
Copyright 1990, 1991, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
* Copyright 1990, 1991 Network Computing Devices;
* Portions Copyright 1987 by Digital Equipment Corporation
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the names of Network Computing Devices, or Digital
* not be used in advertising or publicity pertaining to distribution
* of the software without specific, written prior permission.
*
* NETWORK COMPUTING DEVICES, AND DIGITAL DISCLAIM ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES,
* OR DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
/* $XFree86: xc/programs/fstobdf/props.c,v 1.5 2001/01/17 23:44:54 dawes Exp $ */
#include <stdio.h>
#include <string.h>
#include "fstobdf.h"
static char *
AddQuotes(unsigned char *string, int length)
{
static unsigned char new[256] = "\"";
unsigned char *cp;
unsigned char *end;
end = string + length;
for (cp = &new[1]; string < end; cp++, string++) {
*cp = *string;
if (*cp == '"')
*++cp = '"';
}
*cp++ = '"';
*cp = '\0';
return (char *)(new);
}
Bool
EmitProperties(FILE *outFile,
FSXFontInfoHeader *fontHeader,
FSPropInfo *propInfo,
FSPropOffset *propOffsets,
unsigned char *propData)
{
int nProperties;
FSPropOffset *property;
Bool needDefaultChar;
Bool needFontAscent;
Bool needFontDescent;
needDefaultChar = True;
needFontAscent = True;
needFontDescent = True;
nProperties = propInfo->num_offsets;
for (property = &propOffsets[0]; nProperties--; property++) {
char *name;
int length;
name = (char *)propData + property->name.position;
length = property->name.length;
if ((length == 12) && (!strncmp(name, "DEFAULT_CHAR", 12)))
needDefaultChar = False;
else if ((length == 11) && (!strncmp(name, "FONT_ASCENT", 11)))
needFontAscent = False;
else if ((length == 12) && (!strncmp(name, "FONT_DESCENT", 12)))
needFontDescent = False;
}
nProperties = propInfo->num_offsets;
fprintf(outFile, "STARTPROPERTIES %d\n", nProperties +
(needDefaultChar ? 1 : 0) + (needFontAscent ? 1 : 0) +
(needFontDescent ? 1 : 0));
for (property = &propOffsets[0]; nProperties--; property++) {
unsigned long value;
/* Don't emit properties that are computed by bdftosnf */
fwrite(propData + property->name.position, 1, property->name.length,
outFile);
fputc(' ', outFile);
value = property->value.position;
switch (property->type) {
case PropTypeString:
fprintf(outFile, "%s\n", AddQuotes(propData + value,
property->value.length));
break;
case PropTypeUnsigned:
fprintf(outFile, "%lu\n", value);
break;
case PropTypeSigned:
fprintf(outFile, "%ld\n", value);
break;
default:
fprintf(stderr, "unknown property type\n");
return (False);
}
}
if (needDefaultChar) {
fprintf(outFile, "DEFAULT_CHAR %lu\n",
(long) (fontHeader->default_char.high << 8)
| (fontHeader->default_char.low));
}
if (needFontAscent)
fprintf(outFile, "FONT_ASCENT %d\n", fontHeader->font_ascent);
if (needFontDescent)
fprintf(outFile, "FONT_DESCENT %d\n", fontHeader->font_descent);
fprintf(outFile, "ENDPROPERTIES\n");
return (True);
}

0
xclock/AUTHORS Normal file
View File

12
xclock/COPYING Normal file
View File

@ -0,0 +1,12 @@
This is a stub file. This package has not yet had its complete licensing
information compiled. Please see the individual source files for details on
your rights to use and modify this software.
Please submit updated COPYING files to the Xorg bugzilla:
https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
All licensing questions regarding this software should be directed at the
Xorg mailing list:
http://lists.freedesktop.org/mailman/listinfo/xorg

149
xclock/Clock.h Normal file
View File

@ -0,0 +1,149 @@
/*
* $Xorg: Clock.h,v 1.4 2001/02/09 02:05:39 xorgcvs Exp $
*/
/***********************************************************
Copyright 1987, 1988, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
/* $XFree86: xc/programs/xclock/Clock.h,v 1.11 2002/10/17 01:00:01 dawes Exp $ */
#ifndef _XawClock_h
#define _XawClock_h
/***********************************************************************
*
* Clock Widget
*
***********************************************************************/
#include <X11/Xmu/Converters.h>
/* Parameters:
Name Class RepType Default Value
---- ----- ------- -------------
twentyfour Boolean Boolean True
analog Boolean Boolean True
background Background Pixel white
backingStore BackingStore BackingStore default
border BorderColor Pixel Black
borderWidth BorderWidth Dimension 1
chime Boolean Boolean False
destroyCallback Callback Pointer NULL
font Font XFontStruct* fixed
foreground Foreground Pixel black
hand Foreground Pixel black
height Height Dimension 164
highlight Foreground Pixel black
mappedWhenManaged MappedWhenManaged Boolean True
padding Margin int 8
utime Boolean Boolean False
update Interval int 60 (seconds)
width Width Dimension 164
x Position Position 0
y Position Position 0
*/
/* Resource names used to the clock widget */
/* color of hands */
#define XtNhand "hands"
/* Boolean: 24-hour if TRUE */
#define XtNtwentyfour "twentyfour"
/* Boolean: digital if FALSE */
#define XtNanalog "analog"
/* Boolean: only hour/minute if TRUE */
#define XtNbrief "brief"
/* String: will be used as format arg to
"strftime" if not empty string */
#define XtNstrftime "strftime"
/* Boolean: show seconds since Epoch if TRUE */
#define XtNutime "utime"
/* Boolean: */
#define XtNchime "chime"
/* Int: amount of space around outside of clock */
#define XtNpadding "padding"
/* Boolean: use Render extension if TRUE */
#define XtNrender "render"
/* Boolean: use backing pixmap for double buffering */
#define XtNbuffer "buffer"
/* RenderColor: colors for various clock elements */
#define XtNhourColor "hourColor"
#define XtNminuteColor "minuteColor"
#define XtNsecondColor "secondColor"
#define XtNmajorColor "majorColor"
#define XtNminorColor "minorColor"
#define XtRXftColor "XftColor"
#define XtNface "face"
#define XtCFace "Face"
#define XtRXftFont "XftFont"
/* Boolean: use sharp rendering for Render polygons */
#define XtNsharp "sharp"
#define XtCSharp "Sharp"
typedef struct _ClockRec *ClockWidget; /* completely defined in ClockPrivate.h */
typedef struct _ClockClassRec *ClockWidgetClass; /* completely defined in ClockPrivate.h */
extern WidgetClass clockWidgetClass;
#endif /* _XawClock_h */
/* DON'T ADD STUFF AFTER THIS #endif */

170
xclock/ClockP.h Normal file
View File

@ -0,0 +1,170 @@
/*
* $Xorg: ClockP.h,v 1.4 2001/02/09 02:05:39 xorgcvs Exp $
*/
/***********************************************************
Copyright 1987, 1988, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
/* $XFree86: xc/programs/xclock/ClockP.h,v 1.11 2002/10/17 01:00:01 dawes Exp $ */
#ifndef _XawClockP_h
#define _XawClockP_h
#include <X11/Xos.h> /* Needed for struct tm. */
#include "Clock.h"
#include <X11/Xaw/SimpleP.h>
#ifdef XRENDER
#include <X11/Xft/Xft.h>
#include <X11/extensions/Xrender.h>
#endif
#define SEG_BUFF_SIZE 128
#ifdef NO_I18N
#define ASCII_TIME_BUFLEN 32 /* big enough for 26 plus slop */
#define STRFTIME_BUFF_SIZE 100 /* buffer for "strftime" option */
#else
#define STRFTIME_BUFF_SIZE 256 /* should handle any locale */
#endif
/* New fields for the clock widget instance record */
typedef struct {
#ifndef RENDER
Pixel fgpixel; /* color index for text */
#endif
Pixel Hipixel; /* color index for Highlighting */
Pixel Hdpixel; /* color index for hands */
XFontStruct *font; /* font for text */
GC myGC; /* pointer to GraphicsContext */
GC EraseGC; /* eraser GC */
GC HandGC; /* Hand GC */
GC HighGC; /* Highlighting GC */
/* start of graph stuff */
int update; /* update frequence */
Dimension radius; /* radius factor */
int backing_store; /* backing store type */
Boolean chime;
Boolean beeped;
Boolean analog;
Boolean brief;
Boolean twentyfour;
Boolean utime;
String strftime;
Boolean show_second_hand;
Dimension second_hand_length;
Dimension minute_hand_length;
Dimension hour_hand_length;
Dimension hand_width;
Dimension second_hand_width;
Position centerX;
Position centerY;
int numseg;
int padding;
XPoint segbuff[SEG_BUFF_SIZE];
XPoint *segbuffptr;
XPoint *hour, *sec;
struct tm otm ;
XtIntervalId interval_id;
char prev_time_string[STRFTIME_BUFF_SIZE];
#ifndef NO_I18N
XFontSet fontSet; /* font set for localized text */
Boolean utf8;
#endif
#ifdef XRENDER
XftColor fg_color;
XftColor hour_color;
XftColor min_color;
XftColor sec_color;
XftColor major_color;
XftColor minor_color;
XftFont *face;
XRenderPictFormat *mask_format;
Boolean render;
Boolean sharp;
Boolean can_polygon;
Boolean buffer;
XftDraw *draw;
Picture picture;
Picture fill_picture;
Pixmap pixmap;
XRectangle damage;
XDouble x_scale;
XDouble x_off;
XDouble y_scale;
XDouble y_off;
#endif
} ClockPart;
#ifdef XRENDER
#define ClockFgPixel(c) ((c)->clock.fg_color.pixel)
#else
#define ClockFgPixel(c) ((c)->clock.fgpixel)
#endif
/* Full instance record declaration */
typedef struct _ClockRec {
CorePart core;
SimplePart simple;
ClockPart clock;
} ClockRec;
/* New fields for the Clock widget class record */
typedef struct {int dummy;} ClockClassPart;
/* Full class record declaration. */
typedef struct _ClockClassRec {
CoreClassPart core_class;
SimpleClassPart simple_class;
ClockClassPart clock_class;
} ClockClassRec;
/* Class pointer. */
extern ClockClassRec clockClassRec;
#endif /* _XawClockP_h */

0
xclock/INSTALL Normal file
View File

0
xclock/NEWS Normal file
View File

0
xclock/README Normal file
View File

1
xclock/XClock.ad Normal file
View File

@ -0,0 +1 @@
XClock.input: false

27
xclock/clmask.bit Normal file
View File

@ -0,0 +1,27 @@
#define clock_mask_width 48
#define clock_mask_height 48
static unsigned char clock_mask_bits[] = {
0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00,
0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x00, 0x00,
0x00, 0xe0, 0xff, 0xff, 0x03, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x07, 0x00,
0x00, 0xf8, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x1f, 0x00,
0x00, 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xff, 0xff, 0xff, 0x7f, 0x00,
0x80, 0xff, 0xff, 0xff, 0xff, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x01,
0xe0, 0xff, 0xff, 0xff, 0xff, 0x03, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x03,
0xf0, 0xff, 0xff, 0xff, 0xff, 0x07, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x07,
0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f,
0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x1f,
0xfc, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x1f,
0xfc, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x7f,
0xfc, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x7f,
0xfc, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x1f,
0xfc, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f,
0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x07,
0xf0, 0xff, 0xff, 0xff, 0xff, 0x07, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x03,
0xe0, 0xff, 0xff, 0xff, 0xff, 0x01, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x01,
0x80, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x7f, 0x00,
0x00, 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x1f, 0x00,
0x00, 0xf8, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x07, 0x00,
0x00, 0xe0, 0xff, 0xff, 0x03, 0x00, 0x00, 0x80, 0xff, 0xff, 0x00, 0x00,
0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00,
0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00};

29
xclock/clock.bit Normal file
View File

@ -0,0 +1,29 @@
#define clock_width 48
#define clock_height 48
#define clock_x_hot -1
#define clock_y_hot -1
static unsigned char clock_bits[] = {
0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00,
0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x00, 0x00,
0x00, 0xe0, 0xff, 0xff, 0x03, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x07, 0x00,
0x00, 0xf8, 0x87, 0xf1, 0x0f, 0x00, 0x00, 0xfc, 0x80, 0x81, 0x1f, 0x00,
0x00, 0x3e, 0x80, 0x01, 0x3e, 0x00, 0x00, 0x9f, 0x01, 0xc0, 0x7c, 0x00,
0x80, 0x8f, 0x01, 0xc0, 0xf8, 0x00, 0xc0, 0x07, 0x00, 0x00, 0xf0, 0x01,
0xe0, 0x03, 0x00, 0x00, 0xe0, 0x03, 0xe0, 0x01, 0x00, 0x00, 0xc0, 0x03,
0xf0, 0x00, 0x00, 0x40, 0x80, 0x07, 0xf0, 0x06, 0x00, 0xe0, 0xb0, 0x07,
0x78, 0x06, 0x00, 0xf0, 0x30, 0x0f, 0x78, 0x00, 0x00, 0x78, 0x00, 0x0f,
0x78, 0x00, 0x00, 0x3c, 0x00, 0x0f, 0x3c, 0x00, 0x00, 0x1e, 0x00, 0x1e,
0x3c, 0x00, 0x00, 0x0f, 0x00, 0x1e, 0x3c, 0x00, 0x80, 0x07, 0x00, 0x1e,
0x3c, 0x00, 0xc0, 0x03, 0x00, 0x7e, 0xfc, 0x01, 0xc0, 0x03, 0xc0, 0x7f,
0xfc, 0x01, 0x80, 0x07, 0xc0, 0x7f, 0x3c, 0x00, 0x00, 0x0f, 0x00, 0x7e,
0x3c, 0x00, 0x00, 0x1e, 0x00, 0x1e, 0x3c, 0x00, 0x00, 0x1c, 0x00, 0x1e,
0x7c, 0x00, 0x00, 0x08, 0x00, 0x0f, 0x78, 0x00, 0x00, 0x00, 0x00, 0x0f,
0x78, 0x06, 0x00, 0x00, 0x30, 0x0f, 0xf0, 0x06, 0x00, 0x00, 0xb0, 0x07,
0xf0, 0x00, 0x00, 0x00, 0x80, 0x07, 0xe0, 0x01, 0x00, 0x00, 0xc0, 0x03,
0xe0, 0x03, 0x00, 0x00, 0xe0, 0x01, 0xc0, 0x07, 0x00, 0x00, 0xf0, 0x01,
0x80, 0x8f, 0x01, 0xc0, 0xf8, 0x00, 0x00, 0x9f, 0x01, 0xc0, 0x7c, 0x00,
0x00, 0x3e, 0x80, 0x01, 0x3e, 0x00, 0x00, 0xfc, 0x80, 0x81, 0x1f, 0x00,
0x00, 0xf8, 0x87, 0xf1, 0x0f, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x07, 0x00,
0x00, 0xe0, 0xff, 0xff, 0x03, 0x00, 0x00, 0x80, 0xff, 0xff, 0x00, 0x00,
0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00,
0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00};

34
xclock/config.h.in Normal file
View File

@ -0,0 +1,34 @@
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the `strlcpy' function. */
#undef HAVE_STRLCPY
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Version number of package */
#undef VERSION
/* Define to use Xft2 library */
#undef XFREE86_FT2
/* Define to use XkbStdBell */
#undef XKB
/* Define to use X Render Extension */
#undef XRENDER

111
xclock/mkinstalldirs Executable file
View File

@ -0,0 +1,111 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain
errstatus=0
dirmode=""
usage="\
Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
# process command line arguments
while test $# -gt 0 ; do
case $1 in
-h | --help | --h*) # -h for help
echo "$usage" 1>&2
exit 0
;;
-m) # -m PERM arg
shift
test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
dirmode=$1
shift
;;
--) # stop option processing
shift
break
;;
-*) # unknown option
echo "$usage" 1>&2
exit 1
;;
*) # first non-opt arg
break
;;
esac
done
for file
do
if test -d "$file"; then
shift
else
break
fi
done
case $# in
0) exit 0 ;;
esac
case $dirmode in
'')
if mkdir -p -- . 2>/dev/null; then
echo "mkdir -p -- $*"
exec mkdir -p -- "$@"
fi
;;
*)
if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
echo "mkdir -m $dirmode -p -- $*"
exec mkdir -m "$dirmode" -p -- "$@"
fi
;;
esac
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d
do
pathcomp="$pathcomp$d"
case $pathcomp in
-*) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp"
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
else
if test ! -z "$dirmode"; then
echo "chmod $dirmode $pathcomp"
lasterr=""
chmod "$dirmode" "$pathcomp" || lasterr=$?
if test ! -z "$lasterr"; then
errstatus=$lasterr
fi
fi
fi
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# End:
# mkinstalldirs ends here

264
xclock/xclock.man Normal file
View File

@ -0,0 +1,264 @@
.\" $Xorg: xclock.man,v 1.4 2001/02/09 02:05:39 xorgcvs Exp $
.\" Copyright 1988, 1994, 1998 The Open Group
.\"
.\" Permission to use, copy, modify, distribute, and sell this software and its
.\" documentation for any purpose is hereby granted without fee, provided that
.\" the above copyright notice appear in all copies and that both that
.\" copyright notice and this permission notice appear in supporting
.\" documentation.
.\"
.\" The above copyright notice and this permission notice shall be included
.\" in all copies or substantial portions of the Software.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
.\" IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
.\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
.\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
.\" OTHER DEALINGS IN THE SOFTWARE.
.\"
.\" Except as contained in this notice, the name of The Open Group shall
.\" not be used in advertising or otherwise to promote the sale, use or
.\" other dealings in this Software without prior written authorization
.\" from The Open Group.
.\"
.\" $XFree86: xc/programs/xclock/xclock.man,v 1.15 2003/07/04 16:24:30 eich Exp $
.\"
.TH XCLOCK 1 __xorgversion__
.SH NAME
xclock \- analog / digital clock for X
.SH SYNOPSIS
.ta 8n
\fBxclock\fP [ \fB\-help\fP ] [ \fB\-analog\fP ] [ \fB\-digital\fP ]
[ \fB\-brief\fP ] [ \fB\-chime\fP ] [ \fB\-hd\fP \fIcolor\fP ]
[ \fB\-hl\fP \fIcolor\fP ] [ \fB\-update\fP \fIseconds\fP ]
[ \fB\-strftime\fP \fIformat\fP ]
[ \fB\-padding\fP \fInumber\fP ]
[ \fB\-norender\fP ]
[ \fB\-render\fP ]
[ \fB\-sharp\fP ]
[ \fB\-face\fP \fIpattern\fP ]
.SH DESCRIPTION
The
.I xclock
program displays the time in analog or digital form. The time is continuously
updated at a frequency which may be specified by the user.
.SH OPTIONS
.I Xclock
accepts all of the standard X Toolkit command line options along with the
additional options listed below:
.TP 8
.B \-help
This option indicates that a brief summary of the allowed options should be
printed on the standard error.
.TP 8
.B \-analog
This option indicates that a conventional 12 hour clock face with tick marks
and hands should be used. This is the default.
.TP 8
\fB\-digital\fP or \fB\-d\fP
This option indicates that a 24 hour digital clock should be used.
.TP 8
\fB\-brief\fP
This option indicates that the digital clock should only display the hours
and minutes fields. The default is to show the full time and date information.
.TP 8
\fB\-utime\fP or \fB\-d\fP
This option indicates that a digital clock should display seconds since
the Epoch (in format '970012340 seconds since Epoch' instead of a standard
24-hour time.
.TP 8
.B \-strftime \fIformat\fP
This option allows an strftime(3) format string to be specified for the
digital clock's display.
.TP 8
.B \-twelve
This option indicates that a digital clock should display the time in
twelve hour format.
.TP 8
.B \-twentyfour
This option indicates that a digital clock should display the time in
twenty-four hour format. This is the default when a digital clock is used.
.TP 8
.B \-chime
This option indicates that the clock should chime
once on the half hour and twice on the hour.
.TP 8
\fB\-hands\fP \fIcolor\fP (or \fB\-hd\fP \fIcolor\fP)
This option specifies the color of the hands on an analog clock. The default
is \fIblack\fP.
This option is effectively ignored when Xrender is in use.
.TP 8
\fB\-highlight\fP \fIcolor\fP (or \fB\-hl\fP \fIcolor\fP)
This option specifies the color of the edges of the hands on an analog clock,
and is only useful on color displays. The default is \fIblack\fP.
This option is effectively ignored when Xrender is in use.
.TP 8
.B \-update \fIseconds\fP
This option specifies the frequency in seconds at which \fIxclock\fP
should update its display. If the clock is obscured and then exposed,
it will be updated immediately. A value of 30 seconds or less will enable a
second hand on an analog clock. The default is 60 seconds.
.TP 8
.B \-padding \fInumber\fP
This option specifies the width in pixels of the padding
between the window border and clock text or picture. The default is 10
on a digital clock and 8 on an analog clock.
.TP 8
.B \-render
This option tells \fIxclock\fP to use the Xrender extension to draw an
anti-aliased face. This is the default if \fIxclock\fP has been
compiled with Xrender support.
Note that the color selection options and resources used when Xrender is
in effect differ from the standard options.
.TP 8
.B \-norender
This option turns off the use of Xrender to draw the clock.
.TP 8
.B \-sharp
This option tells \fIxclock\fP to use sharper edges when drawn using
the Xrender extension.
.TP 8
.B \-face \fIpattern\fP
This option specifies the font to use in digital mode when the
Xrender extension is used.
.SH X DEFAULTS
This program uses the
.I Clock
widget. It understands all of the core resource names and classes as well as:
.PP
.TP 8
.B width (\fPclass\fB Width)
Specifies the width of the clock. The default for analog clocks is 164
pixels; the default for digital clocks is whatever is needed to hold the
clock when displayed in the chosen font.
.TP 8
.B height (\fPclass\fB Height)
Specifies the height of the clock. The default for analog clocks is 164
pixels; the default for digital clocks is whatever is needed to hold the
clock when displayed in the chosen font.
.TP 8
.B update (\fPclass\fB Interval)
Specifies the frequency in seconds at which the time should be redisplayed.
.TP 8
.B foreground (\fPclass\fB Foreground)
Specifies the color for the tick marks. The default depends on whether
\fIreverseVideo\fP is specified. If \fIreverseVideo\fP is specified
the default is \fIlwhite\fP, otherwise the default is \fIblack\fP.
.TP 8
.B hands (\fPclass\fB Foreground)
Specifies the color of the insides of the clock's hands. The default
depends on whether
\fIreverseVideo\fP is specified. If \fIreverseVideo\fP is specified
the default is \fIlwhite\fP, otherwise the default is \fIblack\fP.
Note that this resource is not used when Xrender is in effect.
.TP 8
.B highlight (\fPclass\fB Foreground)
Specifies the color used to highlight the clock's hands. The default is
depends on whether
\fIreverseVideo\fP is specified. If \fIreverseVideo\fP is specified
the default is \fIlwhite\fP, otherwise the default is \fIblack\fP.
Note that this resource is not used when Xrender is in effect.
.TP 8
.B analog (\fPclass\fB Boolean)
Specifies whether or not an analog clock should be used instead of a digital
one. The default is True.
.TP 8
.B twentyfour (\fPclass\fB Boolean)
Specifies whether or not a digital clock should display the time in
twenty-four hour format. The default is True.
.TP 8
.B chime (\fPclass\fB Boolean)
Specifies whether or not a bell should be rung on the hour and half hour.
.TP 8
.B padding (\fPclass\fB Margin)
Specifies the amount of internal padding in pixels to be used. The default is
8.
.TP 8
.B font (\fPclass\fB Font)
Specifies the font to be used for the digital clock. Note that variable width
fonts currently will not always display correctly.
This font is only used when Xrender is not in effect.
.TP 8
.B render (\fPclass\fB Boolean)
Specifies whether or not the Xrender extension should be used for the
display. The default is True if \fIxclock\fP has been compiled with
Xrender support.
.PP
When Xrender is in effect, the following additional resources are
understood:
.PP
.TP 8
.B face (\fPclass\fB FaceName)
Specify the pattern for the font to be used for the digital clock when
Xrender is used.
.TP 8
.B sharp (\fPclass\fB Boolean)
Specifies if sharp edges should be used when rendering the clock.
The default is False.
.TP 8
.B buffer (\fPclass\fB Boolean)
Specifies that the updates of the image are drawn to a pixmap before copied
into the window instead drawing them into the window directly.
.PP
The defaults of the following color resources depend on whether
\fIreverseVideo\fP is specified.
If \fIreverseVideo\fP is specified the default is \fIlwhite\fP,
otherwise the default is \fIblack\fP.
.TP 8
.B hourColor (\fPclass\fB Foreground)
The color of the hour hand.
.TP 8
.B minuteColor (\fPclass\fB Foreground)
The color of the minute hand.
.TP 8
.B secondColor (\fPclass\fB Foreground)
The color of the second hand.
.TP 8
.B majorColor (\fPclass\fB Foreground)
The color of the major scale ticks (i. e. each five minutes).
.TP 8
.B minorColor (\fPclass\fB Foreground)
The color of the minor scale ticks (between major ticks).
.SH WIDGETS
In order to specify resources, it is useful to know the hierarchy of
the widgets which compose \fIxclock\fR. In the notation below,
indentation indicates hierarchical structure. The widget class name
is given first, followed by the widget instance name.
.sp
.nf
.\".TA .5i
.ta .5i
XClock xclock
Clock clock
.fi
.sp
.SH ENVIRONMENT
.PP
.TP 8
.B DISPLAY
to get the default host and display number.
.TP 8
.B XENVIRONMENT
to get the name of a resource file that overrides the global resources
stored in the RESOURCE_MANAGER property.
.SH FILES
.TP
.I __apploaddir__/XClock
specifies required resources
.SH "SEE ALSO"
X(__miscmansuffix__), xrdb(1), time(3C)
.SH BUGS
.I Xclock
believes the system clock.
.PP
When in digital mode, the string should be centered automatically.
.SH AUTHORS
Tony Della Fera (MIT-Athena, DEC)
.br
Dave Mankins (MIT-Athena, BBN)
.br
Ed Moy (UC Berkeley)

0
xconsole/AUTHORS Normal file
View File

12
xconsole/COPYING Normal file
View File

@ -0,0 +1,12 @@
This is a stub file. This package has not yet had its complete licensing
information compiled. Please see the individual source files for details on
your rights to use and modify this software.
Please submit updated COPYING files to the Xorg bugzilla:
https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
All licensing questions regarding this software should be directed at the
Xorg mailing list:
http://lists.freedesktop.org/mailman/listinfo/xorg

0
xconsole/INSTALL Normal file
View File

82
xconsole/Makefile.am Normal file
View File

@ -0,0 +1,82 @@
#
# Copyright 2005 Red Hat, Inc.
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of Red Hat not be used in
# advertising or publicity pertaining to distribution of the software without
# specific, written prior permission. Red Hat makes no
# representations about the suitability of this software for any purpose. It
# is provided "as is" without express or implied warranty.
#
# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
# EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
bin_PROGRAMS = xconsole
xconsole_CFLAGS = $(XCONSOLE_CFLAGS)
xconsole_LDADD = $(XCONSOLE_LIBS)
xconsole_SOURCES = \
xconsole.c
appman_PRE = \
xconsole.man
# App default files (*.ad)
appdefaultdir = @appdefaultdir@
APPDEFAULTFILES = \
XConsole
SUFFIXES = .ad
.ad:
cp $< $@
appdefault_DATA = $(APPDEFAULTFILES)
EXTRA_DIST = $(APPDEFAULTFILES:%=%.ad)
CLEANFILES = $(APPDEFAULTFILES)
appmandir = $(APP_MAN_DIR)
appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
EXTRA_DIST += $(appman_PRE)
CLEANFILES += $(appman_DATA)
SED = sed
# Strings to replace in man pages
XORGRELSTRING = @PACKAGE_STRING@
XORGMANNAME = X Version 11
MAN_SUBSTS = \
-e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
-e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
-e 's|__xservername__|Xorg|g' \
-e 's|__xconfigfile__|xorg.conf|g' \
-e 's|__projectroot__|$(prefix)|g' \
-e 's|__apploaddir__|$(appdefaultdir)|' \
-e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \
-e 's|__libmansuffix__|$(LIB_MAN_SUFFIX)|g' \
-e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \
-e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \
-e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g'
SUFFIXES += .$(APP_MAN_SUFFIX) .man
.man.$(APP_MAN_SUFFIX):
sed $(MAN_SUBSTS) < $< > $@

0
xconsole/NEWS Normal file
View File

0
xconsole/README Normal file
View File

28
xconsole/XConsole.ad Normal file
View File

@ -0,0 +1,28 @@
! $Xorg: XConsole.ad,v 1.3 2000/08/17 19:54:13 cpqbld Exp $
!
!
!
!
! $XFree86: xc/programs/xconsole/XConsole.ad,v 1.2 2000/03/31 22:55:55 dawes Exp $
*allowShellResize: true
XConsole.translations: #override\
<MapNotify>: Deiconified() \n\
<UnmapNotify>: Iconified() \n\
<Message>WM_PROTOCOLS: Quit()
XConsole.baseTranslations: #override\
<MapNotify>: Deiconified() \n\
<UnmapNotify>: Iconified() \n\
<Message>WM_PROTOCOLS: Quit()
*text.translations: #override\
Ctrl<KeyPress>C: Clear() \n\
<KeyPress>Clear: Clear()
*text.baseTranslations: #override\
Ctrl<KeyPress>C: Clear() \n\
<KeyPress>Clear: Clear()
*text.scrollVertical: Always
*text.scrollHorizontal: Never
*text.width: 400
*text.height: 70
*text.allowResize: true
*editType: read

22
xconsole/config.h.in Normal file
View File

@ -0,0 +1,22 @@
/* config.h.in. Generated from configure.ac by autoheader. */
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Version number of package */
#undef VERSION

111
xconsole/mkinstalldirs Executable file
View File

@ -0,0 +1,111 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain
errstatus=0
dirmode=""
usage="\
Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
# process command line arguments
while test $# -gt 0 ; do
case $1 in
-h | --help | --h*) # -h for help
echo "$usage" 1>&2
exit 0
;;
-m) # -m PERM arg
shift
test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
dirmode=$1
shift
;;
--) # stop option processing
shift
break
;;
-*) # unknown option
echo "$usage" 1>&2
exit 1
;;
*) # first non-opt arg
break
;;
esac
done
for file
do
if test -d "$file"; then
shift
else
break
fi
done
case $# in
0) exit 0 ;;
esac
case $dirmode in
'')
if mkdir -p -- . 2>/dev/null; then
echo "mkdir -p -- $*"
exec mkdir -p -- "$@"
fi
;;
*)
if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
echo "mkdir -m $dirmode -p -- $*"
exec mkdir -m "$dirmode" -p -- "$@"
fi
;;
esac
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d
do
pathcomp="$pathcomp$d"
case $pathcomp in
-*) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp"
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
else
if test ! -z "$dirmode"; then
echo "chmod $dirmode $pathcomp"
lasterr=""
chmod "$dirmode" "$pathcomp" || lasterr=$?
if test ! -z "$lasterr"; then
errstatus=$lasterr
fi
fi
fi
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# End:
# mkinstalldirs ends here

117
xconsole/xconsole.man Normal file
View File

@ -0,0 +1,117 @@
.\" $Xorg: xconsole.man,v 1.4 2001/02/09 02:05:40 xorgcvs Exp $
.\" Copyright 1994, 1998 The Open Group
.\"
.\" Permission to use, copy, modify, distribute, and sell this software and its
.\" documentation for any purpose is hereby granted without fee, provided that
.\" the above copyright notice appear in all copies and that both that
.\" copyright notice and this permission notice appear in supporting
.\" documentation.
.\"
.\" The above copyright notice and this permission notice shall be included in
.\" all copies or substantial portions of the Software.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
.\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
.\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
.\" THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
.\" WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
.\" OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
.\" SOFTWARE.
.\"
.\" Except as contained in this notice, the name of The Open Group shall not
.\" be used in advertising or otherwise to promote the sale, use or other
.\" dealing in this Software without prior written authorization from the
.\" The Open Group.
.\"
.\" $XFree86: xc/programs/xconsole/xconsole.man,v 1.9 2002/10/12 16:06:47 herrb Exp $
.\"
.TH XCONSOLE 1 __xorgversion__
.SH NAME
xconsole \- monitor system console messages with X
.SH SYNOPSIS
.ta 8n
\fBxconsole\fP [-\fItoolkitoption\fP ...] [-file \fIfile-name\fP]
[-notify] [-stripNonprint] [-daemon] [-verbose] [-exitOnFail]
.SH DESCRIPTION
The
.I xconsole
program displays messages which are usually sent to /dev/console.
.SH OPTIONS
.I Xconsole
accepts all of the standard X Toolkit command line options along with the
additional options listed below:
.TP 8
.B \-file \fIfile-name\fP
To monitor some other device, use this option to specify the device name.
This does not work on regular files as they are always ready to be read from.
.TP 8
.B \-notify \-nonotify
When new data are received from the console and the notify option is set,
the icon name of the application has " *" appended, so that it is evident
even when the application is iconified. \-notify is the default.
.TP 8
.B \-daemon
This option causes
.I xconsole
to place itself in the background, using fork/exit.
.TP 8
.B \-verbose
When set, this option directs
.I xconsole
to display an informative message in the first line of the text buffer.
.TP 8
.B \-exitOnFail
When set, this option directs
.I xconsole
to exit when it is unable to redirect the console output.
.TP 8
.B \-saveLines \fIcount\fP
When set,
.I xconsole
only preserves
.I count
lines of message history instead of growing the text buffer without bound
(a
.I count
of zero \- the default \- is treated as placing no limit on the history).
.SH X DEFAULTS
This program uses the
.I Athena Text
widget, look in the
.I Athena Widget Set
documentation for controlling it.
.PP
.I Xconsole
otherwise accepts resources of the same names as the command-line options
(without the leading dash). "file" is a string type, "saveLines" an
integer, and the remaining options are booleans.
.SH WIDGETS
In order to specify resources, it is useful to know the hierarchy of
the widgets which compose \fIxconsole\fR. In the notation below,
indentation indicates hierarchical structure. The widget class name
is given first, followed by the widget instance name.
.sp
.nf
.TA .5i
.ta .5i
XConsole xconsole
XConsole text
.fi
.sp
.SH ENVIRONMENT
.PP
.TP 8
.B DISPLAY
to get the default host and display number.
.TP 8
.B XENVIRONMENT
to get the name of a resource file that overrides the global resources
stored in the RESOURCE_MANAGER property.
.SH FILES
.TP
.I __apploaddir__/XConsole
specifies required resources
.SH "SEE ALSO"
X(__miscmansuffix__), xrdb(1), Athena Text widget
.SH AUTHOR
Keith Packard (MIT X Consortium)

2
xcursorgen/AUTHORS Normal file
View File

@ -0,0 +1,2 @@
Original authors:
Manish Singh

19
xcursorgen/COPYING Normal file
View File

@ -0,0 +1,19 @@
Copyright (C) 2002 Manish Singh
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation, and that the name of Manish Singh not be used in
advertising or publicity pertaining to distribution of the software without
specific, written prior permission. Manish Singh makes no
representations about the suitability of this software for any purpose. It
is provided "as is" without express or implied warranty.
MANISH SINGH DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
EVENT SHALL MANISH SINGH BE LIABLE FOR ANY SPECIAL, INDIRECT OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.

236
xcursorgen/INSTALL Normal file
View File

@ -0,0 +1,236 @@
Installation Instructions
*************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. (Caching is
disabled by default to prevent problems with accidental use of stale
cache files.)
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You only need
`configure.ac' if you want to change it or regenerate `configure' using
a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that the
`configure' script does not know about. Run `./configure --help' for
details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not support the `VPATH'
variable, you have to compile the package for one architecture at a
time in the source code directory. After you have installed the
package for one architecture, use `make distclean' before reconfiguring
for another architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PREFIX'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PREFIX', the package will
use PREFIX as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' cannot figure out automatically,
but needs to determine by the type of machine the package will run on.
Usually, assuming the package is built to be run on the _same_
architectures, `configure' can figure that out, but if it prints a
message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the `--target=TYPE' option to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share, you
can create a site shell script called `config.site' that gives default
values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script). Here is a another example:
/bin/bash ./configure CONFIG_SHELL=/bin/bash
Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
configuration-related scripts to be executed by `/bin/bash'.
`configure' Invocation
======================
`configure' recognizes the following options to control how it operates.
`--help'
`-h'
Print a summary of the options to `configure', and exit.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.

22
xcursorgen/Makefile.am Normal file
View File

@ -0,0 +1,22 @@
bin_PROGRAMS = xcursorgen
xcursorgen_SOURCES = xcursorgen.c
xcursorgen_CFLAGS = @XCURSORGEN_CFLAGS@
xcursorgen_LDADD = @XCURSORGEN_LIBS@
appmandir = $(APP_MAN_DIR)
appman_PRE = xcursorgen.man
appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
EXTRA_DIST = $(appman_PRE)
CLEANFILES = $(appman_DATA)
MAN_SUBSTS = -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|'
SUFFIXES = .$(APP_MAN_SUFFIX) .man
.man.$(APP_MAN_SUFFIX):
sed $(MAN_SUBSTS) < $< > $@

0
xcursorgen/NEWS Normal file
View File

0
xcursorgen/README Normal file
View File

25
xcursorgen/config.h.in Normal file
View File

@ -0,0 +1,25 @@
/* config.h.in. Generated from configure.ac by autoheader. */
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE
/* Version number of package */
#undef VERSION

111
xcursorgen/mkinstalldirs Executable file
View File

@ -0,0 +1,111 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain
errstatus=0
dirmode=""
usage="\
Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
# process command line arguments
while test $# -gt 0 ; do
case $1 in
-h | --help | --h*) # -h for help
echo "$usage" 1>&2
exit 0
;;
-m) # -m PERM arg
shift
test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
dirmode=$1
shift
;;
--) # stop option processing
shift
break
;;
-*) # unknown option
echo "$usage" 1>&2
exit 1
;;
*) # first non-opt arg
break
;;
esac
done
for file
do
if test -d "$file"; then
shift
else
break
fi
done
case $# in
0) exit 0 ;;
esac
case $dirmode in
'')
if mkdir -p -- . 2>/dev/null; then
echo "mkdir -p -- $*"
exec mkdir -p -- "$@"
fi
;;
*)
if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
echo "mkdir -m $dirmode -p -- $*"
exec mkdir -m "$dirmode" -p -- "$@"
fi
;;
esac
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d
do
pathcomp="$pathcomp$d"
case $pathcomp in
-*) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp"
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
else
if test ! -z "$dirmode"; then
echo "chmod $dirmode $pathcomp"
lasterr=""
chmod "$dirmode" "$pathcomp" || lasterr=$?
if test ! -z "$lasterr"; then
errstatus=$lasterr
fi
fi
fi
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# End:
# mkinstalldirs ends here

46
xcursorgen/xcursorgen.man Normal file
View File

@ -0,0 +1,46 @@
.\"
.\" Copyright 2002 Keith Packard.\"
.\" Permission to use, copy, modify, distribute, and sell this software and its
.\" documentation for any purpose is hereby granted without fee, provided that
.\" the above copyright notice appear in all copies and that both that
.\" copyright notice and this permission notice appear in supporting
.\" documentation, and that the name of Keith Packard not be used in
.\" advertising or publicity pertaining to distribution of the software without
.\" specific, written prior permission. Keith Packard makes no
.\" representations about the suitability of this software for any purpose. It
.\" is provided "as is" without express or implied warranty.
.\"
.\" KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
.\" INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
.\" EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
.\" CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
.\" DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
.\" TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
.\"
.\" $XFree86: xc/programs/xcursorgen/xcursorgen.man,v 1.1 2002/09/03 06:48:28 keithp Exp $
.\"
.TH XCURSORGEN 1 __vendorversion__
.SH NAME
xcursorgen \- create an X cursor file from a collection of PNG images
.SH SYNOPSIS
.B "xcursorgen"
.RI [ config-file ]
.RI [ output-file ]
.SH DESCRIPTION
Xcursorgen reads the config-file to find the list of cursor images along
with their hotspot and nominal size information. Xcursorgen converts all of
the images to Xcursor format and writes them to the output-file.
.P
Each line in the config file is of the form:
.br
<size> <xhot> <yhot> <filename> <ms-delay>
.br
.P
Multiple images with the same <size> are used to create animated cursors,
the <ms-delay> value on each line indicates how long each image should be
displayed before switching to the next. <ms-delay> can be elided for static
cursors.
.SH "SEE ALSO"
Xcursor(3x)

1
xdriinfo/AUTHORS Normal file
View File

@ -0,0 +1 @@
Felix Külhing

20
xdriinfo/COPYING Normal file
View File

@ -0,0 +1,20 @@
Client application for querying drivers' configuration information
Copyright (C) 2003 Felix Kuehling
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
FELIX KUEHLING, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

236
xdriinfo/INSTALL Normal file
View File

@ -0,0 +1,236 @@
Installation Instructions
*************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. (Caching is
disabled by default to prevent problems with accidental use of stale
cache files.)
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You only need
`configure.ac' if you want to change it or regenerate `configure' using
a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that the
`configure' script does not know about. Run `./configure --help' for
details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not support the `VPATH'
variable, you have to compile the package for one architecture at a
time in the source code directory. After you have installed the
package for one architecture, use `make distclean' before reconfiguring
for another architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PREFIX'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PREFIX', the package will
use PREFIX as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' cannot figure out automatically,
but needs to determine by the type of machine the package will run on.
Usually, assuming the package is built to be run on the _same_
architectures, `configure' can figure that out, but if it prints a
message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the `--target=TYPE' option to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share, you
can create a site shell script called `config.site' that gives default
values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script). Here is a another example:
/bin/bash ./configure CONFIG_SHELL=/bin/bash
Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
configuration-related scripts to be executed by `/bin/bash'.
`configure' Invocation
======================
`configure' recognizes the following options to control how it operates.
`--help'
`-h'
Print a summary of the options to `configure', and exit.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.

62
xdriinfo/Makefile.am Normal file
View File

@ -0,0 +1,62 @@
# Copyright 2005 Red Hat, Inc.
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of Red Hat not be used in
# advertising or publicity pertaining to distribution of the software without
# specific, written prior permission. Red Hat makes no
# representations about the suitability of this software for any purpose. It
# is provided "as is" without express or implied warranty.
#
# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
# EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
bin_PROGRAMS = xdriinfo
xdriinfo_CFLAGS = $(XDRIINFO_CFLAGS)
# mesa should really use pkg-config ...
xdriinfo_LDADD = $(XDRIINFO_LIBS)
xdriinfo_SOURCES = \
xdriinfo.c
appman_PRE = \
xdriinfo.man
appmandir = $(APP_MAN_DIR)
appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
EXTRA_DIST = $(appman_PRE)
CLEANFILES = $(appman_DATA)
SED = sed
# Strings to replace in man pages
XORGRELSTRING = @PACKAGE_STRING@
XORGMANNAME = X Version 11
MAN_SUBSTS = \
-e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
-e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
-e 's|__xservername__|Xorg|g' \
-e 's|__xconfigfile__|xorg.conf|g' \
-e 's|__projectroot__|$(prefix)|g' \
-e 's|__apploaddir__|$(appdefaultdir)|' \
-e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \
-e 's|__libmansuffix__|$(LIB_MAN_SUFFIX)|g' \
-e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \
-e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \
-e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g'
SUFFIXES = .$(APP_MAN_SUFFIX) .man
.man.$(APP_MAN_SUFFIX):
sed $(MAN_SUBSTS) < $< > $@

0
xdriinfo/NEWS Normal file
View File

0
xdriinfo/README Normal file
View File

25
xdriinfo/config.h.in Normal file
View File

@ -0,0 +1,25 @@
/* config.h.in. Generated from configure.ac by autoheader. */
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE
/* Version number of package */
#undef VERSION

111
xdriinfo/mkinstalldirs Executable file
View File

@ -0,0 +1,111 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain
errstatus=0
dirmode=""
usage="\
Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
# process command line arguments
while test $# -gt 0 ; do
case $1 in
-h | --help | --h*) # -h for help
echo "$usage" 1>&2
exit 0
;;
-m) # -m PERM arg
shift
test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
dirmode=$1
shift
;;
--) # stop option processing
shift
break
;;
-*) # unknown option
echo "$usage" 1>&2
exit 1
;;
*) # first non-opt arg
break
;;
esac
done
for file
do
if test -d "$file"; then
shift
else
break
fi
done
case $# in
0) exit 0 ;;
esac
case $dirmode in
'')
if mkdir -p -- . 2>/dev/null; then
echo "mkdir -p -- $*"
exec mkdir -p -- "$@"
fi
;;
*)
if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
echo "mkdir -m $dirmode -p -- $*"
exec mkdir -m "$dirmode" -p -- "$@"
fi
;;
esac
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d
do
pathcomp="$pathcomp$d"
case $pathcomp in
-*) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp"
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
else
if test ! -z "$dirmode"; then
echo "chmod $dirmode $pathcomp"
lasterr=""
chmod "$dirmode" "$pathcomp" || lasterr=$?
if test ! -z "$lasterr"; then
errstatus=$lasterr
fi
fi
fi
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# End:
# mkinstalldirs ends here

33
xdriinfo/xdriinfo.man Normal file
View File

@ -0,0 +1,33 @@
.\" $XFree86$
.TH xdriinfo 1 __vendorversion__
.SH NAME
xdriinfo \- query configuration information of DRI drivers
.SH SYNOPSIS
.B xdriinfo
[\-display \fIdisplayname\fP] [command]
.SH DESCRIPTION
\fIxdriinfo\fP can be used to query configuration information of
direct rendering drivers. If no command argument is specified it lists
the names of the direct rendering drivers for all screens.
.PP
Valid commands are:
.TP
.B nscreens
Print the number of screens.
.TP
.B driver \fIscreen\fP
Print the name of the direct rendering driver for \fIscreen\fP.
.TP
.B options \fIscreen|driver\fP
Print the XML document describing the configuration options of a
driver. The driver can be specified directly by \fIdriver\fP name or
indirectly by \fIscreen\fP number. If the driver name is specified
directly then no X connection is needed.
.SH ENVIRONMENT
.TP
.B DISPLAY
The default display.
.SH "SEE ALSO"
.IR glxinfo (1x)
.SH AUTHOR
Felix Kuehling

3
xhost/AUTHORS Normal file
View File

@ -0,0 +1,3 @@
Original authors:
Bob Scheifler, MIT Laboratory for Computer Science
Jim Gettys, MIT Project Athena (DEC)

32
xhost/COPYING Normal file
View File

@ -0,0 +1,32 @@
Copyright 1985, 1986, 1987, 1998 The Open Group
Copyright 2004 Sun Microsystems, Inc.
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, and/or sell copies of the Software, and to permit persons
to whom the Software is furnished to do so, provided that the above
copyright notice(s) and this permission notice appear in all copies of
the Software and that both the above copyright notice(s) and this
permission notice appear in supporting documentation.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale, use
or other dealings in this Software without prior written authorization
of the copyright holder.
X Window System is a trademark of The Open Group.

40
xhost/Makefile.am Normal file
View File

@ -0,0 +1,40 @@
bin_PROGRAMS = xhost
xhost_SOURCES = xhost.c
xhost_CFLAGS = @XHOST_CFLAGS@
xhost_LDADD = @XHOST_LIBS@
appman_PRE = xhost.man
appmandir = $(APP_MAN_DIR)
appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
EXTRA_DIST = $(appman_PRE)
CLEANFILES = $(appman_DATA)
SED = sed
# Strings to replace in man pages
XORGRELSTRING = @PACKAGE_STRING@
XORGMANNAME = X Version 11
MAN_SUBSTS = \
-e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
-e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
-e 's|__xservername__|Xorg|g' \
-e 's|__xconfigfile__|xorg.conf|g' \
-e 's|__projectroot__|$(prefix)|g' \
-e 's|__apploaddir__|$(appdefaultdir)|' \
-e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \
-e 's|__libmansuffix__|$(LIB_MAN_SUFFIX)|g' \
-e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \
-e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \
-e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g'
SUFFIXES = .$(APP_MAN_SUFFIX) .man
.man.$(APP_MAN_SUFFIX):
sed $(MAN_SUBSTS) < $< > $@

0
xhost/NEWS Normal file
View File

0
xhost/README Normal file
View File

46
xhost/config.h.in Normal file
View File

@ -0,0 +1,46 @@
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if `struct sockaddr_in' has a `sin_len' member */
#undef BSD44SOCKETS
/* Define to 1 if you have the `authdes_create' function. */
#undef HAVE_AUTHDES_CREATE
/* Define to 1 if you have the `authdes_seccreate' function. */
#undef HAVE_AUTHDES_SECCREATE
/* Support IPv6 for TCP connections */
#undef IPv6
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE
/* Support Secure RPC ("SUN-DES-1") authentication for X11 clients */
#undef SECURE_RPC
/* Support TCP socket connections */
#undef TCPCONN
/* Support UNIX socket connections */
#undef UNIXCONN
/* Version number of package */
#undef VERSION

111
xhost/mkinstalldirs Executable file
View File

@ -0,0 +1,111 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain
errstatus=0
dirmode=""
usage="\
Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
# process command line arguments
while test $# -gt 0 ; do
case $1 in
-h | --help | --h*) # -h for help
echo "$usage" 1>&2
exit 0
;;
-m) # -m PERM arg
shift
test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
dirmode=$1
shift
;;
--) # stop option processing
shift
break
;;
-*) # unknown option
echo "$usage" 1>&2
exit 1
;;
*) # first non-opt arg
break
;;
esac
done
for file
do
if test -d "$file"; then
shift
else
break
fi
done
case $# in
0) exit 0 ;;
esac
case $dirmode in
'')
if mkdir -p -- . 2>/dev/null; then
echo "mkdir -p -- $*"
exec mkdir -p -- "$@"
fi
;;
*)
if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
echo "mkdir -m $dirmode -p -- $*"
exec mkdir -m "$dirmode" -p -- "$@"
fi
;;
esac
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d
do
pathcomp="$pathcomp$d"
case $pathcomp in
-*) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp"
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
else
if test ! -z "$dirmode"; then
echo "chmod $dirmode $pathcomp"
lasterr=""
chmod "$dirmode" "$pathcomp" || lasterr=$?
if test ! -z "$lasterr"; then
errstatus=$lasterr
fi
fi
fi
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# End:
# mkinstalldirs ends here

0
xinit/AUTHORS Normal file
View File

12
xinit/COPYING Normal file
View File

@ -0,0 +1,12 @@
This is a stub file. This package has not yet had its complete licensing
information compiled. Please see the individual source files for details on
your rights to use and modify this software.
Please submit updated COPYING files to the Xorg bugzilla:
https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
All licensing questions regarding this software should be directed at the
Xorg mailing list:
http://lists.freedesktop.org/mailman/listinfo/xorg

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