[m-rev.] trivial diff: convert GLUT binding to 4-space indentation
Julien Fischer
juliensf at cs.mu.OZ.AU
Thu Apr 20 12:33:28 AEST 2006
Estimated hours taken: 0.2
Branches: main, release
extras/graphics/mercury_glut/*.m:
Convert the GLUT binding to four-space indentation.
Reformat some types according to our current coding standard.
Fix spelling errors in documentation.
Julien.
Index: glut.callback.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/graphics/mercury_glut/glut.callback.m,v
retrieving revision 1.3
diff -u -b -r1.3 glut.callback.m
--- glut.callback.m 8 Aug 2005 07:13:20 -0000 1.3
+++ glut.callback.m 20 Apr 2006 02:27:16 -0000
@@ -1,18 +1,20 @@
%-----------------------------------------------------------------------------%
+% vim: ft=mercury ts=4 sw=4 et
+%-----------------------------------------------------------------------------%
% Copyright (C) 2004-2005 The University of Melbourne.
% This file may only be copied under the terms of the GNU Library General
% Public License - see the file COPYING.LIB in the Mercury distribution.
%-----------------------------------------------------------------------------%
%
-% file: glut.callback.m
-% author: juliensf
+% File: glut.callback.m.
+% Author: juliensf.
%
% This module contains predicates for (un)registering glut callbacks.
%
%-----------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
:- module glut.callback.
-
:- interface.
%-----------------------------------------------------------------------------%
@@ -29,7 +31,7 @@
%
:- pred callback.disable_display_func(io::di, io::uo) is det.
- % Registers the rehsape callback for the current window.
+ % Registers the reshape callback for the current window.
% The reshape callback is Reshape(Width, Height, !IO).
% `Width' and `Height' specify the new window size measured
% in pixels.
@@ -42,7 +44,7 @@
:- pred callback.disable_reshape_func(io::di, io::uo) is det.
% Registers the keyboard callback for the current window.
- % This is called whenver a key is pressed.
+ % This is called whenever a key is pressed.
% The keyboard callback is Keyboard(Key, X, Y, !IO). `Key'
% is the ASCII value of the key pressed. `X' and `Y' are the
% mouse coordinates at the time the key is pressed.
@@ -60,7 +62,7 @@
% Registers the mouse callback for the current window.
% This is called whenever the state of one of the mouse buttons
- % changes (ie. a button is pressed or released). The mouse
+ % changes (i.e.. a button is pressed or released). The mouse
% callback is MouseFunc(Button, State, X, Y, !IO). `Button'
% is the identity of the button, `State' indicates whether the
% button was pressed or released. `X' and `Y' give the mouse pointer
@@ -171,8 +173,8 @@
%
:- pred callback.disable_special_func(io::di, io::uo) is det.
- % Register the special keyboard up callbcak for the current window.
- % This is called when one fo the function or arrow keys is released.
+ % Register the special keyboard up callback for the current window.
+ % This is called when one of the function or arrow keys is released.
%
:- pred callback.special_up_func(pred(special_key, int, int, io, io), io, io).
:- mode callback.special_up_func(pred(in, in, in, di, uo) is det, di, uo)
@@ -190,7 +192,7 @@
:- mode callback.keyboard_up_func(pred(in, in, in, di, uo) is det, di, uo)
is det.
- % Unregister the keyuboard_up callback for the current window.
+ % Unregister the keyboard_up callback for the current window.
%
:- pred callback.disable_keyboard_up_func(io::di, io::uo) is det.
@@ -264,8 +266,9 @@
:- pragma foreign_code("C", "
- /* XXX If we ever support multiple windows remember that the idle
- * callback is global.
+ /*
+ ** XXX If we ever support multiple windows remember that the idle
+ ** callback is global.
*/
MR_Word mglut_idle_callback;
Index: glut.color_map.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/graphics/mercury_glut/glut.color_map.m,v
retrieving revision 1.3
diff -u -b -r1.3 glut.color_map.m
--- glut.color_map.m 8 Aug 2005 07:13:20 -0000 1.3
+++ glut.color_map.m 20 Apr 2006 02:13:40 -0000
@@ -1,25 +1,30 @@
%-----------------------------------------------------------------------------%
+% vim: ft=mercury ts=4 sw=4 et
+%-----------------------------------------------------------------------------%
% Copyright (C) 2004-2005 The University of Melbourne.
% This file may only be copied under the terms of the GNU Library General
% Public License - see the file COPYING.LIB in the Mercury distribution.
%-----------------------------------------------------------------------------%
%
-% file: glut.color_map.m
-% author: juliensf
+% File: glut.color_map.m.
+% Author: juliensf.
%
% This module contains routines for manipulating colormaps when using
% color index mode. This is necessary since OpenGL does not include any
% means of doing this.
%
%-----------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
:- module glut.color_map.
-
:- interface.
%-----------------------------------------------------------------------------%
-:- type component ---> red ; blue ; green.
+:- type component
+ ---> red
+ ; blue
+ ; green.
% color_map.set_color(Index, Red, Blue, Green, !IO).
% Set the colormap entry for the given index.
Index: glut.font.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/graphics/mercury_glut/glut.font.m,v
retrieving revision 1.3
diff -u -b -r1.3 glut.font.m
--- glut.font.m 8 Aug 2005 07:13:20 -0000 1.3
+++ glut.font.m 20 Apr 2006 02:15:03 -0000
@@ -1,18 +1,20 @@
%-----------------------------------------------------------------------------%
+% vim: ft=mercury ts=4 sw=4 et
+%-----------------------------------------------------------------------------%
% Copyright (C) 2004-2005 The University of Melbourne.
% This file may only be copied under the terms of the GNU Library General
% Public License - see the file COPYING.LIB in the Mercury distribution.
%-----------------------------------------------------------------------------%
%
-% file: glut.font.m
-% author: juliensf
+% File: glut.font.m.
+% Author: juliensf.
%
% This module provides an interface to the GLUT font API.
%
%-----------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
:- module glut.font.
-
:- interface.
%----------------------------------------------------------------------------%
@@ -33,8 +35,8 @@
% lists. Adjusts the current raster position based upon
% the width of the character.
%
-:- pred font.bitmap_character(bitmap_font::in, char::in, io::di,
- io::uo) is det.
+:- pred font.bitmap_character(bitmap_font::in, char::in,
+ io::di, io::uo) is det.
% Return the width of the character in pixels when rendered
% using the specified font.
Index: glut.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/graphics/mercury_glut/glut.m,v
retrieving revision 1.7
diff -u -b -r1.7 glut.m
--- glut.m 30 Mar 2006 01:35:20 -0000 1.7
+++ glut.m 20 Apr 2006 02:11:37 -0000
@@ -1,18 +1,20 @@
%-----------------------------------------------------------------------------%
+% vim: ft=mercury ts=4 sw=4 et
+%-----------------------------------------------------------------------------%
% Copyright (C) 2004-2006 The University of Melbourne.
% This file may only be copied under the terms of the GNU Library General
% Public License - see the file COPYING.LIB in the Mercury distribution.
%-----------------------------------------------------------------------------%
%
-% file: glut.m
-% author: juliensf
+% File: glut.m.
+% Author: juliensf.
%
% This is partial Mercury binding to the GL Utility Library (GLUT).
%
%-----------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
:- module glut.
-
:- interface.
:- include_module callback.
Index: glut.model.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/graphics/mercury_glut/glut.model.m,v
retrieving revision 1.3
diff -u -b -r1.3 glut.model.m
--- glut.model.m 8 Aug 2005 07:13:21 -0000 1.3
+++ glut.model.m 20 Apr 2006 02:16:20 -0000
@@ -1,16 +1,18 @@
%-----------------------------------------------------------------------------%
+% vim: ft=mercury ts=4 sw=4 et
+%-----------------------------------------------------------------------------%
% Copyright (C) 2004-2005 The University of Melbourne.
% This file may only be copied under the terms of the GNU Library General
% Public License - see the file COPYING.LIB in the Mercury distribution.
%-----------------------------------------------------------------------------%
%
-% file: glut.model.m
-% author: juliensf
+% File: glut.model.m.
+% Author: juliensf.
%
%-----------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
:- module glut.model.
-
:- interface.
%-----------------------------------------------------------------------------%
Index: glut.overlay.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/graphics/mercury_glut/glut.overlay.m,v
retrieving revision 1.4
diff -u -b -r1.4 glut.overlay.m
--- glut.overlay.m 8 Aug 2005 07:13:21 -0000 1.4
+++ glut.overlay.m 20 Apr 2006 02:28:03 -0000
@@ -1,25 +1,29 @@
%-----------------------------------------------------------------------------%
+% vim: ft=mercury ts=4 sw=4 et
+%-----------------------------------------------------------------------------%
% Copyright (C) 2004-2005 The University of Melbourne.
% This file may only be copied under the terms of the GNU Library General
% Public License - see the file COPYING.LIB in the Mercury distribution.
%-----------------------------------------------------------------------------%
%
-% file: glut.overlay.m
-% author: juliensf
+% File: glut.overlay.m.
+% Author: juliensf.
%
% This module provides an interface to the GLUT overlay API.
%
%-----------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
:- module glut.overlay.
-
:- interface.
:- import_module glut.window.
%-----------------------------------------------------------------------------%
-:- type layer ---> normal ; overlay.
+:- type layer
+ ---> normal
+ ; overlay.
% Returns `yes' of it is possible to establish an overlay for the
% current window; `no' otherwise.
@@ -279,7 +283,7 @@
( Result0 = 0 -> Result = no
; Result0 = 1 -> Result = yes(no)
; Result0 = 2 -> Result = yes(yes)
- ; error("Uknown value returned from overlay.overlay_damaged_2/3.")
+ ; error("Unknown value returned from overlay.overlay_damaged_2/3.")
).
% Returns `0' if there is no overlay
@@ -311,7 +315,7 @@
overlay.transparent_index_2(Result, !IO),
( Result = -1 -> MaybeIndex = no
; Result >= 0 -> MaybeIndex = yes(Result)
- ; error("Unknown value returned from overlay.tranparent_index_2/3.")
+ ; error("Unknown value returned from overlay.transparent_index_2/3.")
).
:- pred overlay.transparent_index_2(int::out, io::di, io::uo) is det.
Index: glut.window.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/graphics/mercury_glut/glut.window.m,v
retrieving revision 1.4
diff -u -b -r1.4 glut.window.m
--- glut.window.m 8 Aug 2005 07:13:21 -0000 1.4
+++ glut.window.m 20 Apr 2006 02:25:49 -0000
@@ -1,21 +1,24 @@
%-----------------------------------------------------------------------------%
+% vim: ft=mercury ts=4 sw=4 et
+%-----------------------------------------------------------------------------%
% Copyright (C) 2004-2005 The University of Melbourne.
% This file may only be copied under the terms of the GNU Library General
% Public License - see the file COPYING.LIB in the Mercury distribution.
%-----------------------------------------------------------------------------%
%
-% file: glut.window.m
-% author: juliensf
+% File: glut.window.m.
+% Author: juliensf.
%
-% This module provides an interface to the GLUT window managment API.
+% This module provides an interface to the GLUT window management API.
% GLUT supports two types of windows: top-level windows and subwindows.
% Both sorts support OpenGL rendering and GLUT callbacks.
%
% XXX We do not currently support multiple windows.
+%
+%-----------------------------------------------------------------------------%
%-----------------------------------------------------------------------------%
:- module glut.window.
-
:- interface.
%-----------------------------------------------------------------------------%
@@ -137,6 +140,7 @@
; full_crosshair
% Full screen cross hair cursor (if possible)
% Otherwise the same as `crosshair'.
+
; none % Invisible cursor.
; inherit. % Use parent window's cursor.
@@ -184,45 +188,61 @@
:- type window.state
---> x
% Current X location in pixels.
+
; y
% Current Y location in pixels.
+
; window_width
% Width of the current window in pixels.
+
; window_height
% Height of the current window in pixels.
+
; buffer_size
% Number of bits in the current layer of
% the current window's color buffer.
+
; stencil_size
% Number of bits in the current layer of
% the current window's stencil buffer.
+
; depth_size
% Number of bits in the current layer of
% the current window's depth buffer.
+
; red_size
% Number of bits of red stored in the current
% layer of the current window's color buffer.
% Zero if in color index mode.
+
; green_size
% As above but the number of green bits.
+
; blue_size
% As above but the number of blue bits.
+
; alpha_size
% As above but the number of alpha bits.
+
; accum_red_size
% Number of bits of red in the accumulation
% buffer of the current layer of the current
% window. Zero if in color index mode.
+
; accum_green_size
% As above but the number of green bits.
+
; accum_blue_size
% As above but the number of blue bits.
+
; accum_alpha_size
% As above but the number of alpha bits.
+
; colormap_size
% Size of the color index colormap of the
% current layer of the current window.
% Zero if in RGBA mode.
+
; number_samples
% Number of samples for multisampling for the
% current layer of the current window.
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list