| C T L _ O P E N C O N S C R E E N ( )
| | | | | SOURCE: qdev_autodocs.txt 1.163 (12/09/2014) English
AMIGA - CTL_#?
----------------------------------------------------------------------------
NAME
ctl_openconscreen() - Allows to open fullscreen con.
dialog.
SYNOPSIS
condata = ctl_openconscreen(cf);
struct ctl_csn_data *ctl_openconscreen(
struct ctl_csn_feed *);
FUNCTION
This function allows to open fullscreen console dialog.
INPUTS
cf - Feed structure, that is desc. in the header file.
RETURNS
Returns pointer to console struct. or NULL on failure.
BASES
SysBase, DOSBase, GfxBase, IntuitionBase,
[DiskfontBase], MathIeeeXXXXBasBase
NOTES
If the feed structure is filled with zeroes then this
function should be still successful!
Tolerated errors will be reflected in 'cf' and/or 'cd'.
Rejected fields will be NULL.
Important! Never pass 'cd->cd_cc[x].cc_con' directly
anywhere, you must duplicate it first! The easiest way
to do this is to call 'ctl_doconswitch()'.
Locking pens who exceed curr. palette is safe, it will
simply have no effect.
This function allows upto 4 consoles to be opened per
screen.
This function will initialize IDCMP that can only be
used through indexed handlers(see structures)! Never
call 'ModifyIDCMP(cd->cd_cc[x].cc_mainwin, 0)'! There
are special functions to control events.
SEE ALSO
ctl_closeconscreen(), ctl_addidcmphandler(),
ctl_remidcmphandler(), ctl_swapbackpen()
EXAMPLE
...
struct Screen *screen;
struct ctl_csn_feed cf;
struct ctl_csn_data *cd;
struct ctl_csh_data csh = {0, 0, 0};
struct ColorSpec colors[] = {
/*
* ANSI colors.
*/
{ 0, 0x0, 0x0, 0x0},
{ 1, 0xE, 0x0, 0x0},
{ 2, 0x0, 0xE, 0x0},
{ 3, 0xE, 0xE, 0x0},
{ 4, 0x0, 0x0, 0xE},
{ 5, 0xE, 0x0, 0xE},
{ 6, 0x0, 0xE, 0xE},
{ 7, 0xE, 0xE, 0xE},
/*
* Workbench alike colors(moved).
*/
{ 8, 0xA, 0xA, 0xA},
{ 9, 0x0, 0x0, 0x0},
{10, 0xF, 0xF, 0xF},
{11, 0x8, 0x6, 0xE},
/*
* Table terminator.
*/
{-1, 0, 0, 0}};
/*
* Default pen mappings(4+ bit screen is necessary
* for correct on screen layout).
*/
UWORD defdrimap[] = {8, 9, 9, 10, 9, 11, 10,
8, 10, 9, 10, 9, ~0};
QDEV_NFO_DRIMAPTYPEI(drimap);
void *bartrig;
memset(&cf, 0 , sizeof(struct ctl_csn_feed);
cf.cf_handler = "KCON://///JUMP";
cf.cf_depth = 4;
cf.cf_cs = colors;
/*
* Protect the palette in a depth independent manner.
* Lock first 12 and last 4 pens.
*/
cf.cf_lfirst = 12;
cf.cf_llast = 4;
/*
* Try to obtain pen mappings from Workbench.
*/
if (((screen = ctl_lockscreensafe(NULL))) &&
(nfo_getdrimap(drimap, screen)))
{
/*
* Relocate them to fit moved palette. Colors start
* at pen number 8 and the default pen mappings are
* generally using first 4 pens.
*/
ctl_relocdrimap(drimap, 8, cf.cf_depth);
cf.cf_drimap = drimap;
ctl_unlockscreensafe(screen);
}
else
{
cf.cf_drimap = defdrimap;
}
if ((cd = ctl_openconscreen(&cf)))
{
if ((bartrig = ctl_addbartrigger(cd)))
{
ctl_doconswitch(&csh, cd->cd_cc[0].cc_con);
if (cf.cf_handler == NULL)
{
FPrintf(cd->cd_con, "Warning, using the 'CON:'!\n");
}
Execute("", csh->ct_mewcon, NULL);
ctl_undoconswitch(&csh);
ctl_rembartrigger(bartrig);
}
ctl_closeconscreen(cd);
}
BUGS
None known.
----------------------------------------------------------------------------
| |
| |