YaST Commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
September 2007
- 23 participants
- 503 discussions
[yast-commit] r40887 - in /trunk/core: VERSION libyui/doc/examples/Events.ycp libyui/src/Y2UINamespace.cc libyui/src/Y2UINamespace.h package/yast2-core.changes
by mvidner@svn.opensuse.org 13 Sep '07
by mvidner@svn.opensuse.org 13 Sep '07
13 Sep '07
Author: mvidner
Date: Thu Sep 13 09:56:24 2007
New Revision: 40887
URL: http://svn.opensuse.org/viewcvs/yast?rev=40887&view=rev
Log:
UI::CollectUserInput: fixed crash introduced when namespacifying,
restricting to a subtree of a dialog works now (#307056).
Modified:
trunk/core/VERSION
trunk/core/libyui/doc/examples/Events.ycp
trunk/core/libyui/src/Y2UINamespace.cc
trunk/core/libyui/src/Y2UINamespace.h
trunk/core/package/yast2-core.changes
Modified: trunk/core/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/VERSION?rev=40887&r1=40886&…
==============================================================================
--- trunk/core/VERSION (original)
+++ trunk/core/VERSION Thu Sep 13 09:56:24 2007
@@ -1 +1 @@
-2.15.11
+2.15.12
Modified: trunk/core/libyui/doc/examples/Events.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/doc/examples/Events.…
==============================================================================
--- trunk/core/libyui/doc/examples/Events.ycp (original)
+++ trunk/core/libyui/doc/examples/Events.ycp Thu Sep 13 09:56:24 2007
@@ -164,7 +164,7 @@
`Left(
`HVSquash(
`Frame( "Payment",
- `RadioButtonGroup( payment_radio_box )
+ `RadioButtonGroup(`id(`payment_group), payment_radio_box )
)
)
),
@@ -247,6 +247,8 @@
}
if ( event["ID"]:nil == `info )
{
+ list<map<string, any> > pg = UI::CollectUserInput(`id(`payment_group));
+ y2milestone( "CollectUserInput(`id(`payment_group)) returned %1", pg );
list<map<string, any> > widget_contents = UI::CollectUserInput();
y2milestone( "CollectUserInput() returned %1", widget_contents );
Modified: trunk/core/libyui/src/Y2UINamespace.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/Y2UINamespace.cc…
==============================================================================
--- trunk/core/libyui/src/Y2UINamespace.cc (original)
+++ trunk/core/libyui/src/Y2UINamespace.cc Thu Sep 13 09:56:24 2007
@@ -586,7 +586,7 @@
YCPValue
-Y2UINamespace::CollectUserInput( const YCPTerm & widget_id, const YCPSymbol & property )
+Y2UINamespace::CollectUserInput( )
{
if ( YUIComponent::ui() )
return YUIComponent::ui()->evaluateCollectUserInput();
@@ -596,10 +596,10 @@
YCPValue
-Y2UINamespace::CollectUserInput( const YCPTerm & widget_id, const YCPTerm & property )
+Y2UINamespace::CollectUserInput( const YCPTerm & widget_id )
{
if ( YUIComponent::ui() )
- return YUIComponent::ui()->evaluateCollectUserInput();
+ return YUIComponent::ui()->evaluateCollectUserInput( widget_id );
else
return YCPVoid();
}
Modified: trunk/core/libyui/src/Y2UINamespace.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/Y2UINamespace.h?…
==============================================================================
--- trunk/core/libyui/src/Y2UINamespace.h (original)
+++ trunk/core/libyui/src/Y2UINamespace.h Thu Sep 13 09:56:24 2007
@@ -303,13 +303,11 @@
/* TYPEINFO: boolean (term) */
YCPValue WizardCommand ( const YCPTerm & command );
- // FIXME BOGUS!, see implementation
- /* TYPEINFO:list<map<string, any>> () */
- YCPValue CollectUserInput( const YCPTerm & widget_id, const YCPSymbol & property );
+ /* TYPEINFO:list<map<string,any>> () */
+ YCPValue CollectUserInput ();
- // FIXME BOGUS!, see implementation
- /* TYPEINFO:list<map<string, any>> (term) */
- YCPValue CollectUserInput( const YCPTerm & widget_id, const YCPTerm & property );
+ /* TYPEINFO:list<map<string,any>> (term) */
+ YCPValue CollectUserInput( const YCPTerm & widget_id );
YCPValue
CallHandler( void * ptr, int argc, YCPValue argv[] );
Modified: trunk/core/package/yast2-core.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/package/yast2-core.changes?…
==============================================================================
--- trunk/core/package/yast2-core.changes (original)
+++ trunk/core/package/yast2-core.changes Thu Sep 13 09:56:24 2007
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Thu Sep 13 09:56:14 CEST 2007 - mvidner(a)suse.cz
+
+- UI::CollectUserInput: fixed crash introduced when namespacifying,
+ restricting to a subtree of a dialog works now (#307056).
+- 2.15.12
+
+-------------------------------------------------------------------
Thu Sep 6 16:43:06 CEST 2007 - mvidner(a)suse.cz
- Enabled iterating over all functions of a Y2Namespace, for
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
13 Sep '07
Author: odabrunz
Date: Thu Sep 13 05:43:12 2007
New Revision: 40886
URL: http://svn.opensuse.org/viewcvs/yast?rev=40886&view=rev
Log:
Created tag stable-2_15_20 for bootloader
Added:
tags/stable-2_15_20/bootloader/
- copied from r40885, trunk/bootloader/
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r40885 - in /trunk/bootloader: VERSION package/yast2-bootloader.changes
by odabrunz@svn.opensuse.org 13 Sep '07
by odabrunz@svn.opensuse.org 13 Sep '07
13 Sep '07
Author: odabrunz
Date: Thu Sep 13 05:42:51 2007
New Revision: 40885
URL: http://svn.opensuse.org/viewcvs/yast?rev=40885&view=rev
Log:
- updated changes file
- 2.15.20
Modified:
trunk/bootloader/VERSION
trunk/bootloader/package/yast2-bootloader.changes
Modified: trunk/bootloader/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/VERSION?rev=40885&r1=…
==============================================================================
--- trunk/bootloader/VERSION (original)
+++ trunk/bootloader/VERSION Thu Sep 13 05:42:51 2007
@@ -1 +1 @@
-2.15.19
+2.15.20
Modified: trunk/bootloader/package/yast2-bootloader.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/package/yast2-bootloa…
==============================================================================
--- trunk/bootloader/package/yast2-bootloader.changes (original)
+++ trunk/bootloader/package/yast2-bootloader.changes Thu Sep 13 05:42:51 2007
@@ -1,4 +1,14 @@
-------------------------------------------------------------------
+Thu Sep 13 05:41:00 CEST 2007 - od(a)suse.de
+
+- specify blockoffset as string, rather than number
+- added a FIXME comment
+- fixed conversion of obsolete filenames in kernel and initrd keys
+- fixed conversion of device names in root and chainloader keys
+ (#309837)
+- 2.15.20
+
+-------------------------------------------------------------------
Tue Aug 28 18:35:52 CEST 2007 - pth(a)suse.de
- Fix the code in bootloader_finish so that the one-time-boot code
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r40884 - /trunk/bootloader/package/yast2-bootloader.changes
by odabrunz@svn.opensuse.org 13 Sep '07
by odabrunz@svn.opensuse.org 13 Sep '07
13 Sep '07
Author: odabrunz
Date: Thu Sep 13 05:39:37 2007
New Revision: 40884
URL: http://svn.opensuse.org/viewcvs/yast?rev=40884&view=rev
Log:
- merge missing lines from submitted changes file
Modified:
trunk/bootloader/package/yast2-bootloader.changes
Modified: trunk/bootloader/package/yast2-bootloader.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/package/yast2-bootloa…
==============================================================================
--- trunk/bootloader/package/yast2-bootloader.changes (original)
+++ trunk/bootloader/package/yast2-bootloader.changes Thu Sep 13 05:39:37 2007
@@ -1,6 +1,8 @@
-------------------------------------------------------------------
Tue Aug 28 18:35:52 CEST 2007 - pth(a)suse.de
+- Fix the code in bootloader_finish so that the one-time-boot code
+ is actually called.
- Redo the logic and structure of the one-time booting code.
* Global Write uses Bootloader::getDefaultSection() to determine the
section name.
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r40883 - in /trunk/bootloader/src: modules/BootGRUB.ycp routines/lilolike.ycp
by odabrunz@svn.opensuse.org 13 Sep '07
by odabrunz@svn.opensuse.org 13 Sep '07
13 Sep '07
Author: odabrunz
Date: Thu Sep 13 05:28:03 2007
New Revision: 40883
URL: http://svn.opensuse.org/viewcvs/yast?rev=40883&view=rev
Log:
- specify blockoffset as string, rather than number
- added a FIXME comment
- fixed conversion of obsolete filenames in kernel and initrd keys
- fixed conversion of device names in root and chainloader keys
(#309837)
Modified:
trunk/bootloader/src/modules/BootGRUB.ycp
trunk/bootloader/src/routines/lilolike.ycp
Modified: trunk/bootloader/src/modules/BootGRUB.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/modules/BootGRUB.…
==============================================================================
--- trunk/bootloader/src/modules/BootGRUB.ycp (original)
+++ trunk/bootloader/src/modules/BootGRUB.ycp Thu Sep 13 05:28:03 2007
@@ -346,7 +346,7 @@
// mountable bootable => chainloader (label: to be decided)
new_sect["noverifyroot"] = "true";
new_sect["chainloader"] = dev;
- new_sect["blockoffset"] = 1;
+ new_sect["blockoffset"] = "1";
new_sect["type"] = "other";
}
else
Modified: trunk/bootloader/src/routines/lilolike.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/routines/lilolike…
==============================================================================
--- trunk/bootloader/src/routines/lilolike.ycp (original)
+++ trunk/bootloader/src/routines/lilolike.ycp Thu Sep 13 05:28:03 2007
@@ -712,7 +712,7 @@
// bootable => chainloader
s["noverifyroot"] = "true";
s["chainloader"] = dev;
- s["blockoffset"] = 1;
+ s["blockoffset"] = "1";
s["type"] = "other";
y2milestone ("Updating section \"%1\" booting other installation to use chainloader entry", s["name"]:"");
}
@@ -743,6 +743,11 @@
out = maplist (map<string,any> s, out, {
string label = s["name"]:"";
string type = s["original_name"]:label;
+ // FIXME: do we still need to remove strings from kernel or initrd names?
+ // if yes: add "image"
+ // if no: remove loop
+ // probably need to do this depending on the version of the old
+ // installation
foreach (string key, ["kernel", "initrd"], {
string value = s[key]:"";
if (regexpmatch (value, "^.*\.shipped.*$"))
@@ -755,7 +760,8 @@
value = regexpsub (value,
"^(.*)\.suse(.*)$", "\\1\\2");
}
- s["key"] = value;
+ // This was broken (was: s["key"] = value;)
+ s[key] = value;
});
// If we did not replace the sections anyway, adjust the section titles:
// Does this section
@@ -788,13 +794,13 @@
&& ! contains (recreated, label))
|| key == "chainloader")
{
- string device = s["key"]:"";
+ string device = s[key]:"";
if (device != nil)
{
y2milestone ("Updating root/other device of section %1",
label);
device = BootCommon::UpdateDevice (device);
- s["key"] = device;
+ s[key] = device;
}
}
});
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r40882 - in /branches/tmp/sh/mod-ui: core/agents-perl/ core/base/src/ core/base/tools/ycpc/ core/liby2/src/ core/liby2/src/include/y2/ core/libycp/src/ core/libycp/src/include/ycp/ core/libyui/doc/...
by sh-sh-sh@svn.opensuse.org 12 Sep '07
by sh-sh-sh@svn.opensuse.org 12 Sep '07
12 Sep '07
Author: sh-sh-sh
Date: Wed Sep 12 17:28:00 2007
New Revision: 40882
URL: http://svn.opensuse.org/viewcvs/yast?rev=40882&view=rev
Log:
merged mvidner's 'UI as namespace' changes
Added:
branches/tmp/sh/mod-ui/core/libycp/src/Xmlcode.cc
branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/Xmlcode.h
branches/tmp/sh/mod-ui/core/libyui/doc/YCPDialogParser.xml
branches/tmp/sh/mod-ui/core/libyui/doc/namespace
branches/tmp/sh/mod-ui/core/libyui/src/UIBuiltinCalls.h
branches/tmp/sh/mod-ui/core/libyui/src/UIBuiltinTable.h
branches/tmp/sh/mod-ui/core/libyui/src/Y2CCUI.cc
branches/tmp/sh/mod-ui/core/libyui/src/Y2CCUI.h
branches/tmp/sh/mod-ui/core/libyui/src/Y2UINamespace.cc
branches/tmp/sh/mod-ui/core/libyui/src/Y2UINamespace.h
Removed:
branches/tmp/sh/mod-ui/core/libyui/src/UI.h
branches/tmp/sh/mod-ui/core/libyui/src/YUI_bindings.cc
Modified:
branches/tmp/sh/mod-ui/core/agents-perl/ag_background
branches/tmp/sh/mod-ui/core/base/src/Makefile.am
branches/tmp/sh/mod-ui/core/base/tools/ycpc/Makefile.am
branches/tmp/sh/mod-ui/core/base/tools/ycpc/ycpc.cc
branches/tmp/sh/mod-ui/core/liby2/src/Y2ComponentBroker.cc
branches/tmp/sh/mod-ui/core/liby2/src/Y2PluginComponent.cc
branches/tmp/sh/mod-ui/core/liby2/src/genericfrontend.cc
branches/tmp/sh/mod-ui/core/liby2/src/include/y2/Y2PluginComponent.h
branches/tmp/sh/mod-ui/core/libycp/src/Bytecode.cc
branches/tmp/sh/mod-ui/core/libycp/src/Import.cc
branches/tmp/sh/mod-ui/core/libycp/src/Makefile.am
branches/tmp/sh/mod-ui/core/libycp/src/Point.cc
branches/tmp/sh/mod-ui/core/libycp/src/StaticDeclaration.cc
branches/tmp/sh/mod-ui/core/libycp/src/SymbolTable.cc
branches/tmp/sh/mod-ui/core/libycp/src/Type.cc
branches/tmp/sh/mod-ui/core/libycp/src/YBlock.cc
branches/tmp/sh/mod-ui/core/libycp/src/YCPBoolean.cc
branches/tmp/sh/mod-ui/core/libycp/src/YCPBuiltinMisc.cc
branches/tmp/sh/mod-ui/core/libycp/src/YCPByteblock.cc
branches/tmp/sh/mod-ui/core/libycp/src/YCPCode.cc
branches/tmp/sh/mod-ui/core/libycp/src/YCPExternal.cc
branches/tmp/sh/mod-ui/core/libycp/src/YCPFloat.cc
branches/tmp/sh/mod-ui/core/libycp/src/YCPInteger.cc
branches/tmp/sh/mod-ui/core/libycp/src/YCPList.cc
branches/tmp/sh/mod-ui/core/libycp/src/YCPMap.cc
branches/tmp/sh/mod-ui/core/libycp/src/YCPPath.cc
branches/tmp/sh/mod-ui/core/libycp/src/YCPString.cc
branches/tmp/sh/mod-ui/core/libycp/src/YCPSymbol.cc
branches/tmp/sh/mod-ui/core/libycp/src/YCPTerm.cc
branches/tmp/sh/mod-ui/core/libycp/src/YCPVoid.cc
branches/tmp/sh/mod-ui/core/libycp/src/YCode.cc
branches/tmp/sh/mod-ui/core/libycp/src/YExpression.cc
branches/tmp/sh/mod-ui/core/libycp/src/YStatement.cc
branches/tmp/sh/mod-ui/core/libycp/src/YSymbolEntry.cc
branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/Bytecode.h
branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/Makefile.am
branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/Point.h
branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/StaticDeclaration.h
branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/SymbolTable.h
branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/Type.h
branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YBlock.h
branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPBoolean.h
branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPByteblock.h
branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPCode.h
branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPElement.h
branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPExternal.h
branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPFloat.h
branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPInteger.h
branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPList.h
branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPMap.h
branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPPath.h
branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPString.h
branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPSymbol.h
branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPTerm.h
branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPValue.h
branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPVoid.h
branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCode.h
branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YExpression.h
branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YStatement.h
branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YSymbolEntry.h
branches/tmp/sh/mod-ui/core/libyui/src/Makefile.am
branches/tmp/sh/mod-ui/core/libyui/src/YUI.h
branches/tmp/sh/mod-ui/core/libyui/src/YUIComponent.cc
branches/tmp/sh/mod-ui/core/libyui/src/YUIComponent.h
branches/tmp/sh/mod-ui/core/libyui/src/YUI_core.cc
branches/tmp/sh/mod-ui/core/wfm/src/Makefile.am
branches/tmp/sh/mod-ui/core/wfm/src/Y2CCWFM.cc
branches/tmp/sh/mod-ui/core/wfm/src/Y2WFMComponent.cc
branches/tmp/sh/mod-ui/core/wfm/testsuite/Makefile.am
branches/tmp/sh/mod-ui/core/wfm/testsuite/runc.cc
branches/tmp/sh/mod-ui/ncurses/src/Makefile.am
branches/tmp/sh/mod-ui/ncurses/src/Y2CCNCursesUI.h
branches/tmp/sh/mod-ui/ncurses/src/pkg/ (props changed)
branches/tmp/sh/mod-ui/ncurses/src/pkg/Makefile.am
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc
branches/tmp/sh/mod-ui/ncurses/testsuite/Makefile.am
branches/tmp/sh/mod-ui/qt/src/Makefile.am
branches/tmp/sh/mod-ui/qt/src/Y2CCQt.h
branches/tmp/sh/mod-ui/qt/src/pkg/Makefile.am
Modified: branches/tmp/sh/mod-ui/core/agents-perl/ag_background
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/agents-per…
==============================================================================
--- branches/tmp/sh/mod-ui/core/agents-perl/ag_background (original)
+++ branches/tmp/sh/mod-ui/core/agents-perl/ag_background Wed Sep 12 17:28:00 2007
@@ -91,6 +91,12 @@
ycp::Return("");
}
+my $exit = 0;
+
+sub ReadExitCode {
+ $exit = $? >> 8; # high 8 bits are exit value
+}
+
# install SIGCHLD handler
$SIG{CHLD} = \&Handler;
@@ -112,8 +118,6 @@
my $pipe_defined = 0;
my $pipe_defined_err = 0;
-my $exit = 0;
-
$| = 1;
# main loop
@@ -235,6 +239,7 @@
}
elsif ($path eq '.status')
{
+ ReadExitCode();
ycp::Return($exit);
}
elsif ($path eq '.newout')
@@ -368,7 +373,7 @@
}
close(RD);
- $exit = $? >> 8; # high 8 bits are exit value
+ ReadExitCode();
}
else
{
@@ -417,7 +422,7 @@
}
close(ERR);
- $exit = $? >> 8; # high 8 bits are exit value
+ ReadExitCode();
}
else
{
Modified: branches/tmp/sh/mod-ui/core/base/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/base/src/M…
==============================================================================
--- branches/tmp/sh/mod-ui/core/base/src/Makefile.am (original)
+++ branches/tmp/sh/mod-ui/core/base/src/Makefile.am Wed Sep 12 17:28:00 2007
@@ -10,7 +10,6 @@
../../wfm/src/libpy2wfm.la \
../../libycp/src/libycp.la \
../../liby2/src/liby2.la \
- ../../libyui/src/libyui.la \
../../libscr/src/libscr.la
# ../../scr/src/libpy2scr.la
Modified: branches/tmp/sh/mod-ui/core/base/tools/ycpc/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/base/tools…
==============================================================================
--- branches/tmp/sh/mod-ui/core/base/tools/ycpc/Makefile.am (original)
+++ branches/tmp/sh/mod-ui/core/base/tools/ycpc/Makefile.am Wed Sep 12 17:28:00 2007
@@ -17,7 +17,7 @@
bin_PROGRAMS = ycpc
ycpc_SOURCES = ycpc.cc
ycpc_LDADD = $(top_builddir)/libycp/src/libycp.la \
- $(top_builddir)/libyui/src/libyui.la \
+ $(top_builddir)/libyui/src/libpy2UI.la \
$(top_builddir)/wfm/src/libpy2wfm.la \
$(top_builddir)/liby2/src/liby2.la \
$(top_builddir)/libscr/src/libscr.la \
Modified: branches/tmp/sh/mod-ui/core/base/tools/ycpc/ycpc.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/base/tools…
==============================================================================
--- branches/tmp/sh/mod-ui/core/base/tools/ycpc/ycpc.cc (original)
+++ branches/tmp/sh/mod-ui/core/base/tools/ycpc/ycpc.cc Wed Sep 12 17:28:00 2007
@@ -22,6 +22,7 @@
#include <ycp/YCode.h>
#include <ycp/Parser.h>
#include <ycp/Bytecode.h>
+#include <ycp/Xmlcode.h>
#include <ycp/Import.h>
#include <ycp/y2log.h>
#include <../../libycp/src/parser.h>
@@ -29,7 +30,6 @@
#include <y2/Y2Component.h>
#include <y2/Y2ComponentBroker.h>
-#include <UI.h>
#include <scr/SCR.h>
#include <WFM.h>
@@ -55,12 +55,13 @@
static int recursive = 0; // recursively all files
static int parse = 0; // just parse source code
static int compile = 0; // just compile source to bytecode
+static int to_xml = 0; // output XML instead of bytecode
static int read_n_print = 0; // read and print bytecode
static int read_n_run = 0; // read and run bytecode
static int freshen = 0; // freshen recompilation
static int force = 0; // force recompilation
static int no_implicit_namespaces = 0; // don't preload implicit namespaces
-static char *ui_name = 0;
+static const char *ui_name = 0;
#define UI_QT_NAME "qt"
#define UI_NCURSES_NAME "ncurses"
@@ -915,11 +916,11 @@
int len = ofname.size ();
if (len > 4 && ofname.substr (len-4, 4) == ".ycp")
{
- ofname = ofname.replace (len-4, 4, ".ybc");
+ ofname = ofname.replace (len-4, 4, to_xml ? ".xml" : ".ybc");
}
else
{
- ofname += ".ybc";
+ ofname += to_xml ? ".xml" : ".ybc";
}
}
progress ("compiling to '%s'\n", ofname.c_str ());
@@ -929,7 +930,14 @@
if (c != NULL )
{
progress ("saving ...\n");
- return Bytecode::writeFile (c, ofname) ? 0 : 1;
+ int result = 0;
+ if (to_xml) {
+ result = Xmlcode::writeFile (c, ofname);
+ }
+ else {
+ result = Bytecode::writeFile (c, ofname);
+ }
+ return result ? 0 : 1;
}
return 2;
@@ -1178,10 +1186,11 @@
{"test", 0, 0, 't'}, // lots of output
{"ui", 1, 0, 'u' }, // UI to start in combination with 'r'
{"version", 0, 0, 'v'}, // show version and exit
+ {"xml", 0, 0, 'x'}, // output XML insteaf of Bytecode
{0, 0, 0, 0}
};
- int c = getopt_long (argc, argv, "h?vVnpqrtRdEcFfI:M:o:l:u:", options, &option_index);
+ int c = getopt_long (argc, argv, "h?vxVnpqrtRdEcFfI:M:o:l:u:", options, &option_index);
if (c == EOF) break;
switch (c)
@@ -1269,6 +1278,9 @@
case 'u':
ui_name = strdup (optarg);
break;
+ case 'x':
+ to_xml = 1;
+ break;
default:
fprintf (stderr, "Try `%s -h' for more information.\n", argv[0]);
exit(1);
@@ -1298,7 +1310,6 @@
// register builtins
SCR scr;
WFM wfm;
- UI ui;
if ((compile == parse) // both are zero
&& (compile == freshen)
Modified: branches/tmp/sh/mod-ui/core/liby2/src/Y2ComponentBroker.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/liby2/src/…
==============================================================================
--- branches/tmp/sh/mod-ui/core/liby2/src/Y2ComponentBroker.cc (original)
+++ branches/tmp/sh/mod-ui/core/liby2/src/Y2ComponentBroker.cc Wed Sep 12 17:28:00 2007
@@ -121,11 +121,12 @@
{
string comp_name = exi->second;
- Y2Component *comp = Y2ComponentBroker::createComponent (comp_name.c_str (), true);
+ // the ui stuff is a mess, must prefer servers
+ Y2Component *comp = createServer (comp_name.c_str ());
if (! comp)
{
- // no client component, try server as well
- comp = Y2ComponentBroker::createComponent (comp_name.c_str (), false);
+ // no server component, try client as well
+ comp = Y2ComponentBroker::createClient (comp_name.c_str ());
}
if (comp)
Modified: branches/tmp/sh/mod-ui/core/liby2/src/Y2PluginComponent.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/liby2/src/…
==============================================================================
--- branches/tmp/sh/mod-ui/core/liby2/src/Y2PluginComponent.cc (original)
+++ branches/tmp/sh/mod-ui/core/liby2/src/Y2PluginComponent.cc Wed Sep 12 17:28:00 2007
@@ -128,6 +128,23 @@
}
+Y2Namespace*
+Y2PluginComponent::import (const char* name_space)
+{
+ if (!handle)
+ {
+ loadPlugin ();
+ }
+
+ if (!comp)
+ {
+ return 0;
+ }
+
+ return comp->import (name_space);
+}
+
+
void
Y2PluginComponent::result (const YCPValue& result)
{
Modified: branches/tmp/sh/mod-ui/core/liby2/src/genericfrontend.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/liby2/src/…
==============================================================================
--- branches/tmp/sh/mod-ui/core/liby2/src/genericfrontend.cc (original)
+++ branches/tmp/sh/mod-ui/core/liby2/src/genericfrontend.cc Wed Sep 12 17:28:00 2007
@@ -109,14 +109,12 @@
* @param m the message to be logged
*/
#if BLOCXX_LIBRARY_VERSION >= 5
- virtual void doProcessLogMessage(const blocxx::String & f,
+ virtual void doProcessLogMessage(const blocxx::String & /*f*/,
const blocxx::LogMessage& m) const
- {
- (void)f;
#else
virtual void doProcessLogMessage(const blocxx::LogMessage& m) const
- {
#endif
+ {
loglevel_t level = LOG_DEBUG;
if (m.category == blocxx::Logger::STR_FATAL_CATEGORY
|| m.category == blocxx::Logger::STR_ERROR_CATEGORY)
@@ -165,156 +163,18 @@
};
static logger_initializer initialize_logger;
-
-int
-main (int argc, char **argv)
+void
+parse_client_and_options (int argc, char ** argv, int& arg, char *& client_name, YCPList& arglist)
{
- if (!argv[0])
- {
- fprintf (stderr, "Missing argv[0]. It is a NULL pointer.");
- exit (5);
- }
-
- progname = basename (argv[0]); // get program name
-
- // Ignore SIGPIPE. No use in signals. Signals can't be assigned to
- // components
- signal(SIGPIPE, SIG_IGN);
-
- // Give some output for the SIGSEGV
- // and other signals too, #238172
- // Note that USR1 and USR2 are handled by the logger.
- signal (SIGHUP, signal_handler);
- signal (SIGINT, signal_handler);
- signal (SIGQUIT, signal_handler);
- signal (SIGILL , signal_handler);
- signal (SIGABRT, signal_handler);
- signal (SIGFPE, signal_handler);
- signal (SIGSEGV, signal_handler);
- signal (SIGTERM, signal_handler);
-
- if (argc < 2) {
- fprintf (stderr, "\nToo few arguments");
- print_usage();
- exit (1);
- }
-
- if (!strcmp (argv[1], "-h") || !strcmp (argv[1], "--help")) {
- print_help ();
- exit (0);
- }
-
- // client _AND_ server must be given
- if (argc < 3)
- {
- fprintf (stderr, "\nPlease give client and server as arguments");
- print_usage();
- exit(5);
- }
-
- // Scan all options for -l/--logfile. They must be honored BEFORE
- // the logger is used the first time.
- for (int arg = 1; arg < argc; arg++)
- {
- if (!strcmp(argv[arg], "-l") || !strcmp(argv[arg], "--logfile"))
- {
- arg++; // switch to filename
-
- if (arg >= argc)
- {
- print_error ("Option %s is missing an argument", argv[arg-1]);
- exit(5);
- }
-
- set_log_filename( argv[arg] ); // set logfile given in command line
- }
- if (!strcmp(argv[arg], "-c") || !strcmp(argv[arg], "--logconf"))
- {
- arg++; // switch to filename
-
- if (arg >= argc)
- {
- print_error ("Option %s is missing an argument", argv[arg-1]);
- exit(5);
- }
-
- set_log_conf( argv[arg] );
- }
- }
-
- // set a defined umask
- umask (0022);
-
- YCPPathSearch::initialize();
-
- ostringstream argdump;
- for (int arg = 1; arg < argc; arg++)
- {
- argdump << " '" << argv[arg] << "'";
- }
-
- y2milestone ("Launched YaST2 component '%s'%s", progname, argdump.str().c_str());
-
- // Now evaluate command line options in sequence
-
- int arg = 1;
-
- // The first argument might be the log option or MUST be the client name
- if (!strcmp(argv[arg], "-l") || !strcmp(argv[arg], "--logfile"))
- {
- // Logfile already done at program start --> ignore here
- arg+=2; // skip over logfilename
- }
- if (!strcmp(argv[arg], "-c") || !strcmp(argv[arg], "--logconf"))
- {
- // Logfile already done at program start --> ignore here
- arg+=2; // skip over logfilename
- }
- // The first argument might be the log option or MUST be the client name
- if (!strcmp(argv[arg], "-l") || !strcmp(argv[arg], "--logfile"))
- {
- // Logfile already done at program start --> ignore here
- arg+=2; // skip over logfilename
- }
-
-
- // Check for namespace exceptions registration
- while (!strcmp(argv[arg], "-n"))
- {
- arg++;
- char *pos = index (argv[arg], '=');
- if (pos == NULL)
- {
- print_error ("Option %s argument must be in format namespace=component", argv[arg-1]);
- exit (5);
- }
- *pos = 0;
- Y2ComponentBroker::registerNamespaceException (argv[arg], pos+1);
- *pos = '=';
- arg++;
- }
-
- // now create client
- char *client_name = argv[arg];
- if (!client_name) {
+ if (!argv[arg]) {
print_usage ();
exit (1);
}
- Y2Component *client = Y2ComponentBroker::createClient (client_name);
- if (!client)
- {
- print_error ("No such client module %s", client_name);
- print_usage ();
- exit (5);
- }
-
+ client_name = argv[arg];
arg++; // next argument (first client option)
// Prepare client options
-
- YCPList arglist;
-
while (arg < argc)
{
if (!strcmp(argv[arg], "-l") || !strcmp(argv[arg], "--logfile"))
@@ -412,7 +272,11 @@
arg++; // switch to next argument
} // Parsing client options
+}
+void
+parse_server_and_options (int argc, char ** argv, int& arg, char *& server_name, YCPList& preload)
+{
if (arg >= argc)
{
fprintf(stderr, "No server module given\n");
@@ -421,23 +285,15 @@
}
// now create server
- char *server_name = argv[arg];
- if (!server_name) {
+ if (!argv[arg]) {
print_usage ();
exit (1);
}
- Y2Component *server = Y2ComponentBroker::createServer (server_name);
- if (!server) {
- print_error ("No such server module %s", server_name);
- print_usage();
- exit(5);
- }
-
+ server_name = argv[arg];
arg++; // next argument (first server option)
// Prepare server and general options
- YCPList preload; // prepare preload files from option -p
while (arg < argc)
{
@@ -507,9 +363,159 @@
arg++; // switch to next argument
} // parsing server options
+}
+
+int
+main (int argc, char **argv)
+{
+ if (!argv[0])
+ {
+ fprintf (stderr, "Missing argv[0]. It is a NULL pointer.");
+ exit (5);
+ }
+
+ progname = basename (argv[0]); // get program name
+
+ // Ignore SIGPIPE. No use in signals. Signals can't be assigned to
+ // components
+ signal(SIGPIPE, SIG_IGN);
+
+ // Give some output for the SIGSEGV
+ // and other signals too, #238172
+ // Note that USR1 and USR2 are handled by the logger.
+ signal (SIGHUP, signal_handler);
+ signal (SIGINT, signal_handler);
+ signal (SIGQUIT, signal_handler);
+ signal (SIGILL , signal_handler);
+ signal (SIGABRT, signal_handler);
+ signal (SIGFPE, signal_handler);
+ signal (SIGSEGV, signal_handler);
+ signal (SIGTERM, signal_handler);
+
+ if (argc < 2) {
+ fprintf (stderr, "\nToo few arguments");
+ print_usage();
+ exit (1);
+ }
+
+ if (!strcmp (argv[1], "-h") || !strcmp (argv[1], "--help")) {
+ print_help ();
+ exit (0);
+ }
+
+ // client _AND_ server must be given
+ if (argc < 3)
+ {
+ fprintf (stderr, "\nPlease give client and server as arguments");
+ print_usage();
+ exit(5);
+ }
+
+ // Scan all options for -l/--logfile. They must be honored BEFORE
+ // the logger is used the first time.
+ for (int arg = 1; arg < argc; arg++)
+ {
+ if (!strcmp(argv[arg], "-l") || !strcmp(argv[arg], "--logfile"))
+ {
+ arg++; // switch to filename
+
+ if (arg >= argc)
+ {
+ print_error ("Option %s is missing an argument", argv[arg-1]);
+ exit(5);
+ }
+
+ set_log_filename( argv[arg] ); // set logfile given in command line
+ }
+ if (!strcmp(argv[arg], "-c") || !strcmp(argv[arg], "--logconf"))
+ {
+ arg++; // switch to filename
+
+ if (arg >= argc)
+ {
+ print_error ("Option %s is missing an argument", argv[arg-1]);
+ exit(5);
+ }
+
+ set_log_conf( argv[arg] );
+ }
+ }
+
+ // set a defined umask
+ umask (0022);
+
+ YCPPathSearch::initialize();
+
+ ostringstream argdump;
+ for (int arg = 1; arg < argc; arg++)
+ {
+ argdump << " '" << argv[arg] << "'";
+ }
+
+ y2milestone ("Launched YaST2 component '%s'%s", progname, argdump.str().c_str());
+
+ // Now evaluate command line options in sequence
+
+ int arg = 1;
+
+ // The first argument might be the log option or MUST be the client name
+ if (!strcmp(argv[arg], "-l") || !strcmp(argv[arg], "--logfile"))
+ {
+ // Logfile already done at program start --> ignore here
+ arg+=2; // skip over logfilename
+ }
+ if (!strcmp(argv[arg], "-c") || !strcmp(argv[arg], "--logconf"))
+ {
+ // Logfile already done at program start --> ignore here
+ arg+=2; // skip over logfilename
+ }
+ // The first argument might be the log option or MUST be the client name
+ if (!strcmp(argv[arg], "-l") || !strcmp(argv[arg], "--logfile"))
+ {
+ // Logfile already done at program start --> ignore here
+ arg+=2; // skip over logfilename
+ }
+
+
+ // Check for namespace exceptions registration
+ while (!strcmp(argv[arg], "-n"))
+ {
+ arg++;
+ char *pos = index (argv[arg], '=');
+ if (pos == NULL)
+ {
+ print_error ("Option %s argument must be in format namespace=component", argv[arg-1]);
+ exit (5);
+ }
+ *pos = 0;
+ Y2ComponentBroker::registerNamespaceException (argv[arg], pos+1);
+ *pos = '=';
+ arg++;
+ }
+
+ // "arg" and these two are output params
+ char * client_name;
+ YCPList arglist;
+ parse_client_and_options (argc, argv, arg, client_name, arglist);
+
+ // "arg" and these two are output params
+ char * server_name;
+ YCPList preload; // prepare preload files from option -p
+ parse_server_and_options (argc, argv, arg, server_name, preload);
+
+ // now create server
+
+ Y2ComponentBroker::registerNamespaceException ("UI", server_name);
+ Y2Component *server = Y2ComponentBroker::getNamespaceComponent ("UI");
+ if (!server) {
+ print_error ("No such server module %s", server_name);
+ print_usage();
+ exit(5);
+ }
+
// Put argument into a nice new array and give them to the server
char **server_argv = new char *[argc-arg+2];
- server_argv[0] = server_name;
+ server_argv[0] = strdup (server_name);
for (int i = arg; i < argc; i++)
server_argv[i-arg+1] = argv[i];
argv[argc] = NULL;
@@ -523,6 +529,16 @@
server->evaluate(preload->value(i));
}
+ // now create client
+
+ Y2Component *client = Y2ComponentBroker::createClient (client_name);
+ if (!client)
+ {
+ print_error ("No such client module %s", client_name);
+ print_usage ();
+ exit (5);
+ }
+
// The environment variable YAST_IS_RUNNING is checked in rpm
// post install scripts. Might be useful for other scripts as
// well.
Modified: branches/tmp/sh/mod-ui/core/liby2/src/include/y2/Y2PluginComponent.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/liby2/src/…
==============================================================================
--- branches/tmp/sh/mod-ui/core/liby2/src/include/y2/Y2PluginComponent.h (original)
+++ branches/tmp/sh/mod-ui/core/liby2/src/include/y2/Y2PluginComponent.h Wed Sep 12 17:28:00 2007
@@ -102,6 +102,8 @@
* Returns the SCRAgent of the Y2Component or NULL if it doesn't have one.
*/
SCRAgent* getSCRAgent ();
+
+ Y2Namespace* import (const char* name_space);
/**
* Tells this server, that the client doesn't need it's services
Modified: branches/tmp/sh/mod-ui/core/libycp/src/Bytecode.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/Bytecode.cc (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/Bytecode.cc Wed Sep 12 17:28:00 2007
@@ -845,8 +845,7 @@
YCodePtr res = 0;
- try
- {
+ // there used to be a try/catch here but it was moved to readFile
switch (code)
{
@@ -1059,13 +1058,6 @@
break;
}
- }
- catch (const Bytecode::Invalid&)
- {
- // there are memory leaks all over the place now
- y2error ("Caught invalid bytecode");
- }
-
return res;
}
@@ -1158,8 +1150,17 @@
#if DO_DEBUG
// y2debug ("Header accepted");
#endif
-
- return readCode (instream);
+
+ try
+ {
+ return readCode (instream);
+ }
+ catch (const Bytecode::Invalid&)
+ {
+ // there are memory leaks all over the place now
+ y2error ("Caught invalid bytecode in '%s'", filename.c_str());
+ return 0;
+ }
}
y2error ("Unsupported version %d.%d.%d"
Modified: branches/tmp/sh/mod-ui/core/libycp/src/Import.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/Import.cc (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/Import.cc Wed Sep 12 17:28:00 2007
@@ -98,6 +98,8 @@
return -1;
}
+ y2debug ("Component found: %s", comp->name().c_str());
+
name_space = comp->import (cname); // do the bytecode import
if (name_space == NULL)
{
Modified: branches/tmp/sh/mod-ui/core/libycp/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/Makefile.am (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/Makefile.am Wed Sep 12 17:28:00 2007
@@ -21,6 +21,7 @@
libycpvalues_la_SOURCES = \
Bytecode.cc Import.cc Point.cc \
+ Xmlcode.cc \
YCPBoolean.cc \
YCPElement.cc YCPByteblock.cc YCPFloat.cc \
YCPInteger.cc YCPList.cc \
Modified: branches/tmp/sh/mod-ui/core/libycp/src/Point.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/Point.cc (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/Point.cc Wed Sep 12 17:28:00 2007
@@ -45,6 +45,7 @@
#include "ycp/Point.h"
#include "ycp/Bytecode.h"
+#include "ycp/Xmlcode.h"
#include "ycp/Scanner.h"
#include "ycp/y2log.h"
@@ -169,4 +170,20 @@
}
+std::ostream &
+Point::toXml (std::ostream & str, int indent ) const
+{
+ str << Xmlcode::spaces( indent ) << "<point line=" << m_line << ">";
+#if DO_DEBUG
+ y2debug ("Point::toStream (%s)", toString().c_str());
+#endif
+ Xmlcode::writeEntry (str, m_entry);
+ if (m_point)
+ {
+ m_point->toXml( str, indent );
+ }
+ return str << "</point>";
+}
+
+
// EOF
Modified: branches/tmp/sh/mod-ui/core/libycp/src/StaticDeclaration.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/StaticDeclaration.cc (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/StaticDeclaration.cc Wed Sep 12 17:28:00 2007
@@ -34,6 +34,7 @@
#include "ycp/YBlock.h"
#include "ycp/Bytecode.h"
+#include "ycp/Xmlcode.h"
#include "ycp/Import.h"
#include "ycp/Point.h"
@@ -49,7 +50,7 @@
// list of namespace prefixes to mark as 'predefined'
// They will be auto-loaded by the scanner on first appearance
//
-static char *predefined[] = {
+static const char *predefined[] = {
"UI", "WFM", "SCR", "Pkg", 0
};
//------------------------------------------------------------------------
@@ -61,7 +62,7 @@
#if DO_DEBUG
y2debug ("m_declTable %p", m_declTable);
#endif
- char **pptr = predefined;
+ const char **pptr = predefined;
SymbolEntryPtr sentry;
Point *point = new Point ("<predefined>");
while (*pptr != 0)
@@ -513,6 +514,27 @@
}
+// write declaration to stream (name and type)
+std::ostream &
+StaticDeclaration::writeXmlDeclaration (std::ostream & str, const declaration_t *decl) const
+{
+ string ns;
+
+ const declaration_t *d = decl;
+ while( d->name_space != 0 )
+ {
+ d = d->name_space;
+ if (!ns.empty()) ns += "::";
+ ns = std::string(d->name);
+ }
+
+ if (!ns.empty()) str << " ns=\"" << ns << "\"";
+ str << " name=\"" << Xmlcode::xmlify( decl->name ) << "\"";
+ decl->type->toXml( str, 0 );
+ return str;
+}
+
+
// read declaration from stream (return declaration matching name and type _exactly_)
declaration_t *
StaticDeclaration::readDeclaration (bytecodeistream & str) const
@@ -526,7 +548,10 @@
if (decl == 0)
{
ycp2error ("No match for '%s (%s)'", name, type->toString().c_str());
- str.setstate (std::ostream::failbit);
+ ycp2error ("That is a builtin function, so your bytecode");
+ ycp2error ("needs to be recompiled using a recent yast2-core.");
+ delete [] name;
+ throw Bytecode::Invalid();
}
delete [] name;
return decl;
Modified: branches/tmp/sh/mod-ui/core/libycp/src/SymbolTable.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/SymbolTable.cc (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/SymbolTable.cc Wed Sep 12 17:28:00 2007
@@ -23,6 +23,7 @@
#include "ycp/SymbolTable.h"
#include "y2/SymbolEntry.h"
#include "ycp/Bytecode.h"
+#include "ycp/Xmlcode.h"
#include "ycp/Point.h"
#ifndef DO_DEBUG
@@ -179,6 +180,26 @@
}
+std::ostream &
+TableEntry::toXml (std::ostream & str, int indent ) const
+{
+ str << Xmlcode::spaces( indent ) << "<tableentry>\n";
+ str << Xmlcode::spaces( indent+2 );
+ Xmlcode::writeEntry (str, m_entry);
+ str << endl;
+ m_point->toXml (str, indent+2 );
+ if ((m_entry->category() == SymbolEntry::c_function) // write function prototype if it's global
+ && m_entry->isGlobal())
+ {
+// y2debug ("TableEntry::toStream: write global function prototype");
+
+ // FIXME: why do we this here???
+ ((YFunctionPtr)(((YSymbolEntryPtr)m_entry)->code()))->toXml( str, indent );
+ }
+ return str << endl << Xmlcode::spaces( indent ) << "</tableentry>";
+}
+
+
void
TableEntry::remove ()
{
@@ -478,6 +499,60 @@
return str;
}
+
+std::ostream &
+SymbolTable::writeXmlUsage (std::ostream & str, int indent ) const
+{
+ if (m_used == 0)
+ return str;
+
+ std::vector<TableEntry *> xrefs;
+
+ std::map<const char *, TableEntry *>::iterator it;
+
+ for (it = m_used->begin(); it != m_used->end(); it++)
+ {
+ TableEntry *tentry = it->second;
+ tentry->sentry()->setPosition (xrefs.size());
+#if DO_DEBUG
+ y2debug ("%d -> %s", xrefs.size(), tentry->sentry()->toString().c_str());
+#endif
+ xrefs.push_back (tentry);
+ }
+
+ int rsize = xrefs.size();
+ if (rsize == 0)
+ return str;
+
+ bool xref_debug = (getenv (XREFDEBUG) != 0);
+
+ if (xref_debug) y2milestone ("Need %d symbols from table %p\n", rsize, this);
+#if DO_DEBUG
+ else y2debug ("Need %d symbols from table %p\n", rsize, this);
+#endif
+
+ str << Xmlcode::spaces( indent ) << "<usage>\n";
+
+ int position = 0;
+ while (position < rsize)
+ {
+ SymbolEntryPtr sentry = xrefs[position]->sentry();
+
+ if (xref_debug) y2milestone("XRef %p::%s @ %d\n", this, sentry->toString().c_str(), position);
+#if DO_DEBUG
+ else y2debug("XRef %p::%s @ %d\n", this, sentry->toString().c_str(), position);
+#endif
+ str << Xmlcode::spaces( indent+2 ) << "<name>" << sentry->name() << "</name>";
+ sentry->type()->toXml( str, 0 );
+ str << endl;
+
+ sentry->setPosition (-position - 1); // negative position -> Xref
+ position++;
+ }
+
+ return str << Xmlcode::spaces( indent ) << "</usage>\n";
+}
+
//-------------------------------------------------------------------
int
Modified: branches/tmp/sh/mod-ui/core/libycp/src/Type.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/Type.cc (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/Type.cc Wed Sep 12 17:28:00 2007
@@ -20,6 +20,7 @@
#include "ycp/y2log.h"
#include "ycp/Type.h"
#include "ycp/Bytecode.h"
+#include "ycp/Xmlcode.h"
#include "ycp/YCPMap.h" // for YCPMapIterator
#include "ycp/YCPCode.h" // for YT_Code in matchvalue()
@@ -137,7 +138,7 @@
/**
- * write out to stream
+ * write out to bytecode stream
*/
std::ostream &
@@ -152,6 +153,16 @@
return str;
}
+
+std::ostream &
+Type::toXml( std::ostream & str, int indent ) const
+{
+ str << " type=\"" << toXmlString() << "\"";
+ if (m_const) str << " const=\"1\"";
+ if (m_reference) str << " reference=\"1\"";
+ return str;
+}
+
//----------------------------------------------------------------
// Type
@@ -193,6 +204,44 @@
}
+string
+Type::toXmlString () const
+{
+ string ret;
+ switch (m_kind)
+ {
+ case UnspecT: ret = "unspec"; break;
+ case ErrorT: ret = "ERR"; break;
+ case AnyT: ret = "any"; break;
+ case BooleanT: ret = "boolean"; break;
+ case ByteblockT: ret = "byteblock"; break;
+ case FloatT: ret = "float"; break;
+ case IntegerT: ret = "integer"; break;
+ case LocaleT: ret = "locale"; break;
+ case PathT: ret = "path"; break;
+ case StringT: ret = "string"; break;
+ case SymbolT: ret = "symbol"; break;
+ case TermT: ret = "term"; break;
+ case VoidT: ret = "void"; break;
+ case WildcardT: ret = "..."; break;
+
+ case FlexT: ret = "flex"; break;
+ case VariableT: ret = "var"; break;
+ case BlockT: ret = "block"; break;
+ case ListT: ret = "list"; break;
+ case MapT: ret = "map"; break;
+ case TupleT: ret = "tuple"; break;
+ case FunctionT: ret = "function"; break;
+
+ case NilT: ret = "nil"; break;
+ case NFlexT: ret = "nflex"; break;
+ // no default:, let gcc warn
+ }
+ if (ret.empty()) ret = "<UNHANDLED>";
+ return preToString() + ret + postToString();
+}
+
+
// match basic (non-constructed) types
//
// returns 0 if match
Added: branches/tmp/sh/mod-ui/core/libycp/src/Xmlcode.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/Xmlcode.cc (added)
+++ branches/tmp/sh/mod-ui/core/libycp/src/Xmlcode.cc Wed Sep 12 17:28:00 2007
@@ -0,0 +1,883 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | |( _| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| ( C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: Xmlcode.cc
+
+ Author: Klaus Kaempf <kkaempf(a)suse.de>
+ Maintainer: Klaus Kaempf <kkaempf(a)suse.de>
+
+ Cloned from Bytecode.cc
+
+ This file contains code to output YCode as XML.
+
+ It primary use is to have an easily parseable representation
+ of the abstract syntax tree coming from the YCP parser.
+ This XML representation could then be used to convert it
+ to C, Ruby, Python, Java, C#, whatever, code.
+
+ See also http://idea.opensuse.org/content/ideas/ycp-to-ruby-translator
+
+ The functions to read XML (and construct YCode from it) are
+ not needed and therefore disabled. If the need arises in
+ the future to parse XML, define XMLCODE_INPUT_SUPPORTED to 1
+ and fix the missing pieces ;-)
+/-*/
+
+#ifndef DO_DEBUG
+#define DO_DEBUG 0
+#endif
+
+// No, input is not supported
+#define XMLCODE_INPUT_SUPPORTED 0
+
+// MAJOR and MINOR number must the the same in header, RELEASE is assumed to
+// provide a backward compatibility
+#define YaST_BYTECODE_HEADER "YaST xmlcode "
+#define YaST_BYTECODE_MAJOR "1"
+#define YaST_BYTECODE_MINOR "4"
+#define YaST_BYTECODE_RELEASE "0"
+
+#include "ycp/Xmlcode.h"
+#include "YCP.h"
+#include "ycp/YCode.h"
+#include "ycp/YExpression.h"
+#include "ycp/YStatement.h"
+#include "ycp/YBlock.h"
+
+#include "y2/Y2Namespace.h"
+
+#include "ycp/y2log.h"
+#include "ycp/pathsearch.h"
+
+#include <fstream>
+#include <errno.h>
+#include <string.h>
+#include <ctype.h>
+
+
+static int
+readInt( xmlcodeistream & str)
+{
+ int i = 0;
+
+ char c;
+
+ for( ;;)
+ {
+ str.get( c);
+ if( !isdigit( c))
+ break;
+ i *= 10;
+ i +=( c - '0');
+ }
+
+ return i;
+}
+
+
+xmlcodeistream::xmlcodeistream( string filename)
+ : std::ifstream( filename.c_str( ))
+ , m_major( -1)
+ , m_minor( -1)
+ , m_release( -1)
+{
+ if( !is_open( ))
+ {
+ y2error( "Failed to open '%s': %s", filename.c_str(), strerror( errno));
+ return;
+ }
+ // read YaST_BYTECODE_HEADER
+
+ char header[sizeof(YaST_BYTECODE_HEADER)+1];
+ int headerlen = strlen( YaST_BYTECODE_HEADER);
+ read( header, headerlen);
+ header[headerlen] = 0;
+ if( strcmp( header, YaST_BYTECODE_HEADER) != 0)
+ {
+ y2error( "Not a xmlcode file '%s'[%s]", filename.c_str(), header);
+ return;
+ }
+
+ m_major = readInt( *this);
+ m_minor = readInt( *this);
+ m_release = readInt( *this);
+}
+
+bool xmlcodeistream::isVersion( int major, int minor, int release)
+{
+ return( major == m_major)
+ &&( minor == m_minor)
+ &&( release == m_release);
+}
+
+bool xmlcodeistream::isVersionAtMost( int major, int minor, int release)
+{
+ if( m_major > major)
+ {
+ return false;
+ }
+
+ if( m_major == major)
+ {
+ if( m_minor > minor)
+ {
+ return false;
+ }
+
+ if( ( m_minor == minor) &&( m_release > release))
+ {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+int Xmlcode::m_namespace_nesting_level = -1;
+int Xmlcode::m_namespace_nesting_array_size = 0;
+int Xmlcode::m_namespace_tare_level = 0;
+Xmlcode::namespaceentry_t *Xmlcode::m_namespace_nesting_array = 0;
+
+void
+Xmlcode::namespaceInit( )
+{
+#if DO_DEBUG
+ y2debug( "Reinitialize namespaces");
+#endif
+ if( Xmlcode::m_namespace_nesting_array)
+ {
+ free( Xmlcode::m_namespace_nesting_array);
+ }
+
+ Xmlcode::m_namespace_nesting_array = 0;
+ Xmlcode::m_namespace_nesting_level = -1;
+ Xmlcode::m_namespace_nesting_array_size = 0;
+ Xmlcode::m_namespace_tare_level = 0;
+}
+
+// ------------------------------------------------------------------
+// xmlcode I/O
+
+static int
+to_hexc( unsigned char v )
+{
+ if( v < 10 ) return '0' + v;
+ if( v < 16 ) return 'A' + v - 10;
+ return -1;
+}
+
+std::ostream &
+Xmlcode::writeBytep( std::ostream & str, const unsigned char * bytep, unsigned int len)
+{
+ unsigned int i = 0;
+ str << "<bytes>";
+ while( i < len ) {
+ str << to_hexc(( *bytep & 0xf0) >> 4 ) << to_hexc( *bytep & 0x0f );
+ bytep++;
+ }
+ return str << "</bytes>";
+}
+
+
+unsigned char *
+Xmlcode::readBytep( xmlcodeistream & str)
+{
+ return 0;
+}
+
+
+// ------------------------------------------------------------------
+// Type I/O
+
+std::ostream &
+Xmlcode::writeType( std::ostream & str, constTypePtr type)
+{
+ return type->toXml( str, 0 );
+}
+
+
+TypePtr
+Xmlcode::readType( xmlcodeistream & str)
+{
+#if DO_DEBUG
+y2debug( "Xmlcode::readType(%d)", kind);
+#endif
+#if XMLCODE_INPUT_SUPPORTED
+ int kind = readInt32( str);
+ switch( (Type::tkind)kind)
+ {
+ case Type::UnspecT:
+ case Type::ErrorT:
+ case Type::AnyT:
+ case Type::BooleanT:
+ case Type::ByteblockT:
+ case Type::FloatT:
+ case Type::IntegerT:
+ case Type::LocaleT:
+ case Type::PathT:
+ case Type::StringT:
+ case Type::SymbolT:
+ case Type::TermT:
+ case Type::VoidT:
+ case Type::WildcardT:
+ case Type::FlexT:
+ case Type::NilT:
+ return TypePtr( new Type( (Type::tkind)kind, str) );
+ break;
+
+ case Type::NFlexT: return TypePtr( new NFlexType( str) ); break;
+ case Type::VariableT: return TypePtr( new VariableType( str) ); break;
+ case Type::BlockT: return TypePtr( new BlockType( str) ); break;
+ case Type::ListT: return TypePtr( new ListType( str) ); break;
+ case Type::MapT: return TypePtr( new MapType( str) ); break;
+ case Type::TupleT: return TypePtr( new TupleType( str) ); break;
+ case Type::FunctionT: return TypePtr( new FunctionType( str) ); break;
+ }
+ y2error( "Unhandled type kind %d", kind);
+#endif
+ return Type::Error->clone();
+}
+
+// ------------------------------------------------------------------
+// ycodelist_t * I/O
+
+std::ostream &
+Xmlcode::writeYCodelist( std::ostream & str, const ycodelist_t *codelist )
+{
+ const ycodelist_t *codep = codelist;
+
+ while( codep)
+ {
+ str << "<element>";
+ if( !codep->code->toXml( str, 0 ) )
+ {
+ y2error( "Error writing codelist");
+ break;
+ }
+ codep = codep->next;
+ str << "</element>";
+ }
+
+ return str;
+}
+
+
+bool
+Xmlcode::readYCodelist( xmlcodeistream & str, ycodelist_t **anchor)
+{
+
+ return str.good();
+}
+
+
+// ------------------------------------------------------------------
+// namespace stack handling
+
+// find Id matching namespace
+int
+Xmlcode::namespaceId( const Y2Namespace *name_space)
+{
+ for( int i = m_namespace_tare_level; i <= m_namespace_nesting_level; i++)
+ {
+ if( m_namespace_nesting_array[i].name_space == name_space)
+ {
+ return i - m_namespace_tare_level;
+ }
+ }
+ y2error( "No ID for %p, level %d", name_space, m_namespace_nesting_level);
+ return -1;
+}
+
+
+// retrieve namespace for ID
+const Y2Namespace *
+Xmlcode::namespacePtr( int namespace_id)
+{
+ // for entries without a name_space( foreach)
+ if( namespace_id < 0) return 0;
+
+ namespace_id += m_namespace_tare_level;
+ if( namespace_id <= m_namespace_nesting_level) // local namespace
+ {
+ return m_namespace_nesting_array[namespace_id].name_space;
+ }
+ y2error( "Block id %d > nesting_level %d", namespace_id - m_namespace_tare_level, m_namespace_nesting_level - m_namespace_tare_level);
+ return 0;
+}
+
+
+// push namespace to stack
+// the stack resembles the nesting of namespaces
+int
+Xmlcode::pushNamespace( const Y2Namespace *name_space, bool with_xrefs)
+{
+ if( name_space == 0)
+ {
+ y2error( "Xmlcode::pushNamespace( %p) NULL", name_space);
+ return -1;
+ }
+
+ m_namespace_nesting_level++;
+ if( m_namespace_nesting_array_size <= m_namespace_nesting_level)
+ {
+ m_namespace_nesting_array_size += 16;
+ m_namespace_nesting_array =( namespaceentry_t *)realloc( m_namespace_nesting_array, sizeof( namespaceentry_t) * m_namespace_nesting_array_size);
+ }
+#if DO_DEBUG
+ y2debug( "Xmlcode::pushNamespace( %p), level %d, size %d, tare %d", name_space, m_namespace_nesting_level, m_namespace_nesting_array_size, m_namespace_tare_level);
+#endif
+ m_namespace_nesting_array[m_namespace_nesting_level].name_space = name_space;
+ m_namespace_nesting_array[m_namespace_nesting_level].with_xrefs = with_xrefs;
+ if( with_xrefs)
+ {
+ name_space->table()->openXRefs();
+ }
+
+ return m_namespace_nesting_level-m_namespace_tare_level;
+}
+
+
+// pop namespace from stack
+// the stack resembles the nesting of namespaces
+int
+Xmlcode::popNamespace( const Y2Namespace *name_space)
+{
+#if DO_DEBUG
+ y2debug( "Xmlcode::popNamespace( %p), level %d, size %d, tare %d", name_space, m_namespace_nesting_level, m_namespace_nesting_array_size, m_namespace_tare_level);
+#endif
+ if( name_space == 0)
+ {
+ y2error( "Xmlcode::popNamespace( %p) NULL", name_space);
+ return -1;
+ }
+
+ if( m_namespace_nesting_level < m_namespace_tare_level)
+ {
+ y2error( "Xmlcode::popNamespace( %p) empty stack", name_space);
+ }
+ else if( m_namespace_nesting_array[m_namespace_nesting_level].name_space != name_space)
+ {
+ y2error( "Xmlcode::popNamespace( %p) not top of stack [%d]%p", name_space, m_namespace_nesting_level, m_namespace_nesting_array[m_namespace_nesting_level].name_space);
+ }
+ else
+ {
+ if( m_namespace_nesting_array[m_namespace_nesting_level].with_xrefs)
+ {
+ name_space->table()->closeXRefs();
+ }
+ m_namespace_nesting_level--;
+ }
+ return 0;
+}
+
+
+// pop all from id stack until given namespace is reached and popped too
+void
+Xmlcode::popUptoNamespace( const Y2Namespace *name_space)
+{
+#if DO_DEBUG
+ y2debug( "Xmlcode::popUptoNamespace( %p), level %d, size %d, tare %d", name_space, m_namespace_nesting_level, m_namespace_nesting_array_size, m_namespace_tare_level);
+#endif
+ if( name_space == 0)
+ {
+ y2error( "Xmlcode::popUptoNamespace( %p) NULL", name_space);
+ return;
+ }
+
+ while( m_namespace_nesting_level >= m_namespace_tare_level)
+ {
+ const Y2Namespace *top_space = m_namespace_nesting_array[m_namespace_nesting_level].name_space;
+ if( m_namespace_nesting_array[m_namespace_nesting_level].with_xrefs)
+ {
+ top_space->table()->closeXRefs();
+ }
+ m_namespace_nesting_level--;
+ if( top_space == name_space)
+ {
+ return;
+ }
+ }
+ y2error( "Xmlcode::popUptoNamespace( %p) empty stack", name_space);
+ return;
+}
+
+
+// reset current namespace stack to 'empty' for module loading
+// returns a tare id needed later
+int
+Xmlcode::tareStack( )
+{
+ int tare = m_namespace_nesting_level - m_namespace_tare_level + 1;
+#if DO_DEBUG
+// y2debug( "Xmlcode::tareStack() level %d, size %d, current tare %d, tare_id %d", m_namespace_nesting_level, m_namespace_nesting_array_size, m_namespace_tare_level, tare);
+#endif
+ m_namespace_tare_level = m_namespace_nesting_level + 1;
+ return tare;
+}
+
+
+void
+Xmlcode::untareStack( int tare_id)
+{
+#if DO_DEBUG
+// y2debug( "Xmlcode::untareStack() level %d, size %d, current tare %d, tare_id %d", m_namespace_nesting_level, m_namespace_nesting_array_size, m_namespace_tare_level, tare_id);
+#endif
+ m_namespace_tare_level -= tare_id;
+ return;
+}
+
+// ------------------------------------------------------------------
+// SymbolEntry pointer( !) handling
+// the SymbolEntries itself are 'owned' by YBlock and referenced via pointers
+// to SymbolEntry. These functions handle Xml I/O for SymbolEntry pointers.
+//
+// position is the index in namespace's m_senvironment[] for _local_ symbols
+// position is the index in module table's m_xrefs[] for _external_ symbols, see YSImport
+//
+std::ostream &
+Xmlcode::writeEntry( std::ostream & str, const SymbolEntryPtr sentry)
+{
+ const Y2Namespace *name_space = sentry->nameSpace();
+ string ns = name_space->name();
+ str << "<entry";
+ if (!ns.empty())
+ str << " ns=\"" << ns << "\"";
+ str << " pos=\"" << sentry->position();
+ str << "\" name=\"" << sentry->name() << "\"/>";
+ return str;
+}
+
+
+SymbolEntryPtr
+Xmlcode::readEntry( xmlcodeistream & str)
+{
+ return 0;
+}
+
+// ------------------------------------------------------------------
+// YCode read
+
+
+// read code from stream
+YCodePtr
+Xmlcode::readCode( xmlcodeistream & str)
+{
+ char code;
+ if( !str.get( code))
+ {
+ y2error( "Can't read from stream");
+ return 0;
+ }
+#if DO_DEBUG
+// y2debug( "Xmlcode::readCode( %d:%s)", code, YCode::toString( (YCode::ykind)code).c_str());
+#endif
+ YCodePtr res = 0;
+
+#if XMLCODE_INPUT_SUPPORTED
+ if( code < YCode::ycConstant)
+ {
+ return new YConst( (YCode::ykind)code, str);
+ }
+
+ // compatibility with 9.1/SLES
+ if( str.isVersion( 1,3,2) && code > YCode::yeExpression)
+ {
+ // yeFunctionPointer did not exist then
+ code++;
+ }
+
+ try
+ {
+
+ switch( code)
+ {
+ case YCode::ycConstant:
+ {
+ // this constant is a placeholder, typically used by
+ // language bindings that cannot provide type information
+ y2error( "Unable to read constant, check the compilation of the module");
+ return 0;
+ }
+ case YCode::ycLocale:
+ {
+ res = new YLocale( str);
+ }
+ break;
+ case YCode::ycFunction:
+ {
+ res = new YFunction( str);
+ }
+ break;
+ case YCode::yePropagate:
+ {
+ res = new YEPropagate( str);
+ }
+ break;
+ case YCode::yeUnary:
+ {
+ res = new YEUnary( str);
+ }
+ break;
+ case YCode::yeBinary:
+ {
+ res = new YEBinary( str);
+ }
+ break;
+ case YCode::yeTriple:
+ {
+ res = new YETriple( str);
+ }
+ break;
+ case YCode::yeCompare:
+ {
+ res = new YECompare( str);
+ }
+ break;
+ case YCode::yeLocale:
+ {
+ res = new YELocale( str);
+ }
+ break;
+ case YCode::yeList:
+ {
+ res = new YEList( str);
+ }
+ break;
+ case YCode::yeMap:
+ {
+ res = new YEMap( str);
+ }
+ break;
+ case YCode::yeTerm:
+ {
+ res = new YETerm( str);
+ }
+ break;
+ case YCode::yeIs:
+ {
+ res = new YEIs( str);
+ }
+ break;
+ case YCode::yeBracket:
+ {
+ res = new YEBracket( str);
+ }
+ break;
+ case YCode::yeBlock:
+ {
+ res = new YBlock( str);
+ }
+ break;
+ case YCode::yeReturn:
+ {
+ res = new YEReturn( str);
+ }
+ break;
+ case YCode::yeVariable:
+ {
+ res = new YEVariable( str);
+ }
+ break;
+ case YCode::yeReference:
+ {
+ res = new YEReference( str);
+ }
+ break;
+ case YCode::yeBuiltin:
+ {
+ res = new YEBuiltin( str);
+ }
+ break;
+ case YCode::yeFunction:
+ {
+ res = YECall::readCall( str);
+ }
+ break;
+ case YCode::yeFunctionPointer:
+ {
+ res = new YEFunctionPointer( str);
+ }
+ break;
+ case YCode::ysTypedef:
+ {
+ res = new YSTypedef( str);
+ }
+ break;
+ case YCode::ysVariable:
+ {
+ res = new YSVariable( str);
+ }
+ break;
+ case YCode::ysFunction:
+ {
+ res = new YSFunction( str);
+ }
+ break;
+ case YCode::ysAssign:
+ {
+ res = new YSAssign( str);
+ }
+ break;
+ case YCode::ysBracket:
+ {
+ res = new YSBracket( str);
+ }
+ break;
+ case YCode::ysIf:
+ {
+ res = new YSIf( str);
+ }
+ break;
+ case YCode::ysWhile:
+ {
+ res = new YSWhile( str);
+ }
+ break;
+ case YCode::ysDo:
+ {
+ res = new YSDo( str);
+ }
+ break;
+ case YCode::ysRepeat:
+ {
+ res = new YSRepeat( str);
+ }
+ break;
+ case YCode::ysExpression:
+ {
+ res = new YSExpression( str);
+ }
+ break;
+ case YCode::ysReturn:
+ {
+ res = new YSReturn( str);
+ }
+ break;
+ case YCode::ysBreak:
+ {
+ res = new YSBreak( str);
+ }
+ break;
+ case YCode::ysContinue:
+ {
+ res = new YSContinue( str);
+ }
+ break;
+ case YCode::ysTextdomain:
+ {
+ res = new YSTextdomain( str);
+ }
+ break;
+ case YCode::ysInclude:
+ {
+ res = new YSInclude( str);
+ }
+ break;
+ case YCode::ysFilename:
+ {
+ res = new YSFilename( str);
+ }
+ break;
+ case YCode::ysImport:
+ {
+ res = new YSImport( str);
+ }
+ break;
+ case YCode::ysBlock:
+ {
+ res = new YSBlock( str);
+ }
+ break;
+ case YCode::ysSwitch:
+ {
+ res = new YSSwitch( str);
+ }
+ break;
+ default:
+ {
+ y2error( "Unknown code %d", code);
+ }
+ break;
+ }
+
+ }
+ catch( const Xmlcode::Invalid&)
+ {
+ // there are memory leaks all over the place now
+ y2error( "Caught invalid xmlcode");
+ }
+#endif
+ return res;
+}
+
+
+// ------------------------------------------------------------------
+// File I/O
+
+// static member
+map <string, YBlockPtr>* Xmlcode::m_xmlcodeCache = NULL;
+
+// read file from module path
+
+YBlockPtr
+Xmlcode::readModule( const string & mname)
+{
+#if DO_DEBUG
+// y2debug( "Xmlcode::readModule( %s) ", mname.c_str( ));
+#endif
+
+ // TODO better error reporting?
+ // like: could not find foo.ycp in /modules, /a/modules.
+ // It will return an empty string on failure
+
+ string filename = YCPPathSearch::findModule( mname);
+ if( filename.empty())
+ {
+ ycperror( "Module '%s' not found", mname.c_str());
+ return 0;
+ }
+
+ if( ! m_xmlcodeCache)
+ {
+ m_xmlcodeCache = new map <string, YBlockPtr>;
+ }
+
+ // check the cache
+ if( m_xmlcodeCache->find( mname) != m_xmlcodeCache->end( ))
+ {
+#if DO_DEBUG
+// y2debug( "Xmlcode cache hit: %s", mname.c_str( ));
+#endif
+
+ return m_xmlcodeCache->find( mname)->second;
+ }
+
+ int tare_id = Xmlcode::tareStack( ); // current nesting level is 0 for this module
+ YBlockPtr block =( YBlockPtr)Xmlcode::readFile( filename);
+
+ if( block == NULL)
+ {
+ return NULL;
+ }
+
+ Xmlcode::untareStack( tare_id);
+
+ if( !block->isModule())
+ {
+ y2error( "'%s' is no module", filename.c_str());
+ return NULL;
+ }
+
+ m_xmlcodeCache->insert( std::make_pair( mname, block));
+
+ return block;
+}
+
+
+// read YCode from file, return YCode( 0 in case of failure)
+YCodePtr
+Xmlcode::readFile( const string & filename)
+{
+#if DO_DEBUG
+// y2debug( "Xmlcode::readFile( %s)", filename.c_str());
+#endif
+ xmlcodeistream instream( filename);
+ if( !instream.is_open( ))
+ {
+ y2error( "Failed to open '%s': %s", filename.c_str(), strerror( errno));
+ return 0;
+ }
+ // check YaST_BYTECODE_HEADER
+ if(
+ instream.isVersion(
+ atoi( YaST_BYTECODE_MAJOR)
+ , atoi( YaST_BYTECODE_MINOR)
+ , atoi( YaST_BYTECODE_RELEASE))
+ ||
+ instream.isVersion( 1,3,2) ) // 9.1/SLES9
+ {
+#if DO_DEBUG
+// y2debug( "Header accepted");
+#endif
+
+ return readCode( instream);
+ }
+
+ y2error( "Unsupported version %d.%d.%d"
+ , instream.major( )
+ , instream.minor( )
+ , instream.release( ));
+ return 0;
+}
+
+
+// write YCode to file, return false on error( i.e. file not existing - see errno)
+bool
+Xmlcode::writeFile( const YCodePtr code, const string & filename)
+{
+ // clear errno first
+ errno = 0;
+
+ std::ofstream outstream( filename.c_str());
+ if( !outstream.is_open( ))
+ {
+ y2error( "Failed to write '%s': %s", filename.c_str(), strerror( errno));
+ return false;
+ }
+
+ outstream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
+ outstream << "<ycp version=\"2.15.8.39280\">\n";
+ code->toXml( outstream, 2 );
+ outstream << "</ycp>\n";
+ return ! outstream.fail( );
+}
+
+
+// indentation
+
+string
+Xmlcode::spaces( int count )
+{
+ count >>= 1;
+ if (count <= 0) return "";
+
+ // 2 4 6 8 10 12 14 16 18 20
+ static string s[10] = { " ", " ", " ", "\t", "\t ", "\t ", "\t ", "\t\t", "\t\t ", "\t\t " };
+
+ if( count > 10 ) {
+ return s[9] + spaces( count*2 - 20 );
+ }
+ return s[count - 1];
+}
+
+string
+Xmlcode::xmlify( const string & s )
+{
+ string result;
+
+ const char *cptr = s.c_str();
+ const char *next;
+ while( (next = strpbrk( cptr, "&<>'\"" )) ) {
+ result += string( cptr, next - cptr );
+ switch (*next) {
+ case '&': result += "&"; break;
+ case '<': result += "<"; break;
+ case '>': result += ">"; break;
+ case '"': result += """; break;
+ case '\'': result += "'"; break;
+ }
+ cptr = next + 1;
+ }
+ result += string( cptr );
+ return result;
+
+}
Modified: branches/tmp/sh/mod-ui/core/libycp/src/YBlock.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/YBlock.cc (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/YBlock.cc Wed Sep 12 17:28:00 2007
@@ -36,6 +36,7 @@
#include "ycp/Point.h"
#include "ycp/Bytecode.h"
+#include "ycp/Xmlcode.h"
#include "ycp/Scanner.h"
#include "ycp/y2log.h"
@@ -516,6 +517,51 @@
}
+std::ostream &
+YBlock::toXmlSwitch( map<YCPValue, int, ycpless> cases, int defaultcase, std::ostream & str, int indent ) const
+{
+ // first, create reverse map of cases
+ int statementcount = statementCount ();
+ YCPValue values[statementcount];
+
+ for (int i = 0; i < statementcount; i++)
+ values[i] = YCPNull ();
+
+ for (map<YCPValue, int, ycpless>::iterator it = cases.begin ();
+ it != cases.end (); it++ )
+ {
+ values[ it->second ] = it->first;
+ }
+
+ // s += environmentToString ();
+
+ stmtlist_t *stmt = m_statements;
+ int index = 0;
+ while (stmt)
+ {
+ str << Xmlcode::spaces( indent );
+ if (index == defaultcase)
+ {
+ str << "<default>\n";
+ stmt->stmt->toXml( str, indent+2 );
+ str << endl << "</default>";
+ }
+ else if (! values[index].isNull ())
+ {
+ str << "<case>";
+ values[index]->toXml( str, 0 );
+ str << endl;
+ stmt->stmt->toXml( str, indent+2 );
+ str << endl << "</case>";
+ }
+ stmt = stmt->next;
+ index++;
+ }
+
+ return str;
+}
+
+
YCPValue
YBlock::evaluate (bool cse)
{
@@ -965,6 +1011,92 @@
}
+std::ostream &
+YBlock::toXml( std::ostream & str, int indent ) const
+{
+ str << Xmlcode::spaces( indent ) << "<block kind=\"";
+
+ switch( m_kind ) {
+ case b_unknown: str << "unspec"; break;
+ case b_module: str << "module"; break;
+ case b_file: str << "file"; break;
+ case b_statement: str << "stmt"; break;
+ case b_definition: str << "def"; break;
+ case b_value: str << "value"; break;
+ case b_namespace: str << "namespace"; break;
+ case b_using: str << "using"; break;
+ }
+ str << "\"";
+ if( !m_name.empty() ) {
+ str << " name=\"" << m_name << "\"";
+ }
+ str << ">\n";
+
+ indent += 2;
+
+ Xmlcode::pushNamespace (nameSpace());
+
+ if (symbolCount() > 0)
+ {
+ str << Xmlcode::spaces( indent ) << "<symbols>\n";
+
+ for (unsigned int i = 0; i < symbolCount(); i++)
+ {
+ YSymbolEntryPtr entry = (YSymbolEntryPtr)symbolEntry (i);
+ entry->toXml( str, indent+2 ); // write SymbolEntry
+ str << endl;
+ }
+ str << Xmlcode::spaces( indent ) << "</symbols>\n";
+
+#if 0
+ // if its a module, write the table
+
+ if (isModule())
+ {
+ yTElist_t *tptr = m_tenvironment;
+
+ if (tptr) {
+ str << Xmlcode::spaces( indent ) << "<table>\n";
+
+ while (tptr)
+ {
+ tptr->tentry->toXml( str, indent+2 ); // write the table entries
+ str << endl;
+ tptr = tptr->next;
+ }
+ str << Xmlcode::spaces( indent ) << "</table>\n";
+ }
+ }
+#endif
+ }
+
+#if 0
+ m_point->toXml( str, indent );
+ str << endl;
+#endif
+
+ stmtlist_t *stmt = m_statements;
+ if( stmt ) {
+ str << Xmlcode::spaces( indent ) << "<statements>\n";
+
+ while (stmt) // write statements
+ {
+ str << Xmlcode::spaces( indent+2 ) << "<stmt>";
+ stmt->stmt->toXml (str, 0 ); // YSImport will push it's namespace
+ str << "</stmt>" << endl;
+ stmt = stmt->next;
+ }
+
+ str << Xmlcode::spaces( indent ) << "</statements>\n";
+ }
+ Xmlcode::popUptoNamespace (nameSpace());
+
+ str << Xmlcode::spaces( indent-2 ) << "</block>\n";
+
+ return str;
+}
+
+
bool
YBlock::isIncluded (string includefile) const
{
Modified: branches/tmp/sh/mod-ui/core/libycp/src/YCPBoolean.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/YCPBoolean.cc (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/YCPBoolean.cc Wed Sep 12 17:28:00 2007
@@ -20,6 +20,7 @@
#include <ycp/y2log.h>
#include "YCPBoolean.h"
#include "Bytecode.h"
+#include "Xmlcode.h"
// YCPBooleanRep
@@ -58,6 +59,13 @@
}
+std::ostream &
+YCPBooleanRep::toXml (std::ostream & str, int indent ) const
+{
+ return str << "<const type=\"bool\" value=\"" << ( v ? "true" : "false" ) << "\"/>";
+}
+
+
YCPValueType
YCPBooleanRep::valuetype() const
{
Modified: branches/tmp/sh/mod-ui/core/libycp/src/YCPBuiltinMisc.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/YCPBuiltinMisc.cc (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/YCPBuiltinMisc.cc Wed Sep 12 17:28:00 2007
@@ -78,11 +78,11 @@
/**
* @builtin random
* @short Random number generator.
- * @description Returns random integer in the interval (0,MAX).
+ * @description Returns a random integer in the interval [0,MAX).
* <tt>srandom</tt> must be activated to get really random
* numbers.
* @param integer MAX
- * @return integer Returns integer in the interval (0,MAX).
+ * @return integer Returns integer in the interval [0,MAX).
* @usage random(100) -> 82
* @usage random(100) -> 36
*/
@@ -90,6 +90,7 @@
if (max.isNull ())
return YCPNull ();
+ // see NOTES in man 3 rand,
// <1,10> 1+(int) (10.0*rand()/(RAND_MAX+1.0));
int ret = (int) (max->value () * rand () / (RAND_MAX + 1.0));
return YCPInteger (ret);
Modified: branches/tmp/sh/mod-ui/core/libycp/src/YCPByteblock.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/YCPByteblock.cc (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/YCPByteblock.cc Wed Sep 12 17:28:00 2007
@@ -20,6 +20,7 @@
#include <ycp/y2log.h>
#include "YCPByteblock.h"
#include "Bytecode.h"
+#include "Xmlcode.h"
using std::min;
@@ -136,6 +137,12 @@
return Bytecode::writeBytep (str, bytes, len);
}
+std::ostream &
+YCPByteblockRep::toXml (std::ostream & str, int indent ) const
+{
+ return Xmlcode::writeBytep (str, bytes, len);
+}
+
// --------------------------------------------------------
Modified: branches/tmp/sh/mod-ui/core/libycp/src/YCPCode.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/YCPCode.cc (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/YCPCode.cc Wed Sep 12 17:28:00 2007
@@ -23,6 +23,7 @@
#include "ycp/y2log.h"
#include "ycp/YCPCode.h"
#include "ycp/Bytecode.h"
+#include "ycp/Xmlcode.h"
//---------------------------------------------------------------------------
// YCPCodeRep
@@ -89,6 +90,14 @@
return m_code->toStream (str);
}
+std::ostream &
+YCPCodeRep::toXml (std::ostream & str, int indent ) const
+{
+ str << "<ycpcode>";
+ m_code->toXml( str, indent );
+ return str << "</ycpcode>";
+}
+
// --------------------------------------------------------
YCPCode::YCPCode (bytecodeistream & str)
@@ -153,6 +162,12 @@
return Bytecode::writeEntry (str, m_entry);
}
+std::ostream &
+YCPEntryRep::toXml( std::ostream & str, int indent ) const
+{
+ return Xmlcode::writeEntry (str, m_entry);
+}
+
//---------------------------------------------------------------------------
@@ -210,6 +225,25 @@
return str;
}
+std::ostream &
+YCPReferenceRep::toXml( std::ostream & str, int indent ) const
+{
+ // this is not used, instead YEVariable is used for xml
+ return str;
+}
+
+
+
+std::ostream &
+YCPBreakRep::toXml( std::ostream & str, int indent ) const
+{
+ return str << "<break/>";
+}
+std::ostream &
+YCPReturnRep::toXml( std::ostream & str, int indent ) const
+{
+ return str << "<return/>";
+}
// EOF
Modified: branches/tmp/sh/mod-ui/core/libycp/src/YCPExternal.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/YCPExternal.cc (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/YCPExternal.cc Wed Sep 12 17:28:00 2007
@@ -77,6 +77,13 @@
return str;
}
+std::ostream &
+YCPExternalRep::toXml (std::ostream & str, int indent ) const
+{
+ y2error ("Trying to store an external payload in xml");
+ return str;
+}
+
// ----------------------------------------------
Modified: branches/tmp/sh/mod-ui/core/libycp/src/YCPFloat.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/YCPFloat.cc (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/YCPFloat.cc Wed Sep 12 17:28:00 2007
@@ -22,6 +22,7 @@
#include "ycp/y2log.h"
#include "ycp/YCPFloat.h"
#include "ycp/Bytecode.h"
+#include "ycp/Xmlcode.h"
// YCPFloatRep
@@ -98,6 +99,12 @@
return Bytecode::writeString (str, toString());
}
+std::ostream &
+YCPFloatRep::toXml (std::ostream & str, int indent ) const
+{
+ return str << "<const type=\"float\" value=\"" << toString() << "\"/>";
+}
+
// --------------------------------------------------------
Modified: branches/tmp/sh/mod-ui/core/libycp/src/YCPInteger.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/YCPInteger.cc (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/YCPInteger.cc Wed Sep 12 17:28:00 2007
@@ -111,6 +111,13 @@
}
+std::ostream &
+YCPIntegerRep::toXml (std::ostream & str, int indent ) const
+{
+ return str << "<const type=\"int\" value=\"" << v << "\"/>";
+}
+
+
// ----------------------------------------------
static long long fromStream (bytecodeistream & str)
Modified: branches/tmp/sh/mod-ui/core/libycp/src/YCPList.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/YCPList.cc (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/YCPList.cc Wed Sep 12 17:28:00 2007
@@ -23,6 +23,7 @@
#include "ycp/YCPList.h"
#include <algorithm>
#include "ycp/Bytecode.h"
+#include "ycp/Xmlcode.h"
#include "ycp/YCPCodeCompare.h"
#include "ycp/ExecutionEnvironment.h"
@@ -278,6 +279,20 @@
}
+std::ostream &
+YCPListRep::toXml (std::ostream & str, int indent ) const
+{
+ str << "<list size=\"" << elements.size() << "\">";
+ for (unsigned index = 0; index < elements.size(); index++)
+ {
+ str << "<element>";
+ elements[index]->toXml( str, 0 );
+ str << "</element>";
+ }
+ return str << "</list>";
+}
+
+
// --------------------------------------------------------
YCPList::YCPList(bytecodeistream & str)
Modified: branches/tmp/sh/mod-ui/core/libycp/src/YCPMap.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/YCPMap.cc (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/YCPMap.cc Wed Sep 12 17:28:00 2007
@@ -20,6 +20,7 @@
#include "ycp/y2log.h"
#include "ycp/YCPMap.h"
#include "ycp/Bytecode.h"
+#include "ycp/Xmlcode.h"
#include "ycp/ExecutionEnvironment.h"
extern ExecutionEnvironment ee;
@@ -220,6 +221,21 @@
}
+std::ostream &
+YCPMapRep::toXml (std::ostream & str, int indent ) const
+{
+ str << "<map size=\"" << stl_map.size() << "\">";
+ for(YCPMapIterator pos = begin(); pos != end(); ++pos )
+ {
+ str << "<element>";
+ str << "<key>"; pos.key()->toXml( str, 0 ); str << "</key>";
+ str << "<value>"; pos.value()->toXml( str, 0 ); str << "</value>";
+ str << "</element>";
+ }
+ return str << "</map>";
+}
+
+
// --------------------------------------------------------
YCPMap::YCPMap(bytecodeistream & str)
Modified: branches/tmp/sh/mod-ui/core/libycp/src/YCPPath.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/YCPPath.cc (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/YCPPath.cc Wed Sep 12 17:28:00 2007
@@ -20,6 +20,7 @@
#include "ycp/y2log.h"
#include "ycp/YCPPath.h"
#include "ycp/Bytecode.h"
+#include "ycp/Xmlcode.h"
#include <ctype.h>
// YCPPathRep
@@ -330,6 +331,16 @@
}
std::ostream &
+YCPPathRep::Component::toXml (std::ostream & str, int indent ) const
+{
+ str << "<component";
+ if (complex) str << " complex";
+ str << ">";
+ str << component.asString();
+ return str << "</component>";
+}
+
+std::ostream &
YCPPathRep::toStream (std::ostream & str) const
{
#if 0
@@ -347,6 +358,26 @@
#endif
}
+std::ostream &
+YCPPathRep::toXml (std::ostream & str, int indent ) const
+{
+ str << "<const type=\"path\" value=\"";
+#if 0
+ if (Xmlcode::writeInt32 (str, components.size()))
+ {
+ for (unsigned c = 0; c < components.size(); c++)
+ {
+ if (!components[c].toStream (str))
+ break;
+ }
+ }
+ return str;
+#else
+ str << Xmlcode::xmlify( toString() );
+#endif
+ return str << "\"/>";
+}
+
// --------------------------------------------------------
Modified: branches/tmp/sh/mod-ui/core/libycp/src/YCPString.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/YCPString.cc (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/YCPString.cc Wed Sep 12 17:28:00 2007
@@ -23,6 +23,7 @@
#include "ycp/y2log.h"
#include "ycp/YCPString.h"
#include "ycp/Bytecode.h"
+#include "ycp/Xmlcode.h"
// YCPStringRep
@@ -122,6 +123,13 @@
}
+std::ostream &
+YCPStringRep::toXml (std::ostream & str, int indent ) const
+{
+ return str << "<const type=\"string\" value=\"" << Xmlcode::xmlify(v) << "\"/>";
+}
+
+
// --------------------------------------------------------
static string
Modified: branches/tmp/sh/mod-ui/core/libycp/src/YCPSymbol.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/YCPSymbol.cc (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/YCPSymbol.cc Wed Sep 12 17:28:00 2007
@@ -20,6 +20,7 @@
#include "ycp/y2log.h"
#include "ycp/YCPSymbol.h"
#include "ycp/Bytecode.h"
+#include "ycp/Xmlcode.h"
// YCPSymbolRep
@@ -81,6 +82,13 @@
return Bytecode::writeUstring (str, v);
}
+std::ostream &
+YCPSymbolRep::toXml (std::ostream & str, int indent ) const
+{
+ str << "<const type=\"symbol\" value=\"" << v.asString() << "\"/>";
+ return str;
+}
+
// --------------------------------------------------------
Modified: branches/tmp/sh/mod-ui/core/libycp/src/YCPTerm.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/YCPTerm.cc (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/YCPTerm.cc Wed Sep 12 17:28:00 2007
@@ -22,6 +22,7 @@
#include "ycp/y2log.h"
#include "ycp/YCPTerm.h"
#include "ycp/Bytecode.h"
+#include "ycp/Xmlcode.h"
// YCPTermRep
YCPTermRep::YCPTermRep(const string& s)
@@ -163,6 +164,14 @@
return l->toStream (str);
}
+std::ostream &
+YCPTermRep::toXml (std::ostream & str, int indent ) const
+{
+ str << "<const type=\"term\" name=\"" << s << "\">";
+ l->toXml( str, indent );
+ return str << "</const>";
+}
+
// --------------------------------------------------------
Modified: branches/tmp/sh/mod-ui/core/libycp/src/YCPVoid.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/YCPVoid.cc (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/YCPVoid.cc Wed Sep 12 17:28:00 2007
@@ -58,6 +58,12 @@
return str;
}
+std::ostream &
+YCPVoidRep::toXml (std::ostream & str, int indent ) const
+{
+ return str << "<const type=\"void\"/>";
+}
+
// --------------------------------------------------------
Modified: branches/tmp/sh/mod-ui/core/libycp/src/YCode.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/YCode.cc (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/YCode.cc Wed Sep 12 17:28:00 2007
@@ -40,6 +40,7 @@
#include "ycp/YBlock.h"
#include "ycp/Bytecode.h"
+#include "ycp/Xmlcode.h"
#include "ycp/y2log.h"
#include "ycp/ExecutionEnvironment.h"
@@ -102,7 +103,7 @@
string
YCode::toString (ykind kind)
{
- static char *names[] = {
+ static const char *names[] = {
"yxError",
// [1] Constants (-> YCPValue, except(!) locale -> yeLocale)
"ycVoid", "ycBoolean", "ycInteger", "ycFloat", // constants
@@ -196,6 +197,17 @@
}
+std::ostream &
+YCode::toXml (std::ostream & str, int indent ) const
+{
+ ykind k = kind ();
+#if DO_DEBUG
+ y2debug ("YCode::toStream (%d:%s)", (int)k, YCode::toString (k).c_str());
+#endif
+ return str << "<ycode code=" << k << "/>";
+}
+
+
YCPValue
YCode::evaluate (bool /*cse*/)
{
@@ -390,6 +402,18 @@
return m_value->toStream (str);
}
+std::ostream &
+YConst::toXml (std::ostream & str, int indent ) const
+{
+ if (m_kind == ycConstant) {
+ y2error ("Internal error, a constant not supposed to be written to xml");
+ }
+ if (m_value.isNull())
+ return str << "<null/>";
+ m_value->toXml (str, 0 );
+ return str;
+}
+
constTypePtr
YConst::type () const
@@ -483,6 +507,14 @@
return Bytecode::writeCharp (str, m_domain->first);
}
+// see also YELocale::toXml
+std::ostream &
+YLocale::toXml (std::ostream & str, int indent ) const
+{
+ str << "<locale domain=\"" << m_domain->first << "\" text=\"" << Xmlcode::xmlify( m_locale ) << "\"/>";
+ return str;
+}
+
string
YLocale::toString() const
{
@@ -732,6 +764,14 @@
}
+std::ostream &
+YFunction::toXmlDefinition (std::ostream & str, int indent ) const
+{
+ // see toXml(...)
+ return str;
+}
+
+
// writing a function to a stream is done in two (well, in fact three) parts
// 1. the SymbolEntry (done when writing the block this function is defined in)
// 2. the declaration block
@@ -762,6 +802,31 @@
}
+std::ostream &
+YFunction::toXml (std::ostream & str, int indent ) const
+{
+ bool need_declaration = ((m_declaration != 0) && (m_declaration->symbolCount() > 0));
+ bool need_definition = (m_definition != 0);
+
+ if (need_declaration || need_definition) {
+ if (need_declaration)
+ {
+ Xmlcode::pushNamespace (m_declaration->nameSpace()); // keep the declaration accessible during definition write
+ str << Xmlcode::spaces( indent+2 ) << "<declaration>\n";
+ m_declaration->toXml (str, indent+4 );
+ str << Xmlcode::spaces( indent+2 ) << "</declaration>\n";
+ }
+ m_definition->toXml (str, indent+2 );
+ if (need_declaration)
+ {
+ Xmlcode::popNamespace (m_declaration->nameSpace());
+ }
+ }
+
+ return str;
+}
+
+
constTypePtr
YFunction::type () const
{
Modified: branches/tmp/sh/mod-ui/core/libycp/src/YExpression.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/YExpression.cc (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/YExpression.cc Wed Sep 12 17:28:00 2007
@@ -37,6 +37,7 @@
#include "ycp/SymbolTable.h"
#include "ycp/Bytecode.h"
+#include "ycp/Xmlcode.h"
#ifndef DO_DEBUG
#define DO_DEBUG 0
@@ -143,6 +144,14 @@
return str;
}
+std::ostream &
+YEVariable::toXml( std::ostream & str, int indent ) const
+{
+ str << "<variable name=\"";
+ str << m_entry->toString (false /*definition*/);
+ return str << "\"/>";
+}
+
// ------------------------------------------------------------------
// reference (-> SymbolEntry)
@@ -207,6 +216,15 @@
}
+std::ostream &
+YEReference::toXml (std::ostream & str, int indent ) const
+{
+ str << "<yereference>";
+ Xmlcode::writeEntry (str, m_entry);
+ return str << "</yereference>";
+}
+
+
constTypePtr
YEReference::type () const
{
@@ -369,6 +387,22 @@
return Bytecode::writeYCodelist (str, m_parameters);
}
+std::ostream &
+YETerm::toXml (std::ostream & str, int indent ) const
+{
+ u_int32_t count = 0;
+ const ycodelist_t *codep = m_parameters;
+
+ while( codep )
+ {
+ count++;
+ codep = codep->next;
+ }
+ str << "<yeterm name=\"" << m_name << "\" args=\"" << count << "\">";
+ Xmlcode::writeYCodelist (str, m_parameters);
+ return str << "</yeterm>";
+}
+
// ------------------------------------------------------------------
@@ -398,23 +432,31 @@
{
}
-
-string
-YECompare::toString () const
+static string
+compare_op_string( YECompare::c_op op )
{
- string s = "(" + m_left->toString();
- switch (m_op)
+ switch (op)
{
- case C_EQ: s += " == "; break;
- case C_NEQ: s += " != "; break;
- case C_LT: s += " < "; break;
- case C_GE: s += " >= "; break;
- case C_LE: s += " <= "; break;
- case C_GT: s += " > "; break;
+ case YECompare::C_EQ: return "=="; break;
+ case YECompare::C_NEQ: return "!="; break;
+ case YECompare::C_LT: return "<"; break;
+ case YECompare::C_GE: return ">="; break;
+ case YECompare::C_LE: return "<="; break;
+ case YECompare::C_GT: return ">"; break;
default:
- s += " ?compare? ";
break;
}
+ return "?compare?";
+}
+
+
+string
+YECompare::toString () const
+{
+ string s = "(" + m_left->toString();
+ s += " ";
+ s += compare_op_string( m_op );
+ s += " ";
s += m_right->toString();
return s + ")";
}
@@ -490,6 +532,16 @@
}
+std::ostream &
+YECompare::toXml (std::ostream & str, int indent ) const
+{
+ str << "<compare op=\"" << Xmlcode::xmlify( compare_op_string( m_op ) ) << "\">";
+ str << "<lhs>"; m_left->toXml( str, 0 ); str << "</lhs>";
+ str << "<rhs>"; m_right->toXml( str, 0 ); str << "</rhs>";
+ return str << "</compare>";
+}
+
+
// ------------------------------------------------------------------
// locale expression (-> singular, plural, count)
@@ -592,6 +644,18 @@
}
+// see also YLocale::toXml
+std::ostream &
+YELocale::toXml (std::ostream & str, int indent ) const
+{
+ str << "<locale domain=\"" << m_domain->first << "\" text=\"" << Xmlcode::xmlify( m_singular )
+ << "\" plural=\"" << Xmlcode::xmlify( m_plural ) << "\">";
+ m_count->toXml( str, 0 );
+ str << "</locale>";
+ return str;
+}
+
+
// ------------------------------------------------------------------
// list expression (-> value, next list value)
@@ -725,6 +789,23 @@
}
+std::ostream &
+YEList::toXml (std::ostream & str, int indent ) const
+{
+ u_int32_t count = 0;
+ const ycodelist_t *codep = m_first;
+
+ while( codep )
+ {
+ count++;
+ codep = codep->next;
+ }
+ str << "<list size=\"" << count << "\">";
+ Xmlcode::writeYCodelist( str, m_first );
+ return str << "</list>";
+}
+
+
constTypePtr
YEList::type () const
{
@@ -883,6 +964,31 @@
}
+std::ostream &
+YEMap::toXml( std::ostream & str, int indent ) const
+{
+ mapval_t *mapp = m_first;
+ u_int32_t count = 0;
+ while( mapp )
+ {
+ count++;
+ mapp = mapp->next;
+ }
+ str << "<map size=\"" << count << "\">";
+
+ mapp = m_first;
+ while (mapp)
+ {
+ str << "<element>";
+ str << "<key>"; mapp->key->toXml( str, 0 ); str << "</key>";
+ str << "<value>"; mapp->value->toXml( str, 0 ); str << "</value>";
+ str << "</element>";
+ mapp = mapp->next;
+ }
+ return str << "</map>";
+}
+
+
constTypePtr
YEMap::type () const
{
@@ -1090,6 +1196,15 @@
return m_value->toStream (str);
}
+std::ostream &
+YEPropagate::toXml (std::ostream & str, int indent ) const
+{
+ str << "<yepropagate from=\"" << Xmlcode::xmlify( m_from->toString() ) << "\" to=\"" << Xmlcode::xmlify( m_to->toString() ) << "\">";
+ m_value->toXml( str, 0 );
+ return str << "</yepropagate>";
+}
+
+
// ------------------------------------------------------------------
// unary expression (-> declaration_t, arg)
@@ -1181,6 +1296,18 @@
}
+std::ostream &
+YEUnary::toXml (std::ostream & str, int indent ) const
+{
+ str << "<yeunary";
+ extern StaticDeclaration static_declarations;
+ static_declarations.writeXmlDeclaration( str, m_decl );
+ str << ">";
+ m_arg->toXml( str, 0 );
+ return str << "</yeunary>";
+}
+
+
// ------------------------------------------------------------------
// binary expression (-> declaration_t, arg1, arg2)
@@ -1284,6 +1411,19 @@
}
+std::ostream &
+YEBinary::toXml (std::ostream & str, int indent ) const
+{
+ str << "<yebinary";
+ extern StaticDeclaration static_declarations;
+ static_declarations.writeXmlDeclaration (str, m_decl);
+ str << ">";
+ m_arg1->toXml( str, 0 );
+ m_arg2->toXml( str, 0 );
+ return str << "</yebinary>";
+}
+
+
constTypePtr
YEBinary::type () const
{
@@ -1390,6 +1530,17 @@
}
+std::ostream &
+YETriple::toXml (std::ostream & str, int indent ) const
+{
+ str << "<yetriple>";
+ str << "<cond>"; m_expr->toXml( str, 0); str << "</cond>";
+ str << "<true>"; m_true->toXml( str, 0 ); str << "</true>";
+ str << "<false>"; m_false->toXml( str, 0); str << "</false>";
+ return str << "</yetriple>";
+}
+
+
// ------------------------------------------------------------------
// is (expression, type)
@@ -1484,6 +1635,15 @@
}
+std::ostream &
+YEIs::toXml (std::ostream & str, int indent ) const
+{
+ str << "<yeis "; m_type->toXml( str, 0); str << ">";
+ str << "<expr>"; m_expr->toXml( str, 0); str << "</expr>";
+ return str << "</yeis>";
+}
+
+
// ------------------------------------------------------------------
// Return (expression)
@@ -1530,6 +1690,14 @@
return m_expr->toStream (str);
}
+std::ostream &
+YEReturn::toXml (std::ostream & str, int indent ) const
+{
+ str << "<yereturn>";
+ m_expr->toXml( str, 0 );
+ return str << "</yereturn>";
+}
+
// ------------------------------------------------------------------
// bracket expression: identifier [ arg, arg, ...] : default
@@ -1693,6 +1861,19 @@
}
+std::ostream &
+YEBracket::toXml (std::ostream & str, int indent ) const
+{
+ str << "<yebracket ";
+ m_resultType->toXml( str, 0);
+ str << ">";
+ m_var->toXml( str, 0 ); // variable
+ m_arg->toXml( str, 0 ); // list
+ m_def->toXml( str, 0 ); // default
+ return str << "</yebracket>";
+}
+
+
// ------------------------------------------------------------------
// builtin function ref (-> declaration_t, type, parameters)
@@ -1727,12 +1908,6 @@
{
Bytecode::popNamespace (m_parameterblock->nameSpace());
}
- if (!m_decl
- || m_type->isError ())
- {
- ycp2error ("Can't find builtin '%s'", m_decl ? StaticDeclaration::Decl2String (m_decl, true).c_str() : m_type->toString().c_str());
- str.setstate (ios::failbit);
- }
// throw away type info
m_type = Type::Void;
}
@@ -1765,6 +1940,80 @@
}
+std::ostream &
+YEBuiltin::toXml( std::ostream & str, int indent ) const
+{
+ str << "<builtin name=\"" << m_decl->name << "\"";
+
+ if (m_parameterblock != 0)
+ {
+ Xmlcode::pushNamespace( m_parameterblock->nameSpace() );
+ }
+
+ // check DECL_SYMBOL functions, these are e.g.
+ // list: find, filter, maplist, listmap, sort, foreach
+ // map: mapmap, maplist, filter, foreach
+
+ ycodelist_t *block = NULL;
+ ycodelist_t *value = NULL;
+ ycodelist_t *p = m_parameters;
+ u_int32_t count = 0;
+ while (p) {
+
+ if (m_decl->flags & DECL_SYMBOL)
+ {
+ // we have three types of parameters
+ // 1. symbols (used to assign values for the block)
+ // - symbols always come first
+ // 2. expression (must eval to a enumerable type, list or map
+ // the builtin operates on and assigns values by iterating over the value)
+ // 3. block to call with symbols assigned
+ // - the block always is last
+ //
+ // find symbols (entries into m_parameterblock) first
+ //
+
+ if (p->code->kind() == ycEntry) {
+ str << " sym" << count << "=\"" << Xmlcode::xmlify( p->code->toString() ) << "\"";
+ }
+ else if (p->next) {
+ if (value) cerr << "Value already set!" << endl;
+ value = p;
+ }
+ else {
+ if (block) cerr << "Block already set!" << endl;
+ block = p;
+ }
+ }
+ p = p->next;
+ ++count;
+ }
+
+ if ((m_decl->flags & DECL_SYMBOL) == 0)
+ {
+ str << " args=\"" << count << "\"";
+ }
+ str << ">";
+
+ if (m_decl->flags & DECL_SYMBOL)
+ {
+ str << "<expr>";
+ value->code->toXml( str, indent+2 );
+ str << "</expr>";
+ block->code->toXml( str, indent );
+ }
+ else {
+ Xmlcode::writeYCodelist( str, m_parameters );
+ }
+
+ if (m_parameterblock != 0)
+ {
+ Xmlcode::popNamespace( m_parameterblock->nameSpace() );
+ }
+ return str << "</builtin>";
+}
+
+
YEBuiltin::~YEBuiltin ()
{
ycodelist_t *parm = m_parameters;
@@ -2739,6 +2988,27 @@
}
+std::ostream &
+YECall::toXml (std::ostream & str, int indent ) const
+{
+ str << "<call";
+ if (!m_sentry->nameSpace()->name().empty()) {
+ str << " ns=\"" << m_sentry->nameSpace()->name() << "\"";
+ }
+ str << " name=\"" << m_sentry->name() << "\">";
+ if (m_next_param_id > 0) {
+ str << "<args>";
+
+ for (uint i = 0 ; i < m_next_param_id; i++)
+ {
+ m_parameters[i]->toXml( str, 0 );
+ }
+ str << "</args>";
+ }
+ return str << "</call>";
+}
+
+
constTypePtr
YECall::type () const
{
Modified: branches/tmp/sh/mod-ui/core/libycp/src/YStatement.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/YStatement.cc (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/YStatement.cc Wed Sep 12 17:28:00 2007
@@ -31,6 +31,7 @@
#include "ycp/YBlock.h"
#include "ycp/Bytecode.h"
+#include "ycp/Xmlcode.h"
#include "ycp/y2log.h"
#include "ycp/ExecutionEnvironment.h"
@@ -114,6 +115,12 @@
return Bytecode::writeInt32 (str, m_line);
}
+std::ostream &
+YStatement::toXml( std::ostream & str, int indent ) const
+{
+ return str << "<statement line=" << m_line << "/>";
+}
+
// ------------------------------------------------------------------
// "break"
@@ -152,6 +159,12 @@
return YStatement::toStream (str);
}
+std::ostream &
+YSBreak::toXml (std::ostream & str, int indent ) const
+{
+ return str << "<break/>";
+}
+
// ------------------------------------------------------------------
// "continue"
@@ -190,6 +203,12 @@
return YStatement::toStream (str);
}
+std::ostream &
+YSContinue::toXml (std::ostream & str, int indent ) const
+{
+ return str << "<continue/>";
+}
+
// ------------------------------------------------------------------
// expression as statement
@@ -232,6 +251,15 @@
}
+std::ostream &
+YSExpression::toXml( std::ostream & str, int indent ) const
+{
+ str << "<expr>";
+ m_expr->toXml( str, indent );
+ return str << "</expr>";
+}
+
+
YCPValue
YSExpression::evaluate (bool cse)
{
@@ -282,6 +310,13 @@
}
+std::ostream &
+YSBlock::toXml (std::ostream & str, int indent ) const
+{
+ return m_block->toXml( str, indent );
+}
+
+
YCPValue
YSBlock::evaluate (bool cse)
{
@@ -379,6 +414,16 @@
}
+std::ostream &
+YSReturn::toXml (std::ostream & str, int indent ) const
+{
+ str << Xmlcode::spaces( indent ) << "<return>";
+ if (m_value != 0)
+ m_value->toXml( str, 0 );
+ return str << "</return>";
+}
+
+
YCPValue
YSReturn::evaluate (bool cse)
{
@@ -478,6 +523,17 @@
}
+std::ostream &
+YSFunction::toXml( std::ostream & str, int indent ) const
+{
+ str << "<fun_def name=\"" << m_entry->name() << "\">\n";
+
+ function()->toXml( str, indent+2 );
+
+ return str << Xmlcode::spaces( indent ) << "</fun_def>";
+}
+
+
// ------------------------------------------------------------------
// typedef (-> type string)
@@ -514,6 +570,15 @@
}
+std::ostream &
+YSTypedef::toXml( std::ostream & str, int indent ) const
+{
+ str << "<typedef name=\"" << m_name << "\"";
+ m_type->toXml( str, 0 );
+ return str << "/>";
+}
+
+
// FIXME: needed ?
YCPValue
@@ -569,6 +634,15 @@
}
+std::ostream &
+YSAssign::toXml( std::ostream & str, int indent ) const
+{
+ str << "<assign name=\"" << m_entry->toString (false /*definition*/) << "\">";
+ m_code->toXml( str, 0 );
+ return str << "</assign>";
+}
+
+
YCPValue
YSAssign::evaluate (bool cse)
{
@@ -668,6 +742,20 @@
}
+std::ostream &
+YSBracket::toXml( std::ostream & str, int indent ) const
+{
+ str << "<bracket>";
+ str << "<lhs>";
+ Xmlcode::writeEntry( str, m_entry );
+ str << "<arg>"; m_arg->toXml( str, 0 ); str << "</arg>";
+ str << "</lhs><rhs>";
+ m_code->toXml( str, 0 );
+ str << "</rhs>";
+ return str << "</bracket>";
+}
+
+
// commit bracket assign recursively
YCPValue
@@ -918,6 +1006,31 @@
}
+std::ostream &
+YSIf::toXml (std::ostream & str, int indent ) const
+{
+ str << "<if>";
+
+ m_condition->toXml( str, 0 );
+
+ if (m_true)
+ {
+ str << endl << Xmlcode::spaces( indent+2 ) << "<then>\n";
+ m_true->toXml( str, indent+4 );
+ str << endl << Xmlcode::spaces( indent+2 ) << "</then>\n";
+ str << Xmlcode::spaces( indent );
+ }
+ if (m_false)
+ {
+ str << endl << Xmlcode::spaces( indent+2 ) << "<else>\n";
+ m_false->toXml( str, indent+4 );
+ str << endl << Xmlcode::spaces( indent+2 ) << "</else>\n";
+ str << Xmlcode::spaces( indent );
+ }
+ return str << "</if>";
+}
+
+
YCPValue
YSIf::evaluate (bool cse)
{
@@ -1019,6 +1132,20 @@
}
+std::ostream &
+YSWhile::toXml (std::ostream & str, int indent ) const
+{
+ str << "<while>\n";
+ str << Xmlcode::spaces( indent+2 ) << "<cond>"; m_condition->toXml(str, 0 ); str << "</cond>\n";
+ if (m_loop) {
+ str << Xmlcode::spaces( indent+2 ) << "<do>";
+ m_loop->toXml(str, indent );
+ str << Xmlcode::spaces( indent+2 ) << "</do>\n";
+ }
+ return str << Xmlcode::spaces( indent ) << "</while>";
+}
+
+
YCPValue
YSWhile::evaluate (bool cse)
{
@@ -1150,6 +1277,23 @@
}
+std::ostream &
+YSRepeat::toXml (std::ostream & str, int indent ) const
+{
+ str << "<repeat>\n";
+ if (m_loop != 0)
+ {
+ str << Xmlcode::spaces( indent+2 ) << "<do>\n";
+ m_loop->toXml( str, indent+4 );
+ str << Xmlcode::spaces( indent+2 ) << "</do>\n";
+ }
+ str << Xmlcode::spaces( indent+2 ) << "<until>";
+ m_condition->toXml( str, 0 );
+ str << "</until>\n";
+ return str << Xmlcode::spaces( indent ) << "</repeat>";
+}
+
+
string
YSRepeat::toString () const
{
@@ -1290,6 +1434,21 @@
}
+std::ostream &
+YSDo::toXml( std::ostream & str, int indent ) const
+{
+ str << "<do>";
+ if (m_loop != 0)
+ {
+ m_loop->toXml( str, indent );
+ }
+ str << "<while>";
+ m_condition->toXml( str, indent );
+ str << "</while>";
+ return str << "</do>";
+}
+
+
YCPValue
YSDo::evaluate (bool cse)
{
@@ -1393,6 +1552,13 @@
}
+std::ostream &
+YSTextdomain::toXml (std::ostream & str, int indent ) const
+{
+ return str << "<textdomain name=\"" << m_domain.asString() << "\"/>";
+}
+
+
YCPValue
YSTextdomain::evaluate (bool /*cse*/)
{
@@ -1449,6 +1615,15 @@
}
+std::ostream &
+YSInclude::toXml( std::ostream & str, int indent ) const
+{
+ str << "<include";
+ if (m_skipped) str << " skipped=\"1\"";
+ return str << " name=\"" << m_filename.asString() << "\"/>";
+}
+
+
YCPValue
YSInclude::evaluate (bool cse)
{
@@ -1521,9 +1696,9 @@
if (nameSpace() == 0)
{
- ycp2error ("Import '%s' failed\n", name().c_str());
- ycp2error ("No namespace\n");
- return;
+ ycp2error ("Import '%s' failed...\n", name().c_str());
+ ycp2error ("Could not create its namespace\n");
+ throw Bytecode::Invalid();
}
// now load symbols we need from the just imported namespace
@@ -1598,6 +1773,14 @@
}
+std::ostream &
+YSImport::toXml( std::ostream & str, int indent ) const
+{
+ Xmlcode::pushNamespace (nameSpace()); // see YBlock::toXml(str) for popUptoNamespace()
+ return str << "<import name=\"" << m_name.asString() << "\"/>";
+}
+
+
YCPValue
YSImport::evaluate (bool cse)
{
@@ -1654,6 +1837,13 @@
}
+std::ostream &
+YSFilename::toXml(std::ostream & str, int indent ) const
+{
+ return str << "<filename name=\"" << m_filename.asString() << "\"/>";
+}
+
+
YCPValue
YSFilename::evaluate (bool cse)
{
@@ -1750,6 +1940,20 @@
}
+std::ostream &
+YSSwitch::toXml( std::ostream & str, int indent ) const
+{
+ str << "<switch>";
+
+ str << "<cond>";
+ m_condition->toXml( str, 0 );
+ str << "</cond>\n";
+
+ m_block->toXmlSwitch( m_cases, m_defaultcase, str, indent+2 );
+ return str << endl << Xmlcode::spaces( indent ) << "</switch>";
+}
+
+
YCPValue
YSSwitch::evaluate (bool cse)
{
Modified: branches/tmp/sh/mod-ui/core/libycp/src/YSymbolEntry.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/YSymbolEntry.cc (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/YSymbolEntry.cc Wed Sep 12 17:28:00 2007
@@ -32,6 +32,7 @@
#include "ycp/SymbolTable.h"
#include "ycp/StaticDeclaration.h"
#include "ycp/Bytecode.h"
+#include "ycp/Xmlcode.h"
IMPL_DERIVED_POINTER(YSymbolEntry, SymbolEntry);
@@ -261,6 +262,18 @@
}
+std::ostream &
+YSymbolEntry::toXml (std::ostream & str, int indent ) const
+{
+ str << Xmlcode::spaces( indent ) << "<symbol";
+ if (m_global) str << " global=\"1\"";
+ str << " category=\"" << catString(); str << "\"";
+ str << " type=\""; str << m_type->toXmlString(); str << "\"";
+ str << " name=\""; str << m_name.asString(); str << "\"/>";
+ // value is never written
+}
+
+
void
YSymbolEntry::setDeclaration (declaration_t *decl)
{
Modified: branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/Bytecode.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/Bytecode.h (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/Bytecode.h Wed Sep 12 17:28:00 2007
@@ -67,7 +67,12 @@
static map<string, YBlockPtr>* m_bytecodeCache;
public:
- /** Thrown instead of unsetting YCode::valid */
+ /** Thrown when it does not make sense to parse more bytecode.
+ * Formerly we used to unset YCode::valid instead.
+ * Any function taking bytecodeistream as a parameter may throw this.
+ * It is recommended to catch them in the same function where the stream
+ * is constructed (Bytecode::readFile).
+ */
class Invalid {};
// bool I/O
Modified: branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/Makefile.am (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/Makefile.am Wed Sep 12 17:28:00 2007
@@ -8,6 +8,7 @@
pkginclude_HEADERS = \
\
+ Xmlcode.h \
YCPBoolean.h YCPByteblock.h \
YCPElement.h YCPFloat.h \
YCPInteger.h YCPList.h \
Modified: branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/Point.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/Point.h (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/Point.h Wed Sep 12 17:28:00 2007
@@ -79,5 +79,6 @@
std::string toString (void) const;
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
};
#endif // Point_h
Modified: branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/StaticDeclaration.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/StaticDeclaration.h (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/StaticDeclaration.h Wed Sep 12 17:28:00 2007
@@ -108,6 +108,7 @@
// write declaration to stream (name and type)
std::ostream & writeDeclaration (std::ostream & str, const declaration_t *decl) const;
+ std::ostream & writeXmlDeclaration (std::ostream & str, const declaration_t *decl) const;
// read declaration from stream (return declaration matching name and type _exactly_)
declaration_t *readDeclaration (bytecodeistream & str) const;
Modified: branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/SymbolTable.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/SymbolTable.h (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/SymbolTable.h Wed Sep 12 17:28:00 2007
@@ -90,6 +90,7 @@
string toStringSymbols () const;
void makeDefinition (int line); // convert declaration to definition (exchanges m_point)
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
// remove yourself from the SymbolTable.
void remove ();
@@ -195,6 +196,7 @@
// write usage to stream, see YSImport
std::ostream &writeUsage (std::ostream & str) const;
+ std::ostream &writeXmlUsage( std::ostream & str, int indent ) const;
//---------------------------------------------------------------
// string
Modified: branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/Type.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/Type.h (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/Type.h Wed Sep 12 17:28:00 2007
@@ -30,6 +30,7 @@
class FunctionType;
class bytecodeistream;
+class xmlcodeistream;
/// YCP type
class Type : public Rep
@@ -182,12 +183,18 @@
* Converts a type code to its YCP notation.
*/
virtual string toString () const;
+ virtual string toXmlString () const;
/**
- * write out to stream
+ * write bytecode out to stream
*/
virtual std::ostream & toStream (std::ostream & str) const;
+ /**
+ * write xml out to stream
+ */
+ virtual std::ostream & toXml (std::ostream & str, int indent ) const;
+
/*
* is base or constructed type
*/
Added: branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/Xmlcode.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/Xmlcode.h (added)
+++ branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/Xmlcode.h Wed Sep 12 17:28:00 2007
@@ -0,0 +1,139 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: Xmlcode.h
+
+ Primitive xmlcode I/O functions.
+ Acts as a namespace wrapper.
+
+ Author: Klaus Kaempf <kkaempf(a)suse.de>
+ Maintainer: Klaus Kaempf <kkaempf(a)suse.de>
+
+/-*/
+// -*- c++ -*-
+
+#ifndef Xmlcode_h
+#define Xmlcode_h
+
+#include "ycp/YCPValue.h"
+#include "ycp/YCode.h"
+#include "ycp/YStatement.h"
+#include "ycp/YBlock.h"
+#include "ycp/Type.h"
+
+class Y2Namespace;
+
+#include <iosfwd>
+#include <string>
+#include <map>
+
+#include <fstream>
+
+/// An istream that remembers some data about the xmlcode.
+class xmlcodeistream : public std::ifstream
+{
+ int m_major, m_minor, m_release;
+ public:
+ xmlcodeistream (string filename);
+ bool isVersion (int major, int minor, int revision);
+ bool isVersionAtMost (int major, int minor, int revision);
+
+ int major () const { return m_major; }
+ int minor () const { return m_minor; }
+ int release () const { return m_release; }
+};
+
+/// *.ybc I/O
+class Xmlcode {
+ static int m_namespace_nesting_level;
+ static int m_namespace_nesting_array_size;
+ static int m_namespace_tare_level;
+
+ /// references to namespaces
+ struct namespaceentry_t {
+ const Y2Namespace *name_space;
+ bool with_xrefs; ///< external references... ???
+ };
+ static namespaceentry_t *m_namespace_nesting_array;
+ static map<string, YBlockPtr>* m_xmlcodeCache;
+
+ public:
+ /** Thrown instead of unsetting YCode::valid */
+ class Invalid {};
+
+ static string spaces( int count );
+
+ static string xmlify( const string & s );
+
+ // bytepointer I/O
+ static std::ostream & writeBytep (std::ostream & streamref, const unsigned char * bytep, unsigned int len);
+ static unsigned char * readBytep (xmlcodeistream & streamref);
+
+ // Type I/O
+ static std::ostream & writeType (std::ostream & str, constTypePtr type);
+ static TypePtr readType (xmlcodeistream & str);
+
+ // ycodelist_t * I/O
+ static std::ostream & writeYCodelist (std::ostream & str, const ycodelist_t *codelist);
+ static bool readYCodelist (xmlcodeistream & str, ycodelist_t **anchor);
+
+ //-----------------------------------------------------------
+ // block nesting handling
+ //
+ static void namespaceInit ();
+ // retrieve ID (nesting level) for namespace
+ static int namespaceId (const Y2Namespace *name_space);
+ // retrieve namespace for ID
+ static const Y2Namespace *namespacePtr (int namespace_id);
+
+ // push given namespace to id stack, return new id, -1 on error
+ static int pushNamespace (const Y2Namespace *name_space, bool with_xrefs = false);
+
+ // pop given namespace from id stack, return namespace id, -1 on error
+ static int popNamespace (const Y2Namespace *name_space);
+
+ // pop all from id stack until given namespace is reached and popped too
+ static void popUptoNamespace (const Y2Namespace *name_space);
+
+ // reset current namespace stack to 'empty' for module loading
+ // returns a tare id needed later
+ static int tareStack ();
+ static void untareStack (int tare_id);
+
+ //-----------------------------------------------------------
+ // SymbolEntry pointer (!) handling
+ // the SymbolEntries itself are 'owned' by Y2Namespace (YBlock in YCP) and referenced via pointers
+ // to SymbolEntry. These functions handle stream I/O for SymbolEntry pointers.
+ static std::ostream &writeEntry (std::ostream & str, const SymbolEntryPtr entry);
+ static SymbolEntryPtr readEntry (xmlcodeistream & str);
+
+ //-----------------------------------------------------------
+ // YCode read.
+ // Must be implemented outside of YCode since we have derived classes to allocate...
+ // see YCode for write
+ static YCodePtr readCode (xmlcodeistream & str);
+
+ // File I/O
+ // reading and writing complete files is done via separate functions
+ // which add/check a 'magic value' header denoting "YCode" and its version.
+
+ // read YCode from file in Module path, return YBlock (NULL in case of error)
+ static YBlockPtr readModule (const string & mname);
+
+ // read YCode from file, return YCode (YError in case of failure)
+ static YCodePtr readFile (const string & filename);
+
+ // write YCode to file, return true on success (check errno for errors)
+ static bool writeFile (const YCodePtr code, const string & filename);
+};
+
+#endif // Xmlcode_h
Modified: branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YBlock.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YBlock.h (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YBlock.h Wed Sep 12 17:28:00 2007
@@ -281,6 +281,8 @@
// write block to stream
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml( std::ostream & str, int indent ) const;
+ std::ostream & toXmlSwitch( map<YCPValue, int, ycpless> cases, int defaultcase, std::ostream & str, int indent ) const;
};
Modified: branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPBoolean.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPBoolean.h (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPBoolean.h Wed Sep 12 17:28:00 2007
@@ -76,6 +76,7 @@
* Output value as bytecode to stream
*/
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
/**
* Returns YT_BOOLEAN. See @ref YCPValueRep#valuetype.
Modified: branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPByteblock.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPByteblock.h (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPByteblock.h Wed Sep 12 17:28:00 2007
@@ -85,6 +85,7 @@
* Output value as bytecode to stream
*/
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
/**
* Compares two bytes blocks.
Modified: branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPCode.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPCode.h (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPCode.h Wed Sep 12 17:28:00 2007
@@ -73,6 +73,7 @@
* Output value as bytecode to stream
*/
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
/**
* Returns YT_CODE. See @ref YCPValueRep#type.
@@ -146,6 +147,7 @@
* Output value as bytecode to stream
*/
std::ostream & toStream (std::ostream & str) const { return str; };
+ std::ostream & toXml (std::ostream & str, int indent ) const;
/**
* Returns YT_BREAK. See @ref YCPValueRep#type.
@@ -213,6 +215,7 @@
* Output value as bytecode to stream
*/
std::ostream & toStream (std::ostream & str) const { return str; };
+ std::ostream & toXml (std::ostream & str, int indent ) const;
/**
* Returns YT_BREAK. See @ref YCPValueRep#type.
@@ -279,6 +282,7 @@
* Output value as bytecode to stream
*/
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
/**
* Returns YT_ENTRY. See @ref YCPValueRep#type.
@@ -350,6 +354,7 @@
* Output value as bytecode to stream
*/
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
/**
* Returns YT_Reference. See @ref YCPValueRep#type.
Modified: branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPElement.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPElement.h (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPElement.h Wed Sep 12 17:28:00 2007
@@ -115,6 +115,9 @@
std::ostream & toStream (std::ostream & str ) const { \
return element->toStream (str); \
} \
+ std::ostream & toXml (std::ostream & str, int indent ) const { \
+ return element->toXml( str, indent ); \
+ } \
YCPValueType valuetype () const { return (static_cast<const YCP##name##Rep*>(element))->valuetype (); }
@@ -274,6 +277,7 @@
* Writes the value to a stream in bytecode format.
*/
virtual std::ostream & toStream (std::ostream & str) const = 0;
+ virtual std::ostream & toXml (std::ostream & str, int indent ) const = 0;
/**
* Returns a shallow copy of this elementRep. Redefine this method
Modified: branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPExternal.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPExternal.h (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPExternal.h Wed Sep 12 17:28:00 2007
@@ -73,6 +73,7 @@
* store the data in persistent stream.
*/
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
/**
* Returns YT_EXTERNAL. See @ref YCPValueRep#valuetype.
Modified: branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPFloat.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPFloat.h (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPFloat.h Wed Sep 12 17:28:00 2007
@@ -84,6 +84,7 @@
* Output value as bytecode to stream
*/
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
/**
* Returns YT_FLOAT. See @ref YCPValueRep#type.
Modified: branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPInteger.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPInteger.h (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPInteger.h Wed Sep 12 17:28:00 2007
@@ -74,6 +74,7 @@
* Output value as bytecode to stream
*/
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
/**
* Returns YT_INTEGER. See @ref YCPValueRep#type.
Modified: branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPList.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPList.h (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPList.h Wed Sep 12 17:28:00 2007
@@ -171,6 +171,7 @@
* Output value as bytecode to stream
*/
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
/**
* Returns YT_LIST. See @ref YCPValueRep#type.
Modified: branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPMap.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPMap.h (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPMap.h Wed Sep 12 17:28:00 2007
@@ -129,6 +129,7 @@
* Output value as bytecode to stream
*/
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
/**
* Returns YT_MAP. See @ref YCPValueRep#valuetype.
Modified: branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPPath.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPPath.h (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPPath.h Wed Sep 12 17:28:00 2007
@@ -51,6 +51,7 @@
}
string toString() const;
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
};
vector<Component> components;
@@ -149,6 +150,7 @@
* Output value as bytecode to stream
*/
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
/**
* Returns YT_PATH. See @ref YCPValueRep#valuetype.
Modified: branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPString.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPString.h (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPString.h Wed Sep 12 17:28:00 2007
@@ -86,6 +86,7 @@
* Output value as bytecode to stream
*/
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
/**
* Returns YT_STRING. See @ref YCPValueRep#valuetype.
Modified: branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPSymbol.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPSymbol.h (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPSymbol.h Wed Sep 12 17:28:00 2007
@@ -84,6 +84,7 @@
* Output value as bytecode to stream
*/
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
/**
* Returns YT_SYMBOL. See @ref YCPValueRep#valuetype.
Modified: branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPTerm.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPTerm.h (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPTerm.h Wed Sep 12 17:28:00 2007
@@ -127,6 +127,7 @@
* Output value as bytecode to stream
*/
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
/**
* Mapping for the term's list isEmpty() function
Modified: branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPValue.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPValue.h (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPValue.h Wed Sep 12 17:28:00 2007
@@ -262,6 +262,7 @@
*/
YCPOrder compare(const YCPValue &v, bool rl = false) const;
+ virtual std::ostream & toXml (std::ostream & str, int indent ) const = 0;
};
Modified: branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPVoid.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPVoid.h (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCPVoid.h Wed Sep 12 17:28:00 2007
@@ -52,6 +52,7 @@
* Output value as bytecode to stream
*/
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
/**
* Returns YT_VOID. See @ref YCPValueRep#valuetype.
Modified: branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCode.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCode.h (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YCode.h Wed Sep 12 17:28:00 2007
@@ -152,6 +152,7 @@
* see Bytecode for read
*/
virtual std::ostream & toStream (std::ostream & str) const = 0;
+ virtual std::ostream & toXml (std::ostream & str, int indent ) const = 0;
/**
* returns true if the YCode represents a constant
@@ -211,6 +212,7 @@
virtual ykind kind() const;
string toString() const;
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
/** yes */
virtual bool isConstant () const { return true; }
YCPValue evaluate (bool cse = false);
@@ -257,6 +259,7 @@
const char *domain () const;
string toString() const;
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
YCPValue evaluate (bool cse = false);
constTypePtr type() const { return Type::Locale; }
@@ -312,8 +315,10 @@
string toStringDeclaration () const;
string toString () const;
- std::ostream & toStreamDefinition (std::ostream & str) const;
- std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toStreamDefinition (std::ostream & str ) const;
+ std::ostream & toXmlDefinition (std::ostream & str, int indent ) const;
+ std::ostream & toStream (std::ostream & str ) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
virtual YCPValue evaluate (bool cse = false);
constTypePtr type() const;
};
Modified: branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YExpression.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YExpression.h (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YExpression.h Wed Sep 12 17:28:00 2007
@@ -72,6 +72,7 @@
virtual bool isReferenceable () const { return true; }
YCPValue evaluate (bool cse = false);
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
constTypePtr type() const { return m_entry->type(); }
};
@@ -92,6 +93,7 @@
string toString () const;
YCPValue evaluate (bool cse = false);
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
constTypePtr type() const;
};
@@ -114,6 +116,7 @@
const char *name () const;
YCPValue evaluate (bool cse = false);
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
constTypePtr type() const { return Type::Term; }
};
@@ -144,6 +147,7 @@
string toString () const;
YCPValue evaluate (bool cse = false);
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
constTypePtr type() const { return Type::Boolean; }
};
@@ -166,6 +170,7 @@
string toString () const;
YCPValue evaluate (bool cse = false);
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
constTypePtr type() const { return Type::Locale; }
};
@@ -187,6 +192,7 @@
string toString () const;
YCPValue evaluate (bool cse = false);
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
constTypePtr type() const;
int count () const;
YCodePtr value (int index) const;
@@ -212,6 +218,7 @@
string toString () const;
YCPValue evaluate (bool cse = false);
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
constTypePtr type() const;
};
@@ -234,6 +241,7 @@
bool canPropagate(const YCPValue& value, constTypePtr to_type) const;
YCPValue evaluate (bool cse = false);
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
constTypePtr type() const { return m_to; }
};
@@ -256,6 +264,7 @@
string toString () const;
YCPValue evaluate (bool cse = false);
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
constTypePtr type() const { return ((constFunctionTypePtr)m_decl->type)->returnType (); }
};
@@ -280,6 +289,7 @@
string toString () const;
YCPValue evaluate (bool cse = false);
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
constTypePtr type() const;
};
@@ -304,6 +314,7 @@
string toString () const;
YCPValue evaluate (bool cse = false);
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
constTypePtr type() const { return m_true->type ()->commontype (m_false->type ()); }
};
@@ -324,6 +335,7 @@
string toString () const;
YCPValue evaluate (bool cse = false);
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
constTypePtr type() const { return Type::Boolean; }
};
@@ -343,6 +355,7 @@
string toString () const;
YCPValue evaluate (bool cse = false);
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
constTypePtr type() const { return m_expr->type(); }
};
@@ -365,6 +378,7 @@
string toString () const;
YCPValue evaluate (bool cse = false);
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
constTypePtr type() const { return m_resultType; }
YCodePtr def () const { return m_def; }
};
@@ -407,6 +421,7 @@
string toString () const;
YCPValue evaluate (bool cse = false);
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
constTypePtr type () const;
constTypePtr completeType () const;
YBlockPtr parameterBlock () const;
@@ -451,6 +466,7 @@
virtual constTypePtr finalize ();
string toString () const;
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
constTypePtr type() const;
string qualifiedName () const;
Modified: branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YStatement.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YStatement.h (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YStatement.h Wed Sep 12 17:28:00 2007
@@ -72,6 +72,7 @@
~YStatement () {};
virtual string toString () const;
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
/** yes */
virtual bool isStatement () const { return true; }
int line () const { return m_line; };
@@ -94,6 +95,7 @@
virtual ykind kind () const { return ysBreak; }
string toString () const;
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
YCPValue evaluate (bool cse = false);
};
@@ -112,6 +114,7 @@
virtual ykind kind () const { return ysContinue; }
string toString () const;
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
YCPValue evaluate (bool cse = false);
};
@@ -132,6 +135,7 @@
virtual ykind kind () const { return ysExpression; }
string toString () const;
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
YCPValue evaluate (bool cse = false);
constTypePtr type () const { return Type::Void; };
};
@@ -153,6 +157,7 @@
virtual ykind kind () const { return ysBlock; }
string toString () const;
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
YCPValue evaluate (bool cse = false);
constTypePtr type () const { return Type::Void; };
};
@@ -177,6 +182,7 @@
void clearValue (); // needed if justReturn triggers
string toString () const;
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
YCPValue evaluate (bool cse = false);
constTypePtr type () const { return Type::Void; };
};
@@ -199,6 +205,7 @@
virtual ykind kind () const { return ysTypedef; }
string toString() const;
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
YCPValue evaluate (bool cse = false);
constTypePtr type () const { return Type::Void; };
};
@@ -229,6 +236,7 @@
string toString () const;
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
YCPValue evaluate (bool cse = false);
constTypePtr type () const { return Type::Void; };
};
@@ -253,6 +261,7 @@
virtual ykind kind () const { return ysAssign; }
string toString () const;
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
YCPValue evaluate (bool cse = false);
};
@@ -294,6 +303,7 @@
virtual ykind kind () const { return ysBracket; }
string toString () const;
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
// recursively extract list arg at idx, get value from current at idx
// and replace with value. re-generating the list/map/term during unwind
YCPValue commit (YCPValue current, int idx, YCPList arg, YCPValue value);
@@ -320,6 +330,7 @@
virtual ykind kind () const { return ysIf; }
string toString () const;
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
YCPValue evaluate (bool cse = false);
constTypePtr type () const { return Type::Void; };
};
@@ -343,6 +354,7 @@
virtual ykind kind () const { return ysWhile; }
string toString () const;
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
YCPValue evaluate (bool cse = false);
constTypePtr type () const { return Type::Void; };
};
@@ -366,6 +378,7 @@
virtual ykind kind () const { return ysRepeat; }
string toString () const;
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
YCPValue evaluate (bool cse = false);
constTypePtr type () const { return Type::Void; };
};
@@ -389,6 +402,7 @@
virtual ykind kind () const { return ysDo; }
string toString () const;
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
YCPValue evaluate (bool cse = false);
constTypePtr type () const { return Type::Void; };
};
@@ -410,6 +424,7 @@
virtual ykind kind () const { return ysTextdomain; }
string toString () const;
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
YCPValue evaluate (bool cse = false);
constTypePtr type () const { return Type::Void; };
const char *domain () const { return m_domain->c_str(); };
@@ -435,6 +450,7 @@
virtual ykind kind () const { return ysInclude; }
string toString () const;
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
YCPValue evaluate (bool cse = false);
constTypePtr type () const { return Type::Void; };
string filename () const { return m_filename; };
@@ -458,6 +474,7 @@
string name () const;
string toString () const;
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
YCPValue evaluate (bool cse = false);
constTypePtr type () const { return Type::Void; };
};
@@ -479,6 +496,7 @@
virtual ykind kind () const { return ysFilename; }
string toString () const;
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
YCPValue evaluate (bool cse = false);
constTypePtr type () const { return Type::Void; };
};
@@ -508,6 +526,7 @@
string name () const;
string toString () const;
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
YCPValue evaluate (bool cse = false);
constTypePtr type () const { return Type::Void; };
constTypePtr conditionType () const { return m_condition->type (); };
Modified: branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YSymbolEntry.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libycp/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YSymbolEntry.h (original)
+++ branches/tmp/sh/mod-ui/core/libycp/src/include/ycp/YSymbolEntry.h Wed Sep 12 17:28:00 2007
@@ -103,6 +103,7 @@
virtual string toString (bool with_type = true) const;
std::ostream & toStream (std::ostream & str) const;
+ std::ostream & toXml (std::ostream & str, int indent ) const;
};
#endif // YSymbolEntry_h
Added: branches/tmp/sh/mod-ui/core/libyui/doc/YCPDialogParser.xml
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/doc…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/doc/YCPDialogParser.xml (added)
+++ branches/tmp/sh/mod-ui/core/libyui/doc/YCPDialogParser.xml Wed Sep 12 17:28:00 2007
@@ -0,0 +1,5476 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<reference id="YCPDialogParser">
+ <title></title>
+ <refentry id="AAA_All-Widgets_widget">
+ <refmeta>
+ <refentrytitle>AAA_All-Widgets</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>AAA_All-Widgets</refname>
+ <refpurpose>Generic options for all widgets</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>AAA_All-Widgets</function>
+ </funcdef>
+ <void/>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Options</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <parameter>notify</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>Make UserInput() return on any action in this widget. Normally UserInput() returns only when a button is clicked; with this option on you can make it return for other events, too, e.g. when the user selects an item in a SelectionBox ( if `opt( `notify ) is set for that SelectionBox ). Only widgets with this option set are affected.</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <parameter>disabled</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>Set this widget insensitive, i.e. disable any user interaction.</para>
+ </para>
+ <para>
+ <para> The widget will show this state by being greyed out (depending on the specific UI).</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <parameter>hstretch</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>Make this widget stretchable in the horizontal dimension.</para>
+ </para>
+ <para>
+ <para></para>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <parameter>vstretch</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>Make this widget stretchable in the vertical dimension.</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <parameter>hvstretch</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>Make this widget stretchable in both dimensions.</para>
+ </para>
+ <para>
+ <para></para>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <parameter>autoShortcut</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>Automatically choose a keyboard shortcut for this widget and don't complain in the log file about the missing shortcut. Don't use this regularly for all widgets - manually chosen keyboard shortcuts are almost always better than those automatically assigned. Refer to the style guide for details. This option is intended used for automatically generated data, e.g., RadioButtons for software selections that come from file or from some other data base.</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <parameter>key_F1</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>(NCurses only) activate this widget with the F1 key</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <parameter>key_F2</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>(NCurses only) activate this widget with the F2 key</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <parameter>key_Fxx</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>(NCurses only) activate this widget with the Fxx key</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <parameter>key_F24</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>(NCurses only) activate this widget with the F24 key</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <parameter>key_none</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>(NCurses only) no function key for this widget</para>
+ </para>
+ <para>
+ <para></para>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <parameter>keyEvents</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>(NCurses only) Make UserInput() / WaitForEvent() return on keypresses within this widget. Exactly which keys trigger such a key event is UI specific. This is not for general use.</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Properties</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>boolean</type>
+ <parameter>Enabled</parameter>
+ </term>
+ <listitem>
+ <para>enabled/disabled state of this widget</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>boolean</type>
+ <parameter>Notify</parameter>
+ </term>
+ <listitem>
+ <para>the current notify state (see also `opt( `notify ))</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>WidgetClass</parameter>
+ </term>
+ <listitem>
+ <para>the widget class of this widget (YLabel, YPushButton, ...)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>DebugLabel</parameter>
+ </term>
+ <listitem>
+ <para>(possibly translated) text describing this widget for debugging</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>DialogDebugLabel</parameter>
+ </term>
+ <listitem>
+ <para>(possibly translated) text describing this dialog for debugging</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> This is not a widget for general usage, this is just a placeholder for descriptions of options that all widgets have in common.</para>
+ </para>
+ <para>
+ <para> Use them for any widget whenever it makes sense.</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ ---</programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/AutoShortcut1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/AutoShortcut2.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="BarGraph_widget">
+ <refmeta>
+ <refentrytitle>BarGraph</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>BarGraph</refname>
+ <refpurpose>Horizontal bar graph (optional widget)</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>BarGraph</function>
+ </funcdef>
+ <paramdef>
+ <type>list</type>
+ <parameter>values</parameter>
+ </paramdef>
+ <paramdef choice="opt">
+ <type>list</type>
+ <parameter>labels</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>list</type>
+ <parameter>values</parameter>
+ </term>
+ <listitem>
+ <para>the initial values (integer numbers)</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Optional Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>list</type>
+ <parameter>labels</parameter>
+ </term>
+ <listitem>
+ <para>the labels for each part; use "%1" to include the current numeric value. May include newlines.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Properties</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>integer-list</type>
+ <parameter>Values</parameter>
+ </term>
+ <listitem>
+ <para>The numerical values of each segment.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string-list</type>
+ <parameter>Labels</parameter>
+ </term>
+ <listitem>
+ <para>The labels for each segment. "\n" allowed.
+Use "%1" as a placeholder for the current value.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ if ( HasSpecialWidget( `BarGraph ) {...
+ `BarGraph( [ 450, 100, 700 ],
+ [ "Windows used\n%1 MB", "Windows free\n%1 MB", "Linux\n%1 MB" ] )
+ </programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/BarGraph1.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>BarGraph1.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/BarGraph1.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/BarGraph2.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>BarGraph2.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/BarGraph2.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/BarGraph3.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>BarGraph3.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/BarGraph3.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="CheckBox_widget">
+ <refmeta>
+ <refentrytitle>CheckBox</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>CheckBox</refname>
+ <refpurpose>Clickable on/off toggle button</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>CheckBox</function>
+ </funcdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>label</parameter>
+ </paramdef>
+ <paramdef choice="opt">
+ <type>boolean|nil</type>
+ <parameter>checked</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>label</parameter>
+ </term>
+ <listitem>
+ <para>the text describing the check box</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Options</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <parameter>boldFont</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>use a bold font</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Optional Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>boolean|nil</type>
+ <parameter>checked</parameter>
+ </term>
+ <listitem>
+ <para>whether the check box should start checked - nil means tristate condition, i.e. neither on nor off</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Properties</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>boolean</type>
+ <parameter>Value</parameter>
+ </term>
+ <listitem>
+ <para>the on/off state; nil for "don't care" (tristate)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Label</parameter>
+ </term>
+ <listitem>
+ <para>the text on the CheckBox</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> A checkbox widget has two states: Checked and not checked. It returns no user input but you can query and change its state via the <replaceable>Value</replaceable> property.</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ `CheckBox( `id( `cheese ), "&amp; Extra cheese" )</programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/CheckBox1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/CheckBox2.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/CheckBox3.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/CheckBox4.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="CheckBoxFrame_widget">
+ <refmeta>
+ <refentrytitle>CheckBoxFrame</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>CheckBoxFrame</refname>
+ <refpurpose>Frame with clickable on/off toggle button</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>CheckBoxFrame</function>
+ </funcdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>label</parameter>
+ </paramdef>
+ <paramdef>
+ <type>boolean</type>
+ <parameter>checked</parameter>
+ </paramdef>
+ <paramdef>
+ <type>term</type>
+ <parameter>child</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>label</parameter>
+ </term>
+ <listitem>
+ <para>the text describing the check box</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>boolean</type>
+ <parameter>checked</parameter>
+ </term>
+ <listitem>
+ <para>whether the check box should start checked</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>term</type>
+ <parameter>child</parameter>
+ </term>
+ <listitem>
+ <para>the child widgets for frame content - typically `VBox(...) or `HBox(...)</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Options</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <parameter>noAutoEnable</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>do not enable/disable frame children upon status change</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <parameter>invertAutoAnable</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>disable frame children if check box is checked</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Properties</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>boolean</type>
+ <parameter>Value</parameter>
+ </term>
+ <listitem>
+ <para>the on/off state of the CheckBoxFrame's check box</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Label</parameter>
+ </term>
+ <listitem>
+ <para>the text on the frame</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> This is a combination of the check box widget and the frame widget: A frame that has a check box where a simple frame would have its frame title.</para>
+ </para>
+ <para>
+ <para> By default, the frame content (the child widgets) get disabled if the check box is set to "off" (unchecked) and enabled if the check box is set to "on" (cheched).</para>
+ </para>
+ <para>
+ <para> `opt(`invertAutoEnable) inverts this behaviour: It makes YCheckBoxFrame disable its content (its child widgets) if it is set to "on" (checked) and enable its content if it is set to "off".</para>
+ </para>
+ <para>
+ <para> `opt(`noAutoEnable) switches off disabling and enabling the frame content (the child widgets) completely. In that case, use QueryWidget() and/or `opt(`immediate).</para>
+ </para>
+ <para>
+ <para> Please note that unlike YCheckBox this widget does not support tri-state - it is always either on or off.</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ `CheckBoxFrame( `id( `custom), "&Custom", true, `VBox(`InputField(...), ... )</programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/CheckBoxFrame1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/CheckBoxFrame2.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/CheckBoxFrame3.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="ComboBox_widget">
+ <refmeta>
+ <refentrytitle>ComboBox</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>ComboBox</refname>
+ <refpurpose>drop-down list selection (optionally editable)</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>ComboBox</function>
+ </funcdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>label</parameter>
+ </paramdef>
+ <paramdef choice="opt">
+ <type>list</type>
+ <parameter>items</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>label</parameter>
+ </term>
+ <listitem>
+ <para></para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Options</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <parameter>editable</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>the user can enter any value.</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Optional Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>list</type>
+ <parameter>items</parameter>
+ </term>
+ <listitem>
+ <para>the items contained in the combo box</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Properties</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>itemID</type>
+ <parameter>|</parameter>
+ </term>
+ <listitem>
+ <para>string Value ID of the selected item or the text the user entered</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Label</parameter>
+ </term>
+ <listitem>
+ <para>caption above the combo box</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>ValidChars</parameter>
+ </term>
+ <listitem>
+ <para>set of valid input characters</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>integer</type>
+ <parameter>InputMaxLength</parameter>
+ </term>
+ <listitem>
+ <para>maximum number of input characters</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> A combo box is a combination of a selection box and an input field. It gives the user a one-out-of-many choice from a list of items. Each item has a ( mandatory ) label and an ( optional ) id. When the 'editable' option is set, the user can also freely enter any value. By default, the user can only select an item already present in the list.</para>
+ </para>
+ <para>
+ <para> The items are very much like SelectionBox items: They can have an (optional) ID, they have a mandatory text to be displayed and an optional boolean parameter indicating the selected state. Only one of the items may have this parameter set to "true"; this will be the default selection on startup.</para>
+ </para>
+ <note>
+ <para>You can and should set a keyboard shortcut within the label. When the user presses the hotkey, the combo box will get the keyboard focus.</para>
+ </note>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ `ComboBox( `id( `pizza ), "select your Pizza:", [ "Margarita", `item( `id( `na ), "Napoli" ) ] )</programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/ComboBox1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/ComboBox2.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/ComboBox3.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/ComboBox4.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/ComboBox-replace-items1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/ComboBox-setInputMaxLength.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="Date_widget">
+ <refmeta>
+ <refentrytitle>Date</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>Date</refname>
+ <refpurpose>Date input field</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>Date</function>
+ </funcdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>label</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>label</parameter>
+ </term>
+ <listitem>
+ <para></para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Properties</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Value</parameter>
+ </term>
+ <listitem>
+ <para>the date </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> A Date input widget for entering dates. This widget is available in the Qt interface only</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ `Date( "Date:", "2004-10-12" )
+ </programlisting>
+ </refsect1>
+ </refentry>
+ <refentry id="DownloadProgress_widget">
+ <refmeta>
+ <refentrytitle>DownloadProgress</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>DownloadProgress</refname>
+ <refpurpose>Self-polling file growth progress indicator (optional widget)</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>DownloadProgress</function>
+ </funcdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>label</parameter>
+ </paramdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>filename</parameter>
+ </paramdef>
+ <paramdef>
+ <type>integer</type>
+ <parameter>expectedSize</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>label</parameter>
+ </term>
+ <listitem>
+ <para>label above the indicator</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>filename</parameter>
+ </term>
+ <listitem>
+ <para>file name with full path of the file to poll</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>integer</type>
+ <parameter>expectedSize</parameter>
+ </term>
+ <listitem>
+ <para>expected final size of the file in bytes</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Properties</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Label</parameter>
+ </term>
+ <listitem>
+ <para>the label above the progress indicator</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Filename</parameter>
+ </term>
+ <listitem>
+ <para>file name with full path of the file to poll</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>integer</type>
+ <parameter>ExpectedSize</parameter>
+ </term>
+ <listitem>
+ <para>expected final size of the file in bytes</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> This widget automatically displays the progress of a lengthy download operation. The widget itself (i.e. the UI) polls the specified file and automatically updates the display as required even if the download is taking place in the foreground.</para>
+ </para>
+ <para>
+ <para> Please notice that this will work only if the UI runs on the same machine as the file to download which may not taken for granted (but which is so for most users).</para>
+ </para>
+ <note>
+ <para>This is a "special" widget, i.e. not all UIs necessarily support it. Check for availability with <replaceable>HasSpecialWidget( `DownloadProgress )</replaceable> before using it.</para>
+ </note>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ if ( HasSpecialWidget( `DownloadProgress ) {...
+ `DownloadProgress( "Base system (230k)", "/tmp/aaa_base.rpm", 230*1024 );
+ </programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/DownloadProgress1.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>DownloadProgress1.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/DownloadProgress1.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="DumbTab_widget">
+ <refmeta>
+ <refentrytitle>DumbTab</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>DumbTab</refname>
+ <refpurpose>Simplistic tab widget that behaves like push buttons</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>DumbTab</function>
+ </funcdef>
+ <paramdef>
+ <type>list</type>
+ <parameter>tabs</parameter>
+ </paramdef>
+ <paramdef>
+ <type>term</type>
+ <parameter>contents</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>list</type>
+ <parameter>tabs</parameter>
+ </term>
+ <listitem>
+ <para>page headers</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>term</type>
+ <parameter>contents</parameter>
+ </term>
+ <listitem>
+ <para>page contents - usually a ReplacePoint</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Properties</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>any</type>
+ <parameter>CurrentItem</parameter>
+ </term>
+ <listitem>
+ <para>the currently selected tab</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> This is a very simplistic approach to tabbed dialogs: The application specifies a number of tab headers and the page contents and takes care of most other things all by itself, in particular page switching. Each tab header behaves very much like a PushButton - as the user activates a tab header, the DumbTab widget simply returns the ID of that tab (or its text if it has no ID). The application should then take care of changing the page contents accordingly - call UI::ReplaceWidget() on the ReplacePoint specified as tab contents or similar actions (it might even just replace data in a Table or RichText widget if this is the tab contents). Hence the name <emphasis>Dumb</emphasis>Tab.</para>
+ </para>
+ <para>
+ <para> The items in the item list can either be simple strings or `item() terms with an optional ID for each individual item (which will be returned upon UI::UserInput() and related when the user selects this tab), a (mandatory) user-visible label and an (optional) flag that indicates that this tab is initially selected. If you specify only a string, UI::UserInput() will return this string.</para>
+ </para>
+ <para>
+ <para> This is a "special" widget, i.e. not all UIs necessarily support it. Check for availability with <replaceable>HasSpecialWidget( `DumbTab )</replaceable> before using it.</para>
+ </para>
+ <note>
+ <para>Please notice that using this kind of widget more often than not is the result of <emphasis>poor dialog or workflow design</emphasis>.</para>
+ <para> Using tabs only hides complexity, but the complexity remains there. They do little to make problems simpler. This however should be the approach of choice for good user interfaces.</para>
+ <para> It is very common for tabs to be overlooked by users if there are just two tabs to select from, so in this case better use an "Expert..." or "Details..." button - this gives much more clue to the user that there is more information available while at the same time clearly indicating that those other options are much less commonly used.</para>
+ <para> If there are very many different views on data or if there are lots and lots of settings, you might consider using a tree for much better navigation. The Qt UI's wizard even has a built-in tree that can be used instead of the help panel.</para>
+ <para> If you use a tree for navigation, unter all circumstances avoid using tabs at the same time - there is no way for the user to tell which tree nodes have tabs and which have not, making navigation even more difficult. KDE's control center or Mozilla's settings are very good examples how <emphasis>not</emphasis> to do that - you become bogged down for sure in all those tree nodes and tabs hidden within so many of them.</para>
+ </note>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ if ( HasSpecialWidget( `DumbTab) {...
+ `DumbTab( [ `item(`id(`page1), "Page &1" ), `item(`id(`page2), "Page &2" ) ], contents; }
+ </programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/DumbTab1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/DumbTab2.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="Empty_widget">
+ <refmeta>
+ <refentrytitle>Empty</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>Empty</refname>
+ <refpurpose>Placeholder widget</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>Empty</function>
+ </funcdef>
+ <void/>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> The Empty widget does nothing and has a default size of zero in both dimensions. It is useful as a placeholder, for example as the initial child of a <replaceable>ReplacePoint</replaceable>.</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ `Empty()
+ </programlisting>
+ </refsect1>
+ </refentry>
+ <refentry id="Frame_widget">
+ <refmeta>
+ <refentrytitle>Frame</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>Frame</refname>
+ <refpurpose>Frame with label</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>Frame</function>
+ </funcdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>label</parameter>
+ </paramdef>
+ <paramdef>
+ <type>term</type>
+ <parameter>child</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>label</parameter>
+ </term>
+ <listitem>
+ <para>title to be displayed on the top left edge</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>term</type>
+ <parameter>child</parameter>
+ </term>
+ <listitem>
+ <para>the contained child widget</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Properties</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Label</parameter>
+ </term>
+ <listitem>
+ <para>the text on the frame</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> This widget draws a frame around its child and displays a title label within the top left edge of that frame. It is used to visually group widgets together. It is very common to use a frame like this around radio button groups.</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ `Frame( `RadioButtonGroup( `id( rb ), `VBox( ... ) ) );</programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Frame1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Frame2.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/InputField5.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="Box_widget">
+ <refmeta>
+ <refentrytitle>HBox</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>HBox</refname>
+ <refname>VBox</refname>
+ <refpurpose>Generic layout: Arrange widgets horizontally or vertically</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>HBox</function>
+ </funcdef>
+ <void/>
+ </funcprototype>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>VBox</function>
+ </funcdef>
+ <void/>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Options</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <parameter>debugLayout</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>verbose logging</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Optional Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>term</type>
+ <parameter>child1</parameter>
+ </term>
+ <listitem>
+ <para>the first child widget</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>term</type>
+ <parameter>child2</parameter>
+ </term>
+ <listitem>
+ <para>the second child widget</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>term</type>
+ <parameter>child3</parameter>
+ </term>
+ <listitem>
+ <para>the third child widget</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>term</type>
+ <parameter>child4</parameter>
+ </term>
+ <listitem>
+ <para>the fourth child widget ( and so on... )</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> The layout boxes are used to split up the dialog and layout a number of widgets horizontally ( <replaceable>HBox</replaceable> ) or vertically ( <replaceable>VBox</replaceable> ).</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ HBox( `PushButton( `id( `ok ), "OK" ), `PushButton( `id( `cancel ), "Cancel" ) )
+ </programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/VBox1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/HBox1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Layout-Buttons-Equal-Growing.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>Layout-Buttons-Equal-Growing.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/Layout-Buttons-Equal-Growing.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Layout-Fixed.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>Layout-Fixed.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/Layout-Fixed.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Layout-Mixed.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>Layout-Mixed.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/Layout-Mixed.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="Spacing_widget">
+ <refmeta>
+ <refentrytitle>HSpacing</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>HSpacing</refname>
+ <refname>VSpacing</refname>
+ <refname>HStretch</refname>
+ <refname>VStretch</refname>
+ <refpurpose>Fixed size empty space for layout</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>HSpacing</function>
+ </funcdef>
+ <void/>
+ </funcprototype>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>VSpacing</function>
+ </funcdef>
+ <void/>
+ </funcprototype>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>HStretch</function>
+ </funcdef>
+ <void/>
+ </funcprototype>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>VStretch</function>
+ </funcdef>
+ <void/>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Optional Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>integer|float</type>
+ <parameter>size</parameter>
+ </term>
+ <listitem>
+ <para></para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> HSpacing and VSpacing are layout helpers to add empty space between widgets.</para>
+ </para>
+ <para>
+ <para> VStretch and HStretch act as "rubber bands" in layouts that take excess space. They have a size of zero if there is no excess space.</para>
+ </para>
+ <para>
+ <para> The <replaceable>size</replaceable> given is measured in units roughly equivalent to the size of a character in the respective UI. Fractional numbers can be used here, but text based UIs may choose to round the number as appropriate - even if this means simply ignoring a spacing when its size becomes zero.</para>
+ </para>
+ <para>
+ <para> If <replaceable>size</replaceable> is omitted, it defaults to 1. <replaceable>HSpacing()</replaceable> will create a horizontal spacing with default width and zero height. <replaceable>VSpacing()</replaceable> will create a vertical spacing with default height and zero width. <replaceable>HStretch()</replaceable> will create a horizontal stretch with zero width and height. <replaceable>VStretch()</replaceable> will create a vertical stretch with zero width and height.</para>
+ </para>
+ <para>
+ <para> A HStretch or VStretch with a size specification will take at least the specified amount of space, but it will take more (in that dimension) if there is excess space in the layout.</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ `HSpacing( 0.3 ) or `HStretch() or `HStretch( 0.7 )</programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Spacing1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Layout-Buttons-Equal-Even-Spaced2.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>Layout-Buttons-Equal-Even-Spaced2.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/Layout-Buttons-Equal-Even-Spaced2.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Layout-Buttons-Equal-Even-Spaced1.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>Layout-Buttons-Equal-Even-Spaced1.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/Layout-Buttons-Equal-Even-Spaced1.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Layout-Buttons-Equal-Even-Spaced1.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>Layout-Buttons-Equal-Even-Spaced1.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/Layout-Buttons-Equal-Even-Spaced1.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Table3.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>Table3.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/Table3.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Table3.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>Table3.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/Table3.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="Squash_widget">
+ <refmeta>
+ <refentrytitle>HSquash</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>HSquash</refname>
+ <refname>VSquash</refname>
+ <refname>HVSquash</refname>
+ <refpurpose>Layout aid: Minimize widget to its preferred size</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>HSquash</function>
+ </funcdef>
+ <paramdef>
+ <type>term</type>
+ <parameter>child</parameter>
+ </paramdef>
+ </funcprototype>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>VSquash</function>
+ </funcdef>
+ <paramdef>
+ <type>term</type>
+ <parameter>child</parameter>
+ </paramdef>
+ </funcprototype>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>HVSquash</function>
+ </funcdef>
+ <paramdef>
+ <type>term</type>
+ <parameter>child</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>term</type>
+ <parameter>child</parameter>
+ </term>
+ <listitem>
+ <para>the child widget</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> The Squash widgets are used to control the layout. A <replaceable>HSquash</replaceable> widget makes its child widget <emphasis>nonstretchable</emphasis> in the horizontal dimension. A <replaceable>VSquash</replaceable> operates vertically, a <replaceable>HVSquash</replaceable> in both dimensions.</para>
+ </para>
+ <para>
+ <para> You can used this for example to reverse the effect of <replaceable>`Left</replaceable> making a widget stretchable. If you want to make a VBox containing for left aligned CheckBoxes, but want the VBox itself to be non-stretchable and centered, than you enclose each CheckBox with a <replaceable>`Left( .. )</replaceable> and the whole VBox with a <replaceable>HSquash( ... )</replaceable>.</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ HSquash( `InputField( "Name:" ) )</programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/HSquash1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="Weight_widget">
+ <refmeta>
+ <refentrytitle>HWeight</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>HWeight</refname>
+ <refname>VWeight</refname>
+ <refpurpose>Control relative size of layouts</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>HWeight</function>
+ </funcdef>
+ <paramdef>
+ <type>integer</type>
+ <parameter>weight</parameter>
+ </paramdef>
+ <paramdef>
+ <type>term</type>
+ <parameter>child</parameter>
+ </paramdef>
+ </funcprototype>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>VWeight</function>
+ </funcdef>
+ <paramdef>
+ <type>integer</type>
+ <parameter>weight</parameter>
+ </paramdef>
+ <paramdef>
+ <type>term</type>
+ <parameter>child</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>integer</type>
+ <parameter>weight</parameter>
+ </term>
+ <listitem>
+ <para>the new weight of the child widget</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>term</type>
+ <parameter>child</parameter>
+ </term>
+ <listitem>
+ <para>the child widget</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> This widget is used to control the layout. When a <replaceable>HBox</replaceable> or <replaceable>VBox</replaceable> widget decides how to devide remaining space amount two <emphasis>stretchable</emphasis> widgets, their weights are taken into account. This widget is used to change the weight of the child widget. Each widget has a vertical and a horizontal weight. You can change on or both of them. If you use <replaceable>HVWeight</replaceable>, the weight in both dimensions is set to the same value.</para>
+ </para>
+ <para>
+ <para> Note: No real widget is created (any more), just the weight value is passed to the child widget.</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ `HWeight( 2, `SelectionBox( "Language" ) )</programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Weight1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Layout-Buttons-Equal-Even-Spaced1.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>Layout-Buttons-Equal-Even-Spaced1.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/Layout-Buttons-Equal-Even-Spaced1.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Layout-Buttons-Equal-Even-Spaced2.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>Layout-Buttons-Equal-Even-Spaced2.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/Layout-Buttons-Equal-Even-Spaced2.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Layout-Buttons-Equal-Growing.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>Layout-Buttons-Equal-Growing.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/Layout-Buttons-Equal-Growing.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Layout-Mixed.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>Layout-Mixed.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/Layout-Mixed.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Layout-Weights1.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>Layout-Weights1.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/Layout-Weights1.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Layout-Weights2.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>Layout-Weights2.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/Layout-Weights2.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="Image_widget">
+ <refmeta>
+ <refentrytitle>Image</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>Image</refname>
+ <refpurpose>Pixmap image</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>Image</function>
+ </funcdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>imageFileName</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>imageFileName</parameter>
+ </term>
+ <listitem>
+ <para>file name (with path) of the image to display</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Options</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <parameter>animated</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>show an animated image (MNG, animated GIF)</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <parameter>scaleToFit</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>scale the pixmap so it fits the available space: zoom in or out as needed</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <parameter>zeroWidth</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>make widget report a preferred width of 0</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <parameter>zeroHeight</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>make widget report a preferred height of 0</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> Displays an image if the respective UI is capable of that.</para>
+ </para>
+ <para>
+ <para> Use <replaceable>`opt( `zeroWidth )</replaceable> and / or <replaceable>`opt( `zeroHeight )</replaceable> if the real size of the image widget is determined by outside factors, e.g. by the size of neighboring widgets. With those options you can override the preferred size of the image widget and make it show just a part of the image. If more screen space is available, more of the image is shown, if not, the layout engine doesn't complain about the image widget not getting its preferred size.</para>
+ </para>
+ <para>
+ <para> `opt( `scaleToFit ) scales the image to fit into the available space, i.e. the image will be zoomed in or out as needed.</para>
+ </para>
+ <para>
+ <para> This option implicitly sets `opt( `zeroWidth ) and `opt( zeroHeight ), too since there is no useful default size for such an image. Use MinSize() or other layout helpers to explicitly set a size on such a widget.</para>
+ </para>
+ <para>
+ <para> Please note that setting both `opt( `tiled ) and `opt( `scaleToFit ) at once doesn't make any sense.</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Image1.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>Image1.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/Image1.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Image-animated.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Image-scaled.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>Image-scaled.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/Image-scaled.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="InputField_widget">
+ <refmeta>
+ <refentrytitle>InputField</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>InputField</refname>
+ <refname>TextEntry</refname>
+ <refname>Password</refname>
+ <refpurpose>Input field</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>InputField</function>
+ </funcdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>label</parameter>
+ </paramdef>
+ <paramdef choice="opt">
+ <type>string</type>
+ <parameter>defaulttext</parameter>
+ </paramdef>
+ </funcprototype>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>TextEntry</function>
+ </funcdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>label</parameter>
+ </paramdef>
+ <paramdef choice="opt">
+ <type>string</type>
+ <parameter>defaulttext</parameter>
+ </paramdef>
+ </funcprototype>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>Password</function>
+ </funcdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>label</parameter>
+ </paramdef>
+ <paramdef choice="opt">
+ <type>string</type>
+ <parameter>defaulttext</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>label</parameter>
+ </term>
+ <listitem>
+ <para>the label describing the meaning of the entry</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Options</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <parameter>shrinkable</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>make the input field very small</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Optional Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>defaulttext</parameter>
+ </term>
+ <listitem>
+ <para>The text contained in the text entry</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Properties</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Value</parameter>
+ </term>
+ <listitem>
+ <para>the input field's contents (the user input)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Label</parameter>
+ </term>
+ <listitem>
+ <para>caption above the input field</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>ValidChars</parameter>
+ </term>
+ <listitem>
+ <para>set of valid input characters</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>integer</type>
+ <parameter>InputMaxLength</parameter>
+ </term>
+ <listitem>
+ <para>maximum number of input characters</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> This widget is a one line text entry field with a label above it. An initial text can be provided.</para>
+ </para>
+ <note>
+ <para>You can and should set a keyboard shortcut within the label. When the user presses the hotkey, the corresponding text entry widget will get the keyboard focus.</para>
+ </note>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ `InputField( `id( `name ), "Enter your name:", "Kilroy" )
+ </programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/InputField1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/InputField2.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/InputField3.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/InputField4.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/InputField6.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/InputField6.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Password2.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Password2.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/InputField-setInputMaxLength.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="IntField_widget">
+ <refmeta>
+ <refentrytitle>IntField</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>IntField</refname>
+ <refpurpose>Numeric limited range input field</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>IntField</function>
+ </funcdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>label</parameter>
+ </paramdef>
+ <paramdef>
+ <type>integer</type>
+ <parameter>minValue</parameter>
+ </paramdef>
+ <paramdef>
+ <type>integer</type>
+ <parameter>maxValue</parameter>
+ </paramdef>
+ <paramdef>
+ <type>integer</type>
+ <parameter>initialValue</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>label</parameter>
+ </term>
+ <listitem>
+ <para>Explanatory label above the input field</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>integer</type>
+ <parameter>minValue</parameter>
+ </term>
+ <listitem>
+ <para>minimum value</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>integer</type>
+ <parameter>maxValue</parameter>
+ </term>
+ <listitem>
+ <para>maximum value</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>integer</type>
+ <parameter>initialValue</parameter>
+ </term>
+ <listitem>
+ <para>initial value</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Properties</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>integer</type>
+ <parameter>Value</parameter>
+ </term>
+ <listitem>
+ <para>the numerical value</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Label</parameter>
+ </term>
+ <listitem>
+ <para>the slider label</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> A numeric input field for integer numbers within a limited range. This can be considered a lightweight version of the <link linkend="Slider_widget">Slider</link> widget, even as a replacement for this when the specific UI doesn't support the Slider. Remember it always makes sense to specify limits for numeric input, even if those limits are very large (e.g. +/- MAXINT).</para>
+ </para>
+ <para>
+ <para> Fractional numbers are currently not supported.</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ `IntField( "Percentage", 1, 100, 50 )
+ </programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/IntField1.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>IntField1.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/IntField1.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/IntField2.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>IntField2.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/IntField2.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="Label_widget">
+ <refmeta>
+ <refentrytitle>Label</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>Label</refname>
+ <refname>Heading</refname>
+ <refpurpose>Simple static text</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>Label</function>
+ </funcdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>label</parameter>
+ </paramdef>
+ </funcprototype>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>Heading</function>
+ </funcdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>label</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>label</parameter>
+ </term>
+ <listitem>
+ <para></para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Options</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <parameter>outputField</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>make the label look like an input field in read-only mode</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <parameter>boldFont</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>use a bold font</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Properties</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Label</parameter>
+ </term>
+ <listitem>
+ <para>the label text</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Value</parameter>
+ </term>
+ <listitem>
+ <para>the label text (alias for Label)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Text</parameter>
+ </term>
+ <listitem>
+ <para>the label text (alias for Label)</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> A <replaceable>Label</replaceable> is static text displayed in the dialog. A <replaceable>Heading</replaceable> is static text with a bold and/or larger font. In both cases, the text may contain newlines.</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ `Label( "Here goes some text\nsecond line" )
+ </programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Label1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Label2.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Label3.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Label4.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Heading3.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Heading3.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Heading3.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="Alignment_widget">
+ <refmeta>
+ <refentrytitle>Left</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>Left</refname>
+ <refname>Right</refname>
+ <refname>Top</refname>
+ <refname>Bottom</refname>
+ <refname>HCenter</refname>
+ <refname>VCenter</refname>
+ <refname>HVCenter</refname>
+ <refpurpose>Layout alignment</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>Left</function>
+ </funcdef>
+ <paramdef>
+ <type>term</type>
+ <parameter>child</parameter>
+ </paramdef>
+ <paramdef choice="opt">
+ <type>`BackgroundPixmap(</type>
+ <parameter>"dir/pixmap.png"</parameter>
+ </paramdef>
+ </funcprototype>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>Right</function>
+ </funcdef>
+ <paramdef>
+ <type>term</type>
+ <parameter>child</parameter>
+ </paramdef>
+ <paramdef choice="opt">
+ <type>`BackgroundPixmap(</type>
+ <parameter>"dir/pixmap.png"</parameter>
+ </paramdef>
+ </funcprototype>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>Top</function>
+ </funcdef>
+ <paramdef>
+ <type>term</type>
+ <parameter>child</parameter>
+ </paramdef>
+ <paramdef choice="opt">
+ <type>`BackgroundPixmap(</type>
+ <parameter>"dir/pixmap.png"</parameter>
+ </paramdef>
+ </funcprototype>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>Bottom</function>
+ </funcdef>
+ <paramdef>
+ <type>term</type>
+ <parameter>child</parameter>
+ </paramdef>
+ <paramdef choice="opt">
+ <type>`BackgroundPixmap(</type>
+ <parameter>"dir/pixmap.png"</parameter>
+ </paramdef>
+ </funcprototype>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>HCenter</function>
+ </funcdef>
+ <paramdef>
+ <type>term</type>
+ <parameter>child</parameter>
+ </paramdef>
+ <paramdef choice="opt">
+ <type>`BackgroundPixmap(</type>
+ <parameter>"dir/pixmap.png"</parameter>
+ </paramdef>
+ </funcprototype>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>VCenter</function>
+ </funcdef>
+ <paramdef>
+ <type>term</type>
+ <parameter>child</parameter>
+ </paramdef>
+ <paramdef choice="opt">
+ <type>`BackgroundPixmap(</type>
+ <parameter>"dir/pixmap.png"</parameter>
+ </paramdef>
+ </funcprototype>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>HVCenter</function>
+ </funcdef>
+ <paramdef>
+ <type>term</type>
+ <parameter>child</parameter>
+ </paramdef>
+ <paramdef choice="opt">
+ <type>`BackgroundPixmap(</type>
+ <parameter>"dir/pixmap.png"</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>term</type>
+ <parameter>child</parameter>
+ </term>
+ <listitem>
+ <para>The contained child widget</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Optional Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>`BackgroundPixmap(</type>
+ <parameter>"dir/pixmap.png"</parameter>
+ </term>
+ <listitem>
+ <para>) background pixmap</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> The Alignment widgets are used to control the layout of a dialog. They are useful in situations, where to a widget is assigned more space than it can use. For example if you have a VBox containing four CheckBoxes, the width of the VBox is determined by the CheckBox with the longest label. The other CheckBoxes are centered per default.</para>
+ </para>
+ <para>
+ <para> With <replaceable>`Left( widget )</replaceable> you tell a widget that it should be laid out leftmost of the space that is available to it. <replaceable>Right, Top</replaceable> and <replaceable>Bottom</replaceable> are working accordingly. The other three widgets center their child widget horizontally, vertically or in both directions.</para>
+ </para>
+ <para>
+ <para> As a very special case, alignment widgets that have `opt(`hvstretch) (and related) set promote their child widget's stretchability to the parent layout. I.e., they do not align a child that is stretchable in that dimension, but stretch it to consume the available space. This is only very rarely useful, such as in very generic layout code where the content of an alignment widget is usually unknown, and it might make sense to, say, center a child that is not stretchable, and OTOH to stretch a child that is stretchable.</para>
+ </para>
+ <para>
+ <para> An optional background pixmap can be specified as the first argument. UIs that support background pixmaps will then use the specified file as a (tiled) backgound image.</para>
+ </para>
+ <para>
+ <para> If that name does not start with "/" or ".", the theme path ("/usr/share/YaST2/theme/current/") will be prepended.</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ `Left( `CheckBox( "Don't ask this again" ) )</programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/HCenter1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/HCenter2.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/HCenter3.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Alignment1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="LogView_widget">
+ <refmeta>
+ <refentrytitle>LogView</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>LogView</refname>
+ <refpurpose>scrollable log lines like "tail -f"</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>LogView</function>
+ </funcdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>label</parameter>
+ </paramdef>
+ <paramdef>
+ <type>integer</type>
+ <parameter>visibleLines</parameter>
+ </paramdef>
+ <paramdef>
+ <type>integer</type>
+ <parameter>maxLines</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>label</parameter>
+ </term>
+ <listitem>
+ <para>(above the log lines)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>integer</type>
+ <parameter>visibleLines</parameter>
+ </term>
+ <listitem>
+ <para>number of visible lines (without scrolling)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>integer</type>
+ <parameter>maxLines</parameter>
+ </term>
+ <listitem>
+ <para>number of log lines to store (use 0 for "all")</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Properties</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Value</parameter>
+ </term>
+ <listitem>
+ <para>All log lines. Set this property to replace or clear the entire contents.
+Can only be set, not queried.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>LastLine</parameter>
+ </term>
+ <listitem>
+ <para>The last log line. Set this property to append one or more line(s) to the log.
+Can only be set, not queried.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Label</parameter>
+ </term>
+ <listitem>
+ <para>The label above the log text.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> A scrolled output-only text window where ASCII output of any kind can be redirected - very much like a shell window with "tail -f".</para>
+ </para>
+ <para>
+ <para> The LogView will keep up to "maxLines" of output, discarding the oldest lines if there are more. If "maxLines" is set to 0, all lines will be kept.</para>
+ </para>
+ <para>
+ <para> "visibleLines" lines will be visible by default (without scrolling) unless you stretch the widget in the layout.</para>
+ </para>
+ <para>
+ <para> Use <replaceable>ChangeWidget( `id( `log ), `LastLine, "bla blurb...\n" )</replaceable> to append one or several line(s) to the output. Notice the newline at the end of each line!</para>
+ </para>
+ <para>
+ <para> Use <replaceable>ChangeWidget( `id( `log ), `Value, "bla blurb...\n" )</replaceable> to replace the entire contents of the LogView.</para>
+ </para>
+ <para>
+ <para> Use <replaceable>ChangeWidget( `id( `log ), `Value, "" )</replaceable> to clear the contents.</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ `LogView( "Log file", 4, 200 );</programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/LogView1.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>LogView1.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/LogView1.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="MarginBox_widget">
+ <refmeta>
+ <refentrytitle>MarginBox</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>MarginBox</refname>
+ <refpurpose>Margins around one child widget</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>MarginBox</function>
+ </funcdef>
+ <paramdef>
+ <type>float</type>
+ <parameter>horMargin</parameter>
+ </paramdef>
+ <paramdef>
+ <type>float</type>
+ <parameter>vertMargin</parameter>
+ </paramdef>
+ <paramdef>
+ <type>term</type>
+ <parameter>child</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>float</type>
+ <parameter>horMargin</parameter>
+ </term>
+ <listitem>
+ <para>margin left and right of the child widget</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>float</type>
+ <parameter>vertMargin</parameter>
+ </term>
+ <listitem>
+ <para>margin above and below the child widget</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>term</type>
+ <parameter>child</parameter>
+ </term>
+ <listitem>
+ <para>The contained child widget</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> This widget is a shorthand to add margins to the sides of a child widget (which may of course also be a VBox or a HBox, i.e. several widgets).</para>
+ </para>
+ <para>
+ <para> Unlike more complex constructs like nested VBox and HBox widgets with VSpacing and HSpacing at the sides, the margins of a MarginBox have lower layout priorities than the real content, so if screen space becomes scarce, the margins will be reduced first, and only if the margins are zero, the content will be reduced in size.</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ `MarginBox( 0.2, 0.3, `Label( "Hello" ) );
+ `MarginBox( `leftMargin( 0.7,), `rightMargin( 2.0 ), `topMargin( 0.3 ), `bottomMargin( 0.8 ), `Label( "Hello" ) );</programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/MarginBox1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/MarginBox2.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="MenuButton_widget">
+ <refmeta>
+ <refentrytitle>MenuButton</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>MenuButton</refname>
+ <refpurpose>Button with popup menu</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>MenuButton</function>
+ </funcdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>label</parameter>
+ </paramdef>
+ <paramdef>
+ <type>itemList</type>
+ <parameter>menu</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>label</parameter>
+ </term>
+ <listitem>
+ <para></para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>itemList</type>
+ <parameter>menu</parameter>
+ </term>
+ <listitem>
+ <para>items</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Properties</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Label</parameter>
+ </term>
+ <listitem>
+ <para>the text on the MenuButton</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> This is a widget that looks very much like a <replaceable>PushButton</replaceable>, but unlike a <replaceable>PushButton</replaceable> it doesn't immediately start some action but opens a popup menu from where the user can select an item that starts an action. Any item may in turn open a submenu etc.</para>
+ </para>
+ <para>
+ <para> <replaceable>UserInput()</replaceable> returns the ID of a menu item if one was activated. It will never return the ID of the <replaceable>MenuButton</replaceable> itself.</para>
+ </para>
+ <para>
+ <para> <emphasis>Style guide hint:</emphasis> Don't overuse this widget. Use it for dialogs that provide lots of actions. Make the most frequently used actions accessible via normal <replaceable>PushButtons</replaceable>. Move less frequently used actions (e.g. "expert" actions) into one or more <replaceable>MenuButtons</replaceable>. Don't nest the popup menus too deep - the deeper the nesting, the more awkward the user interface will be.</para>
+ </para>
+ <para>
+ <para> You can (and should) provide keybord shortcuts along with the button label as well as for any menu item.</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ `MenuButton( "button label", [ `item( `id( `doit ), "&amp; Do it" ), `item( `id( `something ), "&amp; Something" ) ] );</programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/MenuButton1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/MenuButton2.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="MinSize_widget">
+ <refmeta>
+ <refentrytitle>MinWidth</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>MinWidth</refname>
+ <refname>MinHeight</refname>
+ <refname>MinSize</refname>
+ <refpurpose>Layout minimum size</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>MinWidth</function>
+ </funcdef>
+ <paramdef>
+ <type>float|integer</type>
+ <parameter>size</parameter>
+ </paramdef>
+ <paramdef>
+ <type>term</type>
+ <parameter>child</parameter>
+ </paramdef>
+ <paramdef choice="opt">
+ <type>float|integer</type>
+ <parameter>height</parameter>
+ </paramdef>
+ </funcprototype>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>MinHeight</function>
+ </funcdef>
+ <paramdef>
+ <type>float|integer</type>
+ <parameter>size</parameter>
+ </paramdef>
+ <paramdef>
+ <type>term</type>
+ <parameter>child</parameter>
+ </paramdef>
+ <paramdef choice="opt">
+ <type>float|integer</type>
+ <parameter>height</parameter>
+ </paramdef>
+ </funcprototype>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>MinSize</function>
+ </funcdef>
+ <paramdef>
+ <type>float|integer</type>
+ <parameter>size</parameter>
+ </paramdef>
+ <paramdef>
+ <type>term</type>
+ <parameter>child</parameter>
+ </paramdef>
+ <paramdef choice="opt">
+ <type>float|integer</type>
+ <parameter>height</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>float|integer</type>
+ <parameter>size</parameter>
+ </term>
+ <listitem>
+ <para>minimum width (for MinWidth or MinSize) or minimum heigh (for MinHeight)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>term</type>
+ <parameter>child</parameter>
+ </term>
+ <listitem>
+ <para>The contained child widget</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Optional Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>float|integer</type>
+ <parameter>height</parameter>
+ </term>
+ <listitem>
+ <para>(only for MinSize)</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> This widget makes sure its one child never gets less screen space than the specified amount. It implicitly makes the child stretchable in that dimension.</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ `MinWidth( 30, InputField(`id(`name), "Name" ) );</programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/MinWidth1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/MinHeight1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/MinSize1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="MultiLineEdit_widget">
+ <refmeta>
+ <refentrytitle>MultiLineEdit</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>MultiLineEdit</refname>
+ <refpurpose>multiple line text edit field</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>MultiLineEdit</function>
+ </funcdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>label</parameter>
+ </paramdef>
+ <paramdef choice="opt">
+ <type>string</type>
+ <parameter>initialValue</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>label</parameter>
+ </term>
+ <listitem>
+ <para>label above the field</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Optional Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>initialValue</parameter>
+ </term>
+ <listitem>
+ <para>the initial contents of the field</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Properties</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Value</parameter>
+ </term>
+ <listitem>
+ <para>the MultiLineEdit text contents (with newlines)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Label</parameter>
+ </term>
+ <listitem>
+ <para>caption above the MultiLineEdit</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>integer</type>
+ <parameter>InputMaxLength</parameter>
+ </term>
+ <listitem>
+ <para>maximum number of input characters</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> This widget is a multiple line text entry field with a label above it. An initial text can be provided.</para>
+ </para>
+ <para>
+ <para> Note: You can and should set a keyboard shortcut within the label. When the user presses the hotkey, the corresponding MultiLineEdit widget will get the keyboard focus.</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ `MultiLineEdit( `id( `descr ), "Enter problem &amp; description:", "No problem here." )
+ </programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/MultiLineEdit1.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>MultiLineEdit1.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/MultiLineEdit1.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/MultiLineEdit2.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>MultiLineEdit2.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/MultiLineEdit2.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/MultiLineEdit3.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>MultiLineEdit3.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/MultiLineEdit3.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/MultiLineEdit-setInputMaxLength.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="MultiSelectionBox_widget">
+ <refmeta>
+ <refentrytitle>MultiSelectionBox</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>MultiSelectionBox</refname>
+ <refpurpose>Selection box that allows selecton of multiple items</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>MultiSelectionBox</function>
+ </funcdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>label</parameter>
+ </paramdef>
+ <paramdef choice="opt">
+ <type>list</type>
+ <parameter>items</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>label</parameter>
+ </term>
+ <listitem>
+ <para></para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Options</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <parameter>shrinkable</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>make the widget very small</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Optional Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>list</type>
+ <parameter>items</parameter>
+ </term>
+ <listitem>
+ <para>the items initially contained in the selection box</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Properties</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>itemList</type>
+ <parameter>SelectedItems</parameter>
+ </term>
+ <listitem>
+ <para>All currently selected items</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>itemList</type>
+ <parameter>Items</parameter>
+ </term>
+ <listitem>
+ <para>All items</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>itemID</type>
+ <parameter>CurrentItem</parameter>
+ </term>
+ <listitem>
+ <para>The current item (no matter if selected or not)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Label</parameter>
+ </term>
+ <listitem>
+ <para>Caption above the MultiSelectionBox</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> The MultiSelectionBox displays a ( scrollable ) list of items from which any number (even nothing!) can be selected. Use the MultiSelectionBox's <replaceable>SelectedItems</replaceable> property to find out which.</para>
+ </para>
+ <para>
+ <para> Each item can be specified either as a simple string or as <replaceable>`item( ... )</replaceable> which includes an ( optional ) ID and an (optional) 'selected' flag that specifies the initial selected state ('not selected', i.e. 'false', is default).</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ `MultiSelectionBox( `id( `topping ), "select pizza toppings:", [ "Salami", `item( `id( `cheese ), "Cheese", true ) ] )</programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/MultiSelectionBox1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/MultiSelectionBox2.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>MultiSelectionBox2.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/MultiSelectionBox2.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/MultiSelectionBox3.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/MultiSelectionBox-replace-items1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/MultiSelectionBox-replace-items2.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="PackageSelector_widget">
+ <refmeta>
+ <refentrytitle>PackageSelector</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>PackageSelector</refname>
+ <refpurpose>Complete software package selection</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>PackageSelector</function>
+ </funcdef>
+ <void/>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Options</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <parameter>youMode</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>start in YOU (YaST Online Update) mode</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <parameter>updateMode</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>start in update mode</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <parameter>searchMode</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>start with the "search" filter view</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <parameter>summaryMode</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>start with the "installation summary" filter view</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <parameter>repoMode</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>start with the "repositories" filter view</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Optional Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>floppyDevice</parameter>
+ </term>
+ <listitem>
+ <para></para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> A very complex widget that handles software package selection completely transparently. Set up the package manager (the backend) before creating this widget and let the package manager and the package selector handle all the rest. The result of all this are the data stored in the package manager.</para>
+ </para>
+ <para>
+ <para> Use UI::RunPkgSelection() after creating a dialog with this widget. The result of UI::UserInput() in a dialog with such a widget is undefined - it may or may not return.</para>
+ </para>
+ <para>
+ <para> This widget gets the (best) floppy device as a parameter since the UI has no general way of finding out by itself what device can be used for saving or loading pacakge lists etc. - this is best done outside and passed here as a parameter.</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ `PackageSelector()
+ </programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/PackageSelector.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="PartitionSplitter_widget">
+ <refmeta>
+ <refentrytitle>PartitionSplitter</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>PartitionSplitter</refname>
+ <refpurpose>Hard disk partition splitter tool (optional widget)</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>PartitionSplitter</function>
+ </funcdef>
+ <paramdef>
+ <type>integer</type>
+ <parameter>usedSize</parameter>
+ </paramdef>
+ <paramdef>
+ <type>integer</type>
+ <parameter>totalFreeSize</parameter>
+ </paramdef>
+ <paramdef>
+ <type>integer</type>
+ <parameter>newPartSize</parameter>
+ </paramdef>
+ <paramdef>
+ <type>integer</type>
+ <parameter>minNewPartSize</parameter>
+ </paramdef>
+ <paramdef>
+ <type>integer</type>
+ <parameter>minFreeSize</parameter>
+ </paramdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>usedLabel</parameter>
+ </paramdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>freeLabel</parameter>
+ </paramdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>newPartLabel</parameter>
+ </paramdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>freeFieldLabel</parameter>
+ </paramdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>newPartFieldLabel</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>integer</type>
+ <parameter>usedSize</parameter>
+ </term>
+ <listitem>
+ <para>size of the used part of the partition</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>integer</type>
+ <parameter>totalFreeSize</parameter>
+ </term>
+ <listitem>
+ <para>total size of the free part of the partition (before the split)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>integer</type>
+ <parameter>newPartSize</parameter>
+ </term>
+ <listitem>
+ <para>suggested size of the new partition</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>integer</type>
+ <parameter>minNewPartSize</parameter>
+ </term>
+ <listitem>
+ <para>minimum size of the new partition</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>integer</type>
+ <parameter>minFreeSize</parameter>
+ </term>
+ <listitem>
+ <para>minimum free size of the old partition</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>usedLabel</parameter>
+ </term>
+ <listitem>
+ <para>BarGraph label for the used part of the old partition</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>freeLabel</parameter>
+ </term>
+ <listitem>
+ <para>BarGraph label for the free part of the old partition</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>newPartLabel</parameter>
+ </term>
+ <listitem>
+ <para>BarGraph label for the new partition</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>freeFieldLabel</parameter>
+ </term>
+ <listitem>
+ <para>label for the remaining free space field</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>newPartFieldLabel</parameter>
+ </term>
+ <listitem>
+ <para>label for the new size field</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Properties</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>integer</type>
+ <parameter>Value</parameter>
+ </term>
+ <listitem>
+ <para>the numerical value</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> A very specialized widget to allow a user to comfortably split an existing hard disk partition in two parts. Shows a bar graph that displays the used space of the partition, the remaining free space (before the split) of the partition and the space of the new partition (as suggested). Below the bar graph is a slider with an input fields to the left and right where the user can either input the desired remaining free space or the desired size of the new partition or drag the slider to do this.</para>
+ </para>
+ <para>
+ <para> The total size is <replaceable>usedSize+freeSize</replaceable>.</para>
+ </para>
+ <para>
+ <para> The user can resize the new partition between <replaceable>minNewPartSize</replaceable> and <replaceable>totalFreeSize-minFreeSize</replaceable>.</para>
+ </para>
+ <note>
+ <para>This is a "special" widget, i.e. not all UIs necessarily support it. Check for availability with <replaceable>HasSpecialWidget( `PartitionSplitter )</replaceable> before using it.</para>
+ </note>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ if ( HasSpecialWidget( `PartitionSplitter ) {...
+ `PartitionSplitter( 600, 1200, 800, 300, 50,
+ "Windows used\n%1 MB", "Windows used\n%1 MB", "Linux\n%1 MB", "Linux ( MB )" )
+ </programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/PartitionSplitter1.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>PartitionSplitter1.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/PartitionSplitter1.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/PartitionSplitter2.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>PartitionSplitter2.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/PartitionSplitter2.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="PatternSelector_widget">
+ <refmeta>
+ <refentrytitle>PatternSelector</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>PatternSelector</refname>
+ <refpurpose>High-level widget to select software patterns (selections)</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>PatternSelector</function>
+ </funcdef>
+ <void/>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> This widget is similar to the PackageSelector in its semantics: It is a very high-level widget that lets the user select software, but unlike the PackageSelector it works on software patterns (selections).</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ if ( UI::HasSpecialWidget( `PatternSelector) {...
+ `PatternSelector()...
+ UI::RunPkgSelection();
+ </programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/PatternSelector-solo.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/PatternSelector-wizard.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="PkgSpecial_widget">
+ <refmeta>
+ <refentrytitle>PkgSpecial</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>PkgSpecial</refname>
+ <refpurpose>Package selection special - DON'T USE IT</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>PkgSpecial</function>
+ </funcdef>
+ <void/>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> Use only if you know what you are doing - that is, DON'T USE IT.</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ `PkgSpecial( "subwidget_name" )
+ </programlisting>
+ </refsect1>
+ </refentry>
+ <refentry id="ProgressBar_widget">
+ <refmeta>
+ <refentrytitle>ProgressBar</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>ProgressBar</refname>
+ <refpurpose>Graphical progress indicator</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>ProgressBar</function>
+ </funcdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>label</parameter>
+ </paramdef>
+ <paramdef choice="opt">
+ <type>integer</type>
+ <parameter>maxvalue</parameter>
+ </paramdef>
+ <paramdef choice="opt">
+ <type>integer</type>
+ <parameter>progress</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>label</parameter>
+ </term>
+ <listitem>
+ <para>the label describing the bar</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Optional Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>integer</type>
+ <parameter>maxvalue</parameter>
+ </term>
+ <listitem>
+ <para>the maximum value of the bar</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>integer</type>
+ <parameter>progress</parameter>
+ </term>
+ <listitem>
+ <para>the current progress value of the bar</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Properties</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>integer</type>
+ <parameter>Value</parameter>
+ </term>
+ <listitem>
+ <para>the current progress</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Label</parameter>
+ </term>
+ <listitem>
+ <para>caption above the progress bar</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> A progress bar is a horizontal bar with a label that shows a progress value. If you omit the optional parameter <replaceable>maxvalue</replaceable>, the maximum value will be 100. If you omit the optional parameter <replaceable>progress</replaceable>, the progress bar will set to 0 initially.</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ `ProgressBar( `id( `pb ), "17 of 42 Packages installed", 42, 17 )</programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/ProgressBar1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/ProgressBar2.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="PushButton_widget">
+ <refmeta>
+ <refentrytitle>PushButton</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>PushButton</refname>
+ <refname>IconButton</refname>
+ <refpurpose>Perform action on click</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>PushButton</function>
+ </funcdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>iconName</parameter>
+ </paramdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>label</parameter>
+ </paramdef>
+ </funcprototype>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>IconButton</function>
+ </funcdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>iconName</parameter>
+ </paramdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>label</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>iconName</parameter>
+ </term>
+ <listitem>
+ <para>(IconButton only)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>label</parameter>
+ </term>
+ <listitem>
+ <para></para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Options</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <parameter>default</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>makes this button the dialogs default button</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Properties</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Label</parameter>
+ </term>
+ <listitem>
+ <para>text on the button</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> A <replaceable>PushButton</replaceable> is a button with a text label the user can press in order to activate some action. If you call <replaceable>UserInput()</replaceable> and the user presses the button, <replaceable>UserInput()</replaceable> returns with the id of the pressed button.</para>
+ </para>
+ <para>
+ <para> You can (and should) provide keybord shortcuts along with the button label. For example "&amp; Apply" as a button label will allow the user to activate the button with Alt-A, even if it currently doesn't have keyboard focus. This is important for UIs that don't support using a mouse.</para>
+ </para>
+ <para>
+ <para> An <replaceable>IconButton</replaceable> is pretty much the same, but it has an icon in addition to the text. If the UI cannot handle icons, it displays only the text, and the icon is silently omitted.</para>
+ </para>
+ <para>
+ <para> Icons are (at the time of this writing) loaded from the <emphasis>theme</emphasis> directory, /usr/share/YaST2/theme/current.</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ `PushButton( `id( `click ), `opt( `default, `hstretch ), "Click me" )</programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/PushButton1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/PushButton2.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/IconButton1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="RadioButton_widget">
+ <refmeta>
+ <refentrytitle>RadioButton</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>RadioButton</refname>
+ <refpurpose>Clickable on/off toggle button for radio boxes</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>RadioButton</function>
+ </funcdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>label</parameter>
+ </paramdef>
+ <paramdef choice="opt">
+ <type>boolean</type>
+ <parameter>selected</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>label</parameter>
+ </term>
+ <listitem>
+ <para></para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Options</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <parameter>boldFont</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>use a bold font</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Optional Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>boolean</type>
+ <parameter>selected</parameter>
+ </term>
+ <listitem>
+ <para></para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Properties</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>boolean</type>
+ <parameter>Value</parameter>
+ </term>
+ <listitem>
+ <para>the on/off state of the RadioButton</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Label</parameter>
+ </term>
+ <listitem>
+ <para>the text on the RadioButton</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> A radio button is not usefull alone. Radio buttons are group such that the user can select one radio button of a group. It is much like a selection box, but radio buttons can be dispersed over the dialog. Radio buttons must be contained in a <replaceable>RadioButtonGroup</replaceable>.</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ `RadioButton( `id( `now ), "Crash now", true )</programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/RadioButton1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/RadioButton2.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Frame2.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/ShortcutConflict3.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="RadioButtonGroup_widget">
+ <refmeta>
+ <refentrytitle>RadioButtonGroup</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>RadioButtonGroup</refname>
+ <refpurpose>Radio box - select one of many radio buttons</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>RadioButtonGroup</function>
+ </funcdef>
+ <paramdef>
+ <type>term</type>
+ <parameter>child</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>term</type>
+ <parameter>child</parameter>
+ </term>
+ <listitem>
+ <para>the child widget</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Properties</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>any</type>
+ <parameter>CurrentButton</parameter>
+ </term>
+ <listitem>
+ <para>widget ID of the currently selected RadioButton of this group</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>any</type>
+ <parameter>Value</parameter>
+ </term>
+ <listitem>
+ <para>Alias for CurrentButton</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> A <replaceable>RadioButtonGroup</replaceable> is a container widget that has neither impact on the layout nor has it a graphical representation. It is just used to logically group RadioButtons together so the one-out-of-many selection strategy can be ensured.</para>
+ </para>
+ <para>
+ <para> Radio button groups may be nested. Looking bottom up we can say that a radio button belongs to the radio button group that is nearest to it. If you give the <replaceable>RadioButtonGroup</replaceable> widget an id, you can use it to query and set which radio button is currently selected.</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ `RadioButtonGroup( `id( rb ), `VBox( ... ) )</programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/RadioButton1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Frame2.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="ReplacePoint_widget">
+ <refmeta>
+ <refentrytitle>ReplacePoint</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>ReplacePoint</refname>
+ <refpurpose>Pseudo widget to replace parts of a dialog</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>ReplacePoint</function>
+ </funcdef>
+ <paramdef>
+ <type>term</type>
+ <parameter>child</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>term</type>
+ <parameter>child</parameter>
+ </term>
+ <listitem>
+ <para>the child widget</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> A ReplacePoint can be used to dynamically change parts of a dialog. It contains one widget. This widget can be replaced by another widget by calling <replaceable>ReplaceWidget( `id( id ), newchild )</replaceable>, where <replaceable>id</replaceable> is the the id of the new child widget of the replace point. The ReplacePoint widget itself has no further effect and no optical representation.</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ `ReplacePoint( `id( `rp ), `Empty() )</programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/ReplacePoint1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/DumbTab2.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/ShortcutCheckPostponed.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/WidgetExists.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="RichText_widget">
+ <refmeta>
+ <refentrytitle>RichText</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>RichText</refname>
+ <refpurpose>Static text with HTML-like formatting</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>RichText</function>
+ </funcdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>text</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>text</parameter>
+ </term>
+ <listitem>
+ <para></para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Options</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <parameter>plainText</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>don't interpret text as HTML</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <parameter>autoScrollDown</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>automatically scroll down for each text change</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <parameter>shrinkable</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>make the widget very small</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Properties</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Value</parameter>
+ </term>
+ <listitem>
+ <para>the text content</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Text</parameter>
+ </term>
+ <listitem>
+ <para>the text content</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> A <replaceable>RichText</replaceable> is a text area with two major differences to a <replaceable>Label</replaceable>: The amount of data it can contain is not restricted by the layout and a number of control sequences are allowed, which control the layout of the text.</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ `RichText( "This is a <emphasis>bold</emphasis> text" )</programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/RichText1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/RichText2.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/RichText3.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/RichText-hyperlinks.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="SelectionBox_widget">
+ <refmeta>
+ <refentrytitle>SelectionBox</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>SelectionBox</refname>
+ <refpurpose>Scrollable list selection</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>SelectionBox</function>
+ </funcdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>label</parameter>
+ </paramdef>
+ <paramdef choice="opt">
+ <type>list</type>
+ <parameter>items</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>label</parameter>
+ </term>
+ <listitem>
+ <para></para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Options</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <parameter>shrinkable</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>make the widget very small</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <parameter>immediate</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>make `notify trigger immediately when the selected item changes</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Optional Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>list</type>
+ <parameter>items</parameter>
+ </term>
+ <listitem>
+ <para>the items contained in the selection box</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Properties</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>itemID</type>
+ <parameter>Value</parameter>
+ </term>
+ <listitem>
+ <para>The currently selected item</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>itemID</type>
+ <parameter>CurrentItem</parameter>
+ </term>
+ <listitem>
+ <para>The currently selected item</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>itemList</type>
+ <parameter>Items</parameter>
+ </term>
+ <listitem>
+ <para>All items</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Label</parameter>
+ </term>
+ <listitem>
+ <para>caption above the selection box</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> A selection box offers the user to select an item out of a list. Each item has a label and an optional id. When constructing the list of items, you have two way of specifying an item. Either you give a plain string, in which case the string is used both for the id and the label of the item. Or you specify a term <replaceable>`item( term id, string label )</replaceable> or <replaceable>`item( term id, string label, boolean selected )</replaceable>, where you give an id of the form <replaceable>`id( any v )</replaceable> where you can store an aribtrary value as id. The third argument controls whether the item is the selected item.</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ `SelectionBox( `id( `pizza ), "select your Pizza:", [ "Margarita", `item( `id( `na ), "Napoli" ) ] )</programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/SelectionBox1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/SelectionBox2.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/SelectionBox3.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/SelectionBox4.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/SelectionBox-icons.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/SelectionBox-replace-items1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/SelectionBox-replace-items2.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="SimplePatchSelector_widget">
+ <refmeta>
+ <refentrytitle>SimplePatchSelector</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>SimplePatchSelector</refname>
+ <refpurpose>Simplified approach to patch selection</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>SimplePatchSelector</function>
+ </funcdef>
+ <void/>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> This is a stripped-down version of the PackageSelector widget in "online update" ("patches") mode. It provides a very simplistic view on patches. It does not give access to handling packages by itself, but it contains a "Details..." button that lets the application open a full-fledged PackageSelector (in "online update" / "patches" mode).</para>
+ </para>
+ <para>
+ <para> Be advised that only this widget alone without access to the full PackageSelector might easily lead the user to a dead end: If dependency problems arise that cannot easily be solved from within the dependency problems dialog or by deselecting one or several patches, it might be necessary for the user to solve the problem on the package level. If he cannot do that, he might be unable to continue his update task.</para>
+ </para>
+ <para>
+ <para> This widget is similar in many ways to the PatternSelector widget: It gives a higher-level, more abstract access to package management at the cost of omitting details and fine control that more advanced users will want or need. The SimplePatchSelector should be used in ways similarl to the PatternSelector widget.</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ if ( UI::HasSpecialWidget( `SimplePatchSelector) {...
+ `SimplePatchSelector()...
+ UI::RunPkgSelection();
+ </programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/SimplePatchSelector-empty.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/SimplePatchSelector-stable.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="Slider_widget">
+ <refmeta>
+ <refentrytitle>Slider</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>Slider</refname>
+ <refpurpose>Numeric limited range input (optional widget)</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>Slider</function>
+ </funcdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>label</parameter>
+ </paramdef>
+ <paramdef>
+ <type>integer</type>
+ <parameter>minValue</parameter>
+ </paramdef>
+ <paramdef>
+ <type>integer</type>
+ <parameter>maxValue</parameter>
+ </paramdef>
+ <paramdef>
+ <type>integer</type>
+ <parameter>initialValue</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>label</parameter>
+ </term>
+ <listitem>
+ <para>Explanatory label above the slider</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>integer</type>
+ <parameter>minValue</parameter>
+ </term>
+ <listitem>
+ <para>minimum value</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>integer</type>
+ <parameter>maxValue</parameter>
+ </term>
+ <listitem>
+ <para>maximum value</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>integer</type>
+ <parameter>initialValue</parameter>
+ </term>
+ <listitem>
+ <para>initial value</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Properties</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>integer</type>
+ <parameter>Value</parameter>
+ </term>
+ <listitem>
+ <para>the numerical value</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Label</parameter>
+ </term>
+ <listitem>
+ <para>the slider label</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> A horizontal slider with (numeric) input field that allows input of an integer value in a given range. The user can either drag the slider or simply enter a value in the input field.</para>
+ </para>
+ <para>
+ <para> Remember you can use <replaceable>`opt( `notify )</replaceable> in order to get instant response when the user changes the value - if this is desired.</para>
+ </para>
+ <note>
+ <para>This is a "special" widget, i.e. not all UIs necessarily support it. Check for availability with <replaceable>HasSpecialWidget( `Slider )</replaceable> before using it.</para>
+ </note>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ if ( HasSpecialWidget( `Slider ) {...
+ `Slider( "Percentage", 1, 100, 50 )
+ </programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Slider1.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>Slider1.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/Slider1.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Slider2.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>Slider2.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/Slider2.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="Table_widget">
+ <refmeta>
+ <refentrytitle>Table</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>Table</refname>
+ <refpurpose>Multicolumn table widget</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>Table</function>
+ </funcdef>
+ <paramdef>
+ <type>term</type>
+ <parameter>header</parameter>
+ </paramdef>
+ <paramdef choice="opt">
+ <type>list</type>
+ <parameter>items</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>term</type>
+ <parameter>header</parameter>
+ </term>
+ <listitem>
+ <para>the headers of the columns</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Options</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <parameter>immediate</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>make `notify trigger immediately when the selected item changes</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <parameter>keepSorting</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>keep the insertion order - don't let the user sort manually by clicking</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Optional Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>list</type>
+ <parameter>items</parameter>
+ </term>
+ <listitem>
+ <para>the items contained in the selection box</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Properties</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>integer</type>
+ <parameter>CurrentItem</parameter>
+ </term>
+ <listitem>
+ <para>the ID of the currently selected item
+Alias: Value</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>list(item)</type>
+ <parameter>Items</parameter>
+ </term>
+ <listitem>
+ <para>a list of all table items</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>item</type>
+ <parameter>Item(id)</parameter>
+ </term>
+ <listitem>
+ <para>read: a single item (string or term)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>integer|string</type>
+ <parameter>Item(id,column)</parameter>
+ </term>
+ <listitem>
+ <para>write: replacement for one specific cell ( see example )</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> A Table widget is a generalization of the SelectionBox. Information is displayed in a number of columns. Each column has a header. The number of columns and their titles are described by the first argument, which is a term with the symbol <replaceable>header</replaceable>. For each column you add a string specifying its title. For example <replaceable>`header( "Name", "Price" )</replaceable> creates the two columns "Name" and "Price".</para>
+ </para>
+ <para>
+ <para> The second argument is an optional list of items (rows) that are inserted in the table. Each item has the form <replaceable>`item( `id( </replaceable> id <replaceable> ), first column, second column, ... )</replaceable>. For each column one argument has to be specified, which must be of type void, string or integer. Strings are being left justified, integer right and a nil denote an empty cell, just as the empty string.</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ `Table( `header( "Game", "Highscore" ), [ `item( `id(1), "xkobo", "1708" ) ] )</programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Table1.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>Table1.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/Table1.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Table2.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>Table2.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/Table2.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Table3.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>Table3.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/Table3.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Table4.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>Table4.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/Table4.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Table5.ycp" parse="text"/>
+ <screenshot>
+ <screeninfo>Table5.ycp</screeninfo>
+ <graphic fileref="examples/screenshots/Table5.png"/>
+ </screenshot>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="Time_widget">
+ <refmeta>
+ <refentrytitle>Time</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>Time</refname>
+ <refpurpose>Time input field</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>Time</function>
+ </funcdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>label</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>label</parameter>
+ </term>
+ <listitem>
+ <para></para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Properties</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Value</parameter>
+ </term>
+ <listitem>
+ <para>the date </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> A Time input widget for entering time. This widget is available in the Qt interface only</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ `Time( "Time:" , "20:20:20" )
+ </programlisting>
+ </refsect1>
+ </refentry>
+ <refentry id="Tree_widget">
+ <refmeta>
+ <refentrytitle>Tree</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>Tree</refname>
+ <refpurpose>Scrollable tree selection</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>Tree</function>
+ </funcdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>label</parameter>
+ </paramdef>
+ <paramdef choice="opt">
+ <type>itemList</type>
+ <parameter>items</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>label</parameter>
+ </term>
+ <listitem>
+ <para></para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Optional Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>itemList</type>
+ <parameter>items</parameter>
+ </term>
+ <listitem>
+ <para>the items contained in the tree</para>
+ <programlisting>
+
+ itemList ::=
+ [
+ item
+ [ , item ]
+ [ , item ]
+ ...
+ ]
+ item ::=
+ string |
+ `item(
+ [ `id( string ),]
+ string
+ [ , true | false ]
+ [ , itemList ]
+ ) </programlisting>
+ <para> The boolean parameter inside `item() indicates whether or not the respective tree item should be opened by default - if it has any subitems and if the respective UI is capable of closing and opening subtrees. If the UI cannot handle this, all subtrees will always be open.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Properties</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>itemID</type>
+ <parameter>Value</parameter>
+ </term>
+ <listitem>
+ <para>The currently selected item</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>itemID</type>
+ <parameter>CurrentItem</parameter>
+ </term>
+ <listitem>
+ <para>The currently selected item</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>list<itemID></type>
+ <parameter>CurrentBranch</parameter>
+ </term>
+ <listitem>
+ <para>List of IDs of current branch from root to current item</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>itemList</type>
+ <parameter>Items</parameter>
+ </term>
+ <listitem>
+ <para>All items</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>map<ItemID></type>
+ <parameter>OpenItems</parameter>
+ </term>
+ <listitem>
+ <para>Map of IDs of all open items - can only be queried, not set</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Label</parameter>
+ </term>
+ <listitem>
+ <para>caption above the tree</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Label</parameter>
+ </term>
+ <listitem>
+ <para>the label above the Tree</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>itemId</type>
+ <parameter>CurrentItem</parameter>
+ </term>
+ <listitem>
+ <para>the currently selected item
+Alias: Value</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>YTreeItem</type>
+ <parameter>list</parameter>
+ </term>
+ <listitem>
+ <para>Items
+The items that are displayed</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>OpenItems</type>
+ <parameter>a</parameter>
+ </term>
+ <listitem>
+ <para>map of open items - can only be queried, not set</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>CurrentBranch</type>
+ <parameter>a</parameter>
+ </term>
+ <listitem>
+ <para>list of the current item and all its ancestors
+from the root item to the current item- either the respective IDs or,
+for items that don't have IDs, the item text. If no item is currently
+selected, 'nil' is returned.
+This property can only be queried, not set.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> A tree widget provides a selection from a hierarchical tree structure. The semantics are very much like those of a SelectionBox. Unlike the SelectionBox, however, tree items may have subitems that in turn may have subitems etc.</para>
+ </para>
+ <para>
+ <para> Each item has a label string, optionally preceded by an ID. If the item has subitems, they are specified as a list of items after the string.</para>
+ </para>
+ <para>
+ <para> The tree widget will not perform any sorting on its own: The items are always sorted by insertion order. The application needs to handle sorting itself, if desired.</para>
+ </para>
+ <para>
+ <para> Note: The Qt version of the Wizard widget also provides a built-in tree with an API that is (sometimes) easier to use.</para>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ `Tree( `id( `treeID ), "treeLabel", [ "top1", "top2", "top3" ] );</programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Tree1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Tree2.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Tree3.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Tree-icons.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Tree-replace-items.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/Wizard4.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="VMultiProgressMeter_widget">
+ <refmeta>
+ <refentrytitle>VMultiProgressMeter</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>VMultiProgressMeter</refname>
+ <refname>HMultiProgressMeter</refname>
+ <refpurpose>Progress bar with multiple segments (optional widget)</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>VMultiProgressMeter</function>
+ </funcdef>
+ <paramdef>
+ <type>List<integer></type>
+ <parameter>maxValues</parameter>
+ </paramdef>
+ </funcprototype>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>HMultiProgressMeter</function>
+ </funcdef>
+ <paramdef>
+ <type>List<integer></type>
+ <parameter>maxValues</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>List<integer></type>
+ <parameter>maxValues</parameter>
+ </term>
+ <listitem>
+ <para>maximum values</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Properties</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>list<integer></type>
+ <parameter>Values</parameter>
+ </term>
+ <listitem>
+ <para>the current values for all segments</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Values</parameter>
+ </term>
+ <listitem>
+ <para>the current values for all segments</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> A vertical (VMultiProgressMeter) or horizontal (HMultiProgressMeter) progress display with multiple segments. The numbers passed on widget creation are the maximum numbers of each individual segment. Segments sizes will be displayed proportionally to these numbers.</para>
+ </para>
+ <para>
+ <para> This widget is intended for applications like showing the progress of installing from multiple CDs while giving the user a hint how much will be installed from each individual CD.</para>
+ </para>
+ <para>
+ <programlisting> Set actual values later with
+
+UI::ChangeWidget(`id(...), `Values, [ 1, 2, ...] ); </programlisting>
+ </para>
+ <para>
+ <para> The widget may choose to reserve a minimum amount of space for each segment even if that means that some segments will be shown slightly out of proportion.</para>
+ </para>
+ <note>
+ <para>This is a "special" widget, i.e. not all UIs necessarily support it. Check for availability with <replaceable>HasSpecialWidget( `MultiProgressMeter )</replaceable> before using it.</para>
+ </note>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ if ( HasSpecialWidget( `MultiProgressMeter ) {...
+ `MultiProgressMeter( "Percentage", 1, 100, 50 )
+ </programlisting>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <informalexample>
+ <programlisting>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="examples/MultiProgressMeter1.ycp" parse="text"/>
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+ <refentry id="Wizard_widget">
+ <refmeta>
+ <refentrytitle>Wizard</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>Wizard</refname>
+ <refpurpose>Wizard frame - not for general use, use the Wizard:: module instead!</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>
+ <type></type>
+ <function>Wizard</function>
+ </funcdef>
+ <paramdef>
+ <type>any</type>
+ <parameter>backButtonId</parameter>
+ </paramdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>backButtonLabel</parameter>
+ </paramdef>
+ <paramdef>
+ <type>any</type>
+ <parameter>abortButtonId</parameter>
+ </paramdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>abortButtonLabel</parameter>
+ </paramdef>
+ <paramdef>
+ <type>any</type>
+ <parameter>nextButtonId</parameter>
+ </paramdef>
+ <paramdef>
+ <type>string</type>
+ <parameter>nextButtonLabel</parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>any</type>
+ <parameter>backButtonId</parameter>
+ </term>
+ <listitem>
+ <para>ID to return when the user presses the "Back" button</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>backButtonLabel</parameter>
+ </term>
+ <listitem>
+ <para>Label of the "Back" button</para>
+ <para></para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>any</type>
+ <parameter>abortButtonId</parameter>
+ </term>
+ <listitem>
+ <para>ID to return when the user presses the "Abort" button</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>abortButtonLabel</parameter>
+ </term>
+ <listitem>
+ <para>Label of the "Abort" button</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>any</type>
+ <parameter>nextButtonId</parameter>
+ </term>
+ <listitem>
+ <para>ID to return when the user presses the "Next" button</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>nextButtonLabel</parameter>
+ </term>
+ <listitem>
+ <para>Label of the "Next" button</para>
+ <para></para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Options</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <parameter>stepsEnabled</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>Enable showing wizard steps (use UI::WizardCommand() to set them).</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <parameter>treeEnabled</parameter>
+ </term>
+ <listitem>
+ <para>
+ <para>Enable showing a selection tree in the left panel. Disables stepsEnabled.</para>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <para> This is the UI-specific technical implementation of a wizard dialog's main widget. This is not intended for general use - use the Wizard:: module instead which will use this widget properly.</para>
+ </para>
+ <para>
+ <para> A wizard widget always has ID `wizard.<p> The ID of the single replace point within the wizard is always `contents.</para>
+ </para>
+ <note>
+ <para>This is a "special" widget, i.e. not all UIs necessarily support it. Check for availability with <replaceable>HasSpecialWidget( `PartitionSplitter )</replaceable> before using it.</para>
+ </note>
+ </refsect1>
+ <refsect1>
+ <title>Usage</title>
+ <programlisting>
+ `Wizard(`id(`back), "&Back", `id(`abort), "Ab&ort", `id(`next), "&Next" )
+ `Wizard(`back, "&Back", `abort, "Ab&ort", `next, "&Next" )
+ </programlisting>
+ </refsect1>
+ </refentry>
+</reference>
Added: branches/tmp/sh/mod-ui/core/libyui/doc/namespace
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/doc…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/doc/namespace (added)
+++ branches/tmp/sh/mod-ui/core/libyui/doc/namespace Wed Sep 12 17:28:00 2007
@@ -0,0 +1,40 @@
+Converting the UI functions from builtins to a namespace
+
+Why?
+----
+
+So that they can be called from yast2-perl-bindings (and python and ruby,
+coming soon).
+
+Usage
+-----
+
+TODO add the example
+
+How?
+----
+Makefiles: use -lpy2UI instead of -lyui. that should get wrapped properly in
+yast2-core.pc
+Remove references to the UI class.
+
+* liby2
+implement "import" also in Y2PluginComponent because the abstract UI becomes
+one.
+
+genericfrontend: because the abstract UI is now instantiable, register a
+namespace override to the server specified in argv
+
+
+* libyui
+
+Y2CCUI, YUIComponent : make the base UI instantiable so that ycpc can work
+without a real one. Implement the import method.
+
+Y2UINamespace: created, copying code from YUI_bindings.
+- FIXME overloading
+- FIXME macro player: should work now, test
+
+Removed UI.h that served to register the builtins. (TODO: the docs is still
+done in builtin style. Take it as inspiration.)
+
+TODO: test that threads work
Modified: branches/tmp/sh/mod-ui/core/libyui/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/Makefile.am (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/Makefile.am Wed Sep 12 17:28:00 2007
@@ -7,9 +7,11 @@
-DPLUGINDIR=\"${plugindir}\" \
-fmessage-length=0
-lib_LTLIBRARIES = libyui.la
+plugin_LTLIBRARIES = libpy2UI.la
-libyui_la_SOURCES = \
+libpy2UI_la_SOURCES = \
+ Y2UINamespace.cc \
+ Y2CCUI.cc \
YApplication.cc \
YCPDialogParser.cc \
YCPItemParser.cc \
@@ -21,7 +23,6 @@
YUIComponent.cc \
YUIException.cc \
YUIPlugin.cc \
- YUI_bindings.cc \
YUI_builtins.cc \
YUI_core.cc \
YUI_special_widgets.cc \
@@ -83,7 +84,8 @@
pkginclude_HEADERS = \
ImplPtr.h \
- UI.h \
+ Y2UINamespace.h \
+ Y2CCUI.h \
YApplication.h \
YBothDim.h \
YCPDialogParser.h \
@@ -168,10 +170,17 @@
-I$(top_srcdir)/liby2/src/include \
${Y2UTIL_CFLAGS}
-libyui_la_LDFLAGS = -version-info 2:0
-libyui_la_LIBADD = -lpthread
+libpy2UI_la_LDFLAGS = -version-info 2:0
+libpy2UI_la_LIBADD = -lpthread
-CLEANFILES = libyui.kdoc
+# "foo bar: baz" is wrong
+# see "info '(automake)Multiple Outputs'"
+%BuiltinCalls.h %BuiltinTable.h : Y2%Namespace.h
+ ${top_srcdir}/base/tools/devtools/generateYCPWrappers $< $*BuiltinCalls.h $*BuiltinTable.h
+
+BUILT_SOURCES = UIBuiltinTable.h UIBuiltinCalls.h
+
+CLEANFILES = libyui.kdoc $(BUILT_SOURCES)
#<INSTALL-HEADER-TARGET>
Added: branches/tmp/sh/mod-ui/core/libyui/src/UIBuiltinCalls.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/UIBuiltinCalls.h (added)
+++ branches/tmp/sh/mod-ui/core/libyui/src/UIBuiltinCalls.h Wed Sep 12 17:28:00 2007
@@ -0,0 +1,55 @@
+ case 0: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, String is required"); return YCPVoid();} return m_instance->SetLanguage (m_param1->asString());
+ case 1: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, String is required"); return YCPVoid();} if (m_param2->isVoid()) {y2error("ERROR: Parameter 2 is nil, String is required"); return YCPVoid();} return m_instance->SetLanguage (m_param1->asString(), m_param2->asString());
+ case 2: return m_instance->GetProductName ();
+ case 3: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, String is required"); return YCPVoid();} return m_instance->SetProductName (m_param1->asString());
+ case 4: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, String is required"); return YCPVoid();} if (m_param2->isVoid()) {y2error("ERROR: Parameter 2 is nil, String is required"); return YCPVoid();} if (m_param3->isVoid()) {y2error("ERROR: Parameter 3 is nil, String is required"); return YCPVoid();} if (m_param4->isVoid()) {y2error("ERROR: Parameter 4 is nil, String is required"); return YCPVoid();} if (m_param5->isVoid()) {y2error("ERROR: Parameter 5 is nil, String is required"); return YCPVoid();} return m_instance->SetConsoleFont (m_param1->asString(), m_param2->asString(), m_param3->asString(), m_param4->asString(), m_param5->asString());
+ case 5: return m_instance->SetKeyboard ();
+ case 6: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, Boolean is required"); return YCPVoid();} return m_instance->GetLanguage (m_param1->asBoolean());
+ case 7: return m_instance->UserInput ();
+ case 8: return m_instance->PollInput ();
+ case 9: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, Integer is required"); return YCPVoid();} return m_instance->TimeoutUserInput (m_param1->asInteger());
+ case 10: return m_instance->WaitForEvent ();
+ case 11: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, Integer is required"); return YCPVoid();} return m_instance->WaitForEvent (m_param1->asInteger());
+ case 12: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, Term is required"); return YCPVoid();} return m_instance->OpenDialog (m_param1->asTerm());
+ case 13: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, Term is required"); return YCPVoid();} if (m_param2->isVoid()) {y2error("ERROR: Parameter 2 is nil, Term is required"); return YCPVoid();} return m_instance->OpenDialog (m_param1->asTerm(), m_param2->asTerm());
+ case 14: return m_instance->CloseDialog ();
+ case 15: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, Symbol is required"); return YCPVoid();} if (m_param2->isVoid()) {y2error("ERROR: Parameter 2 is nil, Symbol is required"); return YCPVoid();} if (m_param3->isVoid()) {y2error("ERROR: Parameter 3 is nil, Value is required"); return YCPVoid();} return m_instance->ChangeWidget (m_param1->asSymbol(), m_param2->asSymbol(), m_param3->asValue());
+ case 16: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, Term is required"); return YCPVoid();} if (m_param2->isVoid()) {y2error("ERROR: Parameter 2 is nil, Symbol is required"); return YCPVoid();} if (m_param3->isVoid()) {y2error("ERROR: Parameter 3 is nil, Value is required"); return YCPVoid();} return m_instance->ChangeWidget (m_param1->asTerm(), m_param2->asSymbol(), m_param3->asValue());
+ case 17: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, Term is required"); return YCPVoid();} if (m_param2->isVoid()) {y2error("ERROR: Parameter 2 is nil, Term is required"); return YCPVoid();} if (m_param3->isVoid()) {y2error("ERROR: Parameter 3 is nil, Value is required"); return YCPVoid();} return m_instance->ChangeWidget (m_param1->asTerm(), m_param2->asTerm(), m_param3->asValue());
+ case 18: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, Symbol is required"); return YCPVoid();} if (m_param2->isVoid()) {y2error("ERROR: Parameter 2 is nil, Symbol is required"); return YCPVoid();} return m_instance->QueryWidget (m_param1->asSymbol(), m_param2->asSymbol());
+ case 19: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, Symbol is required"); return YCPVoid();} if (m_param2->isVoid()) {y2error("ERROR: Parameter 2 is nil, Term is required"); return YCPVoid();} return m_instance->QueryWidget (m_param1->asSymbol(), m_param2->asTerm());
+ case 20: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, Term is required"); return YCPVoid();} if (m_param2->isVoid()) {y2error("ERROR: Parameter 2 is nil, Symbol is required"); return YCPVoid();} return m_instance->QueryWidget (m_param1->asTerm(), m_param2->asSymbol());
+ case 21: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, Term is required"); return YCPVoid();} if (m_param2->isVoid()) {y2error("ERROR: Parameter 2 is nil, Term is required"); return YCPVoid();} return m_instance->QueryWidget (m_param1->asTerm(), m_param2->asTerm());
+ case 22: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, Symbol is required"); return YCPVoid();} if (m_param2->isVoid()) {y2error("ERROR: Parameter 2 is nil, Term is required"); return YCPVoid();} return m_instance->ReplaceWidget (m_param1->asSymbol(), m_param2->asTerm());
+ case 23: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, Term is required"); return YCPVoid();} if (m_param2->isVoid()) {y2error("ERROR: Parameter 2 is nil, Term is required"); return YCPVoid();} return m_instance->ReplaceWidget (m_param1->asTerm(), m_param2->asTerm());
+ case 24: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, Symbol is required"); return YCPVoid();} return m_instance->SetFocus (m_param1->asSymbol());
+ case 25: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, Term is required"); return YCPVoid();} return m_instance->SetFocus (m_param1->asTerm());
+ case 26: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, String is required"); return YCPVoid();} return m_instance->RunInTerminal (m_param1->asString());
+ case 27: return m_instance->BusyCursor ();
+ case 28: return m_instance->RedrawScreen ();
+ case 29: return m_instance->NormalCursor ();
+ case 30: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, String is required"); return YCPVoid();} return m_instance->MakeScreenshot (m_param1->asString());
+ case 31: return m_instance->MakeScreenshot ();
+ case 32: return m_instance->DumpWidgetTree ();
+ case 33: return m_instance->Beep ();
+ case 34: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, String is required"); return YCPVoid();} return m_instance->RecordMacro (m_param1->asString());
+ case 35: return m_instance->StopRecordMacro ();
+ case 36: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, String is required"); return YCPVoid();} return m_instance->PlayMacro (m_param1->asString());
+ case 37: return m_instance->FakeUserInput ();
+ case 38: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, Value is required"); return YCPVoid();} return m_instance->FakeUserInput (m_param1->asValue());
+ case 39: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, Symbol is required"); return YCPVoid();} return m_instance->Glyph (m_param1->asSymbol());
+ case 40: return m_instance->GetDisplayInfo ();
+ case 41: return m_instance->RecalcLayout ();
+ case 42: return m_instance->PostponeShortcutCheck ();
+ case 43: return m_instance->CheckShortcuts ();
+ case 44: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, Symbol is required"); return YCPVoid();} return m_instance->WidgetExists (m_param1->asSymbol());
+ case 45: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, Term is required"); return YCPVoid();} return m_instance->WidgetExists (m_param1->asTerm());
+ case 46: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, Value is required"); return YCPVoid();} return m_instance->RunPkgSelection (m_param1->asValue());
+ case 47: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, String is required"); return YCPVoid();} if (m_param2->isVoid()) {y2error("ERROR: Parameter 2 is nil, String is required"); return YCPVoid();} return m_instance->AskForExistingDirectory (m_param1->asString(), m_param2->asString());
+ case 48: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, String is required"); return YCPVoid();} if (m_param2->isVoid()) {y2error("ERROR: Parameter 2 is nil, String is required"); return YCPVoid();} if (m_param3->isVoid()) {y2error("ERROR: Parameter 3 is nil, String is required"); return YCPVoid();} return m_instance->AskForExistingFile (m_param1->asString(), m_param2->asString(), m_param3->asString());
+ case 49: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, String is required"); return YCPVoid();} if (m_param2->isVoid()) {y2error("ERROR: Parameter 2 is nil, String is required"); return YCPVoid();} if (m_param3->isVoid()) {y2error("ERROR: Parameter 3 is nil, String is required"); return YCPVoid();} return m_instance->AskForSaveFileName (m_param1->asString(), m_param2->asString(), m_param3->asString());
+ case 50: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, Map is required"); return YCPVoid();} return m_instance->SetFunctionKeys (m_param1->asMap());
+ case 51: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, String is required"); return YCPVoid();} if (m_param2->isVoid()) {y2error("ERROR: Parameter 2 is nil, String is required"); return YCPVoid();} if (m_param3->isVoid()) {y2error("ERROR: Parameter 3 is nil, String is required"); return YCPVoid();} return m_instance->Recode (m_param1->asString(), m_param2->asString(), m_param3->asString());
+ case 52: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, String is required"); return YCPVoid();} return m_instance->SetModulename (m_param1->asString());
+ case 53: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, Symbol is required"); return YCPVoid();} return m_instance->HasSpecialWidget (m_param1->asSymbol());
+ case 54: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, Term is required"); return YCPVoid();} return m_instance->WizardCommand (m_param1->asTerm());
Added: branches/tmp/sh/mod-ui/core/libyui/src/UIBuiltinTable.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/UIBuiltinTable.h (added)
+++ branches/tmp/sh/mod-ui/core/libyui/src/UIBuiltinTable.h Wed Sep 12 17:28:00 2007
@@ -0,0 +1,110 @@
+ enterSymbol (new SymbolEntry (this, 0, "SetLanguage", SymbolEntry::c_function, Type::fromSignature ("void (string)") ) );
+ _registered_functions.push_back ("SetLanguage");
+ enterSymbol (new SymbolEntry (this, 1, "SetLanguage", SymbolEntry::c_function, Type::fromSignature ("void (string, string)") ) );
+ _registered_functions.push_back ("SetLanguage");
+ enterSymbol (new SymbolEntry (this, 2, "GetProductName", SymbolEntry::c_function, Type::fromSignature ("string ()") ) );
+ _registered_functions.push_back ("GetProductName");
+ enterSymbol (new SymbolEntry (this, 3, "SetProductName", SymbolEntry::c_function, Type::fromSignature ("void (string)") ) );
+ _registered_functions.push_back ("SetProductName");
+ enterSymbol (new SymbolEntry (this, 4, "SetConsoleFont", SymbolEntry::c_function, Type::fromSignature ("void (string, string, string, string, string)") ) );
+ _registered_functions.push_back ("SetConsoleFont");
+ enterSymbol (new SymbolEntry (this, 5, "SetKeyboard", SymbolEntry::c_function, Type::fromSignature ("void ()") ) );
+ _registered_functions.push_back ("SetKeyboard");
+ enterSymbol (new SymbolEntry (this, 6, "GetLanguage", SymbolEntry::c_function, Type::fromSignature ("string (boolean)") ) );
+ _registered_functions.push_back ("GetLanguage");
+ enterSymbol (new SymbolEntry (this, 7, "UserInput", SymbolEntry::c_function, Type::fromSignature ("any()") ) );
+ _registered_functions.push_back ("UserInput");
+ enterSymbol (new SymbolEntry (this, 8, "PollInput", SymbolEntry::c_function, Type::fromSignature ("any ()") ) );
+ _registered_functions.push_back ("PollInput");
+ enterSymbol (new SymbolEntry (this, 9, "TimeoutUserInput", SymbolEntry::c_function, Type::fromSignature ("any (integer)") ) );
+ _registered_functions.push_back ("TimeoutUserInput");
+ enterSymbol (new SymbolEntry (this, 10, "WaitForEvent", SymbolEntry::c_function, Type::fromSignature ("map<string,any> ()") ) );
+ _registered_functions.push_back ("WaitForEvent");
+ enterSymbol (new SymbolEntry (this, 11, "WaitForEvent", SymbolEntry::c_function, Type::fromSignature ("map<string,any> (integer)") ) );
+ _registered_functions.push_back ("WaitForEvent");
+ enterSymbol (new SymbolEntry (this, 12, "OpenDialog", SymbolEntry::c_function, Type::fromSignature ("void(term)") ) );
+ _registered_functions.push_back ("OpenDialog");
+ enterSymbol (new SymbolEntry (this, 13, "OpenDialog", SymbolEntry::c_function, Type::fromSignature ("void(term,term)") ) );
+ _registered_functions.push_back ("OpenDialog");
+ enterSymbol (new SymbolEntry (this, 14, "CloseDialog", SymbolEntry::c_function, Type::fromSignature ("boolean()") ) );
+ _registered_functions.push_back ("CloseDialog");
+ enterSymbol (new SymbolEntry (this, 15, "ChangeWidget", SymbolEntry::c_function, Type::fromSignature ("boolean (symbol, symbol, any)") ) );
+ _registered_functions.push_back ("ChangeWidget");
+ enterSymbol (new SymbolEntry (this, 16, "ChangeWidget", SymbolEntry::c_function, Type::fromSignature ("boolean (term, symbol, any)") ) );
+ _registered_functions.push_back ("ChangeWidget");
+ enterSymbol (new SymbolEntry (this, 17, "ChangeWidget", SymbolEntry::c_function, Type::fromSignature ("boolean (term, term, any)") ) );
+ _registered_functions.push_back ("ChangeWidget");
+ enterSymbol (new SymbolEntry (this, 18, "QueryWidget", SymbolEntry::c_function, Type::fromSignature ("any (symbol, symbol)") ) );
+ _registered_functions.push_back ("QueryWidget");
+ enterSymbol (new SymbolEntry (this, 19, "QueryWidget", SymbolEntry::c_function, Type::fromSignature ("any (symbol, term)") ) );
+ _registered_functions.push_back ("QueryWidget");
+ enterSymbol (new SymbolEntry (this, 20, "QueryWidget", SymbolEntry::c_function, Type::fromSignature ("any (term, symbol)") ) );
+ _registered_functions.push_back ("QueryWidget");
+ enterSymbol (new SymbolEntry (this, 21, "QueryWidget", SymbolEntry::c_function, Type::fromSignature ("any (term, term)") ) );
+ _registered_functions.push_back ("QueryWidget");
+ enterSymbol (new SymbolEntry (this, 22, "ReplaceWidget", SymbolEntry::c_function, Type::fromSignature ("boolean (symbol, term)") ) );
+ _registered_functions.push_back ("ReplaceWidget");
+ enterSymbol (new SymbolEntry (this, 23, "ReplaceWidget", SymbolEntry::c_function, Type::fromSignature ("boolean (term, term)") ) );
+ _registered_functions.push_back ("ReplaceWidget");
+ enterSymbol (new SymbolEntry (this, 24, "SetFocus", SymbolEntry::c_function, Type::fromSignature ("boolean (symbol)") ) );
+ _registered_functions.push_back ("SetFocus");
+ enterSymbol (new SymbolEntry (this, 25, "SetFocus", SymbolEntry::c_function, Type::fromSignature ("boolean (term)") ) );
+ _registered_functions.push_back ("SetFocus");
+ enterSymbol (new SymbolEntry (this, 26, "RunInTerminal", SymbolEntry::c_function, Type::fromSignature ("integer (string)") ) );
+ _registered_functions.push_back ("RunInTerminal");
+ enterSymbol (new SymbolEntry (this, 27, "BusyCursor", SymbolEntry::c_function, Type::fromSignature ("void ()") ) );
+ _registered_functions.push_back ("BusyCursor");
+ enterSymbol (new SymbolEntry (this, 28, "RedrawScreen", SymbolEntry::c_function, Type::fromSignature ("void ()") ) );
+ _registered_functions.push_back ("RedrawScreen");
+ enterSymbol (new SymbolEntry (this, 29, "NormalCursor", SymbolEntry::c_function, Type::fromSignature ("void ()") ) );
+ _registered_functions.push_back ("NormalCursor");
+ enterSymbol (new SymbolEntry (this, 30, "MakeScreenshot", SymbolEntry::c_function, Type::fromSignature ("void (string)") ) );
+ _registered_functions.push_back ("MakeScreenshot");
+ enterSymbol (new SymbolEntry (this, 31, "MakeScreenshot", SymbolEntry::c_function, Type::fromSignature ("void ()") ) );
+ _registered_functions.push_back ("MakeScreenshot");
+ enterSymbol (new SymbolEntry (this, 32, "DumpWidgetTree", SymbolEntry::c_function, Type::fromSignature ("void ()") ) );
+ _registered_functions.push_back ("DumpWidgetTree");
+ enterSymbol (new SymbolEntry (this, 33, "Beep", SymbolEntry::c_function, Type::fromSignature ("void ()") ) );
+ _registered_functions.push_back ("Beep");
+ enterSymbol (new SymbolEntry (this, 34, "RecordMacro", SymbolEntry::c_function, Type::fromSignature ("void (string)") ) );
+ _registered_functions.push_back ("RecordMacro");
+ enterSymbol (new SymbolEntry (this, 35, "StopRecordMacro", SymbolEntry::c_function, Type::fromSignature ("void ()") ) );
+ _registered_functions.push_back ("StopRecordMacro");
+ enterSymbol (new SymbolEntry (this, 36, "PlayMacro", SymbolEntry::c_function, Type::fromSignature ("void (string)") ) );
+ _registered_functions.push_back ("PlayMacro");
+ enterSymbol (new SymbolEntry (this, 37, "FakeUserInput", SymbolEntry::c_function, Type::fromSignature ("void ()") ) );
+ _registered_functions.push_back ("FakeUserInput");
+ enterSymbol (new SymbolEntry (this, 38, "FakeUserInput", SymbolEntry::c_function, Type::fromSignature ("void (any)") ) );
+ _registered_functions.push_back ("FakeUserInput");
+ enterSymbol (new SymbolEntry (this, 39, "Glyph", SymbolEntry::c_function, Type::fromSignature ("string (symbol)") ) );
+ _registered_functions.push_back ("Glyph");
+ enterSymbol (new SymbolEntry (this, 40, "GetDisplayInfo", SymbolEntry::c_function, Type::fromSignature ("map<string,any> ()") ) );
+ _registered_functions.push_back ("GetDisplayInfo");
+ enterSymbol (new SymbolEntry (this, 41, "RecalcLayout", SymbolEntry::c_function, Type::fromSignature ("void ()") ) );
+ _registered_functions.push_back ("RecalcLayout");
+ enterSymbol (new SymbolEntry (this, 42, "PostponeShortcutCheck", SymbolEntry::c_function, Type::fromSignature ("void ()") ) );
+ _registered_functions.push_back ("PostponeShortcutCheck");
+ enterSymbol (new SymbolEntry (this, 43, "CheckShortcuts", SymbolEntry::c_function, Type::fromSignature ("void ()") ) );
+ _registered_functions.push_back ("CheckShortcuts");
+ enterSymbol (new SymbolEntry (this, 44, "WidgetExists", SymbolEntry::c_function, Type::fromSignature ("boolean (symbol)") ) );
+ _registered_functions.push_back ("WidgetExists");
+ enterSymbol (new SymbolEntry (this, 45, "WidgetExists", SymbolEntry::c_function, Type::fromSignature ("boolean (term)") ) );
+ _registered_functions.push_back ("WidgetExists");
+ enterSymbol (new SymbolEntry (this, 46, "RunPkgSelection", SymbolEntry::c_function, Type::fromSignature ("any (term)") ) );
+ _registered_functions.push_back ("RunPkgSelection");
+ enterSymbol (new SymbolEntry (this, 47, "AskForExistingDirectory", SymbolEntry::c_function, Type::fromSignature ("string (string, string)") ) );
+ _registered_functions.push_back ("AskForExistingDirectory");
+ enterSymbol (new SymbolEntry (this, 48, "AskForExistingFile", SymbolEntry::c_function, Type::fromSignature ("string (string, string, string)") ) );
+ _registered_functions.push_back ("AskForExistingFile");
+ enterSymbol (new SymbolEntry (this, 49, "AskForSaveFileName", SymbolEntry::c_function, Type::fromSignature ("string (string, string, string)") ) );
+ _registered_functions.push_back ("AskForSaveFileName");
+ enterSymbol (new SymbolEntry (this, 50, "SetFunctionKeys", SymbolEntry::c_function, Type::fromSignature ("void (map<string,integer>)") ) );
+ _registered_functions.push_back ("SetFunctionKeys");
+ enterSymbol (new SymbolEntry (this, 51, "Recode", SymbolEntry::c_function, Type::fromSignature ("any (string, string, string)") ) );
+ _registered_functions.push_back ("Recode");
+ enterSymbol (new SymbolEntry (this, 52, "SetModulename", SymbolEntry::c_function, Type::fromSignature ("void (string)") ) );
+ _registered_functions.push_back ("SetModulename");
+ enterSymbol (new SymbolEntry (this, 53, "HasSpecialWidget", SymbolEntry::c_function, Type::fromSignature ("boolean (symbol)") ) );
+ _registered_functions.push_back ("HasSpecialWidget");
+ enterSymbol (new SymbolEntry (this, 54, "WizardCommand", SymbolEntry::c_function, Type::fromSignature ("boolean (term)") ) );
+ _registered_functions.push_back ("WizardCommand");
Added: branches/tmp/sh/mod-ui/core/libyui/src/Y2CCUI.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/Y2CCUI.cc (added)
+++ branches/tmp/sh/mod-ui/core/libyui/src/Y2CCUI.cc Wed Sep 12 17:28:00 2007
@@ -0,0 +1,58 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: Y2CCUI.cc
+
+ Author: Stanislav Visnovsky <visnov(a)suse.cz>
+ Maintainer: Stanislav Visnovsky <visnov(a)suse.cz>
+
+/-*/
+/*
+ * Component Creator that executes access to UI
+ *
+ * Author: Stanislav Visnovsky <visnov(a)suse.cz>
+ */
+
+
+#include <ycp/y2log.h>
+#include <y2/Y2Component.h>
+#include "Y2CCUI.h"
+#include "YUIComponent.h"
+
+Y2Component* Y2CCDummyUI::provideNamespace(const char* name)
+{
+ y2debug ("UI library namespace provider tries for '%s'", name);
+ // implementation shortcut: we only provide the UI namsepace and the UI component
+ return create(name);
+}
+
+Y2Component* Y2CCDummyUI::create(const char* name) const
+{
+ if (strcmp (name, "UI") == 0)
+ {
+ Y2Component* ret = YUIComponent::uiComponent ();
+ if (ret == 0)
+ {
+ y2milestone ("Creating UI library component");
+ ret = new YUIComponent;
+ }
+
+ return ret;
+ }
+ else
+ {
+ return NULL;
+ }
+}
+
+// Create global variable to register this component creator
+Y2CCDummyUI g_y2ccUI;
Added: branches/tmp/sh/mod-ui/core/libyui/src/Y2CCUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/Y2CCUI.h (added)
+++ branches/tmp/sh/mod-ui/core/libyui/src/Y2CCUI.h Wed Sep 12 17:28:00 2007
@@ -0,0 +1,66 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: Y2CCUI.h
+
+ Author: Stanislav Visnovsky <visnov(a)suse.de>
+ Maintainer: Stanislav Visnovsky <visnov(a)suse.de>
+
+/-*/
+// -*- c++ -*-
+
+/*
+ * Component Creator that executes access to UI
+ *
+ * Author: Stanislav Visnovsky <visnov(a)suse.de>
+ */
+
+#ifndef Y2CCUI_h
+#define Y2CCUI_h
+
+#include <y2/Y2ComponentCreator.h>
+
+class Y2Component;
+
+class Y2CCUI : public Y2ComponentCreator
+{
+
+public:
+ Y2CCUI (Y2ComponentBroker::order_t order = Y2ComponentBroker::BUILTIN) : Y2ComponentCreator (order) {}
+
+ virtual bool isServerCreator () const { return true; };
+
+};
+
+// Have this class implement the UI interface for ycpc, where we need
+// only the type info and not the actual implementation.
+// But let it stand after the real UIs
+class Y2CCDummyUI : public Y2CCUI
+{
+
+public:
+ Y2CCDummyUI () : Y2CCUI (Y2ComponentBroker::PLUGIN) {}
+
+ /**
+ * We provide the UI component
+ */
+ virtual Y2Component *create(const char *name) const;
+
+ /**
+ * We provide the UI namespace
+ */
+ virtual Y2Component *provideNamespace(const char *name);
+
+};
+
+
+#endif // Y2CCUI_h
Added: branches/tmp/sh/mod-ui/core/libyui/src/Y2UINamespace.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/Y2UINamespace.cc (added)
+++ branches/tmp/sh/mod-ui/core/libyui/src/Y2UINamespace.cc Wed Sep 12 17:28:00 2007
@@ -0,0 +1,891 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: Y2UINamespace.cc
+
+ Authors: Klaus Kaempf <kkaempf(a)suse.de>
+ Stanislav Visnovsky <visnov(a)suse.cz>
+
+ Maintainer: Stefan Hundhammer <sh(a)suse.de>
+
+/-*/
+
+
+#include "ycp/YCPBoolean.h"
+#include "ycp/YCPInteger.h"
+#include "ycp/YCPVoid.h"
+#include "ycp/YCPString.h"
+#include "y2/Y2Function.h"
+
+#define y2log_component "ui"
+#include "ycp/y2log.h"
+
+#include "YUI.h"
+#include "YUIComponent.h"
+#include "Y2UINamespace.h"
+
+#define VERBOSE_NAMESPACE 0
+
+YCPValue
+Y2UINamespace::SetLanguage( const YCPString & language )
+{
+ if ( YUIComponent::ui() )
+ YUIComponent::ui()->evaluateSetLanguage( language );
+
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::SetLanguage( const YCPString & language, const YCPString & encoding )
+{
+ if ( YUIComponent::ui() )
+ YUIComponent::ui()->evaluateSetLanguage( language, encoding );
+
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::GetProductName()
+{
+ if ( YUIComponent::ui() )
+ return YUIComponent::ui()->evaluateGetProductName();
+ else
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::SetProductName( const YCPString & name )
+{
+ if ( YUIComponent::ui() )
+ YUIComponent::ui()->evaluateSetProductName( name );
+
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::SetConsoleFont( const YCPString & console_magic,
+ const YCPString & font,
+ const YCPString & screen_map,
+ const YCPString & unicode_map,
+ const YCPString & encoding )
+{
+ if ( YUIComponent::ui() )
+ YUIComponent::ui()->evaluateSetConsoleFont( console_magic,
+ font,
+ screen_map,
+ unicode_map,
+ encoding );
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::SetKeyboard()
+{
+ if ( YUIComponent::ui() )
+ YUIComponent::ui()->evaluateSetKeyboard();
+
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::GetLanguage( const YCPBoolean & strip )
+{
+ if ( YUIComponent::ui() )
+ return YUIComponent::ui()->evaluateGetLanguage( strip );
+ else
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::RunInTerminal( const YCPString &module )
+{
+ if (YUIComponent::ui() )
+ return YUIComponent::ui()->evaluateRunInTerminal( module );
+ else
+ return YCPVoid();
+}
+
+YCPValue
+Y2UINamespace::UserInput()
+{
+ return m_comp->ui()->evaluateUserInput();
+}
+
+
+YCPValue
+Y2UINamespace::PollInput()
+{
+ if ( YUIComponent::ui() )
+ return YUIComponent::ui()->evaluatePollInput();
+ else
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::TimeoutUserInput( const YCPInteger& timeout )
+{
+ if ( YUIComponent::ui() )
+ return YUIComponent::ui()->evaluateTimeoutUserInput( timeout );
+ else
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::WaitForEvent()
+{
+ if ( YUIComponent::ui() )
+ return YUIComponent::ui()->evaluateWaitForEvent();
+ else
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::WaitForEvent( const YCPInteger & timeout )
+{
+ if ( YUIComponent::ui() )
+ return YUIComponent::ui()->evaluateWaitForEvent( timeout );
+ else
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::OpenDialog( const YCPTerm & opts, const YCPTerm & dialog_term )
+{
+ if ( YUIComponent::ui() )
+ // Notice: Parameter order is switched!
+ return YUIComponent::ui()->evaluateOpenDialog( dialog_term, opts );
+ else
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::OpenDialog( const YCPTerm & dialog_term )
+{
+ return m_comp->ui()->evaluateOpenDialog( dialog_term );
+}
+
+
+YCPValue
+Y2UINamespace::CloseDialog()
+{
+ if ( YUIComponent::ui() )
+ return YUIComponent::ui()->evaluateCloseDialog();
+ else
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::ChangeWidget( const YCPSymbol & widget_id, const YCPSymbol & property, const YCPValue & new_value )
+{
+ if ( YUIComponent::ui() )
+ return YUIComponent::ui()->evaluateChangeWidget( widget_id, property, new_value );
+ else
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::ChangeWidget( const YCPTerm & widget_id, const YCPSymbol & property, const YCPValue & new_value )
+{
+ if ( YUIComponent::ui() )
+ return YUIComponent::ui()->evaluateChangeWidget( widget_id, property, new_value );
+ else
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::ChangeWidget( const YCPTerm & widget_id, const YCPTerm & property, const YCPValue & new_value )
+{
+ return ChangeWidget( widget_id, property, new_value );
+}
+
+
+YCPValue
+Y2UINamespace::QueryWidget( const YCPSymbol & widget_id, const YCPSymbol & property )
+{
+ if ( YUIComponent::ui() )
+ return YUIComponent::ui()->evaluateQueryWidget( widget_id, property );
+ else
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::QueryWidget( const YCPSymbol & widget_id, const YCPTerm & property )
+{
+ if ( YUIComponent::ui() )
+ return YUIComponent::ui()->evaluateQueryWidget( widget_id, property );
+ else
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::QueryWidget( const YCPTerm & widget_id, const YCPSymbol & property )
+{
+ if ( YUIComponent::ui() )
+ return YUIComponent::ui()->evaluateQueryWidget( widget_id, property );
+ else
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::QueryWidget( const YCPTerm & widget_id, const YCPTerm & property )
+{
+ if ( YUIComponent::ui() )
+ return YUIComponent::ui()->evaluateQueryWidget( widget_id, property );
+ else
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::ReplaceWidget( const YCPSymbol & widget_id, const YCPTerm & new_widget )
+{
+ if ( YUIComponent::ui() )
+ return YUIComponent::ui()->evaluateReplaceWidget( widget_id, new_widget );
+ else
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::ReplaceWidget( const YCPTerm & widget_id, const YCPTerm & new_widget )
+{
+ if ( YUIComponent::ui() )
+ return YUIComponent::ui()->evaluateReplaceWidget( widget_id, new_widget );
+ else
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::SetFocus( const YCPSymbol & widget_id )
+{
+ if ( YUIComponent::ui() )
+ return YUIComponent::ui()->evaluateSetFocus( widget_id );
+ else
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::SetFocus( const YCPTerm & widget_id )
+{
+ if ( YUIComponent::ui() )
+ return YUIComponent::ui()->evaluateSetFocus( widget_id );
+ else
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::BusyCursor()
+{
+ if ( YUIComponent::ui() )
+ YUIComponent::ui()->evaluateBusyCursor();
+
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::RedrawScreen()
+{
+ if ( YUIComponent::ui() )
+ YUIComponent::ui()->evaluateRedrawScreen();
+
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::NormalCursor()
+{
+ if ( YUIComponent::ui() )
+ YUIComponent::ui()->evaluateNormalCursor();
+
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::MakeScreenshot( const YCPString & filename )
+{
+ if ( YUIComponent::ui() )
+ YUIComponent::ui()->evaluateMakeScreenShot( filename );
+
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::MakeScreenshot()
+{
+ if ( YUIComponent::ui() )
+ return MakeScreenshot( YCPNull() );
+ else
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::DumpWidgetTree()
+{
+ if ( YUIComponent::ui() )
+ YUIComponent::ui()->evaluateDumpWidgetTree();
+
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::Beep()
+{
+ if ( YUIComponent::ui() )
+ YUIComponent::ui()->evaluateBeep();
+
+ return YCPVoid();
+}
+
+YCPValue
+Y2UINamespace::RecordMacro( const YCPString & filename )
+{
+ if ( YUIComponent::ui() )
+ YUIComponent::ui()->evaluateRecordMacro( filename );
+
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::StopRecordMacro()
+{
+ if ( YUIComponent::ui() )
+ YUIComponent::ui()->evaluateStopRecordMacro();
+
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::PlayMacro( const YCPString & filename )
+{
+ if ( YUIComponent::ui() )
+ YUIComponent::ui()->evaluatePlayMacro( filename );
+
+ return YCPVoid();
+}
+
+YCPValue
+Y2UINamespace::FakeUserInput()
+{
+ if ( YUIComponent::ui() )
+ YUIComponent::ui()->evaluateFakeUserInput( YCPVoid() );
+
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::FakeUserInput( const YCPValue & next_input )
+{
+ if ( YUIComponent::ui() )
+ YUIComponent::ui()->evaluateFakeUserInput( next_input );
+
+ return YCPVoid();
+}
+
+
+
+YCPValue
+Y2UINamespace::Glyph( const YCPSymbol & glyphSym )
+{
+ if ( YUIComponent::ui() )
+ return YUIComponent::ui()->evaluateGlyph( glyphSym );
+ else
+ return YCPString( "*" );
+}
+
+
+YCPValue
+Y2UINamespace::GetDisplayInfo()
+{
+ if ( YUIComponent::ui() )
+ return YUIComponent::ui()->evaluateGetDisplayInfo();
+ else
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::RecalcLayout()
+{
+ if ( YUIComponent::ui() )
+ YUIComponent::ui()->evaluateRecalcLayout();
+
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::PostponeShortcutCheck()
+{
+ if ( YUIComponent::ui() )
+ YUIComponent::ui()->evaluatePostponeShortcutCheck();
+
+ return YCPVoid();
+}
+
+YCPValue
+Y2UINamespace::CheckShortcuts()
+{
+ if ( YUIComponent::ui() )
+ YUIComponent::ui()->evaluateCheckShortcuts();
+
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::WidgetExists( const YCPSymbol & widget_id )
+{
+ if ( YUIComponent::ui() )
+ return YUIComponent::ui()->evaluateWidgetExists( widget_id );
+ else
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::WidgetExists( const YCPTerm & widget_id )
+{
+ if ( YUIComponent::ui() )
+ return YUIComponent::ui()->evaluateWidgetExists( widget_id );
+ else
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::RunPkgSelection( const YCPValue & widget_id )
+{
+ if ( YUIComponent::ui() )
+ return YUIComponent::ui()->evaluateRunPkgSelection( widget_id );
+ else
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::AskForExistingDirectory( const YCPString & startDir, const YCPString & headline )
+{
+ if ( YUIComponent::ui() )
+ return YUIComponent::ui()->evaluateAskForExistingDirectory( startDir, headline );
+ else
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::AskForExistingFile( const YCPString & startWith, const YCPString & filter, const YCPString & headline )
+{
+ if ( YUIComponent::ui() )
+ return YUIComponent::ui()->evaluateAskForExistingFile( startWith, filter, headline );
+ else
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::AskForSaveFileName( const YCPString & startWith, const YCPString & filter, const YCPString & headline )
+{
+ if ( YUIComponent::ui() )
+ return YUIComponent::ui()->evaluateAskForSaveFileName( startWith, filter, headline );
+ else
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::SetFunctionKeys( const YCPMap & new_fkeys )
+{
+ if ( YUIComponent::ui() )
+ YUIComponent::ui()->evaluateSetFunctionKeys( new_fkeys );
+
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::Recode( const YCPString & from, const YCPString & to, const YCPString & text )
+{
+ if ( YUIComponent::ui() )
+ return YUIComponent::ui()->evaluateRecode( from, to, text );
+ else
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::SetModulename( const YCPString & name )
+{
+ if ( YUIComponent::ui() )
+ YUIComponent::ui()->evaluateSetModulename( name );
+
+ return YCPVoid();
+}
+
+
+YCPValue
+Y2UINamespace::HasSpecialWidget( const YCPSymbol & widget )
+{
+ if ( YUIComponent::ui() )
+ return YUIComponent::ui()->evaluateHasSpecialWidget( widget );
+ else
+ return YCPBoolean( false );
+}
+
+
+YCPValue
+Y2UINamespace::WizardCommand( const YCPTerm & command )
+{
+ if ( YUIComponent::ui() )
+ return YUIComponent::ui()->evaluateWizardCommand( command );
+ else
+ return YCPBoolean( false );
+}
+
+
+YCPValue
+Y2UINamespace::CallHandler( void * ptr, int argc, YCPValue argv[] )
+{
+ if ( YUIComponent::uiComponent() )
+ {
+ return YUIComponent::uiComponent()->callBuiltin( ptr, argc, argv );
+ }
+ else
+ {
+ y2warning( "No UI instance available yet!" );
+ return YCPVoid();
+ }
+}
+
+// -------------
+
+Y2UIFunction::Y2UIFunction (Y2UINamespace* instance, YUIComponent* comp, unsigned int pos, bool play_macro_blocks) :
+m_position (pos)
+, m_instance (instance)
+, m_comp (comp)
+, m_play_macro_blocks (play_macro_blocks)
+, m_param1 ( YCPNull() )
+, m_param2 ( YCPNull() )
+, m_param3 ( YCPNull() )
+, m_param4 ( YCPNull() )
+, m_param5 ( YCPNull() )
+{
+};
+
+bool Y2UIFunction::attachParameter (const YCPValue& arg, const int position)
+{
+ switch (position)
+ {
+ case 0: m_param1 = arg; break;
+ case 1: m_param2 = arg; break;
+ case 2: m_param3 = arg; break;
+ case 3: m_param4 = arg; break;
+ case 4: m_param5 = arg; break;
+ default: return false;
+ }
+
+ return true;
+}
+
+constTypePtr Y2UIFunction::wantedParameterType() const
+{
+ // we do not help them with type conversion
+ // hey but we could, at least for non-overloaded functions
+ return Type::Any; // FIXME make this the default behavior in parent class
+}
+
+bool Y2UIFunction::appendParameter (const YCPValue& arg)
+{
+ if (m_param1.isNull())
+ {
+ m_param1 = arg;
+ return true;
+ } else if (m_param2.isNull())
+ {
+ m_param2 = arg;
+ return true;
+ } else if (m_param3.isNull())
+ {
+ m_param3 = arg;
+ return true;
+ } else if (m_param4.isNull())
+ {
+ m_param4 = arg;
+ return true;
+ } else if (m_param5.isNull())
+ {
+ m_param5 = arg;
+ return true;
+ }
+ y2internal ("appendParameter > 5 not implemented");
+ return false;
+}
+
+bool Y2UIFunction::finishParameters()
+{
+ // Aha, perl could give us any garbage.
+ // Hmm, how do we cope with giving garbage to ycp modules?
+ // - it heeds wantedParameterType
+ // Funny, why is this function not called?
+
+ y2internal ("FIXME finishParameters not implemented");
+ return true;
+}
+
+YCPValue Y2UIFunction::evaluateCall()
+{
+ if ( ! m_comp->ui() )
+ {
+ y2debug( "Late creation of UI instance" );
+ m_comp->createUI();
+ }
+
+ if ( ! m_comp->ui() )
+ return YCPVoid(); // dummy UI component
+
+ if ( m_play_macro_blocks && m_comp->ui()->playingMacro() )
+ {
+ m_comp->ui()->playNextMacroBlock();
+ }
+
+ YCPValue ret = YCPVoid();
+
+ if ( m_comp->ui()->runningWithThreads() )
+ {
+ m_comp->ui()->_builtinCallData.function = this;
+
+ m_comp->ui()->signalUIThread();
+
+ while ( ! m_comp->ui()->waitForUIThread() )
+ {
+ // NOP
+ }
+
+ ret = m_comp->ui()->_builtinCallData.result;
+ }
+ else
+ {
+ ret = evaluateCall_int();
+ }
+
+ return ret;
+}
+
+YCPValue Y2UIFunction::evaluateCall_int()
+{
+ switch (m_position) {
+#include "UIBuiltinCalls.h"
+ }
+
+ return YCPNull();
+}
+
+bool Y2UIFunction::reset()
+{
+ m_param1 = YCPNull();
+ m_param2 = YCPNull();
+ m_param3 = YCPNull();
+ m_param4 = YCPNull();
+ m_param5 = YCPNull();
+
+ return true;
+}
+
+string Y2UIFunction::name() const
+{
+ // FIXME. when is this called at all?
+ return("Y2UI");
+}
+
+// error reporting helper
+static
+void no_match (const char * name, constTypePtr type,
+ vector<SymbolEntryPtr>::iterator b,
+ vector<SymbolEntryPtr>::iterator e)
+{
+ y2error ("Function %s called with wrong type %s",
+ name, type->toString().c_str());
+ y2error ("TODO: display the candidates"); // use b and e
+}
+
+
+Y2UIOverloadedFunction::Y2UIOverloadedFunction (
+ Y2UINamespace* instance, YUIComponent* comp,
+ unsigned pos_offset,
+ vector<SymbolEntryPtr>::iterator candidates_b,
+ vector<SymbolEntryPtr>::iterator candidates_e,
+ bool play_macro_blocks) :
+ Y2UIFunction (instance, comp, pos_offset, play_macro_blocks),
+ m_candidates_b (candidates_b),
+ m_candidates_e (candidates_e)
+{
+ // still to do: m_position is just the first candidate
+}
+
+bool Y2UIOverloadedFunction::finishParameters()
+{
+ FunctionTypePtr real_tp = new FunctionType (Type::Unspec); //return type
+ if (!m_param1.isNull()) {
+ real_tp->concat (Type::vt2type (m_param1->valuetype()));
+ if (!m_param2.isNull()) {
+ real_tp->concat (Type::vt2type (m_param2->valuetype()));
+ if (!m_param3.isNull()) {
+ real_tp->concat (Type::vt2type (m_param3->valuetype()));
+ if (!m_param4.isNull()) {
+ real_tp->concat (Type::vt2type (m_param4->valuetype()));
+
+ if (!m_param5.isNull()) {
+ real_tp->concat (Type::vt2type (m_param5->valuetype()));
+ }
+ }
+ }
+ }
+ }
+ y2debug ("Actual type: %s", real_tp->toString().c_str());
+
+ vector<SymbolEntryPtr>::iterator
+ b = m_candidates_b,
+ e = m_candidates_e,
+ it;
+
+ for (it = b; it != e; ++it) {
+ SymbolEntryPtr se_p = *it;
+ constFunctionTypePtr cand_type = se_p->type();
+ int m = real_tp->match (cand_type);
+ y2debug ("Candidate: %s MATCH: %d",
+ se_p->toString().c_str(), m);
+ if (m == 0)
+ break;
+ }
+
+ if (it == e) {
+ // any candidate has a good name. report actual used signature.
+ no_match ((*b)->name(), real_tp, b, e);
+ return false;
+ }
+ // found
+ m_position += (it - b);
+ return true;
+}
+
+/**
+ * Constructor.
+ */
+Y2UINamespace::Y2UINamespace (YUIComponent* comp)
+{
+ m_comp = comp;
+ registerFunctions();
+}
+
+/**
+ * Destructor.
+ */
+Y2UINamespace::~Y2UINamespace()
+{}
+
+Y2Function* Y2UINamespace::createFunctionCall (const string name, constFunctionTypePtr type)
+{
+#if VERBOSE_NAMESPACE
+ y2debug ("Creating function call for %s", name.c_str());
+ y2debug ("whose type is %s", type? type->toString().c_str() : "unknown");
+#endif
+
+ // overloading: functions with same name must be adjacent in m_symbols
+
+ symbols_t::iterator
+ b = m_symbols.begin(),
+ e = m_symbols.end(),
+ it = b;
+ SymbolEntryPtr p;
+
+ // 1: find start of range of overloaded functions
+ for ( ; it != e; it++)
+ {
+ p = (*it);
+ if ( p->name() == name )
+ break;
+ }
+
+ if (it == e)
+ {
+ y2error ("No such function %s", name.c_str());
+ return NULL;
+ }
+
+ bool play_macro_blocks = (name == "UserInput" || name == "TimeoutUserInput" || name == "WaitForEvent");
+
+ symbols_t::iterator rb = it;
+ // 2: find end of range of overloaded functions or the exact match
+ for ( ; it != e; it++)
+ {
+ p = (*it);
+ if ( p->name() != name )
+ break;
+ // type comparison, ugh, use match
+ if (type && p->type() == type)
+ {
+ // found exact match
+ // BTW, p->position() may change as we go, don't get confused.
+ // What matters is our own counting.
+ y2debug ("Found symbol '%s' @%d", p->toString().c_str(), p->position());
+ return new Y2UIFunction (this, m_comp, it - b, play_macro_blocks);
+ }
+ }
+ symbols_t::iterator re = it;
+ // [rb, re) have matching name
+
+ if (type)
+ {
+ // we have exhausted the candidates without finding a match
+ y2error ("Incompatible yast2-core?");
+ no_match (name.c_str(), type, rb, re);
+ return NULL;
+ }
+
+ y2debug ("overloaded %s, %u@%u", name.c_str(), re - rb, rb - b);
+ return new Y2UIOverloadedFunction (this, m_comp, rb - b, rb, re, play_macro_blocks);
+}
+
+void Y2UINamespace::registerFunctions()
+{
+#include "UIBuiltinTable.h"
+}
+
Added: branches/tmp/sh/mod-ui/core/libyui/src/Y2UINamespace.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/Y2UINamespace.h (added)
+++ branches/tmp/sh/mod-ui/core/libyui/src/Y2UINamespace.h Wed Sep 12 17:28:00 2007
@@ -0,0 +1,309 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: Y2UINamespace.h
+
+ Authors: Stanislav Visnovsky <visnov(a)suse.cz>
+
+ Maintainer: Stefan Hundhammer <sh(a)suse.de>
+
+/-*/
+
+
+#include <y2/Y2Namespace.h>
+#include <y2/Y2Function.h>
+#include "ycp/YCPBoolean.h"
+#include "ycp/YCPInteger.h"
+#include "ycp/YCPVoid.h"
+#include "ycp/YCPString.h"
+#include "ycp/YCPCode.h"
+#include "ycp/StaticDeclaration.h"
+
+#define y2log_component "ui"
+#include "ycp/y2log.h"
+
+#include "YUI.h"
+#include "YUIComponent.h"
+
+class Y2UINamespace;
+
+/**
+ * A call of a UI:: function
+ */
+class Y2UIFunction: public Y2Function
+{
+ protected:
+
+ unsigned int m_position;
+ Y2UINamespace* m_instance;
+ YUIComponent* m_comp;
+ bool m_play_macro_blocks;
+ YCPValue m_param1;
+ YCPValue m_param2;
+ YCPValue m_param3;
+ YCPValue m_param4;
+ YCPValue m_param5;
+ public:
+
+ Y2UIFunction (Y2UINamespace* instance, YUIComponent* comp, unsigned int pos, bool play_macro_blocks);
+
+ bool attachParameter (const YCPValue& arg, const int position);
+ constTypePtr wantedParameterType () const;
+ bool appendParameter (const YCPValue& arg);
+ bool finishParameters ();
+ YCPValue evaluateCall ();
+ YCPValue evaluateCall_int ();
+ bool reset ();
+ string name () const;
+};
+
+/**
+ * A call of a UI:: function where we don't know the signature beforehand
+ */
+class Y2UIOverloadedFunction: public Y2UIFunction
+{
+ /** A range of SymbolEntries with a matching name.
+ * We will eventually find the right one
+ */
+ vector<SymbolEntryPtr>::iterator m_candidates_b;
+ vector<SymbolEntryPtr>::iterator m_candidates_e;
+
+ public:
+ Y2UIOverloadedFunction (
+ Y2UINamespace* instance, YUIComponent* comp,
+ unsigned pos_offset,
+ vector<SymbolEntryPtr>::iterator candidates_b,
+ vector<SymbolEntryPtr>::iterator candidates_e,
+ bool play_macro_blocks);
+
+ // attachParameter, appendParameter, reset from parent: fine
+ // wantedParameterType from parent: kind of fine
+
+ //! the main job
+ bool finishParameters ();
+};
+
+class Y2UINamespace: public Y2Namespace
+{
+ private:
+ void registerFunctions ();
+
+ vector<string> _registered_functions;
+
+ YUIComponent* m_comp;
+
+ public:
+ /**
+ * Constructor.
+ */
+ Y2UINamespace (YUIComponent* comp);
+
+ /**
+ * Destructor.
+ */
+ virtual ~Y2UINamespace ();
+
+ virtual const string name () const
+ {
+ return "UI";
+ }
+
+ virtual const string filename () const
+ {
+ return "UI";
+ }
+
+ virtual string toString () const
+ {
+ return "// not possible toString";
+ }
+
+ virtual YCPValue evaluate (bool cse = false )
+ {
+ if (cse) return YCPNull ();
+ else return YCPVoid ();
+ }
+
+ virtual Y2Function* createFunctionCall (const string name, constFunctionTypePtr type);
+
+ /* TYPEINFO: void (string) */
+ YCPValue SetLanguage ( const YCPString & language );
+
+ /* TYPEINFO: void (string, string) */
+ YCPValue SetLanguage ( const YCPString & language, const YCPString & encoding );
+
+ /* TYPEINFO: string () */
+ YCPValue GetProductName ();
+
+ /* TYPEINFO: void (string) */
+ YCPValue SetProductName ( const YCPString & name );
+
+ /* TYPEINFO: void (string, string, string, string, string) */
+ YCPValue SetConsoleFont ( const YCPString & console_magic, const YCPString & font, const YCPString & screen_map, const YCPString & unicode_map, const YCPString & encoding );
+
+ /* TYPEINFO: void () */
+ YCPValue SetKeyboard ();
+
+ /* TYPEINFO: string (boolean) */
+ YCPValue GetLanguage ( const YCPBoolean & strip );
+
+ /* TYPEINFO: any() */
+ YCPValue UserInput();
+
+ /* TYPEINFO: any () */
+ YCPValue PollInput ();
+
+ /* TYPEINFO: any (integer) */
+ YCPValue TimeoutUserInput ( const YCPInteger& timeout );
+
+ /* TYPEINFO: map<string,any> () */
+ YCPValue WaitForEvent ();
+
+ /* TYPEINFO: map<string,any> (integer) */
+ YCPValue WaitForEvent( const YCPInteger & timeout );
+
+ /* TYPEINFO: void(term) */
+ YCPValue OpenDialog( const YCPTerm & dialog_term );
+
+ /* TYPEINFO: void(term,term) */
+ YCPValue OpenDialog( const YCPTerm & opts, const YCPTerm & dialog_term );
+
+ /* TYPEINFO: boolean() */
+ YCPValue CloseDialog();
+
+ // TODO DECL_NIL?
+ /* TYPEINFO: boolean (symbol, symbol, any) */
+ YCPValue ChangeWidget ( const YCPSymbol & widget_id, const YCPSymbol & property, const YCPValue & new_value );
+
+ // TODO DECL_NIL?
+ /* TYPEINFO: boolean (term, symbol, any) */
+ YCPValue ChangeWidget ( const YCPTerm & widget_id, const YCPSymbol & property, const YCPValue & new_value );
+
+ // TODO DECL_NIL?
+ /* TYPEINFO: boolean (term, term, any) */
+ YCPValue ChangeWidget ( const YCPTerm & widget_id, const YCPTerm & property, const YCPValue & new_value );
+
+ /* TYPEINFO: any (symbol, symbol) */
+ YCPValue QueryWidget ( const YCPSymbol & widget_id, const YCPSymbol & property );
+
+ /* TYPEINFO: any (symbol, term) */
+ YCPValue QueryWidget ( const YCPSymbol & widget_id, const YCPTerm & property );
+
+ /* TYPEINFO: any (term, symbol) */
+ YCPValue QueryWidget ( const YCPTerm & widget_id, const YCPSymbol & property );
+
+ /* TYPEINFO: any (term, term) */
+ YCPValue QueryWidget ( const YCPTerm & widget_id, const YCPTerm & property );
+
+ /* TYPEINFO: boolean (symbol, term) */
+ YCPValue ReplaceWidget ( const YCPSymbol & widget_id, const YCPTerm & new_widget );
+
+ /* TYPEINFO: boolean (term, term) */
+ YCPValue ReplaceWidget ( const YCPTerm & widget_id, const YCPTerm & new_widget );
+
+ /* TYPEINFO: boolean (symbol) */
+ YCPValue SetFocus ( const YCPSymbol & widget_id );
+
+ /* TYPEINFO: boolean (term) */
+ YCPValue SetFocus ( const YCPTerm & widget_id );
+
+ /* TYPEINFO: integer (string) */
+ YCPValue RunInTerminal ( const YCPString & command );
+
+ /* TYPEINFO: void () */
+ YCPValue BusyCursor ();
+
+ /* TYPEINFO: void () */
+ YCPValue RedrawScreen ();
+
+ /* TYPEINFO: void () */
+ YCPValue NormalCursor ();
+
+ /* TYPEINFO: void (string) */
+ YCPValue MakeScreenshot ( const YCPString & filename );
+
+ /* TYPEINFO: void () */
+ YCPValue MakeScreenshot ();
+
+ /* TYPEINFO: void () */
+ YCPValue DumpWidgetTree ();
+
+ /* TYPEINFO: void () */
+ YCPValue Beep ();
+
+ /* TYPEINFO: void (string) */
+ YCPValue RecordMacro ( const YCPString & filename );
+
+ /* TYPEINFO: void () */
+ YCPValue StopRecordMacro ();
+
+ /* TYPEINFO: void (string) */
+ YCPValue PlayMacro ( const YCPString & filename );
+
+ /* TYPEINFO: void () */
+ YCPValue FakeUserInput ();
+
+ /* TYPEINFO: void (any) */
+ YCPValue FakeUserInput ( const YCPValue & next_input );
+
+ /* TYPEINFO: string (symbol) */
+ YCPValue Glyph ( const YCPSymbol & glyphSym );
+
+ /* TYPEINFO: map<string,any> () */
+ YCPValue GetDisplayInfo ();
+
+ /* TYPEINFO: void () */
+ YCPValue RecalcLayout ();
+
+ /* TYPEINFO: void () */
+ YCPValue PostponeShortcutCheck ();
+
+ /* TYPEINFO: void () */
+ YCPValue CheckShortcuts ();
+
+ /* TYPEINFO: boolean (symbol) */
+ YCPValue WidgetExists ( const YCPSymbol & widget_id );
+
+ /* TYPEINFO: boolean (term) */
+ YCPValue WidgetExists ( const YCPTerm & widget_id );
+
+ /* TYPEINFO: any (term) */
+ YCPValue RunPkgSelection ( const YCPValue & widget_id );
+
+ /* TYPEINFO: string (string, string) */
+ YCPValue AskForExistingDirectory ( const YCPString & startDir, const YCPString & headline );
+
+ /* TYPEINFO: string (string, string, string) */
+ YCPValue AskForExistingFile ( const YCPString & startWith, const YCPString & filter, const YCPString & headline );
+
+ /* TYPEINFO: string (string, string, string) */
+ YCPValue AskForSaveFileName ( const YCPString & startWith, const YCPString & filter, const YCPString & headline );
+
+ /* TYPEINFO: void (map<string,integer>) */
+ YCPValue SetFunctionKeys ( const YCPMap & new_fkeys );
+
+ /* TYPEINFO: any (string, string, string) */
+ YCPValue Recode ( const YCPString & from, const YCPString & to, const YCPString & text );
+
+ /* TYPEINFO: void (string) */
+ YCPValue SetModulename ( const YCPString & name );
+
+ /* TYPEINFO: boolean (symbol) */
+ YCPValue HasSpecialWidget ( const YCPSymbol & widget );
+
+ /* TYPEINFO: boolean (term) */
+ YCPValue WizardCommand ( const YCPTerm & command );
+
+YCPValue
+CallHandler( void * ptr, int argc, YCPValue argv[] );
+
+};
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YUI.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YUI.h Wed Sep 12 17:28:00 2007
@@ -45,6 +45,7 @@
class YMacroPlayer;
class YMacroRecorder;
class Y2Component;
+class Y2UIFunction;
class YUIBuiltinCallData;
// FIXME: Obsolete
@@ -53,17 +54,14 @@
struct YUIBuiltinCallData
{
- void * function;
- int argc;
- YCPValue * argv;
- YCPValue result;
+ Y2UIFunction * function;
+ YCPValue result;
YUIBuiltinCallData()
- : function(0)
- , argc(0)
- , argv(0)
- , result( YCPVoid() )
- {}
+ : result( YCPVoid() )
+ {
+ function = 0;
+ }
};
@@ -92,6 +90,7 @@
**/
YUI( bool with_threads );
+ friend class Y2UIFunction;
public:
@@ -262,11 +261,20 @@
static void setReverseLayout( bool rev ) { _reverseLayout = rev; }
/**
+ * Running with threads?
+ **/
+ bool runningWithThreads() const { return with_threads; }
+
+ /**
* Call a UI builtin function in the correct thread (the UI thread).
* This is called from libycp/YExpression via the UI builtin declarations
* that call UICallHandler.
**/
- YCPValue callBuiltin( void * function, int argc, YCPValue argv[] );
+ YCPValue callBuiltin( void * /*function*/, int /*argc*/, YCPValue /*argv*/[] )
+ {
+ // FIXME dummy UI?
+ return YCPNull();
+ }
/**
* Call 'function' with 'argc' YCPValue parameters and return the result of
@@ -652,7 +660,7 @@
* Use this to post-initialize widget stuff that cannot be upon creating
* the PackageSelector.
**/
- virtual YCPValue runPkgSelection( YWidget * packageSelector ) { return YCPVoid(); }
+ virtual YCPValue runPkgSelection( YWidget * /*packageSelector*/ ) { return YCPVoid(); }
/**
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUIComponent.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YUIComponent.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YUIComponent.cc Wed Sep 12 17:28:00 2007
@@ -25,6 +25,7 @@
#include <ycp/YCPVoid.h>
#include "YUIComponent.h"
+#include "Y2UINamespace.h"
#include "YUI.h"
@@ -41,13 +42,16 @@
_macro_file = 0;
_with_threads = false;
_have_server_options = false;
+ _namespace = NULL;
if ( _uiComponent )
{
- y2error( "Can't create multiple instances of UI component!" );
- return;
+ y2error( "Can't create multiple instances of UI component! (existing '%s', requested '%s')"
+ , _uiComponent->name ().c_str(), this->name ().c_str ());
+ return;
}
-
+
+ y2debug ("Setting UI component to '%s'", name().c_str());
_uiComponent = this;
}
@@ -65,6 +69,23 @@
}
+Y2Namespace *YUIComponent::import (const char* name)
+{
+ y2debug ("%s trying to import %s", this->name().c_str(), name);
+ if ( strcmp (name, "UI") == 0)
+ {
+ if (_namespace == NULL)
+ {
+ _namespace = new Y2UINamespace(this);
+ y2debug ("Namespace created %p", _namespace);
+ }
+
+ return _namespace;
+ }
+
+ return NULL;
+}
+
void YUIComponent::createUI()
{
if ( ! _have_server_options )
@@ -140,7 +161,7 @@
}
-void YUIComponent::result( const YCPValue & result )
+void YUIComponent::result( const YCPValue & /*result*/ )
{
if ( _ui )
delete _ui;
@@ -165,4 +186,12 @@
}
+YUI * YUIComponent::createUI( int /*argc*/, char ** /*argv*/, bool /*with_threads*/, const char * /*macro_file*/ )
+{
+ // This component can be instantiated for compilation purposes
+ // but it cannot evaluate the code.
+ y2debug ("Cannot create generic UI");
+ return 0;
+}
+
// EOF
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUIComponent.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YUIComponent.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YUIComponent.h Wed Sep 12 17:28:00 2007
@@ -25,6 +25,7 @@
class YUI;
+class Y2Namespace;
/**
* @short abstract base class for YaST2 user interface components.
@@ -32,7 +33,7 @@
**/
class YUIComponent : public Y2Component
{
-protected:
+public:
/**
* Constructor.
**/
@@ -43,6 +44,7 @@
**/
virtual ~YUIComponent();
+protected:
/**
* Create the UI. This is called when all the information for doing that is
* complete, in setServerOptions().
@@ -50,10 +52,12 @@
*
* Implement this method in derived classes.
**/
- virtual YUI * createUI( int argc, char **argv, bool with_threads, const char * macro_file ) = 0;
+ virtual YUI * createUI( int argc, char **argv, bool with_threads, const char * macro_file );
public:
+ virtual Y2Namespace *import (const char* name);
+
/**
* Returns the instance of the UI component 0 if none has been created yet.
**/
@@ -115,6 +119,7 @@
static YUI * _ui;
static YUIComponent * _uiComponent;
+ Y2Namespace * _namespace;
int _argc;
char ** _argv;
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUI_core.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YUI_core.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YUI_core.cc Wed Sep 12 17:28:00 2007
@@ -33,6 +33,7 @@
#include <ycp/y2log.h>
#include <ycp/YCPVoid.h>
+#include "Y2UINamespace.h"
#include "YUI.h"
#include "YUISymbols.h"
#include "YWidget.h"
@@ -209,45 +210,6 @@
extern YCPValue UIWaitForEventTimeout( const YCPInteger & timeout );
-YCPValue YUI::callBuiltin( void * function, int argc, YCPValue argv[] )
-{
- YCPValue ret = YCPVoid();
-
- if ( macroPlayer )
- {
- if ( function == UIUserInput ||
- function == UITimeoutUserInput ||
- function == UIWaitForEvent ||
- function == UIWaitForEventTimeout )
- {
- playNextMacroBlock ();
- }
- }
-
- if ( with_threads )
- {
- _builtinCallData.function = function;
- _builtinCallData.argc = argc;
- _builtinCallData.argv = argv;
-
- signalUIThread();
-
- while ( ! waitForUIThread() )
- {
- // NOP
- }
-
- ret = _builtinCallData.result;
- }
- else
- {
- ret = callFunction( function, argc, argv );
- }
-
- return ret;
-}
-
-
YCPValue YUI::callFunction( void * function, int argc, YCPValue argv[] )
{
if ( function == 0 )
@@ -395,11 +357,8 @@
if ( terminate_ui_thread )
return;
- // callFunction() checks for NULL function pointers
+ _builtinCallData.result = _builtinCallData.function->evaluateCall_int();
- _builtinCallData.result = callFunction( _builtinCallData.function,
- _builtinCallData.argc,
- _builtinCallData.argv );
signalYCPThread();
}
}
Modified: branches/tmp/sh/mod-ui/core/wfm/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/wfm/src/Ma…
==============================================================================
--- branches/tmp/sh/mod-ui/core/wfm/src/Makefile.am (original)
+++ branches/tmp/sh/mod-ui/core/wfm/src/Makefile.am Wed Sep 12 17:28:00 2007
@@ -24,7 +24,7 @@
libpy2wfm_la_LDFLAGS = -version-info 2:0
libpy2wfm_la_LIBADD = \
../../scr/src/libpy2scr.la \
- ../../libyui/src/libyui.la \
+ ../../libyui/src/libpy2UI.la \
../../libscr/src/libscr.la \
../../libycp/src/libycp.la \
../../liby2/src/liby2.la \
Modified: branches/tmp/sh/mod-ui/core/wfm/src/Y2CCWFM.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/wfm/src/Y2…
==============================================================================
--- branches/tmp/sh/mod-ui/core/wfm/src/Y2CCWFM.cc (original)
+++ branches/tmp/sh/mod-ui/core/wfm/src/Y2CCWFM.cc Wed Sep 12 17:28:00 2007
@@ -45,7 +45,6 @@
#endif
#include <scr/SCR.h>
-#include <UI.h>
#include "WFM.h"
Y2CCWFM::Y2CCWFM()
@@ -59,7 +58,6 @@
// we can't do this in constructor, since it is called in static initialization
// and we can't control the order of initialization - it can crash
static SCR scr;
- static UI ui;
static WFM wfm;
}
Modified: branches/tmp/sh/mod-ui/core/wfm/src/Y2WFMComponent.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/wfm/src/Y2…
==============================================================================
--- branches/tmp/sh/mod-ui/core/wfm/src/Y2WFMComponent.cc (original)
+++ branches/tmp/sh/mod-ui/core/wfm/src/Y2WFMComponent.cc Wed Sep 12 17:28:00 2007
@@ -202,7 +202,7 @@
const char*
Y2WFMComponent::get_env_lang () const
{
- static char* names[] = { "LANGUAGE", "LC_ALL", "LC_MESSAGES", "LANG" };
+ static const char* names[] = { "LANGUAGE", "LC_ALL", "LC_MESSAGES", "LANG" };
for (size_t i = 0; i < sizeof (names)/sizeof (names[0]); i++)
{
Modified: branches/tmp/sh/mod-ui/core/wfm/testsuite/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/wfm/testsu…
==============================================================================
--- branches/tmp/sh/mod-ui/core/wfm/testsuite/Makefile.am (original)
+++ branches/tmp/sh/mod-ui/core/wfm/testsuite/Makefile.am Wed Sep 12 17:28:00 2007
@@ -24,7 +24,7 @@
runwfm_LDADD = \
../src/libpy2wfm.la \
- $(top_builddir)/libyui/src/libyui.la \
+ $(top_builddir)/libyui/src/libpy2UI.la \
$(top_builddir)/libscr/src/libscr.la \
$(top_builddir)/libycp/src/libycp.la \
$(top_builddir)/liby2/src/liby2.la \
@@ -33,7 +33,7 @@
runc_SOURCES = runc.cc
runc_LDFLAGS = -L$(libdir)
runc_LDADD = ../src/libpy2wfm.la \
- $(top_builddir)/libyui/src/libyui.la \
+ $(top_builddir)/libyui/src/libpy2UI.la \
$(top_builddir)/libscr/src/libscr.la \
$(top_builddir)/libycp/src/libycp.la \
$(top_builddir)/liby2/src/liby2.la \
Modified: branches/tmp/sh/mod-ui/core/wfm/testsuite/runc.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/wfm/testsu…
==============================================================================
--- branches/tmp/sh/mod-ui/core/wfm/testsuite/runc.cc (original)
+++ branches/tmp/sh/mod-ui/core/wfm/testsuite/runc.cc Wed Sep 12 17:28:00 2007
@@ -25,7 +25,6 @@
#include <y2/Y2Component.h>
#include <y2/Y2ComponentCreator.h>
-#include <UI.h>
#include <scr/SCR.h>
#include <WFM.h>
@@ -321,7 +320,6 @@
// initialize the buildins
WFM wfm;
SCR scr;
- UI ui;
for(;;)
{
Modified: branches/tmp/sh/mod-ui/ncurses/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/Mak…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/Makefile.am (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/Makefile.am Wed Sep 12 17:28:00 2007
@@ -5,24 +5,22 @@
SUBDIRS = pkg
AM_CXXFLAGS = -DY2LOG=\"ui-ncurses\" -DLOCALEDIR=\"${localedir}\"
-AM_LDFLAGS = -L$(libdir)
# plugin, libtool forces 'lib' prefix
plugin_LTLIBRARIES = libpy2ncurses.la
#noinst_LTLIBRARIES = liby2ncurses.la
libpy2ncurses_la_LDFLAGS = -version-info 2:0
-#liby2ncurses_la_LDFLAGS = -version-info 2:0
libpy2ncurses_la_LIBADD = \
- -L$(libdir) \
- -lyui \
+ -L$(plugindir) \
+ -lpy2UI \
-lncursesw -lpanelw
#libpy2ncurses_la_LIBADD = \
# -L$(libdir) \
# -Lpkg -lpy2ncurses_pkg \
-# -lyui \
+# -lpy2UI \
# -lncursesw -lpanelw
#liby2ncurses_la_LIBADD = $(libpy2ncurses_la_LIBADD)
@@ -172,7 +170,7 @@
# Y2CCNCursesUI.cc Y2CCNCursesUI.h \
# YNCursesComponent.h
-INCLUDES = -I$(srcdir)/pkg -I$(includedir) -I$(includedir)/yui -I$(includedir)/y2util/qt
+INCLUDES = -I$(srcdir)/pkg -I$(includedir) -I$(includedir)/yui -I$(includedir)/y2util/qt ${ZYPP_CFLAGS}
lang2encoding.cc: lang2encoding.tab
./lang2encoding.tab > lang2encoding.cc
Modified: branches/tmp/sh/mod-ui/ncurses/src/Y2CCNCursesUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/Y2C…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/Y2CCNCursesUI.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/Y2CCNCursesUI.h Wed Sep 12 17:28:00 2007
@@ -24,6 +24,7 @@
#include "YNCursesComponent.h"
#include <iosfwd>
+#include <yui/Y2CCUI.h>
#include "ycp/y2log.h"
@@ -34,13 +35,13 @@
* such a component - returns a newly created component of this
* type. The Y2CCNCursesUI can create components with the name "ncursesui".
*/
-class Y2CCNcursesUI : public Y2ComponentCreator
+class Y2CCNcursesUI : public Y2CCUI
{
public:
/**
* Creates a NCursesUI component creator
*/
- Y2CCNcursesUI() : Y2ComponentCreator(Y2ComponentBroker::BUILTIN) { };
+ Y2CCNcursesUI() : Y2CCUI() { };
/**
* Returns true, since the NCursesUI component is a
@@ -59,8 +60,13 @@
{
y2milestone( "Creating %s component", name );
if (!strcmp(name, "ncurses") ) {
- Y2Component* r = new YNCursesComponent();
- return r;
+ Y2Component* ret = YUIComponent::uiComponent ();
+ if (!ret || ret->name () != name)
+ {
+ y2debug ("UI component is %s, creating %s", ret? ret->name().c_str() : "NULL", name);
+ ret = new YNCursesComponent();
+ }
+ return ret;
}
else return 0;
}
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/Makefile.am (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/Makefile.am Wed Sep 12 17:28:00 2007
@@ -13,8 +13,8 @@
plugin_LTLIBRARIES = libpy2ncurses_pkg.la
libpy2ncurses_pkg_la_LDFLAGS = -version-info 2:0
-libpy2ncurses_pkg_la_LIBADD = \
- -L$(libdir) -lyui \
+libpy2ncurses_pkg_la_LIBADD = \
+ -L$(plugindir) -lpy2UI \
${ZYPP_LIBS}
noinst_HEADERS = \
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc Wed Sep 12 17:28:00 2007
@@ -3047,7 +3047,8 @@
zypp::ByteCount diff = 0;
for (it = b; it != e; ++it)
{
- UIMIL << *it << endl;
+#warning gcc complains here - disabled milestone logging for now
+ // UIMIL << *it << endl;
diff += (it->pkg_size - it->used_size) * 1024;
}
Modified: branches/tmp/sh/mod-ui/ncurses/testsuite/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/testsui…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/testsuite/Makefile.am (original)
+++ branches/tmp/sh/mod-ui/ncurses/testsuite/Makefile.am Wed Sep 12 17:28:00 2007
@@ -14,7 +14,7 @@
runcurses_SOURCES = runcurses.cc
runcurses_LDADD = ../src/libpy2ncurses.la ../src/pkg/libpy2ncurses_pkg.la \
- -lncurses -lpanel -lpthread -ly2 -lyui -lycp -lutil
+ -lncurses -lpanel -lpthread -ly2 -L$(plugindir) -lpy2UI -lycp -lutil
runcurses_LDFLAGS = -L$(libdir) \
-Xlinker --whole-archive \
@@ -26,15 +26,15 @@
NCstring_test.h NCstring_test.cc
utf8test_LDADD = ../src/libpy2ncurses.la ../src/pkg/libpy2ncurses_pkg.la \
- -lncursesw -lpanelw -lpthread -ly2 -lyui -lycp -lutil
+ -lncursesw -lpanelw -lpthread -ly2 -L$(plugindir) -lpy2UI -lycp -lutil
in_wch_SOURCES = in_wch.cc
-#in_wch_LDADD = -lncursesw -lpanelw -lpthread -ly2 -lyui -lycp -lutil
+#in_wch_LDADD = -lncursesw -lpanelw -lpthread -ly2 -lpy2UI -lycp -lutil
in_wch_LDADD = -lncursesw
y2ncurses_SOURCES = y2ncurses.cc
-y2ncurses_LDADD = -lncurses -lpanel -lpthread -ly2 -lyui -lycp \
+y2ncurses_LDADD = -lncurses -lpanel -lpthread -ly2 -L$(plugindir) -lpy2UI -lycp \
-lutil
y2ncurses_LDFLAGS = -static -L$(libdir) \
Modified: branches/tmp/sh/mod-ui/qt/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/Makefile…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/Makefile.am (original)
+++ branches/tmp/sh/mod-ui/qt/src/Makefile.am Wed Sep 12 17:28:00 2007
@@ -30,13 +30,13 @@
libpy2qt_la_LDFLAGS = -version-info 2:0
libpy2qt_la_LIBADD = \
- -L$(libdir) -lyui \
+ -L$(plugindir) -lpy2UI \
-L$(QTLIBDIR) -lqt-mt \
-lX11 -lXext -lSM -lICE
# libpy2qt_la_LIBADD = \
# -Lpkg -ly2qt_pkg \
-# -L$(libdir) -lyui \
+# -L$(plugindir) -lpy2UI \
# -L$(QTLIBDIR) -lqt-mt \
# -lX11 -lXext -lSM -lICE
Modified: branches/tmp/sh/mod-ui/qt/src/Y2CCQt.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/Y2CCQt.h…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/Y2CCQt.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/Y2CCQt.h Wed Sep 12 17:28:00 2007
@@ -12,7 +12,8 @@
File: Y2CCQt.h
- Author: Stefan Hundhammer <sh(a)suse.de>
+ Author: Mathias Kettner <kettner(a)suse.de>
+ Maintainer: Stefan Hundhammer <sh(a)suse.de>
/-*/
@@ -22,6 +23,7 @@
#define _Y2CCQt_h
#include "YQUIComponent.h"
+#include <yui/Y2CCUI.h>
/**
* @short Y2ComponentCreator that can create Qt user interfaces
@@ -29,28 +31,35 @@
* It is given a component name and - if it knows how to create
* such a component - returns a newly created component of this
* type. The Y2CCQt can create components with the name "qt".
- **/
-class Y2CCQt : public Y2ComponentCreator
+ */
+class Y2CCQt : public Y2CCUI
{
public:
/**
* Creates a Qt component creator
- **/
- Y2CCQt() : Y2ComponentCreator(Y2ComponentBroker::BUILTIN) { };
+ */
+ Y2CCQt() : Y2CCUI() { };
/**
* Returns true, since the qt component is a
* YaST2 server.
- **/
+ */
bool isServerCreator() const { return true; };
/**
* Creates a new Qt UI component.
- **/
+ */
Y2Component *create(const char * name) const
{
if (!strcmp(name, "qt") )
- return new YQUIComponent();
+ {
+ Y2Component* ret = YUIComponent::uiComponent ();
+ if (!ret || ret->name () != name)
+ {
+ ret = new YQUIComponent();
+ }
+ return ret;
+ }
else
return 0;
}
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/Make…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/Makefile.am (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/Makefile.am Wed Sep 12 17:28:00 2007
@@ -23,7 +23,7 @@
libpy2qt_pkg_la_LDFLAGS = -version-info 2:0
libpy2qt_pkg_la_LIBADD = \
- -L$(libdir) -lyui \
+ -L$(plugindir) -lpy2UI \
-L$(QTLIBDIR) -lqt-mt \
-lX11 -lXext -lSM -lICE \
${ZYPP_LIBS}
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
12 Sep '07
Author: locilka
Date: Wed Sep 12 16:23:27 2007
New Revision: 40881
URL: http://svn.opensuse.org/viewcvs/yast?rev=40881&view=rev
Log:
Created tag stable-2_15_78 for packager
Added:
tags/stable-2_15_78/packager/
- copied from r40880, trunk/packager/
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
Author: locilka
Date: Wed Sep 12 16:23:22 2007
New Revision: 40880
URL: http://svn.opensuse.org/viewcvs/yast?rev=40880&view=rev
Log:
Created tag stable-2_15_78
Added:
tags/stable-2_15_78/
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r40879 - in /trunk/packager: VERSION agents/ag_xmlrepos package/yast2-packager.changes src/clients/inst_productsources.ycp
by locilka@svn.opensuse.org 12 Sep '07
by locilka@svn.opensuse.org 12 Sep '07
12 Sep '07
Author: locilka
Date: Wed Sep 12 16:21:36 2007
New Revision: 40879
URL: http://svn.opensuse.org/viewcvs/yast?rev=40879&view=rev
Log:
- Fixed evaluation of $short_language localization key in online
repositories.
- Adapted ag_xmlrepos to understand xml:lang="..." additionally to
lang="..." (both #299230).
- 2.15.78
Modified:
trunk/packager/VERSION
trunk/packager/agents/ag_xmlrepos
trunk/packager/package/yast2-packager.changes
trunk/packager/src/clients/inst_productsources.ycp
Modified: trunk/packager/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/VERSION?rev=40879&r1=40…
==============================================================================
--- trunk/packager/VERSION (original)
+++ trunk/packager/VERSION Wed Sep 12 16:21:36 2007
@@ -1 +1 @@
-2.15.77
+2.15.78
Modified: trunk/packager/agents/ag_xmlrepos
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/agents/ag_xmlrepos?rev=…
==============================================================================
--- trunk/packager/agents/ag_xmlrepos (original)
+++ trunk/packager/agents/ag_xmlrepos Wed Sep 12 16:21:36 2007
@@ -20,7 +20,7 @@
} elsif ($variable =~ /^HASH\(/) {
return [$variable];
} else {
- warn "Unknown: ".$variable."\n";
+ y2error ("Unknown: ".$variable);
return [];
}
}
@@ -141,7 +141,16 @@
my $variable_list = GetListFromVariable ($one_repo->{$key} || {});
foreach my $repo_keys (@{$variable_list}) {
- my $lang = $repo_keys->{'lang'}->{'value'} || $default_lang;
+ my $lang = "";
+
+ if (defined $repo_keys->{'lang'}->{'value'}) {
+ $lang = $repo_keys->{'lang'}->{'value'};
+ } elsif (defined $repo_keys->{'xml:lang'}->{'value'}) {
+ $lang = $repo_keys->{'xml:lang'}->{'value'};
+ } else {
+ $lang = $default_lang;
+ }
+
$this_repo->{'localized_'.$key}->{$lang} = $repo_keys->{'value'} || "";
}
Modified: trunk/packager/package/yast2-packager.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/package/yast2-packager.…
==============================================================================
--- trunk/packager/package/yast2-packager.changes (original)
+++ trunk/packager/package/yast2-packager.changes Wed Sep 12 16:21:36 2007
@@ -1,4 +1,13 @@
-------------------------------------------------------------------
+Wed Sep 12 16:16:08 CEST 2007 - locilka(a)suse.cz
+
+- Fixed evaluation of $short_language localization key in online
+ repositories.
+- Adapted ag_xmlrepos to understand xml:lang="..." additionally to
+ lang="..." (both #299230).
+- 2.15.78
+
+-------------------------------------------------------------------
Tue Sep 11 16:02:49 CEST 2007 - locilka(a)suse.cz
- Online repositories need to be added with unique alias (#309317).
Modified: trunk/packager/src/clients/inst_productsources.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/clients/inst_produc…
==============================================================================
--- trunk/packager/src/clients/inst_productsources.ycp (original)
+++ trunk/packager/src/clients/inst_productsources.ycp Wed Sep 12 16:21:36 2007
@@ -490,6 +490,9 @@
}
});
+ // just for debugging purposes
+ y2debug ("%1", list_of_repos);
+
return true;
}
@@ -609,9 +612,15 @@
language_long = GetCurrentLang ();
// fallback if no LANG variable set
- if (language_long == nil)
+ if (language_long == nil || language_long == "")
language_long = Language::language;
+ // de_DE.UTF-8 --> de_DE
+ integer dot_pos = search (language_long, ".");
+ if (dot_pos != nil) {
+ language_long = substring (language_long, 0, dot_pos);
+ }
+
if (language_long != nil) {
if (size(language_long) >= 2) {
language_short = substring (language_long, 0, 2);
@@ -679,6 +688,7 @@
string GetLocalizedString (string current_id, list <string> possible_keys) {
string ret = "";
+ // try localized strings at first
foreach (string possible_key, possible_keys, {
string loc_key = sformat ("localized_%1", possible_key);
@@ -686,20 +696,18 @@
ret = list_of_repos[current_id, loc_key, language_long]:"";
break;
} else if (list_of_repos[current_id, loc_key, language_short]:"" != "") {
- ret = list_of_repos[current_id, loc_key, language_long]:"";
+ ret = list_of_repos[current_id, loc_key, language_short]:"";
break;
}
});
if (ret != "") return ret;
+ // try default strings
foreach (string possible_key, possible_keys, {
if (list_of_repos[current_id, possible_key]:"" != "") {
ret = list_of_repos[current_id, possible_key]:"";
break;
- } else if (list_of_repos[current_id, possible_key]:"" != "") {
- ret = list_of_repos[current_id, possible_key]:"";
- break;
}
});
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r40878 - in /branches/tmp/dmacvicar/jycp: ./ .classpath .project src/ src/ycp.g vendor/ vendor/antlrworks-1.1.3.jar vendor/gi-1.2.jar
by dmacvicar@svn.opensuse.org 12 Sep '07
by dmacvicar@svn.opensuse.org 12 Sep '07
12 Sep '07
Author: dmacvicar
Date: Wed Sep 12 16:14:41 2007
New Revision: 40878
URL: http://svn.opensuse.org/viewcvs/yast?rev=40878&view=rev
Log:
backup
Added:
branches/tmp/dmacvicar/jycp/
branches/tmp/dmacvicar/jycp/.classpath
branches/tmp/dmacvicar/jycp/.project
branches/tmp/dmacvicar/jycp/src/
branches/tmp/dmacvicar/jycp/src/ycp.g
branches/tmp/dmacvicar/jycp/vendor/
branches/tmp/dmacvicar/jycp/vendor/antlrworks-1.1.3.jar (with props)
branches/tmp/dmacvicar/jycp/vendor/gi-1.2.jar (with props)
Added: branches/tmp/dmacvicar/jycp/.classpath
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/jycp/.classpath…
==============================================================================
--- branches/tmp/dmacvicar/jycp/.classpath (added)
+++ branches/tmp/dmacvicar/jycp/.classpath Wed Sep 12 16:14:41 2007
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: branches/tmp/dmacvicar/jycp/.project
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/jycp/.project?r…
==============================================================================
--- branches/tmp/dmacvicar/jycp/.project (added)
+++ branches/tmp/dmacvicar/jycp/.project Wed Sep 12 16:14:41 2007
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jycp</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: branches/tmp/dmacvicar/jycp/src/ycp.g
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/jycp/src/ycp.g?…
==============================================================================
--- branches/tmp/dmacvicar/jycp/src/ycp.g (added)
+++ branches/tmp/dmacvicar/jycp/src/ycp.g Wed Sep 12 16:14:41 2007
@@ -0,0 +1,544 @@
+
+grammar ycp;
+options {k=2; backtrack=true; memoize=true;}
+
+@lexer::members {
+protected boolean enumIsKeyword = true;
+}
+
+/* Expressions */
+
+ /*
+ * EXPRESSION vs BLOCK: type
+ * An important difference between a block and an expression is that
+ * block's type is determined (!= isUnspec) only if it has an explicit
+ * "return". It is then used for detecting type-mismatched return
+ * statements, among other things. As a consequence, all statements
+ * except return must have an undetermined type (Type::Unspec).
+ * Do not confuse Type::Unspec with Type::Void.
+ */
+ /* expressions are either 'compact' (with a defined end-token, no lookahead)
+ or 'infix' (which might need a lookahead token) */
+
+
+
+compact_expression:
+ block
+| LOOKUP '(' expression ',' expression ',' expression ')'
+| SELECT '(' expression ',' expression ',' expression ')'
+| function_call
+| '(' expression ')'
+| QUOTED_EXPRESSION expression ')'
+| IS '(' expression ',' type ')'
+| TEXTDOMAIN
+| I18N string ',' string ',' expression ')'
+| I18N string ')'
+| identifier
+
+| list
+| map
+| constant
+;
+
+infix_expression:
+ expression '+' expression
+| expression '-' expression
+| expression '*' expression
+| expression '/' expression
+| expression '%' expression
+| expression LEFT expression
+| expression RIGHT expression
+| expression '&' expression
+| expression '^' expression
+| expression '|' expression
+| '~' expression
+| expression AND expression
+| expression OR expression
+| expression EQUALS expression
+| expression '<' expression
+| expression '>' expression
+| expression LE expression
+| expression GE expression
+| expression NEQ expression
+| '!' expression
+//| '-' expression %prec UMINUS
+| expression '?' expression ':' expression
+;
+
+casted_expression:
+ '(' type ')' castable_expression
+;
+
+castable_expression:
+| compact_expression
+| casted_expression
+| bracket_expression
+;
+
+bracket_expression:
+ compact_expression '[' list_elements CLOSEBRACKET expression
+;
+
+expression:
+ compact_expression
+| casted_expression
+| infix_expression
+| bracket_expression
+;
+
+compilationUnit : expression;
+
+block:
+ '{'
+ block_end
+| QUOTED_BLOCK
+ block_end
+;
+
+block_end:
+ statements '}'
+;
+
+/* -------------------------------------------------------------- */
+/* Statements */
+/* statements are always inside a block, so p_parser->m_block_stack is valid ! */
+
+statements:
+ statements statement
+;
+
+statement:
+ ';'
+ {
+ $$.t = Type::Unspec; // empty statement is allowed
+ $$.c = 0;
+ }
+| SYM_NAMESPACE DCQUOTED_BLOCK
+| MODULE STRING ';'
+| INCLUDE STRING ';'
+| IMPORT STRING ';'
+| FULLNAME STRING ';'
+| TEXTDOMAIN STRING ';'
+| EXPORT identifier_list ';'
+| TYPEDEF type identifier ';'
+| definition
+| assignment ';'
+| function_call ';'
+| block
+| control_statement
+| CASE expression ':'
+| DEFAULT ':'
+;
+
+control_statement:
+ IF '(' expression ')' statement opt_else
+| WHILE '(' expression ')'
+ statement
+| DO
+ block
+ WHILE '(' expression ')' ';'
+| REPEAT
+ block
+ UNTIL '(' expression ')' ';'
+| BREAK ';'
+| CONTINUE ';'
+| RETURN ';'
+| RETURN expression ';'
+| SWITCH '(' expression ')'
+ block
+;
+
+opt_else:
+ ELSE statement
+| /* empty */
+;
+
+/* -------------------------------------------------------------- */
+/* types */
+
+type:
+ C_TYPE // type ($$.t) is set by scanner
+ // C_TYPE includes already expanded typedefs
+| LIST
+| LIST '<' type_gt
+| MAP
+| MAP '<' type ',' type_gt
+| BLOCK '<' type_gt
+| CONST type
+| type '&'
+| type '(' ')'
+| type '(' types ')'
+;
+
+/* recognize "type >" vs "type >>" */
+type_gt:
+ type '>'
+| type RIGHT
+;
+
+types:
+ type
+| types ',' type
+;
+/* -------------------------------------------------------------- */
+/* Macro/Function or variable definition */
+
+/*
+
+ */
+definition:
+ opt_global DEFINE identifier '('
+| function_start ';' /* function declaration */
+| function_start block /* function definition */
+| opt_global_identifier '=' expression ';' /* variable definition */
+;
+
+
+/*------------------------------------------------------
+ function definition start
+ [global] [define] type identifier '(' [type identifier]* ')
+
+ enter function type+identifier to local/global symbol
+ table.
+ Enter (list of) formal parameters type+symbol to
+ private symbol table to have them available when
+ parsing the (perhaps following) definition block.
+
+ $$.c = YFunction
+ $$.v.tval = TableEntry() (->sentry->code() == YFunction
+ $$.t = declared_return_type for current block
+ $$.l = symbol definition line
+*/
+
+function_start:
+ opt_global_identifier '(' tupletypes ')'
+;
+
+/*--------------------------------------------------------------
+ identifier, optionally prepended by 'global' or
+ 'define' or 'global define'
+ $$.v.tval == entry
+ $$.t = type
+ $$.l = line of identifier
+*/
+
+opt_global_identifier:
+ opt_global opt_define type identifier
+;
+
+opt_global:
+ GLOBAL
+ |
+;
+
+opt_define:
+ DEFINE
+|
+;
+
+/*----------------------------------------------*/
+/* zero or more formal parameters */
+/* $$.c = undef */
+/* $$.t = Type::Unspec if error, any valid type otherwise */
+/* $$.v.fpval = pointer to formalparam_t chain */
+
+tupletypes:
+ /* empty */
+ {
+ $$.v.val = 0;
+ $$.t = Type::Void;
+ }
+| tupletype
+;
+
+/*----------------------------------------------*/
+/* one or more formal parameters */
+/* $$.v.fpval = pointer to formalparam_t chain */
+
+tupletype:
+ formal_param
+| tupletype ',' formal_param
+;
+
+/*----------------------------------------------*/
+/* single formal function parameter */
+/* $$.v.fpval = pointer to formalparam_t */
+
+formal_param:
+ type identifier
+;
+/* -------------------------------------------------------------- */
+/* Assignment */
+
+assignment:
+ identifier '=' expression
+| identifier '[' list_elements ']' '=' expression
+;
+
+/* ----------------------------------------------------------*/
+
+/* allow multi line strings */
+string:
+ STRING
+| string STRING
+;
+
+constant:
+ C_VOID
+| C_BOOLEAN
+| C_INTEGER
+| C_FLOAT
+| STRING /* can't use 'string' here, because it needs lookahead and hence is no 'compact'_expression */
+| C_BYTEBLOCK
+| C_PATH
+| C_SYMBOL
+;
+
+/* -------------------------------------------------------------- */
+/* List expressions */
+
+list:
+ '[' ']'
+| '[' list_elements opt_comma ']'
+;
+
+list_elements:
+ expression
+| list_elements ',' expression
+;
+
+ /* optional comma */
+opt_comma:
+ ','
+|
+;
+
+/* -------------------------------------------------------------- */
+/* Map expressions */
+
+map:
+ MAPEXPR ']' /* empty map */
+| MAPEXPR map_elements opt_comma ']'
+;
+
+map_elements:
+ expression ':' expression
+| map_elements ',' expression ':' expression
+;
+
+/* -------------------------------------------------------------- */
+/*
+ Function call
+
+ initial parse of 'term_name (' triggers first type checking
+ and lookup of term_name so parameters can be checked against
+ prototype.
+
+ function_call: term_name[$1] '('[2] {lookup prototype}[$3] parameters[$4] ')'[$5] {check parameters}
+
+*/
+
+function_call:
+ function_name '('
+ parameters ')'
+;
+
+/*
+ function call parameters
+
+ attach parameters directly to function, thereby using the type information
+ from the function in deciding how to treat parameters.
+
+ since we're using the $0 feature of bison here, we can't
+ split up this BNF further :-(
+
+ $0 refers to $3 of the 'function_call' rule, ie $0.c is the function (one of 4 kinds)
+
+ return $$.t == 0 on error, $$.c == 0 if empty
+ */
+
+parameters:
+ /* empty */
+| type identifier
+| expression
+| parameters ',' type identifier
+| parameters ',' expression
+;
+
+/* -------------------------------------------------------------- */
+/*
+ function name
+
+ might be a known identifier (normal function call)
+ or a symbol constant (YCP Term)
+
+/* -> $$.v.tval == TableEntry if symbol already declared ($$.t != Type::Unspec)
+ $$.v.nval == charptr if symbol undefined ($$.t == Type::Unspec)
+ $$.t = Type::Unspec for SYMBOL, "|" for builtin, else type
+ */
+
+function_name:
+ identifier
+| C_SYMBOL
+;
+
+/* -------------------------------------------------------------- */
+/* Identifiers (KNOWN and UNKNOWN symbols) */
+/* -> $$.v.tval == TableEntry if symbol already declared ($$.t != Type::Unspec)
+ $$.v.nval == charptr if symbol undefined ($$.t == Type::Unspec)
+ $$.t = Type::Unspec for SYMBOL, "|" for builtin, else type
+ */
+
+identifier:
+ IDENTIFIER
+| SYMBOL
+;
+
+identifier_list:
+ identifier
+| identifier ',' identifier_list
+;
+/* ---------------------------------------------------------------------- */
+
+IDENTIFIER : ( '\u0041'..'\u005A'|'\u0061'..'\u007A' )
+ ( '\u005F'|'\u0030'..'\u0039'|'\u0041'..'\u005A'|'\u0061'..'\u007A' )*;
+
+LETTER : ('a'..'z' | 'A'..'Z');
+
+ODIGIT : ('0'..'7');
+DIGIT : ('0'..'9');
+HDIGIT : ('0'..'9' | 'a'..'f' | 'A'..'F' );
+
+ALPHA : LETTER+;
+ALNUM : ( LETTER | DIGIT )+;
+//PATHSEGMENT
+// : ([[:alpha:]_][[:alnum:]_-]*)|\"([^\\"]*(\\.)*)+\";
+PATHSEGMENT
+ : 'foo.bar.foo';
+
+HexLiteral : '0' ('x'|'X') HexDigit+ IntegerTypeSuffix? ;
+
+DecimalLiteral : ('0' | '1'..'9' '0'..'9'*) IntegerTypeSuffix? ;
+
+OctalLiteral : '0' ('0'..'7')+ IntegerTypeSuffix? ;
+
+fragment
+HexDigit : ('0'..'9'|'a'..'f'|'A'..'F') ;
+
+fragment
+IntegerTypeSuffix : ('l'|'L') ;
+
+FloatingPointLiteral
+ : ('0'..'9')+ '.' ('0'..'9')* Exponent? FloatTypeSuffix?
+ | '.' ('0'..'9')+ Exponent? FloatTypeSuffix?
+ | ('0'..'9')+ Exponent FloatTypeSuffix?
+ | ('0'..'9')+ Exponent? FloatTypeSuffix
+ ;
+
+fragment
+Exponent : ('e'|'E') ('+'|'-')? ('0'..'9')+ ;
+
+fragment
+FloatTypeSuffix : ('f'|'F'|'d'|'D') ;
+
+CharacterLiteral
+ : '\'' ( EscapeSequence | ~('\''|'\\') ) '\''
+ ;
+
+StringLiteral
+ : '"' ( EscapeSequence | ~('\\'|'"') )* '"'
+ ;
+
+fragment
+EscapeSequence
+ : '\\' ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\')
+ | UnicodeEscape
+ | OctalEscape
+ ;
+
+fragment
+OctalEscape
+ : '\\' ('0'..'3') ('0'..'7') ('0'..'7')
+ | '\\' ('0'..'7') ('0'..'7')
+ | '\\' ('0'..'7')
+ ;
+
+fragment
+UnicodeEscape
+ : '\\' 'u' HexDigit HexDigit HexDigit HexDigit
+ ;
+
+//SYMBOL : ([[:alpha:]_][[:alnum:]_]+|[[:alpha:]][[:alnum:]_]*);
+SYMBOL : ( (( ALPHA | '_' )( ALNUM | '_' )+) | (( ALPHA )( ALNUM | '_' )+) );
+
+AND : '&&';
+OR : '||';
+LEFT : '<<';
+RIGHT : '>>';
+MAPEXPR : '$[';
+LE : '<=';
+GE : '>=';
+EQUALS : '==';
+NEQ : '!=';
+CLOSEBRACKET
+ : ']';
+I18N : '_(';
+
+TRUE : 'true';
+FALSE : 'false';
+
+IF : 'if';
+ELSE : 'else';
+WHILE : 'while';
+DO : 'do';
+REPEAT : 'repeat';
+UNTIL : 'until';
+BREAK : 'break';
+CONTINUE: 'continue';
+RETURN : 'return';
+SWITCH : 'switch';
+DEFAULT : 'default';
+CASE : 'case';
+LOOKUP : 'lookup';
+TYPEDEF : 'typedef';
+CONST : 'const';
+GLOBAL : 'global';
+DEFINE : 'define';
+SELECT : 'select';
+LIST : 'list';
+MAP : 'map';
+BLOCK : 'block';
+MODULE : 'module';
+IMPORT : 'import';
+INCLUDE : 'include';
+FULLNAME : 'fullname';
+UMINUS : 'uminus';
+TEXTDOMAIN
+ : 'testdomain';
+EXPORT : 'export';
+SYM_NAMESPACE : 'namespace';
+
+C_TYPE : C_VOID|C_BOOLEAN|C_INTEGER|C_FLOAT|C_BYTEBLOCK|C_PATH|C_SYMBOL;
+
+C_VOID : 'nil';
+C_BOOLEAN
+ : TRUE | FALSE;
+C_INTEGER
+ :
+ DecimalLiteral;
+C_FLOAT: FloatingPointLiteral;
+STRING : StringLiteral;
+C_BYTEBLOCK
+ : 'abyteblock';
+C_PATH : 'acpath';
+C_SYMBOL: '`' SYMBOL;
+
+DCQUOTED_BLOCK
+ : '::``{' | '::{';
+QUOTED_BLOCK
+ : '``{';
+QUOTED_EXPRESSION
+ : '``(';
+
+// \`\` { logError ("Lonely doubleqoute", LINE_VAR); return SCANNER_ERROR; }
+// \` { logError ("Lonely qoute", LINE_VAR); return SCANNER_ERROR; }
Added: branches/tmp/dmacvicar/jycp/vendor/antlrworks-1.1.3.jar
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/jycp/vendor/ant…
==============================================================================
Binary file - no diff available.
Added: branches/tmp/dmacvicar/jycp/vendor/gi-1.2.jar
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/jycp/vendor/gi-…
==============================================================================
Binary file - no diff available.
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0