From cf98d3da936e89e3eb4e8e4be99446f8804ade29 Mon Sep 17 00:00:00 2001 From: Keri Harris Date: Mon, 23 Oct 2006 04:12:53 +0000 Subject: Split curs.m into two modules in order to handle parallel builds. (Portage version: 2.1.2_pre3-r6) --- dev-lang/mercury-extras/ChangeLog | 9 +- .../files/mercury-extras-0.12.2-curs.patch | 637 +++++++++++++++++++++ .../files/mercury-extras-0.13.0-curs.patch | 600 +++++++++++++++++++ .../mercury-extras/mercury-extras-0.12.2-r2.ebuild | 19 +- .../mercury-extras/mercury-extras-0.13.0.ebuild | 18 +- 5 files changed, 1265 insertions(+), 18 deletions(-) create mode 100644 dev-lang/mercury-extras/files/mercury-extras-0.12.2-curs.patch create mode 100644 dev-lang/mercury-extras/files/mercury-extras-0.13.0-curs.patch (limited to 'dev-lang') diff --git a/dev-lang/mercury-extras/ChangeLog b/dev-lang/mercury-extras/ChangeLog index 1d15871a6d71..6ea8450937db 100644 --- a/dev-lang/mercury-extras/ChangeLog +++ b/dev-lang/mercury-extras/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for dev-lang/mercury-extras # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/mercury-extras/ChangeLog,v 1.53 2006/10/23 00:18:26 keri Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-lang/mercury-extras/ChangeLog,v 1.54 2006/10/23 04:12:53 keri Exp $ + + 23 Oct 2006; keri + +files/mercury-extras-0.12.2-curs.patch, + -files/mercury-extras-0.12.2-parallel-mmake.patch, + +files/mercury-extras-0.13.0-curs.patch, mercury-extras-0.12.2-r2.ebuild, + mercury-extras-0.13.0.ebuild: + Split curs.m into two modules in order to handle parallel builds. 23 Oct 2006; keri mercury-extras-0.13.0.ebuild: Add ~sparc to KEYWORDS. diff --git a/dev-lang/mercury-extras/files/mercury-extras-0.12.2-curs.patch b/dev-lang/mercury-extras/files/mercury-extras-0.12.2-curs.patch new file mode 100644 index 000000000000..938af3b43fc3 --- /dev/null +++ b/dev-lang/mercury-extras/files/mercury-extras-0.12.2-curs.patch @@ -0,0 +1,637 @@ +diff -urN mercury-extras-0.12.2.orig/curs/curs.m mercury-extras-0.12.2/curs/curs.m +--- mercury-extras-0.12.2.orig/curs/curs.m 2006-10-10 19:42:19.000000000 +1300 ++++ mercury-extras-0.12.2/curs/curs.m 2006-10-10 20:06:42.000000000 +1300 +@@ -30,7 +30,7 @@ + + :- import_module bool, io, string, char, int. + +- ++:- include_module curs__panel. + + % Start a curses session (colour, unbuffered input, no echoing, + % invisible cursor if possible, scrolling on when output past +@@ -220,104 +220,6 @@ + :- func cyan = colour. + :- func white = colour. + +- % ------------------------------------------------------------------------ % +- % ------------------------------------------------------------------------ % +- +- % Panels are windows over the main display; they may be +- % stacked, moved, ordered and hidden. Contents of panels +- % closer to the top of the stack obscure the parts of panels +- % they overlap that are lower in the stack. +- % +- :- module panel. +- +- :- interface. +- +- +- +- :- type panel. +- +- % new(Rows, Cols, Row, Col, Attr, Panel) creates a new panel +- % Panel whose size is given by (Rows, Cols) and whose position +- % on the display is given by (Row, Col). The new panel starts +- % visible and at the top of the stack. The default attributes +- % for the panel are set to Attr. +- % +- :- pred new(int::in, int::in, int::in, int::in, attr::in, panel::out, +- io__state::di, io__state::uo) is det. +- +- % Destroy a panel. +- % +- :- pred delete(panel::in, io__state::di, io__state::uo) is det. +- +- % Raise/lower a panel to the top/bottom of the stack. +- % +- :- pred raise(panel::in, io__state::di, io__state::uo) is det. +- +- :- pred lower(panel::in, io__state::di, io__state::uo) is det. +- +- % Hide/reveal a panel (revealing places it at the top of the stack). +- % +- :- pred hide(panel::in, io__state::di, io__state::uo) is det. +- +- :- pred reveal(panel::in, io__state::di, io__state::uo) is det. +- +- % Move a panel to (Row, Col) on the display. +- % +- :- pred relocate(panel::in, int::in, int::in, +- io__state::di, io__state::uo) is det. +- +- % Clear a panel. +- % +- :- pred clear(panel::in, io__state::di, io__state::uo) is det. +- +- % Move the virtual cursor to given row and column; (0, 0) are the +- % coordinates for the upper left hand corner of the panel. +- % +- :- pred move(panel::in, int::in, int::in, +- io__state::di, io__state::uo) is det. +- +- % Add a char/string to a panel with the given attributes. +- % Note that char codes are passed rather than plain chars. +- % +- :- pred addch(panel::in, attr::in, int::in, +- io__state::di, io__state::uo) is det. +- +- :- pred addstr(panel::in, attr::in, string::in, +- io__state::di, io__state::uo) is det. +- +- % Turn on/off or set attributes that will be applied by default. +- % +- :- pred attr_on(panel::in, attr::in, io__state::di, io__state::uo) is det. +- :- pred attr_off(panel::in, attr::in, io__state::di, io__state::uo) is det. +- :- pred attr_set(panel::in, attr::in, io__state::di, io__state::uo) is det. +- +- % Update the display (also calls doupdate). +- % NOTE that doupdate does not call update_panels. +- % +- :- pred update_panels(io__state::di, io__state::uo) is det. +- +- +- +- % Draws a border around the inside edge of the display. +- % +- :- pred border(panel::in, io__state::di, io__state::uo) is det. +- +- % Draws an horizontal line of length N moving to the right. +- % +- :- pred hline(panel::in, int::in, int::in, +- io__state::di, io__state::uo) is det. +- +- % Draws a vertical line of length N moving down. +- % +- :- pred vline(panel::in, int::in, int::in, +- io__state::di, io__state::uo) is det. +- +- :- end_module panel. +- +- % ------------------------------------------------------------------------ % +- % ------------------------------------------------------------------------ % +- +-% ---------------------------------------------------------------------------- % + % ---------------------------------------------------------------------------- % + + :- implementation. +@@ -936,219 +838,4 @@ + + "). + +- % ------------------------------------------------------------------------ % +- % ------------------------------------------------------------------------ % +- +- :- module panel. +- +- :- implementation. +- +- :- type panel == c_pointer. +- +- % ------------------------------------------------------------------------ % +- +- :- pragma c_header_code(" +- +- #include +- #include +- +- "). +- +- % ------------------------------------------------------------------------ % +- +- :- pragma foreign_proc("C", new(Rows::in, Cols::in, Row::in, Col::in, Attr::in, +- Panel::out, IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], " +- +- WINDOW *w = newwin(Rows, Cols, Row, Col); +- scrollok(w, TRUE); +- wattrset(w, Attr); +- wcolor_set(w, Attr, NULL); +- wclear(w); +- (*(PANEL**)&(Panel)) = new_panel(w); +- +- IO = IO0; +- +- "). +- +- % ------------------------------------------------------------------------ % +- +- :- pragma foreign_proc("C", delete(Panel::in, IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], " +- +- delwin(panel_window((PANEL *)Panel)); +- del_panel((PANEL *)Panel); +- +- IO = IO0; +- +- "). +- +- % ------------------------------------------------------------------------ % +- +- :- pragma foreign_proc("C", raise(Panel::in, IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], " +- +- top_panel((PANEL *)Panel); +- +- IO = IO0; +- +- "). +- +- % ------------------------------------------------------------------------ % +- +- :- pragma foreign_proc("C", lower(Panel::in, IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], " +- +- bottom_panel((PANEL *)Panel); +- +- IO = IO0; +- +- "). +- +- % ------------------------------------------------------------------------ % +- +- :- pragma foreign_proc("C", hide(Panel::in, IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], " +- +- hide_panel((PANEL *)Panel); +- +- IO = IO0; +- +- "). +- +- % ------------------------------------------------------------------------ % +- +- :- pragma foreign_proc("C", reveal(Panel::in, IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], " +- +- show_panel((PANEL *)Panel); +- +- IO = IO0; +- +- "). +- +- % ------------------------------------------------------------------------ % +- +- :- pragma foreign_proc("C", relocate(Panel::in, Row::in, Col::in, IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], " +- +- move_panel((PANEL *)Panel, Row, Col); +- +- IO = IO0; +- +- "). +- +- % ------------------------------------------------------------------------ % +- +- :- pragma foreign_proc("C", clear(Panel::in, IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], " +- +- wclear(panel_window((PANEL *)Panel)); +- +- IO = IO0; +- +- "). +- +- % ------------------------------------------------------------------------ % +- +- :- pragma foreign_proc("C", move(Panel::in, Row::in, Col::in, IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], " +- +- wmove(panel_window((PANEL *)Panel), Row, Col); +- +- IO = IO0; +- +- "). +- +- % ------------------------------------------------------------------------ % +- +- :- pragma foreign_proc("C", addch(Panel::in, Attr::in, CharCode::in, IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], " +- +- waddch(panel_window((PANEL *)Panel), (chtype)Attr | (chtype)CharCode); +- +- IO = IO0; +- +- "). +- +- % ------------------------------------------------------------------------ % +- +- addstr(Panel, Attr, Str) --> +- string__foldl( +- ( pred(Char::in, di, uo) is det --> +- addch(Panel, Attr, char__to_int(Char)) +- ), +- Str +- ). +- +- % ------------------------------------------------------------------------ % +- +- :- pragma foreign_proc("C", attr_on(Panel::in, Attr::in, IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], " +- +- wattron(panel_window((PANEL *)Panel), Attr); +- IO = IO0; +- +- "). +- :- pragma foreign_proc("C", attr_off(Panel::in, Attr::in, IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], " +- +- wattroff(panel_window((PANEL *)Panel), Attr); +- IO = IO0; +- +- "). +- :- pragma foreign_proc("C", attr_set(Panel::in, Attr::in, IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], " +- +- wattrset(panel_window((PANEL *)Panel), Attr); +- IO = IO0; +- +- "). +- +- % ------------------------------------------------------------------------ % +- +- :- pragma foreign_proc("C", update_panels(IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], " +- +- update_panels(); +- doupdate(); +- +- IO = IO0; +- +- "). +- +- % ------------------------------------------------------------------------ % +- +- :- pragma foreign_proc("C", border(Panel::in, IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], " +- +- wborder(panel_window((PANEL *)Panel), 0, 0, 0, 0, 0, 0, 0, 0); +- IO = IO0; +- +- "). +- +- :- pragma foreign_proc("C", hline(Panel::in, C::in, N::in, IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], " +- +- whline(panel_window((PANEL *)Panel), C, N); +- IO = IO0; +- +- "). +- +- :- pragma foreign_proc("C", vline(Panel::in, C::in, N::in, IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], " +- +- wvline(panel_window((PANEL *)Panel), C, N); +- IO = IO0; +- +- "). +- +- % ------------------------------------------------------------------------ % +- +- :- end_module panel. +- +- % ------------------------------------------------------------------------ % +- % ------------------------------------------------------------------------ % +- +-% ---------------------------------------------------------------------------- % + % ---------------------------------------------------------------------------- % +diff -urN mercury-extras-0.12.2.orig/curs/curs.panel.m mercury-extras-0.12.2/curs/curs.panel.m +--- mercury-extras-0.12.2.orig/curs/curs.panel.m 1970-01-01 12:00:00.000000000 +1200 ++++ mercury-extras-0.12.2/curs/curs.panel.m 2006-10-10 20:07:35.000000000 +1300 +@@ -0,0 +1,296 @@ ++% ------------------------------------------------------------------------ % ++ ++ % Panels are windows over the main display; they may be ++ % stacked, moved, ordered and hidden. Contents of panels ++ % closer to the top of the stack obscure the parts of panels ++ % they overlap that are lower in the stack. ++ % ++:- module curs__panel. ++ ++:- interface. ++ ++ ++ ++:- type panel. ++ ++ % new(Rows, Cols, Row, Col, Attr, Panel) creates a new panel ++ % Panel whose size is given by (Rows, Cols) and whose position ++ % on the display is given by (Row, Col). The new panel starts ++ % visible and at the top of the stack. The default attributes ++ % for the panel are set to Attr. ++ % ++:- pred new(int::in, int::in, int::in, int::in, attr::in, panel::out, ++ io__state::di, io__state::uo) is det. ++ ++ % Destroy a panel. ++ % ++:- pred delete(panel::in, io__state::di, io__state::uo) is det. ++ ++ % Raise/lower a panel to the top/bottom of the stack. ++ % ++:- pred raise(panel::in, io__state::di, io__state::uo) is det. ++ ++:- pred lower(panel::in, io__state::di, io__state::uo) is det. ++ ++ % Hide/reveal a panel (revealing places it at the top of the stack). ++ % ++:- pred hide(panel::in, io__state::di, io__state::uo) is det. ++ ++:- pred reveal(panel::in, io__state::di, io__state::uo) is det. ++ ++ % Move a panel to (Row, Col) on the display. ++ % ++:- pred relocate(panel::in, int::in, int::in, ++ io__state::di, io__state::uo) is det. ++ ++ % Clear a panel. ++ % ++:- pred clear(panel::in, io__state::di, io__state::uo) is det. ++ ++ % Move the virtual cursor to given row and column; (0, 0) are the ++ % coordinates for the upper left hand corner of the panel. ++ % ++:- pred move(panel::in, int::in, int::in, ++ io__state::di, io__state::uo) is det. ++ ++ % Add a char/string to a panel with the given attributes. ++ % Note that char codes are passed rather than plain chars. ++ % ++:- pred addch(panel::in, attr::in, int::in, ++ io__state::di, io__state::uo) is det. ++ ++:- pred addstr(panel::in, attr::in, string::in, ++ io__state::di, io__state::uo) is det. ++ ++ % Turn on/off or set attributes that will be applied by default. ++ % ++:- pred attr_on(panel::in, attr::in, io__state::di, io__state::uo) is det. ++:- pred attr_off(panel::in, attr::in, io__state::di, io__state::uo) is det. ++:- pred attr_set(panel::in, attr::in, io__state::di, io__state::uo) is det. ++ ++ % Update the display (also calls doupdate). ++ % NOTE that doupdate does not call update_panels. ++ % ++:- pred update_panels(io__state::di, io__state::uo) is det. ++ ++ ++ ++ % Draws a border around the inside edge of the display. ++ % ++:- pred border(panel::in, io__state::di, io__state::uo) is det. ++ ++ % Draws an horizontal line of length N moving to the right. ++ % ++:- pred hline(panel::in, int::in, int::in, ++ io__state::di, io__state::uo) is det. ++ ++ % Draws a vertical line of length N moving down. ++ % ++:- pred vline(panel::in, int::in, int::in, ++ io__state::di, io__state::uo) is det. ++ ++% ------------------------------------------------------------------------ % ++ ++:- implementation. ++ ++:- type panel == c_pointer. ++ ++% ------------------------------------------------------------------------ % ++ ++:- pragma c_header_code(" ++ ++#include ++#include ++ ++"). ++ ++% ------------------------------------------------------------------------ % ++ ++:- pragma foreign_proc("C", new(Rows::in, Cols::in, Row::in, Col::in, Attr::in, ++ Panel::out, IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], " ++ ++ WINDOW *w = newwin(Rows, Cols, Row, Col); ++ scrollok(w, TRUE); ++ wattrset(w, Attr); ++ wcolor_set(w, Attr, NULL); ++ wclear(w); ++ (*(PANEL**)&(Panel)) = new_panel(w); ++ ++ IO = IO0; ++ ++"). ++ ++% ------------------------------------------------------------------------ % ++ ++:- pragma foreign_proc("C", delete(Panel::in, IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], " ++ ++ delwin(panel_window((PANEL *)Panel)); ++ del_panel((PANEL *)Panel); ++ ++ IO = IO0; ++ ++"). ++ ++% ------------------------------------------------------------------------ % ++ ++:- pragma foreign_proc("C", raise(Panel::in, IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], " ++ ++ top_panel((PANEL *)Panel); ++ ++ IO = IO0; ++ ++"). ++ ++% ------------------------------------------------------------------------ % ++ ++:- pragma foreign_proc("C", lower(Panel::in, IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], " ++ ++ bottom_panel((PANEL *)Panel); ++ ++ IO = IO0; ++ ++"). ++ ++% ------------------------------------------------------------------------ % ++ ++:- pragma foreign_proc("C", hide(Panel::in, IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], " ++ ++ hide_panel((PANEL *)Panel); ++ ++ IO = IO0; ++ ++"). ++ ++% ------------------------------------------------------------------------ % ++ ++:- pragma foreign_proc("C", reveal(Panel::in, IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], " ++ ++ show_panel((PANEL *)Panel); ++ ++ IO = IO0; ++ ++"). ++ ++% ------------------------------------------------------------------------ % ++ ++:- pragma foreign_proc("C", relocate(Panel::in, Row::in, Col::in, IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], " ++ ++ move_panel((PANEL *)Panel, Row, Col); ++ ++ IO = IO0; ++ ++"). ++ ++% ------------------------------------------------------------------------ % ++ ++:- pragma foreign_proc("C", clear(Panel::in, IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], " ++ ++ wclear(panel_window((PANEL *)Panel)); ++ ++ IO = IO0; ++ ++"). ++ ++% ------------------------------------------------------------------------ % ++ ++:- pragma foreign_proc("C", move(Panel::in, Row::in, Col::in, IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], " ++ ++ wmove(panel_window((PANEL *)Panel), Row, Col); ++ ++ IO = IO0; ++ ++"). ++ ++% ------------------------------------------------------------------------ % ++ ++:- pragma foreign_proc("C", addch(Panel::in, Attr::in, CharCode::in, IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], " ++ ++ waddch(panel_window((PANEL *)Panel), (chtype)Attr | (chtype)CharCode); ++ ++ IO = IO0; ++ ++"). ++ ++% ------------------------------------------------------------------------ % ++ ++addstr(Panel, Attr, Str) --> ++ string__foldl( ++ ( pred(Char::in, di, uo) is det --> ++ addch(Panel, Attr, char__to_int(Char)) ++ ), ++ Str ++ ). ++ ++% ------------------------------------------------------------------------ % ++ ++:- pragma foreign_proc("C", attr_on(Panel::in, Attr::in, IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], " ++ ++ wattron(panel_window((PANEL *)Panel), Attr); ++ IO = IO0; ++ ++"). ++:- pragma foreign_proc("C", attr_off(Panel::in, Attr::in, IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], " ++ ++ wattroff(panel_window((PANEL *)Panel), Attr); ++ IO = IO0; ++ ++"). ++:- pragma foreign_proc("C", attr_set(Panel::in, Attr::in, IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], " ++ ++ wattrset(panel_window((PANEL *)Panel), Attr); ++ IO = IO0; ++ ++"). ++ ++% ------------------------------------------------------------------------ % ++ ++:- pragma foreign_proc("C", update_panels(IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], " ++ ++ update_panels(); ++ doupdate(); ++ ++ IO = IO0; ++ ++"). ++ ++% ------------------------------------------------------------------------ % ++ ++:- pragma foreign_proc("C", border(Panel::in, IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], " ++ ++ wborder(panel_window((PANEL *)Panel), 0, 0, 0, 0, 0, 0, 0, 0); ++ IO = IO0; ++ ++"). ++ ++:- pragma foreign_proc("C", hline(Panel::in, C::in, N::in, IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], " ++ ++ whline(panel_window((PANEL *)Panel), C, N); ++ IO = IO0; ++ ++"). ++ ++:- pragma foreign_proc("C", vline(Panel::in, C::in, N::in, IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], " ++ ++ wvline(panel_window((PANEL *)Panel), C, N); ++ IO = IO0; ++ ++"). ++ ++% ------------------------------------------------------------------------ % diff --git a/dev-lang/mercury-extras/files/mercury-extras-0.13.0-curs.patch b/dev-lang/mercury-extras/files/mercury-extras-0.13.0-curs.patch new file mode 100644 index 000000000000..485e4a440e0d --- /dev/null +++ b/dev-lang/mercury-extras/files/mercury-extras-0.13.0-curs.patch @@ -0,0 +1,600 @@ +diff -urN mercury-extras-0.13.0.orig/curs/curs.m mercury-extras-0.13.0/curs/curs.m +--- mercury-extras-0.13.0.orig/curs/curs.m 2006-04-21 15:42:46.000000000 +1200 ++++ mercury-extras-0.13.0/curs/curs.m 2006-10-23 17:00:50.000000000 +1300 +@@ -31,6 +31,8 @@ + :- import_module io. + :- import_module string. + ++:- include_module curs__panel. ++ + %-----------------------------------------------------------------------------% + + % Start a curses session (colour, unbuffered input, no echoing, +@@ -210,90 +212,6 @@ + :- func cyan = colour. + :- func white = colour. + +- %-------------------------------------------------------------------------% +- %-------------------------------------------------------------------------% +- +- % Panels are windows over the main display; they may be +- % stacked, moved, ordered and hidden. Contents of panels +- % closer to the top of the stack obscure the parts of panels +- % they overlap that are lower in the stack. +- % +- :- module panel. +- :- interface. +- +- :- type panel. +- +- % new(Rows, Cols, Row, Col, Attr, Panel) creates a new panel +- % Panel whose size is given by (Rows, Cols) and whose position +- % on the display is given by (Row, Col). The new panel starts +- % visible and at the top of the stack. The default attributes +- % for the panel are set to Attr. +- % +- :- pred new(int::in, int::in, int::in, int::in, attr::in, panel::out, +- io::di, io::uo) is det. +- +- % Destroy a panel. +- % +- :- pred delete(panel::in, io::di, io::uo) is det. +- +- % Raise/lower a panel to the top/bottom of the stack. +- % +- :- pred raise(panel::in, io::di, io::uo) is det. +- :- pred lower(panel::in, io::di, io::uo) is det. +- +- % Hide/reveal a panel (revealing places it at the top of the stack). +- % +- :- pred hide(panel::in, io::di, io::uo) is det. +- :- pred reveal(panel::in, io::di, io::uo) is det. +- +- % Move a panel to (Row, Col) on the display. +- % +- :- pred relocate(panel::in, int::in, int::in, io::di, io::uo) is det. +- +- % Clear a panel. +- % +- :- pred clear(panel::in, io::di, io::uo) is det. +- +- % Move the virtual cursor to given row and column; (0, 0) are the +- % coordinates for the upper left hand corner of the panel. +- % +- :- pred move(panel::in, int::in, int::in, io::di, io::uo) is det. +- +- % Add a char/string to a panel with the given attributes. +- % Note that char codes are passed rather than plain chars. +- % +- :- pred addch(panel::in, attr::in, int::in, io::di, io::uo) is det. +- :- pred addstr(panel::in, attr::in, string::in, io::di, io::uo) is det. +- +- % Turn on/off or set attributes that will be applied by default. +- % +- :- pred attr_on(panel::in, attr::in, io::di, io::uo) is det. +- :- pred attr_off(panel::in, attr::in, io::di, io::uo) is det. +- :- pred attr_set(panel::in, attr::in, io::di, io::uo) is det. +- +- % Update the display (also calls doupdate). +- % NOTE: doupdate does not call update_panels. +- % +- :- pred update_panels(io::di, io::uo) is det. +- +- % Draws a border around the inside edge of the display. +- % +- :- pred border(panel::in, io::di, io::uo) is det. +- +- % Draws an horizontal line of length N moving to the right. +- % +- :- pred hline(panel::in, int::in, int::in, io::di, io::uo) is det. +- +- % Draws a vertical line of length N moving down. +- % +- :- pred vline(panel::in, int::in, int::in, io::di, io::uo) is det. +- +- :- end_module panel. +- +- %-------------------------------------------------------------------------% +- %-------------------------------------------------------------------------% +- +-%-----------------------------------------------------------------------------% + %-----------------------------------------------------------------------------% + + :- implementation. +@@ -1044,210 +962,4 @@ + IO = IO0; + "). + +- %-------------------------------------------------------------------------% +- %-------------------------------------------------------------------------% +- +- :- module panel. +- +- :- implementation. +- +- %-------------------------------------------------------------------------% +- +- :- pragma foreign_decl("C", " +- +- #include +- #include +- +- "). +- +- :- pragma foreign_type("C", panel, "PANEL *"). +- +- %-------------------------------------------------------------------------% +- +- :- pragma foreign_proc("C", +- new(Rows::in, Cols::in, Row::in, Col::in, Attr::in, Panel::out, +- IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], +- " +- WINDOW *w = newwin(Rows, Cols, Row, Col); +- scrollok(w, TRUE); +- wattrset(w, Attr); +- wcolor_set(w, Attr, NULL); +- wclear(w); +- Panel = new_panel(w); +- +- IO = IO0; +- "). +- +- %-------------------------------------------------------------------------% +- +- :- pragma foreign_proc("C", +- delete(Panel::in, IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], +- " +- delwin(panel_window(Panel)); +- del_panel(Panel); +- +- IO = IO0; +- "). +- +- %-------------------------------------------------------------------------% +- +- :- pragma foreign_proc("C", +- raise(Panel::in, IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], +- " +- top_panel(Panel); +- IO = IO0; +- "). +- +- %-------------------------------------------------------------------------% +- +- :- pragma foreign_proc("C", +- lower(Panel::in, IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], +- " +- bottom_panel(Panel); +- IO = IO0; +- "). +- +- %-------------------------------------------------------------------------% +- +- :- pragma foreign_proc("C", +- hide(Panel::in, IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], +- " +- hide_panel(Panel); +- IO = IO0; +- "). +- +- %-------------------------------------------------------------------------% +- +- :- pragma foreign_proc("C", +- reveal(Panel::in, IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], +- " +- show_panel(Panel); +- IO = IO0; +- "). +- +- %-------------------------------------------------------------------------% +- +- :- pragma foreign_proc("C", +- relocate(Panel::in, Row::in, Col::in, IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], +- " +- move_panel(Panel, Row, Col); +- IO = IO0; +- "). +- +- %-------------------------------------------------------------------------% +- +- :- pragma foreign_proc("C", +- clear(Panel::in, IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], +- " +- wclear(panel_window(Panel)); +- IO = IO0; +- "). +- +- %-------------------------------------------------------------------------% +- +- :- pragma foreign_proc("C", +- move(Panel::in, Row::in, Col::in, IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], +- " +- wmove(panel_window(Panel), Row, Col); +- IO = IO0; +- "). +- +- %-------------------------------------------------------------------------% +- +- :- pragma foreign_proc("C", +- addch(Panel::in, Attr::in, CharCode::in, IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], +- " +- waddch(panel_window(Panel), (chtype)Attr | (chtype)CharCode); +- IO = IO0; +- "). +- +- %-------------------------------------------------------------------------% +- +- addstr(Panel, Attr, Str, !IO) :- +- string.foldl( +- ( pred(Char::in, !.IO::di, !:IO::uo) is det :- +- addch(Panel, Attr, char.to_int(Char), !IO) +- ), +- Str, !IO +- ). +- +- %-------------------------------------------------------------------------% +- +- :- pragma foreign_proc("C", +- attr_on(Panel::in, Attr::in, IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], +- " +- wattron(panel_window(Panel), Attr); +- IO = IO0; +- "). +- +- :- pragma foreign_proc("C", +- attr_off(Panel::in, Attr::in, IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], +- " +- wattroff(panel_window(Panel), Attr); +- IO = IO0; +- "). +- +- :- pragma foreign_proc("C", +- attr_set(Panel::in, Attr::in, IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], +- " +- wattrset(panel_window(Panel), Attr); +- IO = IO0; +- "). +- +- %-------------------------------------------------------------------------% +- +- :- pragma foreign_proc("C", +- update_panels(IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], +- " +- update_panels(); +- doupdate(); +- IO = IO0; +- "). +- +- %-------------------------------------------------------------------------% +- +- :- pragma foreign_proc("C", +- border(Panel::in, IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], +- " +- wborder(panel_window(Panel), 0, 0, 0, 0, 0, 0, 0, 0); +- IO = IO0; +- "). +- +- :- pragma foreign_proc("C", +- hline(Panel::in, C::in, N::in, IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], +- " +- whline(panel_window(Panel), C, N); +- IO = IO0; +- "). +- +- :- pragma foreign_proc("C", +- vline(Panel::in, C::in, N::in, IO0::di, IO::uo), +- [will_not_call_mercury, promise_pure], +- " +- wvline(panel_window(Panel), C, N); +- IO = IO0; +- "). +- +- %-------------------------------------------------------------------------% +- :- end_module panel. +- %-------------------------------------------------------------------------% +- %-------------------------------------------------------------------------% +- +-%-----------------------------------------------------------------------------% + %-----------------------------------------------------------------------------% +diff -urN mercury-extras-0.13.0.orig/curs/curs.panel.m mercury-extras-0.13.0/curs/curs.panel.m +--- mercury-extras-0.13.0.orig/curs/curs.panel.m 1970-01-01 12:00:00.000000000 +1200 ++++ mercury-extras-0.13.0/curs/curs.panel.m 2006-10-23 16:52:58.000000000 +1300 +@@ -0,0 +1,282 @@ ++%-----------------------------------------------------------------------------% ++% curs.panel.m ++% Copyright (C) 2001 Ralph Becket ++% Thu Jan 11 13:47:25 GMT 2001 ++% vim: ts=4 sw=4 et tw=0 wm=0 ff=unix ft=mercury ++% ++% THIS FILE IS HEREBY CONTRIBUTED TO THE MERCURY PROJECT TO ++% BE RELEASED UNDER WHATEVER LICENCE IS DEEMED APPROPRIATE ++% BY THE ADMINISTRATORS OF THE MERCURY PROJECT. ++% ++% Simplified Mercury interface to the ncurses panel library. ++% ++%-----------------------------------------------------------------------------% ++ ++:- module curs__panel. ++:- interface. ++ ++:- type panel. ++ ++ % new(Rows, Cols, Row, Col, Attr, Panel) creates a new panel ++ % Panel whose size is given by (Rows, Cols) and whose position ++ % on the display is given by (Row, Col). The new panel starts ++ % visible and at the top of the stack. The default attributes ++ % for the panel are set to Attr. ++ % ++:- pred new(int::in, int::in, int::in, int::in, attr::in, panel::out, ++ io::di, io::uo) is det. ++ ++ % Destroy a panel. ++ % ++:- pred delete(panel::in, io::di, io::uo) is det. ++ ++ % Raise/lower a panel to the top/bottom of the stack. ++ % ++:- pred raise(panel::in, io::di, io::uo) is det. ++:- pred lower(panel::in, io::di, io::uo) is det. ++ ++ % Hide/reveal a panel (revealing places it at the top of the stack). ++ % ++:- pred hide(panel::in, io::di, io::uo) is det. ++:- pred reveal(panel::in, io::di, io::uo) is det. ++ ++ % Move a panel to (Row, Col) on the display. ++ % ++:- pred relocate(panel::in, int::in, int::in, io::di, io::uo) is det. ++ ++ % Clear a panel. ++ % ++:- pred clear(panel::in, io::di, io::uo) is det. ++ ++ % Move the virtual cursor to given row and column; (0, 0) are the ++ % coordinates for the upper left hand corner of the panel. ++ % ++:- pred move(panel::in, int::in, int::in, io::di, io::uo) is det. ++ ++ % Add a char/string to a panel with the given attributes. ++ % Note that char codes are passed rather than plain chars. ++ % ++:- pred addch(panel::in, attr::in, int::in, io::di, io::uo) is det. ++:- pred addstr(panel::in, attr::in, string::in, io::di, io::uo) is det. ++ ++ % Turn on/off or set attributes that will be applied by default. ++ % ++:- pred attr_on(panel::in, attr::in, io::di, io::uo) is det. ++:- pred attr_off(panel::in, attr::in, io::di, io::uo) is det. ++:- pred attr_set(panel::in, attr::in, io::di, io::uo) is det. ++ ++ % Update the display (also calls doupdate). ++ % NOTE: doupdate does not call update_panels. ++ % ++:- pred update_panels(io::di, io::uo) is det. ++ ++ % Draws a border around the inside edge of the display. ++ % ++:- pred border(panel::in, io::di, io::uo) is det. ++ ++ % Draws an horizontal line of length N moving to the right. ++ % ++:- pred hline(panel::in, int::in, int::in, io::di, io::uo) is det. ++ ++ % Draws a vertical line of length N moving down. ++ % ++:- pred vline(panel::in, int::in, int::in, io::di, io::uo) is det. ++ ++%-----------------------------------------------------------------------------% ++ ++:- implementation. ++ ++%-------------------------------------------------------------------------% ++ ++:- pragma foreign_decl("C", " ++ ++ #include ++ #include ++ ++"). ++ ++:- pragma foreign_type("C", panel, "PANEL *"). ++ ++%-------------------------------------------------------------------------% ++ ++:- pragma foreign_proc("C", ++ new(Rows::in, Cols::in, Row::in, Col::in, Attr::in, Panel::out, ++ IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], ++" ++ WINDOW *w = newwin(Rows, Cols, Row, Col); ++ scrollok(w, TRUE); ++ wattrset(w, Attr); ++ wcolor_set(w, Attr, NULL); ++ wclear(w); ++ Panel = new_panel(w); ++ ++ IO = IO0; ++"). ++ ++%-------------------------------------------------------------------------% ++ ++:- pragma foreign_proc("C", ++ delete(Panel::in, IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], ++" ++ delwin(panel_window(Panel)); ++ del_panel(Panel); ++ ++ IO = IO0; ++"). ++ ++%-------------------------------------------------------------------------% ++ ++:- pragma foreign_proc("C", ++ raise(Panel::in, IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], ++" ++ top_panel(Panel); ++ IO = IO0; ++"). ++ ++%-------------------------------------------------------------------------% ++ ++:- pragma foreign_proc("C", ++ lower(Panel::in, IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], ++" ++ bottom_panel(Panel); ++ IO = IO0; ++"). ++ ++%-------------------------------------------------------------------------% ++ ++:- pragma foreign_proc("C", ++ hide(Panel::in, IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], ++" ++ hide_panel(Panel); ++ IO = IO0; ++"). ++ ++%-------------------------------------------------------------------------% ++ ++:- pragma foreign_proc("C", ++ reveal(Panel::in, IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], ++" ++ show_panel(Panel); ++ IO = IO0; ++"). ++ ++%-------------------------------------------------------------------------% ++ ++:- pragma foreign_proc("C", ++ relocate(Panel::in, Row::in, Col::in, IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], ++" ++ move_panel(Panel, Row, Col); ++ IO = IO0; ++"). ++ ++%-------------------------------------------------------------------------% ++ ++:- pragma foreign_proc("C", ++ clear(Panel::in, IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], ++" ++ wclear(panel_window(Panel)); ++ IO = IO0; ++"). ++ ++%-------------------------------------------------------------------------% ++ ++:- pragma foreign_proc("C", ++ move(Panel::in, Row::in, Col::in, IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], ++" ++ wmove(panel_window(Panel), Row, Col); ++ IO = IO0; ++"). ++ ++%-------------------------------------------------------------------------% ++ ++:- pragma foreign_proc("C", ++ addch(Panel::in, Attr::in, CharCode::in, IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], ++" ++ waddch(panel_window(Panel), (chtype)Attr | (chtype)CharCode); ++ IO = IO0; ++"). ++ ++%-------------------------------------------------------------------------% ++ ++addstr(Panel, Attr, Str, !IO) :- ++ string.foldl( ++ ( pred(Char::in, !.IO::di, !:IO::uo) is det :- ++ addch(Panel, Attr, char.to_int(Char), !IO) ++ ), ++ Str, !IO ++ ). ++ ++%-------------------------------------------------------------------------% ++ ++:- pragma foreign_proc("C", ++ attr_on(Panel::in, Attr::in, IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], ++" ++ wattron(panel_window(Panel), Attr); ++ IO = IO0; ++"). ++ ++:- pragma foreign_proc("C", ++ attr_off(Panel::in, Attr::in, IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], ++" ++ wattroff(panel_window(Panel), Attr); ++ IO = IO0; ++"). ++ ++:- pragma foreign_proc("C", ++ attr_set(Panel::in, Attr::in, IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], ++" ++ wattrset(panel_window(Panel), Attr); ++ IO = IO0; ++"). ++ ++%-------------------------------------------------------------------------% ++ ++:- pragma foreign_proc("C", ++ update_panels(IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], ++" ++ update_panels(); ++ doupdate(); ++ IO = IO0; ++"). ++ ++%-------------------------------------------------------------------------% ++ ++:- pragma foreign_proc("C", ++ border(Panel::in, IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], ++" ++ wborder(panel_window(Panel), 0, 0, 0, 0, 0, 0, 0, 0); ++ IO = IO0; ++"). ++ ++:- pragma foreign_proc("C", ++ hline(Panel::in, C::in, N::in, IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], ++" ++ whline(panel_window(Panel), C, N); ++ IO = IO0; ++"). ++ ++:- pragma foreign_proc("C", ++ vline(Panel::in, C::in, N::in, IO0::di, IO::uo), ++ [will_not_call_mercury, promise_pure], ++" ++ wvline(panel_window(Panel), C, N); ++ IO = IO0; ++"). ++ ++%-----------------------------------------------------------------------------% diff --git a/dev-lang/mercury-extras/mercury-extras-0.12.2-r2.ebuild b/dev-lang/mercury-extras/mercury-extras-0.12.2-r2.ebuild index ccdc39dac175..1017702cb5ca 100644 --- a/dev-lang/mercury-extras/mercury-extras-0.12.2-r2.ebuild +++ b/dev-lang/mercury-extras/mercury-extras-0.12.2-r2.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/mercury-extras/mercury-extras-0.12.2-r2.ebuild,v 1.11 2006/10/19 07:28:27 keri Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-lang/mercury-extras/mercury-extras-0.12.2-r2.ebuild,v 1.12 2006/10/23 04:12:53 keri Exp $ inherit eutils @@ -29,8 +29,8 @@ src_unpack() { unpack ${A} cd "${S}" epatch "${FILESDIR}"/${P}-gcc4.patch - epatch "${FILESDIR}"/${P}-parallel-mmake.patch epatch "${FILESDIR}"/${P}-concurrency.patch + epatch "${FILESDIR}"/${P}-curs.patch epatch "${FILESDIR}"/${P}-dynamic_linking.patch epatch "${FILESDIR}"/${P}-lex.patch epatch "${FILESDIR}"/${P}-mercury_glut.patch @@ -60,7 +60,8 @@ src_unpack() { } src_compile() { - mmake depend || die "mmake depend failed" + mmake \ + depend || die "mmake depend failed" mmake \ MMAKEFLAGS="${MAKEOPTS}" \ EXTRA_MLFLAGS=--no-strip \ @@ -70,8 +71,8 @@ src_compile() { cd "${S}"/graphics/mercury_opengl cp ../mercury_tcltk/mtcltk.m ./ mmake \ - -f Mmakefile.mtogl depend \ - || die "mmake depend mtogl failed" + -f Mmakefile.mtogl \ + depend || die "mmake depend mtogl failed" mmake \ MMAKEFLAGS="${MAKEOPTS}" \ -f Mmakefile.mtogl \ @@ -82,16 +83,16 @@ src_compile() { src_install() { cd "${S}" mmake \ - INSTALL_PREFIX="${D}"/usr install \ - || die "mmake install failed" + INSTALL_PREFIX="${D}"/usr \ + install || die "mmake install failed" if use opengl && use tcl && use tk ; then cd "${S}"/graphics/mercury_opengl mv Mmakefile Mmakefile.opengl mv Mmakefile.mtogl Mmakefile mmake \ - INSTALL_PREFIX="${D}"/usr install \ - || die "mmake install mtogl failed" + INSTALL_PREFIX="${D}"/usr \ + install || die "mmake install mtogl failed" fi find "${D}"/usr/lib/mercury-${PV} -type l | xargs rm diff --git a/dev-lang/mercury-extras/mercury-extras-0.13.0.ebuild b/dev-lang/mercury-extras/mercury-extras-0.13.0.ebuild index 3e0ff7f02146..92b8d40de12b 100644 --- a/dev-lang/mercury-extras/mercury-extras-0.13.0.ebuild +++ b/dev-lang/mercury-extras/mercury-extras-0.13.0.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/mercury-extras/mercury-extras-0.13.0.ebuild,v 1.8 2006/10/23 00:18:26 keri Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-lang/mercury-extras/mercury-extras-0.13.0.ebuild,v 1.9 2006/10/23 04:12:53 keri Exp $ inherit eutils @@ -30,6 +30,7 @@ src_unpack() { unpack ${A} cd "${S}" epatch "${FILESDIR}"/${P}-concurrency.patch + epatch "${FILESDIR}"/${P}-curs.patch epatch "${FILESDIR}"/${P}-dynamic_linking.patch epatch "${FILESDIR}"/${P}-lex.patch epatch "${FILESDIR}"/${P}-mercury_glut.patch @@ -66,7 +67,8 @@ src_unpack() { } src_compile() { - mmake depend || die "mmake depend failed" + mmake \ + depend || die "mmake depend failed" mmake \ MMAKEFLAGS="${MAKEOPTS}" \ EXTRA_MLFLAGS=--no-strip \ @@ -76,8 +78,8 @@ src_compile() { cd "${S}"/graphics/mercury_opengl cp ../mercury_tcltk/mtcltk.m ./ mmake \ - -f Mmakefile.mtogl depend \ - || die "mmake depend mtogl failed" + -f Mmakefile.mtogl \ + depend || die "mmake depend mtogl failed" mmake \ MMAKEFLAGS="${MAKEOPTS}" \ -f Mmakefile.mtogl \ @@ -88,16 +90,16 @@ src_compile() { src_install() { cd "${S}" mmake \ - INSTALL_PREFIX="${D}"/usr install \ - || die "mmake install failed" + INSTALL_PREFIX="${D}"/usr \ + install || die "mmake install failed" if use opengl && use tcl && use tk ; then cd "${S}"/graphics/mercury_opengl mv Mmakefile Mmakefile.opengl mv Mmakefile.mtogl Mmakefile mmake \ - INSTALL_PREFIX="${D}"/usr install \ - || die "mmake install mtogl failed" + INSTALL_PREFIX="${D}"/usr \ + install || die "mmake install mtogl failed" fi find "${D}"/usr/lib/mercury-${PV} -type l | xargs rm -- cgit v1.2.3-65-gdbad